From 96146ad92885169d82d5e584d725e08028d92e50 Mon Sep 17 00:00:00 2001 From: chenjingyu Date: Fri, 2 Apr 2021 16:18:20 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]=E7=BB=9F=E8=AE=A1=E5=88=86?= =?UTF-8?q?=E6=9E=90=E5=8C=BA=E9=97=B4=E6=9F=A5=E8=AF=A2=E6=8D=A2=E6=96=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...add-unit-three-line-details.component.scss | 12 +- .../add-unit-three-line-details.component.ts | 29 ++-- .../add-unit-two-time.component.html | 4 +- .../add-unit-two-time.component.scss | 78 +++++++---- .../add-unit-two-time.component.ts | 85 +++++++----- .../page-there-year.component.scss | 8 ++ .../page-there-year.component.ts | 51 +++---- .../page-two-time.component.html | 4 +- .../page-two-time.component.scss | 89 +++++++++---- .../page-two-time/page-two-time.component.ts | 124 ++++++++++++------ 10 files changed, 321 insertions(+), 163 deletions(-) diff --git a/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.scss b/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.scss index 61f60d6..82046a6 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.scss +++ b/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.scss @@ -33,7 +33,7 @@ // padding: 0 15px; display: flex; flex-direction: row; - flex-wrap: wrap; + flex-wrap: nowrap; align-items:center; justify-content:center; .queryField { @@ -67,10 +67,16 @@ overflow: auto; #barEchart{ width: 80%; - height: 550px; position: absolute; left: 50%; - top: 50%; transform: translate(-50%,-50%); + @media screen and (max-device-width:1400px){ + height: 450px; + top: 60%; + } + @media screen and (min-device-width:1400px){ + height: 550px; + top: 50%; + } } } \ No newline at end of file diff --git a/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.ts b/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.ts index bf4cf21..5046b2b 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.ts +++ b/src/app/statistic-analysis/addUnit/add-unit-three-line-details/add-unit-three-line-details.component.ts @@ -19,6 +19,7 @@ export class AddUnitThreeLineDetailsComponent implements OnInit { setTimeoutObj//延时器需要清除 qopao lastId + zhiorbuild ngOnInit(): void { if(sessionStorage.getItem('refresh') === 'true') { sessionStorage.removeItem('refresh'); @@ -30,10 +31,11 @@ export class AddUnitThreeLineDetailsComponent implements OnInit { this.year = params['year']; this.buildingTypeName = params['buildingType']; this.lastId=params['id'] + this.zhiorbuild=params['type'] }); this.setTimeoutObj = window.setTimeout(()=>{ this.getdata() - },1000) + }) } ngOnDestroy(){ @@ -45,24 +47,26 @@ export class AddUnitThreeLineDetailsComponent implements OnInit { zongcount=0 async getdata(){ let parzhi={ + objectType:0, BuildingTypeId:this.lastId, TrendType:this.serviceData.selectType, - //TrendYear:this.year||'' + TrendYear:this.year||'' } let parbuild={ + objectType:0, OrganizationId:this.lastId, TrendType:this.serviceData.selectType, - //TrendYear:this.year||'' + TrendYear:this.year||'' } - await this.serviceData.getData(this.serviceData.zuzhiorBuilding=='zhi'?parbuild:parzhi,`/api/StatisticsAnalysis`) + await this.serviceData.getData(this.zhiorbuild=='zhi'?parbuild:parzhi,`/api/StatisticsAnalysis/Trends`) this.setTimeoutObj = window.setTimeout(() => { this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate)) //console.log(this.tabledata) - for(var i=0;i=this.serviceData.selectStartMonth||this.tabledata[0].companyStatistics.trendStatistics.added[i].month<=this.serviceData.selectEndMonth){ - this.date.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].month) - this.dateNum.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].count) - this.zongcount=this.zongcount+this.tabledata[0].companyStatistics.trendStatistics.added[i].count + for(var i=0;i=this.serviceData.selectStartMonth||this.tabledata[0][i].month<=this.serviceData.selectEndMonth){ + this.date.push(this.tabledata[0][i].month) + this.dateNum.push(this.tabledata[0][i].count) + this.zongcount=this.zongcount+this.tabledata[0][i].count } } @@ -119,10 +123,7 @@ export class AddUnitThreeLineDetailsComponent implements OnInit { this.detailPlanEchart = echarts.init(document.getElementById('barEchart'), 'skinUpp'); this.option = { grid: { - top: 50, - left:40, - right: 20, - //bottom: 20, + top: 90, }, // 标题 title: { @@ -208,7 +209,7 @@ export class AddUnitThreeLineDetailsComponent implements OnInit { if (this.detailPlanEchart.containPixel('grid',pointInPixel)) { let xIndex=this.detailPlanEchart.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; /*事件处理代码书写位置*/ - this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.buildingTypeName,'id':this.lastId}}) + this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.buildingTypeName,'id':this.lastId,'type':this.zhiorbuild}}) //this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time/three_barDetails'],{queryParams:{'level':'zhidui','time':this.option.xAxis.data[xIndex],'buildingTpye':this.buildingTypeName}}); } }); diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.html b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.html index 3e30b85..d735bed 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.html +++ b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.html @@ -4,7 +4,7 @@ * @Author: sueRimn * @Date: 2020-09-05 13:50:45 * @LastEditors: sueRimn - * @LastEditTime: 2021-03-13 14:41:42 + * @LastEditTime: 2021-04-02 09:31:45 -->
@@ -70,7 +70,7 @@
- +
diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss index 6904ade..83396d9 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss +++ b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.scss @@ -11,18 +11,26 @@ overflow: auto; } #Line{ - width: 50%; - height: 420px; - margin: 50px auto; + //width: 50%; + height: 600px; + //margin: 50px auto; } } .publicCss{ width: 80%; - height: 550px; + //height: 550px; position: absolute; left: 50%; - top: 55%; + //top: 55%; transform: translate(-50%,-50%); + @media screen and (max-device-width:1400px){ + height: 450px; + top: 60%; + } + @media screen and (min-device-width:1400px){ + height: 550px; + top: 55%; + } } //头部搜索栏 @@ -34,31 +42,57 @@ // padding: 0 15px; display: flex; flex-direction: row; - flex-wrap: wrap; - align-items:center; - justify-content:center; + flex-wrap: nowrap; + @media screen and (min-device-width:1200px){ + align-items:center; + justify-content:center; + } + + @media screen and (max-device-width:1200px){ + justify-content: center; + align-items:center; + } .queryField { - margin: 0 10px; - font-size: 14px; - .mat-form-field { - width: 130px; - max-height: 50px;; - margin: 0 15px 0 10px; - } + @media screen and (max-device-width:1200px){ + font-size: 14px; + .mat-form-field { + width: 100px; + max-height: 50px;; + margin: 0 5px 0 5px; + } + } + @media screen and (min-device-width:1200px){ + margin: 0 10px; + font-size: 14px; + .mat-form-field { + width: 130px; + max-height: 50px;; + margin: 0 15px 0 10px; + } + } + } .btnbox{ - display: flex; - flex-direction:row-reverse; - //float: right; + @media screen and (min-device-width:1200px){ justify-content: center; - align-items: center; - height: 100%; + align-items: center; button{ width: 88px; height: 36px; } - margin-right:4%; - + margin-right:4%; + } + @media screen and (max-device-width:1200px){ + justify-content: center; + align-items: center; + button{ + width: 88px; + height: 36px; + } + } + display: flex; + flex-direction:nowrap; + height: 100%; } } .selectedBtn{ diff --git a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts index 8b6fa3c..74af655 100644 --- a/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts +++ b/src/app/statistic-analysis/addUnit/add-unit-two-time/add-unit-two-time.component.ts @@ -41,24 +41,26 @@ export class AddUnitTwoTimeComponent implements OnInit { yeardatee async getdata(){ let parzhi={ + objectType:0, BuildingTypeId:this.lastId, TrendType:this.serviceData.selectType, TrendYear:this.yeardatee||'' } let parbuild={ + objectType:0, OrganizationId:this.lastId, TrendType:this.serviceData.selectType, TrendYear:this.yeardatee||'' } - await this.serviceData.getData(this.serviceData.zuzhiorBuilding=='zhi'?parbuild:parzhi,`/api/StatisticsAnalysis`) + await this.serviceData.getData(this.zhiorbuild=="zhi"?parbuild:parzhi,`/api/StatisticsAnalysis/Trends`) this.setTimeoutObj = window.setTimeout(() => { this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate)) - //console.log(this.tabledata) - for(var i=0;i=this.serviceData.selectStartMonth||this.tabledata[0].companyStatistics.trendStatistics.added[i].month<=this.serviceData.selectEndMonth){ - this.date.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].month) - this.dateNum.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].count) - this.zongcount=this.zongcount+this.tabledata[0].companyStatistics.trendStatistics.added[i].count + console.log(this.tabledata[0]) + for(var i=0;i=this.serviceData.selectStartMonth||this.tabledata[0][i].month<=this.serviceData.selectEndMonth){ + this.date.push(this.tabledata[0][i].month) + this.dateNum.push(this.tabledata[0][i].count) + this.zongcount=this.zongcount+this.tabledata[0][i].count } } @@ -102,11 +104,11 @@ export class AddUnitTwoTimeComponent implements OnInit { if (e.selectEndMonth>=e.selectStartMonth) { let startTime = e.selectOneYear + '-' + e.selectStartMonth + '-' + 1 + ' ' + 0 + ':' + 0 +':'+ 0 let endTime = e.selectTwoYear + '-' + e.selectEndMonth + '-' + 31 + ' ' + 23 + ':' + 59 +':'+ 59 - for(var i=0;i=this.serviceData.selectStartMonth&&this.tabledata[0].companyStatistics.trendStatistics.added[i].month<=this.serviceData.selectEndMonth){ - this.date.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].month) - this.dateNum.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].count) - this.zongcount=this.zongcount+this.tabledata[0].companyStatistics.trendStatistics.added[i].count + for(var i=0;i=this.serviceData.selectStartMonth&&this.tabledata[0][i].month<=this.serviceData.selectEndMonth){ + this.date.push(this.tabledata[0][i].month) + this.dateNum.push(this.tabledata[0][i].count) + this.zongcount=this.zongcount+this.tabledata[0][i].count } } //this.oneInit (this.date,this.dateNum) @@ -123,20 +125,31 @@ export class AddUnitTwoTimeComponent implements OnInit { selectEndYear:any = (new Date()).getFullYear() //结束年份 //按年查询 yearSubmit (e) { + this.zongcount=0 + this.date2=[] + this.dateNum2=[] if (e.selectEndYear >= e.selectStartYear) { let startTime = e.selectStartYear + '-' + 1 + '-' + 1 + ' ' + 0 + ':' + 0 +':'+ 0 let endTime = e.selectEndYear + '-' + 12 + '-' + 31 + ' ' + 23 + ':' + 59 +':'+ 59 - //console.log(startTime) - //console.log(endTime) + for(var i=0;i=e.selectStartYear&&this.tabledata[0][i].year<=e.selectEndYear){ + this.date2.push(this.tabledata[0][i].month) + this.dateNum2.push(this.tabledata[0][i].count) + this.zongcount=this.zongcount+this.tabledata[0][i].count + } + } + //this.oneInit (this.date,this.dateNum) + this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum2,this.date2) + this.twoInit (this.date2,this.dateNum2,'year') } else { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('请选择正确时间区段','确定',config); + this.snackBar.open('结束年份必须大于开始年份','确定',config); } } //年或月点击 - dateChange(){ + async dateChange(){ this.tiaoshiPao=null this.forArr.forEach(item => { item.echart.dispose() @@ -145,22 +158,32 @@ export class AddUnitTwoTimeComponent implements OnInit { if(this.selectType == "year"){ this.zongcount=0 this.serviceData.selectType=2 - let paramdata={ + let parzhi={ + objectType:0, BuildingTypeId:this.lastId, - TrendType:this.serviceData.selectType + TrendType:this.serviceData.selectType, + } + let parbuild={ + objectType:0, + OrganizationId:this.lastId, + TrendType:this.serviceData.selectType, } - this.serviceData.getData(paramdata,`/api/StatisticsAnalysis`) + /* let paramdata={ + BuildingTypeId:this.lastId, + TrendType:this.serviceData.selectType + } */ + await this.serviceData.getData(this.zhiorbuild=="zhi"?parbuild:parzhi,`/api/StatisticsAnalysis/Trends`) this.setTimeoutObj = window.setTimeout(() => { this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate)) - //console.log(this.tabledata) - for(var i=0;i { this.year = params['level']; this.buildingTypeName = params['headtext']; this.type=params['type'] + this.lastyears=params['years'] }); - let paramdata={ - planStatus:this.type, - TrendType:this.serviceData.selectType - } - this.serviceData.getData(paramdata,`/api/StatisticsAnalysis`) + this.setTimeoutObj = window.setTimeout(()=>{ - this.tabledata=JSON.parse(JSON.stringify(this.serviceData.allDate)) - console.log(this.tabledata[0].planStatistics.trendStatistics.added) - for(var i=0;i
@@ -66,7 +66,7 @@
- +
diff --git a/src/app/statistic-analysis/state/page-two-time/page-two-time.component.scss b/src/app/statistic-analysis/state/page-two-time/page-two-time.component.scss index bc02d59..d0c1957 100644 --- a/src/app/statistic-analysis/state/page-two-time/page-two-time.component.scss +++ b/src/app/statistic-analysis/state/page-two-time/page-two-time.component.scss @@ -20,39 +20,80 @@ //头部搜索栏 .header { border-bottom: 1px solid #999; - height: 70px; - min-height: 70px; - box-sizing: border-box; - padding: 0 15px; - display: flex; - flex-direction: row; - flex-wrap: wrap; - align-items:center; - justify-content:center; - .queryField { - margin: 0 10px; - font-size: 14px; - .mat-form-field { - width: 130px; - max-height: 50px;; - margin: 0 15px 0 10px; + height: 80px; + min-height: 81px;; + box-sizing: border-box; + // padding: 0 15px; + display: flex; + flex-direction: row; + flex-wrap: nowrap; + @media screen and (min-device-width:1200px){ + align-items:center; + justify-content:center; } + + @media screen and (max-device-width:1200px){ + justify-content: center; + align-items:center; + } + .queryField { + @media screen and (max-device-width:1200px){ + font-size: 14px; + .mat-form-field { + width: 100px; + max-height: 50px;; + margin: 0 5px 0 5px; + } + } + @media screen and (min-device-width:1200px){ + margin: 0 10px; + font-size: 14px; + .mat-form-field { + width: 130px; + max-height: 50px;; + margin: 0 15px 0 10px; + } + } } .fixedCss{ - position: fixed; - top: 81px; - right: 32px; + @media screen and (min-device-width:1200px){ + justify-content: center; + align-items: center; + button{ + width: 88px; + height: 36px; + } + margin-right:4%; + } + @media screen and (max-device-width:1200px){ + justify-content: center; + align-items: center; + button{ + width: 88px; + height: 36px; + } + } + display: flex; + flex-direction:nowrap; + height: 100%; } } //echarts div公有样式 .publicCss{ width: 80%; - height: 550px; - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%,-50%); + @media screen and (max-device-width:1400px){ + height: 450px; + top: 60%; +} +@media screen and (min-device-width:1400px){ + height: 550px; + top: 50%; +} + position: absolute; + left: 50%; + + transform: translate(-50%,-50%); } .publicOneLineCss{ height: 350px; diff --git a/src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts b/src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts index 4e1d71e..44cb412 100644 --- a/src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts +++ b/src/app/statistic-analysis/state/page-two-time/page-two-time.component.ts @@ -128,11 +128,12 @@ export class PageTwoTimeComponent implements OnInit { let endTime = e.selectEndYear + '-' + 12 + '-' + 31 + ' ' + 23 + ':' + 59 +':'+ 59 this.echartsData.selectOneYear=e.selectStartYear this.echartsData.selectTwoYear=e.selectEndYear + this.appEcharts.findyear() } else { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('请选择正确时间区段','确定',config); + this.snackBar.open('结束时间必须大于开始时间','确定',config); } } @@ -149,13 +150,14 @@ export class echartsComponent implements OnInit { constructor(private router: Router,private activatedRoute: ActivatedRoute,public snackBar: MatSnackBar,private adapter: DateAdapter,public echartsData:EchartsDataService) { } - + zongcount=0 type + organizationId=[] tiaoshiPao:any datayuey=[] datayuex=[] - dataYearX = ['2020','2021'] - dataYearY = ['0'] + dataYearX = [] + dataYearY = [] toggleTrue (){} //气泡提示数据获取 bianli(){ @@ -176,18 +178,32 @@ export class echartsComponent implements OnInit { this.headtext=param.level this.type=param.type }); + + window.setTimeout(()=>{ + this.getechartsData() + }) + } + + ngOnDestroy () { + this.twoExample.clear() + this.twoExample.dispose() + + } + //获取数据 + async getechartsData(){ let paramdata={ - //planStatus:this.type, - TrendType:this.echartsData.selectType + planStatus:this.type, + objectType:1, + TrendType:0 } - this.echartsData.getData(paramdata,`/api/StatisticsAnalysis`) - window.setTimeout(()=>{ - this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) - //console.log(this.tabledata[0].companyStatistics.trendStatistics.added) - for(var i=0;i=this.echartsData.selectStartMonth||this.tabledata[0].companyStatistics.trendStatistics.added[i].month<=this.echartsData.selectEndMonth){ - this.datayuex.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].month) - this.datayuey.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].count) + await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`) + this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) + console.log(this.tabledata) + for(var i=0;i=this.echartsData.selectStartMonth||this.tabledata[0][i].month<=this.echartsData.selectEndMonth){ + this.datayuex.push(this.tabledata[0][i].month) + this.datayuey.push(this.tabledata[0][i].count) + this.zongcount=this.zongcount+this.tabledata[0][i].count } } @@ -195,38 +211,36 @@ export class echartsComponent implements OnInit { this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex) //this.oneInit() this.twoInit() - },1000) - } - - ngOnDestroy () { - this.twoExample.clear() - this.twoExample.dispose() - } - changeTime (e) { + async changeTime (e) { this.twoExample.clear() this.twoExample.dispose() - - if (e=='year') { - //this.oneInit(this.dataYearX,this.dataYearY) + this.dataYearX=[] this.echartsData.selectType=2 + this.zongcount=0 let paramdata={ - //planStatus:this.type, + objectType:1, + planStatus:this.type, TrendType:this.echartsData.selectType } - this.echartsData.getData(paramdata,`/api/StatisticsAnalysis`) + await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`) window.setTimeout(()=>{ this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) - console.log(this.tabledata[0].companyStatistics.trendStatistics.added) - this.dataYearY.push(this.tabledata[0].companyStatistics.trendStatistics.added[0].count) + console.log(this.tabledata) + for(var i=0;i{ this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) //console.log(this.tabledata[0].companyStatistics.trendStatistics.added) - for(var i=0;i=this.echartsData.selectStartMonth&&this.tabledata[0].companyStatistics.trendStatistics.added[i].month<=this.echartsData.selectEndMonth){ - this.datayuex.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].month) - this.datayuey.push(this.tabledata[0].companyStatistics.trendStatistics.added[i].count) + for(var i=0;i=this.echartsData.selectStartMonth&&this.tabledata[0][i].month<=this.echartsData.selectEndMonth){ + this.datayuex.push(this.tabledata[0][i].month) + this.datayuey.push(this.tabledata[0][i].count) } } this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.datayuey,this.datayuex) this.twoInit(this.datayuex,this.datayuey) - },1000) + }) + } + //按年查询 + async findyear(){ + this.twoExample.clear() + this.dataYearX=[] + this.dataYearY=[] + let paramdata={ + objectType:1, + planStatus:this.type, + TrendType:this.echartsData.selectType + } + await this.echartsData.getData(paramdata,`/api/StatisticsAnalysis/Trends`) + window.setTimeout(()=>{ + this.tabledata=JSON.parse(JSON.stringify(this.echartsData.allDate)) + //console.log(this.tabledata[0].companyStatistics.trendStatistics.added) + for(var i=0;i=this.echartsData.selectOneYear&&this.tabledata[0][i].year<=this.echartsData.selectTwoYear){ + this.dataYearX.push(this.tabledata[0][i].year) + this.dataYearY.push(this.tabledata[0][i].count) + } + } + this.tiaoshiPao=this.echartsData.qipao(this.tiaoshiPao,this.dataYearY,this.dataYearX) + this.twoInit(this.dataYearX,this.dataYearY) + }) } - headtext twoExample:any; tabledata @@ -268,10 +306,9 @@ export class echartsComponent implements OnInit { let that = this this.twoExample = echarts.init(document.getElementById('two'), 'skinUpp'); var option = { - // 标题 title: { - text: this.headtext+':总数(102)', + text: this.headtext+`:总数(${this.zongcount})`, top: -4, left: 'center', bottom: 100, @@ -281,6 +318,9 @@ export class echartsComponent implements OnInit { color:'#000', } }, + grid: { + top: 90, + }, tooltip: { trigger: 'axis', position: this.echartsData.tableTooltipNoShowq, @@ -353,7 +393,7 @@ export class echartsComponent implements OnInit { if (this.twoExample.containPixel('grid',pointInPixel)) { let xIndex=this.twoExample.convertFromPixel({seriesIndex:0},[params.offsetX, params.offsetY])[0]; if(this.echartsData.selectType==2){ - this.router.navigate(['/statisticanalysis/stataPageThereYearComponent'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':option.title.text,'type':this.type}}); + this.router.navigate(['/statisticanalysis/stataPageThereYearComponent'],{queryParams:{'level':this.headtext,'headtext':option.title.text,'type':this.type,'year':X[xIndex]}}); }else{ /*事件处理代码书写位置*/ if(this.echartsData.level=='0'||this.echartsData.level=='1'||this.echartsData.level=='2'){ @@ -363,7 +403,7 @@ export class echartsComponent implements OnInit { //this.router.navigate(['/statisticanalysis/statePageOne/name'],{queryParams:{'level':option.xAxis.data[xIndex],'headtext':this.headtext,'type':this.type}}); } else if(this.echartsData.level=='3'){ //中队跳转 - this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':params.name,'type':1}}); + this.router.navigate(['/statisticanalysis/AllPlan'],{queryParams:{'name':params.name,'type':this.type}}); } }