From e1d1f4d190286beeca16262240089ff9d461f31b Mon Sep 17 00:00:00 2001 From: tianq Date: Fri, 7 Apr 2023 17:14:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E6=9C=AA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../census/census-accountActiveList.vue | 29 ++-- .../modules/census/census-accountList.vue | 19 ++- src/views/modules/census/census-houseList.vue | 124 +++++++++--------- 3 files changed, 81 insertions(+), 91 deletions(-) diff --git a/src/views/modules/census/census-accountActiveList.vue b/src/views/modules/census/census-accountActiveList.vue index 42cc3b41e..2b6cfb0b9 100644 --- a/src/views/modules/census/census-accountActiveList.vue +++ b/src/views/modules/census/census-accountActiveList.vue @@ -51,7 +51,7 @@
-

{{censusData.activityCount}}

+

{{ censusData.activityCount }}

社区活跃数量

@@ -72,8 +72,6 @@ - - @@ -83,7 +81,7 @@
-

{{censusData.inactivityCount}}

+

{{ censusData.inactivityCount }}

社区不活跃数量

@@ -101,7 +99,6 @@ -
@@ -154,9 +151,9 @@ export default { tableData: [], formData: { - orgId:"", - startDate:"", - endDate:"", + orgId: '', + startDate: '', + endDate: '' }, cateOptions: [], eventTypeCheck: [], @@ -169,7 +166,7 @@ export default { startPickerOptions: { disabledDate: startDisabledDate }, - censusData:{} + censusData: {} }; }, computed: { @@ -233,12 +230,12 @@ export default { async handleExport(type) { const url = '/gov/org/staffLoginLog/accountActivityInfo-export'; - const {formData } = this; + const { formData } = this; axios({ url: window.SITE_CONFIG['apiURL'] + url, method: 'post', data: { - isActivity:type, + isActivity: type, ...formData }, responseType: 'blob' @@ -289,7 +286,7 @@ export default { console.log('getCountLeveldata', data); if (code === 0) { this.censusData = data; - console.log("this.censusData ",this.censusData ) + console.log('this.censusData ', this.censusData); } else { this.$message.error(msg); } @@ -339,13 +336,12 @@ export default { } }, - deepTree(arr, child) { - if (Array.isArray(arr) && arr.length > 0) { + deepTree(arr) { + if (Array.isArray(arr)) { return arr.map(item => { - // if (child === 'subAgencyList') item.value = item.orgType + '-' + item.orgId return { ...item, - [child]: (item[child] && item[child].length > 0 && this.deepTree(item[child], child)) || null + subAgencyList: (item.subAgencyList.length > 0 && this.deepTree(item.subAgencyList)) || null }; }); } @@ -359,7 +355,6 @@ export default { @import '@/assets/scss/modules/management/list-main.scss'; @import '@/assets/scss/modules/shequzhili/event-info.scss'; .btnSearch { - width: 100px; height: 36px; background: #2195fe; diff --git a/src/views/modules/census/census-accountList.vue b/src/views/modules/census/census-accountList.vue index 17b19441c..3fde44454 100644 --- a/src/views/modules/census/census-accountList.vue +++ b/src/views/modules/census/census-accountList.vue @@ -449,16 +449,15 @@ export default { this.pageNo = val; this.showNext(); }, - deepTree(arr, child) { - if (Array.isArray(arr) && arr.length > 0) { - return arr.map(item => { - // if (child === 'subAgencyList') item.value = item.orgType + '-' + item.orgId - return { - ...item, - [child]: (item[child] && item[child].length > 0 && this.deepTree(item[child], child)) || null - }; - }); - } + deepTree(arr) { + if (Array.isArray(arr)) { + return arr.map(item => { + return { + ...item, + subAgencyList: item.subAgencyList.length > 0 && this.deepTree(item.subAgencyList) || null + } + }) + } }, pieInitOk() { this.pieInitState = true; diff --git a/src/views/modules/census/census-houseList.vue b/src/views/modules/census/census-houseList.vue index b1927e305..55054cd83 100644 --- a/src/views/modules/census/census-houseList.vue +++ b/src/views/modules/census/census-houseList.vue @@ -58,7 +58,19 @@ > - + + +
+
+
+
+
{{ item.name }}
+
{{ item.value }}
+
{{ item.value / 100 }}%
+
+
+
+
@@ -173,7 +185,10 @@ export default { pieInitState: false, pieInitState2: false, pieOption: [], - pieOption2: [] + pieOption2: [], + color: ['#3C94FE', '#A17AFA', '#A19FFF', '#22C1C3', '#6FC364', '#F0D915', '#FEB349', '#FE6252', '#F44230', '#5DC7F0'], + chartData: [], + pieData: [] }; }, computed: { @@ -291,14 +306,10 @@ export default { // let data = [...this.pieData]; // console.log('data', data); let chartData = { - name: ['1', '2', '3', '4'], - data: [ - { value: 23, id: '22', level: 'ddd', name: 'name' }, - { value: 23, id: '22', level: 'ddd', name: 'name' }, - { value: 23, id: '22', level: 'ddd', name: 'name' }, - { value: 23, id: '22', level: 'ddd', name: 'name' } - ] + name: ['反骨', '反骨2', '反骨3', '反骨4'], + data: [{ value: 62, name: '反骨' }, { value: 44, name: '反骨2' }, { value: 123, name: '反骨3' }, { value: 232, name: '反骨4' }] }; + this.chartData = chartData; // chartData.name = data.map(item => item.agencyName); // chartData.data = data.map(item => { // return { value: item.count, id: item.agencyId, level: item.agencyLevel, name: item.agencyName }; @@ -312,12 +323,7 @@ export default { // console.log('data', data); let chartData = { name: ['1', '2', '3', '4'], - data: [ - { value: 23, id: '22', level: 'ddd', name: 'name' }, - { value: 23, id: '22', level: 'ddd', name: 'name' }, - { value: 23, id: '22', level: 'ddd', name: 'name' }, - { value: 23, id: '22', level: 'ddd', name: 'name' } - ] + data: [{ value: 62, name: '1' }, { value: 243, name: '2' }] }; // chartData.name = data.map(item => item.agencyName); // chartData.data = data.map(item => { @@ -331,35 +337,7 @@ export default { this.$refs.pieChart.clear(); // 获取pieChart配置 this.pieOption = { - // legend: { - // itemHeight: 14, - // itemWidth: 14, - // icon: 'rect', - // orient: 'vertical', - // top: 'center', - // right: '5%', - // textStyle: { - // align: 'left', - // color: '#', - // verticalAlign: 'middle', - // rich: { - // name: { - // width: 80, - // fontSize: 16 - // }, - // value: { width: 20, align: 'right', fontFamily: 'Medium', fontSize: 16 }, - // rate: { width: 10, align: 'right', fontSize: 16 } - // } - // }, - // // data: datas, - // formatter: name => { - // // if (datas.length) { - // // const item = datas.filter(item => item.name === name)[0]; - // // return `{name|${name}}{value| ${item.value}} {rate| 宗}`; - // // } - // } - // }, - color: ['#3C94FE', '#A17AFA', '#A19FFF', '#22C1C3', '#6FC364', '#FEB349', '#FE6252'], + color: this.color, title: { text: '12345', subtext: '房屋总数(分)', @@ -416,24 +394,18 @@ export default { tooltip: { show: true }, - data: [ - { value: 1048, name: 'Search Engine' }, - { value: 735, name: 'Direct' }, - { value: 580, name: 'Email' }, - { value: 484, name: 'Union Ads' }, - { value: 300, name: 'Video Ads' } - ] + data: chartData.data } ] }; this.$refs.pieChart.setOption(this.pieOption); }, async iniPieChart2(chartData) { - console.log('dddddddddddd'); this.$refs.pieChart2.clear(); // 获取pieChart配置 + this.pieOption2 = { - color: ['#3C94FE', '#A17AFA', '#A19FFF', '#22C1C3', '#6FC364', '#FEB349', '#FE6252'], + color: this.color, title: { text: '12345', subtext: '房屋总数(分)', @@ -463,13 +435,7 @@ export default { show: true }, z: 9999, - data: [ - { value: 1048, name: 'Search Engine' }, - { value: 735, name: 'Direct' }, - { value: 580, name: 'Email' }, - { value: 484, name: 'Union Ads' }, - { value: 300, name: 'Video Ads' } - ] + data: chartData.data }, { type: 'pie', @@ -590,13 +556,12 @@ export default { this.formData.orgId = obj.agencyId; this.formData.level = obj.level; }, - deepTree(arr, child) { - if (Array.isArray(arr) && arr.length > 0) { + deepTree(arr) { + if (Array.isArray(arr)) { return arr.map(item => { - // if (child === 'subAgencyList') item.value = item.orgType + '-' + item.orgId return { ...item, - [child]: (item[child] && item[child].length > 0 && this.deepTree(item[child], child)) || null + subAgencyList: (item.subAgencyList.length > 0 && this.deepTree(item.subAgencyList)) || null }; }); } @@ -609,6 +574,37 @@ export default { @import '@/assets/scss/buttonstyle.scss'; @import '@/assets/scss/modules/management/list-main.scss'; @import '@/assets/scss/modules/shequzhili/event-info.scss'; +.legend { + display: flex;flex-flow:row wrap; + .legend-row { + width: 33.3%; + display: flex; + margin-bottom: 30px; + + .kuai { + width: 12px; + height: 12px; + border-radius: 4px; + } + .content { + .name { + font-size: 14px; + color: #999; + + } + .num { + font-size: 16px; + font-weight: bold; + display: inline-block; + } + .unit{ + font-size: 16px; + display: inline-block; + margin-left: 15px; + } + } + } +} .btnSearch { width: 100px; height: 36px;