From da4257bc32483409af02a06dd342c6981ec786ec Mon Sep 17 00:00:00 2001
From: liulijun <liulijun@hnkhzn.com>
Date: 星期一, 17 十一月 2025 17:14:14 +0800
Subject: [PATCH] 更新大屏幕页面和任务信息页面

---
 项目代码/BigScreen/src/utils/resizeMixin.js |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/BigScreen/src/utils/resizeMixin.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/BigScreen/src/utils/resizeMixin.js"
new file mode 100644
index 0000000..a4d25bc
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/BigScreen/src/utils/resizeMixin.js"
@@ -0,0 +1,32 @@
+// 娣峰叆浠g爜 resize-mixins.js
+import { debounce } from '@/utils';
+const resizeChartMethod = '$__resizeChartMethod';
+
+export default {
+  data() {
+    // 鍦ㄧ粍浠跺唴閮ㄥ皢鍥捐〃 init 鐨勫紩鐢ㄦ槧灏勫埌 chart 灞炴�т笂
+    return {
+      chart: null,
+    };
+  },
+  created() {
+    window.addEventListener('resize', this[resizeChartMethod], false);
+  },
+  activated() {
+    // 闃叉 keep-alive 涔嬪悗鍥捐〃鍙樺舰
+    if (this.chart) {
+      this.chart.resize()
+    }
+  },
+  beforeDestroy() {
+    window.removeEventListener('reisze', this[resizeChartMethod]);
+  },
+  methods: {
+    // 闃叉姈鍑芥暟鏉ユ帶鍒� resize 鐨勯鐜�
+    [resizeChartMethod]: debounce(function() {
+      if (this.chart) {
+        this.chart.resize();
+      }
+    }, 300),
+  },
+};

--
Gitblit v1.9.3