Browse Source

大华绘制轨迹临时解决方案

bihs 2 ngày trước cách đây
mục cha
commit
fd300e2b5d
1 tập tin đã thay đổi với 27 bổ sung16 xóa
  1. 27 16
      monitor_ui/src/views/centerMonitor/camera/index.vue

+ 27 - 16
monitor_ui/src/views/centerMonitor/camera/index.vue

@@ -175,6 +175,13 @@
           <el-button
             size="mini"
             type="text"
+            icon="el-icon-thumb"
+            @click="drawFence(scope.row)"
+          >绘制围栏
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
             icon="el-icon-video-camera"
             @click="preview(scope.row)"
             v-hasPermi="['camerachannel:camerachannel:selectchannel']"
@@ -1171,6 +1178,10 @@ export default {
       this.single = selection.length !== 1
       this.multiple = !selection.length
     },
+    //绘制围栏
+    drawFence(row) {
+      window.open('http://' + row.cameraIp + ':1025?username=admin2&password=admin123')
+    },
     /** ----------------------------------摄像头预览开始------------------------------------- */
     preview(row) {
       selectConfigKey('DssVersion').then(res => {
@@ -1281,7 +1292,7 @@ export default {
     preview_dss(cameraCode, cameraName, deviceCode, deviceSn, deviceProtocolType, deviceLoginType) {
       getDahuaVideoServer().then(newResponse => {
         this.ws.detectConnectQt().then(res => {
-          console.log('检测连接结果:', res);
+          console.log('检测连接结果:', res)
           if (res) { // 连接客户端成功
             this.alertLogin()
             this.ws.login({
@@ -1292,7 +1303,7 @@ export default {
               token: '',
               https: 1
             })
-            console.log('登录结果:', res);
+            console.log('登录结果:', res)
             this.ws.on('loginState', (res) => {
               this.isLogin = res
               if (res) {
@@ -1305,11 +1316,11 @@ export default {
                   channelList.push(code)
                 }
                 // 构建参数对象
-                let params;
+                let params
                 if (deviceCode === null && deviceSn === null && deviceProtocolType === null && deviceLoginType === null) {
-                  params = this.careteListJson(cameraCode, cameraName);
+                  params = this.careteListJson(cameraCode, cameraName)
                 } else {
-                  params = this.careteListJson(cameraCode, cameraName, deviceCode, deviceSn, deviceProtocolType, deviceLoginType);
+                  params = this.careteListJson(cameraCode, cameraName, deviceCode, deviceSn, deviceProtocolType, deviceLoginType)
                 }
                 // 过滤掉 null 参数
                 if (deviceCode === null) delete params.deviceCode
@@ -1328,7 +1339,7 @@ export default {
         })
       })
     },
-    careteListJson(cameraCode, cameraName, deviceCode=null, deviceSn=null, deviceProtocolType=null, deviceLoginType=null) {
+    careteListJson(cameraCode, cameraName, deviceCode = null, deviceSn = null, deviceProtocolType = null, deviceLoginType = null) {
       const treeLabels = [{
         'id': null,
         'labelCode': '999',
@@ -1352,20 +1363,20 @@ export default {
           'cameraType': '1',
           'online': '1',
           'cameraCode': '1'
-        };
-        if (deviceCode!== null) {
-          currentParams.deviceCode = deviceCode;
         }
-        if (deviceSn!== null) {
-          currentParams.deviceSn = deviceSn;
+        if (deviceCode !== null) {
+          currentParams.deviceCode = deviceCode
+        }
+        if (deviceSn !== null) {
+          currentParams.deviceSn = deviceSn
         }
-        if (deviceProtocolType!== null) {
-          currentParams.deviceProtocolType = deviceProtocolType;
+        if (deviceProtocolType !== null) {
+          currentParams.deviceProtocolType = deviceProtocolType
         }
-        if (deviceLoginType!== null) {
-          currentParams.deviceLoginType = deviceLoginType;
+        if (deviceLoginType !== null) {
+          currentParams.deviceLoginType = deviceLoginType
         }
-        channelDates.push(currentParams);
+        channelDates.push(currentParams)
       }
       const labelChannels = [{
         'labelCode': cameraCode,