king
2023-10-23 43b14af93c44ff89cf9f24a45b0451e04e6b473a
src/tabviews/custom/components/table/edit-table/normalTable/index.jsx
@@ -433,23 +433,23 @@
      if (col.editable === 'true' && !disabled) {
        if (editing) {
          if (!col.editType || col.editType === 'text') {
            return (<td className="editing_table_cell">
            return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell">
              <Input className={err ? 'has-error' : ''} title={err} id={col.uuid + record.$$uuid} defaultValue={value} onChange={(e) => this.onChange(e.target.value)} onPressEnter={this.enterPress} onBlur={this.onBlur}/>
            </td>)
          } else if (col.editType === 'date') {
            return (<td className="editing_table_cell">
            return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell">
              <CusDatePicker config={col} value={record[col.field] || null} open={true} onChange={this.onDateChange} blur={() => this.setState({editing: false})}/>
            </td>)
          } else if (col.editType === 'switch') {
            let _value = record[col.field] !== undefined ? record[col.field] : ''
            return (<td className="editing_table_cell">
            return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell">
              <CusSwitch config={col} defaultValue={_value} autoFocus={true} onChange={this.onSwitchChange} onBlur={this.switchBlur}/>
            </td>)
          } else {
            let _value = record[col.field] !== undefined ? record[col.field] : ''
            return (<td className="editing_table_cell">
            return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell">
              <Select
                showSearch
                defaultValue={_value}
@@ -465,7 +465,7 @@
            </td>)
          }
        } else {
          return (<td className={className + ' pointer'} style={style}>
          return (<td onClick={(e) => e.stopPropagation()} className={className + ' pointer'} style={style}>
            <div className="mk-mask" id={col.uuid + record.$$uuid} onClick={this.focus}></div>{content}
          </td>)
        }
@@ -536,11 +536,11 @@
          if (col.noValue === 'hide' && value === 0) {
            val = ''
          }
          return (<td className="editing_table_cell">
          return (<td onClick={(e) => e.stopPropagation()} className="editing_table_cell">
            <InputNumber className={err ? 'has-error' : ''} precision={col.decimal || 0} title={err} id={col.uuid + record.$$uuid} defaultValue={val} onChange={(val) => this.onChange(val)} onPressEnter={this.enterPress} onBlur={this.onBlur}/>
          </td>)
        } else {
          return (<td className={className + ' pointer'} style={style}>
          return (<td onClick={(e) => e.stopPropagation()} className={className + ' pointer'} style={style}>
            <div className="mk-mask" id={col.uuid + record.$$uuid} onClick={this.focus}></div>{content}
          </td>)
        }
@@ -840,6 +840,7 @@
    if (!col) return (<td {...resProps} className={className} style={style}/>)
    let disabled = false
    let editable = false
    if (col.ctrlField) {
      disabled = col.ctrlValue.includes(record[col.ctrlField])
    }
@@ -847,6 +848,7 @@
    let children = null
    if (col.type === 'text') {
      if (col.editable === 'true' && !disabled) {
        editable = true
        let _value = record[col.field] !== undefined ? record[col.field] : ''
        
        if (!col.editType || col.editType === 'text') {
@@ -932,6 +934,7 @@
      }
    } else if (col.type === 'number') {
      if (col.editable === 'true' && !disabled) {
        editable = true
        let _value = record[col.field] !== undefined ? record[col.field] : ''
        if (col.noValue === 'hide' && _value === 0) {
@@ -1105,6 +1108,10 @@
      )
    }
    if (editable) {
      return (<td onClick={(e) => e.stopPropagation()} className={'editing_all_table_cell ' + className} style={style}>{children}</td>)
    }
    return (<td className={'editing_all_table_cell ' + className} style={style}>{children}</td>)
  }
}
@@ -1200,13 +1207,15 @@
    
          if (item.field) {
            orderfields[item.uuid] = item.field
          } else if (item.sortField) {
            orderfields[item.uuid] = item.sortField
          }
          cell = {
            align: item.Align,
            dataIndex: item.uuid,
            title: item.editable === 'true' ? <span>{item.label}<EditOutlined className="system-color mk-edit-sign"/></span> : item.label,
            sorter: !!(item.field && item.IsSort === 'true'),
            sorter: (item.field || item.sortField) && item.IsSort === 'true',
            width: item.Width || 120,
            $type: item.type,
            onCell: record => ({