Merge pull request #603 from veops/dev_ui_240826

fix(ui): define value filter error
This commit is contained in:
Leo Song 2024-08-26 21:40:03 +08:00 committed by GitHub
commit 9244eea71b
1 changed files with 5 additions and 3 deletions

View File

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