|
|
@@ -1,11 +1,10 @@
|
|
|
import {
|
|
|
- TableSearchAction,
|
|
|
+ TableSearchContext,
|
|
|
createPageContext,
|
|
|
createSearchContext,
|
|
|
createTableSearchContext,
|
|
|
} from '@hooks';
|
|
|
import {GetWarehousingFlowingListParams, OriginalListParams} from '@models';
|
|
|
-import {Dispatch} from 'react';
|
|
|
|
|
|
export const pageContext = createPageContext();
|
|
|
export const searchContext = createSearchContext();
|
|
|
@@ -16,9 +15,8 @@ export const contextState = {
|
|
|
endTime: '',
|
|
|
};
|
|
|
export const context = createTableSearchContext(contextState);
|
|
|
-type ContextState = typeof contextState;
|
|
|
export function contextStateSelector(
|
|
|
- [{startTime, endTime, code}]: [ContextState, Dispatch<TableSearchAction<ContextState>>],
|
|
|
+ [{startTime, endTime, code}]: TableSearchContext<typeof contextState>,
|
|
|
): OriginalListParams<GetWarehousingFlowingListParams> {
|
|
|
return {startTime, endTime, wllbCode: code};
|
|
|
}
|