From 4334e4d5f680b4375d7af4ba9e4d8c8baef7266b Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期一, 14 九月 2026 11:02:29 +0800
Subject: [PATCH] feat(production): 添加工序颜色配置和显示功能

---
 src/views/reportAnalysis/productionAnalysis/components/left-top.vue |   34 +++++++++++++++++++++++++---------
 1 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/src/views/reportAnalysis/productionAnalysis/components/left-top.vue b/src/views/reportAnalysis/productionAnalysis/components/left-top.vue
index 932def8..1f7994b 100644
--- a/src/views/reportAnalysis/productionAnalysis/components/left-top.vue
+++ b/src/views/reportAnalysis/productionAnalysis/components/left-top.vue
@@ -1,6 +1,6 @@
 <template>
   <div>
-    <PanelHeader title="宸ュ簭浜у嚭鍒嗘瀽" />
+    <PanelHeader title="宸ュ簭浜у嚭鍒嗘瀽" to="/productionManagement/processStatistics" />
     <div class="main-panel panel-item-customers">
       <div class="filters-row">
         <DateTypeSwitch v-model="dateType" @change="handleDateTypeChange" />
@@ -23,7 +23,7 @@
 </template>
 
 <script setup>
-import { ref, onMounted, onBeforeUnmount, computed } from 'vue'
+import { ref, onMounted, onBeforeUnmount, computed, inject, watch } from 'vue'
 import { processOutputAnalysis } from '@/api/viewIndex.js'
 import PanelHeader from './PanelHeader.vue'
 import Echarts from '@/components/Echarts/echarts.vue'
@@ -33,7 +33,7 @@
 const pieWrapperRef = ref(null)
 const pieBackgroundRef = ref(null)
 
-const dateType = ref(1) // 1=鍛� 2=鏈� 3=瀛e害
+const dateType = ref(3) // 1=鍛� 2=鏈� 3=瀛e害
 
 function array2obj(array, key) {
   const resObj = {}
@@ -60,7 +60,7 @@
     icon: 'circle',
     textStyle: {
       fontSize: 18,
-      color: pieColors[idx % pieColors.length],
+      color: d.color || pieColors[idx % pieColors.length],
     },
   }))
 
@@ -154,11 +154,18 @@
     .then((res) => {
       if (res.code === 200 && Array.isArray(res.data)) {
         const items = res.data
-        pieDatas.value = items.map((item) => ({
-          name: item.name,
-          value: parseFloat(item.value) || 0,
-          rate: item.rate,
-        }))
+        pieDatas.value = items.map((item) => {
+          const point = {
+            name: item.name,
+            value: parseFloat(item.value) || 0,
+            rate: item.rate,
+          }
+          if (item.color) {
+            point.color = item.color
+            point.itemStyle = { color: item.color }
+          }
+          return point
+        })
       }
     })
     .catch((err) => {
@@ -168,6 +175,13 @@
 
 const handleDateTypeChange = () => {
   fetchData()
+}
+
+const dataDashboardRefreshTick = inject('dataDashboardRefreshTick', null)
+if (dataDashboardRefreshTick) {
+  watch(dataDashboardRefreshTick, () => {
+    fetchData()
+  })
 }
 
 onMounted(() => {
@@ -189,9 +203,11 @@
 
 .panel-item-customers {
   border: 1px solid #1a58b0;
+  border-radius: 16px;
   padding: 18px;
   width: 100%;
   height: 449px;
+  overflow: hidden;
 }
 
 .filters-row {

--
Gitblit v1.9.3