diff --git a/src/views/monitor/monitor/MonitorForm.vue b/src/views/monitor/monitor/MonitorForm.vue index bfdf0fa..496101d 100644 --- a/src/views/monitor/monitor/MonitorForm.vue +++ b/src/views/monitor/monitor/MonitorForm.vue @@ -16,7 +16,7 @@ - + 请选择字典生成 diff --git a/src/views/monitor/monitor/index.vue b/src/views/monitor/monitor/index.vue index 211dfc6..74ab4c9 100644 --- a/src/views/monitor/monitor/index.vue +++ b/src/views/monitor/monitor/index.vue @@ -175,7 +175,7 @@ - + diff --git a/src/views/paper/audit/index.vue b/src/views/paper/audit/index.vue index 8e372f9..d3260c5 100644 --- a/src/views/paper/audit/index.vue +++ b/src/views/paper/audit/index.vue @@ -398,9 +398,6 @@ const confirmSync = () => { ElMessage.error('推送失败'); }); } - - - }; const connectSchoolAll = () => { diff --git a/src/views/paper/question/index.vue b/src/views/paper/question/index.vue index e4e69d5..4d61c48 100644 --- a/src/views/paper/question/index.vue +++ b/src/views/paper/question/index.vue @@ -113,16 +113,27 @@ - + - 推送试题 + 推送审核试题 + + + 推送试题 - + + @@ -244,6 +255,74 @@ + + + + + + + + + + + + + + + + + 搜索 + + + 重置 + + + + + + + + + + + + + + + + + + + + @@ -287,6 +366,7 @@ const { t } = useI18n() // 国际化 const loading = ref(true) // 列表的加载中 const total = ref(0) // 列表的总页数 const list = ref([]) // 列表的数 + const queryParams = reactive({ specialtyName: "", courseName: "", @@ -295,6 +375,7 @@ const queryParams = reactive({ chapteridDictText:"", pageNo: 1, pageSize: 10, + audit:"" }) const queryFormRef = ref() // 搜索的表单 const specialtyList = ref([]) // 树形结构 @@ -312,7 +393,7 @@ const getTreePoint = async () => { respoint.value.push(...handleTree(res)) } - +const syncDialogVisible = ref(false) /** 查询列表 */ const getList = async () => { @@ -395,6 +476,17 @@ const handleSpecialtyNodeClick = async (row: any) => { const handleSelectionChange = (rows) => { selections.value = rows; } + + const selectedSchool = ref([]); + +const handleSelectionChangeSchool = (rows) => { + selectedSchool.value = rows; +} + + + + + const selectedRows = ref([]) const handleAudit = async () => { try { @@ -411,12 +503,105 @@ const handleAudit = async () => { type: '0', quIds: selectedRows.value } - await QuestionApi.auditQuestion(requestBody) + // await QuestionApi.auditQuestion(requestBody) message.success(t('推送成功')) // 刷新列表 await getList() } catch {} } +const queryParamsSchool = reactive({ + name:'', + pageNo: 1, + pageSize: 10, +}) +const totalSchool = ref(0) // 列表的总页数 +const listSchool = ref([]) // 列表的数 +const schoolNameList = ref(); +const loadingSchool = ref(true) +const handleTUI = async () => { + try { + const rows = selections.value; + if (!rows.length) { + message.error('请至少选择一条数据'); + return; + } + + selectedRows.value = rows.map((d: any) => d.quId); +getSchoolList(); + syncDialogVisible.value = true + + } catch {} +} +const getSchoolList = async () => { + loadingSchool.value = true + try { + const data = await QuestionApi.getSchoolName(queryParamsSchool); + + listSchool.value = data.list + totalSchool.value = data.total + } finally { + loadingSchool.value = false + } +} +const handleQuerySchool = () => { + queryParamsSchool.pageNo = 1 + getSchoolList() +} +const handleCloseSyncDialog = () => { + syncDialogVisible.value = false + queryParamsSchool.name = '' + listSchool.value = [] + totalSchool.value = 0 +} +const confirmSync = () => { + if (selectedSchool.value.length === 0) { + ElMessage.warning('请先选择要同步的学校'); + return; + } + + const selectedIds = selectedSchool.value.map(item => item.ququeName); + console.log('选中的ID:', selectedIds); + + const rows = selections.value; + selectedRows.value = rows.map((d: any) => d.quId); + console.log(selectedRows.value+"选中的试题") + + const payload = { + queueNames: selectedIds, + questionIds: selectedRows.value + }; + console.log(payload+"payload") + QuestionApi.doPush(payload).then( + () => { + ElMessage.success('推送成功'); + syncDialogVisible.value = false; + getList(); + } + +).catch(() => { + ElMessage.error('推送失败'); + } + +); + +}; +const connectSchoolAll = () => { + if (selectedSchool.value.length === 0) { + ElMessage.warning('请先选择要连接的学校'); + return; + } + const selectedIds = selectedSchool.value.map(item => item.ququeName); + console.log('选中的ID:', selectedIds); + + QuestionApi.connectSchoolAll(selectedIds).then(() => { + ElMessage.success('连接成功'); + }).catch(() => { + ElMessage.error('同步失败'); + }); +}; + + + const connectTent = async () => { try { const res = await QuestionApi.rabbitmqConnect(); diff --git a/src/views/task/exam/components/task-add.vue b/src/views/task/exam/components/task-add.vue index 14e2504..2181516 100644 --- a/src/views/task/exam/components/task-add.vue +++ b/src/views/task/exam/components/task-add.vue @@ -200,13 +200,8 @@ const fetchSpecialtyOptions = async () => { /** 弹窗打开事件 */ const open = () => { - if (props.data) { - assignFields(props.data); - isUpdate.value = true; - } else { resetFields(); - isUpdate.value = false; - } + // 设置批次为 当前时间 + 5位随机数 const now = new Date(); const pad = (n) => n.toString().padStart(2, '0'); diff --git a/src/views/task/exam/components/task-edit.vue b/src/views/task/exam/components/task-edit.vue index f3acd8b..fa3df6b 100644 --- a/src/views/task/exam/components/task-edit.vue +++ b/src/views/task/exam/components/task-edit.vue @@ -1,6 +1,6 @@