Commit 5cca4a59 authored by wangqinghua's avatar wangqinghua

2019.1.12

parent 730987ee
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</div> </div>
</div> </div>
<nz-spin [nzSpinning]="isLoading"> <nz-spin [nzSpinning]="isLoading">
<div echarts [options]="chartOption" style="height: 400px;width: 100%"></div> <div echarts [options]="chartOption" (chartInit)="onEchartInit($event)" style="height: 400px;width: 100%"></div>
</nz-spin> </nz-spin>
<nz-tabset [nzTabPosition]="'top'" [nzType]="'card'"> <nz-tabset [nzTabPosition]="'top'" [nzType]="'card'">
<nz-tab nzTitle="接收流量排行"> <nz-tab nzTitle="接收流量排行">
......
...@@ -4,9 +4,8 @@ import {OverAllService} from '../../overAll/overAll.service'; ...@@ -4,9 +4,8 @@ import {OverAllService} from '../../overAll/overAll.service';
import {NzMessageService} from 'ng-zorro-antd'; import {NzMessageService} from 'ng-zorro-antd';
import {pageSize} from '../../app.constants'; import {pageSize} from '../../app.constants';
import {DatePipe} from '@angular/common'; import {DatePipe} from '@angular/common';
import { setInterval, clearInterval } from 'timers'; import {setInterval, clearInterval} from 'timers';
import { NgxEchartsModule } from 'ngx-echarts';
declare var vis: any;
@Component({ @Component({
selector: 'smart-flow-trend', selector: 'smart-flow-trend',
...@@ -23,6 +22,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -23,6 +22,7 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
startTime: '', startTime: '',
endTime: '' endTime: ''
}; };
echartObj;
//in //in
inList = []; inList = [];
...@@ -60,6 +60,10 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -60,6 +60,10 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
this.getGroup(); this.getGroup();
} }
onEchartInit(e){
this.echartObj = e;
}
//获取分组 //获取分组
getGroup() { getGroup() {
this.overAllSer.getgroups({}).subscribe( this.overAllSer.getgroups({}).subscribe(
...@@ -89,9 +93,9 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -89,9 +93,9 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
this.obj.hostid = this.hostList[0].hostid + ''; this.obj.hostid = this.hostList[0].hostid + '';
this.getEcharts(null); this.getEcharts(null);
// this.time_ = thisset // this.time_ = thisset
this.time_ = setInterval(()=>{ this.time_ = setInterval(() => {
this.findByTime(); this.findByTime();
},1000); }, 1000);
} else { } else {
this.message.warning('当前资源组无资源'); this.message.warning('当前资源组无资源');
} }
...@@ -101,24 +105,125 @@ export class FlowTrendComponent implements OnInit, OnDestroy { ...@@ -101,24 +105,125 @@ export class FlowTrendComponent implements OnInit, OnDestroy {
} }
//实时流量数据 //实时流量数据
findByTime(){ findByTime() {
this.topologySer.findByTime(this.obj.hostid).subscribe( this.topologySer.findByTime(this.obj.hostid).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
console.log('有值'); console.log('有值');
}else{ let nowTime = new Date().getTime() + 500;
const inData = {
clock:this.datePipe.transform(nowTime,"yyyy-MM-dd HH:mm"),
avg:res.data.in
};
this.inEchartData.push(inData);
const outData = {
clock:this.datePipe.transform(nowTime,"yyyy-MM-dd HH:mm"),
avg:res.data.out
};
this.outEchartData.push(outData);
this.flashEcharts();
} else {
this.message.warning(res.errMsg); this.message.warning(res.errMsg);
clearInterval(this.time_); clearInterval(this.time_);
console.log("停止"); console.log('停止');
} }
} }
) );
}
//实时刷新图表
flashEcharts() {
let itemStyle = {
normal: {},
emphasis: {
barBorderWidth: 1,
shadowBlur: 10,
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowColor: 'rgba(0,0,0,0.5)'
}
};
this.echartObj.setOption({
title: {
text: '进出口流量峰值趋势图',
left: 'center',
},
backgroundColor: '#eee',
tooltip: {
// trigger: 'axis',
formatter: (params) => {
let res = params.seriesName;
res += '<br/>时间:' + params.name;
let Mbps = 1000 * 1000;
let kbps = 1000;
let size = Math.abs(params.data);
if (size / Mbps > 1) {
res += '<br/>流量:' + (size / Mbps).toFixed(2) + 'Mbps';
} else if (size / kbps > 1) {
res += '<br/>流量:' + (size / kbps).toFixed(2) + 'kbps';
} else {
res += '<br/>流量:' + (size) + 'bbps';
}
return res;
}
},
xAxis: {
data: this.inEchartData.map(e => {
let date = this.datePipe.transform(e.clock, 'yyyy-MM-dd HH:mm');
return date;
}),
name: '时间',
},
dataZoom: [{
startValue: this.obj.startTime
}, {
type: 'inside'
}],
yAxis: {
inverse: true,
splitArea: {show: false},
type: 'value',
axisLabel: { //Y轴数据
formatter: function(value) {
return Math.abs(value) / 10000 + ' kbps'; //负数取绝对值变正数
},
textStyle: {
color: '#666'
}
},
},
grid: {
left: 100
},
series: [
{
name: '进口流量',
type: 'line',
stack: 'one',
itemStyle: itemStyle,
data: this.inEchartData.map(e => {
return e.avg;
})
},
{
// name: '出口流量',
type: 'line',
stack: 'one',
itemStyle: itemStyle,
data: this.outEchartData.map(e => {
return -e.avg;
})
}
]
})
} }
//页面离开 //页面离开
ngOnDestroy(){ ngOnDestroy() {
//销毁定时任务 //销毁定时任务
console.log("销毁定时任务"); console.log('销毁定时任务');
clearInterval(this.time_); clearInterval(this.time_);
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<div nz-col nzSpan="3"></div> <div nz-col nzSpan="3"></div>
</div> </div>
<nz-table #nzTable [nzData]="checkList"> <nz-table #nzTable [nzData]="checkList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)" [nzLoading]="loading">
<thead> <thead>
<tr> <tr>
<th nzShowCheckbox [nzIndeterminate]="indeterminate" [nzChecked]="allChecked" (nzCheckedChange)="checkAll($event)"></th> <th nzShowCheckbox [nzIndeterminate]="indeterminate" [nzChecked]="allChecked" (nzCheckedChange)="checkAll($event)"></th>
...@@ -46,11 +46,11 @@ ...@@ -46,11 +46,11 @@
<tbody> <tbody>
<tr *ngFor="let data of checkList"> <tr *ngFor="let data of checkList">
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td> <td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td>
<td class="round-tag tag-form">{{data.inventoryNo}}</td> <td class="round-tag tag-form">{{data.name}}</td>
<td>{{data.stock}}</td> <td>{{data.key_}}</td>
<td>{{data.usedcount}}</td> <td>{{data.usedcount}}</td>
<td>{{data.lendcount}}</td> <td>{{data.type}}</td>
<td>{{data.repaircount}}</td> <td>{{data.status}}</td>
<td> <td>
<span>编辑</span> <span>编辑</span>
<span>删除</span> <span>删除</span>
...@@ -60,4 +60,4 @@ ...@@ -60,4 +60,4 @@
</nz-table> </nz-table>
<!--监控项原型--> <!--监控项原型-->
<smart-check-prototype #smartCheckProtoType></smart-check-prototype> <smart-check-prototype #smartCheckProtoType (done)="getList()"></smart-check-prototype>
\ No newline at end of file \ No newline at end of file
...@@ -8,18 +8,19 @@ import {pageSize} from '../../../app.constants'; ...@@ -8,18 +8,19 @@ import {pageSize} from '../../../app.constants';
import {CheckPrototypeComponent} from '../modal/check-prototype/check-prototype.component'; import {CheckPrototypeComponent} from '../modal/check-prototype/check-prototype.component';
@Component({ @Component({
selector: 'smart-check-list', selector: 'smart-check-list',
templateUrl: './check-list.component.html', templateUrl: './check-list.component.html',
styles: [] styles: []
}) })
export class CheckListComponent implements OnInit { export class CheckListComponent implements OnInit {
@ViewChild('smartCheckProtoType') smartCheckProtoType:CheckPrototypeComponent; @ViewChild('smartCheckProtoType') smartCheckProtoType: CheckPrototypeComponent;
tempName; tempName;
disName; disName;
hostId; hostId;
discoveryids; discoveryids;
loading = false;
pageNum = 1; pageNum = 1;
pageCount = pageSize; pageCount = pageSize;
totalNum; totalNum;
...@@ -30,17 +31,17 @@ export class CheckListComponent implements OnInit { ...@@ -30,17 +31,17 @@ export class CheckListComponent implements OnInit {
allChecked; allChecked;
indeterminate; indeterminate;
constructor(private overAllSer: OverAllService, private routerInfo: ActivatedRoute,private router:Router, constructor(private overAllSer: OverAllService, private routerInfo: ActivatedRoute, private router: Router,
private message:NzMessageService,private systemSer:SystemService, private message: NzMessageService, private systemSer: SystemService,
private commonSer:CommonService) { private commonSer: CommonService) {
this.routerInfo.queryParams.subscribe( this.routerInfo.queryParams.subscribe(
(res) => { (res) => {
this.discoveryids = res.discoveryids; this.discoveryids = res.discoveryids;
this.tempName = res.name; this.tempName = res.name;
this.hostId = res.hostId; this.hostId = res.hostId;
} }
); );
} }
checkAll(value: boolean): void { checkAll(value: boolean): void {
this.checkList.forEach(data => data.checked = value); this.checkList.forEach(data => data.checked = value);
...@@ -71,76 +72,84 @@ export class CheckListComponent implements OnInit { ...@@ -71,76 +72,84 @@ export class CheckListComponent implements OnInit {
this.indeterminate = (!allChecked) && (!allUnChecked); this.indeterminate = (!allChecked) && (!allUnChecked);
} }
ngOnInit() { ngOnInit() {
this.getList(); this.getList();
} }
//翻页
change(e) {
this.pageNum = e;
this.getList();
}
getList(){ getList() {
this.loading = true;
const data = { const data = {
pageNum:this.pageNum, pageNum: this.pageNum,
pageCount:this.pageCount, pageCount: this.pageCount,
hostIds:[this.discoveryids] discoveryids: [this.discoveryids]
}; };
this.overAllSer.findItemPrototype(data).subscribe( this.overAllSer.findItemPrototype(data).subscribe(
(res) => { (res) => {
this.checkList = res.data.data; this.checkList = res.data.data;
this.totalNum = res.data.totalNum; this.totalNum = res.data.totalNum;
this.loading = false;
} }
); );
} }
//新增监控项原型 //新增监控项原型
showAddModal(){ showAddModal() {
this.smartCheckProtoType.showAddModal(this.hostId,this.discoveryids,"添加监控项原型") this.smartCheckProtoType.showAddModal(this.hostId, this.discoveryids, '添加监控项原型');
} }
//编辑监控项原型 //编辑监控项原型
showEditModal(data){ showEditModal(data) {
this.smartCheckProtoType.showEditModal(this.hostId,this.discoveryids,data.itemid,"编辑监控项原型") this.smartCheckProtoType.showEditModal(this.hostId, this.discoveryids, data.itemid, '编辑监控项原型');
} }
//单个删除 //单个删除
deleteCheck(item){ deleteCheck(item) {
this.commonSer.confirmThing("删除","确定删除当前的自动发现",()=>{ this.commonSer.confirmThing('删除', '确定删除当前的自动发现', () => {
const data ={ const data = {
ids:[] ids: []
}; };
data.ids.push(item.itemid); data.ids.push(item.itemid);
this.overAllSer.deleteItemPrototype(data).subscribe( this.overAllSer.deleteItemPrototype(data).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.message.success("删除成功"); this.message.success('删除成功');
this.getList(); this.getList();
}else{ } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
} }
) );
}) });
} }
//批量删除 //批量删除
deleteBatchCheck(){ deleteBatchCheck() {
if(this.selectList.length == 0){ if (this.selectList.length == 0) {
this.message.warning("请选择需要删除的监控项原型"); this.message.warning('请选择需要删除的监控项原型');
return false; return false;
} }
this.commonSer.confirmThing("删除","确定删除选择的监控项原型",()=>{ this.commonSer.confirmThing('删除', '确定删除选择的监控项原型', () => {
const data ={ const data = {
ids:this.selectList.map(e=>{ ids: this.selectList.map(e => {
return e.itemid; return e.itemid;
}) })
}; };
this.overAllSer.deleteItemPrototype(data).subscribe( this.overAllSer.deleteItemPrototype(data).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.message.success("删除成功"); this.message.success('删除成功');
this.getList(); this.getList();
}else{ } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
} }
) );
}) });
} }
} }
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<div nz-col nzSpan="3"></div> <div nz-col nzSpan="3"></div>
</div> </div>
<nz-table #nzTable [nzData]="discoveryList"> <nz-table #nzTable [nzData]="discoveryList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)" [nzLoading]="loading">
<thead> <thead>
<tr> <tr>
<th nzShowCheckbox [nzIndeterminate]="indeterminate" [nzChecked]="allChecked" (nzCheckedChange)="checkAll($event)"></th> <th nzShowCheckbox [nzIndeterminate]="indeterminate" [nzChecked]="allChecked" (nzCheckedChange)="checkAll($event)"></th>
......
...@@ -8,9 +8,9 @@ import {OverAllService} from '../../overAll.service'; ...@@ -8,9 +8,9 @@ import {OverAllService} from '../../overAll.service';
import {DiscoveryComponent} from '../../../modal/discovery/discovery.component'; import {DiscoveryComponent} from '../../../modal/discovery/discovery.component';
@Component({ @Component({
selector: 'smart-discovery-list', selector: 'smart-discovery-list',
templateUrl: './discovery-list.component.html', templateUrl: './discovery-list.component.html',
styles: [] styles: []
}) })
export class DiscoveryListComponent implements OnInit { export class DiscoveryListComponent implements OnInit {
@ViewChild('smartDiscovery') smartDiscovery: DiscoveryComponent; @ViewChild('smartDiscovery') smartDiscovery: DiscoveryComponent;
...@@ -19,6 +19,7 @@ export class DiscoveryListComponent implements OnInit { ...@@ -19,6 +19,7 @@ export class DiscoveryListComponent implements OnInit {
discoveryList; discoveryList;
tempName; tempName;
loading = false;
pageNum = 1; pageNum = 1;
pageCount = pageSize; pageCount = pageSize;
totalNum; totalNum;
...@@ -28,13 +29,13 @@ export class DiscoveryListComponent implements OnInit { ...@@ -28,13 +29,13 @@ export class DiscoveryListComponent implements OnInit {
disabledButton = true; disabledButton = true;
indeterminate = false; indeterminate = false;
constructor(private overAllSer: OverAllService, private routerInfo: ActivatedRoute,private router:Router, constructor(private overAllSer: OverAllService, private routerInfo: ActivatedRoute, private router: Router,
private message:NzMessageService,private systemSer:SystemService, private message: NzMessageService, private systemSer: SystemService,
private commonSer:CommonService) { private commonSer: CommonService) {
this.routerInfo.queryParams.subscribe( this.routerInfo.queryParams.subscribe(
(res) => { (res) => {
this.templateid = res.templateid; this.templateid = res.templateid;
this.tempName = res.name this.tempName = res.name;
} }
); );
} }
...@@ -72,95 +73,103 @@ export class DiscoveryListComponent implements OnInit { ...@@ -72,95 +73,103 @@ export class DiscoveryListComponent implements OnInit {
this.getList(); this.getList();
} }
//翻页
change(e) {
this.pageNum = e;
this.getList();
}
getList() { getList() {
this.loading = true;
const data = { const data = {
pageNum:this.pageNum, pageNum: this.pageNum,
pageCount:this.pageCount, pageCount: this.pageCount,
hostIds:[this.templateid] hostIds: [this.templateid]
}; };
this.overAllSer.findPageLldrule(data).subscribe( this.overAllSer.findPageLldrule(data).subscribe(
(res) => { (res) => {
this.discoveryList = res.data.data; this.discoveryList = res.data.data;
this.totalNum = res.data.totalNum; this.totalNum = res.data.totalNum;
this.loading = false;
} }
); );
} }
//添加自动发现 //添加自动发现
showAddModal() { showAddModal() {
this.smartDiscovery.showAddModal(this.templateid,"添加自动发现") this.smartDiscovery.showAddModal(this.templateid, '添加自动发现');
} }
//编辑自动发现 //编辑自动发现
showEditModal(data){ showEditModal(data) {
this.smartDiscovery.showEditModal(this.templateid,data.itemid,"编辑自动发现"); this.smartDiscovery.showEditModal(this.templateid, data.itemid, '编辑自动发现');
} }
//goto 监测项原型 //goto 监测项原型
goToCheck(data){ goToCheck(data) {
this.router.navigate(['app/main/checkList'],{ this.router.navigate(['app/main/checkList'], {
queryParams:{ queryParams: {
hostId:this.templateid, hostId: this.templateid,
discoveryids:data.itemid, discoveryids: data.itemid,
name:data.name, name: data.name,
tempName : this.tempName tempName: this.tempName
} }
}) });
} }
//goto 阈值原型 //goto 阈值原型
goToTrigger(data){ goToTrigger(data) {
this.router.navigate(['app/main/triggerList'],{ this.router.navigate(['app/main/triggerList'], {
queryParams:{ queryParams: {
id:data.itemid, id: data.itemid,
name:data.name, name: data.name,
tempName : this.tempName tempName: this.tempName
} }
}) });
} }
//单个删除 //单个删除
deleteDiscovery(item){ deleteDiscovery(item) {
this.commonSer.confirmThing("删除","确定删除当前的自动发现",()=>{ this.commonSer.confirmThing('删除', '确定删除当前的自动发现', () => {
const data ={ const data = {
ids:[] ids: []
}; };
data.ids.push(item.itemid); data.ids.push(item.itemid);
this.overAllSer.deleteLldrule(data).subscribe( this.overAllSer.deleteLldrule(data).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.message.success("删除成功"); this.message.success('删除成功');
this.getList(); this.getList();
}else{ } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
} }
) );
}) });
} }
//批量删除 //批量删除
deleteBatchDiscovery(){ deleteBatchDiscovery() {
if(this.selectList.length == 0){ if (this.selectList.length == 0) {
this.message.warning("请选择需要删除的自动发现"); this.message.warning('请选择需要删除的自动发现');
return false; return false;
} }
this.commonSer.confirmThing("删除","确定删除选择的自动发现",()=>{ this.commonSer.confirmThing('删除', '确定删除选择的自动发现', () => {
const data ={ const data = {
ids:this.selectList.map(e=>{ ids: this.selectList.map(e => {
return e.itemid; return e.itemid;
}) })
}; };
this.overAllSer.deleteLldrule(data).subscribe( this.overAllSer.deleteLldrule(data).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.message.success("删除成功"); this.message.success('删除成功');
this.getList(); this.getList();
}else{ } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
} }
) );
}) });
} }
} }
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<div nz-col nzSpan="3"></div> <div nz-col nzSpan="3"></div>
</div> </div>
<nz-table #nzTable [nzData]="triggerList"> <nz-table #nzTable [nzData]="triggerList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageNum" [nzPageSize]="pageCount" (nzPageIndexChange)="change($event)" [nzLoading]="loading">
<thead> <thead>
<tr> <tr>
<th nzShowCheckbox [nzIndeterminate]="indeterminate" [nzChecked]="allChecked" <th nzShowCheckbox [nzIndeterminate]="indeterminate" [nzChecked]="allChecked"
...@@ -59,4 +59,4 @@ ...@@ -59,4 +59,4 @@
</tbody> </tbody>
</nz-table> </nz-table>
<!--触发器原型--> <!--触发器原型-->
<smart-trigger-prototype #smartTriggerPrototype></smart-trigger-prototype> <smart-trigger-prototype #smartTriggerPrototype (done)="getList()"></smart-trigger-prototype>
\ No newline at end of file \ No newline at end of file
...@@ -14,13 +14,14 @@ import {TriggerPrototypeComponent} from '../modal/trigger-prototype/trigger-prot ...@@ -14,13 +14,14 @@ import {TriggerPrototypeComponent} from '../modal/trigger-prototype/trigger-prot
}) })
export class TriggerListComponent implements OnInit { export class TriggerListComponent implements OnInit {
@ViewChild('smartTriggerPrototype') smartTriggerPrototype:TriggerPrototypeComponent; @ViewChild('smartTriggerPrototype') smartTriggerPrototype: TriggerPrototypeComponent;
tempName; tempName;
disName; disName;
hostId; hostId;
discoveryids; discoveryids;
color = color; color = color;
loading = false;
pageNum = 1; pageNum = 1;
pageCount = pageSize; pageCount = pageSize;
totalNum; totalNum;
...@@ -76,71 +77,79 @@ export class TriggerListComponent implements OnInit { ...@@ -76,71 +77,79 @@ export class TriggerListComponent implements OnInit {
this.getList(); this.getList();
} }
//翻页
change(e) {
this.pageNum = e;
this.getList();
}
getList() { getList() {
this.loading = true;
const data = { const data = {
pageNum: this.pageNum, pageNum: this.pageNum,
pageCount: this.pageCount, pageCount: this.pageCount,
hostIds: [this.discoveryids] discoveryids: [this.discoveryids]
}; };
this.overAllSer.findPageTrigger(data).subscribe( this.overAllSer.findPageTrigger(data).subscribe(
(res) => { (res) => {
this.triggerList = res.data.data; this.triggerList = res.data.data;
this.totalNum = res.data.totalNum; this.totalNum = res.data.totalNum;
this.loading = false;
} }
); );
} }
showAddModal() { showAddModal() {
this.smartTriggerPrototype.showAddModal("新增阈值原型",this.tempName); this.smartTriggerPrototype.showAddModal('新增阈值原型', this.tempName);
} }
showEditModal(data) { showEditModal(data) {
this.smartTriggerPrototype.showEditModal("编辑阈值原型",data.id,this.tempName); this.smartTriggerPrototype.showEditModal('编辑阈值原型', data.id, this.tempName);
} }
//单个删除 //单个删除
deleteTrigger(item){ deleteTrigger(item) {
this.commonSer.confirmThing("删除","确定删除当前的阈值原型",()=>{ this.commonSer.confirmThing('删除', '确定删除当前的阈值原型', () => {
const data ={ const data = {
ids:[] ids: []
}; };
data.ids.push(item.triggerid); data.ids.push(item.triggerid);
this.overAllSer.deleteTrigger(data).subscribe( this.overAllSer.deleteTrigger(data).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.message.success("删除成功"); this.message.success('删除成功');
this.getList(); this.getList();
}else{ } else {
this.message.error(res.errMsg); this.message.error(res.errMsg);
} }
} }
) );
}) });
} }
//批量删除 //批量删除
deleteBatchTrigger(){ deleteBatchTrigger() {
if(this.selectList.length == 0){ if (this.selectList.length == 0) {
this.message.warning("请选择需要删除的阈值原型"); this.message.warning('请选择需要删除的阈值原型');
return false; return false;
} }
this.commonSer.confirmThing("删除","确定删除选择的阈值原型",()=>{ this.commonSer.confirmThing('删除', '确定删除选择的阈值原型', () => {
const data ={ const data = {
ids:this.selectList.map(e=>{ ids: this.selectList.map(e => {
return e.triggerid; return e.triggerid;
}) })
}; };
this.overAllSer.deleteTrigger(data).subscribe( this.overAllSer.deleteTrigger(data).subscribe(
(res)=>{ (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.message.success("删除成功"); this.message.success('删除成功');
this.getList(); this.getList();
}else{ } else {
this.message.error(res.errMsg); 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