From 2b9eeeb28baeaace1e2465cf9f4d48f869e36517 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Fri, 1 Aug 2025 17:43:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/common.js | 9 +++++++++ src/components/OnlineFile/index.vue | 12 +++++++++++- src/utils/formBuilder.js | 18 ++++++++++-------- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/api/common.js b/src/api/common.js index 1b49578..a261a4d 100644 --- a/src/api/common.js +++ b/src/api/common.js @@ -17,3 +17,12 @@ export function userListNoAuth(params) { isLoading: false }) } + +export function downLoadFile(params) { + return request({ + url: '/api/download-file', + method: 'get', + params:params, + noloading: true + }) +} diff --git a/src/components/OnlineFile/index.vue b/src/components/OnlineFile/index.vue index 59e9e81..bd7e3dc 100644 --- a/src/components/OnlineFile/index.vue +++ b/src/components/OnlineFile/index.vue @@ -28,7 +28,8 @@ diff --git a/src/utils/formBuilder.js b/src/utils/formBuilder.js index 52dddb8..ac2b97f 100644 --- a/src/utils/formBuilder.js +++ b/src/utils/formBuilder.js @@ -1024,10 +1024,11 @@ export default function formBuilder( padding: "0 4px", color:'blue' }, - attrs:{ - href:file.url, - target:"_blank" - } + on: { + click: (_) => { + this.$bus.$emit("online-download", file.id); + }, + }, }, '下载' ), @@ -1804,10 +1805,11 @@ export default function formBuilder( padding: "0 4px", color:'blue' }, - attrs:{ - href:file.url, - target:"_blank" - } + on: { + click: (_) => { + this.$bus.$emit("online-download", file.id); + }, + }, }, '下载' ),