Files
admin-vben5/apps/web-antd/src/api/property/attendanceManagement/attendanceGroupSettings/index.ts
dev_ljl d84904e20c
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
1、考勤组删除
2025-07-27 17:42:14 +08:00

75 lines
1.8 KiB
TypeScript

import type { GroupVO, GroupForm, GroupQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询考勤组基本信息列表
* @param params
* @returns 考勤组基本信息列表
*/
export function groupList(params?: GroupQuery) {
return requestClient.get<PageResult<GroupVO>>('/property/group/list', { params });
}
/**
* 导出考勤组基本信息列表
* @param params
* @returns 考勤组基本信息列表
*/
export function groupExport(params?: GroupQuery) {
return commonExport('/property/group/export', params ?? {});
}
/**
* 查询考勤组基本信息详情
* @param id id
* @param attendanceType 类型
* @returns 考勤组基本信息详情
*/
export function groupInfo(id: ID,attendanceType:string) {
let params={attendanceType}
return requestClient.get<GroupVO>(`/property/group/${id}`,{params});
}
/**
* 新增考勤组基本信息
* @param data
* @returns void
*/
export function groupAdd(data: GroupForm) {
return requestClient.postWithMsg<void>('/property/group', data);
}
/**
* 更新考勤组基本信息
* @param data
* @returns void
*/
export function groupUpdate(data: GroupForm) {
return requestClient.putWithMsg<void>('/property/group', data);
}
/**
* 删除考勤组基本信息
* @param id id
* @param attendanceType 类型
* @returns void
*/
export function groupRemove(id: ID | IDS,attendanceType:string) {
let params={attendanceType}
return requestClient.deleteWithMsg<void>(`/property/group/${id}`,{params});
}
/**
* 获取节假日数据
* @param year
*/
export async function getHoliday(year: string) {
const response = await fetch(`https://timor.tech/api/holiday/year/${year}`);
return response.json();
}