king
2022-08-19 3b103caa6bfc9ed410e67156c3ca1785bf1cecc9
src/menu/components/form/step-form/index.jsx
@@ -119,7 +119,6 @@
  }
  componentDidMount () {
    MKEmitter.addListener('submitStyle', this.getStyle)
    MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle)
  }
@@ -134,7 +133,6 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('submitStyle', this.getStyle)
    MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle)
  }
@@ -228,29 +226,11 @@
  changeStyle = () => {
    const { card } = this.state
    MKEmitter.emit('changeStyle', [card.uuid], ['height', 'background', 'border', 'padding', 'margin', 'shadow'], card.style)
    MKEmitter.emit('changeStyle', ['height', 'background', 'border', 'padding', 'margin', 'shadow'], card.style, this.getStyle)
  }
  getStyle = (comIds, style) => {
    const { card, group } = this.state
    if (comIds[0] === 'form') {
      let Index = group.fields.findIndex(n => n.uuid === comIds[1])
      if (Index === -1) return
      let _group = fromJS(group).toJS()
      _group.fields[Index].style = style
      this.updateGroup(_group)
      return
    }
    if (comIds.length !== 1 || comIds[0] !== card.uuid) return
    let _card = {...card, style}
  getStyle = (style) => {
    let _card = {...this.state.card, style}
    
    this.updateComponent(_card)
  }