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) {
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' })

View File

@@ -38,7 +38,7 @@ export const deletePptx = async (id: number) => {
return await request.delete({ url: '/exam/pptx/delete?id=' + id })
}
// 查询Word节点列表(小类) 根据title查询出来下面所有的数据
// 查询Pptx节点列表(小类) 根据title查询出来下面所有的数据
export const getSlideByNameList = async (title: string) => {
console.log(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 {
id?: number
nodeName: string
parentId: number
status: number
sort: number
toChinese: string
nodeFunction: string
createTime: Date
}
// 查询Xlsx节点精简)列表
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节点列表
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节点详情
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节点
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节点
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节点
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) => {
return await request.get({ url: '/tool/wps/runWpsXlsx?path=' + path })
// 查询Xlsx节点列表(小类) 根据title查询出来下面所有的数据
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>
<el-dropdown-menu>
<el-dropdown-item>
<el-button @click="addWordInfo">添加</el-button>
<el-button @click="addXlsxForm">添加</el-button>
</el-dropdown-item>
</el-dropdown-menu>
</template>
@@ -278,25 +278,26 @@
</div>
<!-- 表单弹窗添加/修改 -->
<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="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>
<el-table :data="listPoint" style="width: 100%">
<el-table-column prop="contentIn" label="值" width="500px">
<template #default="{ row }">
<span @click="addPoints(row)" style="cursor: pointer; color: black">
{{ row.contentIn }}
</span>
</template>
</el-table-column>
</el-table>
<el-tree
style="max-width: 600px"
:data="xlsxPointsList"
:props="defaultProps"
:expand-on-click-node="false"
@node-click="handleNodelClick"
/>
</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>
<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">
<template #default="{ row }">
@@ -317,45 +318,44 @@
</el-table>
</div>
</div>
<!-- <el-skeleton :rows="5" animated v-if="XlsxPointsList.length < 0 && isLoading" />
-->
</el-dialog>
<!-- <el-dialog v-model="dialogFormVisibleWordInfos" :title="titles" width="300px">
<el-dialog v-model="dialogFormVisibleXlsxInfos" :title="titles" width="300px">
<el-tree
style="max-width: 600px"
:data="wordPointsInfoList"
:data="xlsxPointsInfoList"
:props="defaultProps"
:expand-on-click-node="false"
show-checkbox
@check-change="handleCheckChange"
/>
<template #footer>
<el-button type="primary" @click="submitWordPoints"> </el-button>
<el-button @click="dialogFormVisibleWordInfos = false"> </el-button>
<el-button type="primary" @click="submitXlsxPoints"> </el-button>
<el-button @click="dialogFormVisibleXlsxInfos = false"> </el-button>
</template>
</el-dialog> -->
</el-dialog>
</template>
<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 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 XlsxApi from '@/api/wps/xlsx'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { defaultProps, handleTree } from '@/utils/tree'
import { FormRules } from 'element-plus'
import { cloneDeep } from 'lodash-es'
import FileForm from './components/FileForm.vue'
defineOptions({ name: 'WpsWordFrom' })
const wordPointsList = ref<Tree[]>([]) //
const wordPointsInfoList = ref<Tree[]>([]) //
defineOptions({ name: 'WpsXlsxFrom' })
const xlsxPointsList = ref<Tree[]>([]) //
const xlsxPointsInfoList = ref<Tree[]>([]) //
const list = ref([]) //
const listPoint = ref([]) //
const { t } = useI18n() //
const message = useMessage() //
const loading = ref(false) //
const dialogVisible = ref(false) //
const isLoading = ref(false)
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
@@ -403,22 +403,8 @@ const formData = ref({
}
]
})
const wordPointsFun = ref({
chineseName: '',
function: ''
})
const wordPoints = ref({
name: '',
englishName: '',
filePath: '',
type: '',
belongTo: '',
isboo: '',
function: '',
unit: '',
isExam: ''
})
let wordPointsInfosList: (typeof wordPoints)[] = []
let xlsxPointsInfosList: (typeof xlsxPoints)[] = []
const removePoint = (index: number) => {
list.value.splice(index, 1)
}
@@ -448,103 +434,63 @@ const documentList = ref([
fileName: ''
}
])
const dialogFormVisibleWordInfo = ref(false)
const dialogFormVisibleWordInfos = ref(false)
const nodeFunction = ref('')
const dialogFormVisibleXlsxInfo = ref(false)
const dialogFormVisibleXlsxInfos = ref(false)
const titles = ref('')
const englishName = 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) => {
// if (checked || indeterminate) {
// wordPoints.value.belongTo = data.belongTo
// wordPoints.value.parameter = data.isboo
// wordPoints.value.type = data.type
// wordPointsFun.value = {
// chineseName: '',
// function: ''
// }
// wordPointsFun.value.chineseName = data.toChinese
// wordPointsFun.value.function = data.nodeFunction
// wordPoints.value.function.push(cloneDeep(wordPointsFun.value))
// console.log(wordPoints)
// }
if (data.titleType == '2') {
wordPoints.value.name = chineseName.value + data.toChinese
wordPoints.value.filePath = filePath.value
wordPoints.value.function = englishNames.value + data.nodeFunction
wordPoints.value.englishName = englishNames.value
wordPoints.value.belongTo = data.belongTo
wordPoints.value.isboo = data.isboo
wordPoints.value.type = data.type
wordPoints.value.unit = data.unit
wordPoints.value.isExam = '0'
wordPointsInfosList.push(cloneDeep(wordPoints.value))
console.log(data)
const xlsxPoints = {
firstName: '',
index: '',
function: '',
examName: '',
examCode: ''
}
if (data.functions != null && data.functions != "") {
xlsxPoints.firstName = chineseName.value
xlsxPoints.index = textIndex.value
xlsxPoints.function = data.functions
xlsxPoints.examName = data.chineseName
xlsxPoints.examCode = '111'
xlsxPoints.method = data.parameter
xlsxPointsInfosList.push(cloneDeep(xlsxPoints))
}
}
const file = ref()
// xlsx使
const getXlsxDataInfo = async () => {
const fileInput = document.getElementById('xlsxFile') as HTMLInputElement
if (fileInput != null) {
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 = ''
for (var i = 0; i < documentList.value.length; i++) {
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
//
const addXlsxForm = async () => {
dialogFormVisibleXlsxInfo.value = true
}
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({
nodeFunction: undefined
})
const chineseName = ref('')
const nodeFunctions = ref('')
const englishNames = ref('')
const textIndex = ref()
//
const handleNodelClick = async (row: any) => {
// queryParams.nodeFunction = row.selectName
// chineseName.value = '' + row.name + ''
// filePath.value = row.filePath
// nodeFunctions.value = row.selectName
// englishNames.value = row.englishName
// const res = await Xlsx.getWordInfos(queryParams)
// wordPointsInfoList.value = []
// wordPointsInfoList.value.push(...handleTree(res))
// dialogFormVisibleWordInfos.value = true
console.log(row)
//
chineseName.value = '【' + row.name + '】'
textIndex.value = row.index
const res = await XlsxApi.getXlsxByNameList(row.type)
xlsxPointsInfoList.value = []
xlsxPointsInfoList.value.push(...handleTree(res))
dialogFormVisibleXlsxInfos.value = true
}
const handleDelete = (row) => {
console.log(row)
@@ -555,39 +501,29 @@ const handleDelete = (row) => {
}
}
// const submitWordPoints = async () => {
// const res = await WordApi.getWordListInfos(wordPointsInfosList)
// wordPoints.value = {
// name: '',
// englishName: '',
// filePath: '',
// type: '',
// belongTo: '',
// isboo: '',
// function: '',
// unit: '',
// isExam: ''
// }
// let index = 0
// wordPointsInfosList = []
// for (let i = 0; i < res.length; i++) {
// var indexFlag = false
// for (let x = 0; x < list.value.length; x++) {
// if (res[i].content == list.value[x].content) {
// //
// indexFlag = true
// }
// }
// if (!indexFlag) {
// index += 1;
// res[i].sort = index;
// list.value.push(res[i])
// }
// }
// dialogFormVisibleWordInfo.value = false
// dialogFormVisibleWordInfos.value = false
// wordPointsList.value = []
// }
const submitXlsxPoints = async () => {
console.log(xlsxPointsInfosList)
const res = await XlsxApi.getXlsxMaster({
data: JSON.stringify(xlsxPointsInfosList),
file: file.value
})
xlsxPointsInfosList = []
console.log(res)
for (let i = 0; i < res.data.length; i++) {
var indexFlag = false
for (let x = 0; x < list.value.length; x++) {
if (res.data[i].content == list.value[x].content) {
//
indexFlag = true
}
}
if (!indexFlag) {
res.data[i].sort = list.value.length + 1
list.value.push(res.data[i])
}
}
dialogFormVisibleXlsxInfos.value = false
}
const formRules = reactive<FormRules>({
status: [{ required: true, message: '启用状态必填', trigger: 'blur' }]
})
@@ -599,16 +535,10 @@ const rightActiveName = ref('annex')
const rightHandleClick = (tab, e) => {
rightActiveName.value = tab.paneName.value
}
//
const multipleKeywordSelection = ref([] as any)
const handleKeywordSelectionChange = (val: any) => {
multipleKeywordSelection.value = val
}
const selections = ref([])
const handleSelectionChange = (rows) => {
selections.value = rows
}
const keyWord = ref([null])
/** 添加/修改操作 */
const FileRef = ref()
@@ -652,17 +582,8 @@ const deleteUrl = (index: number) => {
formData.value.fileUploads[index].fileName = ''
}
//
const mediumList = ref([] as any)
const multipleMediumSelection = ref([] as any)
const handleMediumSelectionChange = (val: any) => {
multipleMediumSelection.value = val
}
const fileList = []
const multipleDocumentSelection = ref([] as any)
const handleDocumentSelectionChange = (val: any) => {
multipleDocumentSelection.value = val
}
const handleUploadSuccess = ({ url, fileType }) => {
const index = documentList.value.findIndex((item) => item.fileType === fileType)
if (index !== -1) {
@@ -699,16 +620,6 @@ const open = async (queryParams: any, type: string, id?: number) => {
}
}
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 submitForm = async () => {

View File

@@ -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>
@@ -318,11 +339,11 @@
<WpsPptxForm ref="pformRef" @success="getList" />
<SettingForm ref="setformRef" @success="getList" />
<EmailForm ref="emailformRef" @success="getList" />
<WpsExcelForm ref="xlsxformRef" @success="getList" />
<WpsXlsxForm 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'
@@ -339,7 +360,7 @@ import UserImportForm from './UserImportForm.vue'
import WpsWordForm from './WpsWordForm.vue'
import WpsPptxForm from './WpsPptxForm.vue'
import SettingForm from './SettingForm.vue'
import WpsExcelForm from './WpsExcelForm.vue'
import WpsXlsxForm from './WpsXlsxForm.vue'
import PsForm from './PsForm.vue'
import EmailForm from './EmailForm.vue'
import UserAssignRoleForm from './UserAssignRoleForm.vue'
@@ -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))
} catch (error: any) {
connectTentStatus.value = true
} catch (error) {
message.error(t(`连接失败: ${error?.message || '未知错误'}`))
}
}
// 同步试题
const connectTong = async () => {
if (!connectTentStatus.value) {
message.error('请先连接服务器')
return
}
try {
const res = await QuestionApi.receiveAll()
message.success(t('同步成功'))
@@ -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>

View File

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

View File

@@ -8,33 +8,7 @@
:inline="true"
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-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
type="primary"
plain
@@ -58,24 +32,11 @@
:default-expand-all="isExpandAll"
v-if="refreshTable"
>
<el-table-column prop="name" label="Xlsx节点名称" />
<el-table-column prop="nodeFunction" label="节点方法" />
<el-table-column prop="toChinese" label="转中文" />
<el-table-column prop="belongTo" label="归属" width="100">
<template #default="scope">
<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 prop="name" label="名称" />
<el-table-column prop="title" label="标签名称" />
<el-table-column prop="functions" label="方法名称" />
<el-table-column prop="parameter" label="方法参数" />
<el-table-column prop="chineseName" label="中文描述" />
<el-table-column label="操作" align="center" width="150">
<template #default="scope">
<el-button
@@ -100,12 +61,12 @@
<!-- 表单弹窗添加/修改 -->
<XlsxForm ref="formRef" @success="getList" />
</template>
<script lang="ts" setup>
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import { handleTree } from '@/utils/tree'
import * as XlsxApi from '@/api/wps/xlsx'
import XlsxForm from './XlsxForm.vue'
@@ -126,7 +87,7 @@ const queryFormRef = ref() // 搜索的表单
const isExpandAll = ref(true) // 是否展开,默认全部展开
const refreshTable = ref(true) // 重新渲染表格状态
/** 查询Word节点列表 */
/** 查询Xlsx节点列表 */
const getList = async () => {
loading.value = true
try {