导入导出
This commit is contained in:
@@ -274,7 +274,7 @@
|
||||
<upload-excel
|
||||
ref="uploadExcelRef"
|
||||
:title="'导入班主任考核'"
|
||||
:url="'/stuwork/classmasterevaluation/importData'"
|
||||
:url="'/stuwork/file/importClassMasterEvaluation'"
|
||||
:temp-url="templateUrl"
|
||||
@refreshDataList="getDataList" />
|
||||
|
||||
@@ -323,7 +323,8 @@
|
||||
<script setup lang="ts" name="ClassMasterEvaluation">
|
||||
import { ref, reactive, defineAsyncComponent, computed, onMounted } from 'vue'
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObjs, exportData } from "/@/api/stuwork/classmasterevaluation";
|
||||
import { fetchList, delObjs } from "/@/api/stuwork/classmasterevaluation";
|
||||
import { downloadClassMasterEvaluationTemplate, makeExportClassMasterEvaluationTask } from "/@/api/stuwork/file";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { getDeptList } from '/@/api/basic/basicclass'
|
||||
import { getClassListByRole } from '/@/api/basic/basicclass'
|
||||
@@ -347,7 +348,7 @@ const classList = ref<any[]>([])
|
||||
const assessmentCategoryList = ref<any[]>([])
|
||||
const assessmentPointList = ref<any[]>([])
|
||||
const appealDialogVisible = ref(false)
|
||||
const templateUrl = ref('assets/file/班主任考核导入模板.xlsx')
|
||||
const templateUrl = ref('/stuwork/file/getClassMasterEvaluationImportTemplate')
|
||||
const appealForm = reactive({
|
||||
id: '',
|
||||
virtualClassNo: '',
|
||||
@@ -472,17 +473,8 @@ const handleImport = () => {
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
const res = await exportData(searchForm)
|
||||
const blob = new Blob([res.data])
|
||||
const elink = document.createElement('a')
|
||||
elink.download = '班主任考核.xlsx'
|
||||
elink.style.display = 'none'
|
||||
elink.href = URL.createObjectURL(blob)
|
||||
document.body.appendChild(elink)
|
||||
elink.click()
|
||||
URL.revokeObjectURL(elink.href)
|
||||
document.body.removeChild(elink)
|
||||
useMessage().success('导出成功')
|
||||
await makeExportClassMasterEvaluationTask(searchForm)
|
||||
useMessage().success('导出任务已创建,请在文件管理中下载')
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg || '导出失败')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user