|
@@ -493,20 +493,20 @@
|
|
|
console.log("组件销毁前清除定时器")
|
|
|
},
|
|
|
methods: {
|
|
|
- clearTimer() {
|
|
|
- if (this.intervalId) {
|
|
|
- clearInterval(this.intervalId); // 清除定时器
|
|
|
- this.intervalId = null; // 重置定时器ID
|
|
|
- }
|
|
|
- },
|
|
|
- startInterval() {
|
|
|
- this.clearTimer(); // 组件销毁前清除定时器
|
|
|
- this.intervalId = setInterval(() => {
|
|
|
- // 每隔5秒运行的代码
|
|
|
- // console.log('这段代码每隔5秒运行一次');
|
|
|
- this.getPowerConsumption(0, true)
|
|
|
- }, 60000);
|
|
|
- },
|
|
|
+ // clearTimer() {
|
|
|
+ // if (this.intervalId) {
|
|
|
+ // clearInterval(this.intervalId); // 清除定时器
|
|
|
+ // this.intervalId = null; // 重置定时器ID
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // startInterval() {
|
|
|
+ // this.clearTimer(); // 组件销毁前清除定时器
|
|
|
+ // this.intervalId = setInterval(() => {
|
|
|
+ // // 每隔5秒运行的代码
|
|
|
+ // // console.log('这段代码每隔5秒运行一次');
|
|
|
+ // this.getPowerConsumption(0, true)
|
|
|
+ // }, 60000);
|
|
|
+ // },
|
|
|
merchantChange(item, index) {
|
|
|
var m = item;
|
|
|
var n = this.merchantList1[this.current];
|