MailLogDetail.vue 989 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  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" name="SystemMailLogDetail" setup>
  12. import * as MailLogApi from '@/api/system/mail/log'
  13. import { allSchemas } from './log.data'
  14. const dialogVisible = ref(false) // 弹窗的是否展示
  15. const detailLoading = ref(false) // 表单的加载中
  16. const detailData = ref() // 详情数据
  17. /** 打开弹窗 */
  18. const open = async (id: number) => {
  19. dialogVisible.value = true
  20. // 设置数据
  21. detailLoading.value = true
  22. try {
  23. detailData.value = await MailLogApi.getMailLog(id)
  24. } finally {
  25. detailLoading.value = false
  26. }
  27. }
  28. defineExpose({ open }) // 提供 open 方法,用于打开弹窗
  29. </script>