模板
This commit is contained in:
@@ -67,3 +67,13 @@ export function exportJointTraining() {
|
|||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 下载联教联训导入模板(返回 Blob)
|
||||||
|
// GET /download/joint-training
|
||||||
|
export function downloadJointTrainingTemplate() {
|
||||||
|
return request({
|
||||||
|
url: '/download/joint-training',
|
||||||
|
method: 'get',
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -115,10 +115,10 @@ export function exportTeachingLog(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 下载导入模板(返回 Blob),接口形态:GET /log/teaching-log/download-template
|
// 下载导入模板(返回 Blob),接口形态:GET /download/teaching-log
|
||||||
export function downloadTeachingLogTemplate() {
|
export function downloadTeachingLogTemplate() {
|
||||||
return request({
|
return request({
|
||||||
url: '/log/teaching-log/download-template',
|
url: '/download/teaching-log',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -93,3 +93,15 @@ export function listClassroomByJxldh(jxldh) {
|
|||||||
params: { jxldh }
|
params: { jxldh }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载教学场地导入模板(返回 Blob)
|
||||||
|
* GET /download/classroom
|
||||||
|
*/
|
||||||
|
export function downloadClassroomTemplate() {
|
||||||
|
return request({
|
||||||
|
url: '/download/classroom',
|
||||||
|
method: 'get',
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -69,3 +69,42 @@ export function listTraining(params) {
|
|||||||
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' }
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -45,3 +45,13 @@ export function updateKb(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 下载课程科目导入模板(返回 Blob)
|
||||||
|
// GET /download/course-subject
|
||||||
|
export function downloadCourseSubjectTemplate() {
|
||||||
|
return request({
|
||||||
|
url: '/download/course-subject',
|
||||||
|
method: 'get',
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -61,10 +61,10 @@ export function deleteTeachingMaterial(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 教材导入模板下载 GET /teachingMaterial/template */
|
/** 教材导入模板下载 GET /download/teaching-material */
|
||||||
export function downloadTeachingMaterialTemplate() {
|
export function downloadTeachingMaterialTemplate() {
|
||||||
return request({
|
return request({
|
||||||
url: '/teachingMaterial/template',
|
url: '/download/teaching-material',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
responseType: 'blob'
|
responseType: 'blob'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -187,7 +187,8 @@ import {
|
|||||||
deleteJointTraining,
|
deleteJointTraining,
|
||||||
getJointTraining,
|
getJointTraining,
|
||||||
importJointTraining,
|
importJointTraining,
|
||||||
exportJointTraining
|
exportJointTraining,
|
||||||
|
downloadJointTrainingTemplate
|
||||||
} from '@/api/classHour/jointTraining'
|
} from '@/api/classHour/jointTraining'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -433,8 +434,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleDownloadTemplate() {
|
handleDownloadTemplate() {
|
||||||
// 后端暂未提供模板下载接口,仅作提示
|
downloadJointTrainingTemplate().then(blob => {
|
||||||
this.$message.info('后端暂未提供该接口')
|
saveAs(blob, '联教连训管理.xls')
|
||||||
|
this.$message.success('模板下载成功')
|
||||||
|
}).catch(() => {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -347,12 +347,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { saveAs } from 'file-saver'
|
||||||
import {
|
import {
|
||||||
addTraining,
|
addTraining,
|
||||||
disableTraining,
|
disableTraining,
|
||||||
updateTraining,
|
updateTraining,
|
||||||
getTraining,
|
getTraining,
|
||||||
listTraining
|
listTraining,
|
||||||
|
exportTrainingProgram,
|
||||||
|
downloadTrainingProgramTemplate,
|
||||||
|
importTrainingProgram
|
||||||
} from '@/api/teachBusiness/training'
|
} from '@/api/teachBusiness/training'
|
||||||
import { getDicts } from '@/api/system/dict/data'
|
import { getDicts } from '@/api/system/dict/data'
|
||||||
import { optionselect } from '@/api/system/dict/type'
|
import { optionselect } from '@/api/system/dict/type'
|
||||||
@@ -586,12 +590,18 @@ export default {
|
|||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
|
|
||||||
/* ---------- 下载 / 模板下载 / 上传(后端未提供接口) ---------- */
|
/* ---------- 下载 / 模板下载 / 上传 ---------- */
|
||||||
handleDownload() {
|
handleDownload() {
|
||||||
this.$message.warning('后端暂未提供该接口')
|
exportTrainingProgram().then(blob => {
|
||||||
|
saveAs(blob, '人才培养方案课程数据文件.xlsx')
|
||||||
|
this.$message.success('导出成功')
|
||||||
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
handleTemplateDownload() {
|
handleTemplateDownload() {
|
||||||
this.$message.warning('后端暂未提供该接口')
|
downloadTrainingProgramTemplate().then(blob => {
|
||||||
|
saveAs(blob, '人才培养方案课程数据文件模板.xls')
|
||||||
|
this.$message.success('模板下载成功')
|
||||||
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
handleChooseFile() {
|
handleChooseFile() {
|
||||||
this.$refs.fileInputRef && this.$refs.fileInputRef.click()
|
this.$refs.fileInputRef && this.$refs.fileInputRef.click()
|
||||||
@@ -602,7 +612,18 @@ export default {
|
|||||||
this.fileName = file ? file.name : ''
|
this.fileName = file ? file.name : ''
|
||||||
},
|
},
|
||||||
handleUpload() {
|
handleUpload() {
|
||||||
this.$message.warning('后端暂未提供该接口')
|
if (!this.selectedFile) {
|
||||||
|
this.$message.warning('请先选择文件')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
importTrainingProgram(this.selectedFile).then(response => {
|
||||||
|
const count = (response && response.data) || 0
|
||||||
|
this.$message.success(`导入成功,共导入 ${count} 条`)
|
||||||
|
this.selectedFile = null
|
||||||
|
this.fileName = ''
|
||||||
|
if (this.$refs.fileInputRef) this.$refs.fileInputRef.value = ''
|
||||||
|
this.fetchList()
|
||||||
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
|
|
||||||
/* ---------- 工具 ---------- */
|
/* ---------- 工具 ---------- */
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
<div class="list-title">教室列表</div>
|
<div class="list-title">教室列表</div>
|
||||||
<div class="list-actions">
|
<div class="list-actions">
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||||
|
<el-button icon="el-icon-download" @click="handleDownloadTemplate">【教学场地管理模板】下载</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<el-table v-loading="loading" :data="tableData" border stripe highlight-current-row>
|
<el-table v-loading="loading" :data="tableData" border stripe highlight-current-row>
|
||||||
@@ -193,12 +194,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { saveAs } from 'file-saver'
|
||||||
import {
|
import {
|
||||||
addClassroom,
|
addClassroom,
|
||||||
deleteClassroom,
|
deleteClassroom,
|
||||||
updateClassroom,
|
updateClassroom,
|
||||||
listClassroom,
|
listClassroom,
|
||||||
listAllClassroom
|
listAllClassroom,
|
||||||
|
downloadClassroomTemplate
|
||||||
} from '@/api/teachBusiness/classroom'
|
} from '@/api/teachBusiness/classroom'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -369,6 +372,14 @@ export default {
|
|||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/* ---------- 模板下载 ---------- */
|
||||||
|
handleDownloadTemplate() {
|
||||||
|
downloadClassroomTemplate().then(blob => {
|
||||||
|
saveAs(blob, '教学场地管理模板.xls')
|
||||||
|
this.$message.success('模板下载成功')
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
|
||||||
/* ---------- 工具 ---------- */
|
/* ---------- 工具 ---------- */
|
||||||
createEmptyForm() {
|
createEmptyForm() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -320,7 +320,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listKb as listSubject, addKb as addSubject, updateKb as updateSubject, deleteKb as deleteSubject, getKb } from '@/api/teachOffice/kb'
|
import { saveAs } from 'file-saver'
|
||||||
|
import { listKb as listSubject, addKb as addSubject, updateKb as updateSubject, deleteKb as deleteSubject, getKb, downloadCourseSubjectTemplate } from '@/api/teachOffice/kb'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SubjectIndex',
|
name: 'SubjectIndex',
|
||||||
@@ -515,7 +516,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// ==================== 下载(后端暂未提供) ====================
|
// ==================== 下载 ====================
|
||||||
handleDownloadCourse() {
|
handleDownloadCourse() {
|
||||||
this.$message.warning('后端暂未提供该接口')
|
this.$message.warning('后端暂未提供该接口')
|
||||||
},
|
},
|
||||||
@@ -523,7 +524,10 @@ export default {
|
|||||||
this.$message.warning('后端暂未提供该接口')
|
this.$message.warning('后端暂未提供该接口')
|
||||||
},
|
},
|
||||||
handleDownloadTemplate() {
|
handleDownloadTemplate() {
|
||||||
this.$message.warning('后端暂未提供该接口')
|
downloadCourseSubjectTemplate().then(blob => {
|
||||||
|
saveAs(blob, '课程课目数据文件模板.xls')
|
||||||
|
this.$message.success('模板下载成功')
|
||||||
|
}).catch(() => {})
|
||||||
},
|
},
|
||||||
|
|
||||||
// ==================== 文件上传(后端暂未提供) ====================
|
// ==================== 文件上传(后端暂未提供) ====================
|
||||||
|
|||||||
Reference in New Issue
Block a user