king
2022-03-03 3fc643dea8f8c957a95a86d250b5d8b06fb740e1
2022-03-03
6个文件已修改
700 ■■■■■ 已修改文件
src/menu/components/table/edit-table/index.jsx 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/options.jsx 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/index.jsx 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/cusSwitch/index.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx 476 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/edit-table/normalTable/index.scss 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/table/edit-table/index.jsx
@@ -310,7 +310,13 @@
  }
  updateWrap = (res) => {
    this.updateComponent({...this.state.card, wrap: res})
    let card = {...this.state.card, wrap: res}
    if (res.tableType) {
      card.switchable = true
    }
    this.updateComponent(card)
  }
  clickComponent = (e) => {
src/menu/components/table/edit-table/options.jsx
@@ -111,6 +111,18 @@
    },
    {
      type: 'radio',
      field: 'editType',
      label: '编辑模式',
      initval: wrap.editType || 'simple',
      tooltip: '可编辑表单是否全部放开。',
      required: false,
      options: [
        {value: 'simple', label: '单项'},
        {value: 'multi', label: '整体'},
      ]
    },
    {
      type: 'radio',
      field: 'cache',
      label: '缓存',
      initval: wrap.cache || 'true',
@@ -123,6 +135,18 @@
    },
    {
      type: 'radio',
      field: 'tableType',
      label: '表格属性',
      initval: wrap.tableType || '',
      required: false,
      options: [
        {value: '', label: '不可选'},
        {value: 'radio', label: '单选'},
        {value: 'checkbox', label: '多选'},
      ]
    },
    {
      type: 'radio',
      field: 'bordered',
      label: '边框',
      initval: wrap.bordered || 'true',
src/tabviews/custom/components/table/edit-table/index.jsx
@@ -36,6 +36,7 @@
    arr_field: '',        // 使用 sPC_Get_TableData 时的查询字段集
    setting: null,        // 页面全局设置:数据源、按钮及显示列固定、主键等
    data: [],             // 列表数据集
    selectedData: [],     // 已选表格数据
    total: 0,             // 总数
    loading: false,       // 列表数据加载中
    pageIndex: 1,         // 页码
@@ -162,6 +163,7 @@
    if (setting.supModule && !BID) { // BID 不存在时,不做查询
      this.setState({
        data: [],
        selectedData: [],
        total: 0
      })
      reset && MKEmitter.emit('resetTable', config.uuid, repage) // 列表重置
@@ -210,7 +212,84 @@
          item.$origin = true
          return item
        }),
        selectedData: [],
        total: result.total,
        loading: false
      })
    } else {
      this.setState({
        loading: false
      })
      notification.error({
        top: 92,
        message: result.message,
        duration: 10
      })
    }
  }
  /**
   * @description 获取单行数据
   */
  async loadmainLinedata (id) {
    const { mainSearch } = this.props
    const { setting, config, arr_field, search, orderBy, BID, pageIndex, pageSize, BData } = this.state
    let searches = fromJS(search).toJS()
    if (config.setting.useMSearch && mainSearch && mainSearch.length > 0) { // 主表搜索条件
      let keys = searches.map(item => item.key.toLowerCase())
      mainSearch.forEach(item => {
        if (!keys.includes(item.key.toLowerCase())) {
          searches.push(item)
        }
      })
    }
    this.setState({
      loading: true
    })
    let _orderBy = orderBy || setting.order
    let param = UtilsDM.getQueryDataParams(setting, arr_field, searches, _orderBy, pageIndex, pageSize, BID, this.props.menuType, id)
    let result = await Api.genericInterface(param)
    if (result.status) {
      let data = fromJS(this.state.data).toJS()
      let selectedData = fromJS(this.state.selectedData).toJS()
      if (result.data && result.data[0]) {
        let _data = result.data[0] || {}
        _data.$$uuid = _data[setting.primaryKey] || ''
        _data.$$BID = BID || ''
        _data.$$BData = BData || ''
        _data.$type = 'upt'
        _data.$origin = true
        try {
          data = data.map(item => {
            if (item.$$uuid === _data.$$uuid) {
              _data.key = item.key
              _data.$Index = item.$Index
              return _data
            } else {
              return item
            }
          })
          selectedData = selectedData.map(item => {
            if (_data.$$uuid === item.$$uuid) {
              return _data
            }
            return item
          })
        } catch (e) {
          console.warn('数据查询错误')
        }
        MKEmitter.emit('resetSelectLine', config.uuid, _data.$$uuid || '', _data)
      }
      this.setState({
        data,
        selectedData,
        loading: false
      })
    } else {
@@ -387,8 +466,13 @@
    const { config } = this.state
    if (config.uuid !== menuId) return
    if (id === 'empty') return
    this.reloadtable()
    if (!id) {
      this.reloadtable()
    } else {
      this.loadmainLinedata(id)
    }
  }
  resetParentParam = (MenuID, id, data) => {
@@ -413,12 +497,16 @@
   * @param {*} position   // 刷新位置
   * @param {*} btn        // 执行的按钮
   */
  refreshByButtonResult = (menuId, position, btn) => {
  refreshByButtonResult = (menuId, position, btn, id, lines) => {
    const { config, BID } = this.state
    if (config.uuid !== menuId) return
    this.reloadtable(btn)                                                      // 数据刷新
    if (position === 'line' && lines && lines.length === 1) {
      this.loadmainLinedata(lines[0].$$uuid)
    } else {
      this.reloadtable(btn)                                                    // 数据刷新
    }
    if (btn.syncComponentId && btn.syncComponentId !== config.uuid && btn.syncComponentId !== config.setting.supModule) {
      MKEmitter.emit('reloadData', btn.syncComponentId)                        // 同级标签刷新
@@ -467,7 +555,7 @@
  }
  render() {
    const { BID, setting, searchlist, actions, config, columns, BData, data } = this.state
    const { BID, setting, searchlist, actions, config, columns, BData, data, selectedData } = this.state
    return (
      <div className="custom-edit-table" style={config.style}>
@@ -481,7 +569,7 @@
          actions={actions}
          BData={BData}
          columns={config.columns}
          selectedData={[]}
          selectedData={selectedData}
        />
        <div className={'main-table-box ' + (!actions || actions.length === 0 ? 'no-action' : '')}>
          <MainTable
@@ -496,6 +584,7 @@
            lineMarks={config.lineMarks}
            loading={this.state.loading}
            refreshdata={this.refreshbytable}
            chgSelectData={(selects) => this.setState({selectedData: selects})}
            statFValue={this.state.statFValue}
          />
        </div>
src/tabviews/custom/components/table/edit-table/normalTable/cusSwitch/index.jsx
@@ -8,6 +8,7 @@
class ColorSketch extends Component {
  static propTpyes = {
    defaultValue: PropTypes.any,
    autoFocus: PropTypes.any,
    config: PropTypes.object,
    onChange: PropTypes.func
  }
@@ -36,10 +37,10 @@
  }
  render() {
    const { config } = this.props
    const { config, autoFocus } = this.props
    const { status } = this.state
    return (
      <Switch checkedChildren={config.openText} autoFocus={true} onBlur={this.props.onBlur} unCheckedChildren={config.closeText} checked={status} onChange={this.changeStatus} />
      <Switch checkedChildren={config.openText} autoFocus={autoFocus} onBlur={this.props.onBlur} unCheckedChildren={config.closeText} checked={status} onChange={this.changeStatus} />
    )
  }
}
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -270,8 +270,10 @@
  }
  render() {
    let { col, config, record, style, className } = this.props
    let { col, config, record, style, className, ...resProps } = this.props
    const { editing, value, err } = this.state
    if (!col) return (<td {...resProps} className={className} style={style}/>)
    let children = null
    if (col.type === 'text') {
@@ -314,7 +316,7 @@
          } else if (col.editType === 'switch') {
            let _value = record[col.field] !== undefined ? record[col.field] : ''
            return (<td className="editing_table_cell">
              <CusSwitch config={col} defaultValue={_value} onChange={this.onSwitchChange} onBlur={this.switchBlur}/>
              <CusSwitch config={col} defaultValue={_value} autoFocus={true} onChange={this.onSwitchChange} onBlur={this.switchBlur}/>
            </td>)
          } else {
            let _value = record[col.field] !== undefined ? record[col.field] : ''
@@ -332,7 +334,11 @@
            </td>)
          }
        } else {
          return (<td className={className + ' pointer'} style={style}><div className="mk-mask" onClick={this.focus}></div>{content}</td>)
          return (<td className={className + ' pointer'} style={style}>
            {col.addable ? <PlusCircleOutlined onClick={() => MKEmitter.emit('addRecord', col.tableId, {...record})} className="mk-editable mk-plus"/> : null}
            <div className="mk-mask" onClick={this.focus}></div>{content}
            {col.delable ? <DeleteOutlined onClick={() => MKEmitter.emit('delRecord', col.tableId, {...record})} className="mk-editable mk-del"/> : null}
          </td>)
        }
      } else {
        children = content
@@ -387,7 +393,11 @@
            {err ? <Tooltip title={err}><ExclamationCircleOutlined /></Tooltip> : null}
          </td>)
        } else {
          return (<td className={className + ' pointer'} style={style}><div className="mk-mask" onClick={this.focus}></div>{content}</td>)
          return (<td className={className + ' pointer'} style={style}>
            {col.addable ? <PlusCircleOutlined onClick={() => MKEmitter.emit('addRecord', col.tableId, {...record})} className="mk-editable mk-plus"/> : null}
            <div className="mk-mask" onClick={this.focus}></div>{content}
            {col.delable ? <DeleteOutlined onClick={() => MKEmitter.emit('delRecord', col.tableId, {...record})} className="mk-editable mk-del"/> : null}
          </td>)
        }
      } else {
        children = content
@@ -475,6 +485,338 @@
  }
}
class BodyAllCell extends React.Component {
  state = {
    err: null
  }
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props.record), fromJS(nextProps.record)) ||
      nextState.err !== this.state.err
  }
  componentDidMount () {
    MKEmitter.addListener('tdFocus', this.tdFocus)
  }
  /**
   * @description 组件销毁,清除state更新,清除快捷键设置
   */
  componentWillUnmount () {
    this.setState = () => {
      return
    }
    MKEmitter.removeListener('tdFocus', this.tdFocus)
  }
  tdFocus = (id) => {
    const { col, record } = this.props
    if (id !== col.uuid + record.$$uuid) return
    this.focus()
  }
  enterPress = () => {
    const { col, record } = this.props
    setTimeout(() => {
      if (col.enter === '$next') {
        MKEmitter.emit('nextLine', col, record.$$uuid)
      } else {
        MKEmitter.emit('tdFocus', col.enter + record.$$uuid)
      }
    }, 50)
  }
  focus = () => {
    const { col, record } = this.props
    if (col.editType === 'switch' || col.editType === 'select') {
      let node = document.getElementById(col.uuid + record.$$uuid)
      node && node.click()
    } else {
      let err = null
      let val = record[col.field] !== undefined ? record[col.field] : ''
      if (col.type === 'number') {
        val = +val
        if (isNaN(val)) {
          val = 0
        }
        if (typeof(col.max) === 'number' && val > col.max) {
          err = col.label + '最大为' + col.max
        } else if (typeof(col.min) === 'number' && val < col.min) {
          err = col.label + '最小为' + col.min
        }
      } else if (col.required === 'true' && !val) {
        err = '请填写' + col.label
      }
      this.setState({err}, () => {
        let node = document.getElementById(col.uuid + record.$$uuid)
        node && node.select()
      })
    }
  }
  onChange = (val) => {
    const { col, record } = this.props
    let err = null
    if (col.type === 'number') {
      val = +val
      if (isNaN(val)) {
        val = 0
      }
      if (typeof(col.max) === 'number' && val > col.max) {
        err = col.label + '最大为' + col.max
      } else if (typeof(col.min) === 'number' && val < col.min) {
        err = col.label + '最小为' + col.min
      }
    } else if (col.required === 'true' && !val) {
      err = '请填写' + col.label
    }
    this.setState({err})
    MKEmitter.emit('changeRecord', col.tableId, {...record, [col.field]: val})
  }
  onSwitchChange = (val) => {
    const { col, record } = this.props
    setTimeout(() => {
      if (col.enter === '$next') {
        MKEmitter.emit('nextLine', col, record.$$uuid)
      } else {
        MKEmitter.emit('tdFocus', col.enter + record.$$uuid)
      }
    }, 50)
    MKEmitter.emit('changeRecord', col.tableId, {...record, [col.field]: val})
  }
  onSelectChange = (val, option) => {
    const { col, record } = this.props
    let values = {}
    let _option = col.options.filter(m => m.key === option.key)[0]
    if (_option) {
      if (col.linkSubField) {
        col.linkSubField.forEach(m => {
          values[m] = _option[m] !== undefined ? _option[m] : ''
        })
      }
      if (col.editField) {
        values[col.field] = _option.label
        values[col.editField] = val
      } else {
        values[col.field] = val
      }
    }
    setTimeout(() => {
      if (col.enter === '$next') {
        MKEmitter.emit('nextLine', col, record.$$uuid)
      } else {
        MKEmitter.emit('tdFocus', col.enter + record.$$uuid)
      }
    }, 50)
    MKEmitter.emit('changeRecord', col.tableId, {...record, ...values})
  }
  render() {
    let { col, config, record, style, className } = this.props
    const { err } = this.state
    let children = null
    if (col.type === 'text') {
      if (col.editable === 'true') {
        let _value = record[col.field] !== undefined ? record[col.field] : ''
        if (!col.editType || col.editType === 'text') {
          children = (<>
            <Input id={col.uuid + record.$$uuid} defaultValue={_value} onChange={(e) => this.onChange(e.target.value)} onPressEnter={this.enterPress} onBlur={this.onBlur}/>
            {err ? <Tooltip title={err}><ExclamationCircleOutlined /></Tooltip> : null}
          </>)
        } else if (col.editType === 'switch') {
          children = (
            <CusSwitch config={col} autoFocus={false} defaultValue={_value} onChange={this.onSwitchChange} onBlur={() => {}}/>
          )
        } else {
          children = (<>
            <Select
              showSearch
              defaultValue={_value}
              id={col.uuid + record.$$uuid}
              onBlur={() => this.setState({editing: false})}
              filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
              onSelect={this.onSelectChange}
            >
              {col.options.map((item, i) => (<Select.Option key={item.key} disabled={item.$disabled} value={item.value}>{item.label}</Select.Option>))}
            </Select>
          </>)
        }
      } else {
        let content = ''
        if (record[col.field] !== undefined) {
          content = `${record[col.field]}`
        }
        if (content !== '') {
          if (col.textFormat === 'YYYY-MM-DD' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1])/.test(content)) {
            content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)}`
          } else if (col.textFormat === 'YYYY-MM-DD HH:mm:ss' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1]).([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]/.test(content)) {
            content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}`
          }
          content = (col.prefix || '') + content + (col.postfix || '')
        }
        if (col.marks) {
          let mark = getMark(col.marks, record, style)
          style = mark.style
          if (mark.icon) {
            if (mark.position === 'front') {
              content = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {content}</span>
            } else {
              content = <span>{content} <MkIcon style={{color: mark.color}} type={mark.icon} /></span>
            }
          }
        }
        children = content
      }
    } else if (col.type === 'number') {
      if (col.editable === 'true') {
        let _value = record[col.field] !== undefined ? record[col.field] : ''
        children = (<>
          <InputNumber id={col.uuid + record.$$uuid} defaultValue={_value} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress}/>
          {err ? <Tooltip title={err}><ExclamationCircleOutlined /></Tooltip> : null}
        </>)
      } else {
        let content = ''
        try {
          content = parseFloat(record[col.field])
          if (isNaN(content)) {
            content = ''
          }
        } catch (e) {
          content = ''
        }
        if (content !== '') {
          let decimal = col.decimal || 0
          if (col.format === 'percent') {
            content = content * 100
            decimal = decimal > 2 ? decimal - 2 : 0
          } else if (col.format === 'abs') {
            content = Math.abs(content)
          }
          content = content.toFixed(decimal)
          if (col.format === 'thdSeparator') {
            content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
          }
          content = col.prefix + content + col.postfix
        }
        if (col.marks) {
          let mark = getMark(col.marks, record, style)
          style = mark.style
          if (mark.icon) {
            if (mark.position === 'front') {
              content = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {content}</span>
            } else {
              content = <span>{content} <MkIcon style={{color: mark.color}} type={mark.icon} /></span>
            }
          }
        }
        children = content
      }
    } else if (col.type === 'textarea') {
      let content = ''
      if (record[col.field] !== undefined) {
        content = `${record[col.field]}`
      }
      if (content) {
        content = col.prefix + content + col.postfix
      }
      children = (
        <div>
          {content ? <Paragraph copyable ellipsis={{ rows: 3, expandable: true }}>{content}</Paragraph> : null }
        </div>
      )
    } else if (col.type === 'formula') {
      let content = col.formula
      Object.keys(record).forEach(key => {
        let reg = new RegExp('@' + key + '@', 'ig')
        content = content.replace(reg, record[key])
      })
      if (col.eval !== 'false') {
        try {
          // eslint-disable-next-line
          content = eval(content)
        } catch (e) {
          content = ''
        }
      }
      content = content === undefined ? '' : content
      if (content !== '') {
        content = `${col.prefix || ''}${content}${col.postfix || ''}`
        if (col.eval === 'false') {
          content = content.replace(/\n/ig, '<br/>').replace(/\s/ig, '&nbsp;')
          content = <span dangerouslySetInnerHTML={{__html: content}}></span>
        }
      }
      if (col.marks) {
        let mark = getMark(col.marks, record, style)
        style = mark.style
        if (mark.icon) {
          if (mark.position === 'front') {
            content = <span><MkIcon style={{color: mark.color}} type={mark.icon} /> {content}</span>
          } else {
            content = <span>{content} <MkIcon style={{color: mark.color}} type={mark.icon} /></span>
          }
        }
      }
      children = content
    } else if (col.type === 'custom') {
      style.padding = '0px'
      if (col.style) {
        style = {...style, ...col.style}
      }
      children = (
        <CardCellComponent data={record} cards={config} elements={col.elements}/>
      )
    } else if (col.type === 'operation') {
      style.padding = '0px 5px'
      children = (
        <Button type="link" style={{color: 'rgb(255, 77, 79)', backgroundColor: 'transparent'}} onClick={() => MKEmitter.emit('delRecord', col.tableId, {...record})}>删除</Button>
      )
    }
    return (<td className={'editing_all_table_cell ' + className} style={style}>{col.addable ? <PlusCircleOutlined onClick={() => MKEmitter.emit('addRecord', col.tableId, {...record})} className="mk-editable mk-plus"/> : null}{children}{col.delable ? <DeleteOutlined onClick={() => MKEmitter.emit('delRecord', col.tableId, {...record})} className="mk-editable mk-del"/> : null}</td>)
  }
}
class NormalTable extends Component {
  static propTpyes = {
    statFValue: PropTypes.any,       // 合计字段数据
@@ -495,6 +837,7 @@
    data: [],
    edData: [],
    edColumns: [],
    selectedRowKeys: [],  // 表格中选中行
    tableId: '',          // 表格ID
    pageIndex: 1,         // 初始页面索引
    pageSize: 10,         // 每页数据条数
@@ -551,7 +894,7 @@
        _copy.sorter = false
        if (item.editable === 'true') {
          _copy.title = <span>{item.label}<EditOutlined className="system-color" style={{position: 'absolute', bottom: '2px', right: '5px'}}/></span>
          _copy.title = <span>{item.label}<EditOutlined className="system-color mk-edit-sign"/></span>
        }
        edColumns.push(_copy)
      }
@@ -617,6 +960,7 @@
    })
    if (editable === 'true' && data && data.length > 0) {
      this.setState({editable: 'false'})
      setTimeout(() => {
        this.pickupChange()
      }, 200)
@@ -647,6 +991,7 @@
    if (!is(fromJS(this.props.data), fromJS(nextProps.data))) {
      this.setState({data: nextProps.data || []})
      if (this.state.editable === 'true' && !this.state.pickup) {
        this.setState({editable: 'false'})
        setTimeout(() => {
          this.pickupChange()
        }, 200)
@@ -805,21 +1150,28 @@
      return item
    })
    this.setState({edColumns: []}, () => {
    if (this.state.pickup) {
      this.setState({
        pickup: false
      }, () => {
        this.setState({pickup: true, edColumns: _edColumns})
      })
    } else {
      this.setState({edColumns: _edColumns})
    })
    }
  }
  
  nextLine = (col, index) => {
  nextLine = (col, uuid) => {
    const { setting } = this.props
    const { edData, initEditLine, tableId } = this.state
    if (col.tableId !== tableId) return
    index = +index
    let index = edData.findIndex(item => item.$$uuid === uuid)
    let next = edData[index + 1] || null
    if (index < edData.length && initEditLine) {
      MKEmitter.emit('tdFocus', initEditLine.uuid + (index + 1))
    if (next && initEditLine) {
      MKEmitter.emit('tdFocus', initEditLine.uuid + next.$$uuid)
    } else if (col.footEnter === 'add' && setting.addable === 'true') {
      setTimeout(() => {
        this.plusLine()
@@ -1205,12 +1557,82 @@
    })
  }
  /**
   *
   */
  onSelectChange = selectedRowKeys => {
    this.setState({ selectedRowKeys })
    let activeId = ''
    if (selectedRowKeys.length > 0) {
      activeId = selectedRowKeys.slice(-1)[0]
    }
    this.changedata(activeId)
    this.selectdata(selectedRowKeys)
  }
  /**
   * @description 点击整行,触发切换, 判断是否可选,单选或多选,进行对应操作
   */
  changeRow = (index) => {
    const { setting } = this.props
    if (!setting.tableType || this.state.pickup) return
    let newkeys = fromJS(this.state.selectedRowKeys).toJS()
    let activeId = ''
    if (setting.tableType === 'radio') {
      activeId = index
      newkeys = [index]
      this.setState({ selectedRowKeys: newkeys })
    } else {
      if (newkeys.includes(index)) {
        newkeys = newkeys.filter(item => item !== index)
        if (newkeys.length > 0) {
          activeId = newkeys.slice(-1)[0]
        }
      } else {
        activeId = index
        newkeys.push(index)
      }
      this.setState({ selectedRowKeys: newkeys })
    }
    this.changedata(activeId)
    this.selectdata(newkeys)
  }
  changedata = (id) => {
    const { MenuID } = this.props
    const { data } = this.state
    let _data = ''
    if (id) {
      _data = data.filter(item => item.$$uuid === id)[0] || ''
    }
    MKEmitter.emit('resetSelectLine', MenuID, id, _data)
  }
  selectdata = (keys) => {
    const { data } = this.state
    let _data = data.filter(item => keys.includes(item.$$uuid))
    this.props.chgSelectData(_data)
  }
  changeTable = (pagination, filters, sorter) => {
    const { orderfields } = this.state
    this.setState({
      pageIndex: pagination.current,
      pageSize: pagination.pageSize
      pageSize: pagination.pageSize,
      selectedRowKeys: [],
    })
    sorter.field = orderfields[sorter.field] || ''
@@ -1223,15 +1645,20 @@
    if (id !== MenuID) return
    if (repage !== 'false') {
    if (repage === 'false') {
      this.setState({
        pageIndex: 1
        selectedRowKeys: [],
      })
    } else {
      this.setState({
        pageIndex: 1,
        selectedRowKeys: [],
      })
    }
  }
  pickupChange = () => {
    const { submit } = this.props
    const { submit, MenuID } = this.props
    const { data } = this.state
    let pickup = !this.state.pickup
@@ -1264,6 +1691,7 @@
        onCancel() {}
      })
    } else {
      pickup && MKEmitter.emit('resetSelectLine', MenuID, '', '')
      this.setState({
        data: [],
        edData: [],
@@ -1281,12 +1709,12 @@
  render() {
    const { setting, statFValue, lineMarks, submit } = this.props
    const { pickup, tableId, data, edData, columns, edColumns, loading, pageOptions } = this.state
    const { pickup, tableId, data, edData, columns, edColumns, loading, pageOptions, selectedRowKeys } = this.state
    const components = {
      body: {
        row: BodyRow,
        cell: BodyCell
        cell: setting.editType !== 'multi' || !pickup ? BodyCell : BodyAllCell
      }
    }
@@ -1298,6 +1726,16 @@
      _data = edData
      _data = _data.filter(item => !item.$deleted)
      _columns = edColumns
    }
    // 设置表格选择属性:单选、多选、不可选
    let rowSelection = null
    if (setting.tableType && !pickup) {
      rowSelection = {
        selectedRowKeys,
        type: (setting.tableType === 'radio') ? 'radio' : 'checkbox',
        onChange: this.onSelectChange
      }
    }
    let _pagination = false
@@ -1330,6 +1768,7 @@
          style={setting.style}
          size={setting.size || 'middle'}
          bordered={setting.bordered !== 'false'}
          rowSelection={rowSelection}
          columns={_columns}
          dataSource={_data}
          loading={this.props.loading}
@@ -1337,7 +1776,8 @@
          onRow={(record, index) => {
            return {
              lineMarks,
              data: record
              data: record,
              onClick: () => {this.changeRow(record.$$uuid)},
            }
          }}
          onChange={this.changeTable}
src/tabviews/custom/components/table/edit-table/normalTable/index.scss
@@ -18,6 +18,12 @@
    color: inherit;
    font-size: inherit;
  }
  .mk-edit-sign {
    position: absolute;
    bottom: 2px;
    right: 5px;
    opacity: 0.7;
  }
  table {
    max-width: 100%;
@@ -135,28 +141,7 @@
      }
    }
  }
  .ant-input {
    border: none;
    box-shadow: none!important;
    height: auto;
    border-radius: 0;
  }
  .ant-input-number {
    border: none;
    box-shadow: none!important;
    height: auto;
    border-radius: 0;
    position: unset;
    .ant-input-number-handler-wrap {
      display: none;
    }
    .ant-input-number-input {
      border-radius: 0;
      padding: 0;
      height: auto;
    }
  }
  .editing_table_cell {
    .ant-input {
      padding: 0px;
@@ -165,7 +150,10 @@
      left: 0px;
      right: 0px;
      bottom: 0px;
      border: 1px solid #1890ff;
      border: 1px solid var(--antd-wave-shadow-color);
      height: auto;
      border-radius: 0;
      box-shadow: none!important;
    }
    .ant-select {
      padding: 0px;
@@ -183,18 +171,46 @@
        }
      }
    }
    .ant-input-number-input {
      position: absolute;
      top: 0px;
      left: 0px;
      right: 0px;
      bottom: 0px;
      border: 1px solid #1890ff;
    .ant-input-number {
      height: auto;
      border-radius: 0;
      position: unset;
      border: none;
      box-shadow: none!important;
      .ant-input-number-handler-wrap {
        display: none;
      }
      .ant-input-number-input {
        border-radius: 0;
        padding: 0;
        height: auto;
        position: absolute;
        top: 0px;
        left: 0px;
        right: 0px;
        bottom: 0px;
        border: 1px solid var(--antd-wave-shadow-color);
      }
    }
    .anticon {
    .anticon-exclamation-circle {
      color: #ff4d4f;
      position: absolute;
      right: 3px;
      top: calc(50% - 8px);
    }
  }
  .editing_all_table_cell {
    .ant-select {
      width: 100%;
    }
    .ant-input-number-handler-wrap {
      display: none;
    }
    .anticon-exclamation-circle {
      color: #ff4d4f;
      position: absolute;
      right: 13px;
      top: calc(50% - 8px);
    }
  }
@@ -214,12 +230,11 @@
  }
  .mk-editable {
    position: absolute;
    display: inline-block;
    top: calc(50% - 13px);
    display: none;
    top: calc(50% - 18px);
    cursor: pointer;
    padding: 10px 5px;
    opacity: 0;
    // transition: opacity 0.3s 0.1s, left 0.1s;
  }
  tr:hover {
    .mk-editable {
@@ -234,13 +249,11 @@
  }
  .mk-plus {
    left: 0px;
    // left: -25px;
    color: rgb(38, 194, 129);
    padding-right: 10px;
  }
  .mk-del {
    right: 0px;
    // right: -25px;
    color: rgb(255, 77, 79);
    padding-left: 10px;
  }
@@ -280,6 +293,9 @@
  .ant-table-placeholder {
    display: none;
  }
  .mk-editable {
    display: inline-block;
  }
}
.edit-custom-table:not(.fixed-height) {
  .ant-table-body::-webkit-scrollbar {