forked from liweijie/education
模板
This commit is contained in:
@@ -187,7 +187,8 @@ import {
|
||||
deleteJointTraining,
|
||||
getJointTraining,
|
||||
importJointTraining,
|
||||
exportJointTraining
|
||||
exportJointTraining,
|
||||
downloadJointTrainingTemplate
|
||||
} from '@/api/classHour/jointTraining'
|
||||
|
||||
export default {
|
||||
@@ -433,8 +434,10 @@ export default {
|
||||
},
|
||||
|
||||
handleDownloadTemplate() {
|
||||
// 后端暂未提供模板下载接口,仅作提示
|
||||
this.$message.info('后端暂未提供该接口')
|
||||
downloadJointTrainingTemplate().then(blob => {
|
||||
saveAs(blob, '联教连训管理.xls')
|
||||
this.$message.success('模板下载成功')
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,12 +347,16 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { saveAs } from 'file-saver'
|
||||
import {
|
||||
addTraining,
|
||||
disableTraining,
|
||||
updateTraining,
|
||||
getTraining,
|
||||
listTraining
|
||||
listTraining,
|
||||
exportTrainingProgram,
|
||||
downloadTrainingProgramTemplate,
|
||||
importTrainingProgram
|
||||
} from '@/api/teachBusiness/training'
|
||||
import { getDicts } from '@/api/system/dict/data'
|
||||
import { optionselect } from '@/api/system/dict/type'
|
||||
@@ -586,12 +590,18 @@ export default {
|
||||
}).catch(() => {})
|
||||
},
|
||||
|
||||
/* ---------- 下载 / 模板下载 / 上传(后端未提供接口) ---------- */
|
||||
/* ---------- 下载 / 模板下载 / 上传 ---------- */
|
||||
handleDownload() {
|
||||
this.$message.warning('后端暂未提供该接口')
|
||||
exportTrainingProgram().then(blob => {
|
||||
saveAs(blob, '人才培养方案课程数据文件.xlsx')
|
||||
this.$message.success('导出成功')
|
||||
}).catch(() => {})
|
||||
},
|
||||
handleTemplateDownload() {
|
||||
this.$message.warning('后端暂未提供该接口')
|
||||
downloadTrainingProgramTemplate().then(blob => {
|
||||
saveAs(blob, '人才培养方案课程数据文件模板.xls')
|
||||
this.$message.success('模板下载成功')
|
||||
}).catch(() => {})
|
||||
},
|
||||
handleChooseFile() {
|
||||
this.$refs.fileInputRef && this.$refs.fileInputRef.click()
|
||||
@@ -602,7 +612,18 @@ export default {
|
||||
this.fileName = file ? file.name : ''
|
||||
},
|
||||
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-actions">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
<el-button icon="el-icon-download" @click="handleDownloadTemplate">【教学场地管理模板】下载</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="tableData" border stripe highlight-current-row>
|
||||
@@ -193,12 +194,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { saveAs } from 'file-saver'
|
||||
import {
|
||||
addClassroom,
|
||||
deleteClassroom,
|
||||
updateClassroom,
|
||||
listClassroom,
|
||||
listAllClassroom
|
||||
listAllClassroom,
|
||||
downloadClassroomTemplate
|
||||
} from '@/api/teachBusiness/classroom'
|
||||
|
||||
export default {
|
||||
@@ -369,6 +372,14 @@ export default {
|
||||
}).catch(() => {})
|
||||
},
|
||||
|
||||
/* ---------- 模板下载 ---------- */
|
||||
handleDownloadTemplate() {
|
||||
downloadClassroomTemplate().then(blob => {
|
||||
saveAs(blob, '教学场地管理模板.xls')
|
||||
this.$message.success('模板下载成功')
|
||||
}).catch(() => {})
|
||||
},
|
||||
|
||||
/* ---------- 工具 ---------- */
|
||||
createEmptyForm() {
|
||||
return {
|
||||
|
||||
@@ -320,7 +320,8 @@
|
||||
</template>
|
||||
|
||||
<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 {
|
||||
name: 'SubjectIndex',
|
||||
@@ -515,7 +516,7 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
// ==================== 下载(后端暂未提供) ====================
|
||||
// ==================== 下载 ====================
|
||||
handleDownloadCourse() {
|
||||
this.$message.warning('后端暂未提供该接口')
|
||||
},
|
||||
@@ -523,7 +524,10 @@ export default {
|
||||
this.$message.warning('后端暂未提供该接口')
|
||||
},
|
||||
handleDownloadTemplate() {
|
||||
this.$message.warning('后端暂未提供该接口')
|
||||
downloadCourseSubjectTemplate().then(blob => {
|
||||
saveAs(blob, '课程课目数据文件模板.xls')
|
||||
this.$message.success('模板下载成功')
|
||||
}).catch(() => {})
|
||||
},
|
||||
|
||||
// ==================== 文件上传(后端暂未提供) ====================
|
||||
|
||||
Reference in New Issue
Block a user