index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. <!-- 操作:详情 -->
  16. <XTextButton preIcon="ep:view" :title="t('action.detail')" @click="handleDetail(row)" />
  17. </template>
  18. </XTable>
  19. </ContentWrap>
  20. <!-- 弹窗 -->
  21. <XModal id="postModel" v-model="dialogVisible" :title="dialogTitle">
  22. <!-- 表单:详情 -->
  23. <Descriptions :schema="allSchemas.detailSchema" :data="detailData" />
  24. <template #footer>
  25. <!-- 按钮:关闭 -->
  26. <XButton :title="t('dialog.close')" @click="dialogVisible = false" />
  27. </template>
  28. </XModal>
  29. </template>
  30. <script setup lang="ts" name="Loginlog">
  31. // 业务相关的 import
  32. import { allSchemas } from './loginLog.data'
  33. import { getLoginLogPageApi, exportLoginLogApi, LoginLogVO } from '@/api/system/loginLog'
  34. const { t } = useI18n() // 国际化
  35. // 列表相关的变量
  36. const [registerTable, { exportList }] = useXTable({
  37. allSchemas: allSchemas,
  38. getListApi: getLoginLogPageApi,
  39. exportListApi: exportLoginLogApi
  40. })
  41. // 详情操作
  42. const detailData = ref() // 详情 Ref
  43. const dialogVisible = ref(false) // 是否显示弹出层
  44. const dialogTitle = ref(t('action.detail')) // 弹出层标题
  45. // 详情
  46. const handleDetail = async (row: LoginLogVO) => {
  47. // 设置数据
  48. detailData.value = row
  49. dialogVisible.value = true
  50. }
  51. </script>