|
|
@@ -1,28 +1,36 @@
|
|
|
<template>
|
|
|
- <div class="page" style="box-sizing: border-box;">
|
|
|
+ <div class="page" style="box-sizing: border-box;position: relative;">
|
|
|
<more title="常驻人员"></more>
|
|
|
+ <div style="position: absolute;right: 40px;bottom: 10px;z-index: 999;" v-show="!loading">
|
|
|
+ <span style="color: #3b8ff4;">{{page.current}}</span>
|
|
|
+ /
|
|
|
+ <span style="color: #333333;">{{page.pages}}</span>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="card-box">
|
|
|
- <div class="changeIcon" style="left: 0px;z-index: 9999;">
|
|
|
+ <div class="card-box" style="position: relative;">
|
|
|
+ <div class="changeIcon" style="left: 0px;z-index: 9999;" v-show="!loading">
|
|
|
<el-button type="primary" plain size="medium" @click="change('Left')" icon="el-icon-arrow-left" circle>
|
|
|
</el-button>
|
|
|
</div>
|
|
|
|
|
|
- <div class="changeIcon" style="right: 0px;z-index: 9999;">
|
|
|
+ <div class="changeIcon" style="right: 0px;z-index: 9999;" v-show="!loading">
|
|
|
<el-button type="primary" plain size="medium" @click="change('Right')" icon="el-icon-arrow-right" circle>
|
|
|
</el-button>
|
|
|
</div>
|
|
|
|
|
|
<div class="card-list animate__animated animate__faster animate__fadeInLeft"
|
|
|
- style="display: flex;justify-content: center;">
|
|
|
- <div class="card" v-for="(item,index) in list" :key="index">
|
|
|
+ style="display: flex;justify-content: center;min-height: 304px;" v-loading="loading">
|
|
|
+ <div @click="showDetail(item)" class="card" v-for="(item,index) in list" :key="index">
|
|
|
<div class="img">
|
|
|
- <el-image style="width: 100%;height: 100%" :src="item.faceUrl" :preview-src-list="[item.faceUrl]"></el-image>
|
|
|
+ <el-image style="width: 100%;height: 100%;" :style="item.faceUrl?'filter: blur(3px);':''"
|
|
|
+ :src="item.faceUrl">
|
|
|
+ <img style="width: 100%;height: 100%;" slot="error" src="/img/icon/open.png">
|
|
|
+ </el-image>
|
|
|
</div>
|
|
|
<div class="data">
|
|
|
<div class="left">
|
|
|
<div class="name">{{item.userName}}</div>
|
|
|
- <div class="temperature">
|
|
|
+ <div class="temperature" v-if="item.temperature">
|
|
|
<div>{{item.temperature}} ℃</div>
|
|
|
<div v-if="item.temperature>37.6" class="center" style="margin-top: 0.125rem;"><i
|
|
|
class="el-icon-warning dot"></i></div>
|
|
|
@@ -31,11 +39,11 @@
|
|
|
<div class="right">
|
|
|
<div style="display: flex;" v-if="item.isOut === 1">
|
|
|
<img src="/img/icon/enter.png" style="width: 16px;height: 16px;margin-right: 0.2rem;" />
|
|
|
- {{item.openTime}}
|
|
|
+ {{item.openTime | formatDate}}
|
|
|
</div>
|
|
|
<div style="display: flex;margin-top: 0.2rem;" v-if="item.isOut === 2">
|
|
|
<img src="/img/icon/outer.png" style="width: 16px;height: 16px;margin-right: 0.2rem;" />
|
|
|
- {{item.openTime}}
|
|
|
+ {{item.openTime | formatDate}}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -47,42 +55,76 @@
|
|
|
|
|
|
<script>
|
|
|
import more from "@/components/more.vue";
|
|
|
- import {getList} from "@/api/estate/accessrecord";
|
|
|
+ import {
|
|
|
+ getList
|
|
|
+ } from "@/api/estate/accessrecord";
|
|
|
+ import dateTime from "@/util/dateTime.js"
|
|
|
export default {
|
|
|
components: {
|
|
|
more
|
|
|
},
|
|
|
+ inject: ['index'],
|
|
|
data() {
|
|
|
return {
|
|
|
- page:{
|
|
|
+ loading: true,
|
|
|
+ page: {
|
|
|
current: 1,
|
|
|
size: 5,
|
|
|
- total: 0
|
|
|
+ total: 0,
|
|
|
+ pages: 0
|
|
|
},
|
|
|
list: []
|
|
|
};
|
|
|
},
|
|
|
- created(){
|
|
|
- this.loadStaffRecord(1);
|
|
|
+ created() {
|
|
|
+ this.loadStaffRecord();
|
|
|
+ },
|
|
|
+ filters: {
|
|
|
+ formatDate(date) {
|
|
|
+ return dateTime.format(new Date(date), 'mm-dd HH:MM:SS')
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- loadStaffRecord(current){
|
|
|
+ showDetail(item) {
|
|
|
+ let params = {
|
|
|
+ style:'height: 58%;width: 38%;',
|
|
|
+ title: '常驻人员',
|
|
|
+ type: 'visitor',
|
|
|
+ content:item,
|
|
|
+ time: item.createTime
|
|
|
+ }
|
|
|
+ this.index.$refs.myDialog.open(params)
|
|
|
+ },
|
|
|
+ async loadStaffRecord() {
|
|
|
//userType:2-员工,4-访客
|
|
|
- getList(current, this.page.size, {"userType": 2}).then(res =>{
|
|
|
- let data = res.data.data;
|
|
|
- this.list = data.records;
|
|
|
- this.page.total = data.total;
|
|
|
- this.page.current = current;
|
|
|
- })
|
|
|
+ let params = {
|
|
|
+ "userType": 2
|
|
|
+ }
|
|
|
+ let data = (await getList(this.page.current, this.page.size, params)).data.data
|
|
|
+ this.list = data.records;
|
|
|
+ this.page.total = data.total;
|
|
|
+ this.page.pages = data.pages
|
|
|
+ this.loading = false
|
|
|
},
|
|
|
change(item) {
|
|
|
- console.log(item);
|
|
|
+ if (item == 'Left') {
|
|
|
+ if (this.page.current > 1) {
|
|
|
+ this.page.current = this.page.current - 1
|
|
|
+ } else {
|
|
|
+ this.page.current = this.page.pages
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item == 'Right') {
|
|
|
+ if ((this.page.current + 1) <= this.page.pages) {
|
|
|
+ this.page.current = this.page.current + 1
|
|
|
+ } else {
|
|
|
+ this.page.current = 1
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.loadStaffRecord()
|
|
|
this.$animateCss('.card-list', 'animate__slideIn' + item)
|
|
|
- this.list = this.loadStaffRecord(this.page.current + 1)
|
|
|
},
|
|
|
- randomArray(array) {
|
|
|
- return array.sort(() => Math.random() - 0.5)
|
|
|
- }
|
|
|
}
|
|
|
};
|
|
|
</script>
|