| | |
| | | import moment from 'moment' |
| | | import {Dropdown, Menu, Icon, Modal, Form, notification, Switch } from 'antd' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import {toggleCollapse, modifyMainMenu, resetState, resetDebug, resetEditState, resetEditLevel, logout} from '@/store/action' |
| | | import { |
| | | toggleCollapse, |
| | | modifyMainMenu, |
| | | resetState, |
| | | resetDebug, |
| | | resetEditState, |
| | | resetEditLevel, |
| | | initPermission, |
| | | logout |
| | | } from '@/store/action' |
| | | import Api from '@/api' |
| | | import zhCN from '@/locales/zh-CN/header.js' |
| | | import enUS from '@/locales/en-US/header.js' |
| | |
| | | // 获取主菜单 |
| | | let result = await Api.getSystemConfig({func: 'sPC_Get_RolesMenu'}) |
| | | if (result.status) { |
| | | let _permAction = {} |
| | | let _permFuncField = [] |
| | | if (result.UserRoles && result.UserRoles[0] && result.UserRoles[0].RoleMenu) { |
| | | result.UserRoles[0].RoleMenu.forEach(menu => { |
| | | _permAction[menu.MenuID] = true |
| | | }) |
| | | } |
| | | |
| | | if (result.sModular && result.sModular.length > 0) { |
| | | result.sModular.forEach(field => { |
| | | if (field.ModularNo) { |
| | | _permFuncField.push(field.ModularNo) |
| | | } |
| | | }) |
| | | _permFuncField = _permFuncField.sort() |
| | | } |
| | | |
| | | this.props.initPermission(_permAction, _permFuncField) |
| | | } |
| | | } |
| | | |
| | |
| | | selectmenu: state.selectedMainMenu, |
| | | debug: state.debug, |
| | | editState: state.editState, |
| | | editLevel: state.editLevel |
| | | editLevel: state.editLevel, |
| | | permAction: state.permAction, |
| | | permFuncField: state.permFuncField |
| | | } |
| | | } |
| | | |
| | |
| | | modifyMainMenu: (selectmenu) => dispatch(modifyMainMenu(selectmenu)), |
| | | resetEditState: (state) => dispatch(resetEditState(state)), |
| | | resetEditLevel: (level) => dispatch(resetEditLevel(level)), |
| | | initPermission: (permAction, permFuncField) => dispatch(initPermission(permAction, permFuncField)), |
| | | resetState: () => dispatch(resetState()), |
| | | resetDebug: () => dispatch(resetDebug()), |
| | | logout: () => dispatch(logout()) |