|
@@ -139,6 +139,7 @@ export default {
|
|
|
defaultNode: {
|
|
defaultNode: {
|
|
|
immediate: true,
|
|
immediate: true,
|
|
|
handler(n) {
|
|
handler(n) {
|
|
|
|
|
+ if(!n || n.length === 0)return;
|
|
|
this.nodes = this.defaultNode;
|
|
this.nodes = this.defaultNode;
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
let arr = [];
|
|
let arr = [];
|
|
@@ -147,7 +148,6 @@ export default {
|
|
|
arr.push(node.data)
|
|
arr.push(node.data)
|
|
|
})
|
|
})
|
|
|
this.sNodeList = arr;
|
|
this.sNodeList = arr;
|
|
|
- console.log(arr,'arr')
|
|
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
@@ -160,12 +160,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
- sNodeList:{
|
|
|
|
|
- deep: true,
|
|
|
|
|
- handler(){
|
|
|
|
|
- this.$emit("selectNode", JSON.stringify(this.sNodeList));
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
queryData: {
|
|
queryData: {
|
|
|
handler(n) {
|
|
handler(n) {
|
|
|
if (n) {
|
|
if (n) {
|
|
@@ -190,17 +184,15 @@ export default {
|
|
|
// defaultNode:
|
|
// defaultNode:
|
|
|
// //pv: sync("value"),
|
|
// //pv: sync("value"),
|
|
|
// },
|
|
// },
|
|
|
- model: {
|
|
|
|
|
- prop: "defaultNode",
|
|
|
|
|
- event: "change",
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
- methods: {
|
|
|
|
|
|
|
+ methods: {
|
|
|
clear() {
|
|
clear() {
|
|
|
this.sNodeList = [];
|
|
this.sNodeList = [];
|
|
|
this.$refs.tree.setCheckedKeys([]);
|
|
this.$refs.tree.setCheckedKeys([]);
|
|
|
this.$refs.tree.setCurrentKey(null);
|
|
this.$refs.tree.setCurrentKey(null);
|
|
|
- //this.$emit("selectNode", JSON.stringify(this.sNodeList));
|
|
|
|
|
|
|
+ this.nodes = [];
|
|
|
|
|
+ this.$emit("selectNode", JSON.stringify(this.sNodeList));
|
|
|
},
|
|
},
|
|
|
//筛选条件变化
|
|
//筛选条件变化
|
|
|
serchTreeHandler() {
|
|
serchTreeHandler() {
|
|
@@ -246,7 +238,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
// debugger;
|
|
// debugger;
|
|
|
this.sNodeList = this.$refs.tree.getCheckedNodes();
|
|
this.sNodeList = this.$refs.tree.getCheckedNodes();
|
|
|
- //this.$emit("selectNode", JSON.stringify(this.sNodeList));
|
|
|
|
|
|
|
+ this.$emit("selectNode", JSON.stringify(this.sNodeList));
|
|
|
},
|
|
},
|
|
|
recursionTreeHandler(type, tree) {
|
|
recursionTreeHandler(type, tree) {
|
|
|
tree.forEach((item) => {
|
|
tree.forEach((item) => {
|
|
@@ -273,7 +265,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+ model: {
|
|
|
|
|
+ prop: "defaultNode",
|
|
|
|
|
+ event: "selectNode",
|
|
|
|
|
+ },
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|