Merge pull request #693 from veops/dev_ui_250411

fix(ui): dcim - device select name display
This commit is contained in:
Leo Song
2025-04-11 15:51:50 +08:00
committed by GitHub

View File

@@ -112,11 +112,18 @@ export default {
}) })
let CIList = res?.result || [] 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) { if (CIList.length) {
CIList = CIList.map((item) => { CIList = CIList.map((item) => {
return { return {
value: item?._id, 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 unitCount: item?.u_count ?? 0
} }
}) })