update: menu relation transformation completed

This commit is contained in:
QM303176530
2020-04-05 20:14:15 +08:00
parent c755120c8d
commit 81a54b5a44
11 changed files with 110 additions and 116 deletions
+1 -1
View File
@@ -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
+4 -4
View File
@@ -1,7 +1,7 @@
'use strict'
const path = require('path')
function resolve(dir) {
return path.join(__dirname, dir)
}
@@ -51,10 +51,10 @@ module.exports = {
})
.end()
config
// https://webpack.js.org/configuration/devtool/#development
// https://webpack.js.org/configuration/devtool/#development
.when(process.env.NODE_ENV === 'development',
config => config.devtool('cheap-source-map')
)
config => config.devtool('cheap-source-map')
)
config
.when(process.env.NODE_ENV !== 'development',