Browse Source

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

xiayu3 4 years ago
parent
commit
f147146dc8

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


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

@ -83,6 +83,7 @@ s<template>
83 83
            <div>抓拍图片</div>
84 84
            <div>
85 85
              <img :src="rowdata.pictureInfo.fileUrl" alt="" srcset="" style="width:100%;height:100%">
86

86 87
            </div>
87 88
          </div>
88 89
          <div class="detail_item2">
@ -90,12 +91,19 @@ s<template>
90 91
            <div>
91 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 102
                <div class="bottomimg">抓拍图片</div>
95 103
              </div>
96 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 107
              </div>
100 108
              <div>
101 109
                <img :src="rowdata.alarmInfo.headerImage" alt="" srcset="" style="width:100%;height:160px; border-radius: 5px;">
@ -167,7 +175,17 @@ export default {
167 175
      ],
168 176
      // 当前页
169 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,7 +193,6 @@ export default {
175 193
  mounted () {
176 194
    // this.gettype()
177 195
    this.getcompanyTypesList()
178
    // this.search()
179 196
  },
180 197
  methods: {
181 198
    // 表格中的选择数据
@ -201,12 +218,43 @@ export default {
201 218
      var res = await accessapi.getOneInAndOutRecord({ params: { aiIdenLogId: scope.row.aiIdenLogId } })
202 219

203 220
      if (res.data.success) {
204
        this.detail_modal = true
205 221
        // this.rowdata = res.data.data
206 222
        this.rowdata.pictureInfo = res.data.data.pictureInfo
223
        console.log('数据', this.rowdata.pictureInfo)
207 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 258
      } else {
211 259
        this.$Message.danger('获取数据失败')
212 260
      }
@ -311,7 +359,41 @@ export default {
311 359
      } else {
312 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 399
</script>
@ -370,6 +452,7 @@ export default {
370 452

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

@ -398,6 +481,21 @@ export default {
398 481
      > div:nth-child(1) {
399 482
        width: 120px;
400 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 500
      > div:nth-child(2) {
403 501
        width: 117.76px;

+ 138 - 101
security-protection-platform/src/modules/dashboard/index.vue

@ -1,5 +1,5 @@
1 1
<template>
2
  <div class="index">
2
  <div class="index" style="overflow:hidden">
3 3
    <div :style="`background-image: url(${imgBg})`" class="top" >
4 4
      <img src="@/assets/images/brand.png" class="top-logo">
5 5
    </div>
@ -40,27 +40,30 @@
40 40
          <span class="title-span">重点区域监控</span>
41 41
        </div>
42 42
        <!--        <video-player ref="videoPlayer" :options="videoOptions" :playsinline="true" class="vjs-custom-skin videoPlayer"></video-player>-->
43
        <videoPlayer
43
        <video-player v-if="videoOptions !== {}"
44 44
          ref="videoPlayer"
45 45
          :options="videoOptions"
46 46
          :playsinline="true"
47 47
          class="vjs-custom-skin videoPlayer"
48
        />
48
        ></video-player>
49 49
        <div class="videoPlayers">
50
          <div v-for="(item,index) in videoOptionsList" class="videoPlayer-sm" @click="videoSwitchover(item)">
50
          <div v-for="(item,index) in videoOptionsList" class="videoPlayer-sm" @click="videoSwitchover(item,index)">
51 51
            <!--            <video-player ref="videoPlayer"-->
52 52
            <!--                          :options="item.options"-->
53 53
            <!--                          :playsinline="true"-->
54 54
            <!--                          :style="`padding: 0 2.5% 2.5% 2%;border-radius: 5px;border: ${1-index}px solid #009bf3;`"-->
55 55
            <!--                          class="vjs-custom-skin videoPlayer">-->
56 56
            <!--            </video-player>-->
57
            <videoPlayer
57
            <video-player
58 58
              ref="videoPlayer"
59
              :options="videoOptions"
60
              :playsinline="true"
61
              :style="`padding: 0 2.5% 2.5% 2%;border-radius: 5px;border: ${1-index}px solid #009bf3;`"
59
              :playsinline="false"
60
              :events="events"
61
              :options="item.options"
62
              :style="`padding: 0 2.5% 2.5% 2%;border-radius: 5px;`"
63
              :class="{ 'checkedIndex': index == checkedIndex }"
62 64
              class="vjs-custom-skin videoPlayer"
63
            />
65
              @dblclick="handlefullscreenchange"
66
            ></video-player>
64 67
            <div style="color: white;text-align: center;">{{ item.name }}</div>
65 68
          </div>
66 69
        </div>
@ -100,9 +103,13 @@ import dasapi from '@/api/dashboard'
100 103
import sysapi from '@/api/system'
101 104
import 'video.js/dist/video-js.css'
102 105
import 'vue-video-player/src/custom-theme.css'
103
// import { videoPlayer } from 'vue-video-player'
104 106
import 'videojs-flash'
105
import VideoPlayer from '@/components/VideoPlayer'
107
import RtmpVideo from '../videoSurveillance/components/rtmpVideoPlay'
108
import videojs from 'video.js'
109
window.videojs = videojs
110
111
require('video.js/dist/lang/zh-CN.js')
112
require('video.js/dist/video-js.min.css')
106 113
107 114
export default {
108 115
  filters: {
@ -137,40 +144,14 @@ export default {
137 144
    }
138 145
  },
139 146
  components: {
140
    VideoPlayer
147
    RtmpVideo
141 148
  },
142 149
  data() {
143 150
    return {
151
      checkedIndex: 0,
152
      events: ['fullscreenchange'],
144 153
      nowDate: new Date(),
145
      videoOptions: {
146
        autoplay: true, // 如果true,浏览器准备好时开始回放。
147
        muted: true, // 默认情况下将会消除任何音频。
148
        loop: false, // 导致视频一结束就重新开始。
149
        preload: 'auto', // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
150
        language: 'zh-CN',
151
        aspectRatio: '16:10', // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
152
        // fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
153
        // 是否流体自适应容器宽高
154
        fluid: true,
155
        // // 设置视频播放器的显示宽度(以像素为单位)
156
        // width: '100px',
157
        // // 设置视频播放器的显示高度(以像素为单位)
158
        // height: '400px',
159
        sources: [{
160
          withCredentials: false,
161
          type: 'application/x-mpegURL', // 这里的种类支持很多种:基本视频格式、直播、流媒体等,具体可以参看git网址项目
162
          src: 'http://10.19.90.34:1080/live/01.m3u8' // url地址
163
        }],
164
        flash: { hls: { withCredentials: false } },
165
        html5: { hls: { withCredentials: false } },
166
        notSupportedMessage: '此视频暂无法播放,请稍后再试', // 允许覆盖Video.js无法播放媒体源时显示的默认信息。
167
        controlBar: {
168
          timeDivider: false,
169
          durationDisplay: false,
170
          remainingTimeDisplay: false,
171
          fullscreenToggle: false // 全屏按钮
172
        }
173
      },
154
      videoOptions: {},
174 155
      videoOptionsList: [],
175 156
      imgBg: imgBg,
176 157
      titleImgBg: titleImgBg,
@ -187,6 +168,9 @@ export default {
187 168
    }
188 169
  },
189 170
  computed: {
171
    player() {
172
      return this.$refs.videoPlayer1.player
173
    }
190 174
  },
191 175
  mounted () {
192 176
    this.initVideo()
@ -202,57 +186,107 @@ export default {
202 186
    }, 10000)
203 187
  },
204 188
  methods: {
189
    async createMyButton () {
190
      this.$nextTick(() => {
191
        const bars = document.querySelectorAll('.vjs-control-bar')
192
        let time = document.getElementsByClassName('vjs-current-time vjs-time-control vjs-control')
193
        let start = document.getElementsByClassName('vjs-play-control vjs-control vjs-button')
194
        let volume = document.getElementsByClassName('vjs-volume-panel vjs-control vjs-volume-panel-horizontal')
195
        let text = document.getElementsByClassName('vjs-live-control vjs-control')
196
        bars.forEach((item, index) => {
197
          time.forEach(item => {
198
            item.remove()
199
          })
200
          start.forEach(item => {
201
            item.remove()
202
          })
203
          volume.forEach(item => {
204
            item.remove()
205
          })
206
          text.forEach(item => {
207
            item.remove()
208
          })
209
        })
210
      })
211
    },
212
    handlefullscreenchange(val) {
213
      // 因为我是又封装了一个组件,打印val会有相应所需的属性,全屏状态为:isFullscreen_
214
      val.isFullscreen_ = !val.isFullscreen_
215
      // this.$emit('fullscreenchange', val)
216
    },
205 217
    initVideo() {
206 218
      sysapi.getTerminalRel(2).then(res => {
207
        // this.videoOptions = {
208
        //   live: true,
209
        //   autoplay: true,
210
        //   fluid: false,
211
        //   height: document.documentElement.clientHeight * 0.60,
212
        //   notSupportedMessage: '暂时无法播放',
213
        //   controlBar: {
214
        //     timeDivider: false,
215
        //     durationDisplay: false,
216
        //     remainingTimeDisplay: false,
217
        //     fullscreenToggle: true // 全屏按钮
218
        //   },
219
        //   techOrder: ['flash'],
220
        //   flash: {
221
        //     hls: { withCredentials: false },
222
        //     swf: 'static/video-js.swf' // 引入静态文件swf
223
        //   },
224
        //   sources: [{ // 流配置,数组形式,会根据兼容顺序自动切换
225
        //     type: 'rtmp/mp4',
226
        //     src: res.data.data[0].videoUrl
227
        //   }]
228
        // }
219
        this.videoOptions = {
220
          autoplay: true, // 如果true,浏览器准备好时开始回放。
221
          muted: true, // 默认情况下将会消除任何音频。
222
          loop: false, // 导致视频一结束就重新开始。
223
          preload: 'auto', // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
224
          language: 'zh-CN',
225
          aspectRatio: '16:10', // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
226
          // fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
227
          // 是否流体自适应容器宽高
228
          fluid: true,
229
          // // 设置视频播放器的显示宽度(以像素为单位)
230
          // width: '100px',
231
          // // 设置视频播放器的显示高度(以像素为单位)
232
          // height: '300px',
233
          sources: [{
234
            withCredentials: false,
235
            type: 'application/x-mpegURL', // 这里的种类支持很多种:基本视频格式、直播、流媒体等,具体可以参看git网址项目
236
            src: res.data.data[0].videoUrl // url地址
237
          }],
238
          flash: { hls: { withCredentials: false } },
239
          html5: { hls: { withCredentials: false } },
240
          notSupportedMessage: '此视频暂无法播放,请稍后再试', // 允许覆盖Video.js无法播放媒体源时显示的默认信息。
241
          controlBar: {
242
            timeDivider: false,
243
            durationDisplay: false,
244
            remainingTimeDisplay: false,
245
            fullscreenToggle: true, // 全屏按钮,
246
            pictureInPictureToggle: false
247
          }
248
        }
229 249
        this.videoOptionsList = []
230 250
        res.data.data.forEach(e => {
231 251
          this.videoOptionsList.push({
232 252
            options: {
233
              live: true,
234
              autoplay: true,
235
              fluid: false,
236
              height: document.documentElement.clientHeight * 0.15,
237
              notSupportedMessage: '暂时无法播放',
238
              controls: false,
239
              techOrder: ['flash'],
240
              flash: {
241
                hls: { withCredentials: false },
242
                swf: 'static/video-js.swf' // 引入静态文件swf
243
              },
244
              sources: [{ // 流配置,数组形式,会根据兼容顺序自动切换
245
                type: 'rtmp/mp4',
246
                src: e.videoUrl
247
              }]
253
              autoplay: true, // 如果true,浏览器准备好时开始回放。
254
              muted: true, // 默认情况下将会消除任何音频。
255
              loop: false, // 导致视频一结束就重新开始。
256
              preload: 'auto', // 建议浏览器在<video>加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
257
              language: 'zh-CN',
258
              aspectRatio: '16:10', // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
259
              // fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
260
              // 是否流体自适应容器宽高
261
              fluid: true,
262
              // // 设置视频播放器的显示宽度(以像素为单位)
263
              // width: '100px',
264
              // // 设置视频播放器的显示高度(以像素为单位)
265
              // height: '400px',
266
              sources: [{
267
                withCredentials: false,
268
                type: 'application/x-mpegURL', // 这里的种类支持很多种:基本视频格式、直播、流媒体等,具体可以参看git网址项目
269
                src: e.videoUrl // url地址
270
              }],
271
              flash: { hls: { withCredentials: false } },
272
              html5: { hls: { withCredentials: false } },
273
              notSupportedMessage: '此视频暂无法播放,请稍后再试', // 允许覆盖Video.js无法播放媒体源时显示的默认信息。
274
              controlBar: {
275
                timeDivider: false,
276
                durationDisplay: false,
277
                remainingTimeDisplay: false,
278
                fullscreenToggle: false // 全屏按钮
279
              }
248 280
            },
249 281
            name: e.resourceToolName
250 282
          })
283
          this.createMyButton()
251 284
        })
252 285
      })
253 286
    },
254
    videoSwitchover(itme) {
287
    videoSwitchover(itme,index) {
255 288
      this.videoOptions.sources = itme.options.sources
289
      this.checkedIndex = index
256 290
    },
257 291
    gotoSystem() {
258 292
      this.$router.push({name: 'videoSurveillance'})
@ -297,38 +331,38 @@ export default {
297 331
    initRecognition() {
298 332
      dasapi.queryHomeLastInAndOutRecord({monitorSceneId: 3}).then(res => {
299 333
        var data = res.data.data
300
        if (data.length > 4){
301
          data = data.slice(0,4)
334
        if (data.length > 4) {
335
          data = data.slice(0, 4)
302 336
        }
303 337
        data.forEach(e => {
304 338
          e.simi = e.simi.split('.')[0] + '%'
305 339
          e.newImg = e.idenPictureUrl
306
          var loadTimer;
307
          var imgObject = new Image();
308
          imgObject.setAttribute('crossOrigin', 'anonymous');
309
          imgObject.src = e.idenPictureUrl;
310
          imgObject.onLoad = onImgLoaded();
340
          var loadTimer
341
          var imgObject = new Image()
342
          imgObject.setAttribute('crossOrigin', 'anonymous')
343
          imgObject.src = e.idenPictureUrl
344
          imgObject.onLoad = onImgLoaded()
311 345
          function onImgLoaded() {
312
            if (loadTimer != null) clearTimeout(loadTimer);
346
            if (loadTimer != null) clearTimeout(loadTimer)
313 347
            if (!imgObject.complete) {
314 348
              loadTimer = setTimeout(function() {
315
                onImgLoaded();
316
              }, 3);
349
                onImgLoaded()
350
              }, 3)
317 351
            } else {
318
              e.newImg = 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]);
352
              e.newImg = 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])
319 353
            }
320 354
          }
321
          function getImagePortion(imgObj, newWidth, newHeight, startX, startY){
322
            var tnCanvas = document.createElement('canvas');
323
            var tnCanvasContext = tnCanvas.getContext('2d');
324
            tnCanvas.width = newWidth; tnCanvas.height = newHeight;
325
            var bufferCanvas = document.createElement('canvas');
326
            var bufferContext = bufferCanvas.getContext('2d');
327
            bufferCanvas.width = imgObj.width;
328
            bufferCanvas.height = imgObj.height;
329
            bufferContext.drawImage(imgObj, 0, 0);
330
            tnCanvasContext.drawImage(bufferCanvas, startX,startY,newWidth, newHeight,0,0,newWidth,newHeight);
331
            return tnCanvas.toDataURL();
355
          function getImagePortion(imgObj, newWidth, newHeight, startX, startY) {
356
            var tnCanvas = document.createElement('canvas')
357
            var tnCanvasContext = tnCanvas.getContext('2d')
358
            tnCanvas.width = newWidth; tnCanvas.height = newHeight
359
            var bufferCanvas = document.createElement('canvas')
360
            var bufferContext = bufferCanvas.getContext('2d')
361
            bufferCanvas.width = imgObj.width
362
            bufferCanvas.height = imgObj.height
363
            bufferContext.drawImage(imgObj, 0, 0)
364
            tnCanvasContext.drawImage(bufferCanvas, startX, startY, newWidth, newHeight, 0, 0, newWidth, newHeight)
365
            return tnCanvas.toDataURL()
332 366
          }
333 367
        })
334 368
        this.distinguishData = data
@ -724,5 +758,8 @@ export default {
724 758
  .vjs-progress-control{
725 759
    visibility:hidden
726 760
  }
761
  .checkedIndex{
762
    border: 1px solid #009bf3;
763
  }
727 764
}
728 765
</style>

+ 22 - 22
security-protection-platform/src/modules/videoSurveillance/index.vue

@ -15,12 +15,12 @@
15 15
    <div class="page-bottom grid-demo">
16 16
      <t-col v-for="(item,index) in videoList" :span="viewLayoutSpan" :key="index" :value="item.resourceToolId" style="margin-top:24px">
17 17
        <video-player
18
            :ref="'video'+index"
19
            :options="videoOptions[index]"
20
            :playsinline="false"
21
            :events="events"
22
            class="vjs-custom-skin videoPlayer"
23
            @dblclick="handlefullscreenchange"
18
          :ref="'video'+index"
19
          :options="videoOptions[index]"
20
          :playsinline="false"
21
          :events="events"
22
          class="vjs-custom-skin videoPlayer"
23
          @dblclick="handlefullscreenchange"
24 24
        ></video-player>
25 25
      </t-col>
26 26
      <!-- <rtmp-video :list="getVideoPlayList(item)" @goDistinguishRecord="goDistinguishRecord(item.resourceToolId)" @videoReplay="handleReview"></rtmp-video> -->
@ -95,19 +95,19 @@ export default {
95 95
        let start = document.getElementsByClassName('vjs-play-control vjs-control vjs-button')
96 96
        let volume = document.getElementsByClassName('vjs-volume-panel vjs-control vjs-volume-panel-horizontal')
97 97
        let text = document.getElementsByClassName('vjs-live-control vjs-control')
98
        time.forEach(item => {
99
          item.remove()
100
        })
101
        start.forEach(item => {
102
          item.remove()
103
        })
104
        volume.forEach(item => {
105
          item.remove()
106
        })
107
        text.forEach(item => {
108
          item.remove()
109
        })
98 110
        bars.forEach((item, index) => {
99
          time.forEach(item => {
100
            item.remove()
101
          })
102
          start.forEach(item => {
103
            item.remove()
104
          })
105
          volume.forEach(item => {
106
            item.remove()
107
          })
108
          text.forEach(item => {
109
            item.remove()
110
          })
111 111
          let txt = document.createElement('span')
112 112
          txt.innerHTML = '集控室(人脸识别)'
113 113
          txt.style.marginLeft = '12px'
@ -116,10 +116,9 @@ export default {
116 116
          btn.style.cursor = 'pointer'
117 117
          btn.style.marginLeft = 'auto'
118 118
          btn.className = 'aidicon aidicon-image-outline'
119
          btn.setAttribute('resourceToolId', item.value)
119 120
          btn.setAttribute('title', '识别记录')
120
          btn.addEventListener('click', () => {
121
            this.goDistinguishRecord()
122
          })
121
          btn.addEventListener('click', this.goDistinguishRecord)
123 122
          let btn1 = document.createElement('button')
124 123
          btn1.style.color = 'white'
125 124
          btn1.style.cursor = 'pointer'
@ -248,7 +247,8 @@ export default {
248 247
      })
249 248
    },
250 249
    // 进入识别记录界面
251
    goDistinguishRecord (id) {
250
    goDistinguishRecord (e) {
251
      var id = e.target.getAttribute('resourceToolId')
252 252
      this.$router.push({ path: '/videoSurveillance/distinguishRecord', query: { videoId: id } })
253 253
    },
254 254
    // 风场大门分页

+ 32 - 11
security-protection-service/src/main/java/com/ai/bss/security/protection/controller/EmployeeManagementController.java

@ -44,8 +44,8 @@ public class EmployeeManagementController {
44 44
	 */
45 45
	@ResponseBody
46 46
	@RequestMapping("/queryEmployeeList")
47
	public CommonResponse<PageBean<Map<String, Object>>> queryEmployeeList(@ModelAttribute AttendanceReport attendanceReport)
48
			throws Exception {
47
	public CommonResponse<PageBean<Map<String, Object>>> queryEmployeeList(
48
			@ModelAttribute AttendanceReport attendanceReport) throws Exception {
49 49
		// 当前页数
50 50
		int pageNumber = attendanceReport.getPageNumber() < 1 ? 1 : attendanceReport.getPageNumber();
51 51
		// 每页条数
@ -84,8 +84,17 @@ public class EmployeeManagementController {
84 84
	@ResponseBody
85 85
	@RequestMapping("/createEmployee")
86 86
	public CommonResponse<Void> createEmployee(@RequestBody EmployeeDto employeeDto) throws Exception {
87
		if (employeeDto == null || StringUtils.isEmpty(employeeDto.getName())||StringUtils.isEmpty(employeeDto.getOrganizeCode())) {
88
			return CommonResponse.fail("500", "新增失败");
87
		if (employeeDto == null) {
88
			return CommonResponse.fail("500", "员工信息新增失败,参数为空");
89
		}
90
		if (StringUtils.isEmpty(employeeDto.getName())) {
91
			return CommonResponse.fail("500", "员工信息新增失败,项目为空");
92
		}
93
		if (StringUtils.isEmpty(employeeDto.getCode())) {
94
			return CommonResponse.fail("500", "员工信息新增失败,编号为空");
95
		}
96
		if (StringUtils.isEmpty(employeeDto.getOrganizeCode())) {
97
			return CommonResponse.fail("500", "员工信息新增失败,部门为空");
89 98
		}
90 99
91 100
		return employeeManagementService.createEmployee(employeeDto);
@ -100,8 +109,20 @@ public class EmployeeManagementController {
100 109
	@ResponseBody
101 110
	@RequestMapping("/modifyEmployee")
102 111
	public CommonResponse<Void> modifyEmployee(@RequestBody EmployeeDto employeeDto) throws Exception {
103
		if (employeeDto == null || employeeDto.getId() == null || StringUtils.isEmpty(employeeDto.getName())) {
104
			return CommonResponse.fail("500", "修改失败");
112
		if (employeeDto == null) {
113
			return CommonResponse.fail("500", "员工信息修改失败,参数为空");
114
		}
115
		if (employeeDto.getId() == null) {
116
			return CommonResponse.fail("500", "员工信息修改失败,主键为空");
117
		}
118
		if (StringUtils.isEmpty(employeeDto.getName())) {
119
			return CommonResponse.fail("500", "员工信息修改失败,项目为空");
120
		}
121
		if (StringUtils.isEmpty(employeeDto.getCode())) {
122
			return CommonResponse.fail("500", "员工信息修改失败,编号为空");
123
		}
124
		if (StringUtils.isEmpty(employeeDto.getOrganizeCode())) {
125
			return CommonResponse.fail("500", "员工信息修改失败,部门为空");
105 126
		}
106 127
107 128
		return employeeManagementService.modifyEmployee(employeeDto);
@ -132,9 +153,8 @@ public class EmployeeManagementController {
132 153
	 */
133 154
	@ResponseBody
134 155
	@RequestMapping("/uploadEmployeePicture")
135
	public CommonResponse<Map<String, String>> uploadEmployeePicture(
136
			@RequestParam(value = "file") MultipartFile meFile, @RequestParam(required = false) String pictureUrl)
137
			throws Exception {
156
	public CommonResponse<Map<String, String>> uploadEmployeePicture(@RequestParam(value = "file") MultipartFile meFile,
157
			@RequestParam(required = false) String pictureUrl) throws Exception {
138 158
		if (meFile == null || StringUtils.isEmpty(meFile.getOriginalFilename())) {
139 159
			return CommonResponse.fail("500", "上传失败");
140 160
		}
@ -153,11 +173,12 @@ public class EmployeeManagementController {
153 173
	@ResponseBody
154 174
	@RequestMapping("/auditEmployeePicture")
155 175
	public CommonResponse<Void> auditEmployeePicture(@RequestBody EmployeeDto employeeDto) throws Exception {
156
		if (employeeDto.getId()==null||employeeDto.getId()<0||StringUtils.isEmpty(employeeDto.getField2())) {
176
		if (employeeDto.getId() == null || employeeDto.getId() < 0 || StringUtils.isEmpty(employeeDto.getField2())) {
157 177
			return CommonResponse.fail("500", "审核失败");
158 178
		}
159 179
160
		return employeeManagementService.auditEmployeePicture(employeeDto.getId(),employeeDto.getField2(),employeeDto.getField3());
180
		return employeeManagementService.auditEmployeePicture(employeeDto.getId(), employeeDto.getField2(),
181
				employeeDto.getField3());
161 182
	}
162 183
163 184
	/**

+ 49 - 1
security-protection-service/src/main/java/com/ai/bss/security/protection/service/impl/EmployeeManagementServiceImpl.java

@ -106,14 +106,20 @@ public class EmployeeManagementServiceImpl implements EmployeeManagementService
106 106
		resultMap.put("organizationCode", response.getData().getOrganizeCode());
107 107
		resultMap.put("organizationName", response.getData().getOrgName());
108 108
		resultMap.put("age", response.getData().getAge());
109
		
109 110
		resultMap.put("mainWirelessCall", response.getData().getMainWirelessCall());
110 111
		resultMap.put("field1", response.getData().getField1()); // 头像标识
111 112
		resultMap.put("field2", response.getData().getField2()); // 审核结果
112 113
		resultMap.put("field3", response.getData().getField3()); // 审核意见
113 114
		resultMap.put("field4", response.getData().getField4()); // 公司
114 115
115
		resultMap.put("pictureUrl",uploadFileService.getFileUrl(response.getData().getField1(), minioConfig.getBucketHeaderImage()));
116
		if (response.getData().getBirthday()!=null) {
117
			resultMap.put("birthday", String.valueOf(response.getData().getBirthday().getTime()));
118
		}
116 119
		
120
		resultMap.put("pictureUrl",
121
				uploadFileService.getFileUrl(response.getData().getField1(), minioConfig.getBucketHeaderImage()));
122
117 123
		String employeePosition = response.getData().getMainJobPosition();
118 124
		resultMap.put("employeePosition", employeePosition);
119 125
@ -128,8 +134,46 @@ public class EmployeeManagementServiceImpl implements EmployeeManagementService
128 134
		return CommonResponse.ok(resultMap);
129 135
	}
130 136
137
	/**
138
	 * 是否存在用户编码
139
	 * @param code
140
	 * @param id
141
	 * @return 
142
	 * @return true:存在,false:不存在
143
	 */
144
	private boolean isExistEmployeeCode(String code, String id) {
145
		if (StringUtils.isBlank(code)) {
146
			return false;
147
		}
148
149
		UserDto userDto = new UserDto();
150
		userDto.setCode(code);
151
		CommonRequest<UserDto> request = new CommonRequest<UserDto>(userDto);
152
		CommonResponse<List<Map<String, Object>>> response = userDtoQuery.queryWorkEmployeeByUserCode(request);
153
154
		boolean result = false;
155
		if (!CollectionUtils.isEmpty(response.getData())) {
156
			if (StringUtils.isNotBlank(id)) {
157
				for (Map<String, Object> map : response.getData()) {
158
					if (code.equals(String.valueOf(map.get("code"))) && !id.equals(String.valueOf(map.get("id")))) {
159
						result = true;
160
						break;
161
					}
162
				}
163
			} else {
164
				result = true;
165
			}
166
		}
167
168
		return result;
169
	}
170
131 171
	@Override
132 172
	public CommonResponse<Void> createEmployee(EmployeeDto employeeDto) throws Exception {
173
		if (isExistEmployeeCode(employeeDto.getCode(), null)) {
174
			return CommonResponse.fail("501", "编号已存在");
175
		}
176
133 177
		employeeDto.setField2(EbcConstant.AUDIT_STATUS_INI);
134 178
		CommonRequest<EmployeeDto> request = new CommonRequest<EmployeeDto>(employeeDto);
135 179
		return employeeService.createWorkEmployee(request);
@ -137,6 +181,10 @@ public class EmployeeManagementServiceImpl implements EmployeeManagementService
137 181
138 182
	@Override
139 183
	public CommonResponse<Void> modifyEmployee(EmployeeDto employeeDto) {
184
		if (isExistEmployeeCode(employeeDto.getCode(), String.valueOf(employeeDto.getId()))) {
185
			return CommonResponse.fail("501", "编号已存在");
186
		}
187
140 188
		employeeDto.setField2(EbcConstant.AUDIT_STATUS_INI);
141 189
		CommonRequest<EmployeeDto> request = CommonRequest.<EmployeeDto>builder().data(employeeDto).build();
142 190
		return employeeService.modifyEmployee(request);