MailAccountDetail.vue 828 B

12345678910111213141516171819202122232425262728
  1. <template>
  2. <Dialog v-model="dialogVisible" title="详情">
  3. <Descriptions :data="detailData" :schema="allSchemas.detailSchema" />
  4. </Dialog>
  5. </template>
  6. <script lang="ts" setup>
  7. import * as MailAccountApi from '@/api/system/mail/account'
  8. import { allSchemas } from './account.data'
  9. defineOptions({ name: 'SystemMailAccountDetail' })
  10. const dialogVisible = ref(false) // 弹窗的是否展示
  11. const detailLoading = ref(false) // 表单的加载中
  12. const detailData = ref() // 详情数据
  13. /** 打开弹窗 */
  14. const open = async (id: number) => {
  15. dialogVisible.value = true
  16. // 设置数据
  17. detailLoading.value = true
  18. try {
  19. detailData.value = await MailAccountApi.getMailAccount(id)
  20. } finally {
  21. detailLoading.value = false
  22. }
  23. }
  24. defineExpose({ open }) // 提供 open 方法,用于打开弹窗
  25. </script>