index.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <ContentWrap>
  3. <!-- 列表 -->
  4. <XTable @register="registerTable">
  5. <!-- 操作:导出 -->
  6. <template #toolbar_buttons>
  7. <XButton
  8. type="warning"
  9. preIcon="ep:download"
  10. :title="t('action.export')"
  11. @click="exportList('短信日志.xls')"
  12. />
  13. </template>
  14. <template #actionbtns_default="{ row }">
  15. <XTextButton preIcon="ep:view" :title="t('action.detail')" @click="handleDetail(row)" />
  16. </template>
  17. </XTable>
  18. </ContentWrap>
  19. <XModal id="smsLog" v-model="dialogVisible" :title="dialogTitle">
  20. <!-- 对话框(详情) -->
  21. <Descriptions
  22. v-if="actionType === 'detail'"
  23. :schema="allSchemas.detailSchema"
  24. :data="detailData"
  25. />
  26. <!-- 操作按钮 -->
  27. <template #footer>
  28. <XButton :title="t('dialog.close')" @click="dialogVisible = false" />
  29. </template>
  30. </XModal>
  31. </template>
  32. <script setup lang="ts" name="SmsLog">
  33. import { allSchemas } from './sms.log.data'
  34. import * as SmsLoglApi from '@/api/system/sms/smsLog'
  35. const { t } = useI18n() // 国际化
  36. // 列表相关的变量
  37. const [registerTable, { exportList }] = useXTable({
  38. allSchemas: allSchemas,
  39. getListApi: SmsLoglApi.getSmsLogPageApi,
  40. exportListApi: SmsLoglApi.exportSmsLogApi
  41. })
  42. // 弹窗相关的变量
  43. const dialogVisible = ref(false) // 是否显示弹出层
  44. const dialogTitle = ref(t('action.detail')) // 弹出层标题
  45. const actionType = ref('') // 操作按钮的类型
  46. // ========== 详情相关 ==========
  47. const detailData = ref() // 详情 Ref
  48. const handleDetail = (row: SmsLoglApi.SmsLogVO) => {
  49. // 设置数据
  50. actionType.value = 'detail'
  51. detailData.value = row
  52. dialogVisible.value = true
  53. }
  54. </script>