| 
						
						
						
					 | 
				
				 | 
				
					@ -1,5 +1,5 @@ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import systemServ from '@/service/system.ts' | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { IPage, IPageResult, MenuItem } from '@/types' | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { IApiResult, IPage, MenuItem } from '@/types' | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { IMenu } from '@/types/menus' | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { atomWithMutation, atomWithQuery, queryClientAtom } from 'jotai-tanstack-query' | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import { atom, createStore } from 'jotai' | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -24,15 +24,15 @@ export const menuPageAtom = atom<IPage>({}) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					const store = createStore() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					export const menuDataAtom = atomWithQuery<any, IPageResult<IMenu>>((get) => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					export const menuDataAtom = atomWithQuery((get) => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  return { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    queryKey: [ 'menus', get(menuPageAtom) ], | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    queryFn: async ({ queryKey: [ , page ] }) => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      return await systemServ.menus.list(page) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    }, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    select: (data) => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      return data.rows ?? [] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    select: (res) => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      return res.data.rows ?? [] | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					}) | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -49,7 +49,7 @@ export const byIdMenuAtom = atomWithQuery((get) => ({ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					})) | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					export const saveOrUpdateMenuAtom = atomWithMutation<any, IMenu>((get) => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					export const saveOrUpdateMenuAtom = atomWithMutation<IApiResult, IMenu>((get) => { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  return { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    mutationKey: [ 'updateMenu', get(selectedMenuIdAtom) ], | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |