From da649d407d2428fb6743fe1dc3630374f439da8d Mon Sep 17 00:00:00 2001 From: zyh Date: Thu, 6 Jul 2023 17:53:40 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E5=A4=8Ddashboard?= =?UTF-8?q?=E5=8F=98=E9=87=8Fname=E9=87=8D=E5=A4=8D=E6=97=B6=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=85=B6=E4=B8=AD=E4=B8=80=E4=B8=AAname=20=E5=8F=A6?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=A0=A1=E9=AA=8C=E6=9C=AA=E6=B6=88=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/rightBox/panelBox.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nezha-fronted/src/components/common/rightBox/panelBox.vue b/nezha-fronted/src/components/common/rightBox/panelBox.vue index 1f3e0dd58..6643780d1 100644 --- a/nezha-fronted/src/components/common/rightBox/panelBox.vue +++ b/nezha-fronted/src/components/common/rightBox/panelBox.vue @@ -501,6 +501,15 @@ export default { if (findIndex !== lastIndex) { callback(new Error(this.$t('error.nameDuplicate'))) } else { + // 没有重复的 则清除校验 + nameArr.forEach((item, index) => { + const findIndex = nameArr.indexOf(item) + const lastIndex = nameArr.lastIndexOf(item) + const reg = /^[a-zA-Z_][a-zA-Z0-9_]*$/ + if (item && reg.test(item) && findIndex == lastIndex) { + this.$refs.form.clearValidate('param.variables.' + index + '.name') + } + }) callback() } }, 100)