diff --git a/project/biaopin/dv/weiyang/AppDvWeiyang.vue b/project/biaopin/dv/weiyang/AppDvWeiyang.vue index fef7b88a..e9ba5018 100644 --- a/project/biaopin/dv/weiyang/AppDvWeiyang.vue +++ b/project/biaopin/dv/weiyang/AppDvWeiyang.vue @@ -108,8 +108,8 @@ const residentDistribution = { encode: {x: 'name', y: 'c'} }, yAxis: {type: "value", axisLine: hide, splitLine: {lineStyle: {type: 'dashed', color: 'rgba(61,82,102,0.65)'}}}, - xAxis: {type: "category", axisTick: hide, axisLabel: {rotate: 45}}, - grid: {left: 12, right: 12, top: 20, bottom: 0, containLabel: true}, + xAxis: {type: "category", axisTick: hide, axisLabel: {rotate: 35}}, + grid: {left: 12, right: 12, top: 10, bottom: 0, containLabel: true}, legend: {show: false}, } const spDistribution = { @@ -132,6 +132,19 @@ const wotDistribution = { tooltip: {formatter: params => `${params.marker} ${params.name} ${params.percent}%`}, legend: hide, } +const residentGroupTrend = { + series: [ + {type: "line", name: "人数", itemStyle: {color: "#1EE7E7"}, encode: {x: 'ymd', y: 'memberCount'}}, + {type: "line", name: "群数量", itemStyle: {color: "#1890FF"}, encode: {x: 'ymd', y: 'groupCount'}, yAxisIndex: 1}, + ], + yAxis: [ + {type: "value", axisLine: hide, splitLine: {lineStyle: {type: 'dashed', color: 'rgba(61,82,102,0.65)'}}, position: 'right'}, + {type: "value", axisLine: hide, splitLine: {lineStyle: {type: 'dashed', color: 'rgba(61,82,102,0.65)'}}} + ], + xAxis: {type: "category", axisTick: hide, axisLabel: {rotate: 35, fontSize: 10}}, + grid: {left: 12, right: 12, top: 10, bottom: 20, containLabel: true}, + legend: {show: true, bottom: 0, textStyle: {color: '#fff'}, icon: 'rect', itemWidth: 8, itemHeight: 8}, +} export default { name: "AppDvWeiyang", components: {NavTabs, AiEchart, ChargingPercent, ValueUnit, IconSmallPanel, IconStaPanel, SubHeader}, @@ -146,19 +159,25 @@ export default { areaId: "", integralOrderType: "", sta: {}, + chart: {aiTrend, workChain, residentDistribution, spDistribution, wotDistribution, integralOrder, residentGroupTrend}, chartData: {}, tableData: {} } }, computed: { ...mapState(["user"]), - currentAreaId: v => v.areaId || v.user.info.areaId, + currentAreaId: v => "610112010017" || v.areaId || v.user.info.areaId, isLastAreaLevel: v => !/0{3}$/.test(v.currentAreaId), areaSta: v => [ {label: "社区数", icon: "66d80346ec1ea", prop: "communityCount", unit: "个"}, {label: "小区数", icon: "66d7fd4c0445d", prop: "residentialQuartersCount", unit: "个"}, {label: "村数", icon: "66d7fd4d28f1b", prop: "villageCount", unit: "个"}, ].map(e => ({...e, label: v.getLabel(e.prop), value: v.sta[e.prop] || 0, icon: `https://cdn.sinoecare.com/i/2024/09/04/${e.icon}.png`})), + gridSta: v => [ + {label: "网格长", icon: "66e3dfde22b10", prop: "girdManager", unit: "人"}, + {label: "网格员", icon: "66e3dfdfd0252", prop: "girdMember", unit: "人"}, + {label: "楼栋长", icon: "66e3dfe1280a6", prop: "buildingManager", unit: "人"}, + ].map(e => ({...e, label: v.getLabel(e.prop), value: v.sta[e.prop] || 0, icon: `https://cdn.sinoecare.com/i/2024/09/13/${e.icon}.png`})), workorderSta: v => [ {label: "已处理", prop: 'workOrderCountFinishNowMonth', unit: "个"}, {label: "办理中", prop: 'workOrderCountProcessingNowMonth', unit: "个"}, @@ -169,7 +188,7 @@ export default { header: ['时间', '状态', '事件描述'], headerBGC: '#21b4fd1a', oddRowBGC: "transparent", evenRowBGC: "transparent", columnWidth: [160, 100,], align: [, 'center',], - rowNum: 9, + rowNum: 10, data: v.tableData.wotDistribution?.map(e => { const color = v.$dict.getColor('clapEventStatus', e.eventStatus) return [e.createTime, @@ -177,6 +196,15 @@ export default { e.content] }) }), + residentGroupListTable: v => ({ + header: ['居民群', '群主', '群人数'], + headerBGC: '#21b4fd1a', oddRowBGC: "transparent", evenRowBGC: "transparent", + columnWidth: [300], align: ['left', 'center', 'right'], + rowNum: 16, + data: v.tableData.residentGroupList?.map(e => { + return [e.name, e.ownerName, e.memberCount] + }) + }), tabs: v => v.$dict.getDict("wyIntegralOrderType").map(e => { return { label: e.dictName, @@ -186,9 +214,6 @@ export default { monthOnMonth: v => calcComparePercent(v.sta.residentCountLastMonth, v.sta.residentCount), yearOnYear: v => calcComparePercent(v.sta.residentCountLastYear, v.sta.residentCount), workorderFinishedPercent: v => handlePercent(v.sta.workOrderCountFinish / v.sta.workOrderCount * 100), - chart: () => { - return {aiTrend, workChain, residentDistribution, spDistribution, wotDistribution, integralOrder} - }, spDistributionTotal: v => v.chartData.spDistribution?.reduce((a, b) => a.c + b.c, 0) || 0, wotDistributionTotal: v => v.chartData.wotDistribution?.reduce((a, b) => a.c + b.c, 0) || 0, }, @@ -203,7 +228,7 @@ export default { methods: { getData() { const {instance: http, currentAreaId: areaId} = this - return Promise.all([ + const list = [ http.post("/app/wyDiy/pvr", null, {params: {areaId}}).then(res => { if (res?.data) { this.sta = res.data @@ -215,38 +240,64 @@ export default { } }), this.getIntegralOrder(), - http.post("/app/wyDiy/residentDistribution", null, {params: {areaId}}).then(res => { - if (res?.data) { - this.$set(this.chartData, "residentDistribution", res.data) - } - }), http.post("/app/wyDiy/spDistribution", null, {params: {areaId}}).then(res => { if (res?.data) { this.$set(this.chartData, "spDistribution", res.data) } }), - http.post("/app/wyDiy/workChain", null, {params: {areaId}}).then(res => { - if (res?.data) { - this.$set(this.chartData, "workChain", res.data.map(e => ['name', ...workChainSeries].map(k => e[k] ?? 0))) - } - }), - http.post("/app/wyDiy/wotDistribution", null, {params: {areaId}}).then(res => { - if (res?.data) { - this.$set(this.chartData, "wotDistribution", res.data) - } - }), http.post("/app/wyDiy/reportInfoList", null, {params: {areaId, size: 999}}).then(res => { if (res?.data) { this.$set(this.tableData, "wotDistribution", res.data.records) } }), - ]) + ] + if (this.isLastAreaLevel) { + list.concat([ + http.post("/app/wyDiy/residentGroupList", null, {params: {areaId, size: 999}}).then(res => { + if (res?.data) { + this.$set(this.tableData, "residentGroupList", res.data) + } + }), + http.post("/app/wyDiy/residentAge", null, {params: {areaId}}).then(res => { + if (res?.data) { + this.$set(this.chartData, "residentDistribution", res.data) + } + }), + http.post("/app/wyDiy/residentGroupTrend", null, {params: {areaId}}).then(res => { + if (res?.data) { + this.$set(this.chartData, "residentGroupTrend", res.data) + } + }), + ]) + } else { + list.concat([ + http.post("/app/wyDiy/residentDistribution", null, {params: {areaId}}).then(res => { + if (res?.data) { + this.$set(this.chartData, "residentDistribution", res.data) + } + }), + http.post("/app/wyDiy/workChain", null, {params: {areaId}}).then(res => { + if (res?.data) { + this.$set(this.chartData, "workChain", res.data.map(e => ['name', ...workChainSeries].map(k => e[k] ?? 0))) + } + }), + http.post("/app/wyDiy/wotDistribution", null, {params: {areaId}}).then(res => { + if (res?.data) { + this.$set(this.chartData, "wotDistribution", res.data) + } + }) + ]) + } + return Promise.all(list) }, getLabel(key) { return this.dict.getLabel("wyBasicCount", key) || key }, getIntegralOrder() { - const {instance: http, currentAreaId: areaId, integralOrderType} = this + let {instance: http, currentAreaId: areaId, integralOrderType, isLastAreaLevel} = this + if (isLastAreaLevel) { + integralOrderType = 3 + } return http.post("/app/wyDiy/integralOrder", null, {params: {areaId, type: integralOrderType}}).then(res => { if (res?.data) { this.$set(this.chartData, "integralOrder", @@ -273,23 +324,61 @@ export default {