|
@@ -181,7 +181,7 @@ export default {
|
|
|
type: undefined,
|
|
|
sort: undefined,
|
|
|
id: undefined,
|
|
|
- parentId: undefined,
|
|
|
+ parentId: null,
|
|
|
sbNotes: undefined
|
|
|
},
|
|
|
// 表单参数
|
|
@@ -271,7 +271,7 @@ export default {
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
id: undefined,
|
|
|
- parentId: 0,
|
|
|
+ parentId: null,
|
|
|
name: undefined,
|
|
|
icon: undefined,
|
|
|
orderNum: undefined
|
|
@@ -295,10 +295,9 @@ export default {
|
|
|
handleAdd(row) {
|
|
|
this.reset()
|
|
|
this.getTreeselect()
|
|
|
- if (row != null && row.id) {
|
|
|
- this.form.parentId = row.id
|
|
|
- } else {
|
|
|
- this.form.parentId = 0
|
|
|
+ this.form.parentId = row?.id || 0;
|
|
|
+ if (row?.id) {
|
|
|
+ this.form.parentId = row.name;
|
|
|
}
|
|
|
this.open = true
|
|
|
this.title = '添加菜单'
|
|
@@ -318,6 +317,11 @@ export default {
|
|
|
getlabel(row.id).then(response => {
|
|
|
this.form = response.data
|
|
|
this.form.labelTypeList = this.form.labelTypeList.map(item => item.type)
|
|
|
+ if (row?.id) {
|
|
|
+ this.form.parentId = row.name;
|
|
|
+ } else {
|
|
|
+ this.form.parentId = 0;
|
|
|
+ }
|
|
|
this.open = true
|
|
|
this.title = '修改菜单'
|
|
|
})
|