diff --git a/src/components/data/complaint_detail.vue b/src/components/data/complaint_detail.vue index d421172..bf5d653 100644 --- a/src/components/data/complaint_detail.vue +++ b/src/components/data/complaint_detail.vue @@ -10,7 +10,7 @@
- {{ dictLabel(dict?.businessType, base.businessTypeCode) }} + {{ getDictLabel(dict?.businessType, base.businessTypeCode) }}
@@ -50,17 +50,17 @@
- {{ dictLabel(dict?.yesNo, base.repeatt) }} + {{ getDictLabel(dict?.yesNo, base.repeatt) }}
- {{ tagText }} + {{ getDictLabel(dict?.sfssTags, base.tag) }}
- {{ dictLabel(dict?.BlameType, base.handleMethod) }} + {{ getDictLabel(dict?.handleMethodType, base.handleMethod) }}
@@ -90,8 +90,7 @@
- {{ dictLabel(dict?.accountabilityTarget, base.accountabilityTarget) }} - + {{ getDictLabel(dict?.accountabilityTarget, base.accountabilityTarget) }}
@@ -214,11 +213,35 @@ const detail = ref({}); const base = computed(() => detail.value || {}); const neg = computed(() => detail.value?.negative || detail.value?.neg || {}); -function dictLabel(list, value) { - if (!Array.isArray(list)) return "/"; - if (value === undefined || value === null || value === "") return "/"; - const hit = list.find((x) => String(x.dictValue) === String(value)); - return hit?.dictLabel ?? "/"; +function getDictLabel(list, value) { + if (!Array.isArray(list)) return '/' + + if (value === null || value === undefined || value === '') return '/' + + let values = [] + + // 1️⃣ value 是数组 + if (Array.isArray(value)) { + values = value + } + // 2️⃣ value 是 "1,2,3" 这种字符串 + else if (typeof value === 'string' && value.includes(',')) { + values = value.split(',').map(v => v.trim()) + } + // 3️⃣ 单值(string / number) + else { + values = [value] + } + + // 4️⃣ 映射成字典中文 + const labels = values + .map(v => { + const item = list.find(d => d.dictValue == v) + return item?.dictLabel + }) + .filter(Boolean) + + return labels.length ? labels.join(',') : '/' } /** 来源展示:优先后端给的“全路径”,否则用 sourcePath 数组拼 */