update: menu relation transformation completed
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
<el-dropdown>
|
||||
<span class="el-dropdown-link">
|
||||
<img :src="userInfo.headerImg" height="30" width="30" />
|
||||
{{userInfo.nickName}}
|
||||
{{userInfo.title}}
|
||||
<i class="el-icon-arrow-down"></i>
|
||||
</span>
|
||||
<el-dropdown-menu class="dropdown-group" slot="dropdown">
|
||||
|
||||
@@ -44,10 +44,10 @@ export default {
|
||||
const apiObj = new Object()
|
||||
apis &&
|
||||
apis.map(item => {
|
||||
if (apiObj.hasOwnProperty(item.group)) {
|
||||
apiObj[item.group].push(item)
|
||||
if (apiObj.hasOwnProperty(item.apiGroup)) {
|
||||
apiObj[item.apiGroup].push(item)
|
||||
} else {
|
||||
Object.assign(apiObj, { [item.group]: [item] })
|
||||
Object.assign(apiObj, { [item.apiGroup]: [item] })
|
||||
}
|
||||
})
|
||||
const apiTree = []
|
||||
|
||||
@@ -34,7 +34,9 @@ export default {
|
||||
menuTreeIds: [],
|
||||
menuDefaultProps: {
|
||||
children: 'children',
|
||||
label: 'nickName'
|
||||
label: function(data){
|
||||
return data.meta.title
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -64,8 +66,8 @@ export default {
|
||||
const arr = []
|
||||
menus.map(item => {
|
||||
// 防止直接选中父级造成全选
|
||||
if (!menus.some(same => same.parentId === item.menuId)) {
|
||||
arr.push(Number(item.menuId))
|
||||
if (!menus.some(same => same.parentId === item.ID)) {
|
||||
arr.push(Number(item.ID))
|
||||
}
|
||||
})
|
||||
this.menuTreeIds = arr
|
||||
|
||||
Reference in New Issue
Block a user