From 57226169f40cb0e2b2349dd37b739d5c1197a889 Mon Sep 17 00:00:00 2001 From: luyisha Date: Tue, 1 Aug 2023 10:49:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/cultrue/index.vue | 14 +++++++++++++- src/views/index.vue | 12 ++++++++++++ src/views/ty/index.vue | 14 +++++++++++++- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/views/cultrue/index.vue b/src/views/cultrue/index.vue index 46852ec..12beb3c 100644 --- a/src/views/cultrue/index.vue +++ b/src/views/cultrue/index.vue @@ -536,6 +536,9 @@ export default { getLibraryData(){ let that = this; homeApi.getLibraryLeaseData().then(res=>{ + if(!res.data){ + return; + } that.newreader = res.data.data.newreader; that.returncount = res.data.data.returncount; that.servcount = res.data.data.servcount; @@ -837,6 +840,9 @@ export default { gethomeBarData(){ let that = this; homeApi.libflow().then(res=>{ + if(!res.data){ + return; + } const rtdata = res.data.data // that.todayNum = rtdata.today.incount @@ -891,6 +897,9 @@ export default { }) // 获取24小时服务数据 homeApi.wh24hdata().then(res=>{ + if(!res.data){ + return; + } that.data24h = res.data.data.dvalue; that.data24hX = res.data.data.dkeys; }) @@ -910,7 +919,10 @@ export default { // }) homeApi.whDaydata().then(res=>{ - console.log( 'toDayGroupsEnterNum',res); + // console.log( 'toDayGroupsEnterNum',res); + if(!res.data){ + return; + } const tmpdata = res.data.data; tmpdata.forEach((item) => { that.rsqsDataName.push(item.groupName); diff --git a/src/views/index.vue b/src/views/index.vue index 93500b4..6f98502 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -239,6 +239,9 @@ export default { } // allTygGroupTimeNum // /pass.passcc/allGroupTimeNum homeApi.allTygGroupTimeNum({granularity:rqtp}).then(res => { + if(!res.data){ + return; + } const tmpdata = res.data.data.allTimeData const dkeys = res.data.data.dkeys @@ -698,6 +701,9 @@ export default { getStat() { let that = this homeApi.allGroupNum().then(res => { + if(!res.data){ + return; + } // get allTimeData const tmpdata = res.data.returnData this.day_num = tmpdata.day.noRepeatInNum @@ -710,6 +716,9 @@ export default { getPieData() { let that = this; homeApi.homeBarData().then(res => { + if(!res.data){ + return; + } // /pass.passcc/allGroupTimeNum&granularity=daily // get allTimeData const pieData = res.data.data.groupsData; @@ -755,6 +764,9 @@ export default { that.rsqsData_z = []; homeApi.allGcgNumDatas().then(res => { // /pass.passcc/toDayGroupsEnterNum' + if(!res.data){ + return; + } const tmpdata = res.data.data tmpdata.forEach((item) => { this.rsqsDataName.push(item.groupName); diff --git a/src/views/ty/index.vue b/src/views/ty/index.vue index b3137e8..88cac2f 100644 --- a/src/views/ty/index.vue +++ b/src/views/ty/index.vue @@ -873,6 +873,9 @@ export default { } }) homeApi.getAllfFlow({groupsId:idArr}).then(res=>{ + if(!res.data){ + return; + } // console.log(res, '====='); that.data24h = res.data.data.dvalue; that.data24hX = res.data.data.dkeys; @@ -900,9 +903,12 @@ export default { // 场馆人次占比 homeApi.homeBarData({groupsId:idArr}).then(res=>{ + if(!res.data){ + return; + } // console.log(res, '=场馆人次占比='); that.groupsData = []; - console.log(res.data.data.groupsData) + // console.log(res.data.data.groupsData) res.data.data.groupsData.forEach(item=>{ that.groupsData.push(item); that.cgdata.push({ @@ -942,6 +948,9 @@ export default { }) homeApi.allGroupNum({granularity:"daily",groupsId:groups}).then(res=>{ + if(!res.data){ + return; + } const rtdata = res.data.returnData that.todayNum = rtdata.day.noRepeatInNum that.weekNum = rtdata.week.noRepeatInNum @@ -970,6 +979,9 @@ export default { // 请求场馆对应的数据 homeApi.allGcgNumDatas({groupsId:idArr}).then(res=>{ // console.log(res, '====='); + if(!res.data){ + return; + } const tmpdata = res.data.data; tmpdata.forEach((item) => { that.rsqsDataName.push(item.groupName);