diff --git a/src/views/modules/census/census-accountActiveList.vue b/src/views/modules/census/census-accountActiveList.vue index 89bd2d260..a85ee01d9 100644 --- a/src/views/modules/census/census-accountActiveList.vue +++ b/src/views/modules/census/census-accountActiveList.vue @@ -89,7 +89,7 @@ 导出 { - return { - ...item, - subAgencyList: item.subAgencyList.length > 0 && this.deepTree(item.subAgencyList) || null - } - }) - } + if (Array.isArray(arr)) { + return arr.map(item => { + return { + ...item, + subAgencyList: (item.subAgencyList.length > 0 && this.deepTree(item.subAgencyList)) || null + }; + }); + } }, pieInitOk() { this.pieInitState = true; @@ -493,7 +493,19 @@ export default { }, xAxis: { type: 'category', - data: chartData.name + data: chartData.name, + axisLabel: { + interval: 0, + interval: 0, //设置横坐标为斜 + rotate: 30, //文字倾斜角度 + formatter: function(value) { + if (value.length > 10) { + value = value.substring(0, 9) + '..'; + } + return value; + } + }, + triggerEvent: true }, yAxis: { type: 'value', diff --git a/src/views/modules/census/census-orgStatusList.vue b/src/views/modules/census/census-orgStatusList.vue index 3d54778be..1733974a9 100644 --- a/src/views/modules/census/census-orgStatusList.vue +++ b/src/views/modules/census/census-orgStatusList.vue @@ -17,35 +17,12 @@ @change="handleChangeAgency" > - - - - - + 查询
- -
+
@@ -54,7 +31,7 @@
-
+
@@ -64,7 +41,7 @@
-
+
@@ -74,7 +51,7 @@
-
+
@@ -97,7 +74,39 @@
-
下级社区数量统计
+
下级社区数量统计 + +
+ + + + + +
+
+ + +
{ //这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键 let nowData = Date.now(); - if (this.formData.startDate) { - let startDate = new Date(this.formData.startDate); + if (this.formData2.startDate) { + let startDate = new Date(this.formData2.startDate); return time.getTime() > nowData || time.getTime() < startDate || time.getTime() === startDate; } else { return time.getTime() > nowData; @@ -187,7 +196,9 @@ export default { censusData: { district: '', street: '', community: '', grid: '', staff: '' }, formData: { orgId: '', - level: '', + level: '' + }, + formData2: { startDate: '', endDate: '' }, @@ -219,7 +230,7 @@ export default { }, computed: { maxTableHeight() { - this.TableHeight = this.$store.state.inIframe ? this.clientHeight - 420 + this.iframeHeigh : this.clientHeight - 420; + this.TableHeight = this.$store.state.inIframe ? this.clientHeight - 450 + this.iframeHeigh : this.clientHeight - 450; console.log('this.TableHeight', this.TableHeight); return this.TableHeight; }, @@ -227,10 +238,10 @@ export default { ...mapGetters(['clientHeight', 'iframeHeight']) }, watch: { - 'formData.endDate': function(val) { + 'formData2.endDate': function(val) { if (val && val != '') { let arrayTemp = val.split(' '); - this.formData.endDate = arrayTemp[0] + ' 23:59:59'; + this.formData2.endDate = arrayTemp[0] + ' 23:59:59'; } } }, @@ -238,7 +249,7 @@ export default { console.log(this.$store.state); this.user = this.$store.state.user; this.agencyId = this.user.agencyId; - console.log(this.user) + console.log(this.user); this.getOrgTreeList(); this.getTableData(); @@ -271,8 +282,8 @@ export default { url = '/gov/org/customeragency/getCommunityList'; param = { agencyId: this.orgId, - timeStart: this.formData.startDate, - timeEnd: this.formData.endDate, + timeStart: this.formData2.startDate, + timeEnd: this.formData2.endDate, pageNum: this.pageNo, pageSize: this.pageSize }; @@ -342,10 +353,10 @@ export default { let agencyId = ''; if (this.formData.orgId == '') { agencyId = this.agencyId; - this.level=this.user.level + this.level = this.user.level; } else { agencyId = this.formData.orgId; - this.level=this.formData.level + this.level = this.formData.level; } const url = '/gov/org/customeragency/getAgencyCountList'; let params = { agencyId: agencyId }; @@ -394,7 +405,7 @@ export default { } else { agencyId = this.formData.orgId; } - const { data, code, msg } = await requestPost(url, { agencyId: agencyId }); + const { data, code, msg } = await requestPost(url, { agencyId: agencyId, timeStart: this.formData2.startDate, timeEnd: this.formData2.endDate }); this.$refs.pieChart.hideLoading(); @@ -458,7 +469,18 @@ export default { }, xAxis: { type: 'category', - data: chartData.name + data: chartData.name, + axisLabel: { + interval: 0, + interval: 0, //设置横坐标为斜 + rotate: 30, //文字倾斜角度 + formatter: function(value) { + if (value.length > 10) { + value = value.substring(0, 9) + '..'; + } + return value; + } + } }, yAxis: { type: 'value',