| | |
| | | import { |
| | | modifyMenuTree, |
| | | modifyMainMenu, |
| | | modifyTabview, |
| | | resetEditLevel, |
| | | logout |
| | | } from '@/store/action' |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import avatar from '@/assets/img/avatar.jpg' |
| | | import MainLogo from '@/assets/img/main-logo.png' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | | |
| | | const EditMenu = asyncComponent(() => import('@/templates/menuconfig/editfirstmenu')) |
| | |
| | | getMenulist = (result) => { |
| | | let iframes = ['Main/Index', 'bda/rdt', 'Home/rdt'] |
| | | let menulist = [] |
| | | let thdMenuList = [] |
| | | result.fst_menu && result.fst_menu.forEach(fst => { |
| | | let fstItem = { |
| | | MenuID: fst.MenuID, |
| | |
| | | } |
| | | } |
| | | |
| | | thdMenuList.push(trdItem) |
| | | |
| | | return trdItem |
| | | }) |
| | | } |
| | |
| | | menulist.push(fstItem) |
| | | }) |
| | | |
| | | sessionStorage.setItem('thdMenuList', JSON.stringify(thdMenuList)) |
| | | return { menulist } |
| | | } |
| | | |
| | |
| | | |
| | | this.props.modifyMainMenu(menulist[0] || null) |
| | | this.props.resetEditLevel(false) |
| | | this.props.modifyTabview([]) |
| | | |
| | | MKEmitter.emit('modifyTabs', null, 'replace') |
| | | } |
| | | |
| | | exitEdit = () => { |
| | |
| | | |
| | | componentDidMount () { |
| | | if (window.GLOB.systemType !== 'production') { |
| | | Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | if (res.status) { |
| | | let _permFuncField = [] |
| | | let _sysRoles = [] |
| | | |
| | | if (res.Roles && res.Roles.length > 0) { |
| | | _sysRoles = res.Roles.map(role => { |
| | | return { |
| | | uuid: Utils.getuuid(), |
| | | value: role.RoleID, |
| | | text: role.RoleName |
| | | } |
| | | }) |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | if (res.status) { |
| | | let _permFuncField = [] |
| | | let _sysRoles = [] |
| | | |
| | | if (res.Roles && res.Roles.length > 0) { |
| | | _sysRoles = res.Roles.map(role => { |
| | | return { |
| | | uuid: Utils.getuuid(), |
| | | value: role.RoleID, |
| | | text: role.RoleName |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (res.sModular && res.sModular.length > 0) { |
| | | res.sModular.forEach(field => { |
| | | if (field.ModularNo) { |
| | | _permFuncField.push(field.ModularNo) |
| | | } |
| | | }) |
| | | _permFuncField = _permFuncField.sort() |
| | | } |
| | | |
| | | sessionStorage.setItem('sysRoles', JSON.stringify(_sysRoles)) |
| | | sessionStorage.setItem('permFuncField', JSON.stringify(_permFuncField)) |
| | | } |
| | | |
| | | if (res.sModular && res.sModular.length > 0) { |
| | | res.sModular.forEach(field => { |
| | | if (field.ModularNo) { |
| | | _permFuncField.push(field.ModularNo) |
| | | } |
| | | }) |
| | | _permFuncField = _permFuncField.sort() |
| | | } |
| | | |
| | | sessionStorage.setItem('sysRoles', JSON.stringify(_sysRoles)) |
| | | sessionStorage.setItem('permFuncField', JSON.stringify(_permFuncField)) |
| | | } |
| | | }) |
| | | }) |
| | | }, 50) |
| | | } else if (window.GLOB.systemType === 'production') { |
| | | this.props.resetEditLevel('HS') |
| | | this.props.modifyMainMenu({ |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { mainMenu, editLevel, tabviews } = this.props |
| | | const { mainMenu, editLevel } = this.props |
| | | const { menulist } = this.state |
| | | |
| | | return ( |
| | |
| | | } |
| | | {editLevel === 'HS' ? <Button className="level4-close" type="primary" onClick={this.exitManage}>退出</Button> : null} |
| | | {/* 进入编辑按钮 */} |
| | | {!editLevel ? <Icon onClick={this.enterEdit} className="edit-check" type="edit" /> : null} |
| | | {!editLevel && menulist ? <Icon onClick={this.enterEdit} className="edit-check" type="edit" /> : null} |
| | | {!editLevel && options.sysType === 'local' && window.GLOB.systemType !== 'production' && this.props.memberLevel >= 20 ? |
| | | <div className="app-entrance entrance"> |
| | | <div className="icon"><Icon type="appstore" /></div> |
| | |
| | | </Button> |
| | | </div> : null |
| | | } |
| | | {editLevel === 'HS' && tabviews.length === 0 && options.sysType === 'local' && window.GLOB.systemType === 'production' && this.props.memberLevel >= 20 ? |
| | | {editLevel === 'HS' && options.sysType === 'local' && window.GLOB.systemType === 'production' && this.props.memberLevel >= 20 ? |
| | | <div className="app-prod-entrance entrance"> |
| | | <div className="icon"><Icon type="appstore" /></div> |
| | | <div className="title">应用管理</div> |
| | |
| | | |
| | | const mapStateToProps = (state) => { |
| | | return { |
| | | tabviews: state.tabviews, |
| | | menuTree: state.menuTree, |
| | | mainMenu: state.mainMenu, |
| | | editLevel: state.editLevel, |
| | |
| | | |
| | | const mapDispatchToProps = (dispatch) => { |
| | | return { |
| | | modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)), |
| | | modifyMenuTree: (menuTree) => dispatch(modifyMenuTree(menuTree)), |
| | | modifyMainMenu: (mainMenu) => dispatch(modifyMainMenu(mainMenu)), |
| | | resetEditLevel: (level) => dispatch(resetEditLevel(level)), |