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

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

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

Loading…
Cancel
Save