Browse Source

修改人房概览部分的顶部人群类别,接入业务api而不再用数据中台api

V1.0
duanliangtao 2 years ago
parent
commit
8441f2f0c7
  1. 75
      src/views/dataBoard/renfang/index.vue

75
src/views/dataBoard/renfang/index.vue

@ -47,7 +47,7 @@
/>
</div>
<div>
<b>{{ perInfo.aged_ratio }}</b>
<b>{{ perInfo.OLD_PEOPLE_FLAG }}</b>
%
</div>
</div>
@ -60,7 +60,7 @@
/>
</div>
<div>
<b>{{ perInfo.teenagers_ratio }}</b>
<b>{{ perInfo.SUBSISTENCE_ALLOWANCE_FLAG }}</b>
%
</div>
</div>
@ -73,7 +73,7 @@
/>
</div>
<div>
<b>{{ perInfo.volunteer_ratio }}</b>
<b>{{ perInfo.VOLUNTEER_FLAG }}</b>
%
</div>
</div>
@ -86,7 +86,7 @@
/>
</div>
<div>
<b>{{ perInfo.crowd_ratio }}</b>
<b>{{ perInfo.PARTY_FLAG }}</b>
%
</div>
</div>
@ -99,7 +99,7 @@
/>
</div>
<div>
<b>{{ perInfo.unemployed_ratio }}</b>
<b>{{ perInfo.UNEMPLOYED_FLAG }}</b>
%
</div>
</div>
@ -110,10 +110,10 @@
<img
src="~@/assets/images/shuju/renfang/index/per/ygxl.png"
/>
月更新率
特殊人群
</div>
<div>
<b>{{ perInfo.month_update_ratio }}</b>
<b>{{ perInfo.SPECIAL_CROWD_FLAG }}</b>
%
</div>
</div>
@ -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);
}

Loading…
Cancel
Save