From 668fcc32e9b9d47ed616865a4df1f4cab68fc582 Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Mon, 29 Sep 2025 01:23:01 +0800
Subject: [PATCH] 1

---
 src/views/home/components/HomeLtr.vue |   33 ++++++++++++++++++++++-----------
 1 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/src/views/home/components/HomeLtr.vue b/src/views/home/components/HomeLtr.vue
index 7e640f8..ed126f6 100644
--- a/src/views/home/components/HomeLtr.vue
+++ b/src/views/home/components/HomeLtr.vue
@@ -69,6 +69,7 @@
 </template>
 
 <script>
+let _timers = []
 import HQChart from "hqchart";
 import "hqchart/src/jscommon/umychart.resource/css/tools.css";
 import "hqchart/src/jscommon/umychart.resource/font/iconfont.css";
@@ -954,7 +955,7 @@
     ],
     SplashTitle: "loading...",
     Symbol: "600015.sh",
-    IsAutoUpdate: true, // 是自动更新数据
+    IsAutoUpdate: false, // 是自动更新数据
     AutoUpdateFrequency: 15000,
     IsApiPeriod: true,
     IsShowRightMenu: false, // 是否显示右键菜单
@@ -1078,6 +1079,10 @@
       ID: 5,
     },
     {
+      Name: i18n.t("hjsfz"),
+      ID: 6,
+    },
+    {
       Name: i18n.t("hj92"),
       ID: 7,
     },
@@ -1128,7 +1133,6 @@
       chartType: "kline",
       KLineChart: null, // 图形控件  K线图
       Chart: null, // 图形控件  分时图
-      timerss: null,
       isShow: false,
     };
   },
@@ -1146,11 +1150,17 @@
     this.init();
   },
   beforeDestroy() {
-    if (this.timerss) {
-      clearInterval(this.timerss);
-    }
+    this.clearTime();
   },
   methods: {
+    // 清除所有定时器
+    clearTime() {
+      _timers.forEach(id => {
+        clearInterval(id);
+        clearTimeout(id);
+      });
+      _timers = [];
+    },
     init() {
       this.OnSize();
       this.SetChartStyle();
@@ -1214,6 +1224,7 @@
       HQChart.Chart.JSChart.SetStyle(blackStyle);
     },
     handleClick(tab) {
+      this.clearTime();
       this.KLineChart.ChangePeriod(tab.$attrs.Id);
     },
 
@@ -1248,14 +1259,14 @@
       data,
       callback // 第3方数据替换接口
     ) {
-      if (this.timerss) {
-        clearInterval(this.timerss);
-        this.timerss = null;
-      }
+      EastMoney.HQData.Log("[HQChartDemo::NetworkFilter] data", data);
+
       this.timeChange(data, callback);
-      this.timerss = setInterval(() => {
+
+      let timerId = setInterval(() => {
         this.timeChange(data, callback);
-      }, 5000);
+      }, 2000);
+      _timers.push(timerId);
     },
     timeChange(data, callback) {
       EastMoney.HQData.Log("[HQChartDemo::NetworkFilter] data", data);

--
Gitblit v1.9.3