From 21da1b661ac3184c61bfee15152bb8c317b3bba2 Mon Sep 17 00:00:00 2001 From: xjs Date: Mon, 26 May 2025 14:53:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=9C=AA=E6=A0=87?= =?UTF-8?q?=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/AskSection.vue | 2 +- src/views/components/StudentSource.vue | 21 +++++++-- .../chartsComponents/StudentSourceChart.vue | 45 ++++++++++++++++++- 3 files changed, 62 insertions(+), 6 deletions(-) diff --git a/src/views/components/AskSection.vue b/src/views/components/AskSection.vue index f365293..1708e88 100644 --- a/src/views/components/AskSection.vue +++ b/src/views/components/AskSection.vue @@ -4,7 +4,7 @@
-
咨询学段
+
咨询学段(已标记)
diff --git a/src/views/components/StudentSource.vue b/src/views/components/StudentSource.vue index 511ac9b..abbc0e9 100644 --- a/src/views/components/StudentSource.vue +++ b/src/views/components/StudentSource.vue @@ -14,8 +14,7 @@
- -
+
{{ onlineTotal }} @@ -24,8 +23,7 @@
- -
+
{{ offlineTotal }} @@ -33,6 +31,15 @@ 线下来源
+
+
+
+ {{ unMarkTotal }} + +
+ 未标记 +
+
@@ -73,10 +80,12 @@ }; const askSectionData = inject("askSectionData", ref<{ online: any[]; offline: any[] }>({ online: [], offline: [] })); + const gainData = inject("gainData",ref({acqTotal:0})) const onlineTotal = ref(0); const offlineTotal = ref(0); + const unMarkTotal = ref(0) const chartData = ref([]); watch( () => askSectionData.value, @@ -92,9 +101,13 @@ if (askSectionData.value.offline && askSectionData.value.offline.length > 0) { offlineTotal.value = askSectionData.value.offline.reduce((acc, curr) => acc + curr.total, 0); } + if(gainData.value.acqTotal && askSectionData.value.offline && askSectionData.value.online){ + unMarkTotal.value = gainData.value.acqTotal - offlineTotal.value - onlineTotal.value + } chartData.value = [ { name: "线下", value: offlineTotal.value, itemStyle: { color: "rgba(147, 219, 255, 1)" } }, { name: "线上", value: onlineTotal.value, itemStyle: { color: "rgb(79, 214, 169)" } }, + {name:'未标记',value: unMarkTotal.value,itemStyle: { color: "#FF4E4E" }} ]; } diff --git a/src/views/components/chartsComponents/StudentSourceChart.vue b/src/views/components/chartsComponents/StudentSourceChart.vue index a55b73f..791736a 100644 --- a/src/views/components/chartsComponents/StudentSourceChart.vue +++ b/src/views/components/chartsComponents/StudentSourceChart.vue @@ -191,7 +191,50 @@ autoRotate: false, }, }, - series: series, + series: [ + ...series, + { + name: "pie2d", + type: "pie", + labelLine: { + length: 18, + length2: 18, + smooth: true, + minTurnAngle: 20, + }, + label: { + show: true, + position: "outside", + color: "inherit", + rich: { + a: { + width: 5, + height: 5, + borderRadius: 50, + backgroundColor: "inherit", + }, + b: { + fontSize: 12, + }, + c: { + fontSize: 12, + }, + }, + formatter: "{a|} {b|{b}}{d|{d}}%", + }, + startAngle: 30, + clockwise: false, + radius: ["30%", "60%"], + padAngle: 360, + center: ["50%", "50%"], + data: props.chartData, + itemStyle: { + opacity: 1, + borderWidth: 0, + }, + z: 1, + }, + ], graphic: [ { id: "backgroundImg",