From a9bb47c4438a2fa6d329c8eeac2923f6537da358 Mon Sep 17 00:00:00 2001 From: "YOHO\\20373" <2037305722@qq.com> Date: Fri, 23 May 2025 11:13:17 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E8=AF=95=E9=A2=98=E7=95=8C=E9=9D=A2=EF=BC=8C=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E8=AF=95=E9=A2=98=E6=8C=89=E9=92=AE=E6=9D=83=E9=99=90?= =?UTF-8?q?=EF=BC=8C=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/monitor/monitor/MonitorForm.vue | 2 +- src/views/monitor/monitor/index.vue | 2 +- src/views/paper/audit/index.vue | 3 - src/views/paper/question/index.vue | 195 +++++++++++++++++- src/views/task/exam/components/task-add.vue | 7 +- src/views/task/exam/components/task-edit.vue | 2 +- .../collegeexam/components/task-add.vue | 3 +- .../collegeexam/components/task-edit.vue | 2 +- .../selftrans/module/components/task-add.vue | 2 +- .../selftrans/module/components/task-edit.vue | 2 +- .../selftrans/random/components/task-add.vue | 2 +- .../selftrans/random/components/task-edit.vue | 2 +- src/views/task/sprint/components/task-add.vue | 1 + .../task/sprint/components/task-edit.vue | 2 +- src/views/task/trans/components/task-add.vue | 1 + src/views/task/trans/components/task-edit.vue | 2 +- 16 files changed, 205 insertions(+), 25 deletions(-) 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 @@