From 716b3ebfab16547d92fa0d31bf6d747fd1cbfe3c Mon Sep 17 00:00:00 2001 From: zyh Date: Tue, 9 May 2023 17:32:56 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BC=98=E5=8C=96=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E6=A0=A1=E9=AA=8C=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/rightBox/panelBox.vue | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/panelBox.vue b/nezha-fronted/src/components/common/rightBox/panelBox.vue index 73fd9d27c..1f3e0dd58 100644 --- a/nezha-fronted/src/components/common/rightBox/panelBox.vue +++ b/nezha-fronted/src/components/common/rightBox/panelBox.vue @@ -117,7 +117,7 @@ { validator: variableValidator,trigger: 'blur'}, ]" > - + @@ -577,24 +577,20 @@ export default { } }) }, - hideError (key, index) { + hideError (key, index, type) { if (!this.editPanel.param[key] || !this.editPanel.param[key].length) { return } - this.$refs.form.validate((blooen, object) => { - console.log(Object.keys(object)) - let flag = true - Object.keys(object).forEach(item => { - console.log(`param.${key}.${index}.`) - if (item.startsWith(`param.${key}.${index}.`)) { - flag = false - } - }) - if (flag) { + if (type === 'name') { + const reg = /^[a-zA-Z_][a-zA-Z0-9_]*$/ + if (reg.test(this.editPanel.param[key][index].name)) { this.editPanel.param[key][index].error = false this.$forceUpdate() } - }) + } else { + this.editPanel.param[key][index].error = false + this.$forceUpdate() + } }, /* 保存 */