diff --git a/src/store/getters.js b/src/store/getters.js index 0ab66ff..a4bdb58 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -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; diff --git a/src/store/modules/xiaoqu.js b/src/store/modules/xiaoqu.js index 1e068c0..f3d8e0e 100644 --- a/src/store/modules/xiaoqu.js +++ b/src/store/modules/xiaoqu.js @@ -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: { diff --git a/src/views/components/xiaoqu/building.vue b/src/views/components/xiaoqu/building.vue index 9b8f447..db5e3ed 100644 --- a/src/views/components/xiaoqu/building.vue +++ b/src/views/components/xiaoqu/building.vue @@ -10,16 +10,22 @@ {{ info.floor - index }} 层 -
+
{{ info.deptname }}{{ info.name }}
@@ -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); }, // 颜色处理 diff --git a/src/views/components/xiaoqu/house.vue b/src/views/components/xiaoqu/house.vue index 1c8476b..aca4935 100644 --- a/src/views/components/xiaoqu/house.vue +++ b/src/views/components/xiaoqu/house.vue @@ -252,7 +252,10 @@ :label="dict.value" v-for="dict in dict.type.b_census_color_type" :key="dict.value" - >{{ dict.value }}{{ dict.value }} + {{ + dict.value == "HZ" ? "(有户口自住)" : "(有户口不住)" + }} @@ -264,7 +267,10 @@ :label="dict.value" v-for="dict in dict.type.b_flow_color_type" :key="dict.value" - >{{ dict.value }}{{ dict.value }} + {{ + dict.value == "NZ" ? "(没户口自住)" : "(没户口租客)" + }} @@ -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 = "添加居民"; diff --git a/src/views/index.vue b/src/views/index.vue index f9cd243..fdec4bf 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -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,