king
2022-09-13 b8cde0c39d7b6d58ceff3adf6dea3cb3118ea602
src/menu/components/table/base-table/index.jsx
@@ -21,7 +21,6 @@
const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
const PasteComponent = asyncIconComponent(() => import('@/menu/components/share/pastecomponent'))
// const LogComponent = asyncIconComponent(() => import('@/menu/components/share/logcomponent'))
const ColumnComponent = asyncComponent(() => import('./columns'))
class TableCardEditComponent extends Component {
@@ -32,14 +31,12 @@
  }
  state = {
    appType: sessionStorage.getItem('appType'),
    card: null,
    back: false
  }
  UNSAFE_componentWillMount () {
    const { card } = this.props
    const { appType } = this.state
    if (card.isNew) {
      let _card = {
@@ -124,17 +121,9 @@
        }
      }
      if (appType === 'mob') {
        _card.search = []
        _card.action = _card.action.filter(a => !a.origin)
      }
      this.updateComponent(_card)
    } else {
      let _card = fromJS(card).toJS()
      if (appType === 'mob') {
        _card.search = []
      }
      this.setState({
        card: _card
@@ -144,7 +133,6 @@
  componentDidMount () {
    MKEmitter.addListener('submitModal', this.handleSave)
    // MKEmitter.addListener('logButton', this.logButton)
    MKEmitter.addListener('completeSave', this.completeSave)
  }
@@ -160,7 +148,6 @@
      return
    }
    MKEmitter.removeListener('submitModal', this.handleSave)
    // MKEmitter.removeListener('logButton', this.logButton)
    MKEmitter.removeListener('completeSave', this.completeSave)
  }
@@ -298,17 +285,6 @@
    this.props.updateConfig(_card)
  }
  // logButton = (id, item) => {
  //   const { card } = this.state
  //   if (id !== card.uuid) return
  //   let btnlog = card.btnlog || []
  //   btnlog.push(item)
  //   this.updateComponent({...card, btnlog})
  // }
  changeStyle = () => {
    const { card } = this.state
@@ -385,13 +361,13 @@
  }
  setSubConfig = (item) => {
    const { card, appType } = this.state
    const { card } = this.state
    let btn = fromJS(item).toJS()
    if (btn.OpenType === 'pop' || btn.execMode === 'pop') {
      if (!btn.modal) {
        btn.modal = {
          setting: { title: btn.label, width: appType === 'mob' ? 100 : 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' },
          setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' },
          tables: [],
          groups: [],
          fields: []
@@ -499,13 +475,9 @@
  }
  render() {
    const { card, appType } = this.state
    const { card } = this.state
    let options = ['action', 'search', 'form', 'cols']
    let _style = resetStyle(card.style)
    if (appType === 'mob') {
      options = ['action', 'cols']
    }
    return (
      <div className="menu-normal-table-edit-box" style={_style} onClick={this.clickComponent} id={card.uuid}>
@@ -513,7 +485,7 @@
        <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
          <div className="mk-popover-control">
            <PlusOutlined className="plus" title="添加列" onClick={this.addColumns}/>
            {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="添加搜索" onClick={this.addSearch}/> : null}
            <PlusCircleOutlined className="plus" title="添加搜索" onClick={this.addSearch}/>
            <PlusSquareOutlined className="plus" title="添加按钮" onClick={this.addButton}/>
            <NormalForm title="表格设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}>
              <EditOutlined style={{color: '#1890ff'}} title="编辑"/>