人更新后更新户

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

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

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

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

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

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

Loading…
Cancel
Save