Files
shanxia2.0/bx-mobile/src/hooks/useApplicantOptions.ts
T
zlwuandCursor 96dbd3ccbc feat(bx-mobile): complete P3 withdraw, proxy apply, history, and config pages
Align H5 with portal APIs for reimburse withdraw, approval history, applicant/date/title, and UUID-based expense/workflow config using portal user options.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-09 16:19:51 +08:00

22 lines
675 B
TypeScript

import { ref } from 'vue'
import { portalAdminApi } from '@/api/portalAdmin'
export function useApplicantOptions() {
const applicantOptions = ref<{ label: string; value: string }[]>([])
async function loadApplicantOptions() {
try {
const res: any = await portalAdminApi.userOptions()
const data = res?.data ?? res ?? []
applicantOptions.value = (Array.isArray(data) ? data : []).map((u: any) => ({
value: String(u.value ?? u.id ?? ''),
label: String(u.label ?? u.nickName ?? u.realName ?? u.username ?? ''),
}))
} catch {
applicantOptions.value = []
}
}
return { applicantOptions, loadApplicantOptions }
}