添加成员

This commit is contained in:
zhal 2022-09-07 15:11:16 +08:00
parent 6f82a42753
commit 5d6f5a984a

View File

@ -38,6 +38,7 @@
@node-expand="expandNode"
@node-collapse="closeNode"
:filter-node-method="filterNode"
:default-expanded-keys="expandKeys"
node-key="id"
lazy
:load="loadNode">
@ -123,7 +124,9 @@
addressType: 'user',
highSecurityFilter: 'sysAdmin,auditor' ,// sysAdmin,auditor簿
pid: '',
searchUserName:''
searchUserName:'',
tempNodeArr: [],
expandKeys:[]
}
},
@ -324,12 +327,91 @@
})
},
filterNode(value, data) {
debugger;
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(){
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: {
visible(val) {
@ -338,7 +420,12 @@
this.initData();
} else {//
}
}
},
watch: {
searchUserName(val) {
this.$refs.tree.filter(val);
}
},
}
}
</script>