forked from liweijie/education
111 lines
2.4 KiB
JavaScript
111 lines
2.4 KiB
JavaScript
import request from '@/utils/request'
|
||
|
||
// 人才培养方案(专业表 ZYB /training)
|
||
// 接口依据:TrainingProgramController(前端 baseURL 为 /api,此处不重复 /api 前缀)
|
||
|
||
/**
|
||
* 新增培养方案(专业)
|
||
* POST /training/add
|
||
* 请求体(ZYB):zydh/zymc/zydm/pxcc/pxlx 必填;
|
||
* 主键 zydh 需手动传入(留空时后端自动生成 UUID,后端同时置 ty=false、qysj=当前时间)
|
||
*/
|
||
export function addTraining(data) {
|
||
return request({
|
||
url: '/training/add',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
/**
|
||
* 停用(逻辑删除)培养方案
|
||
* POST /training/disable?zydh=
|
||
* @param zydh 专业代号(必填)
|
||
*/
|
||
export function disableTraining(zydh) {
|
||
return request({
|
||
url: '/training/disable',
|
||
method: 'post',
|
||
params: { zydh }
|
||
})
|
||
}
|
||
|
||
/**
|
||
* 更新培养方案
|
||
* POST /training/update
|
||
* 请求体(ZYB):zydh 必传
|
||
*/
|
||
export function updateTraining(data) {
|
||
return request({
|
||
url: '/training/update',
|
||
method: 'post',
|
||
data
|
||
})
|
||
}
|
||
|
||
/**
|
||
* 根据专业代号查询培养方案详情
|
||
* GET /training/get?zydh=
|
||
* @param zydh 专业代号
|
||
*/
|
||
export function getTraining(zydh) {
|
||
return request({
|
||
url: '/training/get',
|
||
method: 'get',
|
||
params: { zydh }
|
||
})
|
||
}
|
||
|
||
/**
|
||
* 分页条件查询培养方案列表
|
||
* GET /training/list
|
||
* 查询参数:zymc(模糊)、zydm(模糊)、pxlx(精确)、pxcc(精确)、pageNum、pageSize
|
||
* 返回:PageResult<ZYB>(records/total)
|
||
*/
|
||
export function listTraining(params) {
|
||
return request({
|
||
url: '/training/list',
|
||
method: 'get',
|
||
params
|
||
})
|
||
}
|
||
|
||
/**
|
||
* 导出培养方案到 Excel(返回 Blob)
|
||
* GET /training/export
|
||
*/
|
||
export function exportTrainingProgram() {
|
||
return request({
|
||
url: '/training/export',
|
||
method: 'get',
|
||
responseType: 'blob'
|
||
})
|
||
}
|
||
|
||
/**
|
||
* 下载培养方案导入模板(返回 Blob)
|
||
* GET /download/training-program
|
||
*/
|
||
export function downloadTrainingProgramTemplate() {
|
||
return request({
|
||
url: '/download/training-program',
|
||
method: 'get',
|
||
responseType: 'blob'
|
||
})
|
||
}
|
||
|
||
/**
|
||
* 导入培养方案 Excel(multipart,字段名 file)
|
||
* POST /training/import
|
||
*/
|
||
export function importTrainingProgram(file) {
|
||
const formData = new FormData()
|
||
formData.append('file', file)
|
||
return request({
|
||
url: '/training/import',
|
||
method: 'post',
|
||
data: formData,
|
||
headers: { 'Content-Type': 'multipart/form-data' }
|
||
})
|
||
}
|