From e5f3257f81978ad7e56a37e973971e970e378035 Mon Sep 17 00:00:00 2001 From: wangxiaoshuang <825034831@qq.com> Date: Fri, 12 Dec 2025 17:34:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E5=A4=B1=E8=B4=A5=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/stream.js | 7 +++++++ src/views/trials/trials-inspection/index.vue | 14 +++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/utils/stream.js b/src/utils/stream.js index 90a964f..d2e59d1 100644 --- a/src/utils/stream.js +++ b/src/utils/stream.js @@ -64,6 +64,13 @@ function downLoadFileConcurrency(obj, arr, callback) { let res = await downLoadFileConcurrency(obj, arr, callback) resolve(res) } + }).catch(err => { + if (callback) { + callback({ + type: 'error' + }) + } + console.log(err) }) }) } diff --git a/src/views/trials/trials-inspection/index.vue b/src/views/trials/trials-inspection/index.vue index 473e64e..3d52474 100644 --- a/src/views/trials/trials-inspection/index.vue +++ b/src/views/trials/trials-inspection/index.vue @@ -313,7 +313,7 @@ export default { }, methods: { handleClose(done) { - this.downLoadType = '' + this.downLoadType = 'start' this.percentage = 0 this.downLoadImageCount = 0 this.downloadVisible = false @@ -338,6 +338,7 @@ export default { if (!confirm) return false this.downloadId = res.OtherInfo.downloadId this.downloadImage(res.Result, res.OtherInfo) + this.downloadVisible = true } } catch (err) { console.log(err) @@ -356,7 +357,7 @@ export default { async downloadImage(data, OtherInfo) { try { let { files, name } = this.formatDownloadFile(data) - let res = await downLoadFile(files, name, 'zip', (data) => { + let res = await downLoadFile(files, name, 'zip', async (data) => { let { type } = data this.downloadType = type if (type === 'start') { @@ -374,8 +375,15 @@ export default { } if (type === 'downLoaded') { } + if (type === 'error') { + let confirm = await this.$confirm(this.$t('trials:imageSummary:confirm:downloadError')) + this.downLoadType = 'start' + this.percentage = 0 + this.downLoadImageCount = 0 + this.downloadVisible = false + } if (type === 'zipEnd') { - this.downLoadType = '' + this.downLoadType = 'start' this.percentage = 0 this.downLoadImageCount = 0 this.downloadVisible = false