Files
hzdyjs/web/src/api/zsjy/internship.ts
T
2025-08-17 22:39:20 +08:00

116 lines
2.5 KiB
TypeScript

import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {
InternshipInfoVO,
InternshipInfoQuery,
InternshipInfoAddBO,
InternshipInfoEditBO,
ClassInfoVO,
InternshipStatisticsVO
} from '@/api/zsjy/types';
import { TableDataInfo, R } from '@/api/types';
/**
* 查询实习信息列表
* @param query 查询参数
*/
export const listInternshipInfo = (query?: InternshipInfoQuery): AxiosPromise<TableDataInfo<InternshipInfoVO>> => {
return request({
url: '/zsjy/internship/list',
method: 'get',
params: query
});
};
/**
* 查询学生实习详细信息
* @param studentId 学生ID
*/
export const getInternshipInfo = (studentId: string | number): AxiosPromise<R<InternshipInfoVO>> => {
return request({
url: `/zsjy/internship/${studentId}`,
method: 'get'
});
};
/**
* 获取当前学生实习信息
* @returns 当前登录学生的实习信息
*/
export const getCurrentStudentInternship = (): AxiosPromise<R<InternshipInfoVO>> => {
return request({
url: '/zsjy/internship/current',
method: 'get'
});
};
/**
* 导出实习信息列表
* @param query 查询参数
*/
export const exportInternshipInfo = (query: InternshipInfoQuery) => {
return request({
url: '/zsjy/internship/export',
method: 'post',
data: query,
responseType: 'blob'
});
};
/**
* 获取班级信息列表(用于下拉选择)
*/
export const getClassOptions = (): AxiosPromise<R<ClassInfoVO[]>> => {
return request({
url: '/zsjy/internship/classes',
method: 'get'
});
};
/**
* 获取实习统计数据
* @param query 查询参数
*/
export const getInternshipStatistics = (query?: InternshipInfoQuery): AxiosPromise<R<InternshipStatisticsVO>> => {
return request({
url: '/zsjy/internship/statistics',
method: 'get',
params: query
});
};
/**
* 新增实习信息
* @param data 实习信息数据
*/
export const addInternshipInfo = (data: InternshipInfoAddBO): AxiosPromise<R<void>> => {
return request({
url: '/zsjy/internship',
method: 'post',
data: data
});
};
/**
* 修改实习信息
* @param data 实习信息数据
*/
export const updateInternshipInfo = (data: InternshipInfoEditBO): AxiosPromise<R<void>> => {
return request({
url: '/zsjy/internship',
method: 'put',
data: data
});
};
/**
* 删除实习信息
* @param internshipId 实习信息ID
*/
export const delInternshipInfo = (internshipId: string | number): AxiosPromise<R<void>> => {
return request({
url: `/zsjy/internship/${internshipId}`,
method: 'delete'
});
};