【修改】 试题审核,试题推送、同步
This commit is contained in:
@@ -26,7 +26,10 @@ export const getQuestionAuditList = (params: QuestionQueryVO) => {
|
||||
|
||||
|
||||
export async function auditQuestion(data) {
|
||||
return await request.post({ url: '/rabbitmq/send' ,data })
|
||||
return await request.post({ url: '/rabbitmq/sendAudio' ,data })
|
||||
}
|
||||
export async function auditQuestionTrue(data) {
|
||||
return await request.post({ url: '/exam/question/auditQuestion' ,data })
|
||||
}
|
||||
export async function rabbitmqConnect() {
|
||||
return await request.post({ url: '/rabbitmq/connect' })
|
||||
|
@@ -113,9 +113,22 @@
|
||||
</el-form-item>
|
||||
<!-- 审核按钮单独显示在下一行 -->
|
||||
<el-form-item>
|
||||
<el-button v-if="queryParams.audit === '1'" type="primary" plain @click="handleAudit()">
|
||||
<el-button
|
||||
v-if="queryParams.audit === '1' && sendAudio"
|
||||
type="primary"
|
||||
plain
|
||||
@click="handleAudit()"
|
||||
>
|
||||
<Icon icon="ep:plus" /> 推送审核试题
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="queryParams.audit === '1' && audioTrue"
|
||||
type="primary"
|
||||
plain
|
||||
@click="handleAuditTrue('True')"
|
||||
>
|
||||
<Icon icon="ep:plus" /> 审核试题
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="queryParams.audit === '' || queryParams.audit === '0'"
|
||||
type="primary"
|
||||
@@ -197,7 +210,7 @@
|
||||
prop="version"
|
||||
:show-overflow-tooltip="true"
|
||||
/> -->
|
||||
<el-table-column label="状态" key="status">
|
||||
<el-table-column label="状态" key="status" :show-overflow-tooltip="true">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
@@ -207,6 +220,18 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="归属"
|
||||
align="center"
|
||||
prop="schoolName"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建教师"
|
||||
align="center"
|
||||
prop="createTeacher"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
@@ -240,8 +265,8 @@
|
||||
<!-- 同步弹框 -->
|
||||
<el-dialog
|
||||
v-model="syncDialogVisible"
|
||||
:title="'同步试题'"
|
||||
width="800px"
|
||||
:title="'选择推送考点服务器'"
|
||||
width="500px"
|
||||
:before-close="handleCloseSyncDialog"
|
||||
>
|
||||
<ContentWrap>
|
||||
@@ -253,26 +278,23 @@
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="学校" prop="name">
|
||||
<el-form-item label="" prop="name">
|
||||
<el-input
|
||||
v-model="queryParamsSchool.name"
|
||||
placeholder="请输入学校名称"
|
||||
placeholder="请输入考点服务器"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
class="!w-190px"
|
||||
@keyup.enter="handleQuerySchool"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuerySchool">
|
||||
<Icon icon="ep:search" class="mr-5px" /> 搜索
|
||||
</el-button>
|
||||
|
||||
<el-button @click="resetQuerySchool"><Icon icon="ep:refresh" />重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<ContentWrap>
|
||||
<el-table
|
||||
v-loading="loadingSchool"
|
||||
@@ -280,8 +302,8 @@
|
||||
@selection-change="handleSelectionChangeSchool"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" label="编号" align="center" prop="id" />
|
||||
<el-table-column label="学校" align="center" prop="name" />
|
||||
<el-table-column label="编号" align="center" prop="id" width="60" />
|
||||
<el-table-column label="考点服务器" align="center" prop="name" />
|
||||
</el-table>
|
||||
<Pagination
|
||||
:total="totalSchool"
|
||||
@@ -290,7 +312,6 @@
|
||||
@pagination="getSchoolList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleCloseSyncDialog">取消</el-button>
|
||||
@@ -316,13 +337,13 @@
|
||||
<FdesignForm ref="fformRef" @success="getList" />
|
||||
<WpsWordForm ref="wformRef" @success="getList" />
|
||||
<WpsPptxForm ref="pformRef" @success="getList" />
|
||||
<SettingForm ref="setformRef" @success="getList"/>
|
||||
<SettingForm ref="setformRef" @success="getList" />
|
||||
<EmailForm ref="emailformRef" @success="getList" />
|
||||
<WpsExcelForm ref="xlsxformRef" @success="getList" />
|
||||
<PsForm ref="psformRef" @success="getList" />
|
||||
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { getAccessToken, getRefreshToken, getTenantId, removeToken, setToken } from '@/utils/auth'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
@@ -348,6 +369,7 @@ import SpecialtyTree from './SpecialtyTree.vue'
|
||||
import { handleTree } from '@/utils/tree'
|
||||
import * as SpecialtyApi from '@/api/points'
|
||||
import { useSettingStore } from '@/store/modules/settings'
|
||||
import { TaskStatusEnum } from '@/api/bpm/task'
|
||||
const settingStore = useSettingStore()
|
||||
defineOptions({ name: 'SystemUser' })
|
||||
|
||||
@@ -373,6 +395,8 @@ const queryParams = reactive({
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const specialtyList = ref<Tree[]>([]) // 树形结构
|
||||
const respoint = ref<Tree[]>([]) // 树形结构
|
||||
const sendAudio = ref(false) // 是否显示推送审核试题按钮
|
||||
const audioTrue = ref(false) // 是否显示审核试题按钮
|
||||
|
||||
/** 获得部门树 */
|
||||
const getTree = async () => {
|
||||
@@ -498,13 +522,11 @@ const handleAudit = async () => {
|
||||
message.error('请至少选择一条数据')
|
||||
return
|
||||
}
|
||||
|
||||
selectedRows.value = rows.map((d: any) => d.quId)
|
||||
console.log(selectedRows.value)
|
||||
|
||||
const requestBody = {
|
||||
type: '0',
|
||||
quIds: selectedRows.value
|
||||
type: '1',
|
||||
queueNames: '1_Queue',
|
||||
questionIds: selectedRows.value
|
||||
}
|
||||
await QuestionApi.auditQuestion(requestBody)
|
||||
message.success(t('推送成功'))
|
||||
@@ -512,6 +534,29 @@ const handleAudit = async () => {
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
// 审核试题
|
||||
const handleAuditTrue = async (status: string) => {
|
||||
try {
|
||||
if (!connectTentStatus.value) {
|
||||
message.error('请先连接服务器')
|
||||
return
|
||||
}
|
||||
const rows = selections.value
|
||||
if (!rows.length) {
|
||||
message.error('请至少选择一条数据')
|
||||
return
|
||||
}
|
||||
selectedRows.value = rows.map((d: any) => d.quId)
|
||||
const requestBody = {
|
||||
type: status,
|
||||
quIds: selectedRows.value
|
||||
}
|
||||
await QuestionApi.auditQuestionTrue(requestBody)
|
||||
message.success(t('审核成功'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
const queryParamsSchool = reactive({
|
||||
name: '',
|
||||
pageNo: 1,
|
||||
@@ -521,6 +566,7 @@ const totalSchool = ref(0) // 列表的总页数
|
||||
const listSchool = ref([]) // 列表的数
|
||||
const schoolNameList = ref()
|
||||
const loadingSchool = ref(true)
|
||||
const connectTentStatus = ref(false)
|
||||
const handleTUI = async () => {
|
||||
try {
|
||||
const rows = selections.value
|
||||
@@ -607,14 +653,18 @@ const connectSchoolAll = () => {
|
||||
const connectTent = async () => {
|
||||
try {
|
||||
const res = await QuestionApi.rabbitmqConnect()
|
||||
console.log(res)
|
||||
message.success(t(res))
|
||||
connectTentStatus.value = true
|
||||
} catch (error: any) {
|
||||
message.error(t(`连接失败: ${error?.message || '未知错误'}`))
|
||||
}
|
||||
}
|
||||
|
||||
// 同步试题
|
||||
const connectTong = async () => {
|
||||
if (!connectTentStatus.value) {
|
||||
message.error('请先连接服务器')
|
||||
return
|
||||
}
|
||||
try {
|
||||
const res = await QuestionApi.receiveAll()
|
||||
message.success(t('同步成功'))
|
||||
@@ -704,7 +754,7 @@ const openForm = (type: string, id?: number) => {
|
||||
if (chooseQuestionType.value.includes('选择题')) {
|
||||
formRef.value.open(queryParams, type, id)
|
||||
} else if (chooseQuestionType.value.includes('编程题')) {
|
||||
cformRef.value.open(queryParams,type, id)
|
||||
cformRef.value.open(queryParams, type, id)
|
||||
} else if (chooseQuestionType.value.includes('程序设计')) {
|
||||
mformRef.value.open(queryParams, type, id)
|
||||
} else if (chooseQuestionType.value.includes('网络题')) {
|
||||
@@ -721,7 +771,7 @@ const openForm = (type: string, id?: number) => {
|
||||
emailformRef.value.open(queryParams, type, id)
|
||||
} else if (chooseQuestionType.value.includes('表格')) {
|
||||
xlsxformRef.value.open(queryParams, type, id)
|
||||
}else if (chooseQuestionType.value.includes('图像处理')) {
|
||||
} else if (chooseQuestionType.value.includes('图像处理')) {
|
||||
psformRef.value.open(queryParams, type, id)
|
||||
}
|
||||
}
|
||||
@@ -831,5 +881,12 @@ const handleRole = (row: UserApi.UserVO) => {
|
||||
/** 初始化 */
|
||||
onMounted(() => {
|
||||
getList()
|
||||
if (getTenantId() == 1) {
|
||||
sendAudio.value = false
|
||||
audioTrue.value = true
|
||||
} else {
|
||||
sendAudio.value = true
|
||||
audioTrue.value = false
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user