| | |
| | | profVisible: false, // 验证信息编辑 |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('submitStyle', this.getStyle) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.props.group), fromJS(nextProps.group)) || !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('submitStyle', this.getStyle) |
| | | } |
| | | |
| | | handleStyle = (element) => { |
| | | const { group } = this.props |
| | | |
| | | let _style = element.style ? fromJS(element.style).toJS() : {} |
| | | let options = ['font', 'border', 'padding', 'margin', 'backgroundColor', 'width'] |
| | | |
| | |
| | | card: element |
| | | }) |
| | | |
| | | MKEmitter.emit('changeStyle', [group.uuid, element.type], options, _style) |
| | | MKEmitter.emit('changeStyle', options, _style, this.getStyle) |
| | | } |
| | | |
| | | getStyle = (comIds, style) => { |
| | | getStyle = (style) => { |
| | | const { card } = this.state |
| | | let group = fromJS(this.props.group).toJS() |
| | | |
| | | if (comIds.length !== 2 || comIds[0] !== group.uuid) return |
| | | |
| | | if (comIds[1] === 'prev') { |
| | | if (card.type === 'prev') { |
| | | group.prevButton.style = style |
| | | } else if (comIds[1] === 'submit') { |
| | | } else if (card.type === 'submit') { |
| | | group.subButton.style = style |
| | | } else if (comIds[1] === 'next') { |
| | | } else if (card.type === 'next') { |
| | | group.nextButton.style = style |
| | | } |
| | | |