diff --git a/src/ui/src/components/ui/selector/business-mix.vue b/src/ui/src/components/ui/selector/business-mix.vue index d97f0c35b1..4d305b8948 100644 --- a/src/ui/src/components/ui/selector/business-mix.vue +++ b/src/ui/src/components/ui/selector/business-mix.vue @@ -120,7 +120,6 @@ }, localSelected: { get() { - console.log(this.value, 'this.value') return this.value }, set(value) { @@ -130,6 +129,14 @@ } } }, + watch: { + localSelected() { + const hasFirstPage = this.displayList.filter(list => list.id === this.value).length + if (!hasFirstPage) { + this.setBizChoose() + } + } + }, async created() { this.getData() @@ -195,6 +202,9 @@ this.displayList = value } + this.setBizChoose() + }, + setBizChoose() { // 由于使用了分页加载,当前选中的业务可能不在列表中select组件无法回显,通过调用registerOption解决 this.$nextTick(() => { const selectedOption = this.normalizationList.find(item => item.id === this.localSelected) @@ -216,13 +226,11 @@ const lowerName = option.name.toLowerCase() const matched = lowerName.indexOf(searchValue) !== -1 if (matched) { - console.log(option) displayList.push(option) } else { const pinyinList = this.$bkToPinyin(lowerName, true, '-').split('-') const pinyinStr = pinyinList.reduce((res, cur) => res + cur[0], '') if (pinyinList.join('').indexOf(searchValue) !== -1 || pinyinStr.indexOf(searchValue) !== -1) { - console.log(option, 'pppyy') displayList.push(option) } } diff --git a/src/ui/src/views/business-topology/children/topology-tree.vue b/src/ui/src/views/business-topology/children/topology-tree.vue index 43c6bddb4e..70bc9b53aa 100644 --- a/src/ui/src/views/business-topology/children/topology-tree.vue +++ b/src/ui/src/views/business-topology/children/topology-tree.vue @@ -524,6 +524,7 @@ this.$set(data, 'status', 'finished') this.$set(data, 'host_count', count.host_count) this.$set(data, 'service_instance_count', count.service_instance_count) + this.$forceUpdate() }) } catch (error) { console.error(error) diff --git a/src/ui/src/views/host-apply/children/search-select-mix.vue b/src/ui/src/views/host-apply/children/search-select-mix.vue index 6c499dfbfc..a04dcfec64 100644 --- a/src/ui/src/views/host-apply/children/search-select-mix.vue +++ b/src/ui/src/views/host-apply/children/search-select-mix.vue @@ -38,6 +38,7 @@ import { mapGetters } from 'vuex' import has from 'has' import { CONFIG_MODE } from '@/service/service-template/index.js' + import { PROPERTY_TYPES } from '@/dictionary/property-constants' export default { props: { @@ -163,8 +164,10 @@ if (isAny) { rule.operator = 'exist' } else { + // 对枚举类型特殊处理 + const val = item.type === PROPERTY_TYPES.ENUM ? value.name : value.id rule.operator = 'contains' - rule.value = String(value.id).trim() + rule.value = String(val).trim() } rules.push(rule) } else {