Explorar el Código

fix: 修复部分抽屉触发数据刷新时外部表格未进行对应行为

lanjianrong hace 4 años
padre
commit
58edc23520

+ 0 - 2
src/components/ModalStore/src/CreateProvider.tsx

@@ -82,8 +82,6 @@ const ModalStore: React.FC<ModalStoreProps> = props => {
   }
 
   function push(key: string, compState: any) {
-    console.log(key)
-
     const isDrawer = key.startsWith('D')
     // eslint-disable-next-line no-param-reassign
     key = isDrawer && compState?.dataId ? `${key}@${compState?.dataId}` : key

+ 1 - 0
src/models/refresh.js

@@ -24,6 +24,7 @@ export default {
     changState(state, action) {
       if (isObject(action.payload)) {
         const { main, target } = action.payload
+        console.log({ ...state, [main]: !state[main], [target]: !state[target] })
         return { ...state, [main]: !state[main], [target]: !state[target] }
       }
       if (isUnDef(state[action.payload])) {

+ 2 - 0
src/pages/Customer/Client/index.jsx

@@ -31,6 +31,7 @@ const Client = props => {
     loading,
     sourceList
   } = props
+  console.log(shouldUpdate)
 
   const { initialState: { permData } = { permData: {} } } = useModel('@@initialState')
   const tRef = useRef()
@@ -163,6 +164,7 @@ const Client = props => {
           <span
             onClick={() =>
               dispatchModal('D_COMPANY_DETAIL', {
+                updateKey: 'client',
                 dataId: record.companyId,
                 orderIds: state.orderIds
               })

+ 2 - 0
src/pages/Customer/Company/index.jsx

@@ -28,6 +28,7 @@ const Company = props => {
     loading
   } = props
 
+  console.log(shouldUpdate)
   const { initialState: { permData } = { permData: {} } } = useModel('@@initialState')
 
   const hasAddPerm = useAccess()?.validatePermByType('company_add')
@@ -58,6 +59,7 @@ const Company = props => {
       })
     }
     if (shouldUpdate) {
+      console.log('1111')
       tRef.current.reload()
     }
   }, [shouldUpdate])

+ 10 - 3
src/pages/Product/Lock/LockStore/index.jsx

@@ -207,7 +207,9 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       width: 150,
       render: (text, record) => (
         <span
-          onClick={() => dispatchModal('D_CLIENT_DETAIL', { dataId: record.clientId })}
+          onClick={() =>
+            dispatchModal('D_CLIENT_DETAIL', { updateKey: 'longle', dataId: record.clientId })
+          }
           className="text-primary cursor-pointer hover:text-hex-967bbd"
         >
           {text}
@@ -223,7 +225,7 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       render: (text, record) => (
         <span
           onClick={() =>
-            dispatchModal('D_COMPANY_DETAIL', { dataId: record.customerId, updateKey: 'longle' })
+            dispatchModal('D_COMPANY_DETAIL', { updateKey: 'longle', dataId: record.customerId })
           }
           className="text-primary cursor-pointer hover:text-hex-967bbd"
         >
@@ -237,7 +239,12 @@ const LockStore = ({ prodList = [], dispatch, shouldUpdate }) => {
       width: 80,
       render: (text, record) => (
         <span
-          onClick={() => dispatchModal('D_SOFTWARE_DETAIL', { dataId: record.responsibleId })}
+          onClick={() =>
+            dispatchModal('D_SOFTWARE_DETAIL', {
+              updateKey: 'longle',
+              dataId: record.responsibleId
+            })
+          }
           className="text-primary cursor-pointer hover:text-hex-967bbd"
         >
           {text}