This commit is contained in:
陆光LG
2025-08-11 09:40:51 +08:00
7 changed files with 245 additions and 321 deletions

View File

@@ -26,7 +26,10 @@ export const getQuestionAuditList = (params: QuestionQueryVO) => {
export async function auditQuestion(data) { 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() { export async function rabbitmqConnect() {
return await request.post({ url: '/rabbitmq/connect' }) return await request.post({ url: '/rabbitmq/connect' })

View File

@@ -38,7 +38,7 @@ export const deletePptx = async (id: number) => {
return await request.delete({ url: '/exam/pptx/delete?id=' + id }) return await request.delete({ url: '/exam/pptx/delete?id=' + id })
} }
// 查询Word节点列表(小类) 根据title查询出来下面所有的数据 // 查询Pptx节点列表(小类) 根据title查询出来下面所有的数据
export const getSlideByNameList = async (title: string) => { export const getSlideByNameList = async (title: string) => {
console.log(title) console.log(title)
return await request.get({ url: '/exam/pptx/getByNameList?title=' + title }) return await request.get({ url: '/exam/pptx/getByNameList?title=' + title })

View File

@@ -2,45 +2,53 @@ import request from '@/config/axios'
export interface XlsxVO { export interface XlsxVO {
id?: number id?: number
nodeName: string
parentId: number parentId: number
status: number status: number
sort: number sort: number
toChinese: string
nodeFunction: string
createTime: Date createTime: Date
} }
// 查询Xlsx节点精简)列表 // 查询Xlsx节点精简)列表
export const getSimpleXlsxList = async (): Promise<XlsxVO[]> => { export const getSimpleXlsxList = async (): Promise<XlsxVO[]> => {
return await request.get({ url: '/wps/xlsx/simple-list' }) return await request.get({ url: '/exam/xlsx/simple-list' })
} }
// 查询Xlsx节点列表 // 查询Xlsx节点列表
export const getXlsxPage = async (params: PageParam) => { export const getXlsxPage = async (params: PageParam) => {
return await request.get({ url: '/wps/xlsx/list', params }) return await request.get({ url: '/exam/xlsx/list', params })
} }
// 查询Xlsx节点详情 // 查询Xlsx节点详情
export const getXlsx = async (id: number) => { export const getXlsx = async (id: number) => {
return await request.get({ url: '/wps/xlsx/get?id=' + id }) return await request.get({ url: '/exam/xlsx/get?id=' + id })
} }
// 新增Xlsx节点 // 新增Xlsx节点
export const createXlsx = async (data: XlsxVO) => { export const createXlsx = async (data: XlsxVO) => {
return await request.post({ url: '/wps/xlsx/create', data: data }) return await request.post({ url: '/exam/xlsx/create', data: data })
} }
// 修改Xlsx节点 // 修改Xlsx节点
export const updateXlsx = async (params: XlsxVO) => { export const updateXlsx = async (params: XlsxVO) => {
return await request.put({ url: '/wps/xlsx/update', data: params }) return await request.put({ url: '/exam/xlsx/update', data: params })
} }
// 删除Xlsx节点 // 删除Xlsx节点
export const deleteXlsx = async (id: number) => { export const deleteXlsx = async (id: number) => {
return await request.delete({ url: '/wps/xlsx/delete?id=' + id }) return await request.delete({ url: '/exam/xlsx/delete?id=' + id })
} }
export const getXlsxInfo = async (path: String) => { // 查询Xlsx节点列表(小类) 根据title查询出来下面所有的数据
return await request.get({ url: '/tool/wps/runWpsXlsx?path=' + path }) export const getSlideByNameList = async (title: string) => {
console.log(title)
return await request.get({ url: '/exam/xlsx/getByNameList?title=' + title })
}
// 上传文件
export const getXlsxDataInfo = (data: any) => {
return request.upload({ url: '/auto/wps/xlsxDataInfo', data })
}
// 获取考点
export const getXlsxMaster = (data: any) => {
return request.upload({ url: '/auto/wps/xlsxMaster', data })
} }

View File

@@ -126,7 +126,7 @@
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item> <el-dropdown-item>
<el-button @click="addWordInfo">添加</el-button> <el-button @click="addXlsxForm">添加</el-button>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
@@ -278,25 +278,26 @@
</div> </div>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<FileForm ref="FileRef" @success="handleUploadSuccess" /> <FileForm ref="FileRef" @success="handleUploadSuccess" />
<el-dialog v-model="dialogFormVisibleWordInfo" title="考点设置" width="70%">
<el-dialog v-model="dialogFormVisibleXlsxInfo" title="考点设置" width="70%">
<input type="file" id="xlsxFile" accept=".xlsx" />
<button @click="getXlsxDataInfo">文件解析</button>
<div style="height: 400px; overflow: hidden; display: flex; gap: 16px"> <div style="height: 400px; overflow: hidden; display: flex; gap: 16px">
<div style="flex: 0.8; overflow: auto; border: 1px solid #eee; padding: 8px"> <div style="flex: 0.5; overflow: auto; border: 1px solid #eee; padding: 8px">
<h3>考点</h3> <h3>考点</h3>
<el-table :data="listPoint" style="width: 100%"> <el-tree
<el-table-column prop="contentIn" label="值" width="500px"> style="max-width: 600px"
<template #default="{ row }"> :data="xlsxPointsList"
<span @click="addPoints(row)" style="cursor: pointer; color: black"> :props="defaultProps"
{{ row.contentIn }} :expand-on-click-node="false"
</span> @node-click="handleNodelClick"
</template> />
</el-table-column>
</el-table>
</div> </div>
<div style="flex: 1.2; overflow: auto; border: 1px solid #eee; padding: 8px"> <div style="flex: 1.5; overflow: auto; border: 1px solid #eee; padding: 8px">
<h3>考点详情</h3> <h3>考点详情</h3>
<el-table :data="list" style="width: 100%"> <el-table :data="list" style="width: 100%">
<el-table-column prop="contentIn" label="值" width="400px" /> <el-table-column prop="contentIn" label="值" width="500px" />
<el-table-column prop="scoreRate" label="权值" width="100"> <el-table-column prop="scoreRate" label="权值" width="100">
<template #default="{ row }"> <template #default="{ row }">
@@ -317,45 +318,44 @@
</el-table> </el-table>
</div> </div>
</div> </div>
<!-- <el-skeleton :rows="5" animated v-if="XlsxPointsList.length < 0 && isLoading" />
-->
</el-dialog> </el-dialog>
<!-- <el-dialog v-model="dialogFormVisibleWordInfos" :title="titles" width="300px"> <el-dialog v-model="dialogFormVisibleXlsxInfos" :title="titles" width="300px">
<el-tree <el-tree
style="max-width: 600px" style="max-width: 600px"
:data="wordPointsInfoList" :data="xlsxPointsInfoList"
:props="defaultProps" :props="defaultProps"
:expand-on-click-node="false" :expand-on-click-node="false"
show-checkbox show-checkbox
@check-change="handleCheckChange" @check-change="handleCheckChange"
/> />
<template #footer> <template #footer>
<el-button type="primary" @click="submitWordPoints"> </el-button> <el-button type="primary" @click="submitXlsxPoints"> </el-button>
<el-button @click="dialogFormVisibleWordInfos = false"> </el-button> <el-button @click="dialogFormVisibleXlsxInfos = false"> </el-button>
</template> </template>
</el-dialog> --> </el-dialog>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
import { FormRules } from 'element-plus'
import * as QuestionApi from '@/api/paper/question' import * as QuestionApi from '@/api/paper/question'
import * as XlsxApi from '@/api/wps/xlsx'
import FileForm from './components/FileForm.vue'
import WordInfo from './components/WordInfo.vue'
import WordInfos from './components/WordInfos.vue'
import * as SpecialtyApi from '@/api/points' import * as SpecialtyApi from '@/api/points'
import * as XlsxApi from '@/api/wps/xlsx'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { defaultProps, handleTree } from '@/utils/tree' import { defaultProps, handleTree } from '@/utils/tree'
import { FormRules } from 'element-plus'
import { cloneDeep } from 'lodash-es' import { cloneDeep } from 'lodash-es'
import FileForm from './components/FileForm.vue'
defineOptions({ name: 'WpsWordFrom' }) defineOptions({ name: 'WpsXlsxFrom' })
const wordPointsList = ref<Tree[]>([]) // const xlsxPointsList = ref<Tree[]>([]) //
const wordPointsInfoList = ref<Tree[]>([]) // const xlsxPointsInfoList = ref<Tree[]>([]) //
const list = ref([]) // const list = ref([]) //
const listPoint = ref([]) //
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const loading = ref(false) // const loading = ref(false) //
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const isLoading = ref(false)
const dialogTitle = ref('') // const dialogTitle = ref('') //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
@@ -403,22 +403,8 @@ const formData = ref({
} }
] ]
}) })
const wordPointsFun = ref({
chineseName: '', let xlsxPointsInfosList: (typeof xlsxPoints)[] = []
function: ''
})
const wordPoints = ref({
name: '',
englishName: '',
filePath: '',
type: '',
belongTo: '',
isboo: '',
function: '',
unit: '',
isExam: ''
})
let wordPointsInfosList: (typeof wordPoints)[] = []
const removePoint = (index: number) => { const removePoint = (index: number) => {
list.value.splice(index, 1) list.value.splice(index, 1)
} }
@@ -448,103 +434,63 @@ const documentList = ref([
fileName: '' fileName: ''
} }
]) ])
const dialogFormVisibleWordInfo = ref(false) const dialogFormVisibleXlsxInfo = ref(false)
const dialogFormVisibleWordInfos = ref(false) const dialogFormVisibleXlsxInfos = ref(false)
const nodeFunction = ref('')
const titles = ref('') const titles = ref('')
const englishName = ref('')
const filePath = ref('') const filePath = ref('')
const upFilePath = ref('')
const functionList = ref<string[]>([])
const xlsxPoints = reactive({
contentIn: '',
content: '',
image: '',
scoreRate: '',
sort: 0
})
const wordData = reactive({
chineseName: '',
englishName: '',
filePath: '',
function: [] as string[]
})
const addPoints = (row: any) => {
xlsxPoints.contentIn = row.contentIn
xlsxPoints.content = row.content
xlsxPoints.image = row.image
xlsxPoints.scoreRate = row.scoreRate
xlsxPoints.sort = list.value.length + 1
list.value.push(cloneDeep(xlsxPoints))
}
const handleCheckChange = (data: Tree, checked: boolean, indeterminate: boolean) => { const handleCheckChange = (data: Tree, checked: boolean, indeterminate: boolean) => {
// if (checked || indeterminate) { console.log(data)
// wordPoints.value.belongTo = data.belongTo const xlsxPoints = {
// wordPoints.value.parameter = data.isboo firstName: '',
// wordPoints.value.type = data.type index: '',
// wordPointsFun.value = { function: '',
// chineseName: '', examName: '',
// function: '' examCode: ''
// } }
// wordPointsFun.value.chineseName = data.toChinese if (data.functions != null && data.functions != "") {
// wordPointsFun.value.function = data.nodeFunction xlsxPoints.firstName = chineseName.value
// wordPoints.value.function.push(cloneDeep(wordPointsFun.value)) xlsxPoints.index = textIndex.value
// console.log(wordPoints) xlsxPoints.function = data.functions
// } xlsxPoints.examName = data.chineseName
if (data.titleType == '2') { xlsxPoints.examCode = '111'
wordPoints.value.name = chineseName.value + data.toChinese xlsxPoints.method = data.parameter
wordPoints.value.filePath = filePath.value xlsxPointsInfosList.push(cloneDeep(xlsxPoints))
wordPoints.value.function = englishNames.value + data.nodeFunction }
wordPoints.value.englishName = englishNames.value }
wordPoints.value.belongTo = data.belongTo const file = ref()
wordPoints.value.isboo = data.isboo // xlsx使
wordPoints.value.type = data.type const getXlsxDataInfo = async () => {
wordPoints.value.unit = data.unit const fileInput = document.getElementById('xlsxFile') as HTMLInputElement
wordPoints.value.isExam = '0' if (fileInput != null) {
wordPointsInfosList.push(cloneDeep(wordPoints.value)) file.value = fileInput.files[0]
const res = await XlsxApi.getXlsxDataInfo({ file: file.value })
xlsxPointsList.value = []
xlsxPointsList.value.push(...handleTree(res.data))
} }
console.log(data, checked, indeterminate)
} }
const addWordInfo = async () => { //
var filePath = '' const addXlsxForm = async () => {
for (var i = 0; i < documentList.value.length; i++) { dialogFormVisibleXlsxInfo.value = true
if (documentList.value[i].fileType == '2') {
filePath = documentList.value[i].url
}
}
// http://115.120.213.238:9000/exam/9f7d8f5d7c68cc2bfd03a23c19045efe7ba13a4bebeb833abece146908bcd0c6.docx documentList.value[1].url
if (filePath == '' || filePath == null) {
return
} }
isLoading.value = true
// if (wordPointsList.value.length <= 0) {
const res = await XlsxApi.getXlsxInfo(filePath)
listPoint.value = res
// isLoading.value = false
// wordPointsList.value = []
// wordPointsList.value.push(...handleTree(res))
// }
dialogFormVisibleWordInfo.value = true
}
const queryParams = reactive({ const queryParams = reactive({
nodeFunction: undefined nodeFunction: undefined
}) })
const chineseName = ref('') const chineseName = ref('')
const nodeFunctions = ref('') const textIndex = ref()
const englishNames = ref('')
//
const handleNodelClick = async (row: any) => { const handleNodelClick = async (row: any) => {
// queryParams.nodeFunction = row.selectName console.log(row)
// chineseName.value = '' + row.name + '' //
// filePath.value = row.filePath chineseName.value = '【' + row.name + '】'
// nodeFunctions.value = row.selectName textIndex.value = row.index
// englishNames.value = row.englishName const res = await XlsxApi.getXlsxByNameList(row.type)
// const res = await Xlsx.getWordInfos(queryParams) xlsxPointsInfoList.value = []
// wordPointsInfoList.value = [] xlsxPointsInfoList.value.push(...handleTree(res))
// wordPointsInfoList.value.push(...handleTree(res)) dialogFormVisibleXlsxInfos.value = true
// dialogFormVisibleWordInfos.value = true
} }
const handleDelete = (row) => { const handleDelete = (row) => {
console.log(row) console.log(row)
@@ -555,39 +501,29 @@ const handleDelete = (row) => {
} }
} }
// const submitWordPoints = async () => { const submitXlsxPoints = async () => {
// const res = await WordApi.getWordListInfos(wordPointsInfosList) console.log(xlsxPointsInfosList)
// wordPoints.value = { const res = await XlsxApi.getXlsxMaster({
// name: '', data: JSON.stringify(xlsxPointsInfosList),
// englishName: '', file: file.value
// filePath: '', })
// type: '', xlsxPointsInfosList = []
// belongTo: '', console.log(res)
// isboo: '', for (let i = 0; i < res.data.length; i++) {
// function: '', var indexFlag = false
// unit: '', for (let x = 0; x < list.value.length; x++) {
// isExam: '' if (res.data[i].content == list.value[x].content) {
// } //
// let index = 0 indexFlag = true
// wordPointsInfosList = [] }
// for (let i = 0; i < res.length; i++) { }
// var indexFlag = false if (!indexFlag) {
// for (let x = 0; x < list.value.length; x++) { res.data[i].sort = list.value.length + 1
// if (res[i].content == list.value[x].content) { list.value.push(res.data[i])
// // }
// indexFlag = true }
// } dialogFormVisibleXlsxInfos.value = false
// } }
// if (!indexFlag) {
// index += 1;
// res[i].sort = index;
// list.value.push(res[i])
// }
// }
// dialogFormVisibleWordInfo.value = false
// dialogFormVisibleWordInfos.value = false
// wordPointsList.value = []
// }
const formRules = reactive<FormRules>({ const formRules = reactive<FormRules>({
status: [{ required: true, message: '启用状态必填', trigger: 'blur' }] status: [{ required: true, message: '启用状态必填', trigger: 'blur' }]
}) })
@@ -599,16 +535,10 @@ const rightActiveName = ref('annex')
const rightHandleClick = (tab, e) => { const rightHandleClick = (tab, e) => {
rightActiveName.value = tab.paneName.value rightActiveName.value = tab.paneName.value
} }
//
const multipleKeywordSelection = ref([] as any)
const handleKeywordSelectionChange = (val: any) => {
multipleKeywordSelection.value = val
}
const selections = ref([]) const selections = ref([])
const handleSelectionChange = (rows) => { const handleSelectionChange = (rows) => {
selections.value = rows selections.value = rows
} }
const keyWord = ref([null])
/** 添加/修改操作 */ /** 添加/修改操作 */
const FileRef = ref() const FileRef = ref()
@@ -652,17 +582,8 @@ const deleteUrl = (index: number) => {
formData.value.fileUploads[index].fileName = '' formData.value.fileUploads[index].fileName = ''
} }
// //
const mediumList = ref([] as any)
const multipleMediumSelection = ref([] as any) const multipleMediumSelection = ref([] as any)
const handleMediumSelectionChange = (val: any) => {
multipleMediumSelection.value = val
}
const fileList = []
const multipleDocumentSelection = ref([] as any) const multipleDocumentSelection = ref([] as any)
const handleDocumentSelectionChange = (val: any) => {
multipleDocumentSelection.value = val
}
const handleUploadSuccess = ({ url, fileType }) => { const handleUploadSuccess = ({ url, fileType }) => {
const index = documentList.value.findIndex((item) => item.fileType === fileType) const index = documentList.value.findIndex((item) => item.fileType === fileType)
if (index !== -1) { if (index !== -1) {
@@ -699,16 +620,6 @@ const open = async (queryParams: any, type: string, id?: number) => {
} }
} }
defineExpose({ open }) // open defineExpose({ open }) // open
// A-Z 0-25
const mappedNumber = computed(() => {
const char = radio.value.toUpperCase()
const code = char.charCodeAt(0)
if (code >= 65 && code <= 90) {
return code - 65
} else {
return '请输入 A-Z 的字母'
}
})
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async () => {

View File

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

View File

@@ -10,25 +10,30 @@
<el-form-item label="上级节点" prop="parentId"> <el-form-item label="上级节点" prop="parentId">
<el-tree-select <el-tree-select
v-model="formData.parentId" v-model="formData.parentId"
:data="xlsxTree" :data="XlsxTree"
:props="defaultProps" :props="defaultProps"
check-strictly check-strictly
default-expand-all default-expand-all
placeholder="请选择上级Xlsx节点" placeholder="请选择上级Slide节点"
value-key="deptId"
/> />
</el-form-item> </el-form-item>
<el-form-item label="Xlsx节点名称" prop="name"> <el-form-item label="Slide节点名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入Xlsx节点名称" /> <el-input v-model="formData.name" placeholder="请输入Slide节点名称" />
</el-form-item> </el-form-item>
<el-form-item label="显示排序" prop="sort"> <el-form-item label="显示排序" prop="sort">
<el-input-number v-model="formData.sort" :min="0" controls-position="right" /> <el-input-number v-model="formData.sort" :min="0" controls-position="right" />
</el-form-item> </el-form-item>
<el-form-item label="节点方法" prop="nodeFunction"> <el-form-item label="节点方法" prop="functions">
<el-input v-model="formData.nodeFunction" maxlength="11" placeholder="请输入节点方法" /> <el-input v-model="formData.functions" placeholder="请输入节点方法" />
</el-form-item> </el-form-item>
<el-form-item label="转中文" prop="toChinese"> <el-form-item label="方法参数" prop="parameter">
<el-input v-model="formData.toChinese" maxlength="50" placeholder="请输入转中文" /> <el-input v-model="formData.parameter" placeholder="请输入节点方法" />
</el-form-item>
<el-form-item label="中文描述" prop="chineseName">
<el-input v-model="formData.chineseName" maxlength="50" placeholder="请输入中文描述" />
</el-form-item>
<el-form-item label="标签名称" prop="title">
<el-input v-model="formData.title" maxlength="50" placeholder="请输入标签名称" />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="status">
<el-select v-model="formData.status" clearable placeholder="请选择状态"> <el-select v-model="formData.status" clearable placeholder="请选择状态">
@@ -40,26 +45,6 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="formData.type" clearable placeholder="请选择状态">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.WPS_WORD)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="归属" prop="belongTo">
<el-select v-model="formData.belongTo" clearable placeholder="请选择归属">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.WORD_BELONG_TO)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@@ -68,11 +53,12 @@
</Dialog> </Dialog>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
import { defaultProps, handleTree } from '@/utils/tree' import { defaultProps, handleTree } from '@/utils/tree'
import * as XlsxApi from '@/api/wps/xlsx' import * as XlsxApi from '@/api/wps/xlsx'
import { CommonStatusEnum } from '@/utils/constants' import { CommonStatusEnum } from '@/utils/constants'
import { FormRules } from 'element-plus' import { FormRules } from 'element-plus'
defineOptions({ name: 'WpsXlsx' }) defineOptions({ name: 'WpsXlsx' })
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
@@ -88,11 +74,10 @@ const formData = ref({
parentId: undefined, parentId: undefined,
name: undefined, name: undefined,
sort: undefined, sort: undefined,
nodeFunction: undefined, functions: undefined,
toChinese: undefined, parameter: undefined,
status: CommonStatusEnum.ENABLE, chineseName: undefined,
type: CommonStatusEnum.ENABLE, status: CommonStatusEnum.ENABLE
belongTo: CommonStatusEnum.ENABLE
}) })
const formRules = reactive<FormRules>({ const formRules = reactive<FormRules>({
parentId: [{ required: true, message: '上级Xlsx节点不能为空', trigger: 'blur' }], parentId: [{ required: true, message: '上级Xlsx节点不能为空', trigger: 'blur' }],
@@ -101,7 +86,7 @@ const formRules = reactive<FormRules>({
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }] status: [{ required: true, message: '状态不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // 表单 Ref const formRef = ref() // 表单 Ref
const xlsxTree = ref() // 树形结构 const XlsxTree = ref() // 树形结构
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
@@ -157,21 +142,20 @@ const resetForm = () => {
parentId: undefined, parentId: undefined,
name: undefined, name: undefined,
sort: undefined, sort: undefined,
nodeFunction: undefined, functions: undefined,
toChinese: undefined, parameter: undefined,
status: CommonStatusEnum.ENABLE, chineseName: undefined,
type: CommonStatusEnum.ENABLE, status: CommonStatusEnum.ENABLE
belongTo: CommonStatusEnum.ENABLE
} }
formRef.value?.resetFields() formRef.value?.resetFields()
} }
/** 获得Xlsx树 */ /** 获得Xlsx树 */
const getTree = async () => { const getTree = async () => {
xlsxTree.value = [] XlsxTree.value = []
const data = await XlsxApi.getSimpleXlsxList() const data = await XlsxApi.getSimpleXlsxList()
let xlsx: Tree = { id: 0, name: '顶级Xlsx节点', children: [] } let Xlsx: Tree = { id: 0, name: '顶级Xlsx节点', children: [] }
xlsx.children = handleTree(data) Xlsx.children = handleTree(data)
xlsxTree.value.push(xlsx) XlsxTree.value.push(Xlsx)
} }
</script> </script>

View File

@@ -8,33 +8,7 @@
:inline="true" :inline="true"
label-width="110px" label-width="110px"
> >
<el-form-item label="Xlsx节点名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入Xlsx节点名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="Xlsx节点状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择Xlsx节点状态"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button <el-button
type="primary" type="primary"
plain plain
@@ -58,24 +32,11 @@
:default-expand-all="isExpandAll" :default-expand-all="isExpandAll"
v-if="refreshTable" v-if="refreshTable"
> >
<el-table-column prop="name" label="Xlsx节点名称" /> <el-table-column prop="name" label="名称" />
<el-table-column prop="nodeFunction" label="节点方法" /> <el-table-column prop="title" label="标签名称" />
<el-table-column prop="toChinese" label="转中文" /> <el-table-column prop="functions" label="方法名称" />
<el-table-column prop="belongTo" label="归属" width="100"> <el-table-column prop="parameter" label="方法参数" />
<template #default="scope"> <el-table-column prop="chineseName" label="中文描述" />
<dict-tag :type="DICT_TYPE.WORD_BELONG_TO" :value="scope.row.belongTo" />
</template>
</el-table-column>
<el-table-column prop="type" label="类型" width="100">
<template #default="scope">
<dict-tag :type="DICT_TYPE.WPS_WORD" :value="scope.row.type" />
</template>
</el-table-column>
<el-table-column prop="status" label="状态" width="100">
<template #default="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="150"> <el-table-column label="操作" align="center" width="150">
<template #default="scope"> <template #default="scope">
<el-button <el-button
@@ -100,12 +61,12 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<XlsxForm ref="formRef" @success="getList" /> <XlsxForm ref="formRef" @success="getList" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { handleTree } from '@/utils/tree' import { handleTree } from '@/utils/tree'
import * as XlsxApi from '@/api/wps/xlsx' import * as XlsxApi from '@/api/wps/xlsx'
import XlsxForm from './XlsxForm.vue' import XlsxForm from './XlsxForm.vue'
@@ -126,7 +87,7 @@ const queryFormRef = ref() // 搜索的表单
const isExpandAll = ref(true) // 是否展开,默认全部展开 const isExpandAll = ref(true) // 是否展开,默认全部展开
const refreshTable = ref(true) // 重新渲染表格状态 const refreshTable = ref(true) // 重新渲染表格状态
/** 查询Word节点列表 */ /** 查询Xlsx节点列表 */
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
try { try {