diff --git a/src/components/negativeInfo/depart-dialog.vue b/src/components/negativeInfo/depart-dialog.vue index fe54d71..c1eea35 100644 --- a/src/components/negativeInfo/depart-dialog.vue +++ b/src/components/negativeInfo/depart-dialog.vue @@ -47,7 +47,7 @@
问题总数 - {{ negativeInfo.size ?? 0 }} + {{ businessProblemTotal }}
@@ -172,6 +172,11 @@ const departTitle = computed(() => [departInfo.value.parentName, departInfo.value.name].filter(Boolean).join(" / ") || "单位问题详情" ); const negativeInfo = ref({}); +const businessProblemTotal = computed(() => + Number(negativeInfo.value.jcj110Size ?? 0) + + Number(negativeInfo.value.jcj122Size ?? 0) + + Number(negativeInfo.value.zfbaSize ?? 0) +); const negativeList = ref([]); @@ -189,12 +194,15 @@ async function getProfileData() { departInfo.value = data.departInfo; negativeInfo.value = data.negativeInfo; complaintCount.value = data.complaintCount ?? 0; - problemSourcesPieOptions.value.series[0].data = data.problemSourcesList; - problemSourcesPieOptions.value.title.text = String(data.negativeInfo.size ?? 0); - businessTypePieOptions.value.series[0].data = data.businessTypeList; - businessTypePieOptions.value.title.text = String(data.negativeInfo.size ?? 0); - problemTypePieOptions.value.series[0].data = data.problemTypeList; - problemTypePieOptions.value.title.text = String(data.negativeInfo.size ?? 0); + for (const [option, items] of [ + [problemSourcesPieOptions, data.problemSourcesList], + [businessTypePieOptions, data.businessTypeList], + [problemTypePieOptions, data.problemTypeList], + ]) { + const categories = items || []; + option.value.series[0].data = categories; + option.value.title.text = String(categories.reduce((total, item) => total + Number(item.value ?? 0), 0)); + } policeBarList.value = data.policeBarList; policeLeadBarList.value = data.policeLeadBarList; @@ -291,10 +299,11 @@ const policeLeadBarList = ref([]); for (const pieOption of [problemSourcesPieOptions, businessTypePieOptions, problemTypePieOptions]) { Object.assign(pieOption.value, { + tooltip: { trigger: "item", formatter: "{b}
数量:{c}
占比:{d}%" }, color: ["#5B8FF9", "#5AD8A6", "#F6BD16", "#F6903D", "#6DC8EC"], title: { text: "0", - subtext: "问题总数", + subtext: "分类统计总数", left: "30%", top: "39%", textAlign: "center",
业务类别业务量问题数