【前端】智能库房综合管理系统前端项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.2 KiB

3 years ago
3 years ago
  1. <template>
  2. <div class="container-wrap">
  3. <span class="right-top-line" />
  4. <span class="left-bottom-line" />
  5. <h3 class="table-title">
  6. <p class="title-arrow">
  7. <svg-icon icon-class="menjin" class-name="warehouse-svg" />门禁记录
  8. </p>
  9. </h3>
  10. <el-table ref="table" style="min-width: 100%;" :height="height" :data="tableData" class="warehose-el-table" stripe>
  11. <el-table-column prop="update_time" label="时间" align="center" min-width="60">
  12. <template slot-scope="scope">
  13. <div>{{ scope.row.update_time | parseTime }}</div>
  14. </template>
  15. </el-table-column>
  16. <el-table-column label="库房" align="center" min-width="30">
  17. <template>
  18. 档案库
  19. </template>
  20. </el-table-column>
  21. <el-table-column prop="alarmMsg" label="警情" align="center" :show-overflow-tooltip="true" min-width="85" />
  22. </el-table>
  23. </div>
  24. </template>
  25. <script>
  26. import { securitydoor } from '@/api/home/securityDoor/securityDoor'
  27. export default {
  28. name: 'SecurityDoor',
  29. props: {
  30. width: {
  31. type: String,
  32. default: '100%'
  33. },
  34. height: {
  35. type: String,
  36. default: '100%'
  37. }
  38. },
  39. data() {
  40. return {
  41. tableData: [], // 正在展示的数据
  42. time: null
  43. }
  44. },
  45. created() {
  46. this.getSecuritydoor()
  47. this.time = setInterval(() => {
  48. this.getSecuritydoor()
  49. }, 1000 * 30)
  50. },
  51. destroyed() {
  52. clearInterval(this.time)
  53. this.time = null
  54. },
  55. methods: {
  56. // 表格隔行变色
  57. rowBgColor({ row, rowIndex }) {
  58. if (rowIndex % 2 === 1) {
  59. return 'light-blue'
  60. } else {
  61. return ''
  62. }
  63. },
  64. getSecuritydoor() {
  65. securitydoor().then((data) => {
  66. if (data && data.length > 0) {
  67. this.tableData.splice(0, data.length, ...data)
  68. }
  69. })
  70. }
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. @import "~@/assets/styles/lend-manage.scss";
  76. .warehouse-left {
  77. position: relative;
  78. h2 {
  79. position: absolute;
  80. left: 50%;
  81. top: 0;
  82. transform: translateX(-50%);
  83. color: #fff;
  84. font-size: 16px;
  85. }
  86. }
  87. ::v-deep
  88. .el-table--striped
  89. .el-table__body
  90. tr.el-table__row--striped
  91. td.el-table__cell {
  92. background: #02255f;
  93. }
  94. </style>