Browse Source

合并dev人房数据替换接口代码

v1.1
战立标 2 years ago
parent
commit
a42585c924
  1. 37
      src/views/dataBoard/renfang/cpts/rkyj.vue
  2. 241
      src/views/dataBoard/renfang/index.vue

37
src/views/dataBoard/renfang/cpts/rkyj.vue

@ -80,7 +80,7 @@
</template>
<script>
import { requestPostBi } from "@/js/dai/request-bipass";
import { requestPost } from "@/js/dai/request";
export default {
props: {
@ -126,26 +126,27 @@ export default {
},
async getList() {
const url = "resident_class_warn";
const { data, code, msg } = await requestPostBi(
url,
{
queryParam: {
org_id: this.orgId,
},
},
{
// mockId: 60040087,
}
);
const url = "/actual/base/peopleRoomOverview/getResidentClassWarnAnalyzed";
if (code === 0) {
if (data && Array.isArray(data)) {
this.list = data;
let params = {
org_id: this.orgId,
level:"agency",
};
if(params.org_id){
const { data, code, msg } = await requestPost(
url,
params
);
if (code === 0) {
if (data && Array.isArray(data)) {
this.list = data;
}
} else {
this.$message.error(msg);
}
} else {
this.$message.error(msg);
}
},
},

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

@ -1,24 +1,24 @@
<template>
<div>
<cpt-bread
v-if="breadList.length > 1"
:bread-list="breadList"
@tap="clickBreadItem"
@tap="clickBreadItem"
v-if="breadList.length > 1"
:bread-list="breadList"
/>
<div class="g-row">
<div class="g-left">
<div class="bgImg">
<Title text="房屋概览"/>
<fwgl ref="fwgl" :orgId="orgData.org_id"></fwgl>
<fwgl ref="fwgl" :orgId="orgId"></fwgl>
</div>
<div class="bgImg">
<Title text="居民概览"/>
<jmgl ref="jmgl" :orgId="orgData.org_id"></jmgl>
<jmgl ref="jmgl" :orgId="orgId"></jmgl>
</div>
<div class="bgImg">
<Title text="图谱画像"/>
<jdtphx :id="orgData.org_id" />
<jdtphx :id="orgId" />
</div>
</div>
@ -33,7 +33,7 @@
/>
</div>
<div>
<b>{{ perInfo.aged_ratio }}</b>
<b>{{ perInfo.OLD_PEOPLE_FLAG }}</b>
%
</div>
</div>
@ -46,13 +46,12 @@
/>
</div>
<div>
<b>{{ perInfo.teenagers_ratio }}</b>
<b>{{ perInfo.SUBSISTENCE_ALLOWANCE_FLAG }}</b>
%
</div>
</div>
</div>
<div class="item" @click="jumpPath('normal', 'aged', '失业人员')">
<div class="item" @click="jumpPath('normal', 'aged', '志愿者')">
<div class="item-info">
<div>
<img
@ -60,12 +59,11 @@
/>
</div>
<div>
<b>{{ perInfo.unemployed_ratio }}</b>
<b>{{ perInfo.UNEMPLOYED_FLAG }}</b>
%
</div>
</div>
</div>
<div class="item" @click="jumpPath('normal', 'aged', '党员')">
<div class="item-info">
<div>
@ -74,7 +72,7 @@
/>
</div>
<div>
<b>{{ perInfo.crowd_ratio }}</b>
<b>{{ perInfo.PARTY_FLAG }}</b>
%
</div>
</div>
@ -87,7 +85,7 @@
/>
</div>
<div>
<b>{{ perInfo.volunteer_ratio }}</b>
<b>{{ perInfo.VOLUNTEER_FLAG }}</b>
%
</div>
</div>
@ -100,26 +98,11 @@
/>
</div>
<div>
<b>{{ perInfo.volunteer_ratio }}</b>
<b>{{ perInfo.SPECIAL_CROWD_FLAG }}</b>
%
</div>
</div>
</div>
<!-- <div class="item">
<div class="item-info">
<div>
<img
src="~@/assets/images/shuju/renfang/index/per/ygxl.png"
/>
月更新率
</div>
<div>
<b>{{ perInfo.month_update_ratio }}</b>
%
</div>
</div>
</div>-->
</div>
<grid-map
@ -153,10 +136,10 @@
</div>
<input
v-model="searchModule.keyword"
placeholder="搜索本组织及下级的居民、小区、楼栋、房屋"
type="text"
@keyup.enter="handleSearch"
type="text"
placeholder="搜索本组织及下级的居民、小区、楼栋、房屋"
@keyup.enter="handleSearch"
v-model="searchModule.keyword"
/>
<div class="i-div"></div>
@ -211,12 +194,12 @@
</div>
</div>
<div v-if="searchModule.result.length > 0" class="card-list">
<div class="card-list" v-if="searchModule.result.length > 0">
<div
v-for="(item, index) in searchModule.result"
:key="item.title + index"
class="card-item"
@click="handleClickSearchItem(item)"
class="card-item"
:key="item.title + index"
@click="handleClickSearchItem(item)"
v-for="(item, index) in searchModule.result"
>
<span>{{ item.title }}</span>
<img
@ -230,8 +213,8 @@
</div>
</div>
<div v-else class="card-empty">
<img src="~@/assets/images/shuju/renfang/index/empty.png"/>
<div class="card-empty" v-else>
<img src="~@/assets/images/shuju/renfang/index/empty.png" />
<span>没有找到搜索结果</span>
</div>
</div>
@ -311,17 +294,17 @@
</div>
</div>
<div v-else class="empty">
<img src="~@/assets/images/shuju/renfang/index/empty.png"/>
<div class="empty" v-else>
<img src="~@/assets/images/shuju/renfang/index/empty.png" />
</div>
</div>
<div v-else>
<div v-if="resiCategoryForecastData.length > 0" class="list">
<div class="list" v-if="resiCategoryForecastData.length > 0">
<div
v-for="(item, index) in resiCategoryForecastData"
:key="item.code + index"
class="item"
@click="toResiClassPage('ai', item.code, item.name)"
@click="toResiClassPage('ai', item.code, item.name)"
class="item"
:key="item.code + index"
v-for="(item, index) in resiCategoryForecastData"
>
<div>{{ ("0" + (index + 1)).substr(-2) }}.</div>
<div class="item-name">{{ item.name }}</div>
@ -335,12 +318,12 @@
<div class="item-per">
<span>较上一年</span>
<img
v-if="item.growth >= 0"
src="~@/assets/images/shuju/renfang/index/up.png"
v-if="item.growth >= 0"
src="~@/assets/images/shuju/renfang/index/up.png"
/>
<img
v-else
src="~@/assets/images/shuju/renfang/index/down.png"
v-else
src="~@/assets/images/shuju/renfang/index/down.png"
/>
<b>{{ item.growthAbs }}</b>
<span></span>
@ -348,8 +331,8 @@
</div>
</div>
<div v-else class="empty">
<img src="~@/assets/images/shuju/renfang/index/empty.png"/>
<div class="empty" v-else>
<img src="~@/assets/images/shuju/renfang/index/empty.png" />
</div>
</div>
</div>
@ -371,12 +354,12 @@
</div>
<div class="m-subbox m-szsq">
<szsq :orgId="orgData.org_id"></szsq>
<szsq :orgId="orgId"></szsq>
</div>
</div>-->
<div class="bgImg">
<Title text="信息采集统计"></Title>
<rfsjtj :currentLevelData="{orgId: orgData.org_id}"/>
<rfsjtj :currentLevelData="{orgId: orgId}"/>
</div>
<div class="bgImg">
<Title text="人口预警"></Title>
@ -390,12 +373,12 @@
}"
class="m-subbox m-rkyj"
>
<rkyj :orgId="orgData.org_id"/>
<rkyj :orgId="orgId"/>
</div>
</div>
<div class="bgImg">
<Title text="人口分析"></Title>
<rkfx :orgId="orgData.org_id" @handelClickRkfxPei="handelClickRkfxPei"/>
<rkfx :orgId="orgId" @handelClickRkfxPei="handelClickRkfxPei"/>
</div>
</div>
@ -403,15 +386,16 @@
</div>
<resi-details
v-if="displayedResiId"
@close="popupShow = false"
:resi-id="displayedResiId"
@close="displayedResiId = ''"
:popupShow='popupShow'
v-if="popupShow"
/>
<house-details
@close="displayedHouseId = ''"
:house-id="displayedHouseId"
v-if="displayedHouseId"
:house-id="displayedHouseId"
@close="displayedHouseId = ''"
/>
</div>
</template>
@ -439,12 +423,12 @@ import jdtphx from "@/views/dataBoard/overview/components/jdtphx.vue";
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: "--",
};
}
@ -508,6 +492,8 @@ export default {
displayedHouseId: "",
pandectData: {},
popupShow:false
};
},
@ -533,7 +519,6 @@ export default {
this.loading = false;
// await this.loadOrgData();
await this.getMapData();
await this.getSubMapData();
this.getResiCategoryData();
this.getPerInfo();
this.getResiCategoryForecastData();
@ -591,6 +576,7 @@ export default {
handleClickDotBtn(type, info) {
if (type == "watch-resi") {
this.displayedResiId = info.user_id;
this.popupShow = true
} else if (type == "watch-house") {
this.displayedHouseId = info.house_id;
}
@ -696,25 +682,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);
}
@ -724,7 +729,7 @@ export default {
async getResiCategoryData() {
const url = "/actual/base/resiCategory/categoryCountList";
let params = {
// id: this.orgData.id,
// id: this.orgId,
// level: "agency",
};
const {data, code, msg} = await requestGet(url, params);
@ -773,67 +778,19 @@ export default {
//
async getMapData() {
const url = "org_map";
const {data, code, msg} = await requestPostBi(
url,
{
queryParam: {
org_id: this.orgId,
},
},
{
// mockId: 60810589,
}
);
if (code === 0) {
let info = data[0];
this.orgData = {
...info,
id: info.org_id,
name: info.org_name,
latitude: parseFloat(info.latitude),
longitude: parseFloat(info.longitude),
coordinates: info.coordinates || "",
children: [],
};
this.orgId = this.orgData.org_id;
this.orgLevel = this.orgData.level;
} else {
this.$message.error(msg);
}
},
const url = "/gov/org/agency/maporg";
let params = {
orgId: this.orgId,
level: this.orgLevel,
};
//
async getSubMapData() {
const url = "sub_org_map";
const {data, code, msg} = await requestPostBi(
url,
{
queryParam: {
org_id: this.orgId,
},
},
{
// mockId: 61831860,
}
);
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
const {orgData} = this;
orgData.children = data.map((item) => {
return {
...item,
id: item.org_id,
name: item.org_name,
latitude: parseFloat(item.latitude),
longitude: parseFloat(item.longitude),
coordinates: item.coordinates || "",
};
});
this.orgData = {...orgData};
this.orgData = data;
this.orgId = this.orgId;
this.orgLevel = this.orgData.level;
} else {
this.$message.error(msg);
}

Loading…
Cancel
Save