|
|
@@ -81,7 +81,7 @@ export default {
|
|
|
// 机构树上能选择的机构类型
|
|
|
enabledCheckOrgTypes: {
|
|
|
type: [Number,Array],
|
|
|
- default: [],
|
|
|
+ default: ()=>[],
|
|
|
required: false,
|
|
|
}
|
|
|
},
|
|
|
@@ -118,7 +118,14 @@ export default {
|
|
|
defaultNode: {
|
|
|
immediate: true,
|
|
|
handler(n) {
|
|
|
- if (!n || n.length === 0) return;
|
|
|
+ if(!n || n.length == 0){
|
|
|
+ this.nodes = [];
|
|
|
+ this.sNodeList = [];
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.tree.setCheckedKeys([]);
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
this.nodes = this.defaultNode;
|
|
|
this.$nextTick(() => {
|
|
|
let arr = [];
|
|
|
@@ -166,7 +173,8 @@ export default {
|
|
|
this.$refs.tree.setCheckedKeys([]);
|
|
|
this.$refs.tree.setCurrentKey(null);
|
|
|
this.nodes = [];
|
|
|
- this.$emit("selectNode", JSON.stringify(this.sNodeList));
|
|
|
+ this.$emit("selectNode",[]);
|
|
|
+ this.$emit("selectNodeId", []);
|
|
|
},
|
|
|
//筛选条件变化
|
|
|
serchTreeHandler() {
|
|
|
@@ -186,12 +194,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
getNodedisabled(node) {
|
|
|
- //console.log("getNodedisabled",node,this.enabledCheckOrgTypes)
|
|
|
- return false;
|
|
|
if (this.enabledCheckOrgTypes) {
|
|
|
- if (Array.isArray(node)) {
|
|
|
- debugger;
|
|
|
- if (this.params.enabledOrgTypeList.findIndex((x) => x === node.type) == -1) {
|
|
|
+ if (Array.isArray(this.enabledCheckOrgTypes)) {
|
|
|
+ if (this.enabledCheckOrgTypes.length>0 && this.enabledCheckOrgTypes.findIndex((x) => x === node.type) == -1) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
@@ -251,7 +256,9 @@ export default {
|
|
|
}
|
|
|
// debugger;
|
|
|
this.sNodeList = this.$refs.tree.getCheckedNodes();
|
|
|
- this.$emit("selectNode", JSON.stringify(this.sNodeList));
|
|
|
+ this.$emit("selectNode", this.sNodeList);
|
|
|
+ let arr = this.sNodeList.map(v=>{return v.id});
|
|
|
+ this.$emit("selectNodeId", arr);
|
|
|
},
|
|
|
|
|
|
getSubOrgIdsByOrgType(topOrg, orgType, orgIdList) {
|
|
|
@@ -290,18 +297,15 @@ export default {
|
|
|
text-overflow: ellipsis;
|
|
|
white-space: nowrap;
|
|
|
cursor: pointer;
|
|
|
-
|
|
|
- >span {
|
|
|
+ > span {
|
|
|
margin: 5px 10px;
|
|
|
}
|
|
|
-
|
|
|
&:hover {
|
|
|
.close-icon {
|
|
|
display: block;
|
|
|
color: #666;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.close-icon {
|
|
|
position: absolute;
|
|
|
top: 30%;
|
|
|
@@ -310,7 +314,6 @@ export default {
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.tree-box {
|
|
|
margin-top: 20px;
|
|
|
max-height: 300px;
|