Merge branch 'dev-3.6' of git.mesalab.cn:nezha/nezha-fronted into dev-3.7
This commit is contained in:
@@ -140,7 +140,7 @@
|
|||||||
{ validator: variableValidator,trigger: 'blur'},
|
{ validator: variableValidator,trigger: 'blur'},
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<el-input v-model="item.name" :placeholder="$t('overall.placeHolder')" size="small" @change="hideError('variables', index)"/>
|
<el-input v-model="item.name" :placeholder="$t('overall.placeHolder')" size="small" @change="hideError('variables', index, 'name')"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- Type -->
|
<!-- Type -->
|
||||||
<el-form-item class="form-item--half-width" :label='$t("overall.type")' :prop="'param.variables.' + index + '.type'" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}">
|
<el-form-item class="form-item--half-width" :label='$t("overall.type")' :prop="'param.variables.' + index + '.type'" :rules="{ required: true, message: $t('validate.required'), trigger: 'blur'}">
|
||||||
@@ -621,24 +621,20 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
hideError (key, index) {
|
hideError (key, index, type) {
|
||||||
if (!this.editPanel.param[key] || !this.editPanel.param[key].length) {
|
if (!this.editPanel.param[key] || !this.editPanel.param[key].length) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$refs.form.validate((blooen, object) => {
|
if (type === 'name') {
|
||||||
console.log(Object.keys(object))
|
const reg = /^[a-zA-Z_][a-zA-Z0-9_]*$/
|
||||||
let flag = true
|
if (reg.test(this.editPanel.param[key][index].name)) {
|
||||||
Object.keys(object).forEach(item => {
|
this.editPanel.param[key][index].error = false
|
||||||
console.log(`param.${key}.${index}.`)
|
this.$forceUpdate()
|
||||||
if (item.startsWith(`param.${key}.${index}.`)) {
|
}
|
||||||
flag = false
|
} else {
|
||||||
}
|
|
||||||
})
|
|
||||||
if (flag) {
|
|
||||||
this.editPanel.param[key][index].error = false
|
this.editPanel.param[key][index].error = false
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
}
|
}
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/* 保存 */
|
/* 保存 */
|
||||||
|
|||||||
Reference in New Issue
Block a user