import type { PageParam, PageResult } from '#/packages/effects/request/src';
|
|
import { requestClient } from '#/api/request';
|
|
export namespace HrmShiftApi {
|
/** 班次定义 */
|
export interface Shift {
|
id?: number;
|
name?: string;
|
/** 上班时间 HH:mm:ss */
|
startTime?: string;
|
/** 下班时间 HH:mm:ss */
|
endTime?: string;
|
/** 标准工时(小时) */
|
workHours?: number;
|
/** 是否跨天 */
|
crossDay?: boolean;
|
/** 标签颜色(十六进制) */
|
color?: string;
|
/** 状态:0-启用,1-禁用 */
|
status?: number;
|
remark?: string;
|
createTime?: string;
|
}
|
}
|
|
/** 查询班次分页列表 */
|
export function getShiftPage(params: PageParam) {
|
return requestClient.get<PageResult<HrmShiftApi.Shift>>('/hrm/shift/page', {
|
params,
|
});
|
}
|
|
/** 查询班次列表(启用状态,供排班页选择) */
|
export function getShiftList() {
|
return requestClient.get<HrmShiftApi.Shift[]>('/hrm/shift/list');
|
}
|
|
/** 查询班次详情 */
|
export function getShift(id: number) {
|
return requestClient.get<HrmShiftApi.Shift>(`/hrm/shift/get?id=${id}`);
|
}
|
|
/** 新增班次 */
|
export function createShift(data: HrmShiftApi.Shift) {
|
return requestClient.post('/hrm/shift/create', data);
|
}
|
|
/** 更新班次 */
|
export function updateShift(data: HrmShiftApi.Shift) {
|
return requestClient.put('/hrm/shift/update', data);
|
}
|
|
/** 删除班次 */
|
export function deleteShift(id: number) {
|
return requestClient.delete(`/hrm/shift/delete?id=${id}`);
|
}
|
|
/** 导出班次 Excel */
|
export function exportShift(params: any) {
|
return requestClient.download('/hrm/shift/export-excel', { params });
|
}
|