调整菜单目录交互
This commit is contained in:
@@ -110,7 +110,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getData() {
|
getData() {
|
||||||
this.instance.post("/admin/menu/menuTree").then(res => {
|
return this.instance.post("/admin/menu/menuTree").then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
this.treeData = res.data
|
this.treeData = res.data
|
||||||
}
|
}
|
||||||
@@ -123,9 +123,12 @@ export default {
|
|||||||
if (res?.code == 0) {
|
if (res?.code == 0) {
|
||||||
this.$message.success("提交成功!")
|
this.$message.success("提交成功!")
|
||||||
this.dialog = false
|
this.dialog = false
|
||||||
if (!this.form.id) {
|
if (!!this.form.id) {
|
||||||
this.getData()
|
let node = this.$refs.MenuTree.getNode(this.form)
|
||||||
} else this.$refs.MenuTree.append(this.form, this.selected)
|
node.data = this.form
|
||||||
|
} else if (!!this.form.parentId) {
|
||||||
|
this.$refs.MenuTree.append(this.form, this.selected)
|
||||||
|
} else this.getData()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user