From 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 21 Apr 2025 18:29:09 +0800
Subject: [PATCH] fix: 天气显示

---
 src/views/TaskManage/TaskTop/TaskIndustry.vue |   48 ++++++++++++++++--------------------------------
 1 files changed, 16 insertions(+), 32 deletions(-)

diff --git a/src/views/TaskManage/TaskTop/TaskIndustry.vue b/src/views/TaskManage/TaskTop/TaskIndustry.vue
index 81de854..e27b5df 100644
--- a/src/views/TaskManage/TaskTop/TaskIndustry.vue
+++ b/src/views/TaskManage/TaskTop/TaskIndustry.vue
@@ -1,7 +1,7 @@
 <!-- 任务算法统计 -->
  <template>
   <div class="task-industry">
-    <div class="title">任务算法统计</div>
+    <div class="title">机巢事件前五数量占比</div>
     <div class="chart" ref="chartRef"></div>
   </div>
  </template>
@@ -41,13 +41,14 @@
       roseType: 'radius',
       radius: ['20%', '70%'],
       center: ['50%', '45%'],
-      data: [
-        { name: '国土类', value: 0, itemStyle: { color: '#3D7FFF' } },
-        { name: '城管类', value: 0, itemStyle: { color: '#8277E9' } },
-        { name: '消防类', value: 0, itemStyle: { color: '#FFB77E' } },
-        { name: '林业类', value: 0, itemStyle: { color: '#44D7B6' } },
-        { name: '公安类', value: 0, itemStyle: { color: '#62F4FF' } }
-      ],
+      data: [],
+      // [
+      //   { name: '国土类', value: 0, itemStyle: { color: '#3D7FFF' } },
+      //   { name: '城管类', value: 0, itemStyle: { color: '#8277E9' } },
+      //   { name: '消防类', value: 0, itemStyle: { color: '#FFB77E' } },
+      //   { name: '林业类', value: 0, itemStyle: { color: '#44D7B6' } },
+      //   { name: '公安类', value: 0, itemStyle: { color: '#62F4FF' } }
+      // ],
       label: {
         show: true,
         position: 'outside',
@@ -71,36 +72,19 @@
 const getIndustryJobNumPieChart = (value) => {
   industryJobNumPieChart(value).then(res => {
     if (res.data.code !== 0) return;
-    option.series[0].data.forEach(item => {
-      const matchData = res.data.data.find(d => d.name === item.name);
-      if (matchData) {
-        item.value = matchData.value;
-      }
-    });
+    option.series[0].data = res.data.data;
+    // forEach(item => {
+    //   const matchData = res.data.data.find(d => d.name === item.name);
+    //   if (matchData) {
+    //     item.value = matchData.value;
+    //   }
+    // });
     chart.value.setOption(option);
   });
 };
 
-
-// 获取行业统计数据
-// const getIndustryJobNumPieChart = () => {
-//   industryJobNumPieChart().then(res => {
-//     if (res.data.code !== 0) return;
-//     const data = res.data.data.map(item => ({
-//       name: item.name,
-//       value: item.value,
-//       itemStyle: {
-//         color: getRandomColor()
-//       }
-//     }));
-//     option.series[0].data = data;
-//     chart.value.setOption(option);
-//   });
-// };
-
 // 添加监听
 watch(() => store.state.task.taskSearchParams, (newVal) => {
-  console.log(newVal, '2222');
   if (newVal) {
     getIndustryJobNumPieChart(newVal);
   }

--
Gitblit v1.9.3