From b352145e4f29bbe73a1373fceebf6688c2741f90 Mon Sep 17 00:00:00 2001 From: yaojian <1161995598@qq.com> Date: Fri, 6 Mar 2026 16:03:27 +0800 Subject: [PATCH] 1 --- src/api/ems/qualityReport.ts | 15 +- src/views/basic/basicclass/index.vue | 6 +- src/views/basic/basicstudent/index.vue | 160 +++++++++++++- src/views/ems/qualityReport/index.vue | 275 +++++++++++++++++++++---- 4 files changed, 401 insertions(+), 55 deletions(-) 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/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/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 @@