| | |
| | | UNSAFE_componentWillMount () { |
| | | const { config, bids } = this.props |
| | | |
| | | let _tabs = fromJS(config).toJS() |
| | | |
| | | if (_tabs.setting.supModule) { |
| | | _tabs.subtabs = [] |
| | | } |
| | | |
| | | this.setState({ |
| | | tabs: fromJS(config).toJS(), |
| | | tabs: _tabs, |
| | | parentIds: config.parentIds || [], |
| | | bids: bids ? bids : {} |
| | | }) |
| | |
| | | } |
| | | |
| | | if (tabs.setting.supModule === MenuID) { |
| | | if (!data || data[tabs.setting.controlField] === undefined) { |
| | | if (!data) { |
| | | this.setState({ |
| | | tabs: {...tabs, subtabs: this.props.config.subtabs} |
| | | tabs: {...tabs, subtabs: []} |
| | | }) |
| | | } else { |
| | | let val = data[tabs.setting.controlField] |
| | | let val = data[tabs.setting.controlField] === undefined ? '' : data[tabs.setting.controlField] + '' |
| | | this.setState({ |
| | | tabs: {...tabs, subtabs: this.props.config.subtabs.filter(tab => { |
| | | if (tab.controlVal === val) { |
| | |
| | | const { mainSearch, BID } = this.props |
| | | const { tabs, bids } = this.state |
| | | |
| | | if (!tabs.subtabs.length) return null |
| | | |
| | | return ( |
| | | <div className={'menu-antv-tabs-wrap ' + tabs.setting.tabLabel} style={tabs.style}> |
| | | <Tabs defaultActiveKey="1" tabPosition={tabs.setting.position} type={tabs.setting.tabStyle}> |
| | | <Tabs defaultActiveKey="1" tabBarStyle={{background: tabs.setting.backgroundColor || 'transparent'}} tabPosition={tabs.setting.position} type={tabs.setting.tabStyle}> |
| | | {tabs.subtabs.map(tab => ( |
| | | <TabPane tab={<span id={'tab' + tab.uuid}>{tab.icon ? <MkIcon type={tab.icon} /> : null}{tab.label}</span>} key={tab.uuid}> |
| | | <TabPane tab={<span id={'tab' + tab.uuid}>{tab.icon ? <MkIcon type={tab.icon} /> : null}{tab.label}</span>} style={{backgroundColor: tab.backgroundColor || 'transparent'}} key={tab.uuid}> |
| | | <TabTransfer BID={BID} config={tab} bids={bids} mainSearch={mainSearch}/> |
| | | </TabPane> |
| | | ))} |