From 3b994b7b56b3ef2f2044a199d2bdb1cbf985d247 Mon Sep 17 00:00:00 2001 From: sd <shidong@jhsoft.cc> Date: 星期四, 28 八月 2025 11:19:29 +0800 Subject: [PATCH] 国标配置优化回显功能 --- src/pages/cameraAccess/components/SeparateRules.vue | 156 +++++++++++++++++++++++++++++++-------------------- 1 files changed, 95 insertions(+), 61 deletions(-) diff --git a/src/pages/cameraAccess/components/SeparateRules.vue b/src/pages/cameraAccess/components/SeparateRules.vue index aae7698..991abc6 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> @@ -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() @@ -439,6 +449,8 @@ }, //鏄惁杩涜瑙嗛鍒嗘瀽澶勭悊 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) { @@ -452,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