1e6c80d5 by lihua

下载数据前先调用检查接口

1 parent 02b8e6ac
...@@ -54,6 +54,12 @@ export const downloadTableData = (params) => request({ ...@@ -54,6 +54,12 @@ export const downloadTableData = (params) => request({
54 responseType: 'blob' 54 responseType: 'blob'
55 }); 55 });
56 56
57 /** 下载数据前的检查 */
58 export const downloadTableDataCheck = (params) => request({
59 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract-use/download-check?userGuid=${params.userGuid}&subjectGuid=${params.subjectGuid}`,
60 method: 'get'
61 });
62
57 /** 数据使用中查看资产表的数据 */ 63 /** 数据使用中查看资产表的数据 */
58 export const queryUseData = (params) => request({ 64 export const queryUseData = (params) => request({
59 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract-use/read?userGuid=${params.userGuid}&subjectGuid=${params.subjectGuid}`, 65 url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract-use/read?userGuid=${params.userGuid}&subjectGuid=${params.subjectGuid}`,
......
...@@ -29,7 +29,8 @@ import { onUploadFilePreview, onUploadFileDownload } from '@/api/modules/common' ...@@ -29,7 +29,8 @@ import { onUploadFilePreview, onUploadFileDownload } from '@/api/modules/common'
29 import useDataAssetStore from "@/store/modules/dataAsset"; 29 import useDataAssetStore from "@/store/modules/dataAsset";
30 import { TableColumnWidth } from '@/utils/enum'; 30 import { TableColumnWidth } from '@/utils/enum';
31 import { 31 import {
32 downloadTableData 32 downloadTableData,
33 downloadTableDataCheck
33 } from "@/api/modules/dataDelivery"; 34 } from "@/api/modules/dataDelivery";
34 35
35 const router = useRouter(); 36 const router = useRouter();
...@@ -336,9 +337,11 @@ const productTableInfo = ref({ ...@@ -336,9 +337,11 @@ const productTableInfo = ref({
336 fields: [ 337 fields: [
337 { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, 338 { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
338 { label: "服务名称", field: "apiName", width: 180 }, 339 { label: "服务名称", field: "apiName", width: 180 },
339 { label: "API类型", field: "apiType", width: 100, getName: (scope) => { 340 {
341 label: "API类型", field: "apiType", width: 100, getName: (scope) => {
340 return scope.row.apiType && apiTypes.find(a => a.value == scope.row.apiType)?.label; 342 return scope.row.apiType && apiTypes.find(a => a.value == scope.row.apiType)?.label;
341 } }, 343 }
344 },
342 { label: "API地址", field: "requestUrl", width: 240 }, 345 { label: "API地址", field: "requestUrl", width: 240 },
343 { label: "描述", field: "apiDescription", width: 240 }, 346 { label: "描述", field: "apiDescription", width: 240 },
344 ], 347 ],
...@@ -449,6 +452,11 @@ const handleTableViewData = (scope) => { ...@@ -449,6 +452,11 @@ const handleTableViewData = (scope) => {
449 452
450 /** 下载数据 */ 453 /** 下载数据 */
451 const handleTableViewDataDown = (scope) => { 454 const handleTableViewDataDown = (scope) => {
455 downloadTableDataCheck({
456 userGuid: route.query.useGuid,
457 subjectGuid: scope.row.guid
458 }).then((res: any) => {
459 if (res?.code == proxy.$passCode) {
452 downloadTableData({ 460 downloadTableData({
453 userGuid: route.query.useGuid, 461 userGuid: route.query.useGuid,
454 subjectGuid: scope.row.guid 462 subjectGuid: scope.row.guid
...@@ -459,6 +467,10 @@ const handleTableViewDataDown = (scope) => { ...@@ -459,6 +467,10 @@ const handleTableViewDataDown = (scope) => {
459 res?.msg && ElMessage.error(res?.msg); 467 res?.msg && ElMessage.error(res?.msg);
460 } 468 }
461 }) 469 })
470 } else {
471 ElMessage.error(res?.msg || '下载失败');
472 }
473 })
462 } 474 }
463 475
464 const toolBtns: any = computed(() => { 476 const toolBtns: any = computed(() => {
...@@ -1257,7 +1269,8 @@ const respParamsTableInfo = ref({ ...@@ -1257,7 +1269,8 @@ const respParamsTableInfo = ref({
1257 <div class="dataLabel" v-show="detailInfo.domainName">{{ detailInfo.domainName }}</div> 1269 <div class="dataLabel" v-show="detailInfo.domainName">{{ detailInfo.domainName }}</div>
1258 <div class="dataLabel dataLabel1" v-if="detailInfo.databaseType">{{ detailInfo.databaseType }}</div> 1270 <div class="dataLabel dataLabel1" v-if="detailInfo.databaseType">{{ detailInfo.databaseType }}</div>
1259 <div class="dataLabel dataLabel1">{{ detailInfo.dataSourcesName }}</div> 1271 <div class="dataLabel dataLabel1">{{ detailInfo.dataSourcesName }}</div>
1260 <div class="dataLabel dataLabel1" v-if="detailInfo.updateFrequency">{{ detailInfo.updateFrequencyName }}</div> 1272 <div class="dataLabel dataLabel1" v-if="detailInfo.updateFrequency">{{ detailInfo.updateFrequencyName }}
1273 </div>
1261 </div> 1274 </div>
1262 </div> 1275 </div>
1263 <!-- <template v-if="detailInfo?.foundMode == 1"> --> 1276 <!-- <template v-if="detailInfo?.foundMode == 1"> -->
...@@ -1310,8 +1323,9 @@ const respParamsTableInfo = ref({ ...@@ -1310,8 +1323,9 @@ const respParamsTableInfo = ref({
1310 </div> 1323 </div>
1311 <div class="list_item"> 1324 <div class="list_item">
1312 <span class="item_label">产品发布机构:</span> 1325 <span class="item_label">产品发布机构:</span>
1313 <span class="item_value"><ellipsis-tooltip :content="publicDataProductsMainRSVO?.productPublisherName || '--'" 1326 <span class="item_value"><ellipsis-tooltip
1314 class-name="w100f mr8-i" :refName="'tooltipOver' + 'productPublisherName'"></ellipsis-tooltip></span> 1327 :content="publicDataProductsMainRSVO?.productPublisherName || '--'" class-name="w100f mr8-i"
1328 :refName="'tooltipOver' + 'productPublisherName'"></ellipsis-tooltip></span>
1315 </div> 1329 </div>
1316 <div class="list_item"> 1330 <div class="list_item">
1317 <span class="item_label">领域:</span> 1331 <span class="item_label">领域:</span>
...@@ -1470,11 +1484,13 @@ const respParamsTableInfo = ref({ ...@@ -1470,11 +1484,13 @@ const respParamsTableInfo = ref({
1470 <span>{{ scope.row["updateTime"] || '--' }}</span> 1484 <span>{{ scope.row["updateTime"] || '--' }}</span>
1471 </template> 1485 </template>
1472 </el-table-column> 1486 </el-table-column>
1473 <el-table-column label="操作" v-if="!detailInfo.nodeId || foundMode == 'download' || foundMode == 'read'" width="220px" align="left" fixed="right" show-overflow-tooltip> 1487 <el-table-column label="操作" v-if="!detailInfo.nodeId || foundMode == 'download' || foundMode == 'read'"
1488 width="220px" align="left" fixed="right" show-overflow-tooltip>
1474 <template #default="scope"> 1489 <template #default="scope">
1475 <span class="text_btn" @click="handleTableViewData(scope)">查看样例数据</span> 1490 <span class="text_btn" @click="handleTableViewData(scope)">查看样例数据</span>
1476 <el-divider v-show="foundMode == 'download'" direction="vertical" /> 1491 <el-divider v-show="foundMode == 'download'" direction="vertical" />
1477 <span v-show="foundMode == 'download'" class="text_btn" @click="handleTableViewDataDown(scope)">下载数据</span> 1492 <span v-show="foundMode == 'download'" class="text_btn"
1493 @click="handleTableViewDataDown(scope)">下载数据</span>
1478 </template> 1494 </template>
1479 </el-table-column> 1495 </el-table-column>
1480 </el-table> 1496 </el-table>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!