chore: quick create route

This commit is contained in:
jialin
2026-02-12 12:20:05 +08:00
parent b21fe0ac4c
commit 07664b5f22
21 changed files with 202 additions and 47 deletions
@@ -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
};
};