1
PC-20250623MANY\Administrator
2025-08-30 2f0e1b6d97a7003ab7d9b99670b027ff66d63eff
src/page/kline/components/kLine.vue
@@ -954,7 +954,7 @@
    ],
    SplashTitle: "loading...",
    Symbol: "600015.sh",
    IsAutoUpdate: true, // 是自动更新数据
    IsAutoUpdate: false, // 是自动更新数据
    AutoUpdateFrequency: 15000,
    IsApiPeriod: true,
    IsShowRightMenu: false, // 是否显示右键菜单
@@ -1071,14 +1071,14 @@
      Name: i18n.t("hj89"),
      ID: 2
    },
    {
      Name: i18n.t("hj90"),
      ID: 4
    },
    {
      Name: i18n.t("hj91"),
      ID: 5
    },
    // {
    //   Name: i18n.t("hj90"),
    //   ID: 4
    // },
    // {
    //   Name: i18n.t("hj91"),
    //   ID: 5
    // },
    {
      Name: i18n.t("hj92"),
      ID: 7
@@ -1169,9 +1169,9 @@
    // this.CreateKLineChart();
    this.$nextTick(() => {
      this.CreateMinuteChart();
      // this.CreateMinuteChart();
      this.CreateKLineChart();
      // this.timerss = setInterval(() => {
      //   // this.KLineChart = null
      //   // this.CreateMinuteChart();
@@ -1218,11 +1218,19 @@
  beforeDestroy() {
    clearInterval(this.timerss); // 在组件销毁前清除定时器
    this.timerss = null;
  },
  destroyed() {
    clearInterval(this.timerss); // 在组件销毁前清除定时器
    this.clearTime();
  },
  methods: {
    // 清除所有定时器
    clearTime() {
      // 创建一个额外的定时器以获取当前最大定时器 ID
      let lastIntervalId = setInterval(() => {}, 1000);
      // 遍历并清除所有定时器
      for (let i = 1; i <= lastIntervalId; i++) {
        clearInterval(i);
        clearTimeout(i);
      }
    },
    OnSize() {
      var width = this.$refs.right.clientWidth;
      // var rightTab = this.$refs.rightTab
@@ -1284,8 +1292,7 @@
      option.Symbol = this.Symbol;
      option.NetworkFilter = (data, callback) => {
        console.log("data, callback", data, callback);
        // console.log("data, callback", data, callback);
        this.NetworkFilter(data, callback);
      }; // 网络请求回调函数
      var chart = HQChart.Chart.JSChart.Init(this.$refs.kline2);
@@ -1328,7 +1335,7 @@
      item,
      type // K线周期
    ) {
      console.log("1");
      this.clearTime();
      //分时额外处理才注释的
      this.chartType = type;
      this.KLinePeriodIndex = index;
@@ -1361,11 +1368,8 @@
      data,
      callback // 第3方数据替换接口
    ) {
      // EastMoney.HQData.Log("[HQChartDemo::NetworkFilter] data", data);
      if (this.timerss) {
        clearInterval(this.timerss);
        this.timerss = null;
      }
      EastMoney.HQData.Log("[HQChartDemo::NetworkFilter] data", data);
      this.getFilter(data, callback);
      this.timerss = setInterval(() => {
        this.getFilter(data, callback);