ソースを参照

修复客户重构抽屉内容不更新BUG

outaozhen 5 年 前
コミット
9e2cf1f3d3

+ 1 - 1
src/components/EditableForm/src/editableForm.jsx

@@ -5,7 +5,7 @@ import { useStore } from 'dva'
 
 const EditableForm = ({ dataSource, columns, type, tartgetUrl }) => {
   const store = useStore()
-  console.log(store)
+  // console.log(store)
   const newColumns = columns.map(item => {
     const newItem = { ...item }
 

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

@@ -17,7 +17,7 @@ const Addcontact = props => {
       title="添加联系人"
       trigger={
         <Button key="button" type="primary">
-          <IconPark type="plus" />
+          <IconPark type="plus" className="zh-mg-right-5" />
           联系人
         </Button>
       }

+ 1 - 1
src/pages/Customer/Contact/components/ContactDetail/ContanctTabList.jsx

@@ -8,7 +8,7 @@ import { useDispatch } from 'dva'
 // import { connect } from 'umi'
 
 const ContanctTabList = ({ clientId }) => {
-  console.log(clientId)
+  // console.log(clientId)
   const dispatch = useDispatch()
   const [state, setState] = useState({
     visible: false

+ 9 - 6
src/pages/Customer/Contact/components/ContactDetail/index.jsx

@@ -34,13 +34,16 @@ const PopContent = props => {
     }
   }
   useEffect(() => {
-    if (shouldUpdate) {
+    if (visible || shouldUpdate) {
       initData()
     }
-  }, [shouldUpdate])
-  useEffect(() => {
-    visible && initData()
-  }, [])
+    window.addEventListener('resize', () => {
+      setClientWidth(document.body.clientWidth * 0.7)
+    })
+    return () => {
+      window.removeEventListener('resize', () => {})
+    }
+  }, [visible, shouldUpdate])
   return (
     <Spin spinning={state.loading}>
       <div className="sheet-box">
@@ -51,7 +54,7 @@ const PopContent = props => {
             </div>
           </Col>
           <Col span={12}>
-            <ContanctTabList />
+            <ContanctTabList clientId={state.client.id} />
             <ContanctLowerList log={state.log} servicelist={state.serviceLog} />
           </Col>
         </Row>