Browse Source

电子围栏

lyq 3 weeks ago
parent
commit
3e17d6499b

+ 104 - 123
monitor_ui/src/views/centerMonitor/camera/PolygonDrawer.vue

@@ -33,7 +33,6 @@
             <button @click="removeItem(item)" class="">
             <button @click="removeItem(item)" class="">
               <i class="fa fa-trash"></i> 删除
               <i class="fa fa-trash"></i> 删除
             </button>
             </button>
-            {{ item.syncStatus == 1 ? "已同步" : "未同步" }}
           </div>
           </div>
         </div>
         </div>
       </div>
       </div>
@@ -41,13 +40,13 @@
       <div class="info-group">
       <div class="info-group">
         <h3 class="setting-title">操作</h3>
         <h3 class="setting-title">操作</h3>
         <div class="actions">
         <div class="actions">
-          <button @click="finishCurrentPolygon" class="action-btn primary-btn" :disabled="taskId == null || pointId == null">
+          <button @click="finishCurrentPolygon" class="action-btn primary-btn" :disabled="pointId == null || pointId == ''">
             <i class="fa fa-check"></i> 完成当前多边形
             <i class="fa fa-check"></i> 完成当前多边形
           </button>
           </button>
-          <button @click="clearCanvas" class="action-btn danger-btn" :disabled="taskId == null || pointId == null">
+          <button @click="clearCanvas" class="action-btn danger-btn" :disabled="pointId == null || pointId == ''">
             <i class="fa fa-trash"></i> 清空画布
             <i class="fa fa-trash"></i> 清空画布
           </button>
           </button>
-          <button @click="savePolygons" class="action-btn secondary-btn" :disabled="taskId == null || pointId == null">
+          <button @click="savePolygons" class="action-btn secondary-btn" :disabled="pointId == null || pointId == ''">
             <i class="fa fa-download"></i> 保存多边形
             <i class="fa fa-download"></i> 保存多边形
           </button>
           </button>
         </div>
         </div>
@@ -63,43 +62,19 @@
     </div>
     </div>
 
 
     <div>
     <div>
-        <!-- 中间内容部分 -->
-        <div class="container" style="z-index: 1;display: none">
-          <div class="real-container">
-            <div class="has-success">
-              <label class="form-label mt-4" for="real-rtsp">请输入实时预览 rtsp 地址: </label>
-              <input id="real-rtsp" value="rtsp://10.10.10.10:9100/dss/monitor/param/cameraid=1000000%240%26substream=1?token=1" type="text" class="form-control">
-              <button type="button" @click="playReal" class="btn btn-outline-primary" id="real-btn">实时预览</button>
-            </div>
+      <!-- 中间内容部分 -->
+      <div class="container" style="z-index: 1;display: none">
+        <div class="real-container">
+          <div class="has-success">
+            <label class="form-label mt-4" for="real-rtsp">请输入实时预览 rtsp 地址: </label>
+            <input id="real-rtsp" value="rtsp://10.10.10.10:9100/dss/monitor/param/cameraid=1000000%240%26substream=1?token=1" type="text" class="form-control">
+            <button type="button" @click="playReal" class="btn btn-outline-primary" id="real-btn">实时预览</button>
           </div>
           </div>
         </div>
         </div>
+      </div>
 
 
-        <!-- 画布区域 -->
-        <div class="canvas-section">
-          <div id="ws-real-player" class="preview-container" ref="previewContainer"></div>
-          <div id="canvas-container" class="canvas-container" ref="canvasContainer">
-            <canvas
-              ref="polygonCanvas"
-              @click="handleCanvasClick"
-              @dblclick="handleCanvasDblClick"
-              @mousemove="handleMouseMove"
-              @mouseenter="handleMouseEnter"
-              @mouseleave="handleMouseLeave"
-              class="polygon-canvas"
-            ></canvas>
-            <!-- <div class="canvas-info" :class="{ 'highlight': highlightInfo }">
-              {{ canvasInfo }}
-            </div> -->
-          </div>
-
-          <!-- <div class="polygon-info">
-            <h3 class="info-title">多边形信息</h3>
-            <div class="info-text">
-              已绘制: <span class="polygon-count">{{ polygons.length }}</span> 个多边形
-            </div>
-          </div> -->
-        </div>
-
+      <!-- 画布区域 -->
+      <div id="ws-real-player" class="preview-container" ref="previewContainer"></div>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
@@ -114,7 +89,7 @@ export default {
   props: {
   props: {
     url: {
     url: {
       type: String,
       type: String,
-      default: null,
+      default: "",
     },
     },
     channelId: {
     channelId: {
       type: String,
       type: String,
@@ -136,13 +111,15 @@ export default {
       type: String,
       type: String,
       default: null,
       default: null,
     },
     },
-    tasks: {
-      type: Array,
-      default: [],
+    info: {
+      type: String,
+      default: null,
     }
     }
   },
   },
   data() {
   data() {
     return {
     return {
+      canvasElem: null,
+      canvasContext: null,
       realPlayer: null,
       realPlayer: null,
 
 
       // 多边形数据
       // 多边形数据
@@ -176,15 +153,15 @@ export default {
     this.initCanvas()
     this.initCanvas()
 
 
     // 初始化预览容器大小
     // 初始化预览容器大小
-    this.resizePreviewContainer()
+    // this.resizePreviewContainer()
 
 
     // 监听窗口大小变化
     // 监听窗口大小变化
-    window.addEventListener('resize', this.resizePreviewContainer)
-  },
-  beforeUnmount() {
-    // 移除事件监听器
-    window.removeEventListener('resize', this.resizePreviewContainer)
+    // window.addEventListener('resize', this.resizePreviewContainer)
   },
   },
+  // beforeUnmount() {
+  //   // 移除事件监听器
+  //   window.removeEventListener('resize', this.resizePreviewContainer)
+  // },
   methods: {
   methods: {
     initRealPlayer() {
     initRealPlayer() {
 
 
@@ -202,10 +179,7 @@ export default {
           switch(methods) {
           switch(methods) {
             case 'initializationCompleted':
             case 'initializationCompleted':
                 console.log('初始化完成')
                 console.log('初始化完成')
-               that.realPlayer.setPlayerAdapter("stretching")
-                // 初始化完成,可调用播放方法(适用于动态加载解码库)
-                // 若回调未触发时就使用实时预览/录像回放,则无法播放。
-                // 此时我们可以调用一个
+                this.initCanvas();
                 break;
                 break;
             case "changeStreamType": // 主/辅码流切换回调
             case "changeStreamType": // 主/辅码流切换回调
                 console.log(data.channelData) // 通道数据
                 console.log(data.channelData) // 通道数据
@@ -247,9 +221,9 @@ export default {
         }
         }
       })
       })
     },
     },
-    getDom(selector) {
-        return document.querySelector(selector)
-    },
+    // getDom(selector) {
+    //     return document.querySelector(selector)
+    // },
     playReal(url) {
     playReal(url) {
       let that = this
       let that = this
       let wsURL = that.url
       let wsURL = that.url
@@ -257,24 +231,24 @@ export default {
       let streamType = 1
       let streamType = 1
       let channelId = that.channelId
       let channelId = that.channelId
       that.realPlayer.realByUrl({
       that.realPlayer.realByUrl({
-          rtspURL, // 必传
-          wsURL, // 必传
-          selectIndex: 0, // 必传, 播放窗口号
-          channelId, // 必传, 通道id
-          streamType, // 必传, 码流类型,
-          playerAdapter: 'stretching', // 选传, selfAdaption 自适应 | stretching 拉伸
-          channelData: {  // 建议传, 通道树信息
-              // id: channelCode, // {String} 通道编码
-              // deviceCode: deviceCode, // {String} 设备编码
-              // deviceType: deviceType, // {String} 设备类型
-              // channelSeq: channelSeq, // {String|Number} 通道序号
-          }, // 选传
+        rtspURL, // 必传
+        wsURL, // 必传
+        selectIndex: 0, // 必传, 播放窗口号
+        channelId, // 必传, 通道id
+        streamType, // 必传, 码流类型,
+        playerAdapter: 'stretching', // 选传, selfAdaption 自适应 | stretching 拉伸
+        channelData: {  // 建议传, 通道树信息
+            // id: channelCode, // {String} 通道编码
+            // deviceCode: deviceCode, // {String} 设备编码
+            // deviceType: deviceType, // {String} 设备类型
+            // channelSeq: channelSeq, // {String|Number} 通道序号
+        }, // 选传
       })
       })
 
 
-      let myDiv = that.getDom('.player-control');
-      that.$nextTick(() => {
-        myDiv.classList.add('hidden');
-      });
+      // let myDiv = that.getDom('.player-control');
+      // that.$nextTick(() => {
+      //   myDiv.classList.add('hidden');
+      // });
     },
     },
     // 初始化画布
     // 初始化画布
     initCanvas() {
     initCanvas() {
@@ -283,52 +257,60 @@ export default {
     },
     },
     // 调整画布大小
     // 调整画布大小
     resizeCanvas() {
     resizeCanvas() {
-      const container = this.$refs.canvasContainer
+      // const container = this.$refs.canvasContainer
       const previewContainer = this.$refs.previewContainer
       const previewContainer = this.$refs.previewContainer
-      const canvas = this.$refs.polygonCanvas
-
-      if (container && previewContainer && canvas) {
-        // 确保两个容器大小一致
-        const width = previewContainer.clientWidth
-        const height = previewContainer.clientHeight
-
-        // 设置canvas容器大小
-        container.style.width = `${width}px`
-        container.style.height = `${height}px`
-
-        // 设置画布尺寸以匹配显示尺寸
-        canvas.width = width
-        canvas.height = height
-
-        // 重绘所有多边形
-        this.redrawAllPolygons()
-      }
+      // const canvas = this.$refs.polygonCanvas
+      this.canvasElem = previewContainer.querySelector('#ws-real-player-0-pzt-livecanvas');
+      this.canvasElem.style.display = 'block';
+
+      this.canvasElem.addEventListener('click', this.handleCanvasClick);
+      this.canvasElem.addEventListener('dblclick', this.handleCanvasDblClick);
+      this.canvasElem.addEventListener('mousemove', this.handleMouseMove);
+      this.canvasElem.addEventListener('mouseenter', this.handleMouseEnter);
+      this.canvasElem.addEventListener('mouseleave', this.handleMouseLeave);
+
+      // if (container && previewContainer && canvas) {
+      //   // 确保两个容器大小一致
+      //   const width = previewContainer.clientWidth
+      //   const height = previewContainer.clientHeight
+      //
+      //   // 设置canvas容器大小
+      //   container.style.width = `${width}px`
+      //   container.style.height = `${height}px`
+      //
+      //   // 设置画布尺寸以匹配显示尺寸
+      //   canvas.width = width
+      //   canvas.height = height
+      //
+      //   // 重绘所有多边形
+      //   this.redrawAllPolygons()
+      // }
     },
     },
     // 调整预览窗口大小
     // 调整预览窗口大小
-    resizePreviewContainer() {
-      const container = this.$refs.canvasContainer
-      const previewContainer = this.$refs.previewContainer
-
-      if (container && previewContainer) {
-        // 获取父容器的尺寸
-        const parent = this.$refs.canvasContainer.parentElement
-        const parentWidth = parent.clientWidth
-
-        // 设置预览容器大小
-        previewContainer.style.width = `${parentWidth}px`
-        // 设置一个合适的高度,比如宽高比16:9
-        const height = Math.floor(parentWidth * 9 / 16)
-        previewContainer.style.height = `${height}px`
-
-        // 调整画布大小以匹配
-        this.resizeCanvas()
-      }
-    },
+    // resizePreviewContainer() {
+    //   const container = this.$refs.canvasContainer
+    //   const previewContainer = this.$refs.previewContainer
+    //
+    //   if (container && previewContainer) {
+    //     // 获取父容器的尺寸
+    //     const parent = this.$refs.canvasContainer.parentElement
+    //     const parentWidth = parent.clientWidth
+    //
+    //     // 设置预览容器大小
+    //     previewContainer.style.width = `${parentWidth}px`
+    //     // 设置一个合适的高度,比如宽高比16:9
+    //     const height = Math.floor(parentWidth * 9 / 16)
+    //     previewContainer.style.height = `${height}px`
+    //
+    //     // 调整画布大小以匹配
+    //     this.resizeCanvas()
+    //   }
+    // },
 
 
     // 处理画布点击事件 - 添加顶点
     // 处理画布点击事件 - 添加顶点
     handleCanvasClick(event) {
     handleCanvasClick(event) {
-      const canvas = this.$refs.polygonCanvas
-      const rect = canvas.getBoundingClientRect()
+      // const canvas = this.$refs.polygonCanvas
+      const rect = this.canvasElem.getBoundingClientRect()
 
 
       // 计算相对于画布的坐标
       // 计算相对于画布的坐标
       let x = event.clientX - rect.left
       let x = event.clientX - rect.left
@@ -349,8 +331,8 @@ export default {
     },
     },
     // 处理鼠标移动事件
     // 处理鼠标移动事件
     handleMouseMove(event) {
     handleMouseMove(event) {
-      const canvas = this.$refs.polygonCanvas
-      const rect = canvas.getBoundingClientRect()
+      // const canvas = this.$refs.polygonCanvas
+      const rect = this.canvasElem.getBoundingClientRect()
       // 计算相对于画布的坐标
       // 计算相对于画布的坐标
       let x = event.clientX - rect.left
       let x = event.clientX - rect.left
       let y = event.clientY - rect.top
       let y = event.clientY - rect.top
@@ -423,8 +405,7 @@ export default {
           lineColor: this.lineColor,
           lineColor: this.lineColor,
           fillColor: this.fillColor,
           fillColor: this.fillColor,
           lineWidth: this.lineWidth,
           lineWidth: this.lineWidth,
-          index: this.polygons.length == 0 ? 1 : this.polygons[this.polygons.length - 1].index + 1,
-          syncStatus: 0
+          index: this.polygons.length == 0 ? 1 : this.polygons[this.polygons.length - 1].index + 1
         })
         })
 
 
         // 重置当前多边形
         // 重置当前多边形
@@ -466,13 +447,13 @@ export default {
       // 转换为JSON字符串
       // 转换为JSON字符串
       const jsonData = JSON.stringify(data, null, 2)
       const jsonData = JSON.stringify(data, null, 2)
 
 
-      let param = {channelId: this.channelId, taskId: this.taskId, pointId: this.pointId, pointName: this.pointName, type: this.type, jsonData: jsonData, info: JSON.stringify(this.tasks.find(task => task.id == this.taskId))};
+      let param = {channelId: this.channelId, taskId: this.taskId, pointId: this.pointId, pointName: this.pointName, type: this.type, jsonData: jsonData, info: this.info};
       addRail(param).then(response => {
       addRail(param).then(response => {
         alert("成功")
         alert("成功")
         let json = {channelId: this.channelId, taskId: this.taskId, pointId: this.pointId, pointName: this.pointName, type: this.type};
         let json = {channelId: this.channelId, taskId: this.taskId, pointId: this.pointId, pointName: this.pointName, type: this.type};
         getRail(json).then(response => {
         getRail(json).then(response => {
           if (response.data && response.data.jsonData) {
           if (response.data && response.data.jsonData) {
-            this.redrawAllPolygons(response.data.jsonData, response.data.syncStatus)
+            this.redrawAllPolygons(response.data.jsonData)
           } else {
           } else {
             this.clearCanvas()
             this.clearCanvas()
           }
           }
@@ -506,19 +487,18 @@ export default {
       }, 1000)
       }, 1000)
     },
     },
     // 重绘所有多边形
     // 重绘所有多边形
-    redrawAllPolygons(data, status) {
+    redrawAllPolygons(data) {
       if (data) {
       if (data) {
         this.polygons = JSON.parse(data).polygons
         this.polygons = JSON.parse(data).polygons
-        this.polygons.forEach(item => item.syncStatus = status)
       }
       }
 
 
-      const canvas = this.$refs.polygonCanvas
-      if (!canvas) return
+      // const canvas = this.$refs.polygonCanvas
+      // if (!canvas) return
 
 
-      const ctx = canvas.getContext('2d')
+      const ctx = this.canvasElem.getContext('2d')
 
 
       // 清空画布
       // 清空画布
-      ctx.clearRect(0, 0, canvas.width, canvas.height)
+      ctx.clearRect(0, 0, this.canvasElem.width, this.canvasElem.height)
 
 
       // 绘制所有已完成的多边形
       // 绘制所有已完成的多边形
       this.polygons.forEach(polygon => {
       this.polygons.forEach(polygon => {
@@ -686,6 +666,7 @@ export default {
   font-size: 18px;
   font-size: 18px;
   font-weight: 600;
   font-weight: 600;
   color: #1F2937;
   color: #1F2937;
+  margin-top: 0px;
   margin-bottom: 16px;
   margin-bottom: 16px;
 }
 }
 
 

+ 97 - 3
monitor_ui/src/views/business/ai/algorithmtask/index.vue

@@ -265,6 +265,16 @@
               <el-table-column prop="channelName" label="通道名称"></el-table-column>
               <el-table-column prop="channelName" label="通道名称"></el-table-column>
               <el-table-column prop="channelCode" label="通道编码"></el-table-column>
               <el-table-column prop="channelCode" label="通道编码"></el-table-column>
               <el-table-column prop="deviceName" label="所属设备"></el-table-column>
               <el-table-column prop="deviceName" label="所属设备"></el-table-column>
+              <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                <template slot-scope="scope">
+                  <el-button
+                    size="mini"
+                    type="text"
+                    icon="el-icon-thumb"
+                    @click="drawFence(scope.row)"
+                  ></el-button>
+                </template>
+              </el-table-column>
             </el-table>
             </el-table>
           </el-col>
           </el-col>
         </el-form-item>
         </el-form-item>
@@ -281,6 +291,36 @@
         <el-button @click="cancel">取 消</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
       </div>
     </el-dialog>
     </el-dialog>
+
+    <!-- 绘制围栏 -->
+    <el-dialog title="绘制围栏" :visible.sync="openDraw" width="1800px" append-to-body :close-on-click-modal="false">
+      <el-row>
+        <el-col :span="6">
+          <el-card class="box-card">
+            通道名称:<span>{{ this.infoDraw.channelName }}</span>
+          </el-card>
+          <div style="margin-top: 15px"></div>
+          <el-card class="box-card" style="height: 400px;overflow: auto">
+            预置点:
+            <div style="margin-top: 15px"></div>
+            <div v-for="(point, index) in this.presetPoints" :key="index">
+              <el-button @click="getDraws(point)">{{ point.presetPointName }}</el-button>
+              <div style="margin-top: 15px"></div>
+            </div>
+          </el-card>
+        </el-col>
+        <el-col :span="18">
+          <div style="margin-left: 60px;margin-bottom: 15px">
+            规则框类型:
+            <el-radio-group v-model="infoDraw.type" @input="raidoChange">
+              <el-radio :label="'0'">识别框</el-radio>
+              <el-radio :label="'1'">屏蔽框</el-radio>
+            </el-radio-group>
+          </div>
+          <PolygonDrawer ref="PolygonDrawer" :url="infoDraw.url" :channelId="infoDraw.channelId" :pointId="infoDraw.pointId" :pointName="infoDraw.pointName" :taskId="infoDraw.taskId" :type="infoDraw.type" />
+        </el-col>
+      </el-row>
+    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -288,9 +328,14 @@
 import { listAlgorithmtask, getAlgorithmtask, delAlgorithmtask, addAlgorithmtask, updateAlgorithmtask, listAlgorithm, syncAlgorithmtask, syncAlgorithmtaskDH } from "@/api/business/ai/algorithmtask";
 import { listAlgorithmtask, getAlgorithmtask, delAlgorithmtask, addAlgorithmtask, updateAlgorithmtask, listAlgorithm, syncAlgorithmtask, syncAlgorithmtaskDH } from "@/api/business/ai/algorithmtask";
 import { channelTree } from "@/api/business/ai/alarmanalysis";
 import { channelTree } from "@/api/business/ai/alarmanalysis";
 import { checkPositiveInteger } from "@/api/system/rules"
 import { checkPositiveInteger } from "@/api/system/rules"
+import PolygonDrawer from './PolygonDrawer.vue'
+import { getPresetPoints } from '@/api/centerMonitor/LabelManagement/setLabel'
+import { getRtsp } from '@/api/centerMonitor/camera/camerachannel'
+import { getRail, operatePresetPoint } from '@/api/centerMonitor/rail/rail'
 
 
 export default {
 export default {
   name: "Algorithmtask",
   name: "Algorithmtask",
+  components: {PolygonDrawer},
   dicts: ['bus_ai_week'],
   dicts: ['bus_ai_week'],
   data() {
   data() {
     return {
     return {
@@ -352,7 +397,10 @@ export default {
       defaultProps: {
       defaultProps: {
         children: 'children',
         children: 'children',
         label: 'label'
         label: 'label'
-      }
+      },
+      openDraw: false,
+      presetPoints: [],
+      infoDraw: {}
     };
     };
   },
   },
   created() {
   created() {
@@ -465,7 +513,7 @@ export default {
     handleAdd() {
     handleAdd() {
       this.reset();
       this.reset();
       channelTree().then(response => {
       channelTree().then(response => {
-        this.data = this.handleTreeView(response.data)
+        this.data = this.handleTree(response.data)
         this.open = true;
         this.open = true;
         this.title = "添加任务";
         this.title = "添加任务";
       });
       });
@@ -480,7 +528,7 @@ export default {
         this.$set(this.form, "analysisCycles", this.form.analysisCycle.split(","));
         this.$set(this.form, "analysisCycles", this.form.analysisCycle.split(","));
         this.$set(this.form, "timeRangeList", this.form.taskJobs.map(item => [new Date(2016, 9, 10, item.startTimeHour, item.startTimeMinute, item.startTimeSecond), new Date(2016, 9, 10, item.endTimeHour, item.endTimeMinute, item.endTimeSecond)]));
         this.$set(this.form, "timeRangeList", this.form.taskJobs.map(item => [new Date(2016, 9, 10, item.startTimeHour, item.startTimeMinute, item.startTimeSecond), new Date(2016, 9, 10, item.endTimeHour, item.endTimeMinute, item.endTimeSecond)]));
         channelTree().then(response => {
         channelTree().then(response => {
-          this.data = this.handleTreeView(response.data)
+          this.data = this.handleTree(response.data)
           this.$refs.tree.setCheckedKeys(this.form.channelInfos.map(item => item.channelCode));
           this.$refs.tree.setCheckedKeys(this.form.channelInfos.map(item => item.channelCode));
         });
         });
         this.open = true;
         this.open = true;
@@ -556,6 +604,52 @@ export default {
       }).catch(error => {
       }).catch(error => {
         this.loading = false;
         this.loading = false;
       });
       });
+    },
+    // 绘制围栏
+    drawFence(row) {
+      this.infoDraw = {channelName: row.channelName, channelId: row.channelCode, pointId: "", pointName: "", taskId: this.form.id, type: "0"};
+      if (this.$refs.tree.getNode(row.channelCode).parent.data.url) {
+        this.infoDraw.url = this.$refs.tree.getNode(row.channelCode).parent.data.url
+      }
+      getPresetPoints(row.channelCode).then(response => {
+        if (response.data.code == 1000) {
+          this.presetPoints = response.data.data.presetPoints
+          this.openDraw = true
+          this.$refs.PolygonDrawer.clearCanvas()
+        }
+      })
+      getRtsp(row.channelCode).then(response => {
+        setTimeout(() => this.$refs.PolygonDrawer.playReal(response.data.data.url.split("|")[1] + "?token=" + response.data.data.token), 500)
+      })
+    },
+    getDraws(point) {
+      point.operateType = 1
+      operatePresetPoint(point)
+      this.infoDraw.pointId = point.presetPointCode
+      this.infoDraw.pointName = point.presetPointName
+      if (this.infoDraw.pointId && this.infoDraw.pointName) {
+        getRail(this.infoDraw).then(response => {
+          if (response.data && response.data.jsonData) {
+            this.$refs.PolygonDrawer.redrawAllPolygons(response.data.jsonData)
+          } else {
+            this.$refs.PolygonDrawer.clearCanvas()
+          }
+        })
+      }
+    },
+    raidoChange(val) {
+      if (this.infoDraw.pointId && this.infoDraw.pointName) {
+        getRail(this.infoDraw).then(response => {
+          if (response.data && response.data.jsonData) {
+            this.$refs.PolygonDrawer.redrawAllPolygons(response.data.jsonData)
+          } else {
+            this.$refs.PolygonDrawer.clearCanvas()
+          }
+        })
+      } else {
+        this.$refs.PolygonDrawer.polygons = []
+        this.$refs.PolygonDrawer.redrawAllPolygons()
+      }
     }
     }
   }
   }
 };
 };

+ 2 - 129
monitor_ui/src/views/centerMonitor/camera/index.vue

@@ -175,13 +175,6 @@
           <el-button
           <el-button
             size="mini"
             size="mini"
             type="text"
             type="text"
-            icon="el-icon-thumb"
-            @click="drawFence(scope.row)"
-          >绘制围栏
-          </el-button>
-          <el-button
-            size="mini"
-            type="text"
             icon="el-icon-video-camera"
             icon="el-icon-video-camera"
             @click="preview(scope.row)"
             @click="preview(scope.row)"
             v-hasPermi="['camerachannel:camerachannel:selectchannel']"
             v-hasPermi="['camerachannel:camerachannel:selectchannel']"
@@ -593,54 +586,6 @@
       </div>
       </div>
     </el-dialog>
     </el-dialog>
     <haikang-t-v-walls ref="haikangTVWalls"></haikang-t-v-walls>
     <haikang-t-v-walls ref="haikangTVWalls"></haikang-t-v-walls>
-
-    <!-- 绘制围栏 -->
-    <el-dialog :title="title" :visible.sync="openDraw" width="1800px" append-to-body :close-on-click-modal="false">
-      <el-row>
-        <el-col :span="6">
-          <el-card class="box-card">
-            <div slot="header" class="clearfix">
-              摄像头名称:<span>{{ this.infoDraw.cameraName }}</span>
-            </div>
-            通道名称:
-            <div style="margin-top: 15px"></div>
-            <div v-for="(channel, index) in this.infoDraw.channels" :key="index">
-              <el-button @click="getPresetpoints(channel)">{{ channel.channelName }}</el-button>
-              <div style="margin-top: 15px"></div>
-            </div>
-            任务:
-            <div style="margin-top: 15px"></div>
-            <el-select v-model="infoDraw.taskId" placeholder="请选择任务">
-              <el-option
-                v-for="task in this.infoDraw.tasks"
-                :key="task.id"
-                :label="task.taskName"
-                :value="task.id"
-              ></el-option>
-            </el-select>
-          </el-card>
-          <div style="margin-top: 15px"></div>
-          <el-card class="box-card" style="height: 400px;overflow: auto">
-            预置点:
-            <div style="margin-top: 15px"></div>
-            <div v-for="(point, index) in this.infoDraw.presetPoints" :key="index">
-              <el-button @click="getDraws(point)">{{ point.presetPointName }}</el-button>
-              <div style="margin-top: 15px"></div>
-            </div>
-          </el-card>
-        </el-col>
-        <el-col :span="18">
-          <div style="margin-left: 60px;margin-bottom: 15px">
-            规则框类型:
-            <el-radio-group v-model="infoDraw.type" @input="raidoChange">
-              <el-radio :label="'0'">识别框</el-radio>
-              <el-radio :label="'1'">屏蔽框</el-radio>
-            </el-radio-group>
-          </div>
-          <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>
   </div>
   </div>
 </template>
 </template>
 
 
@@ -677,10 +622,6 @@ import DHWs from '@/daHua/lib/DHWs'
 import {
 import {
   getHaiKangVideoServer
   getHaiKangVideoServer
 } from '@/api/haikang/haikang'
 } from '@/api/haikang/haikang'
-import PolygonDrawer from './PolygonDrawer.vue'
-import { getPresetPoints } from '@/api/centerMonitor/LabelManagement/setLabel'
-import { getTasks, getRtsp } from '@/api/centerMonitor/camera/camerachannel'
-import { getRail, operatePresetPoint } from '@/api/centerMonitor/rail/rail'
 
 
 
 
 /** ----------------------------------摄像头预览结束------------------------------------- */
 /** ----------------------------------摄像头预览结束------------------------------------- */
@@ -700,8 +641,7 @@ export default {
     aidevicedept,
     aidevicedept,
     aideviceevent,
     aideviceevent,
     ISuperMap,
     ISuperMap,
-    haikangTVWalls,
-    PolygonDrawer
+    haikangTVWalls
   },
   },
   dicts: ['camera_system', 'operator_type', 'camera_factory', 'camera_type', 'camera_use', 'device_status', 'camera_offline_reason', 'convergence_platform'],
   dicts: ['camera_system', 'operator_type', 'camera_factory', 'camera_type', 'camera_use', 'device_status', 'camera_offline_reason', 'convergence_platform'],
   data() {
   data() {
@@ -970,9 +910,7 @@ export default {
         cameraUse: [
         cameraUse: [
           { required: true, message: '摄像头用途不能为空', trigger: 'blur' }
           { required: true, message: '摄像头用途不能为空', trigger: 'blur' }
         ]
         ]
-      },
-      openDraw: false,
-      infoDraw: {}
+      }
     }
     }
   },
   },
   activated: function() {
   activated: function() {
@@ -1240,20 +1178,6 @@ export default {
       this.single = selection.length !== 1
       this.single = selection.length !== 1
       this.multiple = !selection.length
       this.multiple = !selection.length
     },
     },
-    //绘制围栏
-    drawFence(row) {
-      // window.open('http://' + row.cameraIp + ':1036?username=sooka&password=Sooka6688!!')
-      listCamerachannel({cameraId: row.id}).then(response => {
-        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 = "绘制围栏"
-          this.$refs.PolygonDrawer.clearCanvas()
-        } else {
-          this.$modal.msgSuccess('请先维护通道')
-        }
-      });
-    },
     /** ----------------------------------摄像头预览开始------------------------------------- */
     /** ----------------------------------摄像头预览开始------------------------------------- */
     preview(row) {
     preview(row) {
       selectConfigKey('DssVersion').then(res => {
       selectConfigKey('DssVersion').then(res => {
@@ -2035,57 +1959,6 @@ export default {
           that.$modal.warn('设备状态同步失败')
           that.$modal.warn('设备状态同步失败')
         }
         }
       })
       })
-    },
-    getPresetpoints(channel) {
-      if (channel.channelNum) {
-        this.infoDraw.channelId = channel.channelNum
-        getTasks(channel.channelNum).then(response => {
-          if (response.data.success) {
-            this.infoDraw.tasks = response.data.data.data
-          }
-        })
-        getPresetPoints(channel.channelNum).then(response => {
-          if (response.data.code == 1000) {
-            this.infoDraw.presetPoints = response.data.data.presetPoints
-          }
-        })
-        getRtsp(channel.channelNum).then(response => {
-          this.$refs.PolygonDrawer.playReal(response.data.data.url.split("|")[1] + "?token=" + response.data.data.token);
-        })
-      } else {
-        this.$modal.msgSuccess('请先维护通道编号')
-      }
-    },
-    getDraws(point) {
-      point.operateType = 1
-      operatePresetPoint(point)
-      this.infoDraw.pointId = point.presetPointCode
-      this.infoDraw.pointName = point.presetPointName
-      if (this.infoDraw.channelId && this.infoDraw.taskId && this.infoDraw.pointId && this.infoDraw.pointName && this.infoDraw.type) {
-        let param = {channelId: this.infoDraw.channelId, taskId: this.infoDraw.taskId, pointId: this.infoDraw.pointId, pointName: this.infoDraw.pointName, type: this.infoDraw.type}
-        getRail(param).then(response => {
-          if (response.data && response.data.jsonData) {
-            this.$refs.PolygonDrawer.redrawAllPolygons(response.data.jsonData, response.data.syncStatus)
-          } else {
-            this.$refs.PolygonDrawer.clearCanvas()
-          }
-        })
-      }
-    },
-    raidoChange(val) {
-      if (this.infoDraw.channelId && this.infoDraw.taskId && this.infoDraw.pointId && this.infoDraw.pointName && this.infoDraw.type) {
-        let param = {channelId: this.infoDraw.channelId, taskId: this.infoDraw.taskId, pointId: this.infoDraw.pointId, pointName: this.infoDraw.pointName, type: this.infoDraw.type}
-        getRail(param).then(response => {
-          if (response.data && response.data.jsonData) {
-            this.$refs.PolygonDrawer.redrawAllPolygons(response.data.jsonData, response.data.syncStatus)
-          } else {
-            this.$refs.PolygonDrawer.clearCanvas()
-          }
-        })
-      } else {
-        this.$refs.PolygonDrawer.polygons = []
-        this.$refs.PolygonDrawer.redrawAllPolygons()
-      }
     }
     }
   }
   }
 }
 }

+ 1 - 0
src/main/java/com/sooka/sponest/monitor/ai/controller/BusAiAlgorithmTaskController.java

@@ -182,6 +182,7 @@ public class BusAiAlgorithmTaskController extends BaseController
         if (UserConstants.NOT_UNIQUE.equals(busAiAlgorithmTaskService.checkTaskNameUnique(busAiAlgorithmTask))) {
         if (UserConstants.NOT_UNIQUE.equals(busAiAlgorithmTaskService.checkTaskNameUnique(busAiAlgorithmTask))) {
             return error("修改任务失败,任务名称'" + busAiAlgorithmTask.getTaskName() + "'已存在");
             return error("修改任务失败,任务名称'" + busAiAlgorithmTask.getTaskName() + "'已存在");
         }
         }
+        busAiAlgorithmTask.setSyncStatus("0");
         return busAiAlgorithmTaskService.updateBusAiAlgorithmTask(busAiAlgorithmTask) > 0 ? success() : error();
         return busAiAlgorithmTaskService.updateBusAiAlgorithmTask(busAiAlgorithmTask) > 0 ? success() : error();
     }
     }
 
 

+ 2 - 1
src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlarmAnalysisServiceImpl.java

@@ -188,11 +188,12 @@ public class BusAiAlarmAnalysisServiceImpl implements IBusAiAlarmAnalysisService
             map.put("id", item.getId());
             map.put("id", item.getId());
             map.put("label", item.getCameraName());
             map.put("label", item.getCameraName());
             map.put("parentId", "0");
             map.put("parentId", "0");
+            map.put("url", item.getUrl());
             return map;
             return map;
         }).collect(Collectors.toList()));
         }).collect(Collectors.toList()));
         resultList.addAll(channels.stream().map(item -> {
         resultList.addAll(channels.stream().map(item -> {
             Map<String, Object> map = new HashMap();
             Map<String, Object> map = new HashMap();
-            map.put("id", item.getChannelCode());
+            map.put("id", item.getChannelNum());
             map.put("label", item.getChannelName());
             map.put("label", item.getChannelName());
             map.put("parentId", item.getCameraId());
             map.put("parentId", item.getCameraId());
             return map;
             return map;

+ 0 - 1
src/main/java/com/sooka/sponest/monitor/ai/service/impl/BusAiAlgorithmTaskServiceImpl.java

@@ -115,7 +115,6 @@ public class BusAiAlgorithmTaskServiceImpl implements IBusAiAlgorithmTaskService
     @Override
     @Override
     public int updateBusAiAlgorithmTask(BusAiAlgorithmTask busAiAlgorithmTask)
     public int updateBusAiAlgorithmTask(BusAiAlgorithmTask busAiAlgorithmTask)
     {
     {
-        busAiAlgorithmTask.setSyncStatus("0");
         int result = busAiAlgorithmTaskMapper.updateBusAiAlgorithmTask(busAiAlgorithmTask);
         int result = busAiAlgorithmTaskMapper.updateBusAiAlgorithmTask(busAiAlgorithmTask);
         if (StringUtils.isNotEmpty(busAiAlgorithmTask.getInfos())) {
         if (StringUtils.isNotEmpty(busAiAlgorithmTask.getInfos())) {
             busAiAlgorithmTaskInfoService.deleteBusAiAlgorithmTaskInfoByAlgorithmTaskId(busAiAlgorithmTask.getId());
             busAiAlgorithmTaskInfoService.deleteBusAiAlgorithmTaskInfoByAlgorithmTaskId(busAiAlgorithmTask.getId());