Showing
1 changed file
with
52 additions
and
41 deletions
... | ... | @@ -25,63 +25,69 @@ |
25 | 25 | </view> |
26 | 26 | </view> |
27 | 27 | </u-sticky> |
28 | - <mescroll-body ref="mescrollRef" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback"> | |
29 | - <view class="device-list"> | |
30 | - <view @click="openDeviceDetail(item.id, item.alarmStatus, item.lastOnlineTime, item.tbDeviceId)" class="list-item" v-for="item in list" :key="item.id"> | |
31 | - <view | |
32 | - class="u-flex item" | |
33 | - style=" | |
28 | + <mescroll-body ref="mescrollRef" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback"> | |
29 | + <view class="device-list"> | |
30 | + <view @click="openDeviceDetail(item.id, item.alarmStatus, item.lastOnlineTime, item.tbDeviceId)" class="list-item" v-for="item in list" :key="item.id"> | |
31 | + <view | |
32 | + class="u-flex item" | |
33 | + style=" | |
34 | 34 | justify-content: flex-start; |
35 | 35 | flex-direction: column; |
36 | 36 | align-items: center; |
37 | 37 | " |
38 | - > | |
39 | - <view style="width: 450rpx; text-align: left"> | |
40 | - <text style="color: #333; font-size: 15px;font-weight: bold;">{{ item.name }}</text> | |
41 | - </view> | |
42 | - <view style="width: 450rpx; text-align: left; margin-top: 10rpx"> | |
43 | - <view style="color: #666; font-size: 14px;display: flex;"> | |
44 | - 设备编号: | |
45 | - <view style="margin-left:16rpx">{{ item.sn }}</view> | |
46 | - </view> | |
38 | + > | |
39 | + <view style="width: 450rpx; text-align: left"> | |
40 | + <text style="color: #333; font-size: 15px;font-weight: bold;">{{ item.name }}</text> | |
41 | + </view> | |
42 | + <view style="width: 450rpx; text-align: left; margin-top: 10rpx"> | |
43 | + <view style="color: #666; font-size: 14px;display: flex;"> | |
44 | + 设备编号: | |
45 | + <view style="margin-left:16rpx">{{ item.sn }}</view> | |
47 | 46 | </view> |
48 | - <view style="width: 450rpx; text-align: left; margin-top: 10rpx"> | |
49 | - <view style="color: #666; font-size: 14px;display: flex;"> | |
50 | - 所属组织: | |
51 | - <view style="margin-left:16rpx">{{ item.organizationDTO.name }}</view> | |
52 | - </view> | |
47 | + </view> | |
48 | + <view style="width: 450rpx; text-align: left; margin-top: 10rpx"> | |
49 | + <view style="color: #666; font-size: 14px;display: flex;"> | |
50 | + 所属组织: | |
51 | + <view style="margin-left:16rpx">{{ item.organizationDTO.name }}</view> | |
53 | 52 | </view> |
54 | 53 | </view> |
55 | - <view class="item"> | |
56 | - <view class="u-flex" style="margin-top: -6rpx"> | |
57 | - <image | |
58 | - style=" | |
54 | + </view> | |
55 | + <view class="item"> | |
56 | + <view class="u-flex" style="margin-top: -6rpx"> | |
57 | + <image | |
58 | + style=" | |
59 | 59 | width: 30rpx; |
60 | 60 | height: 30rpx; |
61 | 61 | margin-top: 5rpx; |
62 | 62 | margin-right: 5rpx; |
63 | 63 | " |
64 | - :src="item.deviceState === 'ONLINE' ? '../../static/online.png' : item.deviceState === 'INACTIVE' ? '../../static/unonline.png' : '../../static/baojing.png'" | |
65 | - /> | |
64 | + :src=" | |
65 | + item.deviceState === 'ONLINE' | |
66 | + ? '../../static/online.png' | |
67 | + : item.deviceState === 'INACTIVE' | |
68 | + ? '../../static/unonline.png' | |
69 | + : '../../static/baojing.png' | |
70 | + " | |
71 | + /> | |
66 | 72 | |
67 | - <view> | |
68 | - <text | |
69 | - style=" | |
73 | + <view> | |
74 | + <text | |
75 | + style=" | |
70 | 76 | color: #377dff; |
71 | 77 | font-size: 13px; |
72 | 78 | margin-left: 5rpx; |
73 | 79 | margin-top: 20rpx; |
74 | 80 | " |
75 | - :style="{ color: item.deviceState === 'ONLINE' ? '#377DFF' : item.deviceState === 'INACTIVE' ? '#666666' : '#DE4437' }" | |
76 | - > | |
77 | - {{ item.deviceState === 'ONLINE' ? '在线' : item.deviceState === 'INACTIVE' ? '待激活' : '离线' }} | |
78 | - </text> | |
79 | - </view> | |
81 | + :style="{ color: item.deviceState === 'ONLINE' ? '#377DFF' : item.deviceState === 'INACTIVE' ? '#666666' : '#DE4437' }" | |
82 | + > | |
83 | + {{ item.deviceState === 'ONLINE' ? '在线' : item.deviceState === 'INACTIVE' ? '待激活' : '离线' }} | |
84 | + </text> | |
80 | 85 | </view> |
81 | 86 | </view> |
82 | 87 | </view> |
83 | 88 | </view> |
84 | - </mescroll-body> | |
89 | + </view> | |
90 | + </mescroll-body> | |
85 | 91 | <!-- 设备筛选 --> |
86 | 92 | <u-popup @close="close" closeable bgColor="#fff" :show="show" mode="bottom" :round="20" @touchmove.stop.prevent="disabledScroll"> |
87 | 93 | <view class="filter" @touchmove.stop.prevent="disabledScroll"> |
... | ... | @@ -188,7 +194,8 @@ export default { |
188 | 194 | num: 0, |
189 | 195 | size: 10 |
190 | 196 | }, |
191 | - deviceState: '' | |
197 | + deviceState: '', | |
198 | + deviceName: '' | |
192 | 199 | }; |
193 | 200 | }, |
194 | 201 | async onLoad(options) { |
... | ... | @@ -224,6 +231,7 @@ export default { |
224 | 231 | }, |
225 | 232 | /*下拉刷新的回调 */ |
226 | 233 | downCallback() { |
234 | + this.deviceName = ''; | |
227 | 235 | //联网加载数据 |
228 | 236 | this.list = []; |
229 | 237 | this.page.num = 1; |
... | ... | @@ -242,7 +250,8 @@ export default { |
242 | 250 | this.loadData(this.page.num, { |
243 | 251 | deviceState: deviceState.type ? deviceState.type : undefined, |
244 | 252 | deviceType: deviceType.type ? deviceType.type : undefined, |
245 | - alarmStatus: alarmStatus.type === '0' || alarmStatus.type === '1' ? alarmStatus.type : undefined | |
253 | + alarmStatus: alarmStatus.type === '0' || alarmStatus.type === '1' ? alarmStatus.type : undefined, | |
254 | + name: this.deviceName == null ? null : this.deviceName | |
246 | 255 | }); |
247 | 256 | }, |
248 | 257 | |
... | ... | @@ -308,11 +317,13 @@ export default { |
308 | 317 | }); |
309 | 318 | this.show = false; |
310 | 319 | }, |
311 | - inputChanged: debounce(function(name) { | |
320 | + inputChanged(e) { | |
321 | + this.page.num = 1; | |
322 | + this.deviceName = e; | |
312 | 323 | this.loadData(1, { |
313 | - name | |
324 | + name: this.deviceName | |
314 | 325 | }); |
315 | - }, 500) | |
326 | + } | |
316 | 327 | } |
317 | 328 | }; |
318 | 329 | </script> |
... | ... | @@ -384,4 +395,4 @@ export default { |
384 | 395 | } |
385 | 396 | } |
386 | 397 | } |
387 | -</style> | |
398 | +</style> | ... | ... |