Commit 3d887bdf authored by wangqinghua's avatar wangqinghua

update

parent 78038505
......@@ -22,7 +22,8 @@ export class AuthInterceptor implements HttpInterceptor {
if (!!token) {
request = request.clone({
setHeaders: {
accessToken: token
accessToken: token,
moduleId:this.localStorage.retrieve("moduleId")
}
});
}
......
......@@ -7,7 +7,7 @@
<span title><i class="icon iconfont icon-{{item.imageUrl}}"></i>{{item.name}}</span>
<ul>
<ng-container *ngFor="let child of item.children" >
<li nz-menu-item routerLink="{{child.url}}">{{child.name}}</li>
<li nz-menu-item (click)="goToRoute(child)">{{child.name}}</li>
</ng-container>
</ul>
</li>
......
......@@ -297,4 +297,10 @@ export class SidebarComponent implements OnInit {
goTo(route) {
this.router.navigate([route]);
}
goToRoute(node){
console.log(node);
this.$localStorage.store("moduleId",node.id);
this.router.navigate(["app/main/"+ node.url]);
}
}
......@@ -699,15 +699,15 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
nzOkType: 'danger',
nzOnOk: () => {
const data = {
params:[item.itemid]
itemIds:[item.itemid]
};
this.overAllSer.deleteItem(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.info('删除成功');
this.message.success('删除成功');
this.getCheckList(null);
} else {
this.message.info(res.errMsg);
this.message.error(res.errMsg);
}
}
);
......
......@@ -16,7 +16,6 @@ export class AuthServerProvider {
) {}
getToken() {
return this.$localStorage.retrieve('authenticationToken') || this.$sessionStorage.retrieve('authenticationToken');
}
......
......@@ -39,7 +39,7 @@
<span class="custom-node" draggable="true" aria-grabbed="true" [class.active]="node.isSelected">
<span>
{{node.title}}
<i (click)="editGroup(node)" style="margin-left: 20px;" class="anticon anticon-edit"></i>
<i (click)="editGroup(node)" style="margin:0 10px 0 20px;" class="anticon anticon-form"></i>
<i (click)="deleteGroup(node)" class="anticon anticon-close-circle-o"></i>
</span>
</span>
......
......@@ -61,9 +61,11 @@ export class GroupComponent implements OnInit {
getUser() {
const data = {
'name': '',
'orgId': '',
'pageNumber': '1',
'userBo': {
search:null,
organizationId:null
},
'pageNum': '1',
'pageSize': '10'
};
this.systemSer.user(data).subscribe(
......
......@@ -2,12 +2,23 @@
<div style="position: absolute;left:20%;top: 15px;">
<nz-switch [(ngModel)]="first.check" (ngModelChange)="changeValue('1')"></nz-switch>
</div>
<form nz-form>
<nz-form-item *ngFor="let item of list;let i = index;">
<nz-form-label [nzSm]="8" [nzXs]="24" [ngModelOptions]="{standalone: true}">{{item.comment}}</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-switch [(ngModel)]="item.check" [ngModelOptions]="{standalone: true}" (ngModelChange)="changeValue(i+2)"></nz-switch>
</nz-form-control>
</nz-form-item>
</form>
<!--<div disabled="{{isDisabled}}">-->
<form nz-form>
<nz-form-item >
<nz-form-label [nzSm]="8" [nzXs]="24" [ngModelOptions]="{standalone: true}">{{second?.comment}}</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-switch [(ngModel)]="second.check" [ngModelOptions]="{standalone: true}" (ngModelChange)="changeValue('2')"></nz-switch>
</nz-form-control>
</nz-form-item>
</form>
<form nz-form>
<nz-form-item >
<nz-form-label [nzSm]="8" [nzXs]="24" [ngModelOptions]="{standalone: true}">{{third?.comment}}</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-switch [(ngModel)]="third.check" [ngModelOptions]="{standalone: true}" (ngModelChange)="changeValue('3')"></nz-switch>
</nz-form-control>
</nz-form-item>
</form>
<!--</div>-->
</nz-modal>
......@@ -10,6 +10,7 @@ import {NzMessageService} from 'ng-zorro-antd';
export class SeparationComponent implements OnInit {
isVisible = false;
isDisabled = false;
title;
list = [];
value = 0;
......@@ -18,6 +19,16 @@ export class SeparationComponent implements OnInit {
scValue:null,
check:null
};
second = {
id:"",
scValue:null,
check:null
};
third = {
id:"",
scValue:null,
check:null
};
constructor(private systemSer: SystemService,private message:NzMessageService) {
}
......@@ -30,20 +41,11 @@ export class SeparationComponent implements OnInit {
(res) => {
if (res.errCode == 10000) {
this.first = res.data[0];
if(this.first.scValue == 1){
this.first.check = true;
}else{
this.first.check = false;
}
res.data.splice(0, 1);
this.list = res.data;
this.list.forEach(e=>{
if(e.scValue == 1){
e.check = true;
}else{
e.check = false;
}
})
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;
}
}
);
......@@ -60,44 +62,86 @@ export class SeparationComponent implements OnInit {
}
changeValue(type) {
let arr = {
check:"",
scValue:null,
id:""
};
if (type == "1") {
arr = this.first;
}
if (type == "2") {
arr = this.list[0];
}
if (type == "3") {
arr = this.list[1];
}
if (arr.check) {
arr.scValue = 1;
} else {
arr.scValue = 0;
}
const data = {
id: arr.id,
scValue: arr.scValue,
};
this.systemSer.updateValue(data).subscribe(
(res) => {
if (res.errCode == 10000) {
if (this.first.check) {
this.message.success("已开启三员分立功能");
} else {
this.message.success("已关闭三员分立功能");
}
} else {
this.message.error(res.errMsg);
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();
}
)
}
break;
}
)
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;
}
}
}
//保存
......
......@@ -37,12 +37,12 @@ export class SystemService {
//用户列表
user(data): Observable<any>{
return this.http.post(SERVER_API_URL_coms + '/user/findUsers',data);
return this.http.post(SERVER_API_URL_coms + '/user/getUserList?',data);
}
//新增用户
adduser(data): Observable<any>{
return this.http.post(SERVER_API_URL_coms + '/user',data);
return this.http.post(SERVER_API_URL_coms + '/user/createUser',data);
}
//删除用户
......@@ -152,4 +152,34 @@ export class SystemService {
modifyPassword(data): Observable<any>{
return this.http.post(SERVER_API_URL_coms + '/modifyPassword',data );
}
//三员分立总开
separationConfigOpen(): Observable<any>{
return this.http.get(SERVER_API_URL_coms + '/separationConfig/open' );
}
//三员分立总关
separationConfigClose(): Observable<any>{
return this.http.get(SERVER_API_URL_coms + '/separationConfig/close' );
}
//组织系统用户 -关
closeSystem(): Observable<any>{
return this.http.get(SERVER_API_URL_coms + '/separationConfig/closeSystem' );
}
//组织系统用户 -开
openSystem(): Observable<any>{
return this.http.get(SERVER_API_URL_coms + '/separationConfig/openSystem' );
}
//角色与权限--开
openAuth(): Observable<any>{
return this.http.get(SERVER_API_URL_coms + '/separationConfig/openAuth' );
}
//角色与权限--关
closeAuth(): Observable<any>{
return this.http.get(SERVER_API_URL_coms + '/separationConfig/closeAuth' );
}
}
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