提交
This commit is contained in:
1 parent
42ad896456
commit
6b2147aa46
66 files changed
+617071
-28046
No files matched your search
@@ -200,5 +200,16 @@ export function usePlRemotePersonnelOptions(options?: {
|
||||
loaded.value = false
|
||||
}
|
||||
|
||||
return { list, loading, loaded, search, onFocus, reset, invalidate }
|
||||
async function ensureById(personnelId: string) {
|
||||
if (!personnelId || list.value.some(item => item.id === personnelId)) return
|
||||
try {
|
||||
const res = await personnelApi.get(personnelId)
|
||||
const detail = pickBxData<Personnel>(res)
|
||||
if (detail?.id) list.value = [detail, ...list.value]
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
return { list, loading, loaded, search, onFocus, reset, invalidate, ensureById }
|
||||
}
|
||||
Reference in new issue
Block a user