| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { permAction, param } = this.props |
| | | const { permAction } = this.props |
| | | |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | let roleId = sessionStorage.getItem('role_id') || '' // 角色ID |
| | | let balMap = new Map() |
| | | let skip = config.permission === 'false' || window.GLOB.mkHS |
| | | config.components = this.filterComponent(config.components, roleId, permAction, balMap, skip) |
| | | let param = this.props.param || {} // url参数 |
| | | |
| | | config.components = this.filterComponent(config.components, roleId, permAction, balMap, skip, param) |
| | | |
| | | // 获取主搜索条件 |
| | | let mainSearch = [] |
| | |
| | | |
| | | component.search = component.search.map(item => { |
| | | item.oriInitval = item.initval |
| | | if (['text', 'select', 'link'].includes(item.type) && param && param.$searchkey === item.field) { |
| | | if (['text', 'select', 'link'].includes(item.type) && param.$searchkey === item.field) { |
| | | item.initval = param.$searchval |
| | | } |
| | | |
| | |
| | | }) |
| | | |
| | | let params = [] |
| | | let BID = param && param.$BID ? param.$BID : '' |
| | | let BID = param.$BID || '' |
| | | let inherit = {} |
| | | |
| | | if (config.cacheUseful === 'true') { // 缓存继承 |
| | |
| | | } |
| | | if (config.urlFields) { |
| | | config.urlFields.forEach(field => { |
| | | let val = `'${param ? (param[field] || '') : ''}'` |
| | | let val = `'${param[field] || ''}'` |
| | | regs.push({ |
| | | reg: new RegExp('@' + field + '@', 'ig'), |
| | | value: val |
| | |
| | | }) |
| | | } |
| | | |
| | | filterComponent = (components, roleId, permAction, balMap, skip) => { |
| | | filterComponent = (components, roleId, permAction, balMap, skip, urlparam) => { |
| | | return components.filter(item => { |
| | | |
| | | if (item.style && item.style.boxShadow) { |
| | |
| | | return true |
| | | }) |
| | | |
| | | if (item.setting.supModule) { |
| | | let pid = item.setting.supModule.pop() |
| | | item.setting.supModule = pid || '' |
| | | |
| | | if (item.setting.supModule) { |
| | | item.setting.controlField = item.setting.controlField.toLowerCase() |
| | | |
| | | if (item.setting.supModule === 'preview') { |
| | | item.setting.supModule = '' |
| | | let val = '' |
| | | Object.keys(urlparam).forEach(key => { |
| | | if (key.toLowerCase() === item.setting.controlField) { |
| | | val = urlparam[key] |
| | | } |
| | | }) |
| | | |
| | | item.subtabs = item.subtabs.filter(tab => { |
| | | if (tab.controlVal === val) { |
| | | return false |
| | | } else if (/,/ig.test(tab.controlVal)) { |
| | | return !tab.controlVal.split(',').includes(val) |
| | | } |
| | | |
| | | return true |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (item.setting.selectField) { |
| | | item.setting.selectField = item.setting.selectField.toLowerCase() |
| | | |
| | | let val = '' |
| | | Object.keys(urlparam).forEach(key => { |
| | | if (key.toLowerCase() === item.setting.selectField) { |
| | | val = urlparam[key] |
| | | } |
| | | }) |
| | | |
| | | let activeKey = '' |
| | | |
| | | item.subtabs.forEach(tab => { |
| | | if (!activeKey && tab.selectVal === val) { |
| | | activeKey = tab.uuid |
| | | } |
| | | }) |
| | | |
| | | item.activeKey = activeKey |
| | | } |
| | | |
| | | item.subtabs = item.subtabs.map(tab => { |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip) |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam) |
| | | return tab |
| | | }) |
| | | |
| | |
| | | }) |
| | | }) |
| | | item.parentIds = supIds |
| | | |
| | | return true |
| | | } else if (item.type === 'group') { |
| | | if ( |
| | | item.setting.blacklist && item.setting.blacklist.length > 0 && |
| | |
| | | return false |
| | | } |
| | | |
| | | item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip) |
| | | item.components = this.filterComponent(item.components, roleId, permAction, balMap, skip, urlparam) |
| | | |
| | | return true |
| | | } else if (['pie', 'bar', 'line', 'dashboard', 'scatter', 'chart'].includes(item.type)) { |
| | | if ( |
| | | item.plot.blacklist && item.plot.blacklist.length > 0 && |