From a0ceac78cd83f9d8b653f4763abc18e4a4840015 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 9 Sep 2022 09:43:14 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-2192=20fix=EF=BC=9A=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=90=8E=20=E7=82=B9=E5=87=BB=E6=8A=A5=E9=94=99=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=20=E6=8F=90=E7=A4=BA=E6=A1=86=E5=87=BA=E7=8E=B0?= =?UTF-8?q?=E5=A4=9A=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/common/js/tools.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/nezha-fronted/src/components/common/js/tools.js b/nezha-fronted/src/components/common/js/tools.js index 06f452093..f75b807c4 100644 --- a/nezha-fronted/src/components/common/js/tools.js +++ b/nezha-fronted/src/components/common/js/tools.js @@ -38,17 +38,22 @@ export const clickoutside = { } if (oldValue) { // const newValue = JSON.parse(JSON.stringify(binding.value.obj)) - if (unsavedChange == 'on' && !isEqual(oldValue, el.__newValue__)) { + if (unsavedChange == 'on' && !isEqual(oldValue, el.__newValue__) && !el.isShow) { + el.isShow = true MessageBox.confirm(i18n.t('tip.confirmCancel'), { confirmButtonText: i18n.t('tip.yes'), cancelButtonText: i18n.t('tip.no'), type: 'warning' }).then(() => { + el.isShow = false if (binding.value.func) { binding.value.func() } - }).catch(err => err) - } else { + }).catch(err => { + el.isShow = false + console.log(err) + }) + } else if (!el.isShow) { binding.value.func() } } else {