模版管理修改类型显示

This commit is contained in:
lxd 2025-07-25 16:50:33 +08:00
parent 4bb3239161
commit c6dc38732f
2 changed files with 9 additions and 5 deletions

View File

@ -36,7 +36,7 @@
</template>
<script setup lang="ts">
import { TemplateApi, TemplateVO } from '@/api/system/template'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { DICT_TYPE, getStrDictOptions, getDictObj } from '@/utils/dict'
import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
/** 模板 表单 */
defineOptions({ name: 'TemplateForm' })
@ -85,7 +85,7 @@ const submitForm = async () => {
formLoading.value = true
try {
const data = formData.value as unknown as TemplateVO
data.orgid = Profilevo.value.orgid
// data.orgid = Profilevo.value.orgid
if (formType.value === 'create') {
await TemplateApi.createTemplate(data)
message.success(t('common.createSuccess'))

View File

@ -56,7 +56,11 @@
style="border-radius: 10px; overflow: hidden"
>
<el-table-column label="序号" type="index" width="60" align="center" />
<el-table-column label="类型" align="center" prop="type" />
<el-table-column label="类型" align="center" prop="type">
<template #default="scope">
{{ getDictLabel(DICT_TYPE.TEMPLATE_TYPE, scope.row.type) }}
</template>
</el-table-column>
<el-table-column label="内容" align="center" prop="content" />
<el-table-column label="操作" align="center" min-width="120px">
<template #default="scope">
@ -104,7 +108,7 @@ import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { TemplateApi, TemplateVO } from '@/api/system/template'
import TemplateForm from './TemplateForm.vue'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { DICT_TYPE, getStrDictOptions, getDictLabel } from '@/utils/dict'
import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
/** 模板 列表 */
defineOptions({ name: 'Template' })
@ -129,7 +133,7 @@ const exportLoading = ref(false) // 导出的加载中
const getList = async () => {
loading.value = true
try {
queryParams.orgid = Profilevo.value.orgid
// queryParams.orgid = Profilevo.value.orgid
const data = await TemplateApi.getTemplatePage(queryParams)
list.value = data.list
total.value = data.total