index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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
  34. import { ref } from 'vue'
  35. import { useI18n } from '@/hooks/web/useI18n'
  36. import { useXTable } from '@/hooks/web/useXTable'
  37. import { allSchemas } from './sms.log.data'
  38. import * as SmsLoglApi from '@/api/system/sms/smsLog'
  39. const { t } = useI18n() // 国际化
  40. // 列表相关的变量
  41. const [registerTable, { exportList }] = useXTable({
  42. allSchemas: allSchemas,
  43. getListApi: SmsLoglApi.getSmsLogPageApi,
  44. exportListApi: SmsLoglApi.exportSmsLogApi
  45. })
  46. // 弹窗相关的变量
  47. const dialogVisible = ref(false) // 是否显示弹出层
  48. const dialogTitle = ref('edit') // 弹出层标题
  49. const actionType = ref('') // 操作按钮的类型
  50. // ========== 详情相关 ==========
  51. const detailData = ref() // 详情 Ref
  52. const handleDetail = (row: SmsLoglApi.SmsLogVO) => {
  53. // 设置数据
  54. detailData.value = row
  55. dialogVisible.value = true
  56. }
  57. </script>