index.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <doc-alert title="邮件配置" url="https://doc.iocoder.cn/mail" />
  3. <!-- 搜索工作栏 -->
  4. <ContentWrap>
  5. <Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
  6. </ContentWrap>
  7. <!-- 列表 -->
  8. <ContentWrap>
  9. <Table
  10. :columns="allSchemas.tableColumns"
  11. :data="tableObject.tableList"
  12. :loading="tableObject.loading"
  13. :pagination="{
  14. total: tableObject.total
  15. }"
  16. v-model:pageSize="tableObject.pageSize"
  17. v-model:currentPage="tableObject.currentPage"
  18. >
  19. <template #action="{ row }">
  20. <el-button
  21. link
  22. type="primary"
  23. @click="openDetail(row.id)"
  24. v-hasPermi="['system:mail-log:query']"
  25. >
  26. 详情
  27. </el-button>
  28. </template>
  29. </Table>
  30. </ContentWrap>
  31. <!-- 表单弹窗:详情 -->
  32. <mail-log-detail ref="detailRef" />
  33. </template>
  34. <script setup lang="ts" name="SystemMailLog">
  35. import { allSchemas } from './log.data'
  36. import * as MailLogApi from '@/api/system/mail/log'
  37. import MailLogDetail from './MailLogDetail.vue'
  38. // tableObject:表格的属性对象,可获得分页大小、条数等属性
  39. // tableMethods:表格的操作对象,可进行获得分页、删除记录等操作
  40. // 详细可见:https://doc.iocoder.cn/vue3/crud-schema/
  41. const { tableObject, tableMethods } = useTable({
  42. getListApi: MailLogApi.getMailLogPage // 分页接口
  43. })
  44. // 获得表格的各种操作
  45. const { getList, setSearchParams } = tableMethods
  46. /** 详情操作 */
  47. const detailRef = ref()
  48. const openDetail = (id: number) => {
  49. detailRef.value.open(id)
  50. }
  51. /** 初始化 **/
  52. onMounted(() => {
  53. getList()
  54. })
  55. </script>