index.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <script setup lang="ts">
  2. import { useColumns } from "./columns";
  3. import { useRenderIcon } from "@/components/ReIcon/src/hooks";
  4. import { tableData } from "../../data";
  5. const { loading, columns, pagination, Empty, onCurrentChange } = 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. tableData.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-popover placement="right" :width="400" trigger="click">
  33. <template #reference>
  34. <el-button
  35. plain
  36. circle
  37. size="small"
  38. :title="`查看考勤详情`"
  39. :icon="useRenderIcon('ri:search-line')"
  40. />
  41. </template>
  42. <el-table :data="row.items">
  43. <el-table-column width="150" property="name" label="人员名称" />
  44. <el-table-column width="100" property="confirm" label="到岗状态">
  45. <template #default="scope">
  46. <div>{{ scope.row.confirm ? "到岗" : "缺岗" }}</div>
  47. </template>
  48. </el-table-column>
  49. <el-table-column width="100" property="rssi" label="在线状态">
  50. <template #default="scope">
  51. <div>{{ scope.row.rssi == 0 ? "离线" : "在线" }}</div>
  52. </template>
  53. </el-table-column>
  54. </el-table>
  55. </el-popover>
  56. </template>
  57. </pure-table>
  58. </template>
  59. <style lang="scss">
  60. .pure-table-filter {
  61. .el-table-filter__list {
  62. min-width: 80px;
  63. padding: 0;
  64. li {
  65. line-height: 28px;
  66. }
  67. }
  68. }
  69. </style>
  70. <style lang="scss" scoped>
  71. :deep(.el-table) {
  72. --el-table-border: none;
  73. --el-table-border-color: transparent;
  74. .el-empty__description {
  75. margin: 0;
  76. }
  77. .el-scrollbar__bar {
  78. display: none;
  79. }
  80. }
  81. </style>