Browse Source

[FE] 视频监控布局问题、切换场景没有切换布局修复 识别记录下面图片跑马灯

chenxr3 4 years ago
parent
commit
762a15dae8

+ 27 - 7
security-protection-platform/src/modules/videoSurveillance/distinguishRecord/index.vue

44
        </div>
44
        </div>
45
      </div>
45
      </div>
46
      <div class="img-viewer">
46
      <div class="img-viewer">
47
        <div v-for="(item,index) in dataImg" :key="index" :src="item.idenPictureUrl" class="image-carousel">
48
          <img :src="'http://10.19.90.34:19000/ai-image/'+item.idenPictureUrl" class="img-viewer-size" @click="getParticularsData(item.aiIdenLogId,index)">
49
          <span :class="{'fileName' : index === fileNameIndex}" style="width: 132px;margin-right: 14px;text-align:center">{{ item.fileName }}</span>
50
        </div>
47
        <t-carousel dots="none" arrow="always" style="width: 100%">
48
          <t-carousel-item v-for="(item1,index1) in dataImgList" :key="index1" style="width: 100%;padding-left: 10%">
49
            <div v-for="(item, index) in item1" :key="index" :src="item.idenPictureUrl" class="image-carousel">
50
              <img :src="'http://10.19.90.34:19000/ai-image/'+item.idenPictureUrl" class="img-viewer-size" @click="getParticularsData(item.aiIdenLogId,index)">
51
              <span :class="{'fileName' : index === fileNameIndex}" style="width: 132px;margin-right: 14px;text-align:center">{{ item.fileName }}</span>
52
            </div>
53
          </t-carousel-item>
54
        </t-carousel>
51
      </div>
55
      </div>
52
    </div>
56
    </div>
53
  </div>
57
  </div>
65
      devicePosition: '',
69
      devicePosition: '',
66
      distinguishUrl: '',
70
      distinguishUrl: '',
67
      dataImg: [],
71
      dataImg: [],
72
      dataImgList: [],
68
      fileNameIndex: 0,
73
      fileNameIndex: 0,
69
      playerOptions: {
74
      playerOptions: {
70
        playbackRates: [0.7, 1.0, 1.5, 2.0], // 播放速度
75
        playbackRates: [0.7, 1.0, 1.5, 2.0], // 播放速度
116
      }
121
      }
117
      var flag = this.startreend(this.startDate, this.endDate)
122
      var flag = this.startreend(this.startDate, this.endDate)
118
      if (flag) {
123
      if (flag) {
119
        var data = { params: { beginDay: this.startDate, endDay: this.endDate, id: this.videoId }}
124
        var data = { params: { beginDay: this.startDate, endDay: this.endDate, id: this.videoId, pageNumber: 1, pageSize: 10000 }}
120
        sysapi.getDistinguishData(data).then(res => {
125
        sysapi.getDistinguishData(data).then(res => {
121
          console.log(res.data)
126
          console.log(res.data)
122
          this.dataImg = res.data.data
127
          this.dataImg = res.data.data
123
          if (res.data.data.length > 0) {
128
          if (res.data.data.length > 0) {
124
            this.getParticularsData(res.data.data[0].aiIdenLogId, 0)
129
            this.getParticularsData(res.data.data[0].aiIdenLogId, 0)
130
            this.dataImgList = this.arrayGroup(res.data.data, 10)
125
          } else {
131
          } else {
126
            this.devicePosition = ''
132
            this.devicePosition = ''
127
            this.defineResult = ''
133
            this.defineResult = ''
135
        this.$Message.danger('开始时间不能在结束时间的后面')
141
        this.$Message.danger('开始时间不能在结束时间的后面')
136
      }
142
      }
137
    },
143
    },
144
    arrayGroup(array, subGroupLength) {
145
      let index = 0
146
      let newArray = []
147
      while(index < array.length) {
148
        newArray.push(array.slice(index, index += subGroupLength))
149
      }
150
      return newArray
151
    },
138
    // 字符串更改为时间类型
152
    // 字符串更改为时间类型
139
    stringtodate (date) {
153
    stringtodate (date) {
140
      date = date.substring(0, 19)
154
      date = date.substring(0, 19)
240
            display: flex;
254
            display: flex;
241
            .image-carousel{
255
            .image-carousel{
242
              display: flex;
256
              display: flex;
257
              width: 9%;
258
              height: 80%;
243
              flex-direction: column;
259
              flex-direction: column;
244
              .img-viewer-size{
260
              .img-viewer-size{
245
                cursor:pointer;
261
                cursor:pointer;
246
                width: 132px;
247
                height: 88px;
262
                width: 100%;
263
                height: 100%;
248
                margin-right: 14px;
264
                margin-right: 14px;
265
                padding-left: 2%;
249
              }
266
              }
250
            }
267
            }
251
        }
268
        }
252
    }
269
    }
270
    .carousel-control-prev-icon{
271
      color: #009bf3;
272
    }
253
}
273
}
254
.fileName{
274
.fileName{
255
  color: #009bf3;
275
  color: #009bf3;

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

1
<template>
1
<template>
2
  <div class="page-main">
2
  <div class="page-main">
3
    <t-button-group class="top-btn">
3
    <t-button-group class="top-btn">
4
      <t-button v-for="(item,index) in sceneList" :key="index" :value="item.monitorSceneId" :color="item.monitorSceneId === selectedMonitorScene ? 'primary' : 'secondary'" @click="tabClick(item.monitorSceneId)">
4
      <t-button v-for="(item,index) in sceneList" :key="index" :value="item.monitorSceneId" :color="item.monitorSceneId === selectedMonitorScene ? 'primary' : 'secondary'" @click="tabClick(item.monitorSceneId, item.monitorViewLayout)">
5
        {{ item.monitorSceneName }}
5
        {{ item.monitorSceneName }}
6
      </t-button>
6
      </t-button>
7
    </t-button-group>
7
    </t-button-group>
141
        if (element.id === this.gateFieldData) {
141
        if (element.id === this.gateFieldData) {
142
          sysapi.getMonitorScene(this.organizationList[index].id).then((resp) => {
142
          sysapi.getMonitorScene(this.organizationList[index].id).then((resp) => {
143
            this.sceneList = resp.data.data || []
143
            this.sceneList = resp.data.data || []
144
            if (resp.data.data[0].monitorViewLayout === '1X1') {
145
              this.viewLayoutSpan = 10
146
              this.videoPageSize = 1
147
            } else if (resp.data.data[0].monitorViewLayout === '2X2') {
148
              this.viewLayoutSpan = 6
149
              this.videoPageSize = 4
150
            } else if (resp.data.data[0].monitorViewLayout === '3X3') {
151
              this.viewLayoutSpan = 4
152
              this.videoPageSize = 9
153
            } else if (resp.data.data[0].monitorViewLayout === '4X4') {
154
              this.viewLayoutSpan = 3
155
              this.videoPageSize = 16
156
            }
157
            this.tabClick(this.sceneList[0].monitorSceneId)
144
            // if (resp.data.data[0].monitorViewLayout === '1X1') {
145
            //   this.viewLayoutSpan = 10
146
            //   this.videoPageSize = 1
147
            // } else if (resp.data.data[0].monitorViewLayout === '2X2') {
148
            //   this.viewLayoutSpan = 6
149
            //   this.videoPageSize = 4
150
            // } else if (resp.data.data[0].monitorViewLayout === '3X3') {
151
            //   this.viewLayoutSpan = 4
152
            //   this.videoPageSize = 9
153
            // } else if (resp.data.data[0].monitorViewLayout === '4X4') {
154
            //   this.viewLayoutSpan = 3
155
            //   this.videoPageSize = 16
156
            // }
157
            this.tabClick(this.sceneList[0].monitorSceneId, resp.data.data[0].monitorViewLayout)
158
          })
158
          })
159
        }
159
        }
160
      })
160
      })
180
      this.showReplayDialog = true
180
      this.showReplayDialog = true
181
    },
181
    },
182
    // 切换场景
182
    // 切换场景
183
    async tabClick (id) {
183
    async tabClick (id, monitorViewLayout) {
184
      if (monitorViewLayout === '1X1') {
185
        this.viewLayoutSpan = 10
186
        this.videoPageSize = 1
187
      } else if (monitorViewLayout === '2X2') {
188
        this.viewLayoutSpan = 6
189
        this.videoPageSize = 4
190
      } else if (monitorViewLayout === '3X3') {
191
        this.viewLayoutSpan = 4
192
        this.videoPageSize = 9
193
      } else if (monitorViewLayout === '4X4') {
194
        this.viewLayoutSpan = 3
195
        this.videoPageSize = 16
196
      }
184
      this.selectedMonitorScene = id
197
      this.selectedMonitorScene = id
185
      this.paramsObj.page = 0
198
      this.paramsObj.page = 0
186
      this.videoList = []
199
      this.videoList = []
206
    },
219
    },
207
    // 获得风场大门数据
220
    // 获得风场大门数据
208
    getVideoSurveillanceData () {
221
    getVideoSurveillanceData () {
222
      this.videoList = []
223
      this.videoOptions = []
209
      var id = this.tabId
224
      var id = this.tabId
210
      this.paramsObj.page = this.videoCurrent
225
      this.paramsObj.page = this.videoCurrent
211
      sysapi.getVideoSurveillanceData({ params: { monitorSceneId: id } }).then(res => {
212
        this.videoList = res.data.data
213
        for (let i in res.data.data) {
226
      sysapi.getVideoSurveillanceDataForPage({ params: { monitorSceneId: id, pageNumber: this.videoCurrent, pageSize: this.videoPageSize } }).then(res => {
227
        this.videoList = res.data.data.data
228
        this.videoTotal = res.data.data.total
229
        for (let i in res.data.data.data) {
214
          let obj = {
230
          let obj = {
215
            autoplay: true, // 如果true,浏览器准备好时开始回放。
231
            autoplay: true, // 如果true,浏览器准备好时开始回放。
216
            muted: true, // 默认情况下将会消除任何音频。
232
            muted: true, // 默认情况下将会消除任何音频。
228
            sources: [{
244
            sources: [{
229
              withCredentials: false,
245
              withCredentials: false,
230
              type: 'application/x-mpegURL', // 这里的种类支持很多种:基本视频格式、直播、流媒体等,具体可以参看git网址项目
246
              type: 'application/x-mpegURL', // 这里的种类支持很多种:基本视频格式、直播、流媒体等,具体可以参看git网址项目
231
              src: res.data.data[i].videoUrl // url地址
247
              src: res.data.data.data[i].videoUrl // url地址
232
            }],
248
            }],
233
            flash: { hls: { withCredentials: false } },
249
            flash: { hls: { withCredentials: false } },
234
            html5: { hls: { withCredentials: false } },
250
            html5: { hls: { withCredentials: false } },