chore: quick create route
This commit is contained in:
@@ -11,10 +11,12 @@ const useCreateRoute = (options?: { refresh: () => void }) => {
|
||||
action: PageActionType;
|
||||
currentData?: ListItem;
|
||||
title: string;
|
||||
realAction?: string;
|
||||
}>({
|
||||
open: false,
|
||||
action: PageAction.CREATE,
|
||||
currentData: undefined,
|
||||
realAction: undefined,
|
||||
title: ''
|
||||
});
|
||||
|
||||
@@ -32,6 +34,21 @@ const useCreateRoute = (options?: { refresh: () => void }) => {
|
||||
saveScrollHeight();
|
||||
};
|
||||
|
||||
const registerRoute = (
|
||||
action: PageActionType,
|
||||
title: string,
|
||||
currentData?: ListItem
|
||||
) => {
|
||||
setOpenModalStatus({
|
||||
open: true,
|
||||
action,
|
||||
realAction: 'register',
|
||||
currentData,
|
||||
title: title
|
||||
});
|
||||
saveScrollHeight();
|
||||
};
|
||||
|
||||
const closeModal = () => {
|
||||
setOpenModalStatus({
|
||||
open: false,
|
||||
@@ -46,6 +63,7 @@ const useCreateRoute = (options?: { refresh: () => void }) => {
|
||||
openRouteModalStatus: openModalStatus,
|
||||
setOpenRouteModalStatus: setOpenModalStatus,
|
||||
openRouteModal: openModal,
|
||||
registerRouteModal: registerRoute,
|
||||
closeRouteModal: closeModal
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user