Commit 8ed14360 authored by wangqinghua's avatar wangqinghua

update

parent 327d3283
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</nz-select> </nz-select>
</div> </div>
<div nz-col nzSpan="3"> <div nz-col nzSpan="3">
<nz-select style="width: 100%;" nzShowSearch nzAllowClear nzPlaceHolder="选择告资源" [(ngModel)]="obj.hostid" (ngModelChange)="getListIO($event)"> <nz-select style="width: 100%;" nzShowSearch nzAllowClear nzPlaceHolder="选择告资源" [(ngModel)]="obj.hostid" (ngModelChange)="getListIO()">
<ng-container *ngFor="let item of hostList;"> <ng-container *ngFor="let item of hostList;">
<nz-option nzLabel="{{item.name}}" nzValue="{{item.hostid}}"></nz-option> <nz-option nzLabel="{{item.name}}" nzValue="{{item.hostid}}"></nz-option>
</ng-container> </ng-container>
...@@ -57,9 +57,10 @@ ...@@ -57,9 +57,10 @@
></nz-date-picker> ></nz-date-picker>
</div> </div>
</div> </div>
<div echarts [options]="chartOption" style="height: 420px;width: 100%"></div>
<nz-tabset [nzTabPosition]="'top'" [nzType]="'card'"> <nz-tabset [nzTabPosition]="'top'" [nzType]="'card'">
<nz-tab nzTitle="接收流量排行"> <nz-tab nzTitle="接收流量排行">
<nz-table #nzTable [nzData]="inList" [nzLoading]="" [nzFrontPagination]="false" [nzTotal]="inTotalNum" [nzPageIndex]="inPageNum" [nzPageSize]="inPageCount" (nzPageIndexChange)="getInList()"> <nz-table #nzTable [nzData]="inList" [nzLoading]="inLoading" [nzFrontPagination]="false" [nzTotal]="inTotalNum" [nzPageIndex]="inPageNum" [nzPageSize]="inPageCount" (nzPageIndexChange)="inChnagePage($event)">
<thead> <thead>
<tr> <tr>
<th nzWidth="20%">监测点名称</th> <th nzWidth="20%">监测点名称</th>
...@@ -69,17 +70,20 @@ ...@@ -69,17 +70,20 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let data of inList"> <ng-container *ngFor="let item of inList">
<td>{{data.itemName}}</td> <tr (click)="getEcharts(item)">
<td>{{data.max}}</td> <td>{{item.itemName}}</td>
<td>{{data.min}}</td> <td>{{item.max}}</td>
<td>{{data.avg}}</td> <td>{{item.min}}</td>
<td>{{item.avg}}</td>
</tr> </tr>
</ng-container>
</tbody> </tbody>
</nz-table> </nz-table>
</nz-tab> </nz-tab>
<nz-tab nzTitle="发送流量排行"> <nz-tab nzTitle="发送流量排行">
<nz-table #nzTable [nzData]="outList" [nzFrontPagination]="false" [nzTotal]="outTotalNum" [nzPageIndex]="outPageNum" [nzPageSize]="outPageCount" (nzPageIndexChange)="getOutList()"> <nz-table #nzTable [nzData]="outList" [nzLoading]="outLoading" [nzFrontPagination]="false" [nzTotal]="outTotalNum" [nzPageIndex]="outPageNum" [nzPageSize]="outPageCount" (nzPageIndexChange)="outChnagePage($event)">
<thead> <thead>
<tr> <tr>
<th nzWidth="20%">监测点名称</th> <th nzWidth="20%">监测点名称</th>
......
...@@ -25,14 +25,14 @@ export class FlowTrendComponent implements OnInit { ...@@ -25,14 +25,14 @@ export class FlowTrendComponent implements OnInit {
//in //in
inList = []; inList = [];
inPageNum = 1; inPageNum = 1;
inPageCount = pageSize; inPageCount = '5';
inTotalNum; inTotalNum;
inLoading; inLoading;
//out //out
outList = []; outList = [];
outPageNum = 1; outPageNum = 1;
outPageCount = pageSize; outPageCount = '5';
outTotalNum; outTotalNum;
outLoading; outLoading;
...@@ -40,6 +40,9 @@ export class FlowTrendComponent implements OnInit { ...@@ -40,6 +40,9 @@ export class FlowTrendComponent implements OnInit {
timeBegin; timeBegin;
timeEnd; timeEnd;
//图表
chartOption;
constructor(private topologySer: TopologyService, private overAllSer: OverAllService, constructor(private topologySer: TopologyService, private overAllSer: OverAllService,
private message: NzMessageService,private datePipe:DatePipe) { private message: NzMessageService,private datePipe:DatePipe) {
} }
...@@ -79,19 +82,106 @@ export class FlowTrendComponent implements OnInit { ...@@ -79,19 +82,106 @@ export class FlowTrendComponent implements OnInit {
); );
} }
getEcharts() { //获取图标数据
const data = { getEcharts(item) {
itemid: '', const data= {
itemid: item.itemid,
endTime: this.obj.endTime, endTime: this.obj.endTime,
startTime: this.obj.startTime startTime: this.obj.startTime
}; };
this.topologySer.findTrendData(data).subscribe( this.topologySer.findTrendData(data).subscribe(
(res) => { (res) => {
if(res.errCode == 10000){
this.setEacharts();
}else{
this.message.warning(res.errMsg);
}
} }
); );
} }
//
setEacharts(){
let xAxisData = [];
let data1 = [];
let data2 = [];
let data3 = [];
let data4 = [];
for (let i = 0; i < 10; i++) {
xAxisData.push('Class' + i);
data1.push((Math.random() * 2).toFixed(2));
data2.push(-Math.random().toFixed(2));
data3.push((Math.random() * 5).toFixed(2));
data4.push((Math.random() + 0.3).toFixed(2));
}
let itemStyle = {
normal: {
},
emphasis: {
barBorderWidth: 1,
shadowBlur: 10,
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowColor: 'rgba(0,0,0,0.5)'
}
};
this.chartOption = {
backgroundColor: '#eee',
tooltip: {},
xAxis: {
data: xAxisData,
name: 'X Axis',
silent: false,
axisLine: {onZero: true},
splitLine: {show: false},
splitArea: {show: false}
},
yAxis: {
inverse: true,
splitArea: {show: false}
},
grid: {
left: 100
},
series: [
{
name: 'bar',
type: 'bar',
stack: 'one',
itemStyle: itemStyle,
data: data1
},
{
name: 'bar2',
type: 'bar',
stack: 'one',
itemStyle: itemStyle,
data: data2
},
{
name: 'bar3',
type: 'bar',
stack: 'two',
itemStyle: itemStyle,
data: data3
},
{
name: 'bar4',
type: 'bar',
stack: 'two',
itemStyle: itemStyle,
data: data4
}
]
};
console.log(this.chartOption);
}
//获取流量 //获取流量
getList(e) { getList(e) {
this.obj.hostid = null; this.obj.hostid = null;
...@@ -105,22 +195,37 @@ export class FlowTrendComponent implements OnInit { ...@@ -105,22 +195,37 @@ export class FlowTrendComponent implements OnInit {
this.getOutList(); this.getOutList();
} }
//in改变页数
inChnagePage(e){
this.inPageNum = e;
this.getInList();
}
//out改变页数
outChnagePage(e){
this.outPageNum = e;
this.getOutList();
}
//进口流量 //进口流量
getInList() { getInList() {
this.inLoading = true; this.inLoading = true;
const data = { const data = {
obj:{
type: 'in', type: 'in',
pageNum: this.inPageNum,
pageCount: this.inPageCount,
hostid: this.obj.hostid, hostid: this.obj.hostid,
startTime: this.obj.startTime, startTime: this.obj.startTime,
endTime: this.obj.endTime, endTime: this.obj.endTime,
groupid:this.obj.groupid groupid:this.obj.groupid
},
pageNum: this.inPageNum,
pageCount: this.inPageCount,
}; };
this.topologySer.findTrend(data).subscribe( this.topologySer.findTrend(data).subscribe(
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
this.inList = res.data; this.inList = res.data.data;
this.inTotalNum = res.data.totalNum;
} else { } else {
this.message.warning(res.errMsg); this.message.warning(res.errMsg);
} }
...@@ -133,18 +238,22 @@ export class FlowTrendComponent implements OnInit { ...@@ -133,18 +238,22 @@ export class FlowTrendComponent implements OnInit {
getOutList() { getOutList() {
this.outLoading = true; this.outLoading = true;
const data = { const data = {
type: 'out', obj: {
pageNum: this.outPageNum, type:'out',
pageCount: this.outPageCount,
hostid: this.obj.hostid, hostid: this.obj.hostid,
startTime: this.obj.startTime, startTime: this.obj.startTime,
endTime: this.obj.endTime, endTime: this.obj.endTime,
groupid:this.obj.groupid groupid:this.obj.groupid
},
pageNum: this.outPageNum,
pageCount: this.outPageCount,
}; };
this.topologySer.findTrend(data).subscribe( this.topologySer.findTrend(data).subscribe(
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
this.outList = res.data; this.outList = res.data.data;
this.outTotalNum = res.data.totalNum;
} else { } else {
this.message.warning(res.errMsg); this.message.warning(res.errMsg);
} }
......
...@@ -49,8 +49,6 @@ ...@@ -49,8 +49,6 @@
全屏查看</span> 全屏查看</span>
<span aria-hidden="true" title="居中显示" <span aria-hidden="true" title="居中显示"
onClick="editor.utils.showInCenter()">居中显示</span> onClick="editor.utils.showInCenter()">居中显示</span>
<span aria-hidden="true" title="预览"
onClick="editor.utils.showPic()">预览</span>
<span aria-hidden="true" title="保存" (click)="update()">保存</span> <span aria-hidden="true" title="保存" (click)="update()">保存</span>
<span aria-hidden="true" title="清空" <span aria-hidden="true" title="清空"
onClick="editor.utils.clearTopology()">清空</span> onClick="editor.utils.clearTopology()">清空</span>
...@@ -64,231 +62,6 @@ ...@@ -64,231 +62,6 @@
<div class="layui-row"> <div class="layui-row">
<div class="layui-col-md12"> <div class="layui-col-md12">
<div id="topology-body" class="topology-context"> <div id="topology-body" class="topology-context">
<!-- 节点右键菜单 -->
<div id="node-menu" class="right-click-menu" style="z-index: 9">
<div class="fa fa-wrench menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>节点设置</span>
</div>
<div class="fa fa-th-large menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>应用布局</span>
</div>
<div class="fa fa-th-list menu-item" id="change-node-text-pos"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>文字位置</span>
</div>
<div class="fa fa-search-plus menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>放大(Shift+)</span>
</div>
<div class="fa fa-search-minus menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>缩小(Shift-)</span>
</div>
<div class="fa fa-rotate-right menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>顺时针旋转(Shift+U)</span>
</div>
<div class="fa fa-rotate-left menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>逆时针旋转(Shift+I)</span>
</div>
<div class="fa fa-times menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>删除节点(Delete)</span>
</div>
<div class="fa fa-files-o menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>复制节点(Shift+C)</span>
</div>
<div class="fa fa-mail-reply menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>撤销(Shift+Z)</span></div>
<div class="fa fa-mail-forward menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>重做(Shift+R)</span></div>
</div>
<!-- 应用布局选项(二级菜单) -->
<div id="layout-menu" class="right-click-menu" style="z-index: 9">
<div class="fa fa-minus-circle menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>取消布局</span>
</div>
<div class="fa fa-object-group menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>分组布局</span>
</div>
<div class="fa fa-share-alt menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>树形布局</span>
</div>
<div class="fa fa-dot-circle-o menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>圆形布局</span>
</div>
</div>
<!-- 文字位置选项(二级菜单) -->
<div id="node-text-pos-menu" class="right-click-menu" style="z-index: 9">
<div class="menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>顶部居左</span>
</div>
<div class="menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>顶部居中</span>
</div>
<div class="menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>顶部居右</span>
</div>
<div class="menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>中间居左</span>
</div>
<div class="menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>居中</span>
</div>
<div class="menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>中间居右</span></div>
<div class="menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>底部居左</span>
</div>
<div class="menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>底部居中</span>
</div>
<div class="menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>底部居右</span>
</div>
</div>
<!-- 连线右键菜单 -->
<div id="line-menu" class="right-click-menu" style="z-index: 9">
<div class="modeRightEdit" onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span class="menuSpan">添加描述</span>
</div>
<div class="fa fa-wrench menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>连线设置</span>
</div>
<div class="fa fa-times menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>删除连线</span></div>
</div>
<!-- 舞台右键菜单 -->
<div id="main-menu" class="right-click-menu" style="z-index: 9">
<div class="fa fa-search-plus menu-item"
onClick="editor.utils.scalingBig()"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>放大(Shift+)</span>
</div>
<div class="fa fa-search-minus menu-item" onClick="editor.utils.scalingSmall()"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>缩小(Shift-)</span>
</div>
<div class="fa fa-trash-o menu-item" onClick="editor.utils.clear();"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>清空(Shift+Y)</span>
</div>
<div class="fa fa-eye menu-item" onClick="editor.utils.showPic();"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>预览(Shift+P)</span>
</div>
<div class="fa fa-arrows menu-item"
onClick="editor.utils.showInFullScreen(editor.stage.canvas,'RequestFullScreen')"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>全屏查看(Shift+F)</span>
</div>
<div class="fa fa-align-center menu-item" onClick="editor.utils.showInCenter()"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>居中显示(Shift+G)</span>
</div>
<div class="fa fa-floppy-o menu-item" onClick="editor.saveToplogy(true)"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>保存(Shift+S)</span>
</div>
<div class="fa fa-question-circle menu-item" onclick="alert('帮助文档')"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span id="showHelp">查看帮助(Shift+H)</span>
</div>
<div class="fa fa-info-circle menu-item"
onclick="window.open('json_view.html', '当前拓扑结构JSON展示', '').document.write(editor.stage.toJson())"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span id="showJSON">查看拓扑JSON结构</span></div>
</div>
<!-- 分组选项(二级菜单) -->
<div id="group-mange-menu" class="right-click-menu" style="z-index: 9">
<div class="fa fa-pencil-square-o menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>新建分组</span>
</div>
<div class="fa fa-align-left menu-item" id="align-group"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>对齐方式</span>
</div>
</div>
<div class="right-click-menu" id="group-align-menu" style="z-index: 9">
<div class="menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>水平对齐</span>
</div>
<div class="menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>垂直对齐</span>
</div>
</div>
<div class="right-click-menu" id="container-mange-menu" style="z-index: 9">
<div class="fa fa-columns menu-item"
onMouseMove="this.style.backgroundColor='#c5e7f6'"
onMouseOut="this.style.backgroundColor=''">
<span>拆分</span>
</div>
</div>
<!-- 鼠标悬浮显示节点信息 --> <!-- 鼠标悬浮显示节点信息 -->
<div class="node-infobox" style="display: none;"> <div class="node-infobox" style="display: none;">
<span>节点名称:<label name="node_name"></label></span> <span>节点名称:<label name="node_name"></label></span>
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
<button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button> <button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button>
</div> </div>
</div> </div>
<div nz-row class="search-form"> <div nz-row class="search-form">
<div nz-col nzSpan="12"> <div nz-col nzSpan="12">
<nz-select style="width: 200px;" nzShowSearch nzAllowClear nzPlaceHolder="选择类型" (ngModelChange)="getList()"> <nz-select style="width: 200px;" nzShowSearch nzAllowClear nzPlaceHolder="选择类型" (ngModelChange)="getList()">
......
...@@ -121,7 +121,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -121,7 +121,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
this.inOutInfo(); this.inOutInfo();
//监测点 //监测点
this.getList() this.getList();
//历史告警 //历史告警
const obj = {}; const obj = {};
...@@ -129,9 +129,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -129,9 +129,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
} }
ngAfterViewInit() { ngAfterViewInit() {
console.log(this.colorEle.nativeElement.offsetWidth);
this.checkEle.nativeElement.children[1].children[0].children[0].children[2].children[0].children[0].children[2].style.marginRight = this.colorEle.nativeElement.offsetWidth +'px'; this.checkEle.nativeElement.children[1].children[0].children[0].children[2].children[0].children[0].children[2].style.marginRight = this.colorEle.nativeElement.offsetWidth +'px';
console.log(this.checkEle.nativeElement.children[1].children[0].children[0].children[2].children[0].children[0].children[2].style.marginRight);
} }
//平均响应时间 //平均响应时间
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="comments">角色说明</nz-form-label> <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="comments">角色说明</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24"> <nz-form-control [nzSm]="14" [nzXs]="24">
<textarea id="comments" row="4" nz-input formControlName="comments"></textarea> <textarea id="comments" row="4" nz-input formControlName="comments"></textarea>
<nz-form-explain *ngIf="validateForm.get('comments').dirty && validateForm.get('comments').errors">Please select your gender!</nz-form-explain> <nz-form-explain *ngIf="validateForm.get('comments').dirty && validateForm.get('comments').errors">请输入角色说明!</nz-form-explain>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<!--<nz-form-item>--> <!--<nz-form-item>-->
......
...@@ -41,12 +41,24 @@ export class RoleComponent implements OnInit { ...@@ -41,12 +41,24 @@ export class RoleComponent implements OnInit {
this.isVisible = false; this.isVisible = false;
} }
handleOk(): void { handleOk() {
for (let i in this.validateForm.controls) { for (let i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty(); this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity(); this.validateForm.controls[i].updateValueAndValidity();
} }
this.systemSer.addRole(this.validateForm.value).subscribe( if (this.validateForm.invalid) {
return false;
}
const data = {
role:{
name:this.validateForm.value.name,
status:this.validateForm.value.status,
comments:this.validateForm.value.comments,
},
resources:[],
menus:[]
};
this.systemSer.addRole(data).subscribe(
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
this.isVisible = false; this.isVisible = false;
......
import {Component, OnInit, ViewChild} from '@angular/core'; import {Component, OnInit, ViewChild} from '@angular/core';
import {SystemService} from '../system.service'; import {SystemService} from '../system.service';
import {RoleComponent} from '../modal/role/role.component'; import {RoleComponent} from '../modal/role/role.component';
import {NzModalService} from 'ng-zorro-antd'; import {NzMessageService, NzModalService} from 'ng-zorro-antd';
@Component({ @Component({
selector: 'jhi-power', selector: 'jhi-power',
...@@ -13,7 +13,7 @@ export class PowerComponent implements OnInit { ...@@ -13,7 +13,7 @@ export class PowerComponent implements OnInit {
dataSet: any[]; dataSet: any[];
isVisible = false; isVisible = false;
constructor(private systemSer: SystemService, constructor(private systemSer: SystemService,private message:NzMessageService,
private modalSer:NzModalService) { private modalSer:NzModalService) {
} }
...@@ -44,6 +44,12 @@ export class PowerComponent implements OnInit { ...@@ -44,6 +44,12 @@ export class PowerComponent implements OnInit {
nzOnOk:()=>{ nzOnOk:()=>{
this.systemSer.deleteRole(data.id).subscribe( this.systemSer.deleteRole(data.id).subscribe(
(res) => { (res) => {
if(res.errCode == 10000){
this.message.success("删除成功");
this.getRole();
}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