From 1937b5756d5befcfc140bfb313e27689686ac71a Mon Sep 17 00:00:00 2001 From: luyisha Date: Mon, 31 Jul 2023 14:33:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=A4=9A=E4=BD=99=E7=9A=84?= =?UTF-8?q?=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/index.vue | 119 ++++++++------------------------------------ 1 file changed, 21 insertions(+), 98 deletions(-) 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); }, // 今日各场馆服务人次趋势