Quellcode durchsuchen

Merge branch 'master' of http://10.1.235.20:3000/asiainfo/ebc.git

konghl vor 4 Jahren
Ursprung
Commit
3025dbd4dd

BIN
security-protection-platform/src/assets/images/Identify_the_successful.png


+ 105 - 7
security-protection-platform/src/modules/access/index.vue

83
            <div>抓拍图片</div>
83
            <div>抓拍图片</div>
84
            <div>
84
            <div>
85
              <img :src="rowdata.pictureInfo.fileUrl" alt="" srcset="" style="width:100%;height:100%">
85
              <img :src="rowdata.pictureInfo.fileUrl" alt="" srcset="" style="width:100%;height:100%">
86

86
            </div>
87
            </div>
87
          </div>
88
          </div>
88
          <div class="detail_item2">
89
          <div class="detail_item2">
90
            <div>
91
            <div>
91
              <div>
92
              <div>
92
                <!-- 修改-->
93
                <!-- 修改-->
93
                <img src="" alt="" srcset="" style="width:120px;height:160px;border-radius: 5px; ">
94
                <img :src="newimage" alt="" srcset="" style="width:120px;height:160px;border-radius: 5px; ">
95

96
                <!-- <div class="scaleimg">
97
                  <div :style="{backgroundImage:style.bgimg,backgroundPosition:style.bgposition,
98
                                transform:style.scale,
99
                                width:style.width,
100
                                height:style.height}" class="imgcontant"></div>
101
                </div> -->
94
                <div class="bottomimg">抓拍图片</div>
102
                <div class="bottomimg">抓拍图片</div>
95
              </div>
103
              </div>
96
              <div>
104
              <div>
97
                <!-- 修改-->
105
                <!-- 修改-->
98
                <img src="http://img95.699pic.com/photo/50028/0321.jpg_wh300.jpg" alt="" srcset="">
106
                <img src="@/assets/images/Identify_the_successful.png" alt="" srcset="">
99
              </div>
107
              </div>
100
              <div>
108
              <div>
101
                <img :src="rowdata.alarmInfo.headerImage" alt="" srcset="" style="width:100%;height:160px; border-radius: 5px;">
109
                <img :src="rowdata.alarmInfo.headerImage" alt="" srcset="" style="width:100%;height:160px; border-radius: 5px;">
167
      ],
175
      ],
168
      // 当前页
176
      // 当前页
169
      page: 1,
177
      page: 1,
170
      limit: 10
178
      limit: 10,
179
      // style: {
180
      //   bgimg: '',
181
      //   bgposition: '',
182
      //   scale: '',
183
      //   width: '',
184
      //   height: ''
185

186
      // }
187
      // 截取后的图片
188
      newimage: ''
171

189

172
    }
190
    }
173
  },
191
  },
175
  mounted () {
193
  mounted () {
176
    // this.gettype()
194
    // this.gettype()
177
    this.getcompanyTypesList()
195
    this.getcompanyTypesList()
178
    // this.search()
179
  },
196
  },
180
  methods: {
197
  methods: {
181
    // 表格中的选择数据
198
    // 表格中的选择数据
201
      var res = await accessapi.getOneInAndOutRecord({ params: { aiIdenLogId: scope.row.aiIdenLogId } })
218
      var res = await accessapi.getOneInAndOutRecord({ params: { aiIdenLogId: scope.row.aiIdenLogId } })
202

219

203
      if (res.data.success) {
220
      if (res.data.success) {
204
        this.detail_modal = true
205
        // this.rowdata = res.data.data
221
        // this.rowdata = res.data.data
206
        this.rowdata.pictureInfo = res.data.data.pictureInfo
222
        this.rowdata.pictureInfo = res.data.data.pictureInfo
223
        console.log('数据', this.rowdata.pictureInfo)
207
        this.rowdata.alarmInfo = res.data.data.alarmInfo
224
        this.rowdata.alarmInfo = res.data.data.alarmInfo
208
        // console.log(res.data.data)
209
        // console.log('详情数据是', this.rowdata)
225
        console.log('数据', this.rowdata.alarmInfo)
226
        // this.rowdata.alarmInfo.newImg = this.rowdata.pictureInfo.fileUrl
227

228
        this.getImage()
229
        // var loadTimer
230
        // var imgObject = new Image()
231
        // imgObject.setAttribute('crossOrigin', 'anonymous')
232
        // imgObject.src = this.rowdata.pictureInfo.fileUrl
233
        // console.log(this)
234
        // imgObject.onload = this.onImgLoaded(loadTimer, imgObject, this.rowdata.alarmInfo)
235

236
        // console.log(this.rowdata.alarmInfo.newImg)
237

238
        // this.style.width = res.data.data.alarmInfo.face_box[2] - res.data.data.alarmInfo.face_box[0] + 'px'
239
        // // console.log('width是', this.style.width)
240
        // this.style.height = res.data.data.alarmInfo.face_box[3] - res.data.data.alarmInfo.face_box[1] + 'px'
241
        // // console.log('height是', this.style.height)
242
        // this.style.bgimg = 'url(' + res.data.data.pictureInfo.fileUrl + ')'
243
        // // console.log('bgimg是', this.style.bgimg)
244
        // this.style.bgposition = '' + -res.data.data.alarmInfo.face_box[0] + 'px ' + -res.data.data.alarmInfo.face_box[1] + 'px'
245
        // console.log('bgposition是', this.style.bgposition)
246
        // // transform: scale(0.33, 0.33);
247
        // var width = res.data.data.alarmInfo.face_box[2] - res.data.data.alarmInfo.face_box[0]
248
        // var height = res.data.data.alarmInfo.face_box[3] - res.data.data.alarmInfo.face_box[1]
249
        // var scalex = 120 / width
250
        // var scaley = 160 / height
251
        // // console.log(scalex)
252
        // this.style.scale = 'scale(' + scalex + ',' + scaley + ')'
253
        // // console.log('scale是', this.style.scale)
254
        // // console.log(res.data.data)
255
        // console.log('详情数据是', this.rowdata.alarmInfo)
256

257
        this.detail_modal = true
210
      } else {
258
      } else {
211
        this.$Message.danger('获取数据失败')
259
        this.$Message.danger('获取数据失败')
212
      }
260
      }
311
      } else {
359
      } else {
312
        return true
360
        return true
313
      }
361
      }
362
    },
363
    async getImage () {
364
      var loadTimer
365
      var imgObject = new Image()
366
      imgObject.setAttribute('crossOrigin', 'anonymous')
367
      imgObject.src = this.rowdata.pictureInfo.fileUrl
368
      var e = this.rowdata.alarmInfo
369
      var that = this
370
      imgObject.onload = onImgLoaded()
371
      // eslint-disable-next-line no-return-assign
372
      function onImgLoaded () {
373
        if (loadTimer != null) clearTimeout(loadTimer)
374
        if (!imgObject.complete) {
375
          loadTimer = setTimeout(() => {
376
            onImgLoaded()
377
          }, 3)
378
        } else {
379
          that.newimage = getImagePortion(imgObject, e.face_box[2] - e.face_box[0], e.face_box[3] - e.face_box[1], e.face_box[0], e.face_box[1])
380
        }
381
      }
382
      function getImagePortion (imgObj, newWidth, newHeight, startX, startY) {
383
        var tnCanvas = document.createElement('canvas')
384
        var tnCanvasContext = tnCanvas.getContext('2d')
385
        tnCanvas.width = newWidth; tnCanvas.height = newHeight
386
        var bufferCanvas = document.createElement('canvas')
387
        var bufferContext = bufferCanvas.getContext('2d')
388
        bufferCanvas.width = imgObj.width
389
        bufferCanvas.height = imgObj.height
390
        bufferContext.drawImage(imgObj, 0, 0)
391
        tnCanvasContext.drawImage(bufferCanvas, startX, startY, newWidth, newHeight, 0, 0, newWidth, newHeight)
392
        // console.log(tnCanvas.toDataURL())
393
        return tnCanvas.toDataURL()
394
      }
314
    }
395
    }
396

315
  }
397
  }
316
}
398
}
317
</script>
399
</script>
370

452

371
      border-radius: 5px;
453
      border-radius: 5px;
372
      overflow: hidden;
454
      overflow: hidden;
455
      position: relative;
373
    }
456
    }
374
  }
457
  }
375

458

398
      > div:nth-child(1) {
481
      > div:nth-child(1) {
399
        width: 120px;
482
        width: 120px;
400
        height: 100%;
483
        height: 100%;
484

485
        .scaleimg {
486
          width: 120px;
487
          height: 160px;
488

489
          position: relative;
490
          .imgcontant {
491
            border-radius: 10px;
492
            background-repeat: no-repeat;
493
            background-attachment: local;
494
            position: absolute;
495
            top: -160px;
496
            left: -120px;
497
          }
498
        }
401
      }
499
      }
402
      > div:nth-child(2) {
500
      > div:nth-child(2) {
403
        width: 117.76px;
501
        width: 117.76px;