list.vue
3.8 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<template>
<div class="main device-list">
<template v-for="(i,index) in list">
<div
:key="index"
class="items"
>
<div class="top">
<div class="time">
{{i.time}}
</div>
<div class="info">
<div class="info-box">
<div class="item">
<div class="sprite-icon icon-device-sn"></div>
SN码:
<div class="no">{{i.sn}}</div>
</div>
<div class="item">
<div class="sprite-icon icon-device-vin"></div>
VIN码:
<div class="no">{{i.vin}}</div>
</div>
</div>
<div class="sprite-icon icon-device-bind"></div>
</div>
</div>
<div class="bottom">
<div class="label">操作地址</div>
<div class="address">{{i.address}}</div>
</div>
</div>
</template>
<device-tabbar
routeName="device.index"
:tabIndex="1"
></device-tabbar>
</div>
</template>
<script type='text/ecmascript-6'>
import DeviceTabBar from '@c/DeviceTabBar'
import { device } from '@r/api'
export default {
name: 'list',
data () {
return {
list: []
}
},
components: {
'device-tabbar': DeviceTabBar
},
mounted () {
this.showLoading()
device.getInstallationList().then(res => {
console.log(res)
if (res) {
let { code, data, message } = res
if (code == 0) {
data.map(e => {
e.time = new Date(e.updatedDate).format('yyyy.MM.dd hh:mm:ss')
})
this.list = data
} else {
this.showToast(message)
}
} else {
this.showToast('系统异常')
}
})
},
methods: {
}
}
</script>
<style lang='scss'>
html,
body {
background-color: rgb(247, 247, 247);
}
.device-list {
padding-bottom: 60px;
.items {
background: #ffffff;
border-bottom: 0.2px solid #c8c8c8;
border-top: 0.2px solid #c8c8c8;
margin-top: 16px;
position: relative;
&::before {
position: absolute;
content: "";
background: #ededed;
height: 100%;
width: 2px;
left: 66px;
top: 0;
z-index: 2;
}
.top {
display: grid;
grid-template-columns: 68px 1fr;
color: #333333;
position: relative;
&::before {
position: absolute;
top: 50%;
transform: translateY(-50%);
left: 62px;
background: #ffffff;
border: 2px solid #ededed;
content: "";
width: 10px;
height: 10px;
border-radius: 100%;
z-index: 3;
box-sizing: border-box;
}
.time,
.info {
display: flex;
align-items: center;
}
.time {
font-size: 10px;
text-align: center;
line-height: 14px;
}
.info {
font-size: 14px;
display: grid;
padding: 16px 12px;
grid-template-columns: 229px 54px;
&-box {
.item {
display: flex;
align-items: center;
.sprite-icon {
margin-right: 4px;
}
.no {
word-break: break-all;
max-width: 152px;
margin-left: 6px;
}
}
.item:first-of-type {
margin-bottom: 8px;
}
}
}
}
.bottom {
border-top: 1.5px solid #ededed;
display: grid;
grid-template-columns: 68px 1fr;
min-height: 22.5px;
font-size: 10px;
color: #999999;
.label,
.address {
display: flex;
align-items: center;
justify-content: center;
}
.address {
padding: 3.5px 12px;
justify-content: flex-start;
}
}
}
}
</style>