diff --git a/src/api/monitor/index.ts b/src/api/monitor/index.ts index f70dea5..7034f6b 100644 --- a/src/api/monitor/index.ts +++ b/src/api/monitor/index.ts @@ -54,6 +54,8 @@ export const MonitorApi = { updateMonitorStatus:async( data)=>{ return await request.post({ url: `/exam/monitor/updateMonitorStatus` , data }) - } - + }, + getMonitorTaskPage: async (params: any) => { + return await request.get({ url: `/exam/monitorTask/page`, params }) + }, } diff --git a/src/api/system/scheme/index.ts b/src/api/system/scheme/index.ts index 4296307..c445ce2 100644 --- a/src/api/system/scheme/index.ts +++ b/src/api/system/scheme/index.ts @@ -36,11 +36,7 @@ export async function addScheme(data) { * 修改试卷方案 */ export async function updateScheme(data) { - - return await request.put({ url: '/exam/scheme' , data }) - - } /** diff --git a/src/views/monitor/monitor/index.vue b/src/views/monitor/monitor/index.vue index be0c31c..39d25a0 100644 --- a/src/views/monitor/monitor/index.vue +++ b/src/views/monitor/monitor/index.vue @@ -5,7 +5,7 @@ - 代考 + 待考 考试中 考试完成 @@ -17,7 +17,23 @@ 确认 + + + + @@ -226,10 +242,22 @@ import download from '@/utils/download' import { MonitorApi, MonitorVO } from '@/api/monitor' import MonitorForm from './MonitorForm.vue' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' +import taskMonitor from './task-monitor.vue' import * as ClassApi from '@/api/exam/class' + +import { ref } from 'vue' + +const selectedTaskId = ref(null) + +// 接收子组件传递的taskId +const handleTaskSelected = (taskId: string) => { + queryParams.taskId = taskId + console.log('父组件接收到的taskId:', taskId) +} /** 监控管理 列表 */ defineOptions({ name: 'Monitor' }) - +// 新增:初始弹框开关 +const initDialogVisible = ref(true); // 弹窗开关 const dialogVisible = ref(false) const message = useMessage() // 消息弹窗 @@ -242,7 +270,8 @@ const classNameList = ref(); const queryParams = reactive({ pageNo: 1, pageSize: 10, - monitorId:'', + monitorId:undefined, + taskId:'', username: undefined, nickname: undefined, taskType:undefined, @@ -264,6 +293,7 @@ const getList = async () => { classNameList.value = await ClassApi.ClassApi.getClassName() try { const data = await MonitorApi.getMonitorPage(queryParams) + queryParams.taskId = '' list.value = data.list total.value = data.total } finally { @@ -342,6 +372,7 @@ const openForm = (type: string, id?: number) => { ElMessage.success('考试状态更新成功') dialogVisible.value = false + getList() } /** 删除按钮操作 */ const handleDelete = async (id: number) => { @@ -395,9 +426,20 @@ const fetchTaskList = async (taskType: string) => { console.error('获取试卷任务失败', error) } } +const handleNextStep = () => { + getList() + initDialogVisible.value = false +} +const handleNextStepCancel = () => { + queryParams.taskId = '' + getList() + initDialogVisible.value = false +} + /** 初始化 **/ onMounted(() => { - getList() + + initDialogVisible.value = true; // 显示初始弹框 }) \ No newline at end of file diff --git a/src/views/monitor/monitor/task-monitor.vue b/src/views/monitor/monitor/task-monitor.vue new file mode 100644 index 0000000..2871a40 --- /dev/null +++ b/src/views/monitor/monitor/task-monitor.vue @@ -0,0 +1,284 @@ + + + \ No newline at end of file diff --git a/src/views/task/exam/components/steps/step1/components/step-edit.vue b/src/views/task/exam/components/steps/step1/components/step-edit.vue index 993aeef..385898a 100644 --- a/src/views/task/exam/components/steps/step1/components/step-edit.vue +++ b/src/views/task/exam/components/steps/step1/components/step-edit.vue @@ -87,7 +87,7 @@ - + @@ -168,7 +168,6 @@ const form = ref<{ const rules = reactive({ spName: [{ required: true, message: '请选择题型', trigger: 'change' }], quLevel: [{ required: true, message: '请选择难度', trigger: 'change' }], - sort: [{ required: true, message: '请设置排序', trigger: 'change' }], quTitle: [{ required: true, message: '请输入别名', trigger: 'change' }], pointName: [{ required: true, message: '请选择知识点', trigger: 'change' }], quNumbers: [{ required: true, message: '请输入试题数量', trigger: 'blur' }], @@ -223,11 +222,29 @@ const open = async (type: 'create' | 'update', data?: any) => { sort: undefined, taskSpecialty: props.taskSpecialty } + // 清除校验 + await nextTick() + const allKeys = getAllTreeKeys(pointOptions.value).map(String) + form.value.pointName = allKeys + treeRef.value?.setCheckedKeys(allKeys) } - // 清除校验 - await nextTick() - formRef.value?.clearValidate?.() + +} +function getAllTreeKeys(tree: TreeNode[]): number[] { + const keys: number[] = [] + + const traverse = (nodes: TreeNode[]) => { + for (const node of nodes) { + keys.push(node.value) + if (node.children?.length) { + traverse(node.children) + } + } + } + + traverse(tree) + return keys } /** --------- 拉取扁平知识点并建树 --------- **/ diff --git a/src/views/task/exam/components/steps/step1/index.vue b/src/views/task/exam/components/steps/step1/index.vue index c4ddf8d..d0d52eb 100644 --- a/src/views/task/exam/components/steps/step1/index.vue +++ b/src/views/task/exam/components/steps/step1/index.vue @@ -36,7 +36,7 @@ - + - - + + + + + - - - + + + +