From cbe874c9dcc0ebbbcb87110c26abf6a6d527cb96 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期四, 05 二月 2026 09:38:00 +0800
Subject: [PATCH] fix: 大屏样式修改

---
 src/views/reportAnalysis/productionAnalysis/components/right-top.vue |   47 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/src/views/reportAnalysis/productionAnalysis/components/right-top.vue b/src/views/reportAnalysis/productionAnalysis/components/right-top.vue
index 9004362..33ef67b 100644
--- a/src/views/reportAnalysis/productionAnalysis/components/right-top.vue
+++ b/src/views/reportAnalysis/productionAnalysis/components/right-top.vue
@@ -2,6 +2,9 @@
   <div>
     <PanelHeader title="宸ュ崟鎵ц鏁堢巼鍒嗘瀽" />
     <div class="main-panel panel-item-customers">
+      <div class="filters-row">
+        <DateTypeSwitch v-model="dateType" @change="handleDateTypeChange" />
+      </div>
       <Echarts
         ref="chart"
         :chartStyle="chartStyle"
@@ -20,13 +23,16 @@
 
 <script setup>
 import { ref, onMounted } from 'vue'
-import { qualityStatistics } from '@/api/viewIndex.js'
+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 }
@@ -124,26 +130,25 @@
   },
 ]
 
+const handleDateTypeChange = () => {
+  fetchData()
+}
+
 const fetchData = () => {
-  qualityStatistics()
+  workOrderEfficiencyAnalysis({ dateType: dateType.value })
     .then((res) => {
-      if (!res?.data?.item || !Array.isArray(res.data.item)) return
-      const items = res.data.item
+      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.processNum) || 0)
-      // 瀹屾垚锛氬嚭鍘傛暟
-      chartSeries.value[1].data = items.map((d) => Number(d.factoryNum) || 0)
-      // 鑹搧鐜囷細鍑哄巶鏁�/杩囩▼鏁�*100锛堟棤鍗曠嫭鎺ュ彛鏃剁敤姝ゅ崰浣嶏級
-      chartSeries.value[2].data = items.map((d) => {
-        const processNum = Number(d.processNum) || 0
-        const factoryNum = Number(d.factoryNum) || 0
-        if (processNum <= 0) return 0
-        return Math.min(100, Math.round((factoryNum / processNum) * 100))
-      })
+      // 寮�宸�
+      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)
     })
 }
 
@@ -159,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