|
|
@@ -26,22 +26,28 @@ const EditableFormItem = ({ label, dataIndex, record, dataId, span = 24 }) => {
|
|
|
}
|
|
|
const save = async e => {
|
|
|
const { value = '' } = e.currentTarget
|
|
|
+ // debugger
|
|
|
toggleEdit()
|
|
|
- if (value === val) {
|
|
|
+ if (val === record) {
|
|
|
return
|
|
|
}
|
|
|
- setVal(value)
|
|
|
+
|
|
|
await handleConfirm(value)
|
|
|
}
|
|
|
|
|
|
+ const handleOnChange = e => {
|
|
|
+ const { value = '' } = e.currentTarget
|
|
|
+ setVal(value)
|
|
|
+ }
|
|
|
+
|
|
|
const cell = editing ? (
|
|
|
// <Form.Item name={dataIndex} noStyle initialValue={record}>
|
|
|
// <Input ref={inputRef} onPressEnter={save} onBlur={save} />
|
|
|
// </Form.Item>
|
|
|
- <Input ref={inputRef} onPressEnter={save} onBlur={save} value={val} />
|
|
|
+ <Input ref={inputRef} onPressEnter={save} onBlur={save} value={val} onChange={handleOnChange} />
|
|
|
) : (
|
|
|
<div className="editable-cell-value-wrap" onClick={toggleEdit}>
|
|
|
- {record}
|
|
|
+ {val}
|
|
|
</div>
|
|
|
)
|
|
|
|