|
|
@@ -4,7 +4,7 @@ import { Input, Form, Row, Col } from 'antd'
|
|
|
import React, { useState, useEffect, useRef } from 'react'
|
|
|
import './index.less'
|
|
|
|
|
|
-const EditableFormItem = ({ children, dataIndex, record }) => {
|
|
|
+const EditableFormItem = ({ label, dataIndex, record }) => {
|
|
|
const [editing, setEditing] = useState(false)
|
|
|
const inputRef = useRef(null)
|
|
|
useEffect(() => {
|
|
|
@@ -40,12 +40,14 @@ const EditableFormItem = ({ children, dataIndex, record }) => {
|
|
|
<Input ref={inputRef} onPressEnter={save} onBlur={save} />
|
|
|
) : (
|
|
|
<div className="editable-cell-value-wrap" onClick={toggleEdit}>
|
|
|
- {children}
|
|
|
+ {record}
|
|
|
</div>
|
|
|
)
|
|
|
- return(
|
|
|
+ return (
|
|
|
<Row>
|
|
|
- <Col span={2} />
|
|
|
+ <Col span={2}>
|
|
|
+ <span className="zh-lh-32">{label}:</span>
|
|
|
+ </Col>
|
|
|
<Col span={22}>{cell}</Col>
|
|
|
</Row>
|
|
|
)
|