|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import { Component, OnInit } from '@angular/core'; |
|
|
|
|
import { Component, OnInit,ViewChild } from '@angular/core'; |
|
|
|
|
import { Router } from '@angular/router'; |
|
|
|
|
import { ActivatedRoute } from '@angular/router'; |
|
|
|
|
import {EchartsDataService} from '../echarts-data.service' |
|
|
|
@ -176,13 +176,83 @@ export class indexConditionComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
export class publicEchartsComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
constructor(private router: Router,public echartsData:EchartsDataService,public dialog: MatDialog,) { } |
|
|
|
|
constructor(private router: Router,public echartsData:EchartsDataService,public dialog: MatDialog,public snackBar: MatSnackBar) { } |
|
|
|
|
|
|
|
|
|
@ViewChild('verified')verifieds :verifiedComponent; //父组件中获得子组件的引用
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.echartsData.scheduledUpdatesToggle = 1 |
|
|
|
|
this.dateInit() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
isToggle:boolean = true; // 已核查/未核查
|
|
|
|
|
selectType:string = 'month'; //选择当前的 查询类型 按月/年
|
|
|
|
|
//查询数据
|
|
|
|
|
years:any = [] |
|
|
|
|
selectMonth:any = [1,2,3,4,5,6,7,8,9,10,11,12] |
|
|
|
|
|
|
|
|
|
//日期初始化
|
|
|
|
|
dateInit () { |
|
|
|
|
let date = (new Date()).getFullYear() |
|
|
|
|
for (let i=date; i>=date-10;i--) { |
|
|
|
|
this.years.unshift(i) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
selectOneYear:any = (new Date()).getFullYear() //开始年份
|
|
|
|
|
selectTwoYear:any = (new Date()).getFullYear() //结束年份
|
|
|
|
|
selectStartMonth:any = 1 //开始月份
|
|
|
|
|
selectEndMonth:any = (new Date()).getMonth()+1 //结束月份
|
|
|
|
|
//点击月或年
|
|
|
|
|
changeTime(e){ |
|
|
|
|
console.log(e) |
|
|
|
|
//this.echartsData.selectType=0
|
|
|
|
|
this.verifieds.changeTime(e.value) |
|
|
|
|
} |
|
|
|
|
//按月查询
|
|
|
|
|
monthSubmit (e) { |
|
|
|
|
|
|
|
|
|
if (e.selectTwoYear > e.selectOneYear) { |
|
|
|
|
let startTime = e.selectOneYear + '-' + e.selectStartMonth + '-' + 1 + ' ' + 0 + ':' + 0 +':'+ 0 |
|
|
|
|
let endTime = e.selectTwoYear + '-' + e.selectEndMonth + '-' + 31 + ' ' + 23 + ':' + 59 +':'+ 59 |
|
|
|
|
// console.log(startTime)
|
|
|
|
|
// console.log(endTime)
|
|
|
|
|
} else if (e.selectTwoYear === e.selectOneYear) { |
|
|
|
|
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 |
|
|
|
|
// console.log(startTime)
|
|
|
|
|
// console.log(endTime)
|
|
|
|
|
} else { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('请选择正确时间区段','确定',config); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('请选择正确时间区段','确定',config); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectStartYear:any = (new Date()).getFullYear() //开始年份
|
|
|
|
|
selectEndYear:any = (new Date()).getFullYear() //结束年份
|
|
|
|
|
|
|
|
|
|
//按年查询
|
|
|
|
|
yearSubmit (e) { |
|
|
|
|
if (e.selectEndYear >= e.selectStartYear) { |
|
|
|
|
let startTime = e.selectStartYear + '-' + 1 + '-' + 1 + ' ' + 0 + ':' + 0 +':'+ 0 |
|
|
|
|
let endTime = e.selectEndYear + '-' + 12 + '-' + 31 + ' ' + 23 + ':' + 59 +':'+ 59 |
|
|
|
|
} else { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('请选择正确时间区段','确定',config); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//已核查
|
|
|
|
|
verified () { |
|
|
|
@ -245,8 +315,8 @@ export class verifiedComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
window.setTimeout(()=>{ |
|
|
|
|
this.qipaotishi=this.echartsData.qipao(this.qipaotishi,this.ydata,this.xdata) |
|
|
|
|
this.oneInit() |
|
|
|
|
this.qipaotishi=this.echartsData.qipao(this.qipaotishi,this.ydatayue,this.xdatayue) |
|
|
|
|
this.oneInit(this.xdatayue,this.ydatayue) |
|
|
|
|
//this.twoInit()
|
|
|
|
|
},0) |
|
|
|
|
} |
|
|
|
@ -259,11 +329,25 @@ export class verifiedComponent implements OnInit {
|
|
|
|
|
element.echart.clear() |
|
|
|
|
}); |
|
|
|
|
} */ |
|
|
|
|
async changeTime (e){ |
|
|
|
|
this.oneEcharts.clear() |
|
|
|
|
this.oneEcharts.dispose() |
|
|
|
|
this.qipaotishi='' |
|
|
|
|
if(e=='year'){ |
|
|
|
|
this.qipaotishi=this.echartsData.qipao(this.qipaotishi,this.ydataYear,this.xdataYear) |
|
|
|
|
this.oneInit(this.xdataYear,this.ydataYear) |
|
|
|
|
}else{ |
|
|
|
|
this.qipaotishi=this.echartsData.qipao(this.qipaotishi,this.ydatayue,this.xdatayue) |
|
|
|
|
this.oneInit(this.xdatayue,this.ydatayue) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
oneEcharts:any; |
|
|
|
|
qipaotishi |
|
|
|
|
xdata=['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月','9月','10月','11月','12月'] |
|
|
|
|
ydata=[1170, 953, 1144, 799, 789, 773, 660, 998, 790, 1004, 1345, 1245] |
|
|
|
|
xdatayue=['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月','9月','10月','11月','12月'] |
|
|
|
|
ydatayue=[1170, 953, 1144, 799, 789, 773, 660, 998, 790, 1004, 1345, 1345] |
|
|
|
|
xdataYear=['2020','2021'] |
|
|
|
|
ydataYear=['2','5'] |
|
|
|
|
//提示框表格
|
|
|
|
|
tableTooltip(dataArr,title:string){ |
|
|
|
|
let data = dataArr |
|
|
|
@ -290,7 +374,7 @@ export class verifiedComponent implements OnInit {
|
|
|
|
|
res+='</table></div></div>' |
|
|
|
|
return res |
|
|
|
|
} |
|
|
|
|
oneInit () { |
|
|
|
|
oneInit (xdata,ydata) { |
|
|
|
|
|
|
|
|
|
this.oneEcharts = echarts.init(document.getElementById('center'),'walden'); |
|
|
|
|
var option = { |
|
|
|
@ -326,7 +410,7 @@ export class verifiedComponent implements OnInit {
|
|
|
|
|
xAxis: { |
|
|
|
|
type: 'category', |
|
|
|
|
boundaryGap:true, |
|
|
|
|
data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月','9月','10月','11月','12月'], |
|
|
|
|
data:xdata, |
|
|
|
|
axisLabel:{ |
|
|
|
|
textStyle:{ |
|
|
|
|
fontSize :18, |
|
|
|
@ -370,7 +454,7 @@ export class verifiedComponent implements OnInit {
|
|
|
|
|
symbolSize:[65, 65], |
|
|
|
|
data: this.qipaotishi |
|
|
|
|
}, |
|
|
|
|
data: [1170, 953, 1144, 799, 789, 773, 660, 998, 790, 1004, 1345, 1245], |
|
|
|
|
data:ydata, |
|
|
|
|
clickable:false, |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|