Selaa lähdekoodia

fix: 单位同步地址按钮加上弹窗打开状态不能再点击

outaozhen 4 vuotta sitten
vanhempi
commit
36e6963e53

+ 5 - 3
src/pages/Customer/Company/components/CompanyDetail/SyncClient.jsx

@@ -9,6 +9,7 @@ const SyncClient = ({ customer, client }) => {
   const dispatch = useDispatch()
   const [state, setState] = useState({
     visible: false,
+    disable: false,
     selectedKeys: null,
     checkValues: ['district', 'address']
   })
@@ -81,14 +82,15 @@ const SyncClient = ({ customer, client }) => {
     }
   ]
 
-  const { checkValues, visible } = state
+  const { checkValues, visible, disable } = state
   return (
     <>
       <Button
         size="small"
         ghost
         type="primary"
-        onClick={() => setState({ ...state, visible: true })}>
+        disabled={disable}
+        onClick={() => setState({ ...state, visible: true, disable: true })}>
         <Copy theme="two-tone" fill={['#333', '#886ab5']} />
         <span className="ml-1">同步地址信息</span>
         {/* <div className="flex items-center justify-center">
@@ -100,7 +102,7 @@ const SyncClient = ({ customer, client }) => {
         title={`同步 ${customer.companyName} 信息`}
         getContainer={false}
         visible={visible}
-        onCancel={() => setState({ ...state, visible: false })}
+        onCancel={() => setState({ ...state, visible: false, disable: false })}
         onOk={handleOnConfirm}>
         <div className="rounded-3 p-4 mb-2 pt-0">
           <Checkbox.Group

+ 0 - 3
src/pages/Customer/Company/components/CompanyDetail/TabList.jsx

@@ -36,9 +36,6 @@ const CompanyTabList = ({
     params: {},
     visible: false
   })
-  // const [tablistHeight, setTablistHeight] = useState(
-  //   (document.body.tablistHeight - 48 - 92 - 64) / 2
-  // )
   const [clientHeight] = useState((document.body.clientHeight - 48 - 92 - 64 - 120) / 2)
   // console.log(clientHeight)
   // 展示drawer