diff --git a/src/api/monitor/index.ts b/src/api/monitor/index.ts
index 0d1184a..f70dea5 100644
--- a/src/api/monitor/index.ts
+++ b/src/api/monitor/index.ts
@@ -45,4 +45,15 @@ export const MonitorApi = {
exportMonitor: async (params) => {
return await request.download({ url: `/exam/monitor/export-excel`, params })
},
+
+
+ getPaperTaskList: async (id: string) => {
+ return await request.get({ url: `/exam/monitor/getPaperTaskList?id=` + id })
+ },
+
+
+ updateMonitorStatus:async( data)=>{
+ return await request.post({ url: `/exam/monitor/updateMonitorStatus` , data })
+ }
+
}
diff --git a/src/views/monitor/monitor/index.vue b/src/views/monitor/monitor/index.vue
index ac40647..be0c31c 100644
--- a/src/views/monitor/monitor/index.vue
+++ b/src/views/monitor/monitor/index.vue
@@ -1,4 +1,24 @@
+
+
+
+
+
+
+ 代考
+ 考试中
+ 考试完成
+
+
+
+
+
+ 取消
+ 确认
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
搜索
重置
+ 考试状态改变
-
+
+
@@ -115,6 +167,11 @@
+
+
+
+
+
(null);
const loading = ref(true) // 列表的加载中
const list = ref([]) // 列表的数据
const total = ref(0) // 列表的总页数
+const classNameList = ref();
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
+ monitorId:'',
username: undefined,
nickname: undefined,
+ taskType:undefined,
className: undefined,
examStatus: undefined,
score: undefined,
@@ -194,10 +257,11 @@ const queryParams = reactive({
})
const queryFormRef = ref() // 搜索的表单
const exportLoading = ref(false) // 导出的加载中
-
+const taskTypeyOptions = ref([])
/** 查询列表 */
const getList = async () => {
loading.value = true
+ classNameList.value = await ClassApi.ClassApi.getClassName()
try {
const data = await MonitorApi.getMonitorPage(queryParams)
list.value = data.list
@@ -206,6 +270,27 @@ const getList = async () => {
loading.value = false
}
}
+
+// 打开弹窗
+
+const openDialog = async () => {
+ const rows = selections.value;
+ if (!rows.length) {
+ message.error('请至少选择一条数据');
+ return;
+ }
+
+ dialogVisible.value = true
+ selections.value = rows;
+
+}
+
+ /** 表格选中数据 */
+const selections = ref([]);
+const taskList = ref([]);
+const handleSelectionChange = (rows) => {
+ selections.value = rows;
+}
const dateFormatterMin = (row, column, cellValue) => {
if (cellValue == null || isNaN(cellValue)) return '-';
@@ -236,7 +321,28 @@ const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
+// 提交状态变更
+ const confirmChange = async () => {
+ if (selectedStatus.value === null) {
+ ElMessage.error('请选择考试状态');
+ return;
+ }
+
+ const rows = selections.value;
+
+ const monitorIds = rows.map((row: any) => row.monitorId);
+
+
+ await MonitorApi.updateMonitorStatus({
+ monitorIds, // 这是数组
+ status: selectedStatus.value // 这是 0,1,2
+ });
+
+
+ ElMessage.success('考试状态更新成功')
+ dialogVisible.value = false
+ }
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
@@ -250,18 +356,43 @@ const handleDelete = async (id: number) => {
} catch {}
}
+const selectedRows = ref([]);
/** 导出按钮操作 */
const handleExport = async () => {
+ const rows = selections.value;
+ if (!rows.length) {
+ message.error('请至少选择一条数据');
+ return;
+ }
+console.log(rows.length)
try {
// 导出的二次确认
- await message.exportConfirm()
- // 发起导出
- exportLoading.value = true
- const data = await MonitorApi.exportMonitor(queryParams)
- download.excel(data, '监控管理.xls')
+ await message.exportConfirm();
+
+ // 将选中的 monitorId 填入 queryParams
+ queryParams.monitorId = rows.map((row: any) => row.monitorId).join(',');
+
+ exportLoading.value = true;
+
+ const data = await MonitorApi.exportMonitor(queryParams);
+ download.excel(data, '监控管理.xls');
} catch {
+ // 可选:错误处理
} finally {
- exportLoading.value = false
+ exportLoading.value = false;
+
+ // 导出后重置 monitorId,避免影响后续查询
+ queryParams.monitorId = '';
+ }
+}
+const fetchTaskList = async (taskType: string) => {
+
+ try {
+ const res = await MonitorApi.getPaperTaskList( taskType )
+ taskList.value = res
+ } catch (error) {
+ taskList.value = []
+ console.error('获取试卷任务失败', error)
}
}
diff --git a/src/views/task/exam/components/steps/step3/index.vue b/src/views/task/exam/components/steps/step3/index.vue
index d0e7e48..0416f21 100644
--- a/src/views/task/exam/components/steps/step3/index.vue
+++ b/src/views/task/exam/components/steps/step3/index.vue
@@ -5,6 +5,10 @@
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -49,8 +101,9 @@
最新成绩
-
-
+
+
+
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -49,8 +101,9 @@
最新成绩
-
-
+
+
+
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -49,8 +101,9 @@
最新成绩
-
-
+
+
+
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -49,8 +101,9 @@
最新成绩
-
-
+
+
+
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -49,8 +101,9 @@
最新成绩
-
-
+
+
+
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -49,8 +101,9 @@
最新成绩
-
-
+
+
+
-
+
+
+
+
+
@@ -17,6 +20,51 @@
@change="handleFormChange" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -49,8 +101,9 @@
最新成绩
-
-
+
+
+
-
+
+
-
+