import { ref } from 'vue' import type { TreeNodeData } from '@arco-design/web-vue' import { listBranchTree } from '@/apis' /** 部门模块 */ export function useBranch(options?: { onSuccess?: () => void }) { const loading = ref(false) const branchList = ref([]) const getBranchList = async (name?: string) => { try { loading.value = true const res = await listBranchTree({ description: name }) branchList.value = res.data // eslint-disable-next-line ts/no-unused-expressions options?.onSuccess && options.onSuccess() } finally { loading.value = false } } return { branchList, getBranchList, loading } }