Commit ddffc116 authored by wangqinghua's avatar wangqinghua

update

parent 6c33be72
......@@ -32,7 +32,7 @@
<ng-container *ngIf="data.r_clock">已恢复</ng-container>
<ng-container *ngIf="!data.r_clock">告警中</ng-container>
</td>
<td class="list-icon" (click)="showLog(data)"><i class="anticon anticon-profile"></i></td>
<td class="list-icon cursor" (click)="showLog(data)"><i class="anticon anticon-profile"></i></td>
</tr>
</tbody>
</nz-table>
......
......@@ -25,7 +25,7 @@
<div class="tabset-btn">
<button (click)="showCheckModal()" nz-button nzType="default">添加监测点</button>
<!--<button nz-button nzType="default">编辑</button>-->
<button nz-button nzType="default">删除</button>
<button (click)="showDeleteConfirm()" nz-button nzType="default">删除</button>
</div>
<div class="releative" #checkEle>
<div #colorEle class="checkTags tag-form">
......
import {AfterViewInit, Component, ElementRef, OnInit, Renderer, ViewChild,} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {ActivatedRoute, Router} from '@angular/router';
import {OverAllService} from '../../overAll.service';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
import {NzMessageService} from 'ng-zorro-antd';
......@@ -108,7 +108,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
validateForm: FormGroup;
constructor(private routerInfo: ActivatedRoute, private message: NzMessageService,
private overAllSer: OverAllService, private renderer: Renderer,
private overAllSer: OverAllService, private renderer: Renderer,private router:Router,
private fb: FormBuilder, private modalService: NzModalService,private datePipe:DatePipe) {
}
......@@ -829,4 +829,32 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
});
}
//删除单个资源
showDeleteConfirm() {
this.modalService.confirm({
nzTitle: '删除',
nzContent: '<b style="color: red;">确认删除该资源吗?</b>',
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
const data = {
hostids:[]
};
data.hostids.push(this.hostId);
this.overAllSer.deleteHostPost(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.success('删除成功');
this.router.navigate(['app/main/basic']);
} else {
this.message.error(res.errMsg);
}
}
);
},
nzCancelText: '取消',
nzOnCancel: () => console.log('Cancel')
});
}
}
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