Show.vue
10.5 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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
<template>
<div class="">
<el-header class="headers">
<span class="title">实事分析展示</span>
</el-header>
<<<<<<< HEAD
<el-container style="min-height:calc(100vh - 64px);" class="showbox">
<el-main style="padding: 12px;overflow:hidden">
<div style="margin-bottom: 12px;">
<el-row :gutter="20">
<el-col :span="15">
<div class="videoCon">
<!-- 加入视频 -->
<videoplay ref="videoplay" :playurl="playurl"></videoplay>
</div>
</el-col>
<el-col :span="9">
<div class="imgCon">
<div class="imgDiv">
<!-- 加入img 100% -->
<div v-if="resultData[0]">
<img :src = "resultData[0].pic" class="photos"/>
</div>
</div>
<div style="padding:0 10px 10px 10px">
<div class="textDiv">
<div v-if="resultData[0]">
<p>抓拍时间:{{resultData[0].shoot_dt}}</p>
<p>抓拍地点:{{resultData[0].location_name}}</p>
<p>车牌号码:{{resultData[0].vehicle_plate_text}}</p>
<p>车辆类型:{{resultData[0].vehicle_body_type_text}}</p>
<p>车身颜色:{{resultData[0].vehicle_body_color_text}}</p>
<p>违法类型:{{resultData[0].illegal_text}}</p>
</div>
</div>
</div>
</div>
</el-col>
</el-row>
<div style="clear: both;"></div>
=======
<el-container>
<el-main class="mainDiv">
<div class="topDiv">
<div class="videoCon">
<!-- 加入视频 -->
</div>
<div class="imgCon">
<div class="imgDiv">
<!-- 加入img 100% -->
</div>
<div class="textDiv">
<p>抓拍时间:2019年10月29日 17:01:47</p>
<p>抓拍地点:丰豪东路与北清路交叉口</p>
<p>车牌号码:京B123456</p>
<p>车辆类型:小轿车</p>
<p>车身颜色:白色</p>
<p>违法类型:占用公交车道年</p>
</div>
</div>
>>>>>>> c156293e5665c9ed403aab57b2df7ed02e5cce09
</div>
<el-row class="bottomDiv" :gutter="10">
<!-- 循环生成lDiv -->
<el-col :span="8" class="lDiv">
<div class="leftImg">
<!-- 加入img 100% -->
<div v-if="resultData[1]">
<img :src = "resultData[1].pic" class="photos"/>
</div>
</div>
<div class="rightDiv">
<div v-if="resultData[1]">
<p>抓拍时间:{{resultData[1].shoot_dt}}</p>
<p>抓拍地点:{{resultData[1].location_name}}</p>
<p>车牌号码:{{resultData[1].vehicle_plate_text}}</p>
<p>车辆类型:{{resultData[1].vehicle_body_type_text}}</p>
<p>车身颜色:{{resultData[1].vehicle_body_color_text}}</p>
<p>违法类型:{{resultData[1].illegal_text}}</p>
</div>
</div>
<div style="clear: both;"></div>
</el-col>
<el-col :span="8" class="lDiv">
<div class="leftImg">
<!-- 加入img 100% -->
<div v-if="resultData[2]">
<img :src = "resultData[2].pic" class="photos"/>
</div>
</div>
<div class="rightDiv">
<div v-if="resultData[2]">
<p>抓拍时间:{{resultData[2].shoot_dt}}</p>
<p>抓拍地点:{{resultData[2].location_name}}</p>
<p>车牌号码:{{resultData[2].vehicle_plate_text}}</p>
<p>车辆类型:{{resultData[2].vehicle_body_type_text}}</p>
<p>车身颜色:{{resultData[2].vehicle_body_color_text}}</p>
<p>违法类型:{{resultData[2].illegal_text}}</p>
</div>
</div>
<div style="clear: both;"></div>
</el-col>
<el-col :span="8" class="lDiv">
<div class="leftImg">
<!-- 加入img 100% -->
<div v-if="resultData[3]">
<img :src = "resultData[3].pic" class="photos"/>
</div>
</div>
<div class="rightDiv">
<div v-if="resultData[3]">
<p>抓拍时间:{{resultData[3].shoot_dt}}</p>
<p>抓拍地点:{{resultData[3].location_name}}</p>
<p>车牌号码:{{resultData[3].vehicle_plate_text}}</p>
<p>车辆类型:{{resultData[3].vehicle_body_type_text}}</p>
<p>车身颜色:{{resultData[3].vehicle_body_color_text}}</p>
<p>违法类型:{{resultData[3].illegal_text}}</p>
</div>
</div>
<div style="clear: both;"></div>
</el-col>
<div style="clear: both;"></div>
</el-row>
</el-main>
</el-container>
</div>
</template>
<script>
import videoplay from './public/videoPlay'
export default {
name: "home",
data(){
return{
isCollapse: false,
conHeight:0,
playurl:'',
subtaskid:'',
taskid:'',
showws:null,
keepAlive:null,
quitws:false,
resultData:[]
};
},
created(){
this.taskid = this.$route.params.taskid
this.subtaskid = this.$route.params.subtaskid
this.playurl = this.$route.params.playurl
},
mounted(){
this.$refs.videoplay.videoPlay()
},
components: {
videoplay
// HelloWorld
},
methods:{
connectwebsocket(type) {
debugger
let that = this;
this.connect_id = new Date().getTime();
this.showws = new WebSocket(
"ws://" +
this.$api.wsIP +
"/websocket/v1/recv_data/connects/" +
this.connect_id
);
this.showws.onopen = () => {
console.log("ws事件推送服务连接成功");
debugger
let send_mesage =
'{"type":"request","connect_id": "' +
this.connect_id +
'","subtask_id":"' +
this.subtaskid +
'"}';
this.showws.send(send_mesage);
};
this.showws.onmessage = evt => {
let data = JSON.parse(evt.data);
if (data.command) {
} else if (data.type == "response") {
console.log("请求任务推送成功");
} else if (data.event_cate) {
debugger
if (data.event_cate != "flow") {
try {
data.picsEmpty = data.pics.length == 0 ? true : false;
data.pic =
data.pics[0].src_url || "data:image/jpeg;base64," + data.pics[0].pic_base64;
data.bigpic = data.pics[0].src_url || "data:image/jpeg;base64," + data.pics[0].pic_base64;
that.$buildCode.init(data);
if(that.resultData.length > 4) {
that.resultData.pop(data)
} else {
that.resultData.unshift(data)
}
} catch (err) {
console.log(err);
}
}
}
};
try {
this.keepAlive = setInterval(() => {
let send_mesage =
'{"type":"request","id":"' +
new Date().getTime() +
'","mts":"' +
new Date().getTime() +
'","command": "get /websocket/v1/recv_data/connects/' +
this.connect_id +
'/keep_alive"}';
if (that.showws.readyState == 1) {
that.showws.send(send_mesage);
} else {
clearInterval(that.keepAlive);
that.connectwebsocket(1);
console.log("推送服务断开连接");
}
}, 20000);
} catch (err) {
console.log(err);
}
}
},
beforeMount() {
this.connectwebsocket();
//监听成功
this.showws.onopen = ()=> {
let send_mesage =
'{"type":"request","connect_id": "' +
this.connect_id +
'","subtask_id":"' +
this.subtaskid +
'"}';
this.showws.send(send_mesage);
console.log("showws事件推送服务连接成功");
};
//监听断开
this.showws.onclose = function() {
if(quitws) return
window.clearInterval(this.keepAlive);
this.connectwebsocket(1);
};
},
beforeDestroy() {
this.showws.close();
this.quitws = true
try {
window.clearTimeout(this.keepAlive);
} catch (error) {}
}
};
</script>
<style scoped="scoped" lang="scss">
.headers{
line-height: 60px;
}
.title{
font-size:24px;
font-family:MicrosoftYaHeiUI;
color:rgba(255,255,255,1);
-webkit-background-clip:text;
}
.videoCon{
<<<<<<< HEAD
background: #FFFFFF;
width:100%;
height:70vh;
}
.imgCon{
height: 70vh;
background: #FFFFFF;
}
.imgDiv{
padding:0 10px 0 10px;
height:40vh;
}
.imgDiv>div{
height: 100%;
background: #d8d8d8;
}
.lDiv{
float: left;
=======
flex:1212;
height:682px;
background: red;
margin-right: 12px;
}
.imgCon{
background: #FFFFFF;
padding: 12px;
flex:644;
}
.imgDiv{
width:100%;
height:360px;
background:rgba(216,216,216,1);
}
.lDiv{
margin-right: 12px;
flex: 1;
display: flex;
>>>>>>> c156293e5665c9ed403aab57b2df7ed02e5cce09
}
.lDiv:nth-last-of-type(2){
margin: 0;
}
.rightDiv{
<<<<<<< HEAD
width:10.5vw;
height:20vh;
=======
flex:226;
>>>>>>> c156293e5665c9ed403aab57b2df7ed02e5cce09
border:1px solid rgba(229,229,229,1);
border-left: none;
color: #555555;
font-size: 12px;
float: left;
}
.rightDiv p{
margin: 10px 0;
margin-left: 10px;
}
.textDiv{
<<<<<<< HEAD
height:29vh;
=======
height:286px;
>>>>>>> c156293e5665c9ed403aab57b2df7ed02e5cce09
border:1px solid rgba(229,229,229,1);
color: #555555;
font-size:22px;
}
.textDiv p{
margin: 14px 0;
margin-left: 37px;
}
.bottomDiv{
padding: 7px;
background: #FFFFFF;
display: flex;
flex-flow: row nowrap;
}
.leftImg{
<<<<<<< HEAD
width: 21vw;
height: 20.2vh;
=======
flex: 390;
height: 186px;
>>>>>>> c156293e5665c9ed403aab57b2df7ed02e5cce09
background: #d8d8d8;
overflow: hidden;
float: left;
}
<<<<<<< HEAD
.leftImg>div{
height: 100%;
width: 100%;
}
.photos{
width: 100%;
height: 100%;
=======
.topDiv{
margin-bottom: 8px;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
.mainDiv{
padding: 8px;
}
@media screen and (max-width: 1366px) {
.topDiv{
margin-bottom: 5px;
}
.mainDiv{
padding: 5px 40px;
}
.videoCon{
flex:1212;
height:446.78px;
margin-right: 12px;
}
.imgDiv{
height: 237.46px;
}
.textDiv{
height: 171px;
font-size: 16px;
padding-top: 4px;
padding-bottom: 9px;
}
.textDiv p{
margin: 7px 0;
margin-left: 37px;
}
.leftImg{
height: 143px;
}
.rightDiv p {
margin: -1px 0;
margin-left: 7px;
}
.rightDiv{
padding-top: 0px;
}
}
@media (min-height:1080px){
.headers{
line-height: 120px!important;
height: 120px!important;
}
.title{
font-size:40px;
font-family:MicrosoftYaHeiUI;
color:rgba(255,255,255,1);
-webkit-background-clip:text;
}
.mainDiv{
padding-top: 20px;
}
.topDiv{
margin-bottom: 16px;
}
>>>>>>> c156293e5665c9ed403aab57b2df7ed02e5cce09
}
</style>