【新增】 xlsx相关页面
This commit is contained in:
@@ -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 })
|
||||
|
@@ -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 })
|
||||
}
|
||||
|
@@ -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) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
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
|
||||
}
|
||||
|
||||
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 addXlsxForm = async () => {
|
||||
dialogFormVisibleXlsxInfo.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 () => {
|
@@ -329,7 +329,7 @@
|
||||
<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>
|
||||
@@ -351,7 +351,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'
|
||||
|
@@ -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>
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user