mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-30 14:31:04 +00:00
improve; 菜单管理编辑更新
This commit is contained in:
parent
e7b144d15d
commit
e1ca702aad
@ -356,7 +356,7 @@ export default {
|
||||
.then(async (res) => {
|
||||
this.$Message.success(res.msg);
|
||||
this.modals = false;
|
||||
this.$emit('changeMenu');
|
||||
this.$emit('changeMenu', this.formValidate);
|
||||
this.getAddFrom();
|
||||
// this.$store.dispatch('menus/getMenusNavList');
|
||||
})
|
||||
|
||||
@ -198,6 +198,7 @@ export default {
|
||||
seletRouteIds: [], // 选中id
|
||||
menusId: 0, // 选中分类id
|
||||
nodeKey: 0, // 选中节点
|
||||
openId: '',
|
||||
};
|
||||
},
|
||||
components: { menusFrom, formCreate: formCreate.$form() },
|
||||
@ -397,6 +398,7 @@ export default {
|
||||
},
|
||||
// 编辑
|
||||
edit(row, title, index) {
|
||||
this.openId = row.id;
|
||||
this.formValidate = {};
|
||||
this.menusDetails(row.id);
|
||||
this.titleFrom = title;
|
||||
@ -439,10 +441,24 @@ export default {
|
||||
this.$Message.error(res.msg);
|
||||
});
|
||||
},
|
||||
changeMenu() {
|
||||
// this.getData(1);
|
||||
changeMenu(data) {
|
||||
console.log(data)
|
||||
this.changeData(this.tableData, data);
|
||||
this.getMenusUnique();
|
||||
},
|
||||
changeData(arr, data) {
|
||||
let arrKey = Object.keys(data);
|
||||
arr.map((e) => {
|
||||
if (e.id == this.openId) {
|
||||
arrKey.map((el) => {
|
||||
e[el] = data[el];
|
||||
});
|
||||
console.log(e);
|
||||
} else if (e.children) {
|
||||
this.changeData(e.children, data);
|
||||
}
|
||||
});
|
||||
},
|
||||
getMenusUnique() {
|
||||
getMenusUnique().then((res) => {
|
||||
let data = res.data;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user