outaozhen 5 anni fa
parent
commit
4adbc30052

+ 12 - 5
src/components/EditableFormItem/index.jsx

@@ -1,6 +1,6 @@
 import consts from '@/basic/consts'
 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 './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}>
       {children}
     </div>
   )
+  return(
+    <Row>
+      <Col span={2} />
+      <Col span={22}>{cell}</Col>
+    </Row>
+  )
 }
 
 export default EditableFormItem

+ 1 - 1
src/pages/Customer/Contact/components/AddContact/index.jsx

@@ -13,7 +13,7 @@ const Addcontact = props => {
   function handleChange(value) {
     console.log(`selected ${value}`)
   }
-  useEffect(() => {}, [visible])
+  // useEffect(() => {}, [visible])
   return (
     <div>
       <Modal