mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 19:36:43 +08:00
受从的查询,机构修改为接口调用,不再是本地调用了
This commit is contained in:
@@ -121,6 +121,7 @@
|
||||
import usergroupApi from "@/api/modules/usergroup";
|
||||
import userApi from "@/api/system/user";
|
||||
import orgApi from "@/api/system/organiza";
|
||||
import apiUserBasic from "@/api/boe/userbasic";
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
@@ -181,22 +182,45 @@
|
||||
if (node.level === 0) {
|
||||
resolve([{name:'组织机构树',id:'-1'}]);
|
||||
}else{
|
||||
let $this=this;
|
||||
if(node.level === 1){
|
||||
parentId = '-1';
|
||||
apiUserBasic.findOrgsByKeyword('').then(rs=>{
|
||||
let treeList=[];
|
||||
rs.result.forEach(item=>{
|
||||
let node={
|
||||
id:item.id,
|
||||
name:item.name,
|
||||
hrbpId:item.hrbpId,
|
||||
children:[]
|
||||
}
|
||||
treeList.push(node);
|
||||
});
|
||||
resolve(treeList);
|
||||
});
|
||||
}else{
|
||||
parentId = node.data.id;
|
||||
|
||||
apiUserBasic.getOrgInfo(parentId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
let treeList=[];
|
||||
if(rs.result.directChildList){
|
||||
rs.result.directChildList.forEach(item=>{
|
||||
let node={
|
||||
id:item.id,
|
||||
name:item.name,
|
||||
hrbpId:item.hrbpId,
|
||||
children:[]
|
||||
}
|
||||
treeList.push(node);
|
||||
});
|
||||
}
|
||||
resolve(treeList);
|
||||
}else{
|
||||
resolve([]);
|
||||
}
|
||||
});
|
||||
}
|
||||
usergroupApi.userOrgs(parentId).then(res =>{
|
||||
if (res.status == 200) {
|
||||
if(res.result != null && res.result.length > 0){
|
||||
resolve(res.result);
|
||||
}else{
|
||||
resolve([]);
|
||||
}
|
||||
}else{
|
||||
this.$message.error('查询用户的机构失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
|
||||
Reference in New Issue
Block a user