From 84f19ab0d37599400959e85e63cfda5df4869bc8 Mon Sep 17 00:00:00 2001
From: sd <shidong@jhsoft.cc>
Date: 星期一, 28 七月 2025 16:44:25 +0800
Subject: [PATCH] 整合督查任务

---
 src/pages/cameraAccess/components/SeparateRules.vue |  145 ++++++++++++++++++++++++++++-------------------
 1 files changed, 86 insertions(+), 59 deletions(-)

diff --git a/src/pages/cameraAccess/components/SeparateRules.vue b/src/pages/cameraAccess/components/SeparateRules.vue
index b214de6..5487d38 100644
--- a/src/pages/cameraAccess/components/SeparateRules.vue
+++ b/src/pages/cameraAccess/components/SeparateRules.vue
@@ -13,11 +13,16 @@
 
           <div v-if="Camera.analytics && isShowPolling === 'show'" class="flex-box" v-show="cameraType === 'camera'">
             <span class="label">澶勭悊鏂瑰紡</span>
-            <toggle-button :value="Camera.dealWay" :width="60" :labels="{ checked: '瀹炴椂', unchecked: '杞' }" :color="{
+            <toggle-button  :width="60" :labels="{ checked: '瀹炴椂', unchecked: '瀹炴椂' }" :color="{
+              checked: '#3D68E1',
+              unchecked: '#3D68E1',
+              disabled: '#CCCCCC'
+            }" :sync="true"/>
+            <!-- <toggle-button :value="Camera.dealWay" :width="60" :labels="{ checked: '瀹炴椂', unchecked: '杞' }" :color="{
               checked: '#3D68E1',
               unchecked: '#FF7733',
               disabled: '#CCCCCC'
-            }" :sync="true" @change="changePoll" />
+            }" :sync="true" @change="changePoll" /> -->
           </div>
           <div v-if="Camera.analytics" class="flex-box" v-show="cameraType === 'camera'">
             <span class="label">澶勭悊鐘舵��: {{ camStatus }}</span>
@@ -35,7 +40,7 @@
             <span class="label">SmartAI鑺傜偣: {{ Camera.runServerName }}</span>
           </div>
 
-          <div v-if="Camera.analytics" class="flex-box">
+          <!-- <div v-if="Camera.analytics" class="flex-box">
             <span class="label">绠楁硶蹇�熼�氶亾</span>
             <div class="channel flex-box">
               <el-tooltip effect="dark" content="澶嶅埗姝ゆ憚鍍忔満绠楁硶瑙勫垯" placement="bottom" popper-class="atooltip">
@@ -50,7 +55,7 @@
                   " @click="ctrlV" class="iconfont iconniantie ml5"></span>
               </el-tooltip>
             </div>
-          </div>
+          </div> -->
         </div>
       </div>
     </div>
@@ -157,7 +162,7 @@
 import { saveCameraScene } from "@/api/scene"
 import { saveCameraAndTask, updateCameraAndTask } from "@/api/selectRule";
 
-import { changeRunType } from "@/api/pollConfig"
+import { changeRunType,changeRunTypeTwo } from "@/api/pollConfig"
 import { findAllFileByStackId } from "@/api/localVedio"
 import VideoRuleData from "@/Pool/VideoRuleData"
 
@@ -370,6 +375,7 @@
     },
     refresh(url) {
       this.Camera.baseImg = url
+      // console.info("url="+url)
     },
     // 鍒濆鍖栨憚鍍忔満淇℃伅锛岀埗缁勪欢璋冪敤
     async initCameraData(id, type) {
@@ -453,80 +459,101 @@
         this.Camera.dealWay = false
         val = -1
       }
+      console.info("isOpen:"+this.Camera.analytics?1:0)
       if (this.Camera.cameraId && this.Camera.cameraId !== undefined) {
-        changeRunType({
-          camera_ids: [this.Camera.cameraId],
-          run_type: val,
-          isGb: this.Camera.gb28181
+        changeRunTypeTwo({
+          videoId: this.Camera.cameraId,
+          // isOpen: val
+          isOpen: this.Camera.analytics?1:0
         }).then((rsp) => {
           this.getStatus()
-          if (rsp && rsp.success) {
+          if (rsp && rsp.status === 200) {
             this.$notify({
               type: "success",
               message: "閰嶇疆鎴愬姛"
             })
           } else {
+            this.Camera.analytics = !this.Camera.analytics
             this.$notify({
               type: "error",
-              message: "閰嶇疆澶辫触"
+              message: rsp.msg
             })
           }
           this.TreeDataPool.fetchTreeData()
         })
+        // changeRunType({
+        //   camera_ids: [this.Camera.cameraId],
+        //   run_type: val,
+        //   isGb: this.Camera.gb28181
+        // }).then((rsp) => {
+        //   this.getStatus()
+        //   if (rsp && rsp.success) {
+        //     this.$notify({
+        //       type: "success",
+        //       message: "閰嶇疆鎴愬姛"
+        //     })
+        //   } else {
+        //     this.$notify({
+        //       type: "error",
+        //       message: "閰嶇疆澶辫触"
+        //     })
+        //   }
+        //   this.TreeDataPool.fetchTreeData()
+        // })
       }
       this.PollData.statisticTaskInfo()
     },
     //瀹炴椂銆佽疆璇㈠垏鎹�
     changePoll(row) {
       //鍒ゆ柇鏄柊澧炶繕鏄洿鏂�
-      if (this.Camera.cameraId && this.Camera.cameraId !== undefined) {
-        if (this.PollData.RealTimeSum < this.PollData.channelTotal) {
-          if (row.value) {
-            this.Camera.dealWay = true
-          } else {
-            this.Camera.dealWay = false
-          }
-          changeRunType({
-            camera_ids: [this.Camera.cameraId],
-            run_type: this.Camera.dealWay ? 1 : 0,
-            isGb: this.Camera.gb28181
-          }).then((rsp) => {
-            if (rsp && rsp.success) {
-              this.$notify({
-                type: "success",
-                message: "閰嶇疆鎴愬姛"
-              })
-            } else {
-              this.$notify({
-                type: "error",
-                message: "閰嶇疆澶辫触"
-              })
-            }
-          })
-        } else {
-          if (this.Camera.dealWay) {
-            this.Camera.dealWay = false
-            changeRunType({
-              camera_ids: [this.Camera.cameraId],
-              run_type: this.Camera.dealWay ? 1 : 0
-            }).then((rsp) => {
-              if (rsp && rsp.success) {
-                this.$notify({
-                  type: "success",
-                  message: "閰嶇疆鎴愬姛"
-                })
-              } else {
-                this.$notify({
-                  type: "error",
-                  message: "閰嶇疆澶辫触"
-                })
-              }
-            })
-          }
-        }
-        this.TreeDataPool.fetchTreeData()
-        this.PollData.statisticTaskInfo()
-      }
+      // if (this.Camera.cameraId && this.Camera.cameraId !== undefined) {
+      //   if (this.PollData.RealTimeSum < this.PollData.channelTotal) {
+      //     if (row.value) {
+      //       this.Camera.dealWay = true
+      //     } else {
+      //       this.Camera.dealWay = false
+      //     }
+      //     changeRunType({
+      //       camera_ids: [this.Camera.cameraId],
+      //       run_type: this.Camera.dealWay ? 1 : 0,
+      //       isGb: this.Camera.gb28181
+      //     }).then((rsp) => {
+      //       if (rsp && rsp.success) {
+      //         this.$notify({
+      //           type: "success",
+      //           message: "閰嶇疆鎴愬姛"
+      //         })
+      //       } else {
+      //         this.$notify({
+      //           type: "error",
+      //           message: "閰嶇疆澶辫触"
+      //         })
+      //       }
+      //     })
+      //   } else {
+      //     if (this.Camera.dealWay) {
+      //       this.Camera.dealWay = false
+      //       changeRunType({
+      //         camera_ids: [this.Camera.cameraId],
+      //         run_type: this.Camera.dealWay ? 1 : 0
+      //       }).then((rsp) => {
+      //         if (rsp && rsp.success) {
+      //           this.$notify({
+      //             type: "success",
+      //             message: "閰嶇疆鎴愬姛"
+      //           })
+      //         } else {
+      //           this.$notify({
+      //             type: "error",
+      //             message: "閰嶇疆澶辫触"
+      //           })
+      //         }
+      //       })
+      //     }
+      //   }
+      //   this.TreeDataPool.fetchTreeData()
+      //   this.PollData.statisticTaskInfo()
+      // }
     },
     //澶嶅埗
     ctrlC() {

--
Gitblit v1.8.0