|
@@ -82,32 +82,35 @@ export default {
|
|
|
/** 控制树形单选 */
|
|
|
checkChange (data, checked) {
|
|
|
this.checkedData = {}
|
|
|
- // if (checked) {
|
|
|
- if (!!data.children && data.children.length > 0) {
|
|
|
- console.log("有子节点不可选")
|
|
|
- } else {
|
|
|
- this.checkedData = data;
|
|
|
- // 注意!!!
|
|
|
- //1、下方的id和属性中 node-key="id"必须是同一个字段
|
|
|
- //2、$refs.tree 也需要和上方的属性匹配 ref="tree"
|
|
|
- this.$refs.tenantstree.setCheckedKeys([data.value]);
|
|
|
- this.value = data.value;
|
|
|
- this.Information = data.name;
|
|
|
+ debugger
|
|
|
+ if (checked) {
|
|
|
+ if (!!data.children && data.children.length > 0) {
|
|
|
+ console.log("有子节点不可选")
|
|
|
+ } else {
|
|
|
+ this.checkedData = data;
|
|
|
+ // 注意!!!
|
|
|
+ //1、下方的id和属性中 node-key="id"必须是同一个字段
|
|
|
+ //2、$refs.tree 也需要和上方的属性匹配 ref="tree"
|
|
|
+ this.$refs.tenantstree.setCheckedKeys([data.value]);
|
|
|
+ this.value = data.value;
|
|
|
+ this.Information = data.name;
|
|
|
+ }
|
|
|
}
|
|
|
- // }
|
|
|
- // this.value = this.checkedData.value;
|
|
|
- // console.log("checked data", data, this.checkedData)
|
|
|
- // this.Information = this.checkedData.name
|
|
|
+ this.value = this.checkedData.value;
|
|
|
+ console.log("checked data", data, this.checkedData)
|
|
|
+ this.Information = this.checkedData.name
|
|
|
|
|
|
|
|
|
},
|
|
|
submit () {
|
|
|
+ debugger
|
|
|
this.positionInformation.push({ positionInformation: this.Information, id: this.id, value: this.value });
|
|
|
this.params.callback(this.positionInformation);
|
|
|
this.$emit('close');
|
|
|
},
|
|
|
|
|
|
filterTreeData (trData) {
|
|
|
+ debugger
|
|
|
trData.map((item, index) => {
|
|
|
if (this.isNotEmpty(item.children)) {
|
|
|
item.disabled = true;
|
|
@@ -121,6 +124,7 @@ export default {
|
|
|
return arr && Array.isArray(arr) && arr.length > 0;
|
|
|
},
|
|
|
thisCheck (ev, node, data) {
|
|
|
+ debugger
|
|
|
if (!data.disabled) {
|
|
|
node.checked = !node.checked;
|
|
|
}
|