| | |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import './index.scss' |
| | |
| | | }) |
| | | } |
| | | |
| | | reloadMenuView = (menuId) => { |
| | | const { MenuID } = this.props |
| | | |
| | | if (MenuID !== menuId) return |
| | | |
| | | this.setState({ |
| | | loading: true, |
| | | loadingTree: false, |
| | | roleList: null, |
| | | selectRoleId: '', |
| | | mainMenus: null, |
| | | menuTrees: null, |
| | | checkedKeys: [], |
| | | menuOpenKeys: [], |
| | | selectMenuTrees: null, |
| | | selectMenuOpenKeys: [], |
| | | primarykey: '', |
| | | tabKey: '', |
| | | submitloading: false, |
| | | initCheckKeys: null |
| | | }) |
| | | this.getRoleList() |
| | | this.getMainMenuList() |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | this.getRoleList() |
| | | this.getMainMenuList() |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('reloadMenuView', this.reloadMenuView) |
| | | } |
| | | |
| | | /** |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('reloadMenuView', this.reloadMenuView) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |