diff --git a/src/utils/common.ts b/src/utils/common.ts index bc029f6..aab50f4 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -238,8 +238,8 @@ export function getTimeRangeStamp(timeRange: string){ export function downloadFileFun(url: string, name: string) { const a = document.createElement('a'); a.href = url; - a.target = '_blank'; a.download = name; + a.style.display = 'none'; document.body.appendChild(a) a.click() document.body.removeChild(a); diff --git a/src/views/changeLedger/modules/list.vue b/src/views/changeLedger/modules/list.vue index 9585535..e384c74 100644 --- a/src/views/changeLedger/modules/list.vue +++ b/src/views/changeLedger/modules/list.vue @@ -223,7 +223,7 @@ const revokeSave = async () => { const downloadFiles = (r:any,type:string) => { // 下载申请表 if(type==='apply'){ - + } // 下载已验收待关闭 if(type==='accepted'){ diff --git a/src/views/details/approval/index.vue b/src/views/details/approval/index.vue index c8f6a8a..7bcf717 100644 --- a/src/views/details/approval/index.vue +++ b/src/views/details/approval/index.vue @@ -4,7 +4,7 @@ import { Icon } from '@iconify/vue' import { useThemeStore } from '@/store/modules/theme'; import { useRouterPush } from '@/hooks/common/router'; import { useRoute } from 'vue-router'; -import { getColorWithOpacity, tagTextColor, tagBgColor, tagBorderColor } from '@/utils/common'; +import { getColorWithOpacity, tagTextColor, tagBgColor, tagBorderColor, downloadFileFun } from '@/utils/common'; import { AiError, aiTypeJudge } from "@/service/api/ai"; import { systemConfigApi } from '@/service/api/system'; import { getChangeDetailApi } from '@/service/api/change'; @@ -268,12 +268,11 @@ const exportFile = (type: string) => { }; // 变更附带资料下载/一键下载 -const downloadFile = (type: string) => { - window.$message?.info('还差接口') +const downloadFile = (file:any,type: string) => { if(type === 'all'){ - window.$message?.success('打包下载全部附件'); + window.$message?.info('还差接口') }else{ - window.$message?.success('下载当前附件成功'); + downloadFileFun(file?.file_url, file?.doc_name || file?.file_name); } }; // 变更附带资料预览 @@ -560,7 +559,7 @@ onMounted(() => { class="rounded-sm bg-[var(--theme-color)] px-3 py-1 text-xs font-semibold text-white" :style="{'--theme-color': themeStore.themeColor}" >变更附带资料

- 一键下载 + 一键下载 @@ -587,7 +586,7 @@ onMounted(() => {
预览 - 下载 + 下载
diff --git a/src/views/details/closeDoc/index.vue b/src/views/details/closeDoc/index.vue index 97cdb08..50e347f 100644 --- a/src/views/details/closeDoc/index.vue +++ b/src/views/details/closeDoc/index.vue @@ -1,10 +1,10 @@