| | |
| | | /** |
| | | * @description 设置可配置按钮 |
| | | */ |
| | | setSubConfig = (btn) => { |
| | | setSubConfig = (btn, type) => { |
| | | const { menu } = this.props |
| | | const { config, originMenu } = this.state |
| | | |
| | |
| | | message: '菜单配置已修改,请保存!', |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | } else if (type === 'button') { |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | |
| | | _LongParam = '' |
| | | } |
| | | } |
| | | this.props.handleSubConfig(btn, originMenu, _LongParam) |
| | | this.props.handleSubConfig(btn, originMenu, _LongParam, type) |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | |
| | | }) |
| | | } |
| | | }) |
| | | } else if (type === 'tab') { |
| | | this.props.handleSubConfig(btn, originMenu, '', type) |
| | | // this.setState({ |
| | | // loading: true |
| | | // }) |
| | | // Api.getSystemConfig({ |
| | | // func: 'sPC_Get_LongParam', |
| | | // MenuID: btn.uuid |
| | | // }).then(res => { |
| | | // if (res.status) { |
| | | // this.setState({ |
| | | // loading: false |
| | | // }) |
| | | // let _LongParam = '' |
| | | // if (res.LongParam) { |
| | | // _LongParam = window.decodeURIComponent(window.atob(res.LongParam)) |
| | | // try { |
| | | // _LongParam = JSON.parse(_LongParam) |
| | | // } catch (e) { |
| | | // _LongParam = '' |
| | | // } |
| | | // } |
| | | // this.props.handleSubConfig(btn, originMenu, _LongParam) |
| | | // } else { |
| | | // this.setState({ |
| | | // loading: false |
| | | // }) |
| | | // notification.warning({ |
| | | // top: 92, |
| | | // message: res.message, |
| | | // duration: 10 |
| | | // }) |
| | | // } |
| | | // }) |
| | | } |
| | | }, () => { |
| | | notification.warning({ |
| | |
| | | icon={item.icon} |
| | | style={{marginBottom: '10px'}} |
| | | className={'mk-btn mk-' + item.class} |
| | | onClick={() => this.setSubConfig(item)} |
| | | onClick={() => this.setSubConfig(item, 'button')} |
| | | >{item.label}</Button> |
| | | </div> |
| | | ) |
| | | })} |
| | | </Panel> |
| | | {/* 添加显示列 */} |
| | | <Panel header={this.state.dict['header.menu.column']} key="3"> |
| | | <div className="search-element"> |
| | | {Source.columnItems.map((item, index) => { |
| | |
| | | </div> |
| | | <Button type="primary" block onClick={() => this.queryField('columns')}>{this.state.dict['header.menu.column.add']}</Button> |
| | | </Panel> |
| | | {/* 添加标签 */} |
| | | <Panel header={this.state.dict['header.menu.tab']} key="4"> |
| | | <div className="search-element"> |
| | | {Source.tabItems.map((item, index) => { |
| | | return (<SourceElement key={index} content={item}/>) |
| | | })} |
| | | </div> |
| | | {this.state.config.tabs.length > 0 ? |
| | | <p className="config-btn-title"> |
| | | <Tooltip placement="topLeft" title="点击按钮,可完成或查看标签配置信息。"> |
| | | <Icon type="question-circle" /> |
| | | </Tooltip> |
| | | {this.state.dict['header.menu.tab.configurable']} |
| | | </p> : null |
| | | } |
| | | {this.state.config.tabs.map((item, index) => { |
| | | return ( |
| | | <div key={index}> |
| | | <Button |
| | | icon={item.icon} |
| | | style={{marginBottom: '10px'}} |
| | | onClick={() => this.setSubConfig(item, 'tab')} |
| | | >{item.label}</Button> |
| | | </div> |
| | | ) |
| | | })} |
| | | </Panel> |
| | | </Collapse> |
| | | </div> |