From e8e5e84ef9ad0a9da5f9fa9b77a8cb3e1cf92453 Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Thu, 11 Apr 2024 18:33:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E5=B1=8B=E7=94=BB=E5=83=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../portrayal/house/cpts/businessRecord.vue | 63 +++++++++---------- .../modules/portrayal/house/cpts/graph.vue | 3 +- .../portrayal/house/cpts/table/sheng.vue | 2 +- src/views/modules/portrayal/house/index.vue | 10 ++- 4 files changed, 40 insertions(+), 38 deletions(-) diff --git a/src/views/modules/portrayal/house/cpts/businessRecord.vue b/src/views/modules/portrayal/house/cpts/businessRecord.vue index 2371a5980..ca775d9ab 100644 --- a/src/views/modules/portrayal/house/cpts/businessRecord.vue +++ b/src/views/modules/portrayal/house/cpts/businessRecord.vue @@ -74,7 +74,7 @@ export default { }, async mounted() { // 获取家庭所有成员 - await this.getHouseRelationShip(); + console.log(this.familyResiList,'aaa'); await this.getComplainList(); await this.getShengList(); @@ -94,20 +94,35 @@ export default { }, }, + + watch:{ + "familyResiList": { + handler(newValue, oldValue) { + this.getComplainList(); + this.getShengList(); + this.getShequList(); + this.getshijianList(); + this.getxuqiuList(); + this.getfuwuList(); + }, + deep: true, // 开启深度监听 + immediate: true, // 立即触发一次handler + }, + }, //方法 methods: { tabClick(index) {}, handleSizeChange() {}, handleCurrentChange() {}, getComplainList() { - - if (this.resiId.length == 0) { + console.log(this.familyResiList); + if (this.familyResiList.length == 0) { this.complainList = []; this.complainLabel = `12345投诉(0)`; return; } let parm = { - residList: this.resiId, + residList: this.familyResiList, pageNo: this.pageNo, pageSize: this.pageSize, eventType: "3", @@ -135,13 +150,13 @@ export default { }); }, getShengList() { - if (this.resiId.length == 0) { + if (this.familyResiList.length == 0) { this.shengList = []; this.shengLabel = `省满意度调查(0)`; return; } let parm = { - residList: this.resiId, + residList: this.familyResiList, pageNo: this.pageNo, pageSize: this.pageSize, }; @@ -158,13 +173,13 @@ export default { }); }, getShequList() { - if (this.resiId.length == 0) { + if (this.familyResiList.length == 0) { this.shequList = []; this.shequLabel = `社区满意度自查(0)`; return; } let parm = { - residList: this.resiId, + residList: this.familyResiList, pageNo: this.pageNo, pageSize: this.pageSize, }; @@ -191,13 +206,13 @@ export default { }); }, getshijianList() { - if (this.resiId.length == 0) { + if (this.familyResiList.length == 0) { this.shijianList = []; this.shijianLabel = `上报事件(0)`; return; } let parm = { - residList: this.resiId, + residList: this.familyResiList, pageNo: this.pageNo, pageSize: this.pageSize, }; @@ -221,13 +236,13 @@ export default { }); }, getxuqiuList() { - if (this.resiId.length == 0) { + if (this.familyResiList.length == 0) { this.xuqiuList = []; this.xuqiuLabel = `居民需求(0)`; return; } let parm = { - residList: this.resiId, + residList: this.familyResiList, pageNo: this.pageNo, pageSize: this.pageSize, }; @@ -245,13 +260,13 @@ export default { }); }, getfuwuList() { - if (this.resiId.length == 0) { + if (this.familyResiList.length == 0) { this.fuwuList = []; this.fuwuLabel = `社区服务(0)`; return; } let parm = { - residList: this.resiId, + residList: this.familyResiList, pageNo: this.pageNo, pageSize: this.pageSize, }; @@ -268,30 +283,12 @@ export default { }); }, - // 业务记录 - async getHouseRelationShip() { - try { - var resiIds = []; - await this.$http.post("/actual/base/peopleRoomOverview/getFamilyRelationshipList?type=1&resid="+this.houseId).then(({ data: res }) => { - res.data.forEach(function(item) { - // 将每个元素中的"id"放入houseResiIds数组中 - resiIds.push(item.id); - },this); - }); - - this.resiId = resiIds; - - } catch (error) { - console.log(error); - } - }, + }, //子组件注册 components: { complain, sheng, fuwu, shijian, xuqiu, shequ }, //计算 computed: {}, - //监听 - watch: {}, }; diff --git a/src/views/modules/portrayal/house/cpts/graph.vue b/src/views/modules/portrayal/house/cpts/graph.vue index fecd929ce..02646ceb0 100644 --- a/src/views/modules/portrayal/house/cpts/graph.vue +++ b/src/views/modules/portrayal/house/cpts/graph.vue @@ -58,7 +58,7 @@ export default { }, methods: { async getFamilyRelationshipList() { - let url = `/actual/base/peopleRoomOverview/getFamilyRelationshipList?type=1&resid=` + this.houseInfo.id; + let url = `/actual/base/peopleRoomOverview/getFamilyRelationshipListByHouseId?type=0&houseId=` + this.houseInfo.id; let { code, data, msg } = await requestPost(url) if (code == 0) { @@ -90,6 +90,7 @@ export default { })); lineList = lineList.slice(1) const __graph_json_data = { rootId: 'root', nodes: familyList, lines: lineList } + this.$emit('updataHouseIds',data.map(item=>item.id)) this.$refs.seeksRelationGraph.setJsonData(__graph_json_data, (graphInstance) => { // 这些写上当图谱初始化完成后需要执行的代码 }); diff --git a/src/views/modules/portrayal/house/cpts/table/sheng.vue b/src/views/modules/portrayal/house/cpts/table/sheng.vue index d4d1013cb..bfdb26447 100644 --- a/src/views/modules/portrayal/house/cpts/table/sheng.vue +++ b/src/views/modules/portrayal/house/cpts/table/sheng.vue @@ -1,6 +1,6 @@