Newer
Older
import {Component, OnInit} from '@angular/core';
import {SystemService} from '../../system.service';
import {NzMessageService} from 'ng-zorro-antd';
@Component({
selector: 'smart-separation',
templateUrl: './separation.component.html',
styles: []
})
export class SeparationComponent implements OnInit {
isVisible = false;
constructor(private systemSer: SystemService,private message:NzMessageService,
) {
(res) => {
if (res.errCode == 10000) {
this.first = res.data[0];
this.second = res.data[1];
this.third = res.data[2];
this.first.check = this.first.scValue == 1 ? true : false;
this.second.check = this.second.scValue == 1 ? true : false;
this.third.check = this.third.scValue == 1 ? true : false;
}
}
);
}
showModal(title) {
this.title = title;
this.isVisible = true;
this.separationPowerStatus();
}
handleCancel() {
this.isVisible = false;
}
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
switch (type) {
case "1":{
if(this.first.check){
this.systemSer.separationConfigOpen().subscribe(
(res) => {
if (res.data == 1) {
this.message.success("已开启三员分立功能");
} else {
this.message.error(res.errMsg);
}
this.separationPowerStatus();
}
)
}else{
this.systemSer.separationConfigClose().subscribe(
(res) => {
if (res.data == 1) {
this.message.success("已关闭三员分立功能");
} else {
this.message.error(res.errMsg);
}
this.separationPowerStatus();
}
)
}
break;
}
case "3":{
if(this.third.check){
this.systemSer.openSystem().subscribe(
(res) => {
if (res.data == 1) {
this.message.success("已开启组织用户管理");
} else {
this.message.error(res.errMsg);
}
this.separationPowerStatus();
}
)
}else{
this.systemSer.closeSystem().subscribe(
(res) => {
if (res.data == 1) {
this.message.success("已关闭组织用户管理");
} else {
this.message.error(res.errMsg);
}
this.separationPowerStatus();
}
)
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
case "2":{
if(this.second.check){
this.systemSer.openAuth().subscribe(
(res) => {
if (res.data == 1) {
this.message.success("已开启角色与权限");
} else {
this.message.error(res.errMsg);
}
this.separationPowerStatus();
}
)
}else{
this.systemSer.closeAuth().subscribe(
(res) => {
if (res.data == 1) {
this.message.success("已关闭角色与权限");
} else {
this.message.error(res.errMsg);
}
this.separationPowerStatus();
}
)
}
break;
}
}
//保存
handleOk() {
let arr = [];
arr.push(this.first);
arr = arr.concat(this.list);
let arr1 = arr.map(res=>{
const data = {
id:res.id,
(res)=>{
if(res.errCode == 10000){
if(this.first.check){
this.message.success("已开启三员分立功能");
}else{
this.message.success("已关闭三员分立功能");
}
this.isVisible = false;
}else{
this.message.error(res.errMsg);
}
}
)
}
}