1e6c80d5 by lihua

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

1 parent 02b8e6ac
......@@ -54,6 +54,12 @@ export const downloadTableData = (params) => request({
responseType: 'blob'
});
/** 下载数据前的检查 */
export const downloadTableDataCheck = (params) => request({
url: `${import.meta.env.VITE_APP_DIGITAL_CONTRACT_URL}/contract-use/download-check?userGuid=${params.userGuid}&subjectGuid=${params.subjectGuid}`,
method: 'get'
});
/** 数据使用中查看资产表的数据 */
export const queryUseData = (params) => request({
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'
import useDataAssetStore from "@/store/modules/dataAsset";
import { TableColumnWidth } from '@/utils/enum';
import {
downloadTableData
downloadTableData,
downloadTableDataCheck
} from "@/api/modules/dataDelivery";
const router = useRouter();
......@@ -336,9 +337,11 @@ const productTableInfo = ref({
fields: [
{ label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center" },
{ label: "服务名称", field: "apiName", width: 180 },
{ label: "API类型", field: "apiType", width: 100, getName: (scope) => {
{
label: "API类型", field: "apiType", width: 100, getName: (scope) => {
return scope.row.apiType && apiTypes.find(a => a.value == scope.row.apiType)?.label;
} },
}
},
{ label: "API地址", field: "requestUrl", width: 240 },
{ label: "描述", field: "apiDescription", width: 240 },
],
......@@ -449,6 +452,11 @@ const handleTableViewData = (scope) => {
/** 下载数据 */
const handleTableViewDataDown = (scope) => {
downloadTableDataCheck({
userGuid: route.query.useGuid,
subjectGuid: scope.row.guid
}).then((res: any) => {
if (res?.code == proxy.$passCode) {
downloadTableData({
userGuid: route.query.useGuid,
subjectGuid: scope.row.guid
......@@ -459,6 +467,10 @@ const handleTableViewDataDown = (scope) => {
res?.msg && ElMessage.error(res?.msg);
}
})
} else {
ElMessage.error(res?.msg || '下载失败');
}
})
}
const toolBtns: any = computed(() => {
......@@ -1257,7 +1269,8 @@ const respParamsTableInfo = ref({
<div class="dataLabel" v-show="detailInfo.domainName">{{ detailInfo.domainName }}</div>
<div class="dataLabel dataLabel1" v-if="detailInfo.databaseType">{{ detailInfo.databaseType }}</div>
<div class="dataLabel dataLabel1">{{ detailInfo.dataSourcesName }}</div>
<div class="dataLabel dataLabel1" v-if="detailInfo.updateFrequency">{{ detailInfo.updateFrequencyName }}</div>
<div class="dataLabel dataLabel1" v-if="detailInfo.updateFrequency">{{ detailInfo.updateFrequencyName }}
</div>
</div>
</div>
<!-- <template v-if="detailInfo?.foundMode == 1"> -->
......@@ -1310,8 +1323,9 @@ const respParamsTableInfo = ref({
</div>
<div class="list_item">
<span class="item_label">产品发布机构:</span>
<span class="item_value"><ellipsis-tooltip :content="publicDataProductsMainRSVO?.productPublisherName || '--'"
class-name="w100f mr8-i" :refName="'tooltipOver' + 'productPublisherName'"></ellipsis-tooltip></span>
<span class="item_value"><ellipsis-tooltip
:content="publicDataProductsMainRSVO?.productPublisherName || '--'" class-name="w100f mr8-i"
:refName="'tooltipOver' + 'productPublisherName'"></ellipsis-tooltip></span>
</div>
<div class="list_item">
<span class="item_label">领域:</span>
......@@ -1470,11 +1484,13 @@ const respParamsTableInfo = ref({
<span>{{ scope.row["updateTime"] || '--' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" v-if="!detailInfo.nodeId || foundMode == 'download' || foundMode == 'read'" width="220px" align="left" fixed="right" show-overflow-tooltip>
<el-table-column label="操作" v-if="!detailInfo.nodeId || foundMode == 'download' || foundMode == 'read'"
width="220px" align="left" fixed="right" show-overflow-tooltip>
<template #default="scope">
<span class="text_btn" @click="handleTableViewData(scope)">查看样例数据</span>
<el-divider v-show="foundMode == 'download'" direction="vertical" />
<span v-show="foundMode == 'download'" class="text_btn" @click="handleTableViewDataDown(scope)">下载数据</span>
<span v-show="foundMode == 'download'" class="text_btn"
@click="handleTableViewDataDown(scope)">下载数据</span>
</template>
</el-table-column>
</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!