| | |
| | | import PropTypes from 'prop-types' |
| | | import {connect} from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import {Tabs, Icon, BackTop} from 'antd' |
| | | import {Tabs, Icon, BackTop, notification} from 'antd' |
| | | import moment from 'moment' |
| | | import 'moment/locale/zh-cn' |
| | | |
| | | import { modifyTabview, toggleIsiframe } from '@/store/action' |
| | | import { modifyTabview, toggleIsiframe, initActionPermission } from '@/store/action' |
| | | import asyncComponent from '@/utils/asyncLoadComponent' |
| | | import NotFount from '@/components/404' |
| | | import options from '@/store/options.js' |
| | |
| | | window.GLOB.CacheMap = new Map() |
| | | |
| | | if (options.sysType === 'local' && window.GLOB.systemType !== 'production') { |
| | | Api.getAppVersion().then(() => { |
| | | MKEmitter.emit('reloadMenuView', menu.MenuID) |
| | | }, () => { |
| | | let roledefer = new Promise(resolve => { |
| | | Api.getSystemConfig({ |
| | | func: 's_Get_TrdMenu_Role', |
| | | edition_type: 'A', |
| | | pro_sys: '' |
| | | }).then(result => { |
| | | if (!result) return |
| | | if (!result.status) { |
| | | notification.error({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | let _permAction = {loaded: true} // 按钮权限 |
| | | |
| | | if (result.UserRoles_Menu) { |
| | | result.UserRoles_Menu.forEach(menu => { |
| | | if (!menu.MenuID) return |
| | | _permAction[menu.MenuID] = true |
| | | }) |
| | | } |
| | | |
| | | this.props.initActionPermission(_permAction) |
| | | } |
| | | |
| | | resolve() |
| | | }) |
| | | }) |
| | | |
| | | // 获取主菜单参数 |
| | | let menudefer = new Promise(resolve => { |
| | | Api.getAppVersion().then(() => { |
| | | resolve() |
| | | }, () => { |
| | | resolve() |
| | | }) |
| | | }) |
| | | |
| | | Promise.all([roledefer, menudefer]).then(() => { |
| | | MKEmitter.emit('reloadMenuView', menu.MenuID) |
| | | }) |
| | | } else { |
| | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)), |
| | | initActionPermission: (permAction) => dispatch(initActionPermission(permAction)), |
| | | toggleIsiframe: (isiframe) => dispatch(toggleIsiframe(isiframe)) |
| | | } |
| | | } |