| | |
| | | |
| | | class MainAction extends Component { |
| | | static propTpyes = { |
| | | MenuNo: PropTypes.string, |
| | | MenuID: PropTypes.string, |
| | | actions: PropTypes.array, // 搜索条件列表 |
| | | dict: PropTypes.object, // 字典项 |
| | | fixed: PropTypes.any |
| | |
| | | this.formRef.handleReset() |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | |
| | | } |
| | | |
| | | // shouldComponentUpdate (nextProps, nextState) { |
| | | // console.log(!is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))) |
| | | // return true |
| | | // } |
| | | |
| | | render() { |
| | | if (this.props.fixed) { // 按钮是否固定在头部 |
| | | return ( |
| | | <Affix offsetTop={48}> |
| | | <div className="button-list" id={this.props.MenuNo + 'mainaction'}> |
| | | <div className="button-list" id={this.props.MenuID + 'mainaction'}> |
| | | {this.props.actions.map((item, index) => { |
| | | return ( |
| | | <Button |
| | | className={'mk-btn ' + item.CssClass} |
| | | icon={item.Icon} |
| | | className={'mk-btn mk-' + item.class} |
| | | icon={item.icon} |
| | | key={'action' + index} |
| | | onClick={() => {this.actionTrigger(item)}} |
| | | >{item.MenuName}</Button> |
| | | >{item.label}</Button> |
| | | ) |
| | | })} |
| | | {this.getModels()} |
| | |
| | | {this.props.actions.map((item, index) => { |
| | | return ( |
| | | <Button |
| | | className={'mk-btn ' + item.CssClass} |
| | | icon={item.Icon} |
| | | className={'mk-btn mk-' + item.class} |
| | | icon={item.icon} |
| | | key={'action' + index} |
| | | onClick={() => {this.actionTrigger(item)}} |
| | | >{item.MenuName}</Button> |
| | | >{item.label}</Button> |
| | | ) |
| | | })} |
| | | </div> |