|
|
|
@ -166,6 +166,7 @@ |
|
|
|
isPlay: false, |
|
|
|
nomore: false, |
|
|
|
page: 1, |
|
|
|
intervalId: null, |
|
|
|
needInfo: { |
|
|
|
update_time: '2023/08/30 19:00', |
|
|
|
down_scores_quota: { |
|
|
|
@ -355,10 +356,10 @@ |
|
|
|
changeChartIndex(type){ |
|
|
|
this.chartIndex = type; |
|
|
|
this.getUpDownSta(type); |
|
|
|
setTimeout(()=>{ |
|
|
|
this.myChart.clear(); |
|
|
|
this.renderChart(); |
|
|
|
}, 200) |
|
|
|
// setTimeout(()=>{ |
|
|
|
// this.myChart.clear(); |
|
|
|
// this.renderChart(); |
|
|
|
// }, 200) |
|
|
|
}, |
|
|
|
renderChart(){ |
|
|
|
let option = { |
|
|
|
@ -511,6 +512,7 @@ |
|
|
|
getUserSta(){ |
|
|
|
API.request('/adminStatistics/userStatistics', {}, res=>{ |
|
|
|
this.userStatistics = res.data; |
|
|
|
this.renderPie(); // 数据更新后立即重新渲染图表 |
|
|
|
}) |
|
|
|
}, |
|
|
|
/*总后台上下分统计数据*/ |
|
|
|
@ -523,6 +525,11 @@ |
|
|
|
this.UpDownSta.data = this.UpDownSta.histogram.map(item=>{ |
|
|
|
return item.value; |
|
|
|
}) |
|
|
|
// 在数据请求返回后进行图表的渲染 |
|
|
|
this.$nextTick(() => { |
|
|
|
this.myChart.clear(); |
|
|
|
this.renderChart(); |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
/**/ |
|
|
|
@ -557,6 +564,9 @@ |
|
|
|
} |
|
|
|
// this.userType='background'; |
|
|
|
if(this.userType=='background'){ |
|
|
|
this.intervalId = setInterval(() => { |
|
|
|
this.getUserSta(); |
|
|
|
}, 2000); |
|
|
|
// console.log(this.$refs, 'this.$refs----'); |
|
|
|
// console.log(this.$refs.piechart, 'this.$refs.piechart----'); |
|
|
|
} |
|
|
|
@ -591,7 +601,6 @@ |
|
|
|
// this.pieChart = echarts.init(this.$refs.piechart); |
|
|
|
// this.myChart = echarts.init(this.$refs.mychart); |
|
|
|
// #endif |
|
|
|
|
|
|
|
setTimeout(()=>{ |
|
|
|
this.renderPie(); |
|
|
|
this.renderChart(); |
|
|
|
@ -601,10 +610,13 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
onHide() { |
|
|
|
|
|
|
|
clearInterval(this.intervalId); |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.userType = uni.getStorageSync('userType'); |
|
|
|
// if(this.userType=='background'){ |
|
|
|
// this.getUpDownSta(); |
|
|
|
// } |
|
|
|
}, |
|
|
|
onReachBottom() { |
|
|
|
if(this.userType!=='background' && !this.nomore){ |
|
|
|
|