Lita-Tako пре 4 месеци
родитељ
комит
506f97c7e5

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

@@ -630,6 +630,12 @@ export const BUS_TYPE_3 = [
630 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 639
 export const WORK_STATUS = [
634 640
   { value: '01', label: '在岗'},
635 641
   { value: '02', label: '已离职'},

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

@@ -29,6 +29,7 @@ export default {
29 29
       videoMap: {}, // window index - {ws url, camera index code}
30 30
       currentWindowIndex: 0,
31 31
       viewUrl: null,
32
+      isActive: false,
32 33
     }
33 34
   },
34 35
   mounted() {
@@ -175,7 +176,7 @@ export default {
175 176
           },
176 177
         ]
177 178
         list.forEach(d => {
178
-          const type = d.cameraType
179
+          const type = d.live
179 180
           const temp = {
180 181
             label: d.cameraName,
181 182
             ... d
@@ -255,6 +256,7 @@ export default {
255 256
       }
256 257
     },
257 258
     doControl(command, action = 0, speed = 20, presetIndex = 10) {
259
+
258 260
       if(this.videoMap[this.currentWindowIndex]) {
259 261
         const data = this.videoMap[this.currentWindowIndex]
260 262
         const cameraId = data.cameraId
@@ -274,6 +276,14 @@ export default {
274 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 287
     doControl1(command) {
278 288
       this.doControl(command, 0)
279 289
       setTimeout(() => {
@@ -308,7 +318,7 @@ export default {
308 318
         }
309 319
         manualCapture(q).then(resp => {
310 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 394
                   [{label: '←', code: 'LEFT'}, {label: 'center', code: 'GOTO_PRESET'}, {label: '→', code: 'RIGHT'}],
385 395
                   [{label: '↙', code: 'LEFT_DOWN'}, {label: '↓', code: 'DOWN'}, {label: '↘', code: 'RIGHT_DOWN'}]]">
386 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 399
             </el-row>
390 400
           </template>
391 401
         </el-row>
392 402
         <el-row class="row">
393 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 405
           </el-col>
396 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 408
           </el-col>
399 409
         </el-row>
400 410
         <el-row class="row">
401 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 413
           </el-col>
404 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 416
           </el-col>
407 417
         </el-row>
408 418
 <!--        <el-row class="row">-->
@@ -473,4 +483,9 @@ export default {
473 483
     width: calc(50vw - 8px);
474 484
   }
475 485
 }
486
+
487
+.el-button.is-active {
488
+  background-color: #409EFF;
489
+  color: white;
490
+}
476 491
 </style>

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

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

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

@@ -67,7 +67,7 @@
67 67
           </el-col>
68 68
           <el-col :span="8">
69 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 71
             </el-form-item>
72 72
           </el-col>
73 73
         </el-row>

+ 1 - 0
src/utils/systemUtils.js

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