From 75435383608c681cb4158b22c166bc3a3cd33c96 Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期五, 15 五月 2026 13:26:48 +0800
Subject: [PATCH] Merge branch 'dev_NEW_pro' of http://114.132.189.42:9002/r/product-inventory-management into dev_NEW_pro

---
 src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue |   45 +++++++++++++++++++++++++++++++--------------
 1 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue b/src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue
index 8a58783..a7d0174 100644
--- a/src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue
+++ b/src/views/reportAnalysis/dataDashboard/components/basic/center-top.vue
@@ -110,7 +110,7 @@
 </template>
 
 <script setup>
-import { ref, onMounted, onBeforeUnmount, nextTick } from 'vue'
+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'
@@ -175,8 +175,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) {
@@ -259,6 +274,7 @@
 
 // 寰呭姙浜嬮」
 const todoInfoS = () => {
+  destroyTodoListScroll()
   homeTodos().then((res) => {
     todoList.value = res.data
     // 鍦ㄨ幏鍙栧埌寰呭姙浜嬮」鏁版嵁鍚庯紝鍒濆鍖栨粴鍔ㄥ姛鑳�
@@ -268,25 +284,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>
 
@@ -442,6 +458,7 @@
   background-position: center;
   background-repeat: no-repeat;
   padding: 20px;
+  padding-top: 10px;
   height: 186px;
 }
 

--
Gitblit v1.9.3