Browse Source

更新

lite
luyisha 3 years ago
parent
commit
f0d2b5a2cd
  1. 2
      src/App.vue
  2. 55
      src/views/index.vue

2
src/App.vue

@ -155,7 +155,7 @@ export default {
clearInterval(this.polling);
this.polling = setInterval(() => {
//
// this.autoChange();
this.autoChange();
}, 20000);
},
},

55
src/views/index.vue

@ -209,36 +209,20 @@ export default {
},
methods: {
btgetdata() {
//
let that = this;
that.proportionData = [];
that.groupNameData = [];
that.dataP = [];
// console.log(type)
let rqtp;
switch (this.klselt) {
case 'd': rqtp = "daily"; break;
case 'm': rqtp = "monthly"; break;
case 'y': rqtp = "yearly"; break;
}
// console.log(rqtp);
const reqp={
granularity:rqtp,
}
// let rqtp;
// switch (this.klselt) {
// case 'd': rqtp = "daily"; break;
// case 'm': rqtp = "monthly"; break;
// case 'y': rqtp = "yearly"; break;
// }
// allTygGroupTimeNum
homeApi.allGroupTimeNum(reqp).then(res => {
// const kldata = res.data.data.allTimeData
// //
// let kltd = new Array;
// let tmpkvd = new Array;
// const dkeys = res.data.data.dkeys
// dkeys.forEach(function (item, idx) {
// kltd.push(item)
// tmpkvd.push(kldata[item].num)
// })
// this.kltdata = kltd
// this.klvdata = tmpkvd;
//
homeApi.allGroupTimeNum().then(res => {
const tmpdata = res.data.data.allTimeData
const dkeys = res.data.data.dkeys
const groupsData = res.data.data.groupsData
@ -265,7 +249,7 @@ export default {
});
},
btgetdata2() {
//
//
let that = this;
that.proportionData = [];
that.groupNameData = [];
@ -297,7 +281,7 @@ export default {
});
},
btgetdata3() {
//
//
let that = this;
that.proportionData = [];
that.groupNameData = [];
@ -530,7 +514,13 @@ export default {
option && myChart.setOption(option);
function run(myChart) {
that.getHomeBarData();
if(that.klselt == 'd'){
that.btgetdata3();
}else if(that.klselt == 'm'){
this.btgetdata2()
}else if(that.klselt == 'y'){
this.btgetdata()
}
let xData = that.klqsXDatas.slice(-8,that.klqsXDatas.length);
let data = that.klqsDatas.slice(-8,that.klqsDatas.length);
@ -569,11 +559,12 @@ export default {
]
});
}
// that.timer1 = setInterval(function () {
// myChart.clear();
// option && myChart.setOption(option);
// run(myChart);
// }, 5000);
clearInterval(this.timer1)
that.timer1 = setInterval(function () {
myChart.clear();
option && myChart.setOption(option);
run(myChart);
}, 5000);
},
//

Loading…
Cancel
Save