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/productionAnalysis/components/center-bottom.vue |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/views/reportAnalysis/productionAnalysis/components/center-bottom.vue b/src/views/reportAnalysis/productionAnalysis/components/center-bottom.vue
index 46a870a..f4f4024 100644
--- a/src/views/reportAnalysis/productionAnalysis/components/center-bottom.vue
+++ b/src/views/reportAnalysis/productionAnalysis/components/center-bottom.vue
@@ -51,7 +51,7 @@
 </template>
 
 <script setup>
-import { ref, onMounted, onBeforeUnmount, nextTick } from 'vue'
+import { ref, onMounted, onBeforeUnmount, nextTick, inject, watch } from 'vue'
 import { getProgressStatistics } from '@/api/viewIndex.js'
 import PanelHeader from './PanelHeader.vue'
 import CarouselCards from './CarouselCards.vue'
@@ -132,17 +132,22 @@
   }, 150)
 }
 
-const initProgressTableScroll = () => {
-  const tableContainer = progressTableRef.value
-  if (!tableContainer) return
+const stopProgressTableScroll = () => {
   if (progressTableScrollTimer.value) {
     cancelAnimationFrame(progressTableScrollTimer.value)
     progressTableScrollTimer.value = null
   }
-  if (tableContainer._pauseTimer) {
+  const tableContainer = progressTableRef.value
+  if (tableContainer?._pauseTimer) {
     clearInterval(tableContainer._pauseTimer)
     tableContainer._pauseTimer = null
   }
+}
+
+const initProgressTableScroll = () => {
+  const tableContainer = progressTableRef.value
+  if (!tableContainer) return
+  stopProgressTableScroll()
   const tbody = tableContainer.querySelector('tbody')
   if (!tbody) return
   const originalCount = progressTableData.value.length
@@ -198,6 +203,7 @@
 const progressStatisticsInfo = () => {
   getProgressStatistics()
     .then((res) => {
+      stopProgressTableScroll()
       if (!res || !res.data) return
       const obj = {
         totalOrderCount: res.data.totalOrderCount || 0,
@@ -224,14 +230,19 @@
     })
 }
 
+const dataDashboardRefreshTick = inject('dataDashboardRefreshTick', null)
+if (dataDashboardRefreshTick) {
+  watch(dataDashboardRefreshTick, () => {
+    progressStatisticsInfo()
+  })
+}
+
 onMounted(() => {
   progressStatisticsInfo()
 })
 
 onBeforeUnmount(() => {
-  if (progressTableScrollTimer.value) {
-    cancelAnimationFrame(progressTableScrollTimer.value)
-  }
+  stopProgressTableScroll()
   if (tableScrollTimeout.value) clearTimeout(tableScrollTimeout.value)
   const tableContainer = progressTableRef.value
   if (tableContainer?._pauseTimer) {

--
Gitblit v1.9.3