Browse Source

年月日三个图表“轮播”

lite
luyisha 3 years ago
parent
commit
1c6fbfcfb2
  1. 26
      src/views/index.vue

26
src/views/index.vue

@ -180,6 +180,7 @@ export default {
groupNameData: [], groupNameData: [],
timer1: null,// timer1: null,//
timer2: null,// timer2: null,//
timer0: null,//
}; };
}, },
// //
@ -206,8 +207,24 @@ export default {
this.index_pie1(); this.index_pie1();
}, 1000) }, 1000)
this.autoTimer0();
}, },
methods: { methods: {
autoTimer0(){
clearInterval(this.timer0);
this.timer0 = setInterval(() => {
if(this.klselt == 'y'){
this.klselt = 'm';
this.btgetdata2();
}else if(this.klselt == 'm'){
this.klselt = 'd';
this.btgetdata3();
}else if(this.klselt == 'd'){
this.klselt = 'y';
this.btgetdata();
}
}, 5000);
},
btgetdata() { btgetdata() {
// //
let that = this; let that = this;
@ -317,17 +334,20 @@ export default {
// console.log(type); // console.log(type);
this.klselt = type; this.klselt = type;
// this.getHomeBarData(); // this.getHomeBarData();
this.btgetdata() this.btgetdata();
this.autoTimer0();
}, },
selitem2(type) { selitem2(type) {
// console.log(type); // console.log(type);
this.klselt = type; this.klselt = type;
this.btgetdata2() this.btgetdata2();
this.autoTimer0();
}, },
selitem3(type) { selitem3(type) {
// console.log(type); // console.log(type);
this.klselt = type; this.klselt = type;
this.btgetdata3() this.btgetdata3();
this.autoTimer0();
}, },
// -- // --

Loading…
Cancel
Save