Newer
Older
import {AlarmService} from '../alarm.service';
import {NzMessageService, NzModalService} from 'ng-zorro-antd';
import {MediaTypeComponent} from '../modal/media-type/media-type.component';
selector: 'smart-send-set',
templateUrl: './send-set.component.html',
styles: []
constructor(private alarmSer: AlarmService, private modalSer: NzModalService,
private message: NzMessageService,private modalService:NzModalService) {
this.alarmSer.mediaTypeFind({}).subscribe(
(res) => {
if (res.errCode == 10000) {
this.sendList = res.data;
}
//删除发送方式
deleteSend(data) {
this.modalSer.confirm({
nzTitle: '删除',
nzContent: '<b style="color: red;">确认删除该发送方式吗?</b>',
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
const arr = {
ids: []
};
arr.ids.push(data.mediatypeid);
this.alarmSer.mediaTypeDelete(arr).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.info('删除成功');
);
},
nzCancelText: '取消',
nzOnCancel: () => console.log('Cancel')
}
);
}
showEditModal(item) {
this.smartMediaType.showEditModal(item, '编辑发送方式');
//新增发送方式
showAddModal() {
this.smartMediaType.showAddModal('新增发送方式');
//启用or禁用
operationSend(title,status,item){
this.modalService.confirm({
nzTitle: title,
nzContent: '<b style="color: red;">确定要' + title + '该发送方式吗</b>',
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
this.alarmSer.mediaTypeStatus(item.mediatypeid, status).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.info(title + '成功');
this.getList();
} else {
this.message.info(res.errMsg);
}
}
);
},
nzCancelText: '取消',
nzOnCancel: () => console.log('Cancel')
});
}