| | |
| | | const propsDefault = { |
| | | label: propsConfig.label || 'name', |
| | | path: propsConfig.path || 'path', |
| | | icon: propsConfig.icon || 'icon', |
| | | children: propsConfig.children || 'children' |
| | | icon: propsConfig.icon || 'source', |
| | | children: propsConfig.children || 'children', |
| | | } |
| | | const icon = ele[propsDefault.icon]; |
| | | ele[propsDefault.icon] = validatenull(icon) ? menu.iconDefault : icon; |
| | |
| | | function updateCode(items) { |
| | | items.forEach(item => { |
| | | item.pathValue = item.path; |
| | | item.path = '/' + item.code; |
| | | item.path = '/' + item.id; |
| | | item.query = {}; // 初始化 item.query |
| | | if (item.pathValue.indexOf('?') != -1) { |
| | | item.query = queryStringToObject(item.pathValue) |
| | |
| | | |
| | | commit('SET_MENU_ALL', menu) |
| | | commit('SET_MENU', menu) |
| | | //dispatch('GetButtons');s |
| | | dispatch('GetButtons'); |
| | | resolve(menu) |
| | | }) |
| | | }) |
| | |
| | | let children = {}; |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(child => { |
| | | Vue.set(children, child.code, true); |
| | | // const childObject = { |
| | | // [child.code]: true, |
| | | // source: child.source |
| | | // }; |
| | | // Object.assign(children, childObject); |
| | | children[child.code] = { |
| | | source: child.source |
| | | } |
| | | }); |
| | | } |
| | | Vue.set(permission_new, item.code, children); |
| | | Vue.set(permission_new, item.id, children); |
| | | }); |
| | | state.permission = permission_new; |
| | | setStore({name: "permission", content: permission_new}); |