From 2088822f2bca6d93ad3e550a166a9b18332747fd Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 05 二月 2026 10:55:36 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New' into dev_New

---
 src/views/reportAnalysis/productionAnalysis/components/right-top.vue |   60 ++++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 42 insertions(+), 18 deletions(-)

diff --git a/src/views/reportAnalysis/productionAnalysis/components/right-top.vue b/src/views/reportAnalysis/productionAnalysis/components/right-top.vue
index e6717d1..d3a9eb9 100644
--- a/src/views/reportAnalysis/productionAnalysis/components/right-top.vue
+++ b/src/views/reportAnalysis/productionAnalysis/components/right-top.vue
@@ -2,9 +2,21 @@
   <div>
     <PanelHeader title="宸ュ崟鎵ц鏁堢巼鍒嗘瀽" />
     <div class="main-panel panel-item-customers">
-      <Echarts ref="chart" :chartStyle="chartStyle" :grid="grid" :legend="barLegend" :series="chartSeries"
-        :tooltip="tooltip" :xAxis="xAxis1" :yAxis="yAxis1"
-        :options="{ backgroundColor: 'transparent', textStyle: { color: '#B8C8E0' } }" style="height: 260px" />
+      <div class="filters-row">
+        <DateTypeSwitch v-model="dateType" @change="handleDateTypeChange" />
+      </div>
+      <Echarts
+        ref="chart"
+        :chartStyle="chartStyle"
+        :grid="grid"
+        :legend="barLegend"
+        :series="chartSeries"
+        :tooltip="tooltip"
+        :xAxis="xAxis1"
+        :yAxis="yAxis1"
+        :options="{ backgroundColor: 'transparent', textStyle: { color: '#B8C8E0' } }"
+        style="height: 260px"
+      />
     </div>
   </div>
 </template>
@@ -14,10 +26,13 @@
 import { workOrderEfficiencyAnalysis } from '@/api/viewIndex.js'
 import PanelHeader from './PanelHeader.vue'
 import Echarts from '@/components/Echarts/echarts.vue'
+import DateTypeSwitch from './DateTypeSwitch.vue'
+
+const dateType = ref(1) // 1=鍛� 2=鏈� 3=瀛e害
 
 const chartStyle = {
   width: '100%',
-  height: '160%',
+  height: '140%',
 }
 
 const grid = { left: '3%', right: '4%', bottom: '3%', top: '10%', containLabel: true }
@@ -115,24 +130,25 @@
   },
 ]
 
+const handleDateTypeChange = () => {
+  fetchData()
+}
+
 const fetchData = () => {
-  workOrderEfficiencyAnalysis()
+  workOrderEfficiencyAnalysis({ dateType: dateType.value })
     .then((res) => {
-      // 鏍规嵁浣犵殑缁撴瀯锛屾暟鎹洿鎺ュ湪 res.data 涓�
-      if (!res?.data || !Array.isArray(res.data)) return
-
-      const list = res.data
-
-      xAxis1.value[0].data = list.map((item) => item.date)
-
-      chartSeries.value[0].data = list.map((item) => Number(item.startQuantity) || 0)
-
-      chartSeries.value[1].data = list.map((item) => Number(item.finishQuantity) || 0)
-
-      chartSeries.value[2].data = list.map((item) => Number(item.yieldRate) || 0)
+      if (res.code !== 200 || !Array.isArray(res.data)) return
+      const items = res.data
+      xAxis1.value[0].data = items.map((d) => d.date)
+      // 寮�宸�
+      chartSeries.value[0].data = items.map((d) => Number(d.startQuantity) || 0)
+      // 瀹屾垚
+      chartSeries.value[1].data = items.map((d) => Number(d.finishQuantity) || 0)
+      // 鑹搧鐜�
+      chartSeries.value[2].data = items.map((d) => Math.min(100, parseFloat(d.yieldRate) || 0))
     })
     .catch((err) => {
-      console.error('鑾峰彇宸ュ崟鏁堢巼鏁版嵁澶辫触:', err)
+      console.error('鑾峰彇宸ュ崟鎵ц鏁堢巼鍒嗘瀽澶辫触:', err)
     })
 }
 
@@ -148,6 +164,14 @@
   gap: 20px;
 }
 
+.filters-row {
+  display: flex;
+  justify-content: flex-end;
+  align-items: center;
+  gap: 12px;
+  margin-bottom: 10px;
+}
+
 .panel-item-customers {
   border: 1px solid #1a58b0;
   padding: 18px;

--
Gitblit v1.9.3