修复菜单和机构模块关闭编辑界面再打开新增界面数据没有清空的问题

dev
smallchill 5 years ago
parent 97b513c3d8
commit 141ab2c334
  1. 25
      src/views/system/dept.vue
  2. 25
      src/views/system/menu.vue

@ -132,6 +132,7 @@
dicData: [], dicData: [],
type: "tree", type: "tree",
hide: true, hide: true,
addDisabled: false,
props: { props: {
label: "title" label: "title"
}, },
@ -212,13 +213,10 @@
}); });
}, },
handleAdd(row) { handleAdd(row) {
this.$refs.crud.value.parentId = row.id; this.parentId = row.id;
this.$refs.crud.option.column.filter(item => { const column = this.findObject(this.option.column, "parentId");
if (item.prop === "parentId") { column.value = row.id;
item.value = row.id; column.addDisabled = true;
item.addDisabled = true;
}
});
this.$refs.crud.rowAdd(); this.$refs.crud.rowAdd();
}, },
rowSave(row, done, loading) { rowSave(row, done, loading) {
@ -328,15 +326,10 @@
done(); done();
}, },
beforeClose(done) { beforeClose(done) {
this.$refs.crud.tableForm = {}; this.parentId = "";
this.$refs.crud.value.parentId = ""; const column = this.findObject(this.option.column, "parentId");
this.$refs.crud.value.addDisabled = false; column.value = "";
this.$refs.crud.option.column.filter(item => { column.addDisabled = false;
if (item.prop === "parentId") {
item.value = "";
item.addDisabled = false;
}
});
done(); done();
}, },
currentChange(currentPage) { currentChange(currentPage) {

@ -112,6 +112,7 @@
type: "tree", type: "tree",
dicData: [], dicData: [],
hide: true, hide: true,
addDisabled: false,
props: { props: {
label: "title" label: "title"
}, },
@ -274,13 +275,10 @@
}); });
}, },
handleAdd(row) { handleAdd(row) {
this.$refs.crud.value.parentId = row.id; this.parentId = row.id;
this.$refs.crud.option.column.filter(item => { const column = this.findObject(this.option.column, "parentId");
if (item.prop === "parentId") { column.value = row.id;
item.value = row.id; column.addDisabled = true;
item.addDisabled = true;
}
});
this.$refs.crud.rowAdd(); this.$refs.crud.rowAdd();
}, },
rowSave(row, done, loading) { rowSave(row, done, loading) {
@ -388,15 +386,10 @@
done(); done();
}, },
beforeClose(done) { beforeClose(done) {
this.$refs.crud.tableForm = {}; this.parentId = "";
this.$refs.crud.value.parentId = ""; const column = this.findObject(this.option.column, "parentId");
this.$refs.crud.value.addDisabled = false; column.value = "";
this.$refs.crud.option.column.filter(item => { column.addDisabled = false;
if (item.prop === "parentId") {
item.value = "";
item.addDisabled = false;
}
});
done(); done();
}, },
currentChange(currentPage) { currentChange(currentPage) {

Loading…
Cancel
Save