king
2023-11-14 ef8acbf3859bd13e759fbb9b8ba726039c1fb2c5
src/components/normalform/modalform/mkTable/index.jsx
@@ -75,14 +75,14 @@
class EditableCell extends Component {
  getInput = (form) => {
    const { inputType, options, min, max, unlimit } = this.props
    const { inputType, options, min, max, unlimit, allowClear } = this.props
    if (inputType === 'number' && unlimit) {
      return <InputNumber onPressEnter={() => this.getValue(form)} />
    } else if (inputType === 'number') {
      return <InputNumber min={min} max={max} precision={0} onPressEnter={() => this.getValue(form)} />
    } else if (inputType === 'color') {
      return <ColorSketch />
      return <ColorSketch allowClear={allowClear}/>
    } else if (inputType === 'icon') {
      return <MkEditIcon allowClear/>
    } else if (inputType === 'select') {
@@ -392,6 +392,7 @@
  }
  render() {
    const { fixed } = this.props
    let components = {
      body: {
        cell: EditableCell
@@ -420,6 +421,7 @@
          unlimit: col.unlimit,
          required: col.required !== false ? true : false,
          title: col.title,
          allowClear: col.allowClear === true,
          editing: this.isEditing(record),
          onSave: this.execSave,
        }),
@@ -435,7 +437,7 @@
    return (
      <EditableContext.Provider value={this.props.form}>
        <div className="modal-editable-table">
          <Button disabled={!!this.state.editingKey} type="link" onClick={this.addline}><PlusOutlined style={{}}/></Button>
          {!fixed ? <Button disabled={!!this.state.editingKey} type="link" onClick={this.addline}><PlusOutlined style={{}}/></Button> : null}
          <DndProvider>
            <Table
              bordered