Newer
Older
import {OverAllService} from '../../overAll/overAll.service';
import { DatePipe } from '@angular/common';
@Component({
selector: 'smart-pause',
templateUrl: './pause.component.html',
styles: []
})
export class PauseComponent implements OnInit {
constructor(public overAllSer: OverAllService,public datePipe:DatePipe,
public message:NzMessageService) {
initForm(){
this.data = {
startTime: null,
time: ''
};
}
this.isShow = true;
}
handleCancel() {
this.isShow = false;
}
handleOk() {
if(this.typeTitle == '基础资源'){
this.basic();
}
if(this.typeTitle == '网站监测'){
this.web();
}
}
basic(){
startTime: this.datePipe.transform(this.data.startTime,'yyyy-MM-dd HH:mm:ss'),
this.initForm();
this.message.success("临时暂停成功");
}else{
this.message.error(res.errMsg);
web(){
const data = {
httptestid: Number(this.id),
startTime: this.datePipe.transform(this.data.startTime,'yyyy-MM-dd HH:MM:ss'),
time: Number(this.data.time)
};
this.overAllSer.tempStopWebscenario(data).subscribe(
(res) => {
if(res.errCode == 10000){
this.isShow = false;