VInout.vue
1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<template>
<div class="theme-wrap">
<card-title> <span>进出场信息</span></card-title>
<div class="theme-body">
<div class="access-title">
<p><span><span class="access-icon"></span>{{inoutmsg}} </span> <span>{{inouttime|formatDate}}</span></p>
</div>
<div class="access-img" :style="{backgroundImage:'url('+imgUrl+')'}"></div>
</div>
</div>
</template>
<script>
import CardTitle from './base/CardTitle'
import AccountNum from './base/AccountNum'
import { formatDate } from '../utils/date'
export default {
name: 'VInout',
components: {
CardTitle,
AccountNum
},
props:['inoutmsg','inouttime','imgUrl'],
data(){
return{
}
},
filters:{
formatDate(time){
var date = new Date(time)
return formatDate(date, 'yyyy-MM-dd hh:mm');
}
}
}
</script>
<style scoped lang="scss">
.theme-wrap {
height: 100%;
}
.theme-body {
height: calc(100% - 30px);
margin-left: 20px;
}
.access-title{
height: 30% ;
display: flex;
align-items: center;
p {
width: 99%;
padding-right: 20px;
height: 26px;
line-height: 26px;
display: flex;
justify-content: space-between;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
background: linear-gradient(to right, rgba(0, 45, 140, .1) , rgba(0, 45, 140, .7));
}
.access-icon{
display: inline-block;
vertical-align: middle;
width: 22px;
height: 26px;
margin-right: 10px;
background: url("../images/content/access-icon.png") no-repeat 0 center;
background-size: 22px 22px;
}
}
.access-img{
width: 93%;
height: 60%;
background-repeat: no-repeat;
background-size: 100% 100%;
}
</style>