27139
This commit is contained in:
		| @@ -40,9 +40,16 @@ | ||||
|       <ai-dialog title="选择网格" :visible.sync="showGrid" :customFooter="true" :destroyOnClose="true" | ||||
|                  @opened="beforeSelectTree" border width="720px"> | ||||
|         <div class="grid"> | ||||
|           <el-tree :data="treeObj.treeList" :props="treeObj.defaultProps" node-key="id" ref="tree" | ||||
|                    :check-strictly="true" show-checkbox | ||||
|                    :default-checked-keys="treeObj.checkedKeys" default-expand-all highlight-current> | ||||
|           <el-tree | ||||
|             :data="treeObj.treeList" | ||||
|             :props="treeObj.defaultProps" | ||||
|             node-key="id" | ||||
|             ref="tree" | ||||
|             :check-strictly="true" | ||||
|             show-checkbox | ||||
|             :default-checked-keys="treeObj.checkedKeys" | ||||
|             default-expand-all | ||||
|             @check="onCheckChange"> | ||||
|           </el-tree> | ||||
|         </div> | ||||
|         <div class="dialog-footer" slot="footer"> | ||||
| @@ -129,6 +136,16 @@ export default { | ||||
|         } | ||||
|       }); | ||||
|     }, | ||||
|  | ||||
|     onCheckChange (e) { | ||||
|       this.$nextTick(() => { | ||||
|         this.$refs.tree.getCheckedKeys().forEach(v => { | ||||
|           this.$refs.tree.setChecked(v, false) | ||||
|         }) | ||||
|         this.$refs.tree.setChecked(e.id, true) | ||||
|       }) | ||||
|     }, | ||||
|  | ||||
|     getCheckedTree() { | ||||
|       if (this.$refs.tree.getCheckedNodes().length > 1) { | ||||
|         return this.$message.error('不能绑定多个网格') | ||||
|   | ||||
		Reference in New Issue
	
	Block a user