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