专业添加导入模板下载和数据上传

This commit is contained in:
2026-09-15 17:43:34 +08:00
parent c7397ad457
commit 6e767947f7
8 changed files with 691 additions and 10 deletions
+15 -2
View File
@@ -45,12 +45,25 @@ export function delMajor(zydh) {
})
}
// 下载人才培养方案课程数据文件模板
// 下载专业导入模板(xlsx,列头与后端导入解析一致)
export function downloadMajorTemplate() {
return request({
url: '/download/training-program',
url: '/discipline/major/template',
method: 'get',
responseType: 'blob',
timeout: 30000
})
}
// 导入专业(Excelform-data 字段名 file
export function importMajor(file) {
const formData = new FormData()
formData.append('file', file)
return request({
url: '/discipline/major/import',
method: 'post',
data: formData,
headers: { 'Content-Type': 'multipart/form-data' },
timeout: 120000
})
}