From 1855bc3a974b2e8deb8bf291524437e1911e192c Mon Sep 17 00:00:00 2001 From: "453530270@qq.com" Date: Mon, 14 Aug 2023 16:37:04 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A5=BC=E5=9B=BE=E8=B0=83=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/HomeView.vue | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index b29e0f6..be586a2 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -243,7 +243,11 @@ export default { this.showorders() // 环图数据 const ccdata = res.data.data.groupsData - let tcdata =new Array;that.circularData.groupName=[];that.circularData.proportion=[]; + + let tcdata =new Array; + that.circularData.groupName=[]; + that.circularData.proportion=[]; + ccdata.forEach(function(item,idx){ // idx tcdata.push({ @@ -650,10 +654,6 @@ export default { homeApi.allGroupNum().then(res => { // get allTimeData const tmpdata = res.data.returnData - // that.day_num = tmpdata.day.noRepeatInNum - // that.week_num = tmpdata.week.noRepeatInNum - // that.mon_num = tmpdata.month.noRepeatInNum - // that.year_num = tmpdata.year.noRepeatInNum //年度总人数 const ycount= tmpdata.year.noRepeatInNum @@ -694,16 +694,33 @@ export default { // 饼图、各场馆实时服务人次数据 const pieData = jstr.realTimeData.data; - that.circularData.groupName=[];that.circularData.proportion=[];that.kcdata=[]; - pieData.forEach((item) => { + // 对数据进行排序 + const yord=[2,0,4,5,1,3] + // array + that.circularData.groupName=[]; + that.circularData.proportion=[]; + that.kcdata=[]; + // 按照yord 进行填充 + for(let x=0;x { + // that.circularData.groupName.push(item.groupName) + // that.circularData.proportion.push(item.proportion) + // that.kcdata.push({ + // name:item.groupName, + // value:item.proportion.split('%')[0] + // // value: item.noRepeatInNum, + // }) + // }) // 环形图 this.cgchart()