lyq 1 月之前
父節點
當前提交
ff13416cf2

+ 8 - 4
monitor_ui/src/views/centerMonitor/camera/PolygonDrawer.vue

@@ -40,13 +40,13 @@
       <div class="action-group">
         <h3 class="setting-title">操作</h3>
         <div class="actions">
-          <button @click="finishCurrentPolygon" class="action-btn primary-btn">
+          <button @click="finishCurrentPolygon" class="action-btn primary-btn" :disabled="taskId == null || pointId == null">
             <i class="fa fa-check"></i> 完成当前多边形
           </button>
-          <button @click="clearCanvas" class="action-btn danger-btn">
+          <button @click="clearCanvas" class="action-btn danger-btn" :disabled="taskId == null || pointId == null">
             <i class="fa fa-trash"></i> 清空画布
           </button>
-          <button @click="savePolygons" class="action-btn secondary-btn">
+          <button @click="savePolygons" class="action-btn secondary-btn" :disabled="taskId == null || pointId == null">
             <i class="fa fa-download"></i> 保存多边形
           </button>
         </div>
@@ -114,6 +114,10 @@ import { addRail } from '@/api/centerMonitor/rail/rail'
 export default {
   name: 'PolygonDrawer',
   props: {
+    url: {
+      type: String,
+      default: null,
+    },
     channelId: {
       type: String,
       default: null,
@@ -250,7 +254,7 @@ export default {
     },
     playReal(url) {
       let that = this
-      let wsURL = 'ws://39.153.161.212:40004'
+      let wsURL = that.url
       let rtspURL = url
       let streamType = 1
       let channelId = that.channelId

+ 9 - 5
monitor_ui/src/views/centerMonitor/camera/index.vue

@@ -637,7 +637,7 @@
               <el-radio :label="'1'">屏蔽框</el-radio>
             </el-radio-group>
           </div>
-          <PolygonDrawer ref="PolygonDrawer" :channelId="infoDraw.channelId" :pointId="infoDraw.pointId" :pointName="infoDraw.pointName" :taskId="infoDraw.taskId" :type="infoDraw.type" :tasks="infoDraw.tasks" />
+          <PolygonDrawer ref="PolygonDrawer" :url="infoDraw.url" :channelId="infoDraw.channelId" :pointId="infoDraw.pointId" :pointName="infoDraw.pointName" :taskId="infoDraw.taskId" :type="infoDraw.type" :tasks="infoDraw.tasks" />
         </el-col>
       </el-row>
     </el-dialog>
@@ -1244,9 +1244,13 @@ export default {
     drawFence(row) {
       // window.open('http://' + row.cameraIp + ':1036?username=sooka&password=Sooka6688!!')
       listCamerachannel({cameraId: row.id}).then(response => {
-        this.infoDraw = {cameraName: row.cameraName, channels: response.rows, tasks: [], presetPoints: [], pointId: "", pointName: "", type: "0"};
-        this.openDraw = true
-        this.title = "绘制围栏"
+        if (response.rows.length != 0) {
+          this.infoDraw = {url: row.url, cameraName: row.cameraName, channels: response.rows, tasks: [], presetPoints: [], pointId: "", pointName: "", type: "0"};
+          this.openDraw = true
+          this.title = "绘制围栏"
+        } else {
+          this.$modal.msgSuccess('请先维护通道')
+        }
       });
     },
     /** ----------------------------------摄像头预览开始------------------------------------- */
@@ -2066,7 +2070,7 @@ export default {
       }
     },
     raidoChange(val) {
-      if (this.$refs.PolygonDrawer.polygons.size != 0) {
+      if (this.$refs.PolygonDrawer.polygons.length != 0) {
         this.$refs.PolygonDrawer.polygons = []
         this.$refs.PolygonDrawer.redrawAllPolygons()
       }