index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <script setup lang="ts">
  2. import { useColumns } from "./columns";
  3. import { useRenderIcon } from "@/components/ReIcon/src/hooks";
  4. const { loading, columns, dataList, pagination, Empty, onCurrentChange } =
  5. useColumns();
  6. </script>
  7. <template>
  8. <pure-table
  9. row-key="id"
  10. alignWhole="center"
  11. showOverflowTooltip
  12. :loading="loading"
  13. :loading-config="{ background: 'transparent' }"
  14. :data="
  15. dataList.slice(
  16. (pagination.currentPage - 1) * pagination.pageSize,
  17. pagination.currentPage * pagination.pageSize
  18. )
  19. "
  20. :columns="columns"
  21. :pagination="pagination"
  22. @page-current-change="onCurrentChange"
  23. >
  24. <template #empty>
  25. <el-empty description="暂无数据" :image-size="60">
  26. <template #image>
  27. <Empty />
  28. </template>
  29. </el-empty>
  30. </template>
  31. <template #operation="{ row }">
  32. <el-button
  33. plain
  34. circle
  35. size="small"
  36. :title="`查看序号为${row.id}的详情`"
  37. :icon="useRenderIcon('ri:search-line')"
  38. />
  39. </template>
  40. </pure-table>
  41. </template>
  42. <style lang="scss">
  43. .pure-table-filter {
  44. .el-table-filter__list {
  45. min-width: 80px;
  46. padding: 0;
  47. li {
  48. line-height: 28px;
  49. }
  50. }
  51. }
  52. </style>
  53. <style lang="scss" scoped>
  54. :deep(.el-table) {
  55. --el-table-border: none;
  56. --el-table-border-color: transparent;
  57. .el-empty__description {
  58. margin: 0;
  59. }
  60. .el-scrollbar__bar {
  61. display: none;
  62. }
  63. }
  64. </style>