Commit afd8670a authored by wangqinghua's avatar wangqinghua

update

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