From c6f7d4e449465c1996f403911bc23932ff32a35c Mon Sep 17 00:00:00 2001 From: aixianling Date: Thu, 14 Jul 2022 14:53:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../develop/AppDeployWxmp/AppDeployWxmp.vue | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/project/oms/apps/develop/AppDeployWxmp/AppDeployWxmp.vue b/project/oms/apps/develop/AppDeployWxmp/AppDeployWxmp.vue index 54430373..c4e12b61 100644 --- a/project/oms/apps/develop/AppDeployWxmp/AppDeployWxmp.vue +++ b/project/oms/apps/develop/AppDeployWxmp/AppDeployWxmp.vue @@ -31,7 +31,8 @@ @@ -113,7 +114,8 @@ export default { // privateKey: {required: true, message: "请输入 小程序上传私钥"}, // projectPath: {required: true, message: "请输入 项目地址"}, version: {required: true, message: "请选择 定制方案"}, - } + }, + timer: {} } }, methods: { @@ -155,15 +157,15 @@ export default { }).then(res => { if (res?.code == 0) { row.count = 1 - let timer = setInterval(() => { + this.timer[id] = setInterval(() => { if (row.count >= 100) { - clearInterval(timer) + clearInterval(this.timer[id]) this.$message.error("打包失败!") } else if (row.count <= 25) { row.count++ } else this.handleConfirmZip(row).then(v => { if (v.error) { - clearInterval(timer) + clearInterval(this.timer[id]) row.error = v.error row.count = 0 } else row.count++ @@ -172,6 +174,10 @@ export default { } }).catch(() => this.$message.error("打包失败!")) }, + handleCancelZip(row) { + clearInterval(this.timer[row.id]) + row.count = 0 + }, handleUpdateSystem(row) { let {appid} = row return this.instance.post("/node/wxmp/updateSystem", null, { @@ -225,6 +231,9 @@ export default { }, created() { this.getTableData() + }, + beforeDestroy() { + Object.values(this.timer).map(t => clearInterval(t)) } }