From dc9f7d0cd684061e827fce6fb5f1c225cac48f36 Mon Sep 17 00:00:00 2001 From: "wu.jian2" Date: Thu, 31 Aug 2023 14:50:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E8=AE=BE=E8=AE=A1=E9=A1=B5=E9=9D=A2=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data-room-ui/packages/BizComponent/index.vue | 41 +++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/data-room-ui/packages/BizComponent/index.vue b/data-room-ui/packages/BizComponent/index.vue index 9e5ce708..9e8da89a 100644 --- a/data-room-ui/packages/BizComponent/index.vue +++ b/data-room-ui/packages/BizComponent/index.vue @@ -237,17 +237,18 @@ export default { backManagement () { // 给出一个确认框提示,提示如下确定返回主页面吗?未保存的配置将会丢失。3个按钮 : 留在页面 、离开页面、保存后离开页面 this.$confirm('确定返回主页面吗?未保存的配置将会丢失。', '提示', { + distinguishCancelAndClose: true, confirmButtonText: '保存后离开页面', cancelButtonText: '离开页面', cancelButtonClass: 'cancel-btn', - cancelButtonColor: '#FF6F6F', - showCancelButton: true, type: 'warning', customClass: 'bs-el-message-box' }).then(() => { this.save(true) - }).catch(() => { - this.pageJump() + }).catch((action) => { + if (action === 'cancel') { + this.pageJump() + } }) }, save (pageJump = false) { @@ -271,12 +272,17 @@ export default { translateBlobToBase64(res, function (e) { this.form.coverPicture = e.result updateBizComponent(this.form) - .then((res) => { - that.$message.success('保存成功') - console.log(pageJump) - if (pageJump) { - this.pageJump() - } + .then(() => { + this.$message({ + message: '保存成功', + type: 'success', + onClose: () => { + // 此处写提示关闭后需要执行的函数 + if (pageJump) { + this.pageJump() + } + } + }) }) .finally(() => { that.loading = false @@ -287,11 +293,16 @@ export default { this.form.coverPicture = dataUrl updateBizComponent(this.form) .then(() => { - console.log(1122) - this.$message.success('保存成功') - if (pageJump) { - this.pageJump() - } + this.$message({ + message: '保存成功', + type: 'success', + onClose: () => { + // 此处写提示关闭后需要执行的函数 + if (pageJump) { + this.pageJump() + } + } + }) }) .finally(() => { this.loading = false