|
|
|
@ -39,26 +39,28 @@ export class AddUnitTwoTimeComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
//获取数据
|
|
|
|
|
yeardatee |
|
|
|
|
getdata(){ |
|
|
|
|
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||'' |
|
|
|
|
} |
|
|
|
|
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.tabledata[0].companyStatistics.trendStatistics.added.length;i++){ |
|
|
|
|
if(this.tabledata[0].companyStatistics.trendStatistics.added[i].month>=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.tabledata[0].length;i++){ |
|
|
|
|
if(this.tabledata[0][i].month>=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 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -66,7 +68,7 @@ export class AddUnitTwoTimeComponent implements OnInit {
|
|
|
|
|
//this.oneInit (this.date,this.dateNum)
|
|
|
|
|
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date) |
|
|
|
|
this.twoInit (this.date,this.dateNum,'month') |
|
|
|
|
}, 1000); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
forward(){ |
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.headname,'id':this.lastId,'type':this.zhiorbuild=='zhi'?'zhi':'build'}}) |
|
|
|
@ -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.tabledata[0].companyStatistics.trendStatistics.added.length;i++){ |
|
|
|
|
if(this.tabledata[0].companyStatistics.trendStatistics.added[i].month>=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.tabledata[0].length;i++){ |
|
|
|
|
if(this.tabledata[0][i].month>=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<this.tabledata[0].length;i++){ |
|
|
|
|
if(this.tabledata[0][i].year>=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.tabledata[0].companyStatistics.trendStatistics.added.length;i++){ |
|
|
|
|
this.dateNum2.push(this.tabledata[0].companyStatistics.trendStatistics.added[0].count) |
|
|
|
|
this.zongcount=this.zongcount+this.tabledata[0].companyStatistics.trendStatistics.added[i].count |
|
|
|
|
console.log(this.tabledata) |
|
|
|
|
for(var i=0;i<this.tabledata[0].length;i++){ |
|
|
|
|
this.dateNum2.push(this.tabledata[0][i].count) |
|
|
|
|
this.zongcount=this.zongcount+this.tabledata[0][i].count |
|
|
|
|
} |
|
|
|
|
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum,this.date) |
|
|
|
|
this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum2,this.date2) |
|
|
|
|
this.twoInit (this.date2,this.dateNum2,'year') |
|
|
|
|
}, 1000); |
|
|
|
|
}); |
|
|
|
|
/* this.tiaoshiPao=this.serviceData.qipao(this.tiaoshiPao,this.dateNum2,this.date2) |
|
|
|
|
this.twoInit(this.date2,this.dateNum2,'year') */ |
|
|
|
|
} |
|
|
|
@ -224,7 +247,7 @@ export class AddUnitTwoTimeComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
date2 = ['2020', '2021'] |
|
|
|
|
dateNum2 = [0] |
|
|
|
|
dateNum2 = [] |
|
|
|
|
|
|
|
|
|
//新增数量统计
|
|
|
|
|
oneInit (date,dateNum) { |
|
|
|
@ -320,15 +343,12 @@ export class AddUnitTwoTimeComponent implements OnInit {
|
|
|
|
|
item.echart = echarts.init(document.getElementById('gaoceng'), 'skinUpp'); |
|
|
|
|
var option = { |
|
|
|
|
grid: { |
|
|
|
|
top: 50, |
|
|
|
|
left:40, |
|
|
|
|
right: 20, |
|
|
|
|
//bottom: 20,
|
|
|
|
|
top: 90, |
|
|
|
|
}, |
|
|
|
|
// 标题
|
|
|
|
|
title: { |
|
|
|
|
text: this.headname+`:总数(${this.zongcount})`, |
|
|
|
|
top: -4, |
|
|
|
|
top:-4, |
|
|
|
|
left: 'center', |
|
|
|
|
textStyle:{ |
|
|
|
|
//文字颜色
|
|
|
|
@ -374,6 +394,7 @@ export class AddUnitTwoTimeComponent implements OnInit {
|
|
|
|
|
}, |
|
|
|
|
// y轴
|
|
|
|
|
yAxis: { |
|
|
|
|
//min:10,
|
|
|
|
|
type: 'value', |
|
|
|
|
name: '个', |
|
|
|
|
axisLabel: { |
|
|
|
@ -411,7 +432,7 @@ export class AddUnitTwoTimeComponent implements OnInit {
|
|
|
|
|
/*事件处理代码书写位置*/ |
|
|
|
|
// console.log(option.series[0].data[xIndex],option.xAxis.data[xIndex],option.title.text,option.series[0].name)
|
|
|
|
|
if(option.series[0].name == "year"){ |
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time/three_lineDetails'],{queryParams:{'year':this.date2[xIndex],'buildingType':this.headname,'id':this.lastId}}); |
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time/three_lineDetails'],{queryParams:{'year':this.date2[xIndex],'buildingType':this.headname,'id':this.lastId,'type':this.zhiorbuild}}); |
|
|
|
|
|
|
|
|
|
/* this.selectType="month" |
|
|
|
|
this.yeardatee=option.xAxis.data[xIndex] |
|
|
|
@ -420,7 +441,7 @@ export class AddUnitTwoTimeComponent implements OnInit {
|
|
|
|
|
}else{ |
|
|
|
|
if(this.serviceData.level=='0'||this.serviceData.level=='1'||this.serviceData.level=='2'){ |
|
|
|
|
//this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_time/three_barDetails'],{queryParams:{'level':'zhidui','time':option.xAxis.data[xIndex],'buildingTpye':this.headname}});
|
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.headname,'id':this.lastId}}) |
|
|
|
|
this.router.navigate(['/statisticanalysis/addUnit_one/addUnit_two_type'],{queryParams:{'level':this.headname,'id':this.lastId,'type':this.zhiorbuild}}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|