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() + } }, /* 保存 */