king
2022-11-07 af6486b3629d23e426ce85b87dbc20dfa15b1afe
src/menu/components/table/base-table/index.jsx
@@ -56,7 +56,7 @@
        setting: { interType: 'system' },
        wrap: { bordered: 'true', tableType: 'checkbox', show: 'true' },
        style: {},
        headerStyle: { fontSize: '16px', borderBottomWidth: '1px', borderBottomColor: '#e8e8e8' },
        headerStyle: {},
        columns: [],
        cols: [
          { origin: true, uuid: Utils.getuuid(), Align: 'left', label: 'label1', field: '', Hide: 'false', type: 'text', Width: 120 },
@@ -65,6 +65,10 @@
        ],
        scripts: [],
        isNew: true
      }
      if (card.name === '主表') {
        _card.setting.supModule = ['empty']
      }
      this.updateComponent(_card)
@@ -78,7 +82,6 @@
  }
  componentDidMount () {
    MKEmitter.addListener('submitModal', this.handleSave)
    MKEmitter.addListener('completeSave', this.completeSave)
  }
@@ -93,7 +96,6 @@
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('submitModal', this.handleSave)
    MKEmitter.removeListener('completeSave', this.completeSave)
  }
@@ -262,26 +264,6 @@
    }
  }
  handleSave = (_cards, btn, modal) => {
    let card = fromJS(this.state.card).toJS()
    if (card.uuid !== _cards.uuid) return
    let _index = card.action.findIndex(cell => cell.uuid === btn.uuid)
    if (_index === -1) return
    card.action = card.action.map(cell => {
      if (cell.uuid === btn.uuid) {
        cell.modal = modal
      }
      return cell
    })
    this.updateComponent(card)
  }
  getWrapForms = () => {
    const { wrap, action, columns, cols } = this.state.card
@@ -317,7 +299,7 @@
    config.absFields = []
    config.cols.forEach(col => {
      if (!col.field) return
      if (['text', 'picture', 'textarea'].includes(col.type)) {
      if (['text', 'picture', 'video', 'textarea'].includes(col.type)) {
        config.columns.push({
          datatype: `Nvarchar(${col.fieldlength || 50})`,
          field: col.field,
@@ -381,7 +363,7 @@
            <NormalForm title="表格设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}>
              <EditOutlined style={{color: '#1890ff'}} title="编辑"/>
            </NormalForm>
            <CopyComponent type="normaltable" card={card}/>
            <CopyComponent type="basetable" card={card}/>
            <PasteComponent config={card} options={options} updateConfig={this.updateComponent} />
            <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/>
            <SettingComponent config={card} updateConfig={this.updateComponent} />