diff --git a/cmdb-ui/src/components/CMDBFilterComp/expression.vue b/cmdb-ui/src/components/CMDBFilterComp/expression.vue index 25206049..3facb3a3 100644 --- a/cmdb-ui/src/components/CMDBFilterComp/expression.vue +++ b/cmdb-ui/src/components/CMDBFilterComp/expression.vue @@ -139,9 +139,9 @@ :normalizer=" (node) => { return { - id: String(node[0] || ''), - label: node[1] ? node[1].label || node[0] : node[0], - children: node.children && node.children.length ? node.children : undefined, + id: node.id, + label: node.label, + children: node.children, } } " @@ -352,8 +352,12 @@ export default { }, getChoiceValueByProperty(property) { const _find = this.canSearchPreferenceAttrList.find((item) => item.name === property) - if (_find) { - return _find.choice_value + if (_find?.choice_value?.length) { + return _find.choice_value.map((node) => ({ + id: String(node?.[0] ?? ''), + label: node?.[1]?.label || node?.[0] || '', + children: node?.children?.length ? node.children : undefined + })) } return [] }, diff --git a/cmdb-ui/src/modules/cmdb/views/ipam/components/ipamTree.vue b/cmdb-ui/src/modules/cmdb/views/ipam/components/ipamTree.vue index d5bfdf15..e2c37871 100644 --- a/cmdb-ui/src/modules/cmdb/views/ipam/components/ipamTree.vue +++ b/cmdb-ui/src/modules/cmdb/views/ipam/components/ipamTree.vue @@ -9,6 +9,7 @@
li:first-child { + .ipam-tree-node-all { .ant-tree-switcher { display: none; } diff --git a/cmdb-ui/src/modules/cmdb/views/ipam/index.vue b/cmdb-ui/src/modules/cmdb/views/ipam/index.vue index fc754762..de6fc135 100644 --- a/cmdb-ui/src/modules/cmdb/views/ipam/index.vue +++ b/cmdb-ui/src/modules/cmdb/views/ipam/index.vue @@ -185,6 +185,7 @@ export default { showCatalogBtn: rootShowCatalogBtn, showSubnetBtn: rootShowSubnetBtn, parentId: '', + class: 'ipam-tree-node-all' }) this.treeData = treeData