1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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 });
}