用户管理-用户详情、新增用户
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
import 'ztree';
|
||||
declare var $: any;
|
||||
@@ -13,12 +14,16 @@ declare var jQuery: any;
|
||||
export class UserManagementComponent implements OnInit {
|
||||
treeSelected:any; //树模型-当前选中项
|
||||
collectionSize:any ;
|
||||
public tableData:any=[];
|
||||
statusParamsTable:any={ //获取目录树接口的状态,0请求失败 1请求前 2请求中 3请求成功,有数据 4请求成功,无数据
|
||||
status:1,
|
||||
}
|
||||
statusParamsTree:any={ //获取机构接口的状态,0请求失败 1请求前 2请求中 3请求成功,有数据 4请求成功,无数据
|
||||
status:1,
|
||||
}
|
||||
statusParamsDetail:any={ //获取用户详情接口的状态,0请求失败 1请求前 2请求中 3请求成功,有数据 4请求成功,无数据
|
||||
status:1,
|
||||
}
|
||||
public search:any={
|
||||
page_index:'1',
|
||||
page_size:'10',
|
||||
@@ -26,30 +31,80 @@ export class UserManagementComponent implements OnInit {
|
||||
login_name:'',
|
||||
orgId:'',
|
||||
}
|
||||
isLoading:false;
|
||||
public tableData:any=[];
|
||||
visible = false;
|
||||
userDetail:any={}; //用户详情
|
||||
|
||||
|
||||
constructor(
|
||||
private http:HttpClientService,
|
||||
private router:Router,
|
||||
) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.initTree();
|
||||
this.queryTable();
|
||||
}
|
||||
//新增、修改 1新增 2修改
|
||||
addModify(type,item?){
|
||||
if(type==1){
|
||||
console.log(222)
|
||||
this.router.navigate(['app/system/users/modify'],{queryParams:{operateType:1}})
|
||||
}else if(type==2){
|
||||
|
||||
}
|
||||
}
|
||||
//打开详情页面
|
||||
open(item): void {
|
||||
this.statusParamsDetail.status=1;
|
||||
this.visible = true;
|
||||
this.userDetail={};
|
||||
this.http.get('/sysapi/setting/user/detail/list', { uid: item.uid }).subscribe((json)=>{
|
||||
if(json.is_success){
|
||||
if(json.body){
|
||||
this.statusParamsDetail.status=3;
|
||||
this.userDetail=json.body;
|
||||
}else{
|
||||
this.statusParamsDetail.status=4;
|
||||
}
|
||||
}else{
|
||||
this.statusParamsDetail.status=0;
|
||||
}
|
||||
})
|
||||
}
|
||||
//关闭详情页面
|
||||
close(): void {
|
||||
this.visible = false;
|
||||
}
|
||||
//重置,重置搜索条件
|
||||
reset(){
|
||||
this.search.page_index=1;
|
||||
this.search.page_size=10;
|
||||
this.search.real_name='';
|
||||
this.search.login_name='';
|
||||
this.queryTable();
|
||||
}
|
||||
//获取列表
|
||||
queryTable():void{
|
||||
this.statusParamsTable.status=1;
|
||||
this.http.get('/sysapi/setting/user/list',this.search).subscribe((json)=>{
|
||||
if(json.is_success){
|
||||
this.tableData=json.body.list;
|
||||
this.statusParamsTable.status=3;
|
||||
this.collectionSize=json.body.total;
|
||||
if(json.body.list&&json.body.list.length>0){
|
||||
this.statusParamsTable.status=3;
|
||||
}else{
|
||||
this.statusParamsTable.status=4;
|
||||
}
|
||||
}else{
|
||||
this.statusParamsTable.status=0;
|
||||
}
|
||||
})
|
||||
}
|
||||
//翻页
|
||||
pageChange(event){
|
||||
this.search.page_index=event;
|
||||
this.queryTable();
|
||||
}
|
||||
//树模型参数设置
|
||||
public zNodes: any[];
|
||||
setting = {
|
||||
@@ -78,7 +133,7 @@ export class UserManagementComponent implements OnInit {
|
||||
},
|
||||
},
|
||||
};
|
||||
//新树模型
|
||||
//获取机构列表,树模型数据处理
|
||||
initTree(){
|
||||
//获取目录列表
|
||||
this.statusParamsTree.status=1;
|
||||
|
||||
Reference in New Issue
Block a user