forked from liweijie/education
模板
This commit is contained in:
@@ -69,3 +69,42 @@ export function listTraining(params) {
|
||||
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' }
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user