fix(ui): CI - ci detail title display

This commit is contained in:
LH_R
2025-04-25 16:31:43 +08:00
parent 3a7f4a31d0
commit e180f549c8

View File

@@ -23,15 +23,25 @@ export default {
default: () => []
}
},
data() {
return {
icon: '',
title: ''
}
},
computed: {
findCIType() {
return this.ci_types?.find?.((item) => item?.id === this.ci?._type)
},
icon() {
return this?.findCiType?.icon || ''
},
title() {
return this?.ci?.[this.findCIType?.show_name] || this?.ci?.[this.findCIType?.unique_key] || ''
return this.ci_types?.find?.((item) => item?.id === this.ci?._type) || {}
}
},
watch: {
findCIType: {
deep: true,
immediate: true,
handler(val) {
this.icon = val?.icon || ''
this.title = this?.ci?.[val?.show_name] || this?.ci?.[val?.unique_key] || ''
},
}
}
}