import React, {Component} from 'react'
|
import PropTypes from 'prop-types'
|
// import { is, fromJS } from 'immutable'
|
import { Button, Affix } from 'antd'
|
import './index.scss'
|
|
class MainAction extends Component {
|
static propTpyes = {
|
actions: PropTypes.array, // 搜索条件列表
|
dict: PropTypes.object // 字典项
|
}
|
|
state = {
|
|
}
|
|
actionTrigger = (item) => {
|
console.log(item)
|
}
|
|
UNSAFE_componentWillMount () {
|
|
}
|
|
// shouldComponentUpdate (nextProps, nextState) {
|
// console.log(!is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)))
|
// return true
|
// }
|
|
render() {
|
return (
|
<Affix offsetTop={48}>
|
<div className="button-list">
|
{this.props.actions.map((item, index) => {
|
return (
|
<Button
|
className={'mk-btn ' + item.CssClass}
|
icon={item.Icon}
|
key={'action' + index}
|
onClick={() => {this.actionTrigger(item)}}
|
>{item.MenuName}</Button>
|
)
|
})}
|
</div>
|
</Affix>
|
)
|
}
|
}
|
|
export default MainAction
|