添加数据产品下载源文件
Showing
1 changed file
with
24 additions
and
2 deletions
| ... | @@ -35,6 +35,7 @@ import { | ... | @@ -35,6 +35,7 @@ import { |
| 35 | getContractStrategy | 35 | getContractStrategy |
| 36 | } from "@/api/modules/dataDelivery"; | 36 | } from "@/api/modules/dataDelivery"; |
| 37 | import StrategyTable from '../data_smart_contract/components/strategyTable.vue'; | 37 | import StrategyTable from '../data_smart_contract/components/strategyTable.vue'; |
| 38 | import { getDownFileSignByUrl, obsDownloadRequest, parseAndDecodeUrl } from '@/api/modules/obsService'; | ||
| 38 | 39 | ||
| 39 | const router = useRouter(); | 40 | const router = useRouter(); |
| 40 | const route = useRoute(); | 41 | const route = useRoute(); |
| ... | @@ -477,7 +478,8 @@ const handleTableViewData = (scope) => { | ... | @@ -477,7 +478,8 @@ const handleTableViewData = (scope) => { |
| 477 | } | 478 | } |
| 478 | 479 | ||
| 479 | /** 下载数据 */ | 480 | /** 下载数据 */ |
| 480 | const handleTableViewDataDown = (scope) => { | 481 | const handleTableViewDataDown = async (scope) => { |
| 482 | if (foundMode.value == 'download' || foundMode.value == 'readAndDown') { | ||
| 481 | downloadTableDataCheck({ | 483 | downloadTableDataCheck({ |
| 482 | userGuid: route.query.useGuid, | 484 | userGuid: route.query.useGuid, |
| 483 | subjectGuid: scope.row.guid | 485 | subjectGuid: scope.row.guid |
| ... | @@ -497,6 +499,24 @@ const handleTableViewDataDown = (scope) => { | ... | @@ -497,6 +499,24 @@ const handleTableViewDataDown = (scope) => { |
| 497 | ElMessage.error(res?.msg || '下载失败'); | 499 | ElMessage.error(res?.msg || '下载失败'); |
| 498 | } | 500 | } |
| 499 | }) | 501 | }) |
| 502 | } else if (!detailInfo.nodeId && foundMode.value == '1' && userData.superTubeFlag == 'Y') { //下载源文件 | ||
| 503 | let fileUrl = scope.row.fileUrl; | ||
| 504 | const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(fileUrl).fileName); | ||
| 505 | if (!refSignInfo?.data) { | ||
| 506 | refSignInfo?.msg && ElMessage.error(refSignInfo?.msg); | ||
| 507 | return; | ||
| 508 | } | ||
| 509 | obsDownloadRequest(refSignInfo?.data).then((res: any) => { | ||
| 510 | if (res && !res.msg) { | ||
| 511 | let f = scope.row.fileName; | ||
| 512 | let name = f.name; | ||
| 513 | var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : ''; | ||
| 514 | download(res, name, fileSuffix); | ||
| 515 | } else { | ||
| 516 | res?.msg && ElMessage.error(res?.msg); | ||
| 517 | } | ||
| 518 | }) | ||
| 519 | } | ||
| 500 | } | 520 | } |
| 501 | 521 | ||
| 502 | const toolBtns: any = computed(() => { | 522 | const toolBtns: any = computed(() => { |
| ... | @@ -1526,8 +1546,10 @@ const respParamsTableInfo = ref({ | ... | @@ -1526,8 +1546,10 @@ const respParamsTableInfo = ref({ |
| 1526 | <!-- 如果是下载,就只显示下载,如果是查看和下载就都显示,就两个按钮都显示。仅查看,就仅查看 --> | 1546 | <!-- 如果是下载,就只显示下载,如果是查看和下载就都显示,就两个按钮都显示。仅查看,就仅查看 --> |
| 1527 | <span v-show="foundMode != 'download'" class="text_btn" @click="handleTableViewData(scope)">查看样例数据</span> | 1547 | <span v-show="foundMode != 'download'" class="text_btn" @click="handleTableViewData(scope)">查看样例数据</span> |
| 1528 | <el-divider v-show="foundMode == 'readAndDown' || (!detailInfo.nodeId && foundMode == '1' && userData.superTubeFlag == 'Y')" direction="vertical" /> | 1548 | <el-divider v-show="foundMode == 'readAndDown' || (!detailInfo.nodeId && foundMode == '1' && userData.superTubeFlag == 'Y')" direction="vertical" /> |
| 1529 | <span v-show="foundMode == 'download' || foundMode == 'readAndDown' || (!detailInfo.nodeId && foundMode == '1' && userData.superTubeFlag == 'Y')" class="text_btn" | 1549 | <span v-if="foundMode == 'download' || foundMode == 'readAndDown'" class="text_btn" |
| 1530 | @click="handleTableViewDataDown(scope)">下载数据</span> | 1550 | @click="handleTableViewDataDown(scope)">下载数据</span> |
| 1551 | <span v-else-if="!detailInfo.nodeId && foundMode == '1' && userData.superTubeFlag == 'Y'" class="text_btn" | ||
| 1552 | @click="handleTableViewDataDown(scope)">下载</span> | ||
| 1531 | </template> | 1553 | </template> |
| 1532 | </el-table-column> | 1554 | </el-table-column> |
| 1533 | </el-table> | 1555 | </el-table> | ... | ... |
-
Please register or sign in to post a comment