d8cbcfaf by lihua

下载文件资源检查

1 parent c4d4ad6c
......@@ -6,7 +6,7 @@ pipeline {
SVN_FOLD = "fe-data-trusted-space-connector"
SSH_PATH = "js-match"
SVN_TYPE = "temp"
image_tag = "1.0.0-arm"
image_tag = "1.0.1-arm"
ip = "121.237.182.192:30002"
port = "59900"
vport = "80"
......
......@@ -60,6 +60,12 @@ export const downloadTableData = (params) => request({
responseType: 'blob'
});
/** 下载文件前的检查 */
export const downloadFileCheck = (params) => request({
url: `${import.meta.env.VITE_API_COMMON_URL}/contract-use/download-file?userGuid=${params.userGuid}&fileName=${params.fileName}`,
method: 'get'
});
/** 下载数据前的检查 */
export const downloadTableDataCheck = (params) => request({
url: `${import.meta.env.VITE_API_COMMON_URL}/contract-use/download-check?userGuid=${params.userGuid}&subjectGuid=${params.subjectGuid}`,
......
......@@ -32,7 +32,8 @@ import { TableColumnWidth } from '@/utils/enum';
import {
downloadTableData,
downloadTableDataCheck,
getContractStrategy
getContractStrategy,
downloadFileCheck
} from "@/api/modules/dataDelivery";
import StrategyTable from '../data_smart_contract/components/strategyTable.vue';
import { getDownFileSignByUrl, obsDownloadRequest, parseAndDecodeUrl } from '@/api/modules/obsService';
......@@ -477,6 +478,24 @@ const handleTableViewData = (scope) => {
});
}
/** 下载文件资源 */
const downloadFile = (productDetailItem) => {
if (foundMode.value == '1') {
onUploadFileDownload(productDetailItem);
} else {// 使用次数需要先调用
downloadFileCheck({
userGuid: route.query.useGuid,
fileName: productDetailItem
}).then((res: any) => {
if (res?.code == proxy.$passCode) {
onUploadFileDownload(productDetailItem);
} else {
ElMessage.error(res?.msg || '下载失败');
}
});
}
}
/** 下载数据 */
const handleTableViewDataDown = async (scope) => {
if (foundMode.value == 'download' || foundMode.value == 'readAndDown') {
......@@ -1493,13 +1512,13 @@ const respParamsTableInfo = ref({
</template>
<div class="file-name"><ellipsis-tooltip :content="productDetailItem.name ?? ''" class-name="w100f"
refName="tooltipOver"></ellipsis-tooltip></div>
<div
<!-- <div
v-if="foundMode != 'download' && ['pdf', 'png', 'jpg', 'jpeg'].includes(productDetailItem.name?.substring(productDetailItem.name.lastIndexOf('.') + 1).toLowerCase())"
:style="{ right: '36px' }" class="file-preview" @click="onUploadFilePreview(productDetailItem)">
查看
</div>
</div> -->
<div :style="{ right: '0px' }" class="file-preview" v-if="foundMode == 'download' || foundMode == 'readAndDown' || foundMode == '1'"
@click="onUploadFileDownload(productDetailItem)">下载</div>
@click="downloadFile">下载</div>
</div>
</span>
</span>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!