Commit afd8670a authored by wangqinghua's avatar wangqinghua

update

parent b0aa0511
......@@ -164,13 +164,13 @@ export class GroupComponent implements OnInit {
nzOkText: '确定',
nzCancelText: '取消',
nzOnOk: () => {
const data = {
id: item.id
};
this.systemSer.deleteUser(data).subscribe(
this.systemSer.deleteUser(item.id).subscribe(
(res) => {
if (res.data == 1) {
this.getUser();
this.message.success("删除用户成功");
}else{
this.message.error(res.errMsg);
}
}
);
......@@ -216,7 +216,7 @@ export class GroupComponent implements OnInit {
//编辑部门
showEditGroupModal(item) {
this.smartGroupModal.showEditModal(this.groupList,"编辑部门",item.key);
this.smartGroupModal.showEditModal(this.groupList,"编辑部门",item);
}
//删除部门
......
......@@ -8,13 +8,12 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>上级部门</nz-form-label>
<nz-form-label [nzSm]="6" [nzXs]="24">上级部门</nz-form-label>
<nz-form-control [nzSm]="14" [nzXs]="24">
<nz-select id="parentId" formControlName="parentId" nzPlaceHolder="上级部门">
<nz-option nzValue="无" nzLabel=""></nz-option>
<nz-option *ngFor="let item of groupList" nzValue="{{item.id}}" nzLabel="{{item.name}}"></nz-option>
</nz-select>
<nz-form-explain *ngIf="validateForm.get('parentId').dirty && validateForm.get('parentId').errors">请选择上级部门!</nz-form-explain>
</nz-form-control>
</nz-form-item>
</form>
......
......@@ -38,14 +38,17 @@ export class GroupModalComponent implements OnInit {
this.title = title;
}
showEditModal(list,title,id){
this.orgId = id;
showEditModal(list,title,item){
this.orgId = item.key;
this.groupList = list;
this.isVisible = true;
this.title = title;
this.validateForm.patchValue(item.origin);
this.validateForm.value.parentId = item.key;
}
handleCancel(){
this.initForm();
this.isVisible = false;
}
......
......@@ -35,7 +35,6 @@ export class RoleComponent implements OnInit {
roleId;
groupList = [];
moduleList = []; //菜单权限
resourceList = []; //主机分组权限
constructor(private fb: FormBuilder, private message: NzMessageService, private overAllSer: OverAllService,
private systemSer: SystemService, private layoutSer: LayoutService, private commonSer: CommonService) {
......@@ -119,6 +118,9 @@ export class RoleComponent implements OnInit {
handleCancel(): void {
this.isVisible = false;
this.ininForm();
this.groupList = [];
this.moduleList = [];
}
handleOk() {
......@@ -132,11 +134,15 @@ export class RoleComponent implements OnInit {
}
let resourceArr = [];
this.resourceList.forEach(e=>{
this.groupList.forEach(e=>{
if(e.checked){
resourceArr.push(e.id);
const data = {
groupId:e.groupid,
groupName:e.name
};
resourceArr.push(data);
}
})
});
if (this.title == '新增角色') {
this.create(resourceArr);
......@@ -164,6 +170,9 @@ export class RoleComponent implements OnInit {
this.add.emit();
this.ininForm();
this.message.success('新增成功');
this.groupList = [];
this.moduleList = [];
} else {
this.message.error(res.errMsg);
}
......@@ -190,6 +199,8 @@ export class RoleComponent implements OnInit {
this.add.emit();
this.ininForm();
this.message.success('修改成功');
this.groupList = [];
this.moduleList = [];
} else {
this.message.error(res.errMsg);
}
......
......@@ -35,7 +35,7 @@ export class SystemService {
return this.http.post(SERVER_API_URL_COMS + '/role/createRole',data);
}
//删除用户
//删除角色
deleteRole(params): Observable<any>{
return this.http.get(SERVER_API_URL_COMS + '/role/deleteRoleById?' +this.commonSer.toQuery(params));
}
......@@ -66,8 +66,8 @@ export class SystemService {
}
//删除用户
deleteUser(data): Observable<any>{
return this.http.get(SERVER_API_URL_COMS + '/user/deleteUser?' + this.commonSer.toQuery(data) );
deleteUser(params): Observable<any>{
return this.http.get(SERVER_API_URL_COMS + '/user/deleteUser/' +params);
}
//删除用户
......@@ -82,7 +82,7 @@ export class SystemService {
//删除单个组织机构
deleteOrg(params): Observable<any>{
return this.http.delete(SERVER_API_URL_COMS + '/organization/' + params);
return this.http.get(SERVER_API_URL_COMS + '/organization/deleteOrganizationById/'+params );
}
//编辑组织
......@@ -140,11 +140,6 @@ export class SystemService {
return this.http.get(SERVER_API_URL_COMS + '/role/checkRole');
}
//单个用户角色获取
roleList(data): Observable<any>{
return this.http.get(SERVER_API_URL_COMS + '/user/roleList?'+this.commonSer.toQuery(data) );
}
//获取当前已审批记录
getApproveOfDone(data): Observable<any>{
return this.http.post(SERVER_API_URL_COMS + '/approve/getApproveOfDone',data );
......
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