修复禅道bug#4853 需要支持选择部门后选中部门下人员

This commit is contained in:
anhc 2022-09-22 13:49:23 +08:00
parent 775d9a5fef
commit ef1ec3312a

View File

@ -32,11 +32,12 @@
:props="treeProps" :props="treeProps"
:show-checkbox="multiple" :show-checkbox="multiple"
:expand-on-click-node=false :expand-on-click-node=false
:check-strictly=true :check-strictly=false
:highlight-current=true :highlight-current=true
@node-click="openNode" @node-click="openNode"
@node-expand="expandNode" @node-expand="expandNode"
@node-collapse="closeNode" @node-collapse="closeNode"
@check="checkBox"
:filter-node-method="filterNode" :filter-node-method="filterNode"
:default-expanded-keys="expandKeys" :default-expanded-keys="expandKeys"
node-key="id" node-key="id"
@ -185,7 +186,7 @@
if (!that.isOlderVersion){ if (!that.isOlderVersion){
let nodes = this.$refs.tree.getCheckedNodes(); let nodes = this.$refs.tree.getCheckedNodes();
nodes.forEach((item)=>{ nodes.forEach((item)=>{
if (!that.form.userArr.includes(item.id)){ if (item.type=="user" && !that.form.userArr.includes(item.id)){
that.form.userArr.push(item.id); that.form.userArr.push(item.id);
} }
}) })
@ -258,6 +259,12 @@
}, },
openNode(obj, node, tree) {// openNode(obj, node, tree) {//
},
checkBox(node,state) {//
if (node.type == "department"){
const tree = this.$refs.tree;
tree.getNode(node.id).expand();
}
}, },
expandNode(obj, node, tree) {// expandNode(obj, node, tree) {//
@ -303,7 +310,7 @@
curr.disabled = true; curr.disabled = true;
} else { } else {
if (isDept && curr.type == 'department') curr.disabled = false; if (isDept && curr.type == 'department') curr.disabled = false;
if (!isDept && curr.type == 'department') curr.disabled = true; if (!isDept && curr.type == 'department') curr.disabled = false;
if (isUser && curr.type == 'user') curr.disabled = false; if (isUser && curr.type == 'user') curr.disabled = false;
if (!isUser && curr.type == 'user') curr.disabled = true; if (!isUser && curr.type == 'user') curr.disabled = true;
if (isRole && curr.type == 'role') curr.disabled = false; if (isRole && curr.type == 'role') curr.disabled = false;