From 319e345bc6e7c4b78a385552332be5f7b630eff8 Mon Sep 17 00:00:00 2001 From: huababa1 <2037205722@qq.com> Date: Mon, 10 Nov 2025 12:23:47 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=AF=95=E5=8D=B7=E4=BB=BB=E5=8A=A1=E7=8F=AD=E7=BA=A7?= =?UTF-8?q?=E5=88=86=E9=85=8D=EF=BC=8C=E8=AF=95=E9=A2=98=E7=9A=84=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/exam/class/index.ts | 3 + src/views/paper/question/BrowerForm.vue | 32 ++-- src/views/paper/question/ChoiceForm.vue | 31 ++-- src/views/paper/question/EmailForm.vue | 31 ++-- src/views/paper/question/FileForm.vue | 34 ++--- src/views/paper/question/MysqlForm.vue | 32 ++-- src/views/paper/question/PsForm.vue | 33 +++-- src/views/paper/question/SettingForm.vue | 32 ++-- .../question/WindowsSystemSettingForm.vue | 32 ++-- src/views/paper/question/WpsPptxForm.vue | 32 ++-- src/views/paper/question/WpsWordForm.vue | 32 ++-- src/views/paper/question/WpsXlsxForm.vue | 32 ++-- .../exam/components/steps/step5/index.vue | 137 ++++++++++++++++- .../components/steps/step5/index.vue | 139 +++++++++++++++++- .../module/components/steps/step5/index.vue | 137 ++++++++++++++++- .../random/components/steps/step5/index.vue | 138 ++++++++++++++++- .../sprint/components/steps/step5/index.vue | 131 ++++++++++++++++- .../trans/components/steps/step5/index.vue | 126 ++++++++++++++++ 18 files changed, 967 insertions(+), 197 deletions(-) diff --git a/src/api/exam/class/index.ts b/src/api/exam/class/index.ts index 51ce9cf..8ccdd5e 100644 --- a/src/api/exam/class/index.ts +++ b/src/api/exam/class/index.ts @@ -36,6 +36,9 @@ export const ClassApi = { getClassIdName: async () => { return await request.get({ url: `/exam/class/getClassIdName` }) }, + getClassIdAndName: async () => { + return await request.get({ url: `/exam/class/getClassIdAndName` }) + }, // 绑定学生班级 bindingClass: async (data: ClassStudentSaveReqVO) => { diff --git a/src/views/paper/question/BrowerForm.vue b/src/views/paper/question/BrowerForm.vue index 997b1f2..48d4122 100644 --- a/src/views/paper/question/BrowerForm.vue +++ b/src/views/paper/question/BrowerForm.vue @@ -23,6 +23,21 @@ :rules="formRules" label-width="80px" > + + + + + + + + + + 启用 + 禁用 + + + + @@ -86,22 +101,7 @@ - - - - - - 启用 - 禁用 - - - - - - - - - +
diff --git a/src/views/paper/question/ChoiceForm.vue b/src/views/paper/question/ChoiceForm.vue index 4f57767..331820c 100644 --- a/src/views/paper/question/ChoiceForm.vue +++ b/src/views/paper/question/ChoiceForm.vue @@ -10,6 +10,21 @@ :rules="formRules" label-width="80px" > + + + + + + + + + + 启用 + 禁用 + + + + @@ -95,22 +110,8 @@ --> - + - - - - 启用 - 禁用 - - - - - - - - -
diff --git a/src/views/paper/question/EmailForm.vue b/src/views/paper/question/EmailForm.vue index fc9dfd5..28cf9d7 100644 --- a/src/views/paper/question/EmailForm.vue +++ b/src/views/paper/question/EmailForm.vue @@ -10,6 +10,21 @@ :rules="formRules" label-width="80px" > + + + + + + + + + + 启用 + 禁用 + + + + @@ -75,21 +90,7 @@ /> - - - - - 启用 - 禁用 - - - - - - - - - +
diff --git a/src/views/paper/question/FileForm.vue b/src/views/paper/question/FileForm.vue index 88ab6ed..36363aa 100644 --- a/src/views/paper/question/FileForm.vue +++ b/src/views/paper/question/FileForm.vue @@ -22,6 +22,22 @@ :rules="formRules" label-width="80px" > + + + + + + + + + + 启用 + 禁用 + + + + + @@ -86,23 +102,7 @@ - - - - - - 启用 - 禁用 - - - - - - - - - - +
diff --git a/src/views/paper/question/MysqlForm.vue b/src/views/paper/question/MysqlForm.vue index 3734e37..a56ef3d 100644 --- a/src/views/paper/question/MysqlForm.vue +++ b/src/views/paper/question/MysqlForm.vue @@ -10,6 +10,21 @@ :rules="formRules" label-width="80px" > + + + + + + + + + + 启用 + 禁用 + + + + @@ -85,27 +100,14 @@ - - - - 启用 - 禁用 - - - + - - - - - - - +
diff --git a/src/views/paper/question/PsForm.vue b/src/views/paper/question/PsForm.vue index 5a23d27..4fb8f8f 100644 --- a/src/views/paper/question/PsForm.vue +++ b/src/views/paper/question/PsForm.vue @@ -22,6 +22,22 @@ :rules="formRules" label-width="80px" > + + + + + + + + + + 启用 + 禁用 + + + + + @@ -86,22 +102,7 @@ - - - - - - 启用 - 禁用 - - - - - - - - - +
diff --git a/src/views/paper/question/SettingForm.vue b/src/views/paper/question/SettingForm.vue index 6749189..819c348 100644 --- a/src/views/paper/question/SettingForm.vue +++ b/src/views/paper/question/SettingForm.vue @@ -10,6 +10,22 @@ :rules="formRules" label-width="80px" > + + + + + + + + + + 启用 + 禁用 + + + + + @@ -75,21 +91,7 @@ /> - - - - - 启用 - 禁用 - - - - - - - - - +
diff --git a/src/views/paper/question/WindowsSystemSettingForm.vue b/src/views/paper/question/WindowsSystemSettingForm.vue index c809bcf..f0613eb 100644 --- a/src/views/paper/question/WindowsSystemSettingForm.vue +++ b/src/views/paper/question/WindowsSystemSettingForm.vue @@ -10,6 +10,22 @@ :rules="formRules" label-width="80px" > + + + + + + + + + + + 启用 + 禁用 + + + + @@ -75,21 +91,7 @@ /> - - - - - 启用 - 禁用 - - - - - - - - - +
diff --git a/src/views/paper/question/WpsPptxForm.vue b/src/views/paper/question/WpsPptxForm.vue index c56ce6d..c1a24a3 100644 --- a/src/views/paper/question/WpsPptxForm.vue +++ b/src/views/paper/question/WpsPptxForm.vue @@ -10,6 +10,22 @@ :rules="formRules" label-width="80px" > + + + + + + + + + + 启用 + 禁用 + + + + + @@ -75,21 +91,7 @@ /> - - - - - 启用 - 禁用 - - - - - - - - - +
diff --git a/src/views/paper/question/WpsWordForm.vue b/src/views/paper/question/WpsWordForm.vue index 21d001b..5688cca 100644 --- a/src/views/paper/question/WpsWordForm.vue +++ b/src/views/paper/question/WpsWordForm.vue @@ -10,6 +10,22 @@ :rules="formRules" label-width="80px" > + + + + + + + + + + + 启用 + 禁用 + + + + @@ -75,21 +91,7 @@ /> - - - - - 启用 - 禁用 - - - - - - - - - +
diff --git a/src/views/paper/question/WpsXlsxForm.vue b/src/views/paper/question/WpsXlsxForm.vue index 6373c5a..13906af 100644 --- a/src/views/paper/question/WpsXlsxForm.vue +++ b/src/views/paper/question/WpsXlsxForm.vue @@ -10,6 +10,22 @@ :rules="formRules" label-width="80px" > + + + + + + + + + + + 启用 + 禁用 + + + + @@ -75,21 +91,7 @@ /> - - - - - 启用 - 禁用 - - - - - - - - - +
diff --git a/src/views/task/exam/components/steps/step5/index.vue b/src/views/task/exam/components/steps/step5/index.vue index df2fa5d..56a1c0a 100644 --- a/src/views/task/exam/components/steps/step5/index.vue +++ b/src/views/task/exam/components/steps/step5/index.vue @@ -17,6 +17,7 @@ @keyup.enter="handleQuery" /> + 搜索 重置 @@ -35,6 +36,17 @@ > 添加学生 + + 按班级分配 + + + + + + + 全选 + + + +
+ + + + {{ item.name }} + + + + +
+
选择考场
+ + + {{ room.batch }} + + +
+
+ + + +
@@ -107,7 +169,9 @@ import * as SmsPersonlApi from '@/api/system/person'; import PersonEdit from './components/person-edit.vue'; import PersonSearch from './components/person-serach.vue' import StudentImportForm from './components/StudentImportForm.vue' +import * as ClassApi from '@/api/exam/class' import * as SmsChannelApi from '@/api/system/session'; +import * as PersonApi from '@/api/system/person' import { fa } from 'element-plus/es/locale'; defineOptions({ name: 'SystemSmsChannel' }) @@ -151,10 +215,15 @@ const queryParams = reactive({ pageNo: 1, pageSize: 10, batch: undefined, - status: undefined, createTime: [], taskId: props.taskId }) +const queryParamsSessions = reactive({ + pageNo: 1, + pageSize: 999, + status: 0, + taskId: props.taskId +}) /** 查询列表 */ const getList = async () => { loading.value = true @@ -200,6 +269,63 @@ const handleSelectionChange = (rows) => { } +const checkAll = ref(false); +const queDialogVisible = ref(false); +const currentSpNames = ref>([]); +const examRooms = ref>([]); +const selectedExamRoom = ref(null); +const openQueDialog =async () => { + currentSpNames.value = await ClassApi.ClassApi.getClassIdAndName() + // 获取考场列表 + const res = await SmsChannelApi.pageSessions(queryParamsSessions); + if (res.list) { + examRooms.value = res.list || []; // ✅ 把返回的列表存入考场数组 + } else { + examRooms.value = []; + } + queDialogVisible.value = true; +}; +const selectedQue = ref([]); + +watch(selectedQue, (val) => { + if (val.length === currentSpNames.value.length) { + checkAll.value = true; + } else { + checkAll.value = false; + } +}); + +const handleCheckAllChange = (val: boolean) => { + if (val) { + selectedQue.value = currentSpNames.value.map(item => item.id); + } else { + selectedQue.value = []; + } +}; + +const confirmQue = async () => { + try { + const payload = { + taskId: props.taskId, + classIds: selectedQue.value, // 数组形式传递 + sessionId:selectedExamRoom.value + }; + + console.log(payload) + await PersonApi.setSessionStu(payload) + ElMessage.success('设置成功'); + getList() + } catch (err) { + console.error(err); + } + + // 关闭弹窗 & 清空数据 + queDialogVisible.value = false; + selectedQue.value = []; + checkAll.value = false; +}; + + const selectedRows = ref([]); const handleDeletes = async () => { @@ -237,10 +363,6 @@ if(res =='删除成功'){ await getList() } catch {} } -const importFormRef = ref() -const handleImport = () => { - importFormRef.value.open() -} const openEdit = (type: string, row?: object) => { @@ -258,7 +380,10 @@ const openSearch = (type: string, row?: object) => { }) } - +const importFormRef = ref() +const handleImport = () => { + importFormRef.value.open() +} /** 删除按钮操作 */ const handleDelete = async (id: number) => { diff --git a/src/views/task/selftrans/collegeexam/components/steps/step5/index.vue b/src/views/task/selftrans/collegeexam/components/steps/step5/index.vue index ef536f0..56a1c0a 100644 --- a/src/views/task/selftrans/collegeexam/components/steps/step5/index.vue +++ b/src/views/task/selftrans/collegeexam/components/steps/step5/index.vue @@ -17,6 +17,7 @@ @keyup.enter="handleQuery" />
+ 搜索 重置 @@ -35,6 +36,17 @@ > 添加学生 + + 按班级分配 + + + + + + + 全选 + + + +
+ + + + {{ item.name }} + + + + +
+
选择考场
+ + + {{ room.batch }} + + +
+
+ + + +
@@ -106,8 +168,10 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import * as SmsPersonlApi from '@/api/system/person'; import PersonEdit from './components/person-edit.vue'; import PersonSearch from './components/person-serach.vue' -import * as SmsChannelApi from '@/api/system/session'; import StudentImportForm from './components/StudentImportForm.vue' +import * as ClassApi from '@/api/exam/class' +import * as SmsChannelApi from '@/api/system/session'; +import * as PersonApi from '@/api/system/person' import { fa } from 'element-plus/es/locale'; defineOptions({ name: 'SystemSmsChannel' }) @@ -151,10 +215,15 @@ const queryParams = reactive({ pageNo: 1, pageSize: 10, batch: undefined, - status: undefined, createTime: [], taskId: props.taskId }) +const queryParamsSessions = reactive({ + pageNo: 1, + pageSize: 999, + status: 0, + taskId: props.taskId +}) /** 查询列表 */ const getList = async () => { loading.value = true @@ -200,6 +269,63 @@ const handleSelectionChange = (rows) => { } +const checkAll = ref(false); +const queDialogVisible = ref(false); +const currentSpNames = ref>([]); +const examRooms = ref>([]); +const selectedExamRoom = ref(null); +const openQueDialog =async () => { + currentSpNames.value = await ClassApi.ClassApi.getClassIdAndName() + // 获取考场列表 + const res = await SmsChannelApi.pageSessions(queryParamsSessions); + if (res.list) { + examRooms.value = res.list || []; // ✅ 把返回的列表存入考场数组 + } else { + examRooms.value = []; + } + queDialogVisible.value = true; +}; +const selectedQue = ref([]); + +watch(selectedQue, (val) => { + if (val.length === currentSpNames.value.length) { + checkAll.value = true; + } else { + checkAll.value = false; + } +}); + +const handleCheckAllChange = (val: boolean) => { + if (val) { + selectedQue.value = currentSpNames.value.map(item => item.id); + } else { + selectedQue.value = []; + } +}; + +const confirmQue = async () => { + try { + const payload = { + taskId: props.taskId, + classIds: selectedQue.value, // 数组形式传递 + sessionId:selectedExamRoom.value + }; + + console.log(payload) + await PersonApi.setSessionStu(payload) + ElMessage.success('设置成功'); + getList() + } catch (err) { + console.error(err); + } + + // 关闭弹窗 & 清空数据 + queDialogVisible.value = false; + selectedQue.value = []; + checkAll.value = false; +}; + + const selectedRows = ref([]); const handleDeletes = async () => { @@ -238,10 +364,6 @@ if(res =='删除成功'){ } catch {} } -const importFormRef = ref() -const handleImport = () => { - importFormRef.value.open() -} const openEdit = (type: string, row?: object) => { showEdit.value = true @@ -258,7 +380,10 @@ const openSearch = (type: string, row?: object) => { }) } - +const importFormRef = ref() +const handleImport = () => { + importFormRef.value.open() +} /** 删除按钮操作 */ const handleDelete = async (id: number) => { diff --git a/src/views/task/selftrans/module/components/steps/step5/index.vue b/src/views/task/selftrans/module/components/steps/step5/index.vue index df2fa5d..56a1c0a 100644 --- a/src/views/task/selftrans/module/components/steps/step5/index.vue +++ b/src/views/task/selftrans/module/components/steps/step5/index.vue @@ -17,6 +17,7 @@ @keyup.enter="handleQuery" />
+ 搜索 重置 @@ -35,6 +36,17 @@ > 添加学生 + + 按班级分配 + + + + + + + 全选 + + + +
+ + + + {{ item.name }} + + + + +
+
选择考场
+ + + {{ room.batch }} + + +
+
+ + + +
@@ -107,7 +169,9 @@ import * as SmsPersonlApi from '@/api/system/person'; import PersonEdit from './components/person-edit.vue'; import PersonSearch from './components/person-serach.vue' import StudentImportForm from './components/StudentImportForm.vue' +import * as ClassApi from '@/api/exam/class' import * as SmsChannelApi from '@/api/system/session'; +import * as PersonApi from '@/api/system/person' import { fa } from 'element-plus/es/locale'; defineOptions({ name: 'SystemSmsChannel' }) @@ -151,10 +215,15 @@ const queryParams = reactive({ pageNo: 1, pageSize: 10, batch: undefined, - status: undefined, createTime: [], taskId: props.taskId }) +const queryParamsSessions = reactive({ + pageNo: 1, + pageSize: 999, + status: 0, + taskId: props.taskId +}) /** 查询列表 */ const getList = async () => { loading.value = true @@ -200,6 +269,63 @@ const handleSelectionChange = (rows) => { } +const checkAll = ref(false); +const queDialogVisible = ref(false); +const currentSpNames = ref>([]); +const examRooms = ref>([]); +const selectedExamRoom = ref(null); +const openQueDialog =async () => { + currentSpNames.value = await ClassApi.ClassApi.getClassIdAndName() + // 获取考场列表 + const res = await SmsChannelApi.pageSessions(queryParamsSessions); + if (res.list) { + examRooms.value = res.list || []; // ✅ 把返回的列表存入考场数组 + } else { + examRooms.value = []; + } + queDialogVisible.value = true; +}; +const selectedQue = ref([]); + +watch(selectedQue, (val) => { + if (val.length === currentSpNames.value.length) { + checkAll.value = true; + } else { + checkAll.value = false; + } +}); + +const handleCheckAllChange = (val: boolean) => { + if (val) { + selectedQue.value = currentSpNames.value.map(item => item.id); + } else { + selectedQue.value = []; + } +}; + +const confirmQue = async () => { + try { + const payload = { + taskId: props.taskId, + classIds: selectedQue.value, // 数组形式传递 + sessionId:selectedExamRoom.value + }; + + console.log(payload) + await PersonApi.setSessionStu(payload) + ElMessage.success('设置成功'); + getList() + } catch (err) { + console.error(err); + } + + // 关闭弹窗 & 清空数据 + queDialogVisible.value = false; + selectedQue.value = []; + checkAll.value = false; +}; + + const selectedRows = ref([]); const handleDeletes = async () => { @@ -237,10 +363,6 @@ if(res =='删除成功'){ await getList() } catch {} } -const importFormRef = ref() -const handleImport = () => { - importFormRef.value.open() -} const openEdit = (type: string, row?: object) => { @@ -258,7 +380,10 @@ const openSearch = (type: string, row?: object) => { }) } - +const importFormRef = ref() +const handleImport = () => { + importFormRef.value.open() +} /** 删除按钮操作 */ const handleDelete = async (id: number) => { diff --git a/src/views/task/selftrans/random/components/steps/step5/index.vue b/src/views/task/selftrans/random/components/steps/step5/index.vue index 4b7c50d..56a1c0a 100644 --- a/src/views/task/selftrans/random/components/steps/step5/index.vue +++ b/src/views/task/selftrans/random/components/steps/step5/index.vue @@ -17,6 +17,7 @@ @keyup.enter="handleQuery" />
+ 搜索 重置 @@ -35,6 +36,17 @@ > 添加学生 + + 按班级分配 + + + + + + + 全选 + + + +
+ + + + {{ item.name }} + + + + +
+
选择考场
+ + + {{ room.batch }} + + +
+
+ + + +
@@ -107,7 +169,9 @@ import * as SmsPersonlApi from '@/api/system/person'; import PersonEdit from './components/person-edit.vue'; import PersonSearch from './components/person-serach.vue' import StudentImportForm from './components/StudentImportForm.vue' +import * as ClassApi from '@/api/exam/class' import * as SmsChannelApi from '@/api/system/session'; +import * as PersonApi from '@/api/system/person' import { fa } from 'element-plus/es/locale'; defineOptions({ name: 'SystemSmsChannel' }) @@ -151,10 +215,15 @@ const queryParams = reactive({ pageNo: 1, pageSize: 10, batch: undefined, - status: undefined, createTime: [], taskId: props.taskId }) +const queryParamsSessions = reactive({ + pageNo: 1, + pageSize: 999, + status: 0, + taskId: props.taskId +}) /** 查询列表 */ const getList = async () => { loading.value = true @@ -200,6 +269,63 @@ const handleSelectionChange = (rows) => { } +const checkAll = ref(false); +const queDialogVisible = ref(false); +const currentSpNames = ref>([]); +const examRooms = ref>([]); +const selectedExamRoom = ref(null); +const openQueDialog =async () => { + currentSpNames.value = await ClassApi.ClassApi.getClassIdAndName() + // 获取考场列表 + const res = await SmsChannelApi.pageSessions(queryParamsSessions); + if (res.list) { + examRooms.value = res.list || []; // ✅ 把返回的列表存入考场数组 + } else { + examRooms.value = []; + } + queDialogVisible.value = true; +}; +const selectedQue = ref([]); + +watch(selectedQue, (val) => { + if (val.length === currentSpNames.value.length) { + checkAll.value = true; + } else { + checkAll.value = false; + } +}); + +const handleCheckAllChange = (val: boolean) => { + if (val) { + selectedQue.value = currentSpNames.value.map(item => item.id); + } else { + selectedQue.value = []; + } +}; + +const confirmQue = async () => { + try { + const payload = { + taskId: props.taskId, + classIds: selectedQue.value, // 数组形式传递 + sessionId:selectedExamRoom.value + }; + + console.log(payload) + await PersonApi.setSessionStu(payload) + ElMessage.success('设置成功'); + getList() + } catch (err) { + console.error(err); + } + + // 关闭弹窗 & 清空数据 + queDialogVisible.value = false; + selectedQue.value = []; + checkAll.value = false; +}; + + const selectedRows = ref([]); const handleDeletes = async () => { @@ -237,10 +363,7 @@ if(res =='删除成功'){ await getList() } catch {} } -const importFormRef = ref() -const handleImport = () => { - importFormRef.value.open() -} + const openEdit = (type: string, row?: object) => { showEdit.value = true @@ -257,7 +380,10 @@ const openSearch = (type: string, row?: object) => { }) } - +const importFormRef = ref() +const handleImport = () => { + importFormRef.value.open() +} /** 删除按钮操作 */ const handleDelete = async (id: number) => { diff --git a/src/views/task/sprint/components/steps/step5/index.vue b/src/views/task/sprint/components/steps/step5/index.vue index d209b64..56a1c0a 100644 --- a/src/views/task/sprint/components/steps/step5/index.vue +++ b/src/views/task/sprint/components/steps/step5/index.vue @@ -17,10 +17,11 @@ @keyup.enter="handleQuery" />
+ 搜索 重置 - 添加学生 + + 按班级分配 + + + + + + + 全选 + + + +
+ + + + {{ item.name }} + + + + +
+
选择考场
+ + + {{ room.batch }} + + +
+
+ + + +
@@ -107,7 +169,9 @@ import * as SmsPersonlApi from '@/api/system/person'; import PersonEdit from './components/person-edit.vue'; import PersonSearch from './components/person-serach.vue' import StudentImportForm from './components/StudentImportForm.vue' +import * as ClassApi from '@/api/exam/class' import * as SmsChannelApi from '@/api/system/session'; +import * as PersonApi from '@/api/system/person' import { fa } from 'element-plus/es/locale'; defineOptions({ name: 'SystemSmsChannel' }) @@ -151,10 +215,15 @@ const queryParams = reactive({ pageNo: 1, pageSize: 10, batch: undefined, - status: undefined, createTime: [], taskId: props.taskId }) +const queryParamsSessions = reactive({ + pageNo: 1, + pageSize: 999, + status: 0, + taskId: props.taskId +}) /** 查询列表 */ const getList = async () => { loading.value = true @@ -200,6 +269,63 @@ const handleSelectionChange = (rows) => { } +const checkAll = ref(false); +const queDialogVisible = ref(false); +const currentSpNames = ref>([]); +const examRooms = ref>([]); +const selectedExamRoom = ref(null); +const openQueDialog =async () => { + currentSpNames.value = await ClassApi.ClassApi.getClassIdAndName() + // 获取考场列表 + const res = await SmsChannelApi.pageSessions(queryParamsSessions); + if (res.list) { + examRooms.value = res.list || []; // ✅ 把返回的列表存入考场数组 + } else { + examRooms.value = []; + } + queDialogVisible.value = true; +}; +const selectedQue = ref([]); + +watch(selectedQue, (val) => { + if (val.length === currentSpNames.value.length) { + checkAll.value = true; + } else { + checkAll.value = false; + } +}); + +const handleCheckAllChange = (val: boolean) => { + if (val) { + selectedQue.value = currentSpNames.value.map(item => item.id); + } else { + selectedQue.value = []; + } +}; + +const confirmQue = async () => { + try { + const payload = { + taskId: props.taskId, + classIds: selectedQue.value, // 数组形式传递 + sessionId:selectedExamRoom.value + }; + + console.log(payload) + await PersonApi.setSessionStu(payload) + ElMessage.success('设置成功'); + getList() + } catch (err) { + console.error(err); + } + + // 关闭弹窗 & 清空数据 + queDialogVisible.value = false; + selectedQue.value = []; + checkAll.value = false; +}; + + const selectedRows = ref([]); const handleDeletes = async () => { @@ -259,7 +385,6 @@ const handleImport = () => { importFormRef.value.open() } - /** 删除按钮操作 */ const handleDelete = async (id: number) => { try { diff --git a/src/views/task/trans/components/steps/step5/index.vue b/src/views/task/trans/components/steps/step5/index.vue index ea32bb8..56a1c0a 100644 --- a/src/views/task/trans/components/steps/step5/index.vue +++ b/src/views/task/trans/components/steps/step5/index.vue @@ -36,6 +36,17 @@ > 添加学生
+ + 按班级分配 + + + + + + + 全选 + + + +
+ + + + {{ item.name }} + + + + +
+
选择考场
+ + + {{ room.batch }} + + +
+
+ + + +
@@ -108,7 +169,9 @@ import * as SmsPersonlApi from '@/api/system/person'; import PersonEdit from './components/person-edit.vue'; import PersonSearch from './components/person-serach.vue' import StudentImportForm from './components/StudentImportForm.vue' +import * as ClassApi from '@/api/exam/class' import * as SmsChannelApi from '@/api/system/session'; +import * as PersonApi from '@/api/system/person' import { fa } from 'element-plus/es/locale'; defineOptions({ name: 'SystemSmsChannel' }) @@ -155,6 +218,12 @@ const queryParams = reactive({ createTime: [], taskId: props.taskId }) +const queryParamsSessions = reactive({ + pageNo: 1, + pageSize: 999, + status: 0, + taskId: props.taskId +}) /** 查询列表 */ const getList = async () => { loading.value = true @@ -200,6 +269,63 @@ const handleSelectionChange = (rows) => { } +const checkAll = ref(false); +const queDialogVisible = ref(false); +const currentSpNames = ref>([]); +const examRooms = ref>([]); +const selectedExamRoom = ref(null); +const openQueDialog =async () => { + currentSpNames.value = await ClassApi.ClassApi.getClassIdAndName() + // 获取考场列表 + const res = await SmsChannelApi.pageSessions(queryParamsSessions); + if (res.list) { + examRooms.value = res.list || []; // ✅ 把返回的列表存入考场数组 + } else { + examRooms.value = []; + } + queDialogVisible.value = true; +}; +const selectedQue = ref([]); + +watch(selectedQue, (val) => { + if (val.length === currentSpNames.value.length) { + checkAll.value = true; + } else { + checkAll.value = false; + } +}); + +const handleCheckAllChange = (val: boolean) => { + if (val) { + selectedQue.value = currentSpNames.value.map(item => item.id); + } else { + selectedQue.value = []; + } +}; + +const confirmQue = async () => { + try { + const payload = { + taskId: props.taskId, + classIds: selectedQue.value, // 数组形式传递 + sessionId:selectedExamRoom.value + }; + + console.log(payload) + await PersonApi.setSessionStu(payload) + ElMessage.success('设置成功'); + getList() + } catch (err) { + console.error(err); + } + + // 关闭弹窗 & 清空数据 + queDialogVisible.value = false; + selectedQue.value = []; + checkAll.value = false; +}; + + const selectedRows = ref([]); const handleDeletes = async () => {