下载数据前先调用检查接口
Showing
2 changed files
with
30 additions
and
8 deletions
| ... | @@ -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}`, | ... | ... |
| ... | @@ -30,7 +30,8 @@ import { CircleCloseFilled } from '@element-plus/icons-vue' | ... | @@ -30,7 +30,8 @@ import { CircleCloseFilled } from '@element-plus/icons-vue' |
| 30 | import useDataAssetStore from "@/store/modules/dataAsset"; | 30 | import useDataAssetStore from "@/store/modules/dataAsset"; |
| 31 | import { TableColumnWidth } from '@/utils/enum'; | 31 | import { TableColumnWidth } from '@/utils/enum'; |
| 32 | import { | 32 | import { |
| 33 | downloadTableData | 33 | downloadTableData, |
| 34 | downloadTableDataCheck | ||
| 34 | } from "@/api/modules/dataDelivery"; | 35 | } from "@/api/modules/dataDelivery"; |
| 35 | 36 | ||
| 36 | const router = useRouter(); | 37 | const router = useRouter(); |
| ... | @@ -337,9 +338,11 @@ const productTableInfo = ref({ | ... | @@ -337,9 +338,11 @@ const productTableInfo = ref({ |
| 337 | fields: [ | 338 | fields: [ |
| 338 | { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, | 339 | { label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" }, |
| 339 | { label: "服务名称", field: "apiName", width: 180 }, | 340 | { label: "服务名称", field: "apiName", width: 180 }, |
| 340 | { label: "API类型", field: "apiType", width: 100, getName: (scope) => { | 341 | { |
| 342 | label: "API类型", field: "apiType", width: 100, getName: (scope) => { | ||
| 341 | return scope.row.apiType && apiTypes.find(a => a.value == scope.row.apiType)?.label; | 343 | return scope.row.apiType && apiTypes.find(a => a.value == scope.row.apiType)?.label; |
| 342 | } }, | 344 | } |
| 345 | }, | ||
| 343 | { label: "API地址", field: "requestUrl", width: 240 }, | 346 | { label: "API地址", field: "requestUrl", width: 240 }, |
| 344 | { label: "描述", field: "apiDescription", width: 240 }, | 347 | { label: "描述", field: "apiDescription", width: 240 }, |
| 345 | ], | 348 | ], |
| ... | @@ -450,6 +453,11 @@ const handleTableViewData = (scope) => { | ... | @@ -450,6 +453,11 @@ const handleTableViewData = (scope) => { |
| 450 | 453 | ||
| 451 | /** 下载数据 */ | 454 | /** 下载数据 */ |
| 452 | const handleTableViewDataDown = (scope) => { | 455 | const handleTableViewDataDown = (scope) => { |
| 456 | downloadTableDataCheck({ | ||
| 457 | userGuid: route.query.useGuid, | ||
| 458 | subjectGuid: scope.row.guid | ||
| 459 | }).then((res: any) => { | ||
| 460 | if (res?.code == proxy.$passCode) { | ||
| 453 | downloadTableData({ | 461 | downloadTableData({ |
| 454 | userGuid: route.query.useGuid, | 462 | userGuid: route.query.useGuid, |
| 455 | subjectGuid: scope.row.guid | 463 | subjectGuid: scope.row.guid |
| ... | @@ -460,6 +468,10 @@ const handleTableViewDataDown = (scope) => { | ... | @@ -460,6 +468,10 @@ const handleTableViewDataDown = (scope) => { |
| 460 | res?.msg && ElMessage.error(res?.msg); | 468 | res?.msg && ElMessage.error(res?.msg); |
| 461 | } | 469 | } |
| 462 | }) | 470 | }) |
| 471 | } else { | ||
| 472 | ElMessage.error(res?.msg || '下载失败'); | ||
| 473 | } | ||
| 474 | }) | ||
| 463 | } | 475 | } |
| 464 | 476 | ||
| 465 | const toolBtns: any = computed(() => { | 477 | const toolBtns: any = computed(() => { |
| ... | @@ -1272,7 +1284,8 @@ const respParamsTableInfo = ref({ | ... | @@ -1272,7 +1284,8 @@ const respParamsTableInfo = ref({ |
| 1272 | <div class="dataLabel" v-show="detailInfo.domainName">{{ detailInfo.domainName }}</div> | 1284 | <div class="dataLabel" v-show="detailInfo.domainName">{{ detailInfo.domainName }}</div> |
| 1273 | <div class="dataLabel dataLabel1" v-if="detailInfo.databaseType">{{ detailInfo.databaseType }}</div> | 1285 | <div class="dataLabel dataLabel1" v-if="detailInfo.databaseType">{{ detailInfo.databaseType }}</div> |
| 1274 | <div class="dataLabel dataLabel1">{{ detailInfo.dataSourcesName }}</div> | 1286 | <div class="dataLabel dataLabel1">{{ detailInfo.dataSourcesName }}</div> |
| 1275 | <div class="dataLabel dataLabel1" v-if="detailInfo.updateFrequency">{{ detailInfo.updateFrequencyName }}</div> | 1287 | <div class="dataLabel dataLabel1" v-if="detailInfo.updateFrequency">{{ detailInfo.updateFrequencyName }} |
| 1288 | </div> | ||
| 1276 | </div> | 1289 | </div> |
| 1277 | </div> | 1290 | </div> |
| 1278 | <!-- <template v-if="detailInfo?.foundMode == 1"> --> | 1291 | <!-- <template v-if="detailInfo?.foundMode == 1"> --> |
| ... | @@ -1325,8 +1338,9 @@ const respParamsTableInfo = ref({ | ... | @@ -1325,8 +1338,9 @@ const respParamsTableInfo = ref({ |
| 1325 | </div> | 1338 | </div> |
| 1326 | <div class="list_item"> | 1339 | <div class="list_item"> |
| 1327 | <span class="item_label">产品发布机构:</span> | 1340 | <span class="item_label">产品发布机构:</span> |
| 1328 | <span class="item_value"><ellipsis-tooltip :content="publicDataProductsMainRSVO?.productPublisherName || '--'" | 1341 | <span class="item_value"><ellipsis-tooltip |
| 1329 | class-name="w100f mr8-i" :refName="'tooltipOver' + 'productPublisherName'"></ellipsis-tooltip></span> | 1342 | :content="publicDataProductsMainRSVO?.productPublisherName || '--'" class-name="w100f mr8-i" |
| 1343 | :refName="'tooltipOver' + 'productPublisherName'"></ellipsis-tooltip></span> | ||
| 1330 | </div> | 1344 | </div> |
| 1331 | <div class="list_item"> | 1345 | <div class="list_item"> |
| 1332 | <span class="item_label">领域:</span> | 1346 | <span class="item_label">领域:</span> |
| ... | @@ -1485,11 +1499,13 @@ const respParamsTableInfo = ref({ | ... | @@ -1485,11 +1499,13 @@ const respParamsTableInfo = ref({ |
| 1485 | <span>{{ scope.row["updateTime"] || '--' }}</span> | 1499 | <span>{{ scope.row["updateTime"] || '--' }}</span> |
| 1486 | </template> | 1500 | </template> |
| 1487 | </el-table-column> | 1501 | </el-table-column> |
| 1488 | <el-table-column label="操作" v-if="!detailInfo.nodeId || foundMode == 'download' || foundMode == 'read'" width="220px" align="left" fixed="right" show-overflow-tooltip> | 1502 | <el-table-column label="操作" v-if="!detailInfo.nodeId || foundMode == 'download' || foundMode == 'read'" |
| 1503 | width="220px" align="left" fixed="right" show-overflow-tooltip> | ||
| 1489 | <template #default="scope"> | 1504 | <template #default="scope"> |
| 1490 | <span class="text_btn" @click="handleTableViewData(scope)">查看样例数据</span> | 1505 | <span class="text_btn" @click="handleTableViewData(scope)">查看样例数据</span> |
| 1491 | <el-divider v-show="foundMode == 'download'" direction="vertical" /> | 1506 | <el-divider v-show="foundMode == 'download'" direction="vertical" /> |
| 1492 | <span v-show="foundMode == 'download'" class="text_btn" @click="handleTableViewDataDown(scope)">下载数据</span> | 1507 | <span v-show="foundMode == 'download'" class="text_btn" |
| 1508 | @click="handleTableViewDataDown(scope)">下载数据</span> | ||
| 1493 | </template> | 1509 | </template> |
| 1494 | </el-table-column> | 1510 | </el-table-column> |
| 1495 | </el-table> | 1511 | </el-table> | ... | ... |
-
Please register or sign in to post a comment