| | |
| | | orderColumn: '', |
| | | orderType: 'asc', |
| | | search: '', |
| | | fixed: {} |
| | | configMap: {} |
| | | } |
| | | |
| | | async loadconfig () { |
| | | // 获取主菜单 |
| | | let param = { |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: this.props.MenuID, |
| | | isCache: true |
| | | MenuID: this.props.MenuID |
| | | } |
| | | let result = await Api.getSystemConfig(param) |
| | | let result = await Api.getSystemCacheConfig(param) |
| | | if (result.status && result.LongParam) { |
| | | let config = window.decodeURIComponent(window.atob(result.LongParam)) |
| | | |
| | |
| | | loading: true |
| | | }, () => { |
| | | this.improveSearch() |
| | | this.improveAction() |
| | | this.loadmaindata() |
| | | }) |
| | | } else { |
| | |
| | | searchlist.forEach(item => { |
| | | if (item.type !== 'select' && item.type !== 'link') return |
| | | |
| | | let unloaded = item.options.length === 0 |
| | | |
| | | if (item.setAll === 'true') { |
| | | item.options.unshift({ |
| | | key: Utils.getuuid(), |
| | |
| | | }) |
| | | } |
| | | |
| | | if (item.resourceType === '1' && item.dataSource && unloaded) { |
| | | if (item.resourceType === '1' && item.dataSource) { |
| | | let param = { |
| | | func: 'sPC_Get_SelectedList', |
| | | LText: item.dataSourceSql, |
| | |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | let defer = new Promise(resolve => { |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getSystemCacheConfig(param).then(res => { |
| | | res.search = item |
| | | resolve(res) |
| | | }) |
| | |
| | | } |
| | | }) |
| | | this.setState({searchlist}) |
| | | }) |
| | | } |
| | | |
| | | improveAction = () => { |
| | | const { config } = this.state |
| | | config.action.forEach(item => { |
| | | if (item.OpenType !== 'pop' && item.OpenType !== 'tab' && item.OpenType !== 'blank') return |
| | | |
| | | Api.getSystemCacheConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: item.uuid |
| | | }).then(res => { |
| | | if (res.status) { |
| | | let _LongParam = '' |
| | | if (res.LongParam) { |
| | | _LongParam = window.decodeURIComponent(window.atob(res.LongParam)) |
| | | try { |
| | | _LongParam = JSON.parse(_LongParam) |
| | | } catch (e) { |
| | | _LongParam = '' |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | configMap: {...this.state.configMap, [item.uuid]: _LongParam} |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | |
| | | <MainAction |
| | | MenuID={this.props.MenuID} |
| | | setting={setting} |
| | | configMap={this.state.configMap} |
| | | refreshdata={this.refreshbyaction} |
| | | gettableselected={this.gettableselected} |
| | | actions={actions} |