king
2022-08-19 3b103caa6bfc9ed410e67156c3ca1785bf1cecc9
src/menu/components/form/formaction/index.jsx
@@ -32,10 +32,6 @@
    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))
  }
@@ -47,12 +43,9 @@
    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']
@@ -60,19 +53,18 @@
      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
    }