From 0eeb39d97ff6d647a89484b80fd28c18b1e2892c Mon Sep 17 00:00:00 2001
From: jhzh <1628036192@qq.com>
Date: Wed, 23 Oct 2024 14:58:38 +0800
Subject: [PATCH] 1

---
 src/page/kline/components/kLine.vue |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/src/page/kline/components/kLine.vue b/src/page/kline/components/kLine.vue
index 4e0db31..ab87dd2 100644
--- a/src/page/kline/components/kLine.vue
+++ b/src/page/kline/components/kLine.vue
@@ -994,6 +994,8 @@
   },
   data() {
     return {
+      key:0,
+      active:0,
       MinuteDayMenu: DefaultData.GetMinuteDayMenu(),
       MinuteDayIndex: 0,
       KLinePeriodMenu: DefaultData.GetKLinePeriodMenu(),
@@ -1015,10 +1017,12 @@
 
       VolChartHeight: 10,
       chartType: "kline",
+      timerss:null,
       isShow: false,
       xData: [],
     };
   },
+
   created() {
     const { query } = this.$route;
     if (query.if_zhishu === "0") {
@@ -1040,8 +1044,18 @@
     this.OnSize();
     this.SetChartStyle();
     this.$nextTick(() => {
-      // this.CreateMinuteChart();
-      this.CreateKLineChart();
+      this.CreateMinuteChart();
+        this.CreateKLineChart();
+  //     this.timerss = setInterval(() => {
+  //       this.CreateKLineChart();
+  //       console.log(this.KLinePeriodMenu);
+		// // this.KLineChart.ChangePeriod(this.KLinePeriodMenu[this.KLinePeriodIndex].ID);
+		// //此处为了 让k线实时刷新
+		// this.OnClickKLinePeriodMenu(this.KLinePeriodIndex, 0, 'kline')
+		// this.OnClickKLinePeriodMenu(this.KLinePeriodIndex, this.KLinePeriodMenu[this.KLinePeriodIndex], 'kline')
+  //       // this.OnClickKLinePeriodMenu(this.KLinePeriodIndex+1, this.KLinePeriodMenu[this.KLinePeriodIndex+1], 'kline')
+  //       // this.OnClickKLinePeriodMenu(this.KLinePeriodIndex-1, this.KLinePeriodMenu[this.KLinePeriodIndex-1], 'kline')
+  //     }, 5000);
     });
     let that = this;
     window.onresize = _.debounce(this.OnSize, 200);
@@ -1075,8 +1089,12 @@
       that.OnSize();
     });
   },
-
+  beforeDestroy() {
+        clearInterval(this.timerss); // 在组件销毁前清除定时器
+        this.timerss = null
+      },
   methods: {
+
     OnSize() {
       var width = this.$refs.right.clientWidth;
       // var rightTab = this.$refs.rightTab
@@ -1117,7 +1135,7 @@
     },
 
     CreateMinuteChart() {
-      if (this.Chart) return;
+      // if (this.Chart) return;
 
       var option = DefaultData.GetMinuteOption();
       option.Symbol = this.Symbol;
@@ -1137,6 +1155,8 @@
       option.Symbol = this.Symbol;
       option.NetworkFilter = (data, callback) => {
         this.NetworkFilter(data, callback);
+
+        // this.NetworkFilter(data, callback);
       }; // 网络请求回调函数
       var chart = HQChart.Chart.JSChart.Init(this.$refs.kline2);
       HQChart.Chart.JSChart.GetResource().FrameLogo.Text = null;
@@ -1178,6 +1198,7 @@
       item,
       type // K线周期
     ) {
+    console.log('1');
       //分时额外处理才注释的
       this.chartType = type;
       this.KLinePeriodIndex = index;

--
Gitblit v1.9.3