first commit

This commit is contained in:
2024-04-08 21:34:02 +08:00
commit a41a7f32ab
223 changed files with 44629 additions and 0 deletions

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

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