| | |
| | | param: PropTypes.any, // 其他页面传递的参数 |
| | | Tab: PropTypes.string, // 弹窗标签 |
| | | MenuID: PropTypes.string, // 菜单Id |
| | | MenuNo: PropTypes.string, // 菜单参数 |
| | | MenuName: PropTypes.string, // 菜单名称 |
| | | changeTemp: PropTypes.func |
| | | } |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { MenuID } = this.props |
| | | const { MenuID, MenuName } = this.props |
| | | |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | config = window.decodeURIComponent(window.atob(result.LongParam)) |
| | | config = config.replace(/@mywebsite@\//ig, window.GLOB.baseurl) |
| | | config = JSON.parse(config) |
| | | config.MenuID = MenuID |
| | | config.MenuName = MenuName || config.MenuName |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | config = '' |
| | |
| | | }) |
| | | } |
| | | |
| | | config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID) |
| | | config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID, config.MenuName) |
| | | |
| | | let autoMatic = null |
| | | if (config.autoMatic && config.autoMatic.enable === 'true') { |
| | |
| | | } |
| | | } |
| | | |
| | | filterComponent = (components, roleId, permAction, skip, urlparam, pageId) => { |
| | | filterComponent = (components, roleId, permAction, skip, urlparam, pageId, MenuName) => { |
| | | return components.filter(item => { |
| | | item.$pageId = pageId |
| | | |
| | | item.$menuname = (this.props.MenuName || '') + '-' + (item.name || '主表') |
| | | item.$menuname = (MenuName || '') + '-' + (item.name || '主表') |
| | | |
| | | if (item.type === 'tabs') { |
| | | item.subtabs = item.subtabs.filter(tab => { |
| | |
| | | if (tab.permission !== 'true') { // 权限未开启不做权限控制 |
| | | skip = true |
| | | } |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, skip, urlparam, pageId) |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, skip, urlparam, pageId, MenuName) |
| | | return tab |
| | | }) |
| | | |
| | | return true |
| | | } else { |
| | | item.name = (this.props.MenuName || '') |
| | | item.name = (MenuName || '') |
| | | } |
| | | |
| | | // 搜索条件初始化 |