sd
2025-07-28 84f19ab0d37599400959e85e63cfda5df4869bc8
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>
@@ -370,6 +375,7 @@
    },
    refresh(url) {
      this.Camera.baseImg = url
      // console.info("url="+url)
    },
    // 初始化摄像机信息,父组件调用
    async initCameraData(id, type) {
@@ -453,21 +459,24 @@
        this.Camera.dealWay = false
        val = -1
      }
      console.info("isOpen:"+this.Camera.analytics?1:0)
      if (this.Camera.cameraId && this.Camera.cameraId !== undefined) {
        changeRunTypeTwo({
          videoId: this.Camera.cameraId,
          isOpen: val===1?1:0
          // 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()
@@ -497,54 +506,54 @@
    //实时、轮询切换
    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() {