From 6a6930d43b3de95ed2838487c370c5ae325f407b Mon Sep 17 00:00:00 2001 From: SongZhen <> Date: Wed, 20 Sep 2023 14:16:53 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Tree/nodeWrap.vue | 4 +- .../organizational/dangTree/index.vue | 26 ++++++------- .../organizational/gridTree/index.vue | 26 ++++++------- .../dataBoard/organizational/jwTree/index.vue | 26 ++++++------- .../microgrid/components/reportAnEvent.vue | 38 +++++++++---------- .../organizational/microgrid/index.vue | 7 +++- 6 files changed, 61 insertions(+), 66 deletions(-) diff --git a/src/components/Tree/nodeWrap.vue b/src/components/Tree/nodeWrap.vue index 36fda9d08..680c93c18 100644 --- a/src/components/Tree/nodeWrap.vue +++ b/src/components/Tree/nodeWrap.vue @@ -134,11 +134,13 @@ export default { getHomeTypes(id) { this.$http.get(`/actual/base/organizational/structure/getResidentCategoryByHouseId?houseId=${"1495582904602800129"}`).then((res) => { - const { code, data } = res.data; + const { code, msg, data } = res.data; if (code === 0) { const newItem = data[0]; const itemNumOne = Object.keys(newItem).filter((key) => newItem[key] === 1); this.homeTypeArr = itemNumOne; + } else { + this.$message.error(msg); } }); }, diff --git a/src/views/dataBoard/organizational/dangTree/index.vue b/src/views/dataBoard/organizational/dangTree/index.vue index 29fa0ca9f..913ce7552 100644 --- a/src/views/dataBoard/organizational/dangTree/index.vue +++ b/src/views/dataBoard/organizational/dangTree/index.vue @@ -68,21 +68,19 @@ export default { //获取树状结构 getTreeData() { this.loading = true; - this.$http - .get(`/actual/base/organizational/structure/partyCommitteeOrg?agencyId=${this.$store.state.chooseArea.chooseName.orgId}`) - .then((res) => { - const { - data: { code, data }, - } = res; - if (code === 0) { - this.nodeConfig = data[0]; - this.getDataPLevel(data); - this.loading = false; - } - }) - .catch(() => { + this.$http.get(`/actual/base/organizational/structure/partyCommitteeOrg?agencyId=${this.$store.state.chooseArea.chooseName.orgId}`).then((res) => { + const { + data: { code, msg, data }, + } = res; + if (code === 0) { + this.nodeConfig = data[0]; + this.getDataPLevel(data); this.loading = false; - }); + } else { + this.loading = false; + this.$message.error(msg); + } + }); }, getTitleNameMapFun(i) { diff --git a/src/views/dataBoard/organizational/gridTree/index.vue b/src/views/dataBoard/organizational/gridTree/index.vue index 93605bb76..5d80b7ba4 100644 --- a/src/views/dataBoard/organizational/gridTree/index.vue +++ b/src/views/dataBoard/organizational/gridTree/index.vue @@ -72,21 +72,19 @@ export default { //获取树状结构 getTreeData() { this.loading = true; - this.$http - .get(`/gov/org/organizational/neighborhood/getGridCommitteeOrgTreeList?agencyId=${this.$store.state.chooseArea.chooseName.orgId}`) - .then((res) => { - const { - data: { code, data }, - } = res; - if (code === 0) { - this.nodeConfig = data[0]; - this.getDataPLevel(data); - this.loading = false; - } - }) - .catch(() => { + this.$http.get(`/gov/org/organizational/neighborhood/getGridCommitteeOrgTreeList?agencyId=${this.$store.state.chooseArea.chooseName.orgId}`).then((res) => { + const { + data: { code, msg, data }, + } = res; + if (code === 0) { + this.nodeConfig = data[0]; + this.getDataPLevel(data); this.loading = false; - }); + } else { + this.loading = false; + this.$message.error(msg); + } + }); }, getTitleNameMapFun(i) { diff --git a/src/views/dataBoard/organizational/jwTree/index.vue b/src/views/dataBoard/organizational/jwTree/index.vue index d44934d76..cfd63391d 100644 --- a/src/views/dataBoard/organizational/jwTree/index.vue +++ b/src/views/dataBoard/organizational/jwTree/index.vue @@ -74,21 +74,19 @@ export default { //获取树状结构 getTreeData() { this.loading = true; - this.$http - .get(`/gov/org/organizational/neighborhood/getNeighborhoodCommitteeOrgTreeList?agencyId=${this.$store.state.chooseArea.chooseName.orgId}`) - .then((res) => { - const { - data: { code, data }, - } = res; - if (code === 0) { - this.nodeConfig = data[0]; - this.getDataPLevel(data); - this.loading = false; - } - }) - .catch(() => { + this.$http.get(`/gov/org/organizational/neighborhood/getNeighborhoodCommitteeOrgTreeList?agencyId=${this.$store.state.chooseArea.chooseName.orgId}`).then((res) => { + const { + data: { code, msg, data }, + } = res; + if (code === 0) { + this.nodeConfig = data[0]; + this.getDataPLevel(data); this.loading = false; - }); + } else { + this.loading = false; + this.$message.error(msg); + } + }); }, getTitleNameMapFun(i) { diff --git a/src/views/dataBoard/organizational/microgrid/components/reportAnEvent.vue b/src/views/dataBoard/organizational/microgrid/components/reportAnEvent.vue index 03355c59c..31f1fddfc 100644 --- a/src/views/dataBoard/organizational/microgrid/components/reportAnEvent.vue +++ b/src/views/dataBoard/organizational/microgrid/components/reportAnEvent.vue @@ -191,32 +191,28 @@ export default { getDetailsData(id) { this.loading = true; - this.$http - .post("/governance/icEvent/detail", { icEventId: id }) - .then((res) => { - const { code, data } = res.data; - if (code === 0) { - this.item = data; - } - }) - .catch((res) => { + this.$http.post("/governance/icEvent/detail", { icEventId: id }).then((res) => { + const { code, data, msg } = res.data; + if (code === 0) { + this.item = data; + } else { this.loading = false; - }); + this.$message.error(msg); + } + }); }, getProcessData(id) { - this.$http - .post("/governance/icEvent/process", { icEventId: id }) - .then((res) => { - const { code, data } = res.data; - if (code === 0) { - this.activities = data; - this.loading = false; - } - }) - .catch((err) => { + this.$http.post("/governance/icEvent/process", { icEventId: id }).then((res) => { + const { code, data, msg } = res.data; + if (code === 0) { + this.activities = data; + this.loading = false; + } else { this.loading = false; - }); + this.$message.error(msg); + } + }); }, // /governance/icEvent/detail diff --git a/src/views/dataBoard/organizational/microgrid/index.vue b/src/views/dataBoard/organizational/microgrid/index.vue index 568729d22..b88a51a40 100644 --- a/src/views/dataBoard/organizational/microgrid/index.vue +++ b/src/views/dataBoard/organizational/microgrid/index.vue @@ -9,7 +9,7 @@
- + diff --git a/src/views/dataBoard/overview/components/sq12345.vue b/src/views/dataBoard/overview/components/sq12345.vue index ba0622bfb..16a67796a 100644 --- a/src/views/dataBoard/overview/components/sq12345.vue +++ b/src/views/dataBoard/overview/components/sq12345.vue @@ -8,14 +8,14 @@
处理中
已办结
-
-
- {{ item.num }} +
+
+ {{ index - 0 + 1 }}
-
{{ item.shequ }}
-
{{ item.fwgxs }}
-
{{ item.rkgxs }}
-
{{ item.rfgxzs }}
+
{{ item.orgName }}
+
{{ item.sumNum }}
+
{{ item.processNum }}
+
{{ item.closedNum }}
@@ -23,55 +23,40 @@ diff --git a/src/views/dataBoard/overview/components/sqrfph.vue b/src/views/dataBoard/overview/components/sqrfph.vue index d7d23363c..591adcb70 100644 --- a/src/views/dataBoard/overview/components/sqrfph.vue +++ b/src/views/dataBoard/overview/components/sqrfph.vue @@ -8,14 +8,14 @@
人口更新数
人房更新总数
-
-
- {{ item.num }} +
+
+ {{ index - 0 + 1 }}
-
{{ item.shequ }}
-
{{ item.fwgxs }}
-
{{ item.rkgxs }}
-
{{ item.rfgxzs }}
+
{{ item.orgName }}
+
{{ item.houseNum }}
+
{{ item.residentNum }}
+
{{ item.sumNum }}
@@ -23,55 +23,40 @@ diff --git a/src/views/dataBoard/overview/index.vue b/src/views/dataBoard/overview/index.vue index a2fceff2b..eb50fe5c1 100644 --- a/src/views/dataBoard/overview/index.vue +++ b/src/views/dataBoard/overview/index.vue @@ -1,83 +1,147 @@ @@ -93,8 +157,15 @@ import jdwgy from "@/views/dataBoard/overview/components/jdwgy.vue"; import rfsjtj from "@/views/dataBoard/overview/components/rfsjtj.vue"; import sqrfph from "@/views/dataBoard/overview/components/sqrfph.vue"; import sq12345 from "@/views/dataBoard/overview/components/sq12345.vue"; -import { requestPostBi } from "@/js/dai/request-bipass"; -import { requestPost } from "@/js/dai/request"; + +import DynamicHumanRoomData from "@/views/dataBoard/overview/components/DynamicHumanRoomData.vue"; +import CommunityResult from "@/views/dataBoard/overview/components/CommunityResult.vue"; +import EventAndFollowUp from "@/views/dataBoard/overview/components/EventAndFollowUp.vue"; +import RankingGridData from "@/views/dataBoard/overview/components/RankingGridData.vue"; + + +import {requestPostBi} from "@/js/dai/request-bipass"; +import {requestPost} from "@/js/dai/request"; import getQueryPara from "dai-js/modules/getQueryPara"; export default { @@ -112,22 +183,31 @@ export default { rfsjtj, sqrfph, sq12345, + DynamicHumanRoomData, + CommunityResult, + EventAndFollowUp, + RankingGridData }, data() { return { loading: false, - rfphDate: "2023-03", + rfphDate: this.$moment().format('YYYY-MM'), + sq12345Date: this.$moment().format('YYYY-MM'), + sqzcDate: this.$moment().format('YYYY-MM'), + sjhfDate: this.$moment().format('YYYY-MM'), + sqwggxDate: this.$moment().format('YYYY-MM'), orgData: { children: [], }, //当前组织对象 orgId: "", orgLevel: "", + currentLevel: "", breadList: [ { orgId: "", orgLevel: "", - meta: { title: "人房总览" }, + meta: {title: "人房总览"}, }, ], @@ -137,12 +217,19 @@ export default { }, mounted() { - const queryOrgId = getQueryPara("orgId"); - const queryOrgLevel = getQueryPara("orgLevel"); - this.init(queryOrgId, queryOrgLevel); + // const queryOrgId = getQueryPara("orgId"); + // const queryOrgLevel = getQueryPara("orgLevel"); + // this.init(queryOrgId, queryOrgLevel); + if(this.$store.state.chooseArea.chooseName.orgId) { + this.getMapData() + } }, - watch: {}, + watch: { + "$store.state.chooseArea.chooseName"(val){ + this.getMapData() + } + }, methods: { async init(queryOrgId, queryOrgLevel) { @@ -157,12 +244,12 @@ export default { //加载组织数据 this.loading = false; await this.getMapData(); - await this.getSubMapData(); + // await this.getSubMapData(); this.loading = true; }, - changeDate(e){ - this.rfphDate=e; + changeDate(e) { + this.rfphDate = e; }, handleClickDotBtn(type, info) { console.log("handleClickDotBtn", type, info); @@ -173,21 +260,23 @@ export default { } }, - clickBreadItem({ item }) { + clickBreadItem({item}) { this.toBread(item); }, clickAgencyItem(item) { + console.log(item, 'item') this.toBread({ orgId: item.id, orgLevel: item.level, - meta: { title: item.name }, + meta: {title: item.name}, }); + this.getMapData(item.id,item.level) }, toBread(item) { - const { orgId } = item; - const { breadList } = this; + const {orgId} = item; + const {breadList} = this; let index = breadList.findIndex((val) => val.orgId === orgId); // return console.log(item, breadList, index); if (index >= 0) { @@ -212,39 +301,17 @@ export default { }, //获取地图上显示的组织数据 - async getMapData() { + async getMapData(orgId=this.$store.state.chooseArea.chooseName.orgId,level=this.$store.state.chooseArea.chooseName.level) { console.log("=========================getMapData"); const url = "org_map"; - - const { data, code, msg } = await requestPostBi( - url, - { - queryParam: { - org_id: this.orgId, - }, - }, - { - // mockId: 60810589, - } - ); - - if (code === 0) { - console.log("data::", data); - let info = data[0]; - this.orgData = { - ...info, - id: info.org_id, - name: info.org_name, - latitude: parseFloat(info.latitude), - longitude: parseFloat(info.longitude), - coordinates: info.coordinates || "", - children: [], - }; + this.$http.post(`/gov/org/agency/maporg`, {orgId, level}).then(({data: {data}}) => { + console.log(data,'datadatadata') + this.orgData = data; this.orgId = this.orgData.org_id; this.orgLevel = this.orgData.level; - } else { - this.$message.error(msg); - } + this.currentLevel = this.orgData.agencyLevel; + console.log(this.orgData, 'orgData') + }) }, //获取地图上显示的组织数据 @@ -252,20 +319,20 @@ export default { console.log("=========================getSubMapData"); const url = "sub_org_map"; - const { data, code, msg } = await requestPostBi( - url, - { - queryParam: { - org_id: this.orgId, + const {data, code, msg} = await requestPostBi( + url, + { + queryParam: { + org_id: this.orgId, + }, }, - }, - { - // mockId: 61831860, - } + { + // mockId: 61831860, + } ); if (code === 0) { - const { orgData } = this; + const {orgData} = this; orgData.children = data.map((item) => { return { ...item, @@ -276,10 +343,10 @@ export default { coordinates: item.coordinates || "", }; }); - this.orgData = { ...orgData }; + this.orgData = {...orgData}; console.log( - "==========================getSubMapData:result", - this.orgData + "==========================getSubMapData:result", + this.orgData ); } else { this.$message.error(msg); @@ -294,7 +361,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; this.orgId = this.orgId; @@ -311,7 +378,7 @@ export default { diff --git a/src/views/dataBoard/satisfactionEval/components/Tabs/index.vue b/src/views/dataBoard/satisfactionEval/components/Tabs/index.vue index 70597d2a8..93d9bfb22 100644 --- a/src/views/dataBoard/satisfactionEval/components/Tabs/index.vue +++ b/src/views/dataBoard/satisfactionEval/components/Tabs/index.vue @@ -1,6 +1,7 @@