Skip to content

Commit 53e8d34

Browse files
authored
Merge pull request #693 from veops/dev_ui_250411
fix(ui): dcim - device select name display
2 parents 108c110 + c62e403 commit 53e8d34

File tree

1 file changed

+8
-1
lines changed
  • cmdb-ui/src/modules/cmdb/views/dcim/components/rackDetail/rackView/deviceForm

1 file changed

+8
-1
lines changed

cmdb-ui/src/modules/cmdb/views/dcim/components/rackDetail/rackView/deviceForm/deviceSelect.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,18 @@ export default {
112112
})
113113
let CIList = res?.result || []
114114
115+
const {
116+
show_key = '',
117+
unique_id = '',
118+
attributes = []
119+
} = this?.currentCITYpe || {}
120+
const unique_key = attributes?.find((attr) => attr?.id === unique_id)?.name || ''
121+
115122
if (CIList.length) {
116123
CIList = CIList.map((item) => {
117124
return {
118125
value: item?._id,
119-
name: item?.[this?.currentCITYpe?.show_key] || item?._id || '',
126+
name: item?.[show_key] || item?.[unique_key] || item?._id || '',
120127
unitCount: item?.u_count ?? 0
121128
}
122129
})

0 commit comments

Comments
 (0)