From 611ee40dcad621dcfb59a95ff36b1bb887918f5d Mon Sep 17 00:00:00 2001 From: LH_R Date: Mon, 26 Aug 2024 21:38:02 +0800 Subject: [PATCH] fix(ui): define value filter error --- cmdb-ui/src/modules/cmdb/views/ci_types/preValueArea.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmdb-ui/src/modules/cmdb/views/ci_types/preValueArea.vue b/cmdb-ui/src/modules/cmdb/views/ci_types/preValueArea.vue index f76427b..ddd02f7 100644 --- a/cmdb-ui/src/modules/cmdb/views/ci_types/preValueArea.vue +++ b/cmdb-ui/src/modules/cmdb/views/ci_types/preValueArea.vue @@ -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