This commit is contained in:
yanran200730
2022-01-18 14:51:38 +08:00
parent f1231284d6
commit 7ddfd8d394

View File

@@ -202,10 +202,18 @@
</template> </template>
</ai-card> </ai-card>
</el-form> </el-form>
<ai-dialog title="选择网格" :visible.sync="showGrid" :customFooter="true" :destroyOnClose="true" @opened="beforeSelectTree" border width="720px"> <ai-dialog title="选择网格" :visible.sync="showGrid" :customFooter="true" :destroyOnClose="true" border width="720px">
<div class="grid"> <div class="grid">
<el-tree :data="treeObj.treeList" :props="treeObj.defaultProps" node-key="id" ref="tree" :check-strictly="true" show-checkbox <el-tree
:default-checked-keys="currCheckedKeys" default-expand-all highlight-current> :data="treeObj.treeList"
:props="treeObj.defaultProps"
node-key="id"
ref="tree"
:check-strictly="true"
show-checkbox
:default-checked-keys="currCheckedKeys"
default-expand-all
@check="onCheckChange">
</el-tree> </el-tree>
</div> </div>
<div class="dialog-footer" slot="footer" > <div class="dialog-footer" slot="footer" >
@@ -278,6 +286,7 @@ export default {
}; };
}, },
created() { created() {
this.beforeSelectTree()
if (this.params.id) { if (this.params.id) {
this.searchDetail(); this.searchDetail();
this.title = "网格员详情"; this.title = "网格员详情";
@@ -339,6 +348,15 @@ 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)
})
},
removeGrid (index) { removeGrid (index) {
this.forms.girdInfoList.splice(index, 1) this.forms.girdInfoList.splice(index, 1)
}, },