| | |
| | | import SourceWrap from './dragsource' |
| | | import './index.scss' |
| | | |
| | | class CardChart extends Component { |
| | | class ModelSource extends Component { |
| | | state = { |
| | | menuOptions: null |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { MenuType } = this.props |
| | | let options = fromJS(menuOptions).toJS() |
| | | |
| | | options = options.filter(item => !item.forbid || !item.forbid.includes(MenuType)) |
| | | |
| | | this.setState({ |
| | | menuOptions: options |
| | | }) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | render() { |
| | | const { menuOptions } = this.state |
| | | |
| | | return ( |
| | | <div className="mob-card-source-box"> |
| | | {menuOptions.map((item, index) => (<SourceWrap key={index} content={item} />))} |
| | |
| | | } |
| | | } |
| | | |
| | | export default CardChart |
| | | export default ModelSource |