| | |
| | | </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"; |
| | |
| | | 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("hjsfz"), |
| | | ID: 6, |
| | | }, |
| | | { |
| | | Name: i18n.t("hj92"), |
| | | ID: 7, |
| | |
| | | chartType: "kline", |
| | | KLineChart: null, // 图形控件 K线图 |
| | | Chart: null, // 图形控件 分时图 |
| | | timerss: null, |
| | | isShow: false, |
| | | }; |
| | | }, |
| | |
| | | this.init(); |
| | | }, |
| | | beforeDestroy() { |
| | | if (this.timerss) { |
| | | clearInterval(this.timerss); |
| | | } |
| | | this.clearTime(); |
| | | }, |
| | | methods: { |
| | | // 清除所有定时器 |
| | | clearTime() { |
| | | // 创建一个额外的定时器以获取当前最大定时器 ID |
| | | let lastIntervalId = setInterval(() => {}, 1000); |
| | | // 遍历并清除所有定时器 |
| | | for (let i = 1; i <= lastIntervalId; i++) { |
| | | clearInterval(i); |
| | | clearTimeout(i); |
| | | } |
| | | _timers.forEach(id => { |
| | | clearInterval(id); |
| | | clearTimeout(id); |
| | | }); |
| | | _timers = []; |
| | | }, |
| | | init() { |
| | | this.OnSize(); |
| | |
| | | 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); |