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/dataDashboard/components/basic/center-top.vue |  279 ++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 232 insertions(+), 47 deletions(-)

diff --git a/src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue b/src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue
index 2c0ebe5..f4e086e 100644
--- a/src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue
+++ b/src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue
@@ -5,15 +5,13 @@
       <div class="stat-card">
         <img src="@/assets/BI/icon@2x.png" alt="鍥炬爣" class="card-icon" />
         <div class="card-content">
-          <span class="card-label">鍛樺伐鎬绘暟</span>
-          <span class="card-value">{{ totalStaff }}</span>
-        </div>
-      </div>
-      <div class="stat-card">
-        <img src="@/assets/BI/icon@2x.png" alt="鍥炬爣" class="card-icon" />
-        <div class="card-content">
           <span class="card-label">瀹㈡埛鎬绘暟</span>
           <span class="card-value">{{ totalCustomers }}</span>
+          <div class="card-compare" :class="compareClass(customersYoY)">
+            <span>鍚屾瘮</span>
+            <span class="compare-value">{{ formatPercent(customersYoY) }}</span>
+            <span class="compare-icon">{{ customersYoY >= 0 ? '鈫�' : '鈫�' }}</span>
+          </div>
         </div>
       </div>
       <div class="stat-card">
@@ -21,6 +19,11 @@
         <div class="card-content">
           <span class="card-label">渚涘簲鍟嗘�绘暟</span>
           <span class="card-value">{{ totalSuppliers }}</span>
+          <div class="card-compare" :class="compareClass(suppliersYoY)">
+            <span>鍚屾瘮</span>
+            <span class="compare-value">{{ formatPercent(suppliersYoY) }}</span>
+            <span class="compare-icon">{{ suppliersYoY >= 0 ? '鈫�' : '鈫�' }}</span>
+          </div>
         </div>
       </div>
     </div>
@@ -80,7 +83,7 @@
             <div class="todo-division">寰呭姙浜嬬敱锛歿{ item.approveReason }}</div>
               <div style="display: flex;justify-content: space-between;align-items: center;"
               >
-                <div class="todo-title">鐢宠绫诲瀷锛歿{ item.approveId }}</div>
+                <div class="todo-title">鐢宠绫诲瀷锛歿{ item.approveTypeName }}</div>
                 <div class="todo-division">鐢宠閮ㄩ棬锛歿{ item.approveDeptName }}</div>
                 <div class="todo-time">{{ item.approveTime }}</div>
               </div>
@@ -95,20 +98,19 @@
 </template>
 
 <script setup>
-import { ref, onMounted, onBeforeUnmount, nextTick } from 'vue'
-import { homeTodos } from '@/api/viewIndex.js'
-import { staffOnJobListPage } from '@/api/personnelManagement/employeeRecord.js'
-import { listCustomer } from '@/api/basicData/customerFile.js'
-import { listSupplier } from '@/api/basicData/supplierManageFile.js'
+import { ref, onMounted, onBeforeUnmount, nextTick, inject, watch } from 'vue'
+import { homeTodos, summaryStatistics } from '@/api/viewIndex.js'
 import { getLedgerPage } from '@/api/equipmentManagement/ledger.js'
 import { getRepairPage } from '@/api/equipmentManagement/repair.js'
 import { getUpkeepPage } from '@/api/equipmentManagement/upkeep.js'
 import { measuringInstrumentListPage } from '@/api/equipmentManagement/measurementEquipment.js'
 
 // 缁熻鏁版嵁
-const totalStaff = ref(0)
 const totalCustomers = ref(0)
 const totalSuppliers = ref(0)
+// 鍚屾瘮
+const customersYoY = ref(0)
+const suppliersYoY = ref(0)
 const equipmentNum = ref(0)
 const equipmentRepair = ref(0)
 const equipmentMaintain = ref(0)
@@ -118,20 +120,22 @@
 const todoList = ref([])
 const refTodoList = ref(null)
 
-// 鑾峰彇鍛樺伐銆佸鎴枫�佷緵搴斿晢鏁伴噺
+const formatPercent = (val) => {
+  const num = Number(val) || 0
+  return `${Math.abs(num).toFixed(2)}%`
+}
+
+const compareClass = (val) => (val >= 0 ? 'compare-up' : 'compare-down')
+
+// 鑾峰彇瀹㈡埛銆佷緵搴斿晢鏁伴噺
 const getNum = () => {
-  const params = {
-    pageNum: -1,
-    pageSize: -1,
-  }
-  staffOnJobListPage({ ...params, staffState: 1 }).then((res) => {
-    totalStaff.value = res.data.total
-  })
-  listCustomer(params).then((res) => {
-    totalCustomers.value = res.total
-  })
-  listSupplier(params).then((res) => {
-    totalSuppliers.value = res.data.total
+  summaryStatistics().then((res) => {
+    totalCustomers.value = res.data.totalCustomer
+    customersYoY.value = res.data.customerGrowthRate
+    totalSuppliers.value = res.data.totalSupplier
+    suppliersYoY.value = res.data.supplierGrowthRate
+  }).catch(err => {
+    console.error('鑾峰彇鍩虹缁熻鏁版嵁澶辫触:', err)
   })
 }
 
@@ -155,8 +159,23 @@
   })
 }
 
+const destroyTodoListScroll = () => {
+  const todoListEl = refTodoList.value
+  if (todoListEl) {
+    if (todoListEl._animationFrame) {
+      cancelAnimationFrame(todoListEl._animationFrame)
+      todoListEl._animationFrame = null
+    }
+    if (todoListEl._pauseTimer) {
+      clearInterval(todoListEl._pauseTimer)
+      todoListEl._pauseTimer = null
+    }
+  }
+}
+
 // 鍒濆鍖栧緟鍔炰簨椤瑰垪琛ㄦ粴鍔ㄥ姛鑳�
 const initTodoListScroll = () => {
+  destroyTodoListScroll()
   const todoListEl = refTodoList.value
   // 寮哄埗鍚敤婊氬姩锛屼笉妫�鏌ヤ换浣曟潯浠�
   if (todoListEl) {
@@ -239,6 +258,7 @@
 
 // 寰呭姙浜嬮」
 const todoInfoS = () => {
+  destroyTodoListScroll()
   homeTodos().then((res) => {
     todoList.value = res.data
     // 鍦ㄨ幏鍙栧埌寰呭姙浜嬮」鏁版嵁鍚庯紝鍒濆鍖栨粴鍔ㄥ姛鑳�
@@ -248,25 +268,25 @@
   })
 }
 
-onMounted(() => {
+const refreshCenterTopData = () => {
   getNum()
   getLedgerNum()
   todoInfoS()
+}
+
+const dataDashboardRefreshTick = inject('dataDashboardRefreshTick', null)
+if (dataDashboardRefreshTick) {
+  watch(dataDashboardRefreshTick, () => {
+    refreshCenterTopData()
+  })
+}
+
+onMounted(() => {
+  refreshCenterTopData()
 })
 
 onBeforeUnmount(() => {
-  // 娓呯悊寰呭姙浜嬮」鍒楄〃鐨勫姩鐢诲拰瀹氭椂鍣�
-  const todoListEl = refTodoList.value
-  if (todoListEl) {
-    if (todoListEl._animationFrame) {
-      cancelAnimationFrame(todoListEl._animationFrame)
-      todoListEl._animationFrame = null
-    }
-    if (todoListEl._pauseTimer) {
-      clearInterval(todoListEl._pauseTimer)
-      todoListEl._pauseTimer = null
-    }
-  }
+  destroyTodoListScroll()
 })
 </script>
 
@@ -285,12 +305,52 @@
   background-position: center;
   background-repeat: no-repeat;
   height: 142px;
+  transition: all 0.3s ease;
+  position: relative;
+  overflow: hidden;
+  animation: cardFadeIn 0.6s ease-out both;
+}
+
+.stat-card:nth-child(1) { animation-delay: 0.1s; }
+.stat-card:nth-child(2) { animation-delay: 0.2s; }
+
+@keyframes cardFadeIn {
+  from { opacity: 0; transform: translateY(20px); }
+  to { opacity: 1; transform: translateY(0); }
+}
+
+.stat-card:hover {
+  transform: translateY(-3px);
+  box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
+}
+
+/* 鍗$墖搴曢儴鍏夌嚎 */
+.stat-card::after {
+  content: '';
+  position: absolute;
+  bottom: 0;
+  left: 10%;
+  right: 10%;
+  height: 2px;
+  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.5), transparent);
+  opacity: 0;
+  transition: opacity 0.3s;
+}
+
+.stat-card:hover::after {
+  opacity: 1;
 }
 
 .card-icon {
-  width: 100px;
-  height: 100px;
+  width: 70px;
+  height: 70px;
   margin: 20px 20px 0 10px;
+  animation: iconFloat 4s ease-in-out infinite;
+}
+
+@keyframes iconFloat {
+  0%, 100% { transform: translateY(0); }
+  50% { transform: translateY(-5px); }
 }
 
 .card-content {
@@ -301,23 +361,90 @@
 
 .card-value {
   font-weight: 500;
-  font-size: 40px;
+  font-size: 32px;
   background: linear-gradient(360deg, #008bfd 0%, #ffffff 100%);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
+  transition: all 0.3s ease;
+}
+
+.stat-card:hover .card-value {
+  text-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
+  transform: scale(1.05);
 }
 
 .card-label {
   font-weight: 400;
-  font-size: 19px;
+  font-size: 16px;
   color: rgba(208, 231, 255, 0.7);
+}
+
+.card-compare {
+  display: flex;
+  align-items: center;
+  gap: 6px;
+  font-size: 15px;
+  color: #d0e7ff;
+}
+
+.card-compare > span:first-child {
+  font-size: 13px;
+  opacity: 0.8;
+}
+
+.compare-value {
+  font-weight: 600;
+}
+
+.compare-icon {
+  font-size: 14px;
+  position: relative;
+  top: -1px; /* 杞诲井涓婄Щ锛岃绠ご涓庢枃瀛楀瀭鐩村眳涓榻� */
+}
+
+.compare-up .compare-value,
+.compare-up .compare-icon {
+  color: #00c853;
+}
+
+.compare-down .compare-value,
+.compare-down .compare-icon {
+  color: #ff5252;
 }
 
 .equipment-stats {
   border: 1px solid #1a58b0;
   padding: 18px;
   height: 240px;
+  padding-top: 0px;
+  margin-bottom: 20px;
+  position: relative;
+  overflow: hidden;
+}
+
+/* 璁惧缁熻闈㈡澘瑙掕惤瑁呴グ */
+.equipment-stats::before,
+.equipment-stats::after {
+  content: '';
+  position: absolute;
+  width: 15px;
+  height: 15px;
+  border-color: rgba(0, 212, 255, 0.5);
+  border-style: solid;
+  pointer-events: none;
+}
+
+.equipment-stats::before {
+  top: -1px;
+  left: -1px;
+  border-width: 2px 0 0 2px;
+}
+
+.equipment-stats::after {
+  bottom: -1px;
+  right: -1px;
+  border-width: 0 2px 2px 0;
 }
 
 .equipment-header {
@@ -364,7 +491,7 @@
 .equipment-value {
   display: block;
   font-weight: 500;
-  font-size: 40px;
+  font-size: 36px;
   color: #ffffff;
   width: 120px;
   height: 110px;
@@ -374,6 +501,13 @@
   background-position: center;
   background-repeat: no-repeat;
   margin-bottom: 8px;
+  transition: all 0.3s ease;
+  animation: valuePulse 3s ease-in-out infinite;
+}
+
+@keyframes valuePulse {
+  0%, 100% { text-shadow: 0 0 10px rgba(78, 228, 255, 0.2); }
+  50% { text-shadow: 0 0 20px rgba(78, 228, 255, 0.4); }
 }
 
 .equipment-label {
@@ -388,7 +522,35 @@
   background-position: center;
   background-repeat: no-repeat;
   padding: 20px;
-  height: 186px;
+  padding-top: 10px;
+  height: 480px;
+  flex: 1;
+  position: relative;
+  overflow: hidden;
+}
+
+/* 浜嬩欢闈㈡澘瑙掕惤瑁呴グ */
+.event-info::before,
+.event-info::after {
+  content: '';
+  position: absolute;
+  width: 15px;
+  height: 15px;
+  border-color: rgba(0, 212, 255, 0.5);
+  border-style: solid;
+  pointer-events: none;
+}
+
+.event-info::before {
+  top: -1px;
+  left: -1px;
+  border-width: 2px 0 0 2px;
+}
+
+.event-info::after {
+  bottom: -1px;
+  right: -1px;
+  border-width: 0 2px 2px 0;
 }
 
 .event-header {
@@ -412,7 +574,7 @@
   list-style: none;
   padding: 0;
   margin: 0;
-  height: 120px; /* 鎸夌敤鎴疯姹傝皟鏁撮珮搴� */
+  height: 210px;
   overflow: hidden;
   font-size: 15px;
 }
@@ -425,6 +587,29 @@
   display: flex;
   justify-content: space-between;
   align-items: center;
+  transition: all 0.3s ease;
+  position: relative;
+}
+
+.todo-list li:hover {
+  background: rgba(0, 212, 255, 0.08);
+  transform: translateX(5px);
+}
+
+.todo-list li::after {
+  content: '';
+  position: absolute;
+  left: 0;
+  right: 0;
+  bottom: 0;
+  height: 1px;
+  background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.3), transparent);
+  opacity: 0;
+  transition: opacity 0.3s;
+}
+
+.todo-list li:hover::after {
+  opacity: 1;
 }
 
 .todo-title {

--
Gitblit v1.9.3