Просмотр исходного кода

[FE]初步联调视频回放接口

luoxu5 лет назад: 4
Родитель
Сommit
c8d7ca045b

+ 3 - 4
security-protection-platform/src/api/dashboard/index.js

@ -4,20 +4,19 @@ const { $default } = http
4 4
5 5
const api = {
6 6
  // 出勤(饼状图)
7
  queryAttendanceChart() {
7
  queryAttendanceChart () {
8 8
    return $default.get('/sp/homePage/queryAttendanceChart', {}).then(resp => {
9
      debugger
10 9
      return resp.data
11 10
    })
12 11
  },
13 12
  // 报警(柱状图)
14
  queryAlarmAnalysisChart() {
13
  queryAlarmAnalysisChart () {
15 14
    return $default.get('/sp/homePage/queryAlarmAnalysisChart', {}).then(resp => {
16 15
      return resp.data
17 16
    })
18 17
  },
19 18
  // 报警(TOP4)
20
  queryAlarmAnalysisTopList() {
19
  queryAlarmAnalysisTopList () {
21 20
    return $default.get('/sp/homePage/queryAlarmAnalysisTopList', {}).then(resp => {
22 21
      return resp.data
23 22
    })

+ 7 - 3
security-protection-platform/src/api/videoSurveillance/index.js

@ -1,14 +1,18 @@
1 1
import http from '@/http'
2
const { $http } = http
2
const { $http, $default } = http
3 3
4 4
const api = {
5 5
  // 获取风场大门表格数据
6
  getVideoSurveillanceData(params) {
6
  getVideoSurveillanceData (params) {
7 7
    return $http.get('/videoSurveillance/getVideoSurveillanceData', params)
8 8
  },
9 9
  // 获取识别记录数据
10
  getDistinguishData(params) {
10
  getDistinguishData (params) {
11 11
    return $http.get('/videoSurveillance/getDistinguishData', params)
12
  },
13
  // 视频回放
14
  getVideoPlayBack (id) {
15
    return $default.get(`/sp/uploadFile/getFileUrl?fileName=${id}`).catch((err) => { return err })
12 16
  }
13 17
}
14 18
export default api

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

@ -17,9 +17,15 @@
17 17
          <div slot="foot" class="bottom">
18 18
            <span v-tooltip="item.videoDetail">{{ item.videoDetail.content | handleText }}</span>
19 19
            <div style="margin-left:auto">
20
              <t-button v-tooltip="item.options1" class="bottom-btn" @click="goDistinguishRecord(item.videoId)"><t-icon size="16" icon="image-outline"></t-icon></t-button>
21
              <t-button v-tooltip="item.options2" class="bottom-btn" @click="handleReview(item.videoId)"><t-icon size="16" icon="piechart-outline"></t-icon></t-button>
22
              <t-button v-tooltip="item.options3" class="bottom-btn"><t-icon size="16" icon="arrow-expand-all-outline"></t-icon></t-button>
20
              <t-button v-tooltip="item.options1" class="bottom-btn" @click="goDistinguishRecord(item.videoId)">
21
                <t-icon size="16" icon="image-outline"></t-icon>
22
              </t-button>
23
              <t-button v-tooltip="item.options2" class="bottom-btn" @click="handleReview(item.videoId)">
24
                <t-icon size="16" icon="piechart-outline"></t-icon>
25
              </t-button>
26
              <t-button v-tooltip="item.options3" class="bottom-btn">
27
                <t-icon size="16" icon="arrow-expand-all-outline"></t-icon>
28
              </t-button>
23 29
            </div>
24 30
          </div>
25 31
        </t-card>
@ -37,7 +43,7 @@ import ReplayDialog from './components/ReplayDialog'
37 43
export default {
38 44
  components: { ReplayDialog },
39 45
  filters: {
40
    handleText(value) {
46
    handleText (value) {
41 47
      if (!value) return ''
42 48
      if (value.length > 13) {
43 49
        return value.slice(0, 13) + '...'
@ -45,7 +51,7 @@ export default {
45 51
      return value
46 52
    }
47 53
  },
48
  data() {
54
  data () {
49 55
    return {
50 56
      videoCurrent: 1, // 大门分页数据
51 57
      videoPageSize: 10, // 大门分页数据
@ -66,12 +72,14 @@ export default {
66 72
      replayList: []
67 73
    }
68 74
  },
69
  mounted() {
75
  mounted () {
70 76
    this.getWindFiledList() // 获取风场列表
71 77
    this.getVideoSurveillanceData() // 获取视频监控界面数据
72 78
  },
73 79
  methods: {
74
    handleReview() {
80
    async handleReview (id) {
81
      // const res = await sysapi.getVideoPlayBack(id)
82
      // console.log(res)
75 83
      this.replayList = [{
76 84
        fileName: '12月14 16:55',
77 85
        fileId: 'ai-video_5A02296PAKA885B-video20201214165526.mp4',
@ -97,27 +105,27 @@ export default {
97 105
        fileId: 'ai-video_5A02296PAKA885B-video20201214165531.mp4',
98 106
        fileType: 'video/mp4'
99 107
      }]
100
      // this.replayList = [{
101
      //   sources: [{
102
      //     src: 'http://10.19.90.34:19000/tool-image/tool-image_7fa1f7b30f0640f2a67ac8b4c2e0b574.mp4',
103
      //     type: 'video/mp4'
104
      //   }]
105
      // }, {
106
      //   sources: [{
107
      //     src: 'http://10.19.90.34:19000/tool-image/tool-image_7fa1f7b30f0640f2a67ac8b4c2e0b574.mp4',
108
      //     type: 'video/mp4'
109
      //   }]
110
      // }]
108
      this.replayList = [{
109
        sources: [{
110
          src: 'http://10.19.90.34:19000/tool-image/tool-image_7fa1f7b30f0640f2a67ac8b4c2e0b574.mp4',
111
          type: 'video/mp4'
112
        }]
113
      }, {
114
        sources: [{
115
          src: 'http://10.19.90.34:19000/tool-image/tool-image_7fa1f7b30f0640f2a67ac8b4c2e0b574.mp4',
116
          type: 'video/mp4'
117
        }]
118
      }]
111 119
      this.showReplayDialog = true
112 120
    },
113
    async tabClick(id) {
121
    async tabClick (id) {
114 122
      this.paramsObj.page = 0
115 123
      this.videoList = []
116 124
      this.tabId = id
117 125
      this.videoCurrent = 1
118 126
      this.getVideoSurveillanceData()
119 127
    },
120
    getWindFiledList() {
128
    getWindFiledList () {
121 129
      commonapi.getDepartments().then(resp => {
122 130
        this.organizationList = []
123 131
        console.log(resp)
@ -133,13 +141,13 @@ export default {
133 141
      })
134 142
    },
135 143
    // 获得风场大门数据
136
    getVideoSurveillanceData(isWind) {
144
    getVideoSurveillanceData (isWind) {
137 145
      if (isWind) {
138 146
        this.videoList = []
139 147
      }
140 148
      if (this.videoList.length <= 10) {
141 149
        this.paramsObj.page = this.videoCurrent
142
        sysapi.getVideoSurveillanceData({params: this.paramsObj}).then(res => {
150
        sysapi.getVideoSurveillanceData({ params: this.paramsObj }).then(res => {
143 151
          this.departments = res.data.departments
144 152
          this.videoTotal = this.departments[this.tabId - 1].total
145 153
          res.data.data.forEach((element, index) => {
@ -160,11 +168,11 @@ export default {
160 168
      }
161 169
    },
162 170
    // 进入识别记录界面
163
    goDistinguishRecord(id) {
164
      this.$router.push({path: '/videoSurveillance/distinguishRecord', query: {videoId: id}})
171
    goDistinguishRecord (id) {
172
      this.$router.push({ path: '/videoSurveillance/distinguishRecord', query: { videoId: id } })
165 173
    },
166 174
    // 风场大门分页
167
    onChangeGate(val) {
175
    onChangeGate (val) {
168 176
      this.videoList = []
169 177
      this.videoCurrent = val
170 178
      this.getVideoSurveillanceData()
@ -173,69 +181,77 @@ export default {
173 181
}
174 182
</script>
175 183
<style lang="scss" scoped>
176
.page-main{
177
    padding:30px 24px 24px 24px;
178
    .top-btn{
179
        float: right;
180
    }
181
    .page-bottom{
182
        display: flex;
184
.page-main {
185
  padding: 30px 24px 24px 24px;
186
  .top-btn {
187
    float: right;
188
  }
189
  .page-bottom {
190
    display: flex;
191
    width: 100%;
192
    flex-wrap: wrap;
193
    margin-left: -24px;
194
    .card-video-first,
195
    .card-video {
196
      width: 354px;
197
      height: 240px;
198
      margin-top: 20px;
199
      .card-image {
183 200
        width: 100%;
184
        flex-wrap: wrap;
185
        margin-left: -24px;
186
        .card-video-first, .card-video{
187
          width:354px;
188
          height:240px;
189
          margin-top: 20px;
190
            .card-image{
191
                width: 100%;
192
                height: 100%;
193
            }
194
            .bottom{
195
                padding: 0 12px;
196
                display: flex;
197
                align-items: center;
198
                background-color: rgba(0, 0, 0, 0.5);
199
                height: 40px;
200
                color: #fff;
201
                font-size: 14px;
202
                .bottom-btn{
203
                    color: #fff;
204
                    border: none;
205
                    padding:0 !important;
206
                    &:hover{
207
                        color: #0089d4;
208
                    }
209
                }
210
            }
211
        }
212
        .card-video{
213
          .card-footer{
214
            padding: 0px 0 0 24px !important;
215
            background: none;
216
            width: 100%;
217
            position: absolute;
218
            border-top: none;
219
            bottom: 0px;
220
            }
221
            .card-block, .card-video-block{
222
              margin-left: 24px;
223
              padding:0 !important;
224
            }
201
        height: 100%;
202
      }
203
      .bottom {
204
        padding: 0 12px;
205
        display: flex;
206
        align-items: center;
207
        background-color: rgba(0, 0, 0, 0.5);
208
        height: 40px;
209
        color: #fff;
210
        font-size: 14px;
211
        .bottom-btn {
212
          color: #fff;
213
          border: none;
214
          padding: 0 !important;
215
          &:hover {
216
            color: #0089d4;
217
          }
225 218
        }
219
      }
220
    }
221
    .card-video {
222
      .card-footer {
223
        padding: 0px 0 0 24px !important;
224
        background: none;
225
        width: 100%;
226
        position: absolute;
227
        border-top: none;
228
        bottom: 0px;
229
      }
230
      .card-block,
231
      .card-video-block {
232
        margin-left: 24px;
233
        padding: 0 !important;
234
      }
226 235
    }
227
    .pager{
236
  }
237
  .pager {
228 238
    margin-right: auto;
229 239
    margin: 21px 0px 24px 0;
230 240
    float: right;
231 241
  }
232
.btn-primary, .radio-group-button .form-radio:checked, .radio-group-button .form-radio[checked]{
242
  .btn-primary,
243
  .radio-group-button .form-radio:checked,
244
  .radio-group-button .form-radio[checked] {
233 245
    color: #0089d4;
234 246
    background-color: #fff;
235 247
    border: 1px solid #0089d4;
236
}
237
.btn-secondary, .radio-group-button .form-radio, .checkbox-group--button .form-checkbox .form-checkbox__inner, .btn-dashed-secondary, .btn-outline-secondary{
248
  }
249
  y,
250
  .radio-group-button .form-radio,
251
  .checkbox-group--button .form-checkbox .form-checkbox__inner,
252
  .btn-dashed-secondary,
253
  .btn-outline-secondary {
238 254
    background: none;
239
}
255
  }
240 256
}
241 257
</style>