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

View File

@@ -0,0 +1,22 @@
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<TreeNodeData[]>([])
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 }
}