提交 | 用户 | 时间
|
314507
|
1 |
<template> |
H |
2 |
<Dialog v-model="dialogVisible" :max-height="500" :scroll="true" title="详情"> |
|
3 |
<Descriptions :data="detailData" :schema="allSchemas.detailSchema"> |
|
4 |
<!-- 展示 HTML 内容 --> |
|
5 |
<template #templateContent="{ row }"> |
|
6 |
<div v-dompurify-html="row.templateContent"></div> |
|
7 |
</template> |
|
8 |
</Descriptions> |
|
9 |
</Dialog> |
|
10 |
</template> |
|
11 |
<script lang="ts" setup> |
|
12 |
import * as MailLogApi from '@/api/system/mail/log' |
|
13 |
import { allSchemas } from './log.data' |
|
14 |
|
|
15 |
defineOptions({ name: 'SystemMailLogDetail' }) |
|
16 |
|
|
17 |
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
18 |
const detailLoading = ref(false) // 表单的加载中 |
|
19 |
const detailData = ref() // 详情数据 |
|
20 |
|
|
21 |
/** 打开弹窗 */ |
|
22 |
const open = async (id: number) => { |
|
23 |
dialogVisible.value = true |
|
24 |
// 设置数据 |
|
25 |
detailLoading.value = true |
|
26 |
try { |
|
27 |
detailData.value = await MailLogApi.getMailLog(id) |
|
28 |
} finally { |
|
29 |
detailLoading.value = false |
|
30 |
} |
|
31 |
} |
|
32 |
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
33 |
</script> |