添加成员
This commit is contained in:
parent
6f82a42753
commit
5d6f5a984a
@ -38,6 +38,7 @@
|
|||||||
@node-expand="expandNode"
|
@node-expand="expandNode"
|
||||||
@node-collapse="closeNode"
|
@node-collapse="closeNode"
|
||||||
:filter-node-method="filterNode"
|
:filter-node-method="filterNode"
|
||||||
|
:default-expanded-keys="expandKeys"
|
||||||
node-key="id"
|
node-key="id"
|
||||||
lazy
|
lazy
|
||||||
:load="loadNode">
|
:load="loadNode">
|
||||||
@ -123,7 +124,9 @@
|
|||||||
addressType: 'user',
|
addressType: 'user',
|
||||||
highSecurityFilter: 'sysAdmin,auditor' ,// 例如值为sysAdmin,auditor,则开启三员之后该地址簿不显示系统管理员和安全审计员
|
highSecurityFilter: 'sysAdmin,auditor' ,// 例如值为sysAdmin,auditor,则开启三员之后该地址簿不显示系统管理员和安全审计员
|
||||||
pid: '',
|
pid: '',
|
||||||
searchUserName:''
|
searchUserName:'',
|
||||||
|
tempNodeArr: [],
|
||||||
|
expandKeys:[]
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -324,12 +327,91 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
filterNode(value, data) {
|
filterNode(value, data) {
|
||||||
|
debugger;
|
||||||
if (!value) return true;
|
if (!value) return true;
|
||||||
return data.name.indexOf(value) !== -1;
|
//return data.name.indexOf(value) !== -1;
|
||||||
|
return value.data.pathIdList.indexOf(data.id) !== -1;
|
||||||
},
|
},
|
||||||
searchUserNameFun(){
|
searchUserNameFun(){
|
||||||
this.$refs.tree.filter(this.searchUserName);
|
let that = this;
|
||||||
|
if (that.searchUserName) {
|
||||||
|
const data = {
|
||||||
|
url: 'jd',
|
||||||
|
data: {
|
||||||
|
cmd: 'com.actionsoft.apps.coe.pal_search_user_tree_node',
|
||||||
|
userName: that.searchUserName,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
awsuiAxios.post(data).then(ro => {
|
||||||
|
debugger;
|
||||||
|
// console.log('--------',ro)
|
||||||
|
let userIdArr = [...ro.data];
|
||||||
|
if (userIdArr.length) {
|
||||||
|
userIdArr.forEach(userid => {
|
||||||
|
let node = that.$refs.tree.getNode(userid);
|
||||||
|
// 如果当前节点已经被加载渲染 直接过滤
|
||||||
|
if (node) {
|
||||||
|
that.$refs.tree.filter(node);
|
||||||
|
setTimeout(() => {
|
||||||
|
if (node && node.parent) {
|
||||||
|
if (!node.parent.expanded){
|
||||||
|
node.parent.expand();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},100);
|
||||||
|
that.tempNodeArr.push(node);
|
||||||
|
}else {
|
||||||
|
// 否则查询当前部门节所有父级部门
|
||||||
|
that.searchParentUserIdFun(userid,that.searchUserName);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else {
|
||||||
|
that.$message({type:'warning',message:'查询的部门不存在,请检查输入的部门名称'});
|
||||||
|
}
|
||||||
|
}).catch(error => {
|
||||||
|
console.log(error);
|
||||||
|
})
|
||||||
|
}else {
|
||||||
|
that.treeNode.childNodes = [];
|
||||||
|
that.loadNode(that.treeNode,that.treeResolve);
|
||||||
|
that.expandKeys = [];
|
||||||
|
if (that.tempNodeArr.length){
|
||||||
|
that.tempNodeArr.forEach(node => {
|
||||||
|
that.$refs.tree.remove(node);
|
||||||
|
})
|
||||||
|
that.tempNodeArr.length = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//this.$refs.tree.filter(this.searchUserName);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
searchParentUserIdFun(userid,orgName){
|
||||||
|
debugger;
|
||||||
|
let that = this;
|
||||||
|
const data = {
|
||||||
|
url: 'jd',
|
||||||
|
data: {
|
||||||
|
cmd: 'com.actionsoft.apps.coe.pal_search_user_tree_parent_node',
|
||||||
|
userid,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
awsuiAxios.post(data)
|
||||||
|
.then(ro => {
|
||||||
|
console.log('父级部门',ro.data);
|
||||||
|
that.expandKeys = [...ro.data];
|
||||||
|
setTimeout(() => {
|
||||||
|
// that.$refs.orgTree.filter(orgName);
|
||||||
|
let node = that.$refs.tree.getNode(userid);
|
||||||
|
that.$refs.tree.filter(node);
|
||||||
|
that.tempNodeArr.push(node);
|
||||||
|
},100);
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
visible(val) {
|
visible(val) {
|
||||||
@ -338,7 +420,12 @@
|
|||||||
this.initData();
|
this.initData();
|
||||||
} else {// 关闭
|
} else {// 关闭
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
watch: {
|
||||||
|
searchUserName(val) {
|
||||||
|
this.$refs.tree.filter(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user