Lita-Tako 4 months ago
parent
commit
506f97c7e5

+ 6 - 0
src/components/common/data.js

@@ -630,6 +630,12 @@ export const BUS_TYPE_3 = [
630
   { value: '1', label: '仓外'},
630
   { value: '1', label: '仓外'},
631
 ]
631
 ]
632
 
632
 
633
+export const CAMERA_LOCATION = [
634
+  { value: '1', label: '仓内'},
635
+  { value: '2', label: '业务'},
636
+  { value: '3', label: '安防'},
637
+]
638
+
633
 export const WORK_STATUS = [
639
 export const WORK_STATUS = [
634
   { value: '01', label: '在岗'},
640
   { value: '01', label: '在岗'},
635
   { value: '02', label: '已离职'},
641
   { value: '02', label: '已离职'},

+ 23 - 8
src/components/common/player/live_v2.vue

@@ -29,6 +29,7 @@ export default {
29
       videoMap: {}, // window index - {ws url, camera index code}
29
       videoMap: {}, // window index - {ws url, camera index code}
30
       currentWindowIndex: 0,
30
       currentWindowIndex: 0,
31
       viewUrl: null,
31
       viewUrl: null,
32
+      isActive: false,
32
     }
33
     }
33
   },
34
   },
34
   mounted() {
35
   mounted() {
@@ -175,7 +176,7 @@ export default {
175
           },
176
           },
176
         ]
177
         ]
177
         list.forEach(d => {
178
         list.forEach(d => {
178
-          const type = d.cameraType
179
+          const type = d.live
179
           const temp = {
180
           const temp = {
180
             label: d.cameraName,
181
             label: d.cameraName,
181
             ... d
182
             ... d
@@ -255,6 +256,7 @@ export default {
255
       }
256
       }
256
     },
257
     },
257
     doControl(command, action = 0, speed = 20, presetIndex = 10) {
258
     doControl(command, action = 0, speed = 20, presetIndex = 10) {
259
+
258
       if(this.videoMap[this.currentWindowIndex]) {
260
       if(this.videoMap[this.currentWindowIndex]) {
259
         const data = this.videoMap[this.currentWindowIndex]
261
         const data = this.videoMap[this.currentWindowIndex]
260
         const cameraId = data.cameraId
262
         const cameraId = data.cameraId
@@ -274,6 +276,14 @@ export default {
274
         return this.$message.warning('请选择播放中的窗口')
276
         return this.$message.warning('请选择播放中的窗口')
275
       }
277
       }
276
     },
278
     },
279
+    circle() {
280
+      if(this.isActive) {
281
+        this.doControl('LEFT', 1)
282
+      }else {
283
+        this.doControl('LEFT', 0)
284
+      }
285
+      this.isActive = !this.isActive
286
+    },
277
     doControl1(command) {
287
     doControl1(command) {
278
       this.doControl(command, 0)
288
       this.doControl(command, 0)
279
       setTimeout(() => {
289
       setTimeout(() => {
@@ -308,7 +318,7 @@ export default {
308
         }
318
         }
309
         manualCapture(q).then(resp => {
319
         manualCapture(q).then(resp => {
310
           if(resp) {
320
           if(resp) {
311
-            this.$systemUtils.download(resp)
321
+            this.$systemUtils.download2(resp)
312
           }
322
           }
313
         })
323
         })
314
       }
324
       }
@@ -384,25 +394,25 @@ export default {
384
                   [{label: '←', code: 'LEFT'}, {label: 'center', code: 'GOTO_PRESET'}, {label: '→', code: 'RIGHT'}],
394
                   [{label: '←', code: 'LEFT'}, {label: 'center', code: 'GOTO_PRESET'}, {label: '→', code: 'RIGHT'}],
385
                   [{label: '↙', code: 'LEFT_DOWN'}, {label: '↓', code: 'DOWN'}, {label: '↘', code: 'RIGHT_DOWN'}]]">
395
                   [{label: '↙', code: 'LEFT_DOWN'}, {label: '↓', code: 'DOWN'}, {label: '↘', code: 'RIGHT_DOWN'}]]">
386
             <el-row class="row">
396
             <el-row class="row">
387
-              <el-button v-if="item.code !== 'GOTO_PRESET'" v-for="item in list" :key="item.code" class="small-btn" @click="doControl1(item.code)">{{item.label}}</el-button>
388
-              <el-button v-else class="small-btn" icon="el-icon-refresh" @click="doControl(item.code)"></el-button>
397
+              <el-button v-if="item.code !== 'GOTO_PRESET'" v-for="item in list" :key="item.code" class="small-btn" @mousedown="doControl(item.code, 0)" @mouseup="doControl(item.code, 1)">{{item.label}}</el-button>
398
+              <el-button v-else class="small-btn" :class="{ 'is-active': isActive }" icon="el-icon-refresh" @click="circle()"></el-button>
389
             </el-row>
399
             </el-row>
390
           </template>
400
           </template>
391
         </el-row>
401
         </el-row>
392
         <el-row class="row">
402
         <el-row class="row">
393
           <el-col :span="12">
403
           <el-col :span="12">
394
-            <el-button type="primary" class="btn" icon="el-icon-plus" @click="doControl1('FOCUS_NEAR')">聚焦</el-button>
404
+            <el-button type="primary" class="btn" icon="el-icon-plus" @mousedown="doControl('FOCUS_NEAR', 0)" @mouseup="doControl('FOCUS_NEAR', 1)">聚焦</el-button>
395
           </el-col>
405
           </el-col>
396
           <el-col :span="12">
406
           <el-col :span="12">
397
-            <el-button type="primary" class="btn" icon="el-icon-remove" @click="doControl1('FOCUS_FAR')">聚焦</el-button>
407
+            <el-button type="primary" class="btn" icon="el-icon-remove" @mousedown="doControl('FOCUS_FAR', 0)" @mouseup="doControl('FOCUS_FAR', 1)">聚焦</el-button>
398
           </el-col>
408
           </el-col>
399
         </el-row>
409
         </el-row>
400
         <el-row class="row">
410
         <el-row class="row">
401
           <el-col :span="12">
411
           <el-col :span="12">
402
-            <el-button type="primary" class="btn" icon="el-icon-plus"  @click="doControl1('ZOOM_IN')">调焦</el-button>
412
+            <el-button type="primary" class="btn" icon="el-icon-plus"  @mousedown="doControl('ZOOM_IN', 0)" @mouseup="doControl('ZOOM_IN', 1)">调焦</el-button>
403
           </el-col>
413
           </el-col>
404
           <el-col :span="12">
414
           <el-col :span="12">
405
-            <el-button type="primary" class="btn" icon="el-icon-remove"  @click="doControl1('ZOOM_OUT')">调焦</el-button>
415
+            <el-button type="primary" class="btn" icon="el-icon-remove"  @mousedown="doControl('ZOOM_OUT', 0)" @mouseup="doControl('ZOOM_OUT', 1)">调焦</el-button>
406
           </el-col>
416
           </el-col>
407
         </el-row>
417
         </el-row>
408
 <!--        <el-row class="row">-->
418
 <!--        <el-row class="row">-->
@@ -473,4 +483,9 @@ export default {
473
     width: calc(50vw - 8px);
483
     width: calc(50vw - 8px);
474
   }
484
   }
475
 }
485
 }
486
+
487
+.el-button.is-active {
488
+  background-color: #409EFF;
489
+  color: white;
490
+}
476
 </style>
491
 </style>

+ 1 - 1
src/components/common/player/playback_v2.vue

@@ -175,7 +175,7 @@ export default {
175
           },
175
           },
176
         ]
176
         ]
177
         list.forEach(d => {
177
         list.forEach(d => {
178
-          const type = d.cameraType
178
+          const type = d.live
179
           const temp = {
179
           const temp = {
180
             label: d.cameraName,
180
             label: d.cameraName,
181
             ... d
181
             ... d

+ 1 - 1
src/page/basicData/components/cameraListEdit.vue

@@ -67,7 +67,7 @@
67
           </el-col>
67
           </el-col>
68
           <el-col :span="8">
68
           <el-col :span="8">
69
             <el-form-item label="业务类型" prop="live">
69
             <el-form-item label="业务类型" prop="live">
70
-              <common-select  v-model="form.live" type="BUS_TYPE" :readonly="readonly" />
70
+              <common-select v-model="form.live" type="CAMERA_LOCATION" :readonly="readonly" />
71
             </el-form-item>
71
             </el-form-item>
72
           </el-col>
72
           </el-col>
73
         </el-row>
73
         </el-row>

+ 1 - 0
src/utils/systemUtils.js

@@ -295,6 +295,7 @@ export const download2 = (url, fileName) => {
295
   const a = document.createElement('a');
295
   const a = document.createElement('a');
296
   a.href = url;
296
   a.href = url;
297
   a.download = fileName || 'download';
297
   a.download = fileName || 'download';
298
+  a.target = '_blank'
298
   document.body.appendChild(a);
299
   document.body.appendChild(a);
299
   a.click();
300
   a.click();
300
   document.body.removeChild(a);
301
   document.body.removeChild(a);