From 85a36c8a6e65e7ba8e3f47c67ea762742cd0e2bc Mon Sep 17 00:00:00 2001 From: "453530270@qq.com" Date: Sat, 29 Jul 2023 10:58:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A2=B3=E7=90=86=E5=8E=9F=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E8=B0=83=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ty/index.vue | 127 +++++++++++++++++++++++++++++++++-------- 1 file changed, 103 insertions(+), 24 deletions(-) diff --git a/src/views/ty/index.vue b/src/views/ty/index.vue index 4fd4c65..37a6e09 100644 --- a/src/views/ty/index.vue +++ b/src/views/ty/index.vue @@ -62,28 +62,14 @@
24小时进馆人数
- {{ cgn_1 }} + {{ cgv_1 }} 体育场 - {{ cgn_2 }} + {{ cgv_2 }} 体育馆 - {{ cgn_3 }} + {{ cgv_3 }} 游泳场馆
- - - +
@@ -190,12 +176,19 @@ export default { data24h: [], // 场馆人次占比 groupsData: [], + // cgp 场馆比例 cgp_1:'', cgp_2:'', cgp_3:'', + // cgn 场馆名称 cgn_1:'', cgn_2:'', cgn_3:'', + // cgv 场馆值 + cgv_1:0, + cgv_2:0, + cgv_3:0, + // 趋势图 rsqsXData: [], rsqsDatas: [], @@ -248,9 +241,9 @@ export default { // this.$nextTick(()=>{ - this.addNumber(0, this.todayNum, 'insv') - this.addNumber(0, this.monthNum, 'insv2') - this.addNumber(0, this.yearNum, 'insv3') + // this.addNumber(0, this.todayNum, 'insv') + // this.addNumber(0, this.monthNum, 'insv2') + // this.addNumber(0, this.yearNum, 'insv3') // }); }, @@ -889,9 +882,9 @@ export default { }, 1500); } run(); - setInterval(function () { - run(); - }, 3000); + // setInterval(function () { + // run(); + // }, 3000); }, ty_pie(myChart,DD){ let that = this; @@ -1026,6 +1019,53 @@ export default { // }, 200) }, + // 24小时趋势 + getData24h(){ + let that = this; + homeApi.getID().then(res=>{ + // console.log(res, '====='); + let idArr = ""; + res.data.data.map(item=>{ + if(item.type==1){ + idArr += "|"+item.groupId; + } + }) + homeApi.getAllfFlow({groupsId:idArr}).then(res=>{ + // console.log(res, '====='); + that.data24h = res.data.data.dvalue; + that.data24hX = res.data.data.dkeys; + }); + }); + }, + + // 人次占比 + gethomeBarData(){ + let that = this; + homeApi.getID().then(res=>{ + // console.log(res, '====='); + let idArr = ""; + res.data.data.map(item=>{ + if(item.type==1){ + idArr += "|"+item.groupId; + } + }) + that.groupsData = []; + homeApi.homeBarData({groupsId:idArr}).then(res=>{ + // console.log(res, '====='); + res.data.data.groupsData.forEach(item=>{ + that.groupsData.push(item); + }); + // console.log(that.groupsData, 'that.groupsData') + that.cgn_1 = that.groupsData[0].noRepeatInNum; + that.cgp_1 = that.groupsData[0].proportion; + that.cgn_2 = that.groupsData[1].noRepeatInNum; + that.cgp_2 = that.groupsData[1].proportion; + that.cgn_3 = that.groupsData[2]?that.groupsData[2].noRepeatInNum:''; + that.cgp_3 = that.groupsData[2]?that.groupsData[2].proportion:''; + }); + }); + }, + // 总计 体育场馆的总数 getStat() { let that = this @@ -1065,6 +1105,45 @@ export default { }, + // 折线趋势图 + getGcgNumDatas(){ + let that = this; + homeApi.getID().then(res=>{ + // console.log(res, '====='); + let idArr = ""; + res.data.data.map(item=>{ + if(item.type==1){ + idArr += "|"+item.groupId; + } + }) + // 请求场馆对应的数据 + homeApi.allGcgNumDatas({groupsId:idArr}).then(res=>{ + // console.log(res, '====='); + const tmpdata = res.data.data; + tmpdata.forEach((item) => { + that.rsqsDataName.push(item.groupName); + that.rsqsDatas.push(item.list) + }) + + that.rsqsXData = res.data.data[0].list.dkeys; + that.rsqsDatas.forEach((item) => { + let rsqsData = [] + Object.getOwnPropertyNames(item).forEach((value) => { + + if(value=='dkeys'){ + + } + if(value=='dvalue'){ + // console.log(item, value, '-----') + // rsqsData.push(item[value]) + rsqsData = item[value]; + } + }); + that.rsqsDataAll.push(rsqsData) + }) + }); + }); + }, }, };