From 4d63578b73f083f50acd8ff176aa13bcb9babbdf Mon Sep 17 00:00:00 2001 From: zhouyuejun <505127606@qq.com> Date: Wed, 17 Apr 2019 10:32:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=94=A8=E6=88=B7=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BF=9D=E5=AD=98=E6=89=80=E5=B1=9E=E6=9C=BA=E6=9E=84?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E4=B8=A2=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user-management-modify.component.ts | 71 +++++++++---------- .../user-management.component.html | 4 +- .../user-management.component.ts | 6 +- 3 files changed, 42 insertions(+), 39 deletions(-) diff --git a/src/app/pages/system-management/user-management/user-management-modify/user-management-modify.component.ts b/src/app/pages/system-management/user-management/user-management-modify/user-management-modify.component.ts index 9f2484e..f484657 100644 --- a/src/app/pages/system-management/user-management/user-management-modify/user-management-modify.component.ts +++ b/src/app/pages/system-management/user-management/user-management-modify/user-management-modify.component.ts @@ -76,6 +76,36 @@ export class UserManagementModifyComponent implements OnInit { this.statusParamsDetail.status = 3; } }) + this.statusParamsTree.status = 1; + this.http.get("/sysapi/setting/organization/list").subscribe(json => { + if (json.is_success) { + if (json.body.length > 0) { + this.statusParamsTree.status = 3; + for (var i = 0; i < json.body.length; i++) { + let option = json.body[i]; + option.name = option.organization; + if (option.pid) { + option.pId = option.pid; + } else { + option.pId = 'hsfuhiw34239j89sauf98992h3indshv98h392hf9mplsd032fs2a2313fc'; + } + } + json.body.push({ + name: "全部机构", + isParent: true, + open: true, + id: 'hsfuhiw34239j89sauf98992h3indshv98h392hf9mplsd032fs2a2313fc', + }) + this.orgList = json.body; + } else { + //数据为空 + this.statusParamsTree.status = 4; + } + } else { + //请求失败 + this.statusParamsTree.status = 0; + } + }) } //获取用户详情 queryUserDetail() { @@ -172,7 +202,7 @@ export class UserManagementModifyComponent implements OnInit { //打开机构树抽屉 open(): void { this.treeSelected = ''; - this.statusParamsTree.status = 1; + // this.statusParamsTree.status = 1; this.visible = true; this.initTree(); @@ -308,41 +338,10 @@ export class UserManagementModifyComponent implements OnInit { //获取机构列表,树模型数据处理 initTree() { //获取目录列表 - this.statusParamsTree.status = 1; - this.http.get("/sysapi/setting/organization/list").subscribe(json => { - if (json.is_success) { - if (json.body.length > 0) { - this.orgList = json.body; - this.statusParamsTree.status = 3; - let children = []; - for (var i = 0; i < json.body.length; i++) { - let option = json.body[i]; - option.name = option.organization; - if (option.pid) { - option.pId = option.pid; - } else { - option.pId = 'hsfuhiw34239j89sauf98992h3indshv98h392hf9mplsd032fs2a2313fc'; - } - } - json.body.push({ - name: "全部机构", - isParent: true, - open: true, - id: 'hsfuhiw34239j89sauf98992h3indshv98h392hf9mplsd032fs2a2313fc', - }) - } else { - //数据为空 - this.statusParamsTree.status = 4; - } - } else { - //请求失败 - this.statusParamsTree.status = 0; - } - this.zNodes = json.body; - $.fn.zTree.init($("#treeDemo"), this.setting, this.zNodes); - var zTree = $.fn.zTree.getZTreeObj("treeDemo"); - let node = zTree.getNodes(); - }) + this.zNodes = this.orgList; + $.fn.zTree.init($("#treeDemo"), this.setting, this.zNodes); + var zTree = $.fn.zTree.getZTreeObj("treeDemo"); + let node = zTree.getNodes(); } diff --git a/src/app/pages/system-management/user-management/user-management.component.html b/src/app/pages/system-management/user-management/user-management.component.html index 3161ee9..6323397 100644 --- a/src/app/pages/system-management/user-management/user-management.component.html +++ b/src/app/pages/system-management/user-management/user-management.component.html @@ -53,8 +53,8 @@ - - + diff --git a/src/app/pages/system-management/user-management/user-management.component.ts b/src/app/pages/system-management/user-management/user-management.component.ts index 6b194a7..1fede95 100644 --- a/src/app/pages/system-management/user-management/user-management.component.ts +++ b/src/app/pages/system-management/user-management/user-management.component.ts @@ -33,7 +33,9 @@ export class UserManagementComponent implements OnInit { orgId:'', } visible = false; - userDetail:any={}; //用户详情 + userDetail:any={}; //用户详情 + + currentUserInfo = JSON.parse(sessionStorage.getItem('userInfo')); constructor( @@ -43,6 +45,8 @@ export class UserManagementComponent implements OnInit { ) { } ngOnInit() { + // this.currentUserInfo = JSON.parse(sessionStorage.getItem('userInfo')); + // console.log(sessionStorage.getItem('userInfo')); // 页面监听 动态改变表单高度 $('#tree-box').css('height',(document.documentElement.clientHeight-106+'px')); $('#main-box-user').css('height',(document.documentElement.clientHeight-106+'px'));