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) {
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'),
time: Number(this.data.time)
};
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;
this.done.emit();
}
this.message.info(res.errMsg);
}
);