This commit is contained in:
lik
2026-11-06 19:51:44 +08:00
parent 6d90ebd07f
commit bfe451104d
696 changed files with 59664 additions and 1 deletions
+36
View File
@@ -0,0 +1,36 @@
import type { Employee } from '~/types/api'
import { request } from '~/utils/request'
export type EmployeeListQuery = {
page?: number
pageSize?: number
role?: string
status?: string
keyword?: string
}
export const employeeApi = {
list: (query: EmployeeListQuery) =>
request<{ employees: Employee[]; total: number; page: number; pageSize: number }>(
'/health/employee',
{ query }
),
create: (body: Record<string, unknown>) =>
request<{ employee: Employee }>('/health/employee', {
method: 'POST',
body,
}),
update: (id: string, body: Record<string, unknown>) =>
request<{ employee: Employee }>(`/health/employee/${id}`, {
method: 'PUT',
body,
}),
updateStatus: (id: string, status: string) =>
request<{ employee: Employee }>(`/health/employee/${id}/status`, {
method: 'PATCH',
body: { status },
}),
}