1
PC-20250623MANY\Administrator
2025-09-23 01d33e0271209b14ed364ccdb5d6ed0270a906af
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);