【新增】 xlsx相关页面

This commit is contained in:
dlaren
2025-08-10 02:22:41 +08:00
parent 06f5d5f65c
commit ea8112e563
6 changed files with 158 additions and 294 deletions

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

@@ -329,7 +329,7 @@
<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>
@@ -351,7 +351,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'

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 {