2018-10-29 16:27:34 +08:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2018-12-21 18:28:32 +08:00
|
|
|
import { HttpClientService } from '../../../services/http-client.service';
|
|
|
|
|
import { Router } from '@angular/router';
|
|
|
|
|
import { NzMessageService } from 'ng-zorro-antd';
|
2018-10-29 16:27:34 +08:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-data-synchronize',
|
|
|
|
|
templateUrl: './data-synchronize.component.html',
|
|
|
|
|
styleUrls: ['./data-synchronize.component.scss']
|
|
|
|
|
})
|
|
|
|
|
export class DataSynchronizeComponent implements OnInit {
|
2018-12-21 18:28:32 +08:00
|
|
|
selectedValue:any='1';
|
|
|
|
|
dateRange:any='';
|
|
|
|
|
search:any={
|
|
|
|
|
date_start:'',
|
|
|
|
|
date_end:''
|
|
|
|
|
}
|
|
|
|
|
constructor() { }
|
2018-10-29 16:27:34 +08:00
|
|
|
|
2018-12-21 18:28:32 +08:00
|
|
|
ngOnInit() {
|
|
|
|
|
}
|
|
|
|
|
onChange(result: Date): void {
|
|
|
|
|
this.search.date_start=this.changeDate(result[0]);
|
|
|
|
|
this.search.date_end=this.changeDate(result[1]);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//日期时间处理
|
|
|
|
|
changeDate(time){
|
|
|
|
|
var date = new Date(time);
|
|
|
|
|
var Y = date.getFullYear()+'';
|
|
|
|
|
var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1)+'';
|
|
|
|
|
var D = (date.getDate()<10?'0'+date.getDate():date.getDate())+'';
|
|
|
|
|
var h = (date.getHours()<10?'0'+date.getHours():date.getHours())+'' ;
|
|
|
|
|
var m = (date.getMinutes()<10?'0'+date.getMinutes():date.getMinutes())+'';
|
|
|
|
|
var s = date.getSeconds()<10?'0'+date.getSeconds():date.getSeconds()+'';
|
|
|
|
|
return Y+'-'+M+'-'+D+' '+h+':'+m+':'+s;
|
|
|
|
|
}
|
2018-10-29 16:27:34 +08:00
|
|
|
}
|