From c62e4032e3523d4de95255590192bf1cbd169b2b Mon Sep 17 00:00:00 2001 From: LH_R Date: Fri, 11 Apr 2025 15:51:12 +0800 Subject: [PATCH] fix(ui): dcim - device select name display --- .../rackDetail/rackView/deviceForm/deviceSelect.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmdb-ui/src/modules/cmdb/views/dcim/components/rackDetail/rackView/deviceForm/deviceSelect.vue b/cmdb-ui/src/modules/cmdb/views/dcim/components/rackDetail/rackView/deviceForm/deviceSelect.vue index 216fb5a..09fea91 100644 --- a/cmdb-ui/src/modules/cmdb/views/dcim/components/rackDetail/rackView/deviceForm/deviceSelect.vue +++ b/cmdb-ui/src/modules/cmdb/views/dcim/components/rackDetail/rackView/deviceForm/deviceSelect.vue @@ -112,11 +112,18 @@ export default { }) let CIList = res?.result || [] + const { + show_key = '', + unique_id = '', + attributes = [] + } = this?.currentCITYpe || {} + const unique_key = attributes?.find((attr) => attr?.id === unique_id)?.name || '' + if (CIList.length) { CIList = CIList.map((item) => { return { value: item?._id, - name: item?.[this?.currentCITYpe?.show_key] || item?._id || '', + name: item?.[show_key] || item?.[unique_key] || item?._id || '', unitCount: item?.u_count ?? 0 } })