fix(ui): define value filter error

This commit is contained in:
LH_R 2024-08-26 21:38:02 +08:00
parent 2717f65280
commit aaa3a1e829
1 changed files with 5 additions and 3 deletions

View File

@ -366,7 +366,7 @@ export default {
} }
return { return {
choice_value: this.valueList.filter((item) => item?.[0]), choice_value: this.valueList.filter((item) => !['', null, undefined].includes(item?.[0])),
choice_web_hook: null, choice_web_hook: null,
choice_other: null choice_other: null
} }
@ -398,8 +398,10 @@ export default {
}, },
validateDefine() { validateDefine() {
const valueList = this.valueList.filter((item) => item?.[0]) const valueList = this.valueList.filter((item) => {
const isRepeat = _.uniq(valueList.map(item => item?.[0] || '')).length !== valueList.length return !['', null, undefined].includes(item?.[0])
})
const isRepeat = _.uniq(valueList.map(item => item?.[0])).length !== valueList.length
if (isRepeat) { if (isRepeat) {
this.$message.warning(this.$t('cmdb.ciType.enumValueTip2')) this.$message.warning(this.$t('cmdb.ciType.enumValueTip2'))
return true return true