This commit is contained in:
yanran200730
2022-02-11 10:11:45 +08:00
parent 9a68f2ec8a
commit 76af1c2d14
5 changed files with 140 additions and 23 deletions

View File

@@ -98,9 +98,11 @@
:props="treeObj.defaultProps"
node-key="id"
ref="tree"
:check-strictly="true" show-checkbox
:check-strictly="true"
show-checkbox
:default-checked-keys="treeObj.checkedKeys"
default-expand-all highlight-current>
default-expand-all
@check="onCheckChange">
</el-tree>
</div>
</ai-dialog>
@@ -298,10 +300,19 @@ export default {
this.showGrid = false
},
onCheckChange (e) {
this.$nextTick(() => {
this.$refs.tree.getCheckedKeys().forEach(v => {
this.$refs.tree.setChecked(v, false)
})
this.$refs.tree.setChecked(e.id, true)
})
},
getGridList() {
this.instance.post(`/app/appgirdinfo/listAll`).then((res) => {
if (res.code == 0) {
this.treeObj.treeList = res.data
this.treeObj.treeList = this.format(res.data)
if (this.formData.girdId) {
this.$set(this.treeObj, 'checkedKeys', [this.formData.girdId])
}
@@ -309,6 +320,20 @@ export default {
})
},
format (list) {
return list.map(item => {
if (item.girdLevel !== '2') {
item.disabled = true
}
if (item.girdList && item.girdList.length) {
item.girdList = this.format(item.girdList)
}
return item
})
},
getDetail() {
this.instance.post(`/app/appspecialprison/queryDetailById?id=${this.params.id}`).then((res) => {
if (res.data) {