liuxiaolong
2019-05-06 3e0536f508aad49f743e7bfabca34e3980a1b6e2
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
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
<template>
  <div
    style="width:1200px; overflow-x:scroll;min-width:1200px; width:expression_r(document.body.clientWidth < 1200 ?'1200px':'auto'); max-width:1800px;"
  >
    <div class="overflow-auto row bg-white" style="margin:0px 0px">
      <div
        class="col-md-12 col-lg-3 mb-4"
        style="margin:0px 0px"
        v-for="(item,index) in list"
        :key="index"
      >
        <div v-if="item.sdkType" style="float:left;width:39%;">
          <div style="text-align:center;width: 120px;height: 140px;">
            <div style="text-align:center;width: 120px;height: 120px;background:#f1f1f1;">
              <httpImg
                v-if="item.sdkType==='1'||item.sdkType==='人脸'"
                v-bind:src="item.picSmUrl"
                style="max-width: 100%;max-height: 100%;height: 120px;"
              ></httpImg>
              <httpImg
                v-if="item.sdkType!=='1'&&item.sdkType!=='人脸'"
                v-bind:src="item.picSmUrl"
                style="width: 120px;height: 68px;float:left;margin:26px 0px 26px 0px"
              ></httpImg>
            </div>
            <div v-if="item.picSmUrl!=null" style="float:left;margin:5px 0px">
              <button
                @click="detail(item)"
                type="button"
                class="btn btn-outline-primary icon-btn borderless btn-sm"
                title="查看详情"
              >
                <span style="font-size:17px" class="far fa-list-alt"></span>
              </button>
              <button
                v-if="item.sdkType==='1'||item.sdkType==='人脸'"
                @click="searchPerson(item)"
                type="button"
                class="btn btn-outline-primary icon-btn borderless btn-sm"
                title="查找此人"
              >
                <span style="font-size:17px" class="fas fa-user-circle"></span>
              </button>
              <button
                v-if="item.sdkType==='1'||item.sdkType==='人脸'"
                @click="orbit(item)"
                type="button"
                class="btn btn-outline-primary icon-btn borderless btn-sm"
                title="查看轨迹"
              >
                <span style="font-size:17px" class="ion ion-logo-polymer"></span>
              </button>
              <button
                v-if="item.sdkType==='1'||item.sdkType==='人脸'"
                @click="control(item)"
                type="button"
                class="btn btn-outline-primary icon-btn borderless btn-sm"
                title="加入布控"
              >
                <span style="font-size:17px" class="d-block fas fa-shield-alt pb5"></span>
              </button>
            </div>
          </div>
        </div>
        <!-- <div v-if="item.picSmUrl!=null"  style="float:left;margin:5px 0px">
          <button  @click="detail(item)"  type="button" class="btn btn-outline-primary icon-btn borderless btn-sm " title="查看详情"><span style="font-size:17px" class=" far fa-list-alt"></span></button>
          <button  v-if="item.sdkType==='1'||item.sdkType==='人脸'" @click="searchPerson(item)" type="button" class="btn btn-outline-primary icon-btn borderless btn-sm" title="查找此人"><span style="font-size:17px" class="fas fa-user-circle"></span></button>
          <button  v-if="item.sdkType==='1'||item.sdkType==='人脸'" @click="orbit(item)" type="button" class="btn btn-outline-primary icon-btn borderless btn-sm" title="查看轨迹"><span style="font-size:17px" class="ion ion-logo-polymer"></span></button>
          <button  v-if="item.sdkType==='1'||item.sdkType==='人脸'" @click="control(item)" type="button" class="btn btn-outline-primary icon-btn borderless btn-sm" title="加入布控"><span style="font-size:17px" class="d-block fas fa-shield-alt pb5"></span></button>
          </div>
        </div>-->
        <div
          v-if="item.sdkType"
          style="float:left;width:65%;margin:0px 0px 0px -20px;text-align:left;"
        >
          <ul v-if="item.picSmUrl!=null">
            <li class :title="item.picDate.substring(0,19)">&nbsp;{{item.picDate.substring(0,19)}}</li>
            <li class="omit" :title="item.picAddress">&nbsp;{{item.picAddress}}</li>
            <li class="omit">&nbsp;{{item.Gender}} {{item.Race}} {{item.Age}}</li>
            <li
              :title="item.BaseName"
              v-if="item.sdkType==='1'||item.sdkType==='人脸'"
              :class="item.personIsHub==='1'||item.personIsHub==='4'? 'red1 omit' : 'green1 omit' "
            >
              <b>&nbsp;{{item.BaseName}}</b>
            </li>
            <li
              :title="item.sdkType"
              v-if="item.sdkType!=='1'&&item.sdkType!=='人脸'"
              :class="item.personIsHub==='1'||item.personIsHub==='4'? 'red1 omit' : 'green1 omit' "
            >
              <b>&nbsp;{{item.sdkType}}</b>
            </li>
            <li class="omit" :title="item.miaoshu">&nbsp;{{item.miaoshu}}</li>
          </ul>
        </div>
        <hr style="margin:-20px -12px">
      </div>
    </div>
    <div class="pt20" style="width:100%">
      <b-pagination
        class="justify-content-center m-0"
        v-if="total"
        v-model="currentPage"
        @change="changePage"
        :total-rows="total"
        :per-page="length"
      />
    </div>
 
    <div>
      <!-- <siliderModel :BigPicParam="BigPic" :accompanyPersonParam="accompanyPerson" :parentData="childrenData" ref="siliderModelForCommon"></siliderModel>
      <sdkTypeModel ref="sdkTypeModelForCommon"></sdkTypeModel>-->
    </div>
  </div>
</template>
<script>
import {
  findEsData,
  addFromRetrieve,
  getBigPic,
  accompanyPerson,
  getVideoByCServer
} from '../../../../server/searchList/commomList.js'
import siliderModel from '../model/siliderModel'
import { mapActions } from 'vuex'
import sdkTypeModel from '../model/sdkTypeModel'
import siliderModelNew from '../model/siliderModelNew'
import siliderModelMV from '../model/siliderModelMV'
export default {
  components: {
    findEsData,
    siliderModel,
    mapActions,
    sdkTypeModel,
    addFromRetrieve,
    siliderModelNew,
    getBigPic,
    accompanyPerson,
    getVideoByCServer,
    siliderModelMV
  },
  props: {},
  data() {
    return {
      data: [],
      list: [],
      length: 40,
      currentPage: 1,
      total: 0,
      BigPic: {},
      accompanyPerson: {},
      childrenData: {},
      parameter: {
        ack_alarm: '',
        cluId: '',
        content: '',
        contents: [],
        dataBaseList: [],
        endDate: '2019-01-10 05:51:19',
        indeviceid: [],
        page: 1,
        recordType: '',
        sdkType: [],
        size: 40,
        startDate: '2019-01-04 05:51:19'
      }
    }
  },
  created() {},
  watch: {},
  methods: {
    ...mapActions(['openNewWindowtab']),
    async getAccompanyPerson(paramw) {
      this.data.splice(0, this.data.length)
      // let res = await accompanyPerson(this.params)
      let res = await accompanyPerson(paramw)
      if (res && res.success) {
        this.data = res.data.personList
        // this.data.push(this.data[0])
        // this.data.push(this.data[0])
        // this.data.push(this.data[0])
        // this.data.push(this.data[0])
        // this.data.push(this.data[0])
      }
      for (let i = 0; i < this.data.length; i++) {
        if (this.data[i].name) {
          this.data[i].miaoshu = this.data[i].name
          if (this.data[i].gender) {
            this.data[i].miaoshu =
              this.data[i].miaoshu + '/' + this.data[i].gender
          }
          if (this.data[i].cardId) {
            this.data[i].miaoshu =
              this.data[i].miaoshu + '/' + this.data[i].cardId
          }
          if (this.data[i].no) {
            this.data[i].miaoshu = this.data[i].miaoshu + '/' + this.data[i].no
          }
          if (this.data[i].phone) {
            this.data[i].miaoshu =
              this.data[i].miaoshu + '/' + this.data[i].phone
          }
          if (this.data[i].orgName) {
            this.data[i].miaoshu =
              this.data[i].miaoshu + '/' + this.data[i].orgName
          }
        }
      }
    },
    async getList(param) {
      if (param && param !== null) {
        this.parameter.indeviceid = param.indeviceid.indeviceid
        this.parameter.cluId =
          param.indeviceid.indeviceid.length > 0 ? '' : param.currentItem.type
        this.parameter.content = param.content
        this.parameter.dataBaseList = param.recordData.dataBaseList
        this.parameter.endDate = param.dateTime[1]
        this.parameter.sdkType = param.sdkData.sdkType
        this.parameter.startDate = param.dateTime[0]
        this.parameter.recordType = param.recordData.recordType
        this.parameter.page = 1
        this.currentPage = 1
        // // console.log(this.parameter, '修改后的参数')
      }
      let res = await findEsData(this.parameter)
      // console.log(res, '普通列表findEsData得到的数据')
      if (res && res.success) {
        this.total = parseInt(res.data.total)
        this.list = res.data.esList
        for (let i = 0; i < this.list.length; i++) {
          this.list[i].miaoshu = ''
          if (this.list[i].name) {
            this.list[i].miaoshu = this.list[i].name
 
            if (this.list[i].gender) {
              this.list[i].miaoshu =
                this.list[i].miaoshu + '/' + this.list[i].gender
            }
            if (this.list[i].cardId) {
              this.list[i].miaoshu =
                this.list[i].miaoshu + '/' + this.list[i].cardId
            }
            if (this.list[i].no) {
              this.list[i].miaoshu =
                this.list[i].miaoshu + '/' + this.list[i].no
            }
            if (this.list[i].phone) {
              this.list[i].miaoshu =
                this.list[i].miaoshu + '/' + this.list[i].phone
            }
            if (this.list[i].orgName) {
              this.list[i].miaoshu =
                this.list[i].miaoshu + '/' + this.list[i].orgName
            }
          }
        }
        this.bushang()
      }
    },
    changePage(e) {
      this.currentPage = parseInt(e)
      this.parameter.page = parseInt(e)
      this.getList()
    },
    // 查看详情
    async detail(item1) {
      const BigPicjson = {
        videoNum: item1.videoNum,
        picDate: item1.picDate,
        videoIp: item1.videoIp,
        indeviceid: item1.indeviceid,
        imgKey: item1.imgKey
      }
      let videoRes = await getVideoByCServer(BigPicjson)
      let videoUrl = ''
      if (videoRes && videoRes.success) {
        videoUrl = videoRes.data.filepath
      }
      console.log(videoUrl, 'videoUrl')
      if (item1.sdkType === '1') {
        const accompanyPersonjson = {
          videoReqNum: item1.videoReqNum,
          picDate: item1.picDate,
          personId: item1.personId,
          Id: item1.Id
        }
        this.getAccompanyPerson(accompanyPersonjson)
        let res = await getBigPic(BigPicjson)
        // if (this.data.length > 0) {
        //   for (let i = 0; i < 5; i++) {
        //     this.data.push(this.data[0])
        //   }
        // }
        this.$layer.iframe({
          content: {
            content: siliderModelMV,
            parent: this,
            data: {
              url1: res && res.success ? res.data.img_url : '',
              url2: videoUrl,
              parentDataStr: JSON.stringify({ ...item1 }),
              accompanyPersonArrayStr: JSON.stringify(this.data)
            }
          },
          area: ['850px', '620px'],
          title: '详情',
          maxmin: true,
          shade: false
        })
      } else {
        this.$layer.iframe({
          content: {
            content: siliderModelNew,
            parent: this,
            data: {
              url1: item1.picSmUrl,
              url2: videoUrl
            }
          },
          area: 'auto',
          title: '详情',
          maxmin: true,
          shade: false
        })
      }
      // const BigPicjson = {
      //   videoNum: item1.videoNum,
      //   picDate: item1.picDate,
      //   videoIp: item1.videoIp,
      //   indeviceid: item1.indeviceid,
      //   imgKey: item1.imgKey
      // }
      // this.BigPic = {...BigPicjson}
      // const accompanyPersonjson = {
      //   videoReqNum: item1.videoReqNum,
      //   picDate: item1.picDate,
      //   personId: item1.personId,
      //   Id: item1.Id
      // }
      // this.accompanyPerson = {...accompanyPersonjson}
      // this.childrenData = {...item1}
      // // console.log(BigPicjson, '来的参数')
      // if (item1.sdkType === '1' || item1.sdkType === '人脸') {
      //   this.$refs.siliderModelForCommon.showModel(BigPicjson)
      // } else {
      //   this.$refs.sdkTypeModelForCommon.showModel(BigPicjson, item1.picSmUrl)
      // }
    },
    searchPerson(obj) {
      this.openNewWindowtab({
        urlStr: window.document.location.href.substring(
          0,
          window.document.location.href.indexOf('#') + 2
        ),
        query:
          'tabType=table&tableType=mapList&urlPath=' +
          obj.picSmUrl +
          '&liker=' +
          localStorage.getItem('threshold')
      })
    },
    orbit(obj) {
      localStorage.removeItem('esList') // 清除esList
      localStorage.setItem('personId', obj.personId)
      let jsonstr = localStorage.getItem('sear')
      let json = JSON.parse(jsonstr)
      json.path = obj.picSmUrl
      localStorage.setItem('searParams', JSON.stringify(json))
      localStorage.setItem('personId', obj.personId)
      this.openNewWindowtab({
        urlStr: window.document.location.href.substring(
          0,
          window.document.location.href.indexOf('#') + 2
        ),
        query: 'tabType=map'
      })
    },
    async control(obj) {
      let json = {
        dbInfos: [
          {
            cluId: obj.cluster_id,
            devId: obj.indeviceid
          }
        ],
        imgUrl: obj.picSmUrl,
        featureBase64: obj.FaceFeature,
        idCard: obj.cardId ? obj.cardId : ''
      }
      let res = await addFromRetrieve(json)
      console.log(res, '已加入待布控表')
      if (res && res.success) {
        this.$toast({
          type: 'primary',
          message: '已加入待布控表',
          toastHorizontalPosition: 'right'
        })
      } else {
        this.$toast({
          type: 'error',
          message: '加入待布控表失败',
          toastHorizontalPosition: 'right'
        })
      }
    },
    bushang() {
      let s = 4 - (this.list.length % 4)
      s = s === 4 ? s - 4 : s
      for (let i = 0; i < s; i++) {
        let obj = {}
        this.list.push(obj)
      }
    }
  }
}
</script>
<style lang="scss">
.zuhe {
  float: left;
  width: 50%;
  border: 2px solid #76bef7;
  overflow: hidden;
}
.imgdiv {
  float: left;
  width: 50%;
}
.img43 {
  width: 120px;
  height: 120px;
}
.percentage-red {
  text-align: center;
  background: url('/static/img/search/red.png');
  height: 20px;
  float: left;
  width: 75px;
  color: white;
  margin: -20px 70px;
}
.percentage-green {
  text-align: center;
  background: url('/static/img/search/green.png');
  height: 20px;
  float: left;
  width: 75px;
  color: white;
  margin: -20px 70px;
}
.omit {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
ul {
  list-style-type: none;
  line-height: 1.5em;
}
.myion {
  width: 30px;
  height: 30px;
}
.green1 {
  color: green;
}
.red1 {
  color: red;
}
</style>