|
@@ -1,6 +1,6 @@
|
|
|
import consts from '@/basic/consts'
|
|
import consts from '@/basic/consts'
|
|
|
import { apiUpdateContract } from '@/services/contact'
|
|
import { apiUpdateContract } from '@/services/contact'
|
|
|
-import { Input, Form } from 'antd'
|
|
|
|
|
|
|
+import { Input, Form, Row, Col } from 'antd'
|
|
|
import React, { useState, useEffect, useRef } from 'react'
|
|
import React, { useState, useEffect, useRef } from 'react'
|
|
|
import './index.less'
|
|
import './index.less'
|
|
|
|
|
|
|
@@ -33,15 +33,22 @@ const EditableFormItem = ({ children, dataIndex, record }) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return editing ? (
|
|
|
|
|
- <Form.Item name={dataIndex} noStyle initialValue={record}>
|
|
|
|
|
- <Input ref={inputRef} onPressEnter={save} onBlur={save} />
|
|
|
|
|
- </Form.Item>
|
|
|
|
|
|
|
+ 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} />
|
|
|
) : (
|
|
) : (
|
|
|
<div className="editable-cell-value-wrap" onClick={toggleEdit}>
|
|
<div className="editable-cell-value-wrap" onClick={toggleEdit}>
|
|
|
{children}
|
|
{children}
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|
|
|
|
|
+ return(
|
|
|
|
|
+ <Row>
|
|
|
|
|
+ <Col span={2} />
|
|
|
|
|
+ <Col span={22}>{cell}</Col>
|
|
|
|
|
+ </Row>
|
|
|
|
|
+ )
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export default EditableFormItem
|
|
export default EditableFormItem
|