网格回显
This commit is contained in:
@@ -107,7 +107,7 @@
|
||||
</el-tree>
|
||||
</div>
|
||||
<div class="dialog-footer" slot="footer">
|
||||
<el-button size="medium" @click="showGrid = false">取消</el-button>
|
||||
<el-button size="medium" @click="closed()">取消</el-button>
|
||||
<el-button type="primary" size="medium" @click="getCheckedTree()">确认</el-button>
|
||||
</div>
|
||||
</ai-dialog>
|
||||
@@ -299,9 +299,6 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
onConfirm() {
|
||||
// if(this.form.ruleType==1 && !this.form.ladderRule.length) {
|
||||
// return this.$message.error('请添加规则')
|
||||
// }
|
||||
this.$refs.DialogForm.validate((valid) => {
|
||||
if (valid) {
|
||||
let formData = this.$copy(this.form);
|
||||
@@ -424,14 +421,6 @@ export default {
|
||||
.post(`/app/appgirdinfo/listAll3`, null, null)
|
||||
.then((res) => {
|
||||
if (res.code == 0) {
|
||||
// res.data.forEach((item)=>{
|
||||
// const isChecked = this.girdInfoList.find((checkedId)=>{
|
||||
// return item.id === checkedId
|
||||
// })
|
||||
// if(isChecked) item.checkType = true
|
||||
// })
|
||||
// console.log(res.data)
|
||||
|
||||
this.treeObj.treeList = this.girdToTree(res.data);
|
||||
this.girdInfoList.map((e) => {
|
||||
this.treeObj.checkedKeys.push(e.id);
|
||||
@@ -439,7 +428,7 @@ export default {
|
||||
this.$nextTick(() => {
|
||||
this.currCheckedKeys = this.girdInfoList;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.tree?.getCheckedKeys(this.currCheckedKeys);
|
||||
this.$refs.tree?.setCheckedKeys(this.currCheckedKeys);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -447,14 +436,13 @@ 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)
|
||||
// })
|
||||
// console.log(e);
|
||||
this.$refs.tree.setChecked(e.id, true);
|
||||
this.girdInfoList.forEach((v) => {
|
||||
if(v == e.id) {
|
||||
this.$refs.tree.setChecked(e.id, false);
|
||||
} else {
|
||||
this.$refs.tree.setChecked(e.id, true);
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
|
||||
Reference in New Issue
Block a user