From 8441f2f0c75eb274b13227bf555c117c04c0da26 Mon Sep 17 00:00:00 2001 From: duanliangtao Date: Tue, 28 Nov 2023 17:32:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=E6=88=BF=E6=A6=82?= =?UTF-8?q?=E8=A7=88=E9=83=A8=E5=88=86=E7=9A=84=E9=A1=B6=E9=83=A8=E4=BA=BA?= =?UTF-8?q?=E7=BE=A4=E7=B1=BB=E5=88=AB=EF=BC=8C=E6=8E=A5=E5=85=A5=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1api=E8=80=8C=E4=B8=8D=E5=86=8D=E7=94=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=AD=E5=8F=B0api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dataBoard/renfang/index.vue | 75 +++++++++++++++++---------- 1 file changed, 47 insertions(+), 28 deletions(-) diff --git a/src/views/dataBoard/renfang/index.vue b/src/views/dataBoard/renfang/index.vue index e6e6b4af1..351b059b4 100644 --- a/src/views/dataBoard/renfang/index.vue +++ b/src/views/dataBoard/renfang/index.vue @@ -47,7 +47,7 @@ />老年人
- {{ perInfo.aged_ratio }} + {{ perInfo.OLD_PEOPLE_FLAG }} %
@@ -60,7 +60,7 @@ />低保人员
- {{ perInfo.teenagers_ratio }} + {{ perInfo.SUBSISTENCE_ALLOWANCE_FLAG }} %
@@ -73,7 +73,7 @@ />志愿者
- {{ perInfo.volunteer_ratio }} + {{ perInfo.VOLUNTEER_FLAG }} %
@@ -86,7 +86,7 @@ />党员
- {{ perInfo.crowd_ratio }} + {{ perInfo.PARTY_FLAG }} %
@@ -99,7 +99,7 @@ />失业人员
- {{ perInfo.unemployed_ratio }} + {{ perInfo.UNEMPLOYED_FLAG }} %
@@ -110,10 +110,10 @@ - 月更新率 + 特殊人群
- {{ perInfo.month_update_ratio }} + {{ perInfo.SPECIAL_CROWD_FLAG }} %
@@ -444,12 +444,12 @@ import resiCategoryMap from "@/views/business/resi-category-map.js"; function iniGetPerInfo() { return { - unemployed_ratio: "--", - crowd_ratio: "--", - volunteer_ratio: "--", - month_update_ratio: "--", - aged_ratio: "--", - teenagers_ratio: "--", + OLD_PEOPLE_FLAG: "--", + PARTY_FLAG: "--", + UNEMPLOYED_FLAG: "--", + VOLUNTEER_FLAG: "--", + SUBSISTENCE_ALLOWANCE_FLAG: "--", + SPECIAL_CROWD_FLAG: "--", }; } @@ -700,25 +700,44 @@ export default { //地图上居民分类百分比数据 ps:感觉有点重复显示 async getPerInfo() { - const url = "resident_ratio"; - const { data, code, msg } = await requestPostBi( + const url = "/actual/base/resiCategory/categoryCountPartList"; + + let params = { + orgId: this.orgId, + }; + + const { data, code, msg } = await requestGet( url, - { - queryParam: { - org_id: this.orgId, - }, - }, - { - // mockId: 61167746, - } + params ); - if (code === 0) { - this.perInfo = { - ...iniGetPerInfo(), - ...data[0], - }; + if (code === 0 && data) { + // this.perInfo = { + // ...iniGetPerInfo(), + // ...data[0], + // }; + const resiCount = data.resiCount; + Object.keys(data.categoryList).forEach((key) => { + const category = data.categoryList[key]; + const categoryName = category.categoryName; + const categoryCount = category.categoryCount; + const radio = categoryCount/resiCount * 100; + if(categoryName == "OLD_PEOPLE_FLAG"){ + this.perInfo.OLD_PEOPLE_FLAG=radio.toFixed(2); + }else if(categoryName == "PARTY_FLAG"){ + this.perInfo.PARTY_FLAG=radio.toFixed(2); + }else if(categoryName == "UNEMPLOYED_FLAG"){ + this.perInfo.UNEMPLOYED_FLAG=radio.toFixed(2); + }else if(categoryName == "VOLUNTEER_FLAG"){ + this.perInfo.VOLUNTEER_FLAG=radio.toFixed(2); + }else if(categoryName == "SUBSISTENCE_ALLOWANCE_FLAG"){ + this.perInfo.SUBSISTENCE_ALLOWANCE_FLAG=radio.toFixed(2); + }else if(categoryName == "SPECIAL_CROWD_FLAG"){ + this.perInfo.SPECIAL_CROWD_FLAG=radio.toFixed(2); + } + }); + } else { this.$message.error(msg); }