diff --git a/src/views/dataBoard/renfang/resi/classNew.vue b/src/views/dataBoard/renfang/resi/classNew.vue index 77b410ea2..98a46c470 100644 --- a/src/views/dataBoard/renfang/resi/classNew.vue +++ b/src/views/dataBoard/renfang/resi/classNew.vue @@ -908,6 +908,7 @@ export default { }, created() { this.pageNo = 1; + this.level = this.$store.state.user.level === 'grid'?'grid':'agency' }, watch: { // oldValsss: { @@ -1017,6 +1018,8 @@ export default { let queryParam = { pageNo: this.pageNo, pageSize: this.pageSize, + agencyId: this.org_id, + level: this.level, ...this.searchParams, ...params, }; diff --git a/src/views/dataBoard/renfang/visualizing/components/dangyuan.vue b/src/views/dataBoard/renfang/visualizing/components/dangyuan.vue index 35b1d3480..83816e755 100644 --- a/src/views/dataBoard/renfang/visualizing/components/dangyuan.vue +++ b/src/views/dataBoard/renfang/visualizing/components/dangyuan.vue @@ -66,34 +66,32 @@ export default { methods: { getData() { const { user } = this.$store.state + var level = user.level; + if(level==='grid'){ + level = "grid" + }else{ + level = "agency" + } + let params = this.$paramsFormat({ + agencyId: this.org_id, + level + }) + const partyTypes = [0, 1]; + partyTypes.forEach(type => { + this.$http + .get(`/actual/base/peopleRoomOverview/partyPie?type=${type}&${params}`) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } + // 使用 type 动态设置对应的数据属性和方法 + this[`dy${type === 0 ? 'Left' : 'Right'}`] = dataFormatter(res.data); + this[`init${type === 0 ? 'Left' : 'Right'}Charts`](); + }) + .catch(() => {}); + }); - var level = user.level; - if(level==='grid'){ - level = "grid" - }else{ - level = "agency" - } - - this.$http - .get("/actual/base/peopleRoomOverview/partyPie?type=0") - .then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg); - } - this.dyLeft = dataFormatter(res.data); - this.initLeftCharts(); - }) - .catch(() => {}); - this.$http - .get("/actual/base/peopleRoomOverview/partyPie?type=1") - .then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg); - } - this.dyRight = dataFormatter(res.data); - this.initRightCharts(); - }) - .catch(() => {}); + this.$http .post(`/actual/base/peopleRoomOverview/findPeoplePie`,{ agencyId:user.agencyId,level:level,category:'PARTY_FLAG'}) diff --git a/src/views/dataBoard/renfang/visualizing/components/shiyerenyuan.vue b/src/views/dataBoard/renfang/visualizing/components/shiyerenyuan.vue index f79313bb6..7c0d9f214 100644 --- a/src/views/dataBoard/renfang/visualizing/components/shiyerenyuan.vue +++ b/src/views/dataBoard/renfang/visualizing/components/shiyerenyuan.vue @@ -93,57 +93,28 @@ export default { if(level!="grid"){ level = "agency" } + let params = this.$paramsFormat({ + agencyId: this.org_id, + level + }) + // 定义请求类型数组 + const types = [0, 1, 2, 3, 4]; + + types.forEach(type => { + this.$http + .get(`/actual/base/peopleRoomOverview/unemployedPie?type=${type}&${params}`) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } + + // 使用 type 动态设置对应的数据属性和方法 + this[`syryData${type+1}`] = dataFormatter(res.data); + this[`syryDataCharts${type+1}`](); + }) + .catch(() => {}); + }); - this.$http - .get("/actual/base/peopleRoomOverview/unemployedPie?type=0") - .then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg); - } - this.syryData1 = dataFormatter(res.data); - this.syryDataCharts1(); - }) - .catch(() => {}); - this.$http - .get("/actual/base/peopleRoomOverview/unemployedPie?type=1") - .then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg); - } - this.syryData2 = dataFormatter(res.data); - this.syryDataCharts2(); - }) - .catch(() => {}); - this.$http - .get("/actual/base/peopleRoomOverview/unemployedPie?type=2") - .then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg); - } - this.syryData3 = dataFormatter(res.data); - this.syryDataCharts3(); - }) - .catch(() => {}); - this.$http - .get("/actual/base/peopleRoomOverview/unemployedPie?type=3") - .then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg); - } - this.syryData4 = dataFormatter(res.data); - this.syryDataCharts4(); - }) - .catch(() => {}); - this.$http - .get("/actual/base/peopleRoomOverview/unemployedPie?type=4") - .then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg); - } - this.syryData5 = dataFormatter(res.data); - this.syryDataCharts5(); - }) - .catch(() => {}); this.$http .post(`/actual/base/peopleRoomOverview/findPeoplePie`,{ agencyId:user.agencyId,level:level,category:'UNEMPLOYED_FLAG'}) diff --git a/src/views/dataBoard/renfang/visualizing/components/teshurenqun.vue b/src/views/dataBoard/renfang/visualizing/components/teshurenqun.vue index 907fd6b8c..64f153493 100644 --- a/src/views/dataBoard/renfang/visualizing/components/teshurenqun.vue +++ b/src/views/dataBoard/renfang/visualizing/components/teshurenqun.vue @@ -68,7 +68,7 @@ export default { } this.$http - .post(`/actual/base/peopleRoomOverview/findPeoplePie`,{ agencyId:user.agencyId,level:level,category:'SPECIAL_CROWD_FLAG'}) + .post(`/actual/base/peopleRoomOverview/findPeoplePie`,{agencyId:user.agencyId,level:level,category:'SPECIAL_CROWD_FLAG'}) .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg); @@ -79,7 +79,7 @@ export default { .catch(() => {}); this.$http - .post("/actual/base/peopleRoomOverview/getSpecialResidentAnalyze",{org_id:this.org_id}) + .post("/actual/base/peopleRoomOverview/getSpecialResidentAnalyze",{org_id:this.org_id,level:level}) .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg); diff --git a/src/views/dataBoard/renfang/visualizing/components/zhiyuanzhe.vue b/src/views/dataBoard/renfang/visualizing/components/zhiyuanzhe.vue index 18d3527b1..0628f7cd4 100644 --- a/src/views/dataBoard/renfang/visualizing/components/zhiyuanzhe.vue +++ b/src/views/dataBoard/renfang/visualizing/components/zhiyuanzhe.vue @@ -73,27 +73,27 @@ export default { }else{ level = "agency" } - - this.$http - .get("/actual/base/peopleRoomOverview/volunteerPie?type=0") - .then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg); - } - this.zyzLeft = dataFormatter(res.data); - this.initLeftCharts(); - }) - .catch(() => {}); - this.$http - .get("/actual/base/peopleRoomOverview/volunteerPie?type=1") - .then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg); - } - this.zyzRight = dataFormatter(res.data); - this.initRightCharts(); + // 定义请求类型数组 + const volunteerTypes = [0, 1]; + let params = this.$paramsFormat({ + agencyId: this.org_id, + level }) - .catch(() => {}); + // 循环发起请求 + volunteerTypes.forEach(type => { + this.$http + .get(`/actual/base/peopleRoomOverview/volunteerPie?type=${type}&${params}`) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } + + // 使用 type 动态设置对应的数据属性和方法 + this[`zyz${type === 0 ? 'Left' : 'Right'}`] = dataFormatter(res.data); + this[`init${type === 0 ? 'Left' : 'Right'}Charts`](); + }) + .catch(() => {}); + }); this.$http .post(`/actual/base/peopleRoomOverview/findPeoplePie`,{ agencyId:user.agencyId,level:level,category:'VOLUNTEER_FLAG'})