today_visitor.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <div class="page animate__animated animate__faster animate__fadeInRight" style="min-height: 56.3125rem;">
  3. <more title="今日访客"></more>
  4. <div v-loading="loading">
  5. <div v-if="list.length>0">
  6. <div class="card" v-for="(item,index) in list" :key="index">
  7. <div class="card-left">
  8. <div class="center">
  9. <img :src="item.faceUrl">
  10. </div>
  11. <div class="data">
  12. <div>{{item.userName}}</div>
  13. <div>体温 {{item.temperature}}℃</div>
  14. </div>
  15. </div>
  16. <div class="card-center">
  17. {{item.openTime}}
  18. </div>
  19. <!-- <div class="card-right" v-if="false">-->
  20. <!-- 逗留:{{item.time}}-->
  21. <!-- </div>-->
  22. </div>
  23. </div>
  24. <avue-empty v-else style="margin-top: 150px;"></avue-empty>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. import more from "@/components/more.vue";
  30. import {
  31. getList
  32. } from "@/api/estate/accessrecord";
  33. import {
  34. dateFormat
  35. } from "@/util/date";
  36. export default {
  37. components: {
  38. more
  39. },
  40. data() {
  41. return {
  42. loading: true,
  43. page: {
  44. current: 1,
  45. size: 5,
  46. total: 0
  47. },
  48. list: []
  49. };
  50. },
  51. created() {
  52. this.loadGuestRecord(1);
  53. },
  54. methods: {
  55. loadGuestRecord(current) {
  56. this.loading = true;
  57. let that = this;
  58. //userType:2-员工,4-访客
  59. let queryDate = dateFormat(new Date, "yyyy-MM-dd");
  60. getList(current, this.page.size, {
  61. "userType": 4,
  62. "queryDate": queryDate
  63. }).then(res => {
  64. let data = res.data.data;
  65. that.list = data.records;
  66. that.page.total = data.total;
  67. that.page.current = current;
  68. that.loading = false;
  69. })
  70. },
  71. /*change() {
  72. setInterval(() => {
  73. let list = this.list;
  74. list.push(list[0]);
  75. list.splice(0, 1);
  76. this.list = list;
  77. }, 1500)
  78. }*/
  79. },
  80. mounted() {
  81. },
  82. };
  83. </script>
  84. <style lang="scss" scoped>
  85. .page {
  86. background-color: #FFFFFF;
  87. padding: 1.2rem;
  88. box-sizing: border-box;
  89. }
  90. .center {
  91. display: flex;
  92. justify-content: center;
  93. align-items: center;
  94. }
  95. .card {
  96. display: flex;
  97. justify-content: space-between;
  98. align-items: center;
  99. background-color: #f5f5f5;
  100. padding: 0.68rem 1.4rem;
  101. margin-top: 1rem;
  102. .card-center,
  103. .card-right {
  104. color: #333333;
  105. font-size: 0.875rem;
  106. }
  107. .card-left {
  108. display: flex;
  109. img {
  110. width: 3rem;
  111. height: 3rem;
  112. border-radius: 50%;
  113. margin-right: 0.625rem;
  114. }
  115. .data {
  116. display: flex;
  117. align-items: flex-start;
  118. justify-content: center;
  119. flex-direction: column;
  120. text-align: left;
  121. div:first-child {
  122. color: #333333;
  123. font-weight: 800;
  124. font-size: 0.93rem;
  125. }
  126. div:last-child {
  127. margin-top: 0.16rem;
  128. color: #999999;
  129. font-weight: 400;
  130. font-size: 0.8rem;
  131. }
  132. }
  133. }
  134. }
  135. </style>