人更新后更新户

master
许宏杰 6 months ago
parent c8111f4e53
commit 4ae303e3c2

@ -30,5 +30,6 @@ const getters = {
netWorkintroduce: (state) => state.xiaoqu.netWorkintroduce,
panel: (state) => state.xiaoqu.panel,
houseItem: (state) => state.xiaoqu.houseItem,
refreshBuild: (state) => state.xiaoqu.refreshBuild,
};
export default getters;

@ -11,8 +11,12 @@ const xiaoqu = {
netWorkintroduce: {},
panel: {},
houseItem: {},
refreshBuild: 1,
},
mutations: {
SET_REFRESH: (state, refresh) => {
state.refreshBuild = refresh;
},
SET_PANEL: (state, boolean) => {
for (let key in boolean) {
state.panel[key] = boolean[key];
@ -77,6 +81,7 @@ const xiaoqu = {
isj: undefined,
};
state.houseItem = {};
state.refreshBuild = 1;
},
},
actions: {

@ -10,16 +10,22 @@
{{ info.floor - index }}
</div>
</div>
<div class="building-house-container">
<div
ref="build"
class="building-house-container"
v-loading="loading"
element-loading-background="rgba(0, 0, 0, 0.8)"
element-loading-text="加载中"
>
<div class="building-name">{{ info.deptname }}{{ info.name }}</div>
<div class="house" v-for="(item, index) in groupedRooms" :key="index">
<colorCell
:active="currentIndex == house.keyId ? 'activeCell' : ''"
:active="currentIndex == house.id ? 'activeCell' : ''"
:isClcik="true"
:item="house"
v-for="(house, houseIndex) in item"
:key="houseIndex"
@clickHouse="clickHouse(house, house.keyId)"
@clickHouse="clickHouse(house, house.id)"
></colorCell>
</div>
</div>
@ -36,6 +42,7 @@ import { v4 as uuidv4 } from "uuid";
export default {
data() {
return {
loading: true,
show: false,
info: {},
list: [],
@ -48,9 +55,11 @@ export default {
"leftColor",
"rightTopColor",
"houseItem",
"refreshBuild",
]),
groupedRooms() {
console.log(this.list.length, "总房屋数");
if (this.list.length == 0) return;
if (this.info.deptname == "嘉华园") {
//
const sortedRooms = this.list.sort((a, b) => {
@ -83,7 +92,7 @@ export default {
floors.forEach((floorRooms) => {
floorRooms.sort((a, b) => parseInt(a.name) - parseInt(b.name));
});
// console.log(floors);
return floors.reverse();
}
},
@ -94,6 +103,7 @@ export default {
watch: {
"queryParamsXiaoqu.buildingId"(newValue, oldValue) {
if (newValue) {
this.show = true;
this.getBuildingInfo();
this.getBuildingList();
} else {
@ -104,6 +114,11 @@ export default {
"houseItem.id"(newValue, oldValue) {
if (!newValue) this.currentIndex = 0;
},
refreshBuild(newValue, oldValue) {
if (newValue > 1) {
this.getBuildingList();
}
},
},
created() {},
methods: {
@ -123,14 +138,7 @@ export default {
? this.houseItem.buildingWidth
: window.innerWidth - this.$refs.houseItem.offsetWidth,
name: item.name,
// color: item.color,
// isD: item.is_d,
// isJ: item.is_j,
// isK: item.is_k,
// isx: item.is_x,
// typename: item.typename,
// leftColor: item.leftColor,
// rightTopColor: item.rightTopColor,
keyId: keyId,
});
this.currentIndex = keyId;
},
@ -139,19 +147,17 @@ export default {
this.info = info.data;
},
async getBuildingList() {
this.loading = true;
this.$refs.build.scrollIntoView({
behavior: "smooth", //
});
let res = await getNum({
buildingId: this.queryParamsXiaoqu.buildingId,
});
this.currentIndex = this.houseItem.keyId;
this.list = res.data;
this.show = true;
// this.list = this.groupedRooms(res.data);
// let num = 0;
// this.list.forEach((item) => {
// num = num + item.length;
// });
// console.log(num, res.data.length);
this.loading = false;
this.$store.commit("SET_REFRESH", 1);
},
//

@ -252,7 +252,10 @@
:label="dict.value"
v-for="dict in dict.type.b_census_color_type"
:key="dict.value"
>{{ dict.value }}</el-radio
>{{ dict.value }}
{{
dict.value == "HZ" ? "(有户口自住)" : "(有户口不住)"
}}</el-radio
>
</el-radio-group>
</el-form-item>
@ -264,7 +267,10 @@
:label="dict.value"
v-for="dict in dict.type.b_flow_color_type"
:key="dict.value"
>{{ dict.value }}</el-radio
>{{ dict.value }}
{{
dict.value == "NZ" ? "(没户口自住)" : "(没户口租客)"
}}</el-radio
>
</el-radio-group>
</el-form-item>
@ -420,6 +426,7 @@ export default {
})
.then(() => {
this.getPersonList();
this.setrefresh(4);
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
@ -449,6 +456,7 @@ export default {
updatePerson(this.form).then((response) => {
this.open = false;
this.getPersonList();
this.setrefresh(3);
this.$modal.msgSuccess("修改成功");
});
} else {
@ -459,12 +467,18 @@ export default {
addPerson(this.form).then((res) => {
this.open = false;
this.getPersonList();
this.setrefresh(2);
this.$modal.msgSuccess("新增成功");
});
}
}
});
},
setrefresh(type) {
this.$store.commit("SET_REFRESH", type);
},
addPerson() {
this.reset();
this.title = "添加居民";

@ -298,6 +298,16 @@ export default {
let _this = this;
const arr = mars3d.Util.geoJsonToGraphics(res);
arr.map((item, index) => {
let id = item.attr.Id;
if (
id == 245 ||
id == 251 ||
id == 248 ||
id == 254 ||
id == 257 ||
id == 260
)
return;
const polygonEntity = new mars3d.graphic.PolygonEntity({
id: item.id,
positions: item.positions,
@ -306,20 +316,10 @@ export default {
fill: false,
outline: true,
fill: true,
color:
item.attr.Id == 254 ||
item.attr.Id == 257 ||
item.attr.Id == 260
? "#545454"
: "#ffeb3b",
color: "#ffeb3b",
opacity: 0.3,
outlineWidth: 2,
outlineColor:
item.attr.Id == 254 ||
item.attr.Id == 257 ||
item.attr.Id == 260
? "#545454"
: "#ffeb3b",
outlineColor: "#ffeb3b",
label: {
opacity: 1,
text: item.attr.name,

Loading…
Cancel
Save