first commit

This commit is contained in:
zc
2026-02-26 17:31:18 +08:00
commit f1b87df6ca
803 changed files with 297148 additions and 0 deletions

21
src/hooks/app/useMenu.ts Normal file
View File

@@ -0,0 +1,21 @@
import { ref } from 'vue'
import type { TreeNodeData } from '@arco-design/web-vue'
import { listMenuTree } from '@/apis'
/** 菜单模块 */
export function useMenu(options?: { onSuccess?: () => void }) {
const loading = ref(false)
const menuList = ref<TreeNodeData[]>([])
const getMenuList = async (name?: string) => {
try {
loading.value = true
const res = await listMenuTree({ description: name })
menuList.value = res.data
options?.onSuccess && options.onSuccess()
} finally {
loading.value = false
}
}
return { menuList, getMenuList, loading }
}