| | |
| | | import React, {Component} from 'react' |
| | | import {connect} from 'react-redux' |
| | | import { is, fromJS } from 'immutable' |
| | | import { BackTop, Breadcrumb, Icon} from 'antd' |
| | | import { BackTop, Breadcrumb, Icon, notification} from 'antd' |
| | | import moment from 'moment' |
| | | import 'moment/locale/zh-cn' |
| | | |
| | |
| | | import mzhCN from '@/locales/zh-CN/main.js' |
| | | import menUS from '@/locales/en-US/main.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import { initActionPermission } from '@/store/action' |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | | |
| | |
| | | window.GLOB.CacheMap = new Map() |
| | | |
| | | if (options.sysType === 'local' && window.GLOB.systemType !== 'production') { |
| | | 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(() => { |
| | | MKEmitter.emit('reloadMenuView', tabview.MenuID) |
| | | resolve() |
| | | }, () => { |
| | | resolve() |
| | | }) |
| | | }) |
| | | |
| | | Promise.all([roledefer, menudefer]).then(() => { |
| | | MKEmitter.emit('reloadMenuView', tabview.MenuID) |
| | | }) |
| | | } else { |
| | |
| | | } |
| | | } |
| | | |
| | | const mapDispatchToProps = () => { |
| | | return {} |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | initActionPermission: (permAction) => dispatch(initActionPermission(permAction)), |
| | | } |
| | | } |
| | | |
| | | export default connect(mapStateToProps, mapDispatchToProps)(BreadView) |