index.vue 1.6 KB

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