From bc365ef47ae4e01754aeadbae26170e11c9bb80e Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 22 六月 2026 16:56:12 +0800
Subject: [PATCH] 新疆马铃薯 1.删除按钮添加操作权限

---
 src/views/reportAnalysis/qualityAnalysis/components/left-top.vue |  225 +++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 174 insertions(+), 51 deletions(-)

diff --git a/src/views/reportAnalysis/qualityAnalysis/components/left-top.vue b/src/views/reportAnalysis/qualityAnalysis/components/left-top.vue
index 7debef5..5036d17 100644
--- a/src/views/reportAnalysis/qualityAnalysis/components/left-top.vue
+++ b/src/views/reportAnalysis/qualityAnalysis/components/left-top.vue
@@ -13,13 +13,8 @@
 
         <div class="inspect-body">
           <div class="ring">
-            <Echarts
-              :chartStyle="ringChartStyle"
-              :series="buildRingSeries(section)"
-              :tooltip="ringTooltip"
-              :legend="{ show: false }"
-              :options="ringOptions"
-            />
+            <Echarts :chartStyle="ringChartStyle" :series="buildRingSeries(section)" :tooltip="ringTooltip"
+              :legend="{ show: false }" :options="ringOptions" />
           </div>
 
           <div class="stats">
@@ -51,42 +46,72 @@
 </template>
 
 <script setup>
-import { reactive } from 'vue'
+import { reactive, onMounted } from 'vue'
 import Echarts from '@/components/Echarts/echarts.vue'
 import PanelHeader from './PanelHeader.vue'
 import DateTypeSwitch from './DateTypeSwitch.vue'
+import { rawMaterialDetection, processDetection, factoryDetection } from '@/api/viewIndex.js'
 
 const QUALIFIED_COLOR = '#4EE4FF'
 const UNQUALIFIED_COLOR = '#3378FF'
 const TRACK_COLOR = 'rgba(78, 228, 255, 0.12)'
 
+const apiMap = {
+  raw: rawMaterialDetection,
+  process: processDetection,
+  final: factoryDetection,
+}
+
+
+const fetchSectionData = async (section) => {
+  const api = apiMap[section.key]
+  if (!api) return
+
+  try {
+    const res = await api({
+      type: section.dateType,
+    })
+
+    if (res?.code === 200 && res?.data) {
+      const data = res.data
+      section.qualifiedCount = Number(data.qualifiedCount || 0)
+      section.unqualifiedCount = Number(data.unqualifiedCount || 0)
+      section.qualifiedRate = Number(data.qualifiedRate || 0)
+      section.unqualifiedRate = Number(data.unqualifiedRate || 0)
+    }
+  } catch (err) {
+    console.error(`${section.key} 鎺ュ彛璇锋眰澶辫触`, err)
+  }
+}
+
+
 const sections = reactive([
   {
     key: 'raw',
     title: '鍘熸潗鏂欐娴�',
-    dateType: 1,
-    qualifiedCount: 199,
-    unqualifiedCount: 99,
-    qualifiedRate: 90,
-    unqualifiedRate: 10,
+    dateType: 3,
+    qualifiedCount: 0,
+    unqualifiedCount: 0,
+    qualifiedRate: 0,
+    unqualifiedRate: 0,
   },
   {
     key: 'process',
     title: '杩囩▼妫�娴�',
-    dateType: 1,
-    qualifiedCount: 199,
-    unqualifiedCount: 99,
-    qualifiedRate: 90,
-    unqualifiedRate: 10,
+    dateType: 3,
+    qualifiedCount: 0,
+    unqualifiedCount: 0,
+    qualifiedRate: 0,
+    unqualifiedRate: 0,
   },
   {
     key: 'final',
     title: '鎴愬搧鍑哄巶妫�娴�',
-    dateType: 1,
-    qualifiedCount: 199,
-    unqualifiedCount: 99,
-    qualifiedRate: 90,
-    unqualifiedRate: 10,
+    dateType: 3,
+    qualifiedCount: 0,
+    unqualifiedCount: 0,
+    qualifiedRate: 0,
+    unqualifiedRate: 0,
   },
 ])
 
@@ -183,19 +208,19 @@
   const section = sections.find((s) => s.key === key)
   if (!section) return
   section.dateType = dateType
-  const rates = calcRates(section.qualifiedCount, section.unqualifiedCount)
-  section.qualifiedRate = rates.qualifiedRate
-  section.unqualifiedRate = rates.unqualifiedRate
+  // 鍒囨崲鏃ユ湡绫诲瀷鏃堕噸鏂拌幏鍙栨暟鎹�
+  fetchSectionData(section)
 }
 
-sections.forEach((s) => {
-  const rates = calcRates(s.qualifiedCount, s.unqualifiedCount)
-  s.qualifiedRate = rates.qualifiedRate
-  s.unqualifiedRate = rates.unqualifiedRate
+// 缁勪欢鎸傝浇鏃惰幏鍙栨墍鏈塻ection鐨勬暟鎹�
+onMounted(() => {
+  sections.forEach((section) => {
+    fetchSectionData(section)
+  })
 })
 </script>
 
-<style scoped>
+<style scoped lang="scss">
 .main-panel {
   display: flex;
   flex-direction: column;
@@ -213,17 +238,13 @@
   .filters-row-left {
     width: 50%;
     color: white;
-    /* 鐢╢lex鏇夸唬float锛岃瀛愬厓绱犲榻愭洿绋冲畾 */
     display: flex;
     align-items: center;
 
     span {
-      /* 鏍稿績锛氱埗绾х浉瀵瑰畾浣嶏紝浣滀负浼厓绱犲熀鍑� */
       position: relative;
       display: inline-block;
-      /* 缁欎吉鍏冪礌鍜屾枃瀛楃暀绌洪棿 */
       padding-left: 22px;
-      /* 鏂囧瓧鍨傜洿灞呬腑 */
       line-height: 23px;
       margin-right: 8px;
 
@@ -238,8 +259,8 @@
         top: 50%;
         left: 0;
         transform: translateY(-50%);
-        /* 纭繚鑿卞舰鍦ㄦ笎鍙樺潡涓婃柟 */
         z-index: 1;
+        animation: diamondPulse 2s ease-in-out infinite;
       }
 
       &::before {
@@ -248,11 +269,10 @@
         width: 18px;
         height: 7px;
         border-radius: 8px;
-        background: linear-gradient(360deg, rgba(33,133,255,0.4) 0%, rgba(33,221,255,0) 100%);
+        background: linear-gradient(360deg, rgba(33, 133, 255, 0.4) 0%, rgba(33, 221, 255, 0) 100%);
         position: absolute;
         top: 50%;
         left: -1px;
-        /* 绮惧噯璐村湪鑿卞舰姝d笅鏂� */
         transform: translateY(calc(0% + 8px));
         z-index: 0;
       }
@@ -261,26 +281,58 @@
     p {
       width: 100px;
       height: 23px;
-      /* 娓愬彉璧峰鑹插拰鑿卞舰缁熶竴锛屾洿鍗忚皟 */
       background: linear-gradient(90deg, #217AFF 0%, rgba(33, 221, 255, 0) 100%);
-      /* 绮惧噯鍨傜洿灞呬腑 */
       line-height: 26px;
       text-align: center;
       color: white;
-      /* 鐢ㄩ珮搴︾殑涓�鍗婂仛鍦嗚锛岀‘淇濆乏杈规槸瀹岀編鍗婂渾 */
       border-radius: 12px 0 0 12px;
-      /* 鍙�夛細鍔犱竴鐐瑰乏鍐呰竟璺濓紝璁╂枃瀛椾笉璐磋竟 */
       padding-left: 4px;
+      animation: titleShimmer 3s ease-in-out infinite;
     }
   }
+}
+
+@keyframes diamondPulse {
+  0%, 100% { opacity: 0.8; }
+  50% { opacity: 1; box-shadow: 0 0 10px rgba(33, 133, 255, 0.5); }
+}
+
+@keyframes titleShimmer {
+  0%, 100% { opacity: 1; }
+  50% { opacity: 0.85; }
 }
 
 .panel-item-customers {
   border: 1px solid #1a58b0;
   padding: 14px 18px;
   width: 100%;
-  height: 960px;
+  height: 958px;
   box-sizing: border-box;
+  position: relative;
+}
+
+/* 闈㈡澘瑙掕惤瑁呴グ */
+.panel-item-customers::before,
+.panel-item-customers::after {
+  content: '';
+  position: absolute;
+  width: 20px;
+  height: 20px;
+  border-color: rgba(0, 212, 255, 0.5);
+  border-style: solid;
+  pointer-events: none;
+}
+
+.panel-item-customers::before {
+  top: -1px;
+  left: -1px;
+  border-width: 2px 0 0 2px;
+}
+
+.panel-item-customers::after {
+  bottom: -1px;
+  right: -1px;
+  border-width: 0 2px 2px 0;
 }
 
 .inspect-block {
@@ -291,7 +343,24 @@
   padding: 8px 0;
   gap: 6px;
   position: relative;
+  animation: blockFadeIn 0.5s ease-out both;
+  animation-delay: calc(var(--index, 0) * 0.1s);
 }
+
+@keyframes blockFadeIn {
+  from {
+    opacity: 0;
+    transform: translateX(-20px);
+  }
+  to {
+    opacity: 1;
+    transform: translateX(0);
+  }
+}
+
+.inspect-block:nth-child(1) { --index: 0; }
+.inspect-block:nth-child(2) { --index: 1; }
+.inspect-block:nth-child(3) { --index: 2; }
 
 .inspect-block:not(:last-child)::after {
   content: '';
@@ -308,7 +377,7 @@
   flex: 1 1 auto;
   min-height: 0;
   display: flex;
-  justify-content:space-around;
+  justify-content: space-around;
   align-items: center;
   gap: 18px;
 }
@@ -321,26 +390,36 @@
   display: flex;
   align-items: center;
   justify-content: center;
+  animation: ringFloat 4s ease-in-out infinite;
 }
 
-/* 澶栧湀鍒诲害锛堢偣鐘剁幆锛� */
+@keyframes ringFloat {
+  0%, 100% { transform: translateY(0); }
+  50% { transform: translateY(-3px); }
+}
+
+/* 澶栧湀鍒诲害锛堢偣鐘剁幆锛�- 鏃嬭浆鍔ㄧ敾 */
 .ring::before {
   content: '';
   position: absolute;
   inset: -8px;
   border-radius: 50%;
-  background: repeating-conic-gradient(
-    from 0deg,
-    rgba(78, 228, 255, 0.75) 0 1deg,
-    rgba(78, 228, 255, 0) 1deg 9deg
-  );
+  background: repeating-conic-gradient(from 0deg,
+      rgba(78, 228, 255, 0.75) 0 1deg,
+      rgba(78, 228, 255, 0) 1deg 9deg);
   -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%);
   mask: radial-gradient(circle, transparent 62%, #000 63%);
   opacity: 0.35;
   pointer-events: none;
+  animation: ringRotate 30s linear infinite;
 }
 
-/* 鏌斿拰鍙戝厜鑳屾櫙 */
+@keyframes ringRotate {
+  from { transform: rotate(0deg); }
+  to { transform: rotate(360deg); }
+}
+
+/* 鏌斿拰鍙戝厜鑳屾櫙 - 鑴夊啿鍔ㄧ敾 */
 .ring::after {
   content: '';
   position: absolute;
@@ -349,6 +428,12 @@
   background: radial-gradient(circle, rgba(78, 228, 255, 0.18) 0%, rgba(78, 228, 255, 0.06) 40%, rgba(0, 0, 0, 0) 70%);
   filter: blur(0.2px);
   pointer-events: none;
+  animation: ringGlow 3s ease-in-out infinite;
+}
+
+@keyframes ringGlow {
+  0%, 100% { opacity: 0.8; transform: scale(1); }
+  50% { opacity: 1; transform: scale(1.02); }
 }
 
 .stats {
@@ -369,6 +454,32 @@
   border: 1px solid rgba(78, 228, 255, 0.22);
   background: linear-gradient(90deg, rgba(33, 122, 255, 0.28) 0%, rgba(10, 28, 58, 0.35) 55%, rgba(10, 28, 58, 0.2) 100%);
   box-shadow: inset 0 0 18px rgba(16, 45, 95, 0.25);
+  transition: all 0.3s ease;
+  position: relative;
+  overflow: hidden;
+}
+
+/* 缁熻琛屾偓鍋滄晥鏋� */
+.stat-row:hover {
+  border-color: rgba(0, 212, 255, 0.4);
+  box-shadow: inset 0 0 18px rgba(16, 45, 95, 0.25), 0 0 15px rgba(0, 212, 255, 0.15);
+}
+
+/* 缁熻琛屽簳閮ㄥ厜绾� */
+.stat-row::after {
+  content: '';
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  height: 1px;
+  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.4), transparent);
+  opacity: 0;
+  transition: opacity 0.3s;
+}
+
+.stat-row:hover::after {
+  opacity: 1;
 }
 
 .stat-left {
@@ -385,6 +496,12 @@
   border-radius: 2px;
   display: inline-block;
   box-shadow: 0 0 10px rgba(78, 228, 255, 0.25);
+  animation: dotPulse 2s ease-in-out infinite;
+}
+
+@keyframes dotPulse {
+  0%, 100% { box-shadow: 0 0 10px rgba(78, 228, 255, 0.25); }
+  50% { box-shadow: 0 0 15px rgba(78, 228, 255, 0.5); }
 }
 
 .dot-qualified {
@@ -408,6 +525,12 @@
   min-width: 40px;
   text-align: right;
   text-shadow: 0 0 10px rgba(78, 228, 255, 0.15);
+  transition: all 0.3s ease;
+}
+
+.stat-row:hover .stat-value {
+  text-shadow: 0 0 15px rgba(78, 228, 255, 0.4);
+  transform: scale(1.05);
 }
 
 .stat-percent {

--
Gitblit v1.9.3