Browse Source

修改地图搜索接口

v1.1
战立标 2 years ago
parent
commit
2af1719092
  1. 72
      src/views/dataBoard/renfang/cpts/fwgl.vue
  2. 172
      src/views/dataBoard/renfang/index.vue

72
src/views/dataBoard/renfang/cpts/fwgl.vue

@ -100,16 +100,16 @@ export default {
this.getData();
})
},
watch: {
// orgId() {
// this.getData();
// },
watch: {
// orgId() {
// this.getData();
// },
pandectData: {
immediate: true,
deep:true,
deep: true,
handler(newData) {
this.pandectData = newData
this.iniPieChart();
this.iniPieChart();
}
}
@ -191,35 +191,36 @@ export default {
},
//
iniPieChart() {
this.$refs.pieChart.clear();
// pieChart
this.pieOption = pieOption();
const {pandectData} = this
//
this.pieOption.title.text = pandectData.homeCount;
this.pieData = [
{value: pandectData.selfStay, name: "自住"},
{value: pandectData.rentOut, name: "出租"},
{value: pandectData.vacantHouse, name: "闲置"},
];
const temp = [...this.pieData,{value:pandectData.homeCount, name: "总数"}]
this.pieOption.series[0].data = this.pieData;
console.log(this.pieOption, 'this.pieOption.series')
this.$refs.pieChart.setOption(this.pieOption);
let than = this
let currentIndex = 0;
this.$nextTick(() => {
this.$refs.pieChart.clear();
// pieChart
this.pieOption = pieOption();
const {pandectData} = this
//
this.pieOption.title.text = pandectData.homeCount;
this.pieData = [
{value: pandectData.selfStay, name: "自住"},
{value: pandectData.rentOut, name: "出租"},
{value: pandectData.vacantHouse, name: "闲置"},
];
const temp = [...this.pieData, {value: pandectData.homeCount, name: "总数"}]
this.pieOption.series[0].data = this.pieData;
console.log(this.pieOption, 'this.pieOption.series')
this.$refs.pieChart.setOption(this.pieOption);
let than = this
let currentIndex = 0;
//
this.$refs.pieChart.myChart.off('click').on('click', (param) =>{ //使functionthisVueComponent
currentIndex = (currentIndex + 1) %temp.length;
const currentData =temp[currentIndex];
const percentage = ((currentData.value / pandectData.homeCount) * 100).toFixed(2);
than.$refs.pieChart.myChart.setOption({
title: {
text:currentData.name == '总数'?pandectData.homeCount: `${percentage}%`,
subtext: currentData.name,
}
});
let index;
this.$refs.pieChart.myChart.off('click').on('click', (param) => { //使functionthisVueComponent
currentIndex = (currentIndex + 1) % temp.length;
const currentData = temp[currentIndex];
const percentage = ((currentData.value / pandectData.homeCount) * 100).toFixed(2);
than.$refs.pieChart.myChart.setOption({
title: {
text: currentData.name == '总数' ? pandectData.homeCount : `${percentage}%`,
subtext: currentData.name,
}
});
let index;
//dataIndex
index = param.dataIndex;
//
@ -228,6 +229,7 @@ export default {
this.toListPage(index, param.name)
}
});
})
// this.$refs.pieChart.hideLoading()
},
@ -487,9 +489,11 @@ export default {
.margintop18 {
margin-top: 18px;
}
.pie-right {
width: calc(100% - 200px);
}
.new-number {
display: flex;
flex-wrap: wrap;

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

@ -1,9 +1,9 @@
<template>
<div>
<cpt-bread
@tap="clickBreadItem"
v-if="breadList.length > 1"
:bread-list="breadList"
v-if="breadList.length > 1"
:bread-list="breadList"
@tap="clickBreadItem"
/>
<div class="g-row">
<div class="g-left">
@ -41,7 +41,7 @@
<div class="item-info">
<div>
<img
src="~@/assets/images/shuju/renfang/index/per/qsn.png"
src="~@/assets/images/shuju/renfang/index/per/qsn.png"
/>
</div>
<div>
@ -153,41 +153,41 @@
<div class="card-tabs">
<div
:class="{
'z-on': searchModule.resultTab == '0',
'z-on': searchModule.resultTab == 'all',
}"
@click="searchModule.resultTab = '0'"
@click="searchModule.resultTab = 'all'"
>
全部
</div>
<div
:class="{
'z-on': searchModule.resultTab == '1',
'z-on': searchModule.resultTab == 'resident',
}"
@click="searchModule.resultTab = '1'"
@click="searchModule.resultTab = 'resident'"
>
居民
</div>
<div
:class="{
'z-on': searchModule.resultTab == '2',
'z-on': searchModule.resultTab == 'quarter',
}"
@click="searchModule.resultTab = '2'"
@click="searchModule.resultTab = 'quarter'"
>
小区
</div>
<div
:class="{
'z-on': searchModule.resultTab == '3',
'z-on': searchModule.resultTab == 'build',
}"
@click="searchModule.resultTab = '3'"
@click="searchModule.resultTab = 'build'"
>
楼栋
</div>
<div
:class="{
'z-on': searchModule.resultTab == '4',
'z-on': searchModule.resultTab == 'home',
}"
@click="searchModule.resultTab = '4'"
@click="searchModule.resultTab = 'home'"
>
房屋
</div>
@ -355,7 +355,7 @@
</div>
</div>
<cpt-loading v-show="false" />
<cpt-loading v-show="false"/>
</div>
<resi-details
@ -450,7 +450,7 @@ export default {
searchModule: {
displayedCard: false,
keyword: "",
resultTab: "0", // 0 1234
resultTab: "all", // 0 1234
result: [
// {
// id: 1,
@ -504,8 +504,8 @@ export default {
const {agencyId} = this.$store.state.user;
const url = "/actual/base/residentHouseMerge/communityOverview";
let params = {
agencyId:this.orgId,
orgId:this.orgId ,
agencyId: this.orgId,
orgId: this.orgId,
level: this.orgLevel,
};
console.log(params);
@ -571,7 +571,7 @@ export default {
clickAgencyItem(item) {
console.log(item);
if (item.level === 'neighborHood') {
this.$router.push('/homeDetails/index?id='+item.id)
this.$router.push('/homeDetails/index?id=' + item.id)
} else {
this.toBread({
orgId: item.id,
@ -608,36 +608,32 @@ export default {
//
async handleSearch() {
this.searchModule.result = [];
const { searchModule } = this;
const url = [
"search_all",
"search_resident",
"search_village",
"search_building",
"search_house",
][searchModule.resultTab];
const {data, code, msg} = await requestPostBi(
const {searchModule} = this;
/* const url = [
"search_all",
"search_resident",
"search_village",
"search_building",
"search_house",
][searchModule.resultTab];*/
let url = '/actual/base/peopleRoomOverview/getSearchResult'
const {data, code, msg} = await requestPost(
url,
{
queryParam: {
org_id: this.orgId,
name: this.searchModule.keyword,
},
org_id: this.orgId,
content: this.searchModule.keyword,
searchType: searchModule.resultTab
},
{
// mockId: 60044224,
// mockId: 60048067,
}
);
if (code === 0) {
this.searchModule.result = data.map((item) => {
let type = item.type || searchModule.resultTab;
let type = item.type;
let title = "";
let detailJson = {};
if (searchModule.resultTab == 0) {
let detailJson = item.detail_json;
// if (searchModule.resultTab == 0) {
title = item.name;
if (typeof item.detail_json == "string") {
try {
@ -646,14 +642,15 @@ export default {
console.log(e);
}
}
} else if (type == "1") {
if (type == "1") {
title = item.user_name;
} else if (type == "2") {
title = item.village_name;
title = item.detail_json.village;
} else if (type == "3") {
title = item.village_name + "-" + item.building_name;
console.log(item,'detailJson')
title = detailJson.village + "-" + detailJson.building;
} else if (type == "4") {
title = item.building + "-" + item.unit + "-" + item.door;
title = item.center_addre;
}
return {
title,
@ -661,7 +658,7 @@ export default {
...item,
...detailJson,
};
});
})
} else {
this.$message.error(msg);
}
@ -671,13 +668,13 @@ export default {
async getPerInfo() {
const url = "/actual/base/resiCategory/categoryCountPartList";
let params = {
orgId: this.orgId,
agencyId: this.orgId,
level: this.orgLevel,
};
const { data, code, msg } = await requestGet(
url,
params
orgId: this.orgId,
agencyId: this.orgId,
level: this.orgLevel,
};
const {data, code, msg} = await requestGet(
url,
params
);
if (code === 0 && data) {
// this.perInfo = {
@ -686,23 +683,23 @@ export default {
// };
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);
}
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 {
@ -722,7 +719,7 @@ export default {
// id: this.orgId,
// level: "agency",
};
const { data, code, msg } = await requestGet(url, params);
const {data, code, msg} = await requestGet(url, params);
if (code === 0) {
if (data) {
this.resiCategoryData = data.categoryList.map((item) => {
@ -746,26 +743,26 @@ export default {
const {agencyId} = this.$store.state.user;
const url = "/actual/base/resiCategory/intelligentPredictioncategoryCountList";
let params = {
agencyId:agencyId,
orgId:this.orgId,
agencyId: agencyId,
orgId: this.orgId,
level: this.orgLevel,
};
const {data, code, msg} = await requestGet(url, params);
if (code === 0) {
this.resiCategoryForecastData = data.categoryList.map((item) => {
return {
code: item.categoryName,
name: resiCategoryMap[item.categoryName] || "",
count: item.categoryCountNext,
// name:item.categoryCountName,
per: parseInt(
this.resiCategoryForecastData = data.categoryList.map((item) => {
return {
code: item.categoryName,
name: resiCategoryMap[item.categoryName] || "",
count: item.categoryCountNext,
// name:item.categoryCountName,
per: parseInt(
(100 * item.categoryCount) / data.resiCount
),
// per: item.change_ratio,
growth: item.change_ratio,
growthAbs: Math.abs(item.categoryCountNext - item.categoryCount)
};
});
),
// per: item.change_ratio,
growth: item.change_ratio,
growthAbs: Math.abs(item.categoryCountNext - item.categoryCount)
};
});
} else {
this.$message.error(msg);
}
@ -780,7 +777,7 @@ export default {
level: this.orgLevel,
};
const { data, code, msg } = await requestPost(url, params);
const {data, code, msg} = await requestPost(url, params);
if (code === 0) {
this.orgData = data;
@ -827,6 +824,7 @@ export default {
.m-box {
height: 323px;
}
.map-bottom {
margin: 0 17px;
}

Loading…
Cancel
Save