Commit 18596d22 authored by wangqinghua's avatar wangqinghua

update

parent f998bbbe
......@@ -23,8 +23,8 @@
</div>
<div class="tabset">
<div class="tabset-btn">
<button nz-button nzType="default">编辑</button>
<button nz-button nzType="default">删除</button>
<button (click)="editBasicModal()" nz-button nzType="default">编辑</button>
<button (click)="showDeleteConfirm()" nz-button nzType="default">删除</button>
</div>
<div class="releative">
<nz-tabset class="tabs-smart ">
......@@ -193,3 +193,5 @@
</nz-tabset>
</div>
</div>
<!--添加网站-->
<smart-website #smartWebsite (done)="getwebList()"></smart-website>
\ No newline at end of file
import {Component, OnInit, OnChanges, ViewChild, ElementRef} from '@angular/core';
import {OverAllService} from '../../overAll.service';
import {ActivatedRoute} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router';
import {NzMessageService} from 'ng-zorro-antd';
import {DatePipe} from '@angular/common';
import {WebsiteComponent} from '../../../modal/website/website.component';
import {CommonService} from '../../../shared/common/common.service';
@Component({
selector: 'smart-network-detail',
......@@ -28,6 +30,7 @@ import {DatePipe} from '@angular/common';
export class NetworkDetailComponent implements OnInit, OnChanges {
@ViewChild('chartSpeedLeft') chartSpeedLeft:ElementRef;
@ViewChild('chartTimeLeft') chartTimeLeft:ElementRef;
@ViewChild('smartWebsite') smartWebsite:WebsiteComponent;
httptestid; //网站ID
webName; //网站名称
......@@ -50,8 +53,8 @@ export class NetworkDetailComponent implements OnInit, OnChanges {
endTime: ''
};
constructor(private overAllSer: OverAllService, private routerInfo: ActivatedRoute,
private message: NzMessageService, private datePipe: DatePipe) {
constructor(private overAllSer: OverAllService, private routerInfo: ActivatedRoute,private router:Router,
private message: NzMessageService, private datePipe: DatePipe,private commonSer:CommonService) {
}
ngOnInit() {
......@@ -278,4 +281,30 @@ export class NetworkDetailComponent implements OnInit, OnChanges {
this.isSpinning = false;
}
//编辑网站
editBasicModal(){
this.smartWebsite.showEditModal(this.httptestid);
}
//单个删除
showDeleteConfirm(){
this.commonSer.confirmThing("删除","确认要删除该网站监测吗",()=>{
let arr = [];
arr.push(this.httptestid);
const data = {
ids:arr
};
this.overAllSer.deleteBatch(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.success('删除成功');
this.router.navigate(['app/main/networkCheck'])
} else {
this.message.error(res.errMsg);
}
}
);
});
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment