【修改】 word pptx 关联关系页面逻辑
This commit is contained in:
@@ -121,6 +121,8 @@ export enum DICT_TYPE {
|
|||||||
PPTX_BELONG_TO = "pptx_belong_to",
|
PPTX_BELONG_TO = "pptx_belong_to",
|
||||||
PPTX_ISBOO = "pptx_isboo",
|
PPTX_ISBOO = "pptx_isboo",
|
||||||
PPTX_TITLE_TYPE ="pptx_title_type",
|
PPTX_TITLE_TYPE ="pptx_title_type",
|
||||||
|
WPS_UNIT ="wps_unit",
|
||||||
|
|
||||||
|
|
||||||
QUESTION_AUDIT="question_audit",
|
QUESTION_AUDIT="question_audit",
|
||||||
QUESTION_SOURCE="question_source",
|
QUESTION_SOURCE="question_source",
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
<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="pptxTree"
|
:data="wordTree"
|
||||||
:props="defaultProps"
|
:props="defaultProps"
|
||||||
check-strictly
|
check-strictly
|
||||||
default-expand-all
|
default-expand-all
|
||||||
@@ -79,6 +79,16 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="数据类型" prop="unit">
|
||||||
|
<el-select v-model="formData.unit" clearable placeholder="请选择数据类型">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.WPS_UNIT)"
|
||||||
|
: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>
|
||||||
@@ -87,13 +97,13 @@
|
|||||||
</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 PptxApi from '@/api/wps/pptx'
|
import * as PptxApi from '@/api/wps/pptx'
|
||||||
import { CommonStatusEnum } from '@/utils/constants'
|
import { CommonStatusEnum } from '@/utils/constants'
|
||||||
import { FormRules } from 'element-plus'
|
import { FormRules } from 'element-plus'
|
||||||
|
|
||||||
defineOptions({ name: 'WpsPptx' })
|
defineOptions({ name: 'WpsWord' })
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
@@ -114,7 +124,8 @@ const formData = ref({
|
|||||||
type: CommonStatusEnum.ENABLE,
|
type: CommonStatusEnum.ENABLE,
|
||||||
belongTo: CommonStatusEnum.ENABLE,
|
belongTo: CommonStatusEnum.ENABLE,
|
||||||
isboo: CommonStatusEnum.ENABLE,
|
isboo: CommonStatusEnum.ENABLE,
|
||||||
titleType: CommonStatusEnum.ENABLE
|
titleType: CommonStatusEnum.ENABLE,
|
||||||
|
unit: CommonStatusEnum.ENABLE
|
||||||
})
|
})
|
||||||
const formRules = reactive<FormRules>({
|
const formRules = reactive<FormRules>({
|
||||||
parentId: [{ required: true, message: '上级Pptx节点不能为空', trigger: 'blur' }],
|
parentId: [{ required: true, message: '上级Pptx节点不能为空', trigger: 'blur' }],
|
||||||
@@ -123,7 +134,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 pptxTree = ref() // 树形结构
|
const wordTree = ref() // 树形结构
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (type: string, id?: number) => {
|
const open = async (type: string, id?: number) => {
|
||||||
@@ -140,7 +151,7 @@ const open = async (type: string, id?: number) => {
|
|||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 获得Pptx节点树
|
// 获得Word节点树
|
||||||
await getTree()
|
await getTree()
|
||||||
}
|
}
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
@@ -185,17 +196,18 @@ const resetForm = () => {
|
|||||||
type: CommonStatusEnum.ENABLE,
|
type: CommonStatusEnum.ENABLE,
|
||||||
belongTo: CommonStatusEnum.ENABLE,
|
belongTo: CommonStatusEnum.ENABLE,
|
||||||
isboo: CommonStatusEnum.ENABLE,
|
isboo: CommonStatusEnum.ENABLE,
|
||||||
titleType: CommonStatusEnum.ENABLE
|
titleType: CommonStatusEnum.ENABLE,
|
||||||
|
unit: CommonStatusEnum.ENABLE
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获得Pptx树 */
|
/** 获得Word树 */
|
||||||
const getTree = async () => {
|
const getTree = async () => {
|
||||||
pptxTree.value = []
|
wordTree.value = []
|
||||||
const data = await PptxApi.getSimplePptxList()
|
const data = await PptxApi.getSimplePptxList()
|
||||||
let pptx: Tree = { id: 0, name: '顶级Pptx节点', children: [] }
|
let word: Tree = { id: 0, name: '顶级Pptx节点', children: [] }
|
||||||
pptx.children = handleTree(data)
|
word.children = handleTree(data)
|
||||||
pptxTree.value.push(pptx)
|
wordTree.value.push(word)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@@ -81,6 +81,11 @@
|
|||||||
<dict-tag :type="DICT_TYPE.PPTX_TITLE_TYPE" :value="scope.row.titleType" />
|
<dict-tag :type="DICT_TYPE.PPTX_TITLE_TYPE" :value="scope.row.titleType" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column prop="unit" label="数据类型" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.WPS_UNIT" :value="scope.row.unit" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="状态" width="100">
|
<el-table-column prop="status" label="状态" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
||||||
|
@@ -60,7 +60,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="值类型" prop="isboo">
|
<el-form-item label="值类型" prop="isboo">
|
||||||
<el-select v-model="formData.isboo" clearable placeholder="请选择归属">
|
<el-select v-model="formData.isboo" clearable placeholder="请选择值类型">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.WORD_ISBOO)"
|
v-for="dict in getIntDictOptions(DICT_TYPE.WORD_ISBOO)"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
@@ -79,6 +79,16 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="数据类型" prop="unit">
|
||||||
|
<el-select v-model="formData.unit" clearable placeholder="请选择数据类型">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.WPS_UNIT)"
|
||||||
|
: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>
|
||||||
@@ -87,7 +97,7 @@
|
|||||||
</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 WordApi from '@/api/wps/word'
|
import * as WordApi from '@/api/wps/word'
|
||||||
import { CommonStatusEnum } from '@/utils/constants'
|
import { CommonStatusEnum } from '@/utils/constants'
|
||||||
@@ -114,7 +124,8 @@ const formData = ref({
|
|||||||
type: CommonStatusEnum.ENABLE,
|
type: CommonStatusEnum.ENABLE,
|
||||||
belongTo: CommonStatusEnum.ENABLE,
|
belongTo: CommonStatusEnum.ENABLE,
|
||||||
isboo: CommonStatusEnum.ENABLE,
|
isboo: CommonStatusEnum.ENABLE,
|
||||||
titleType: CommonStatusEnum.ENABLE
|
titleType: CommonStatusEnum.ENABLE,
|
||||||
|
unit: CommonStatusEnum.ENABLE
|
||||||
})
|
})
|
||||||
const formRules = reactive<FormRules>({
|
const formRules = reactive<FormRules>({
|
||||||
parentId: [{ required: true, message: '上级Word节点不能为空', trigger: 'blur' }],
|
parentId: [{ required: true, message: '上级Word节点不能为空', trigger: 'blur' }],
|
||||||
@@ -185,7 +196,8 @@ const resetForm = () => {
|
|||||||
type: CommonStatusEnum.ENABLE,
|
type: CommonStatusEnum.ENABLE,
|
||||||
belongTo: CommonStatusEnum.ENABLE,
|
belongTo: CommonStatusEnum.ENABLE,
|
||||||
isboo: CommonStatusEnum.ENABLE,
|
isboo: CommonStatusEnum.ENABLE,
|
||||||
titleType: CommonStatusEnum.ENABLE
|
titleType: CommonStatusEnum.ENABLE,
|
||||||
|
unit: CommonStatusEnum.ENABLE
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
@@ -81,6 +81,11 @@
|
|||||||
<dict-tag :type="DICT_TYPE.PPTX_TITLE_TYPE" :value="scope.row.titleType" />
|
<dict-tag :type="DICT_TYPE.PPTX_TITLE_TYPE" :value="scope.row.titleType" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column prop="unit" label="数据类型" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.WPS_UNIT" :value="scope.row.unit" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="状态" width="100">
|
<el-table-column prop="status" label="状态" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
||||||
|
Reference in New Issue
Block a user