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