king
2022-01-07 c1f9e05741e64087ebbfa5e1185bfd0beeb4eeb5
src/menu/components/table/normal-table/index.jsx
@@ -151,6 +151,7 @@
    MKEmitter.addListener('submitStyle', this.getStyle)
    MKEmitter.addListener('submitModal', this.handleSave)
    MKEmitter.addListener('logButton', this.logButton)
    MKEmitter.addListener('completeSave', this.completeSave)
  }
  shouldComponentUpdate (nextProps, nextState) {
@@ -167,6 +168,22 @@
    MKEmitter.removeListener('submitStyle', this.getStyle)
    MKEmitter.removeListener('submitModal', this.handleSave)
    MKEmitter.removeListener('logButton', this.logButton)
    MKEmitter.removeListener('completeSave', this.completeSave)
  }
  completeSave = () => {
    const { card } = this.state
    if (card.isNew) {
      let item = fromJS(card).toJS()
      item.search = item.search.filter(a => !a.origin)
      item.action = item.action.filter(a => !a.origin)
      item.cols = item.cols.filter(a => !a.origin)
      delete item.isNew
      this.setState({card: item}, () => { MKEmitter.emit('revert') })
    }
  }
  loopCol = (col) => {
@@ -387,9 +404,16 @@
  }
  getWrapForms = () => {
    const { wrap, action, columns } = this.state.card
    const { wrap, action, columns, cols } = this.state.card
    return getWrapForm(wrap, action, columns)
    let _actions = [...action]
    cols.forEach(col => {
      if (col.type !== 'action') return
      _actions.push(...col.elements)
    })
    return getWrapForm(wrap, _actions, columns)
  }
  updateWrap = (res) => {