From 43730dc105c5e15aadd1896aeb61e82ea3c33417 Mon Sep 17 00:00:00 2001
From: sd <shidong@jhsoft.cc>
Date: 星期五, 29 八月 2025 15:26:10 +0800
Subject: [PATCH] 日志管理-操作日志没有数据bug修复

---
 src/pages/cameraAccess/components/SeparateRules.vue |  157 +++++++++++++++++++++++++++++++--------------------
 1 files changed, 95 insertions(+), 62 deletions(-)

diff --git a/src/pages/cameraAccess/components/SeparateRules.vue b/src/pages/cameraAccess/components/SeparateRules.vue
index b214de6..aa38deb 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>
@@ -36,13 +41,13 @@
           </div>
 
           <div v-if="Camera.analytics" class="flex-box">
-            <span class="label">绠楁硶蹇�熼�氶亾</span>
+            <span class="label">浠诲姟蹇�熼�氶亾</span>
             <div class="channel flex-box">
-              <el-tooltip effect="dark" content="澶嶅埗姝ゆ憚鍍忔満绠楁硶瑙勫垯" placement="bottom" popper-class="atooltip">
+              <el-tooltip effect="dark" content="澶嶅埗姝ゆ憚鍍忔満AI浠诲姟" placement="bottom" popper-class="atooltip">
                 <span style="color: #3d68e1; cursor: pointer; font-size: 23px" @click="ctrlC"
                   class="iconfont iconfuzhiguize"></span>
               </el-tooltip>
-              <el-tooltip effect="dark" :content="!TreeDataPool.ctrlCameraId ? '绮樿创绠楁硶瑙勫垯' : `绮樿创绠楁硶瑙勫垯锛屾潵婧愶細${TreeDataPool.ctrlCameraName}`
+              <el-tooltip effect="dark" :content="!TreeDataPool.ctrlCameraId ? '绮樿创AI浠诲姟' : `绮樿创AI浠诲姟锛屾潵婧愶細${TreeDataPool.ctrlCameraName}`
                 " placement="bottom" popper-class="atooltip">
                 <span :style="!TreeDataPool.ctrlCameraId
                   ? 'cursor: not-allowed;font-size:23px;'
@@ -59,7 +64,7 @@
 
     <div class="top">
       <p class="task-css">
-        <b style="font-size: 14px; line-height: 18px">鐫f煡浠诲姟</b>
+        <b style="font-size: 14px; line-height: 18px">AI浠诲姟</b>
       </p>
       <div class="clearfix">
         <slide-scene :sceneData="Camera.rules"></slide-scene>
@@ -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"
 
@@ -185,6 +190,9 @@
   computed: {
     cameraType() {
       return this.TreeDataPool.treeActiveName === "camera" ? "camera" : "dataStack"
+    },
+    isGb28182() {
+      return this.TreeDataPool.selectedNode.cameraType === 1
     }
   },
   data() {
@@ -370,6 +378,7 @@
     },
     refresh(url) {
       this.Camera.baseImg = url
+      // console.info("url="+url)
     },
     // 鍒濆鍖栨憚鍍忔満淇℃伅锛岀埗缁勪欢璋冪敤
     async initCameraData(id, type) {
@@ -429,7 +438,8 @@
           }
         })
       }
-
+      console.info(
+        this.Camera.rules)
     },
     delScenRule() {
       this.Camera.update()
@@ -440,6 +450,7 @@
     //鏄惁杩涜瑙嗛鍒嗘瀽澶勭悊
     pollEnable(row) {
       // console.info("Camera.:"+JSON.stringify(this.Camera))
+      console.log("this.Camera",this.Camera)
       let val = 0
       if (row) {
         if (this.PollData.RealTimeSum < this.PollData.channelTotal) {
@@ -453,80 +464,102 @@
         this.Camera.dealWay = false
         val = -1
       }
+      console.info("瑙嗛鍒嗘瀽鎸夐挳2")
+      // 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,
+          videoType:this.isGb28182 ? 1 : 0,
+          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