diff --git a/src/api/basic/graduverify.ts b/src/api/basic/graduverify.ts new file mode 100644 index 0000000..a1b41d4 --- /dev/null +++ b/src/api/basic/graduverify.ts @@ -0,0 +1,91 @@ +import request from '/@/utils/request'; + +/** + * 分页查询毕业学生核对数据 + * @param query 查询参数 + */ +export const fetchList = (query?: any) => { + return request({ + url: '/basic/graduverify/page', + method: 'get', + params: query + }); +}; + +/** + * 导入毕业学籍回流数据并核对 + * @param file 文件 + */ +export const importData = (file: File) => { + const formData = new FormData(); + formData.append('file', file); + return request({ + url: '/basic/graduverify/import', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +/** + * 导出核对数据 + * @param data 查询条件 + */ +export const exportData = (data: any) => { + return request({ + url: '/basic/graduverify/export', + method: 'post', + data, + responseType: 'blob' + }); +}; + +/** + * 下发至班主任核对 + * @param batchNo 批次号 + */ +export const sendToClassMaster = (batchNo: string) => { + return request({ + url: '/basic/graduverify/send', + method: 'post', + params: { batchNo } + }); +}; + +/** + * 提交核对结果 + * @param id 记录ID + * @param verifyResult 核对结果 + */ +export const submitVerify = (id: string, verifyResult: string) => { + return request({ + url: '/basic/graduverify/verify', + method: 'post', + params: { id, verifyResult } + }); +}; + +/** + * 获取待核对统计 + * @param classMasterCode 班主任工号 + */ +export const getPendingCount = (classMasterCode?: string) => { + return request({ + url: '/basic/graduverify/pending-count', + method: 'get', + params: { classMasterCode } + }); +}; + +/** + * 下载导入模板 + */ +export const downloadTemplate = () => { + return request({ + url: '/basic/graduverify/template', + method: 'get', + responseType: 'blob' + }); +}; \ No newline at end of file diff --git a/src/api/ems/qualityReport.ts b/src/api/ems/qualityReport.ts index 6981a88..04f09af 100644 --- a/src/api/ems/qualityReport.ts +++ b/src/api/ems/qualityReport.ts @@ -32,7 +32,7 @@ export const importComment = (file: File) => { const formData = new FormData(); formData.append('file', file); return request({ - url: '/ems/emsqualityreport/importComment', + url: '/ems/file/importStudentComment', method: 'post', data: formData, headers: { @@ -47,7 +47,7 @@ export const importComment = (file: File) => { */ export const setClassStartTime = (data: any) => { return request({ - url: '/ems/emsqualityreport/setClassStartTime', + url: '/ems/emsopenschooltime/edit', method: 'post', data }); @@ -66,3 +66,14 @@ export const exportExcel = (query?: any) => { }); }; +/** + * 导出学生评语模板 + */ +export const exportStudentCommentTemplate = () => { + return request({ + url: '/ems/file/exportStudentCommentTemplate', + method: 'get', + responseType: 'blob' + }); +}; + diff --git a/src/api/stuwork/file.ts b/src/api/stuwork/file.ts new file mode 100644 index 0000000..10651ec --- /dev/null +++ b/src/api/stuwork/file.ts @@ -0,0 +1,702 @@ +import request from '/@/utils/request'; +import { useMessage } from '/@/hooks/message'; + +/** + * 通用的 blob 文件下载辅助函数 + * @param promise 请求 Promise + * @param fileName 下载文件名 + */ +export const downloadBlobFile = async (promise: Promise, fileName: string) => { + try { + const res = await promise; + // 检查响应数据 + if (!res.data) { + useMessage().error('响应数据为空'); + return false; + } + + // 检查是否是错误响应(JSON 格式的错误信息) + const contentType = res.headers?.['content-type'] || ''; + if (contentType.includes('application/json')) { + // 后端返回了 JSON 格式的错误信息 + const reader = new FileReader(); + reader.onload = () => { + try { + const errorData = JSON.parse(reader.result as string); + useMessage().error(errorData.msg || '下载失败'); + } catch { + useMessage().error('下载失败'); + } + }; + reader.readAsText(res.data); + return false; + } + + // 创建 blob 对象 + const blob = res.data instanceof Blob ? res.data : new Blob([res.data]); + + // 检查 blob 大小 + if (blob.size === 0) { + useMessage().error('文件内容为空'); + return false; + } + + // 创建下载链接 + const url = window.URL.createObjectURL(blob); + const link = document.createElement('a'); + link.href = url; + link.download = fileName; + document.body.appendChild(link); + link.click(); + // 清理 + window.URL.revokeObjectURL(url); + document.body.removeChild(link); + useMessage().success('下载成功'); + return true; + } catch (error: any) { + console.error('文件下载失败:', error); + useMessage().error(error.msg || '下载失败'); + return false; + } +}; + +// ==================== 教室日卫生 ==================== + +/** + * 下载教室日卫生导入模板 + */ +export const downloadClassRoomHygieneDailyTemplate = () => { + return request({ + url: '/stuwork/classRoomHygieneDaily/import/template', + method: 'get', + responseType: 'blob' + }); +}; + +/** + * 教室日卫生导入 + * @param formData 文件表单数据 + */ +export const importClassRoomHygieneDaily = (formData: FormData) => { + return request({ + url: '/stuwork/classRoomHygieneDaily/import', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +/** + * 创建导出教室日卫生异步任务 + * @param query 查询参数 + */ +export const makeExportClassRoomHygieneDailyTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportClassRoomHygieneDailyTask', + method: 'post', + data: query + }); +}; + +// ==================== 教室月卫生 ==================== + +/** + * 下载教室月卫生导入模板 + */ +export const downloadClassRoomHygieneMonthlyTemplate = () => { + return request({ + url: '/stuwork/classroomhygienemonthly/import/template', + method: 'get', + responseType: 'blob' + }); +}; + +/** + * 教室月卫生导入 + * @param formData 文件表单数据 + */ +export const importClassRoomHygieneMonthly = (formData: FormData) => { + return request({ + url: '/stuwork/classroomhygienemonthly/import', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +/** + * 创建导出教室月卫生异步任务 + * @param query 查询参数 + */ +export const makeExportClassRoomHygieneMonthlyTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportClassRoomHygieneMonthlyTask', + method: 'post', + data: query + }); +}; + +// ==================== 日常巡检 ==================== + +/** + * 下载日常巡检导入模板 + */ +export const downloadClassCheckDailyTemplate = () => { + return request({ + url: '/stuwork/classcheckdaily/importTemplate', + method: 'get', + responseType: 'blob' + }); +}; + +/** + * 日常巡检导入 + * @param formData 文件表单数据 + */ +export const importClassCheckDaily = (formData: FormData) => { + return request({ + url: '/stuwork/classcheckdaily/import', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +/** + * 创建导出日常巡检异步任务 + * @param query 查询参数 + */ +export const makeExportClassCheckDailyTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportClassCheckDailyTask', + method: 'post', + data: query + }); +}; + +// ==================== 日常行为 ==================== + +/** + * 下载日常行为导入模板 + */ +export const downloadClassHygieneDailyTemplate = () => { + return request({ + url: '/stuwork/classhygienedaily/importTemplate', + method: 'get', + responseType: 'blob' + }); +}; + +/** + * 日常行为导入 + * @param formData 文件表单数据 + */ +export const importClassHygieneDaily = (formData: FormData) => { + return request({ + url: '/stuwork/classhygienedaily/import', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +/** + * 创建导出日常行为异步任务 + * @param query 查询参数 + */ +export const makeExportClassHygieneDailyTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportClassHygieneDailyTask', + method: 'post', + data: query + }); +}; + +// ==================== 班级概况 / 学生信息 ==================== + +/** + * 创建导出班级概况异步任务 + * @param query 查询参数 + */ +export const makeExportClassOverviewTask = (query?: any) => { + return request({ + url: '/basic/basicFile/makeExportClassOverviewTask', + method: 'post', + data: query + }); +}; + +/** + * 创建导出学生信息异步任务 + * @param query 查询参数 + */ +export const makeExportStudentDataTask = (query?: any) => { + return request({ + url: '/basic/basicFile/makeExportStudentDataTask', + method: 'post', + data: query + }); +}; + +// ==================== 班主任考核 ==================== + +/** + * 下载班主任考核导入模板 + */ +export const downloadClassMasterEvaluationTemplate = () => { + return request({ + url: '/stuwork/file/getClassMasterEvaluationImportTemplate', + method: 'get', + responseType: 'blob' + }); +}; + +/** + * 班主任考核导入 + * @param formData 文件表单数据 + */ +export const importClassMasterEvaluation = (formData: FormData) => { + return request({ + url: '/stuwork/file/importClassMasterEvaluation', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +/** + * 创建导出班主任考核异步任务 + * @param query 查询参数 + */ +export const makeExportClassMasterEvaluationTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportClassMasterEvaluationTask', + method: 'post', + data: query + }); +}; + +// ==================== 住宿管理 ==================== + +/** + * 创建导出住宿名单异步任务 + * @param query 查询参数 + */ +export const makeExportDormStudentTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportDormStudentTask', + method: 'post', + data: query + }); +}; + +/** + * 创建导出住宿情况统计表异步任务 + * @param query 查询参数 + */ +export const makeExportDormStatisticsTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportDormStatisticsTask', + method: 'post', + data: query + }); +}; + +/** + * 创建导出宿舍房间异步任务 + * @param query 查询参数 + */ +export const makeExportDormRoomTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportDormRoomTask', + method: 'post', + data: query + }); +}; + +/** + * 创建导出异常住宿异步任务 + * @param query 查询参数 + */ +export const makeExportDormStudentAbnormalTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportDormStudentAbnormalTask', + method: 'post', + data: query + }); +}; + +// ==================== 宿舍月卫生 ==================== + +/** + * 导出宿舍月卫生模板 + * @param query 查询参数 + */ +export const exportDormHygieneMonthlyTemplate = (query?: any) => { + return request({ + url: '/stuwork/file/exportDormHygieneMonthlyTemplate', + method: 'post', + data: query, + responseType: 'blob' + }); +}; + +/** + * 导入宿舍月卫生数据 + * @param formData 文件表单数据 + */ +export const importDormHygieneMonthly = (formData: FormData) => { + return request({ + url: '/stuwork/file/importDormHygieneMonthly', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +// ==================== 宿舍整改 ==================== + +/** + * 创建导出宿舍整改异步任务 + * @param query 查询参数 + */ +export const makeExportDormReformTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportDormReformTask', + method: 'post', + data: query + }); +}; + +// ==================== 宿舍水电 ==================== + +/** + * 创建导出宿舍水电异步任务 + * @param query 查询参数 + */ +export const makeExportDormWaterElectricityTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportDormWaterElectricityTask', + method: 'post', + data: query + }); +}; + +// ==================== 学籍异动 ==================== + +/** + * 创建导出学籍异动异步任务 + * @param query 查询参数 + */ +export const makeExportStudentChangeTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportStudentChangeTask', + method: 'post', + data: query + }); +}; + +// ==================== 学生违纪 ==================== + +/** + * 创建导出学生违纪异步任务 + * @param query 查询参数 + */ +export const makeExportStudentDisciplineTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportStudentDisciplineTask', + method: 'post', + data: query + }); +}; + +// ==================== 学生请假 ==================== + +/** + * 创建导出学生请假异步任务 + * @param query 查询参数 + */ +export const makeExportStudentLeaveTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportStudentLeaveTask', + method: 'post', + data: query + }); +}; + +// ==================== 学生评优评先 ==================== + +/** + * 创建导出学生评优评先异步任务 + * @param query 查询参数 + */ +export const makeExportStudentPraiseTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportStudentPraiseTask', + method: 'post', + data: query + }); +}; + +// ==================== 班费 ==================== + +/** + * 创建导出班费异步任务 + * @param query 查询参数 + */ +export const makeExportClassFundTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportClassFundTask', + method: 'post', + data: query + }); +}; + +// ==================== 操行考核 ==================== + +/** + * 导出操行考核模板 + */ +export const exportConductAssessmentTemplate = () => { + return request({ + url: '/stuwork/file/exportConductAssessmentTemplate', + method: 'get', + responseType: 'blob' + }); +}; + +/** + * 导入操行考核数据 + * @param formData 文件表单数据 + */ +export const importConductAssessment = (formData: FormData) => { + return request({ + url: '/stuwork/file/importConductAssessment', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +// ==================== 安全教育 ==================== + +/** + * 创建导出安全教育异步任务 + * @param query 查询参数 + */ +export const makeExportSafetyEducationTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportSafetyEducationTask', + method: 'post', + data: query + }); +}; + +// ==================== 文明班级 ==================== + +/** + * 导出文明班级模板 + */ +export const exportRewardClassTemplate = () => { + return request({ + url: '/stuwork/file/exportRewardClassTemplate', + method: 'get', + responseType: 'blob' + }); +}; + +/** + * 导入文明班级数据 + * @param formData 文件表单数据 + */ +export const importRewardClass = (formData: FormData) => { + return request({ + url: '/stuwork/file/importRewardClass', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +// ==================== 文明宿舍 ==================== + +/** + * 导出文明宿舍模板 + */ +export const exportRewardDormTemplate = () => { + return request({ + url: '/stuwork/file/exportRewardDormTemplate', + method: 'get', + responseType: 'blob' + }); +}; + +/** + * 导入文明宿舍数据 + * @param formData 文件表单数据 + */ +export const importRewardDorm = (formData: FormData) => { + return request({ + url: '/stuwork/file/importRewardDorm', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +// ==================== 班级学生评语 ==================== + +/** + * 导出班级学生评语文档(单人/班级) + * @param query 查询参数 + */ +export const exportClassAssetsIntroduction = (query?: any) => { + return request({ + url: '/stuwork/classassets/exportIntroduction', + method: 'post', + data: query, + responseType: 'blob' + }); +}; + +// ==================== 学生评语 ==================== + +/** + * 导出学生评语模板 + */ +export const exportStudentCommentTemplate = () => { + return request({ + url: '/ems/file/exportStudentCommentTemplate', + method: 'get', + responseType: 'blob' + }); +}; + +/** + * 导入学生评语数据 + * @param formData 文件表单数据 + */ +export const importStudentComment = (formData: FormData) => { + return request({ + url: '/ems/file/importStudentComment', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +// ==================== 教室公物 ==================== + +/** + * 创建导出教室公物异步任务 + * @param query 查询参数 + */ +export const makeExportClassAssetsTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportClassAssetsTask', + method: 'post', + data: query + }); +}; + +// ==================== 活动报名详情 ==================== + +/** + * 创建导出活动报名详情异步任务 + * @param query 查询参数 + */ +export const makeExportActivitySignUpDetailTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportActivitySignUpDetailTask', + method: 'post', + data: query + }); +}; + +// ==================== 活动获奖 ==================== + +/** + * 导出活动获奖模板 + */ +export const exportActivityAwardsTemplate = () => { + return request({ + url: '/stuwork/file/exportActivityAwardsTemplate', + method: 'get', + responseType: 'blob' + }); +}; + +/** + * 导入活动获奖数据 + * @param formData 文件表单数据 + */ +export const importActivityAwards = (formData: FormData) => { + return request({ + url: '/stuwork/file/importActivityAwards', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +// ==================== 团员信息 ==================== + +/** + * 导出团员数据模板 + */ +export const exportStuUnionLeagueTemplate = () => { + return request({ + url: '/stuwork/file/exportStuUnionLeagueTemplate', + method: 'get', + responseType: 'blob' + }); +}; + +/** + * 导入团员数据 + * @param formData 文件表单数据 + */ +export const importStuUnionLeague = (formData: FormData) => { + return request({ + url: '/stuwork/file/importStuUnionLeague', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + } + }); +}; + +/** + * 创建导出团员信息异步任务 + * @param query 查询参数 + */ +export const makeExportStuUnionLeagueTask = (query?: any) => { + return request({ + url: '/stuwork/file/makeExportStuUnionLeagueTask', + method: 'post', + data: query + }); +}; \ No newline at end of file diff --git a/src/components/Upload/Excel.vue b/src/components/Upload/Excel.vue index bdc4445..afd8261 100644 --- a/src/components/Upload/Excel.vue +++ b/src/components/Upload/Excel.vue @@ -106,11 +106,13 @@ const downExcelTemp = async () => { window.URL.revokeObjectURL(url); document.body.removeChild(link); } else { - // 使用后端接口下载 - const fileName = prop.tempUrl?.split('/').pop() || 'template.xlsx'; + // 使用后端接口下载,文件名使用导入功能名称 + const title = prop.title?.replace('导入', '') || '导入模板'; + const fileName = `${title}模板.xlsx`; await other.downBlobFile(other.adaptationUrl(prop.tempUrl), {}, fileName); } } catch (error) { + console.error('模板下载失败:', error); useMessage().error('模板下载失败,请先维护模板文件'); } }; diff --git a/src/utils/other.ts b/src/utils/other.ts index 31e2b51..232a704 100644 --- a/src/utils/other.ts +++ b/src/utils/other.ts @@ -285,8 +285,8 @@ export function downBlobFile(url: any, query: any, fileName: string) { * @returns */ export function handleBlobFile(response: any, fileName: string) { - // 处理返回的文件流 - const blob = response; + // 处理返回的文件流,支持 axios 响应结构 { data: blob } 或直接 blob + const blob = response?.data || response; if (blob && blob.size === 0) { useMessage().error('内容为空,无法下载'); return; @@ -295,7 +295,7 @@ export function handleBlobFile(response: any, fileName: string) { // 兼容一下 入参不是 File Blob 类型情况 var binaryData = [] as any; - binaryData.push(response); + binaryData.push(blob); link.href = window.URL.createObjectURL(new Blob(binaryData)); link.download = fileName; document.body.appendChild(link); diff --git a/src/views/basic/basicclass/index.vue b/src/views/basic/basicclass/index.vue index 52ac5d7..bce003a 100644 --- a/src/views/basic/basicclass/index.vue +++ b/src/views/basic/basicclass/index.vue @@ -278,9 +278,9 @@ import { ref, reactive, defineAsyncComponent, computed, onMounted } from 'vue' import { useRoute } from 'vue-router' import { BasicTableProps, useTable } from "/@/hooks/table"; import { fetchList, delObj, putObjs, classExportData, getDeptList, getClassListByRole } from "/@/api/basic/basicclass"; +import { makeExportClassOverviewTask } from "/@/api/stuwork/file"; import { useMessage, useMessageBox } from "/@/hooks/message"; import { fetchList as getRuleList } from "/@/api/stuwork/entrancerule"; -import { downBlobFile, adaptationUrl } from "/@/utils/other"; import TableColumnControl from '/@/components/TableColumnControl/index.vue' import { List, OfficeBuilding, Grid, Document, UserFilled, Phone, User, Lock, CircleCheck, TrendCharts, Setting, Menu, Search } from '@element-plus/icons-vue' import { useTableColumnControl } from '/@/hooks/tableColumn' @@ -467,8 +467,8 @@ const confirmLinkRule = async () => { // 导出 const handleExport = async () => { try { - await downBlobFile(adaptationUrl('/basic/basicclass/classExportData'), searchForm, '班级信息.xlsx') - useMessage().success('导出成功') + await makeExportClassOverviewTask(searchForm) + useMessage().success('导出任务已创建,请在文件管理中下载') } catch (err: any) { useMessage().error(err.msg || '导出失败') } diff --git a/src/views/basic/basicstudent/index.vue b/src/views/basic/basicstudent/index.vue index ea2c07e..61ef08a 100644 --- a/src/views/basic/basicstudent/index.vue +++ b/src/views/basic/basicstudent/index.vue @@ -388,10 +388,10 @@ - + + + +
+
+ + 全选 + + 重置 +
+ + + + {{ field.label }} + + +
+ +
@@ -448,6 +486,7 @@ import { downBlobFile, adaptationUrl } from "/@/utils/other"; import { Session } from "/@/utils/storage"; import TableColumnControl from '/@/components/TableColumnControl/index.vue' import GenderTag from '/@/components/GenderTag/index.vue' +import {makeExportClassRoomHygieneMonthlyTask} from "/@/api/stuwork/file"; // 引入组件 const FormDialog = defineAsyncComponent(() => import('./form.vue')); @@ -472,6 +511,12 @@ const selectedRows = ref([]) const importCertificateDialogVisible = ref(false) const uploadLoading = ref(false) const fileList = ref([]) +// 导出字段选择相关 +const exportFieldDialogVisible = ref(false) +const exportFieldLoading = ref(false) +const selectedExportFields = ref([]) +const exportFieldCheckAll = ref(false) +const exportFieldIndeterminate = ref(false) // 表格列配置 const tableColumns = [ @@ -499,6 +544,36 @@ const visibleColumns = ref([]) // 列排序顺序 const columnOrder = ref([]) +// 导出字段选项 +const exportFieldOptions = [ + { value: 'deptName', label: '学院' }, + { value: 'majorName', label: '专业' }, + { value: 'className', label: '班级' }, + { value: 'classNo', label: '班号' }, + { value: 'stuNo', label: '学号' }, + { value: 'realName', label: '姓名' }, + { value: 'gender', label: '性别' }, + { value: 'idCard', label: '身份证号' }, + { value: 'birthday', label: '出生日期' }, + { value: 'nation', label: '民族' }, + { value: 'politicalStatus', label: '政治面貌' }, + { value: 'phone', label: '个人电话' }, + { value: 'parentPhone', label: '家长电话' }, + { value: 'education', label: '文化程度' }, + { value: 'householdType', label: '户口性质' }, + { value: 'householdAddress', label: '户籍所在地' }, + { value: 'currentAddress', label: '现住址' }, + { value: 'isDorm', label: '是否住宿' }, + { value: 'dormNo', label: '宿舍号' }, + { value: 'enrollStatus', label: '学籍状态' }, + { value: 'stuStatus', label: '学生状态' }, + { value: 'teacherName', label: '班主任' }, + { value: 'isClassLeader', label: '是否班干部' }, + { value: 'bankCard', label: '银行卡号' }, + { value: 'bankName', label: '开户行' }, + { value: 'remark', label: '备注' } +] + // 从本地统一存储加载配置 const loadSavedConfig = () => { const routePath = route.path.replace(/^\//, '').replace(/\//g, '-') @@ -654,8 +729,56 @@ const handleSelectionChange = (selection: any[]) => { } // 学生信息导出 -const handleExportStudent = async () => { - useMessage().warning('功能开发中') +const handleExportStudent = () => { + // 打开字段选择弹窗 + exportFieldDialogVisible.value = true + // 默认选中常用字段 + if (selectedExportFields.value.length === 0) { + selectedExportFields.value = ['deptName', 'majorName', 'className', 'stuNo', 'realName', 'gender', 'idCard', 'phone', 'education', 'enrollStatus'] + } + updateExportFieldCheckAll() +} + +// 全选/取消全选 +const handleExportFieldCheckAllChange = (val: boolean) => { + selectedExportFields.value = val ? exportFieldOptions.map(item => item.value) : [] + exportFieldIndeterminate.value = false +} + +// 更新全选状态 +const updateExportFieldCheckAll = () => { + const total = exportFieldOptions.length + const selected = selectedExportFields.value.length + exportFieldCheckAll.value = selected === total + exportFieldIndeterminate.value = selected > 0 && selected < total +} + +// 重置选择 +const handleExportFieldReset = () => { + selectedExportFields.value = ['deptName', 'majorName', 'className', 'stuNo', 'realName', 'gender', 'idCard', 'phone', 'education', 'enrollStatus'] + updateExportFieldCheckAll() +} + +// 确认导出 +const handleExportFieldConfirm = async () => { + if (selectedExportFields.value.length === 0) { + useMessage().warning('请至少选择一个导出字段') + return + } + + exportFieldLoading.value = true + try { + const params = { + ...searchForm, + fields: selectedExportFields.value.join(',') + } + await exportStudentData(params) + useMessage().success('导出任务已创建,请在文件管理中下载') + } catch (err: any) { + useMessage().error(err.msg || '导出失败') + } finally { + exportFieldLoading.value = false + } } // 申请顶岗 @@ -889,3 +1012,30 @@ onMounted(() => { getStuStatusListData() }) + + diff --git a/src/views/basic/graduverify/index.vue b/src/views/basic/graduverify/index.vue new file mode 100644 index 0000000..09d579e --- /dev/null +++ b/src/views/basic/graduverify/index.vue @@ -0,0 +1,495 @@ + + + + + \ No newline at end of file diff --git a/src/views/ems/qualityReport/index.vue b/src/views/ems/qualityReport/index.vue index eec53a3..37f6e4c 100644 --- a/src/views/ems/qualityReport/index.vue +++ b/src/views/ems/qualityReport/index.vue @@ -88,25 +88,25 @@
- 评语导入 - 设置班级开学时间 - + 名单导出 - + @@ -155,12 +162,15 @@ - +
+ 下载模板 +
- + + + + + + + + + + + + @@ -237,13 +276,14 @@