diff --git a/src/views/index.vue b/src/views/index.vue
index 4ee6fdd..d26907e 100644
--- a/src/views/index.vue
+++ b/src/views/index.vue
@@ -8,8 +8,8 @@
总服务人次趋势
年
- 月
- 日
+ 月
+ 日
@@ -215,95 +215,29 @@ export default {
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();
}
+ this.btgetdata();
}, 5000);
},
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;
- // }
- // allTygGroupTimeNum
- homeApi.allGroupTimeNum().then(res => {
- const tmpdata = res.data.data.allTimeData
- const dkeys = res.data.data.dkeys
- const groupsData = res.data.data.groupsData
-
- let datas = []
- Object.values(tmpdata).forEach((value) => {
- datas.push(value.num);
- });
-
- that.klqsDatas = datas;
- that.klqsXDatas = dkeys;
-
- that.proportionData = [];that.groupNameData=[];that.dataP=[];
- groupsData.forEach((item) => {
- that.proportionData.push(item.proportion);
- that.groupNameData.push(item.groupName);
- that.dataP.push({
- name:item.groupName,
- value:item.proportion.split('%')[0]
- })
- })
-
- this.home_bar();
- });
- },
- btgetdata2() {
- //月客流
- let that = this;
- that.proportionData = [];
- that.groupNameData = [];
- that.dataP = [];
- homeApi.allGroupTimeNum2().then(res => {
- const tmpdata = res.data.data.allTimeData
- const dkeys = res.data.data.dkeys
- const groupsData = res.data.data.groupsData
-
- let datas = []
- Object.values(tmpdata).forEach((value) => {
- datas.push(value.num);
- });
-
- that.klqsDatas = datas;
- that.klqsXDatas = dkeys;
-
- that.proportionData = [];that.groupNameData=[];that.dataP=[];
- groupsData.forEach((item) => {
- that.proportionData.push(item.proportion);
- that.groupNameData.push(item.groupName);
- that.dataP.push({
- name:item.groupName,
- value:item.proportion.split('%')[0]
- })
- })
-
- this.home_bar();
- });
- },
- btgetdata3() {
- //日客流
- let that = this;
- that.proportionData = [];
- that.groupNameData = [];
- that.dataP = [];
- homeApi.allGroupTimeNum3().then(res => {
+ let rqtp;
+ switch (this.klselt) {
+ case 'd': rqtp = "daily"; break;
+ case 'm': rqtp = "monthly"; break;
+ case 'y': rqtp = "yearly"; break;
+ }
+ // allTygGroupTimeNum // /pass.passcc/allGroupTimeNum
+ homeApi.allTygGroupTimeNum({granularity:rqtp}).then(res => {
const tmpdata = res.data.data.allTimeData
const dkeys = res.data.data.dkeys
const groupsData = res.data.data.groupsData
@@ -329,6 +263,7 @@ export default {
this.home_bar();
});
},
+
//选择年月日中的某个
selitem(type) {
// console.log(type);
@@ -337,18 +272,6 @@ export default {
this.btgetdata();
this.autoTimer0();
},
- selitem2(type) {
- // console.log(type);
- this.klselt = type;
- this.btgetdata2();
- this.autoTimer0();
- },
- selitem3(type) {
- // console.log(type);
- this.klselt = type;
- this.btgetdata3();
- this.autoTimer0();
- },
// 透明背景柱状统计图--总服务人次趋势
home_bar() {
@@ -535,9 +458,9 @@ export default {
option && myChart.setOption(option);
function run(myChart) {
if(that.klselt == 'd'){
- that.btgetdata3();
+ that.btgetdata();
}else if(that.klselt == 'm'){
- that.btgetdata2()
+ that.btgetdata()
}else if(that.klselt == 'y'){
that.btgetdata()
}
@@ -579,12 +502,12 @@ export default {
]
});
}
- clearInterval(this.timer1)
- 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);
},
// 今日各场馆服务人次趋势