瀏覽代碼

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

chenxr3 4 年之前
父節點
當前提交
762a15dae8

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

@ -44,10 +44,14 @@
44 44
        </div>
45 45
      </div>
46 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 55
      </div>
52 56
    </div>
53 57
  </div>
@ -65,6 +69,7 @@ export default {
65 69
      devicePosition: '',
66 70
      distinguishUrl: '',
67 71
      dataImg: [],
72
      dataImgList: [],
68 73
      fileNameIndex: 0,
69 74
      playerOptions: {
70 75
        playbackRates: [0.7, 1.0, 1.5, 2.0], // 播放速度
@ -116,12 +121,13 @@ export default {
116 121
      }
117 122
      var flag = this.startreend(this.startDate, this.endDate)
118 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 125
        sysapi.getDistinguishData(data).then(res => {
121 126
          console.log(res.data)
122 127
          this.dataImg = res.data.data
123 128
          if (res.data.data.length > 0) {
124 129
            this.getParticularsData(res.data.data[0].aiIdenLogId, 0)
130
            this.dataImgList = this.arrayGroup(res.data.data, 10)
125 131
          } else {
126 132
            this.devicePosition = ''
127 133
            this.defineResult = ''
@ -135,6 +141,14 @@ export default {
135 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 153
    stringtodate (date) {
140 154
      date = date.substring(0, 19)
@ -240,16 +254,22 @@ export default {
240 254
            display: flex;
241 255
            .image-carousel{
242 256
              display: flex;
257
              width: 9%;
258
              height: 80%;
243 259
              flex-direction: column;
244 260
              .img-viewer-size{
245 261
                cursor:pointer;
246
                width: 132px;
247
                height: 88px;
262
                width: 100%;
263
                height: 100%;
248 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 274
.fileName{
255 275
  color: #009bf3;

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

@ -1,7 +1,7 @@
1 1
<template>
2 2
  <div class="page-main">
3 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 5
        {{ item.monitorSceneName }}
6 6
      </t-button>
7 7
    </t-button-group>
@ -141,20 +141,20 @@ export default {
141 141
        if (element.id === this.gateFieldData) {
142 142
          sysapi.getMonitorScene(this.organizationList[index].id).then((resp) => {
143 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,7 +180,20 @@ export default {
180 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 197
      this.selectedMonitorScene = id
185 198
      this.paramsObj.page = 0
186 199
      this.videoList = []
@ -206,11 +219,14 @@ export default {
206 219
    },
207 220
    // 获得风场大门数据
208 221
    getVideoSurveillanceData () {
222
      this.videoList = []
223
      this.videoOptions = []
209 224
      var id = this.tabId
210 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 230
          let obj = {
215 231
            autoplay: true, // 如果true,浏览器准备好时开始回放。
216 232
            muted: true, // 默认情况下将会消除任何音频。
@ -228,7 +244,7 @@ export default {
228 244
            sources: [{
229 245
              withCredentials: false,
230 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 249
            flash: { hls: { withCredentials: false } },
234 250
            html5: { hls: { withCredentials: false } },