Newer
Older
import {Component, OnInit, ViewChild} from '@angular/core';
import {SystemService} from '../system.service';
import {RoleComponent} from '../modal/role/role.component';
import {SelectPersonComponent} from '../../modal/select-person/select-person.component';
import {SeparationComponent} from '../modal/separation/separation.component';
selector: 'jhi-power',
templateUrl: './power.component.html',
styles: []
@ViewChild('smartSelectPerson') smartSelectPerson:SelectPersonComponent;
constructor(private systemSer: SystemService,private message:NzMessageService,
getRole() {
this.systemSer.role().subscribe(
(res) => {
this.dataSet = res.data;
}
);
showEditModal(data){
if(data.isEdit == 0){
this.message.warning("该角色不可编辑");
return false;
}
this.smartRole.showEditModal(data.id);
(res)=>{
if(res.errCode == 10000){
this.message.success("授予成功")
}else{
this.message.error(res.errMsg);
}
}
)
}
deleteRole(item) {
if(item.isEdit == 0){
this.message.warning("该角色不可删除");
return false;
}
this.modalSer.confirm({
nzTitle:'删除',
nzContent:'<b style="color: red">确定删除该角色</b>',
nzOkText:'确定',
nzOkType:'danger',
nzOnOk:()=>{
if(res.errCode == 10000){
this.message.success("删除成功");
this.getRole();
}else{
this.message.error(res.errMsg);
}
//三员分立
showSeparationModal(){
this.smartSeparation.showModal("三员分立");
}