zhangzengfei
2022-07-20 4a800a8fc83c6bd1f86a8e847b079a51a7532c09
src/pages/cameraAccess/components/SeparateRules.vue
@@ -2,7 +2,7 @@
  <div class="s-separate-rules">
    <div class="ai">
      <div class="check-area">
        <div class="ai-select">
        <div class="ai-select" v-if="TreeDataPool.selectedNode.type !== 'MENU'">
          <div v-show="cameraType === 'camera'">
            <span>
              <span class="label">视频分析处理</span>
@@ -15,7 +15,7 @@
            </span>
          </div>
          <div v-if="Camera.analytics" class="flex-box" v-show="cameraType === 'camera'">
          <div v-if="Camera.analytics && isShowPolling === 'show'" class="flex-box" v-show="cameraType === 'camera'">
            <span class="label">处理方式</span>
            <toggle-button
              :value="Camera.dealWay"
@@ -223,6 +223,7 @@
import { pasteRules } from "@/api/task"
import { getCameraInfo } from "@/api/camera"
import { getGB28181CameraInfo } from "@/api/camera"
import { saveCameraScene } from "@/api/scene"
import { changeRunType } from "@/api/pollConfig"
@@ -257,6 +258,7 @@
  },
  data() {
    return {
      isShowPolling: sessionStorage.getItem("isShowPolling"),
      mockSceneData: [],
      loading: false,
      Camera: new VideoRuleData(),
@@ -309,7 +311,11 @@
  },
  methods: {
    getStatus() {
      getCameraInfo(this.Camera.cameraId).then((res) => {
      let refreshCameraInfo = getCameraInfo
      if (this.Camera.gb28181) {
        refreshCameraInfo = getGB28181CameraInfo
      }
      refreshCameraInfo(this.Camera.cameraId).then((res) => {
        if (res.success) {
          switch (res.data.status) {
            case 0:
@@ -401,6 +407,13 @@
      this.swiperIndex = this.$refs.swiper.swiper.activeIndex
    },
    drawBaseImg() {
      if (!this.Camera.cameraId) {
        this.$notify({
          type: "warning",
          message: "请先选择摄像机"
        })
        return
      }
      if (Array.isArray(this.$refs.canvas)) {
        if (this.$refs.canvas.length > 0) {
          this.$refs.canvas[0].showModal()
@@ -486,7 +499,8 @@
      if (this.Camera.cameraId && this.Camera.cameraId !== undefined) {
        changeRunType({
          camera_ids: [this.Camera.cameraId],
          run_type: val
          run_type: val,
          isGb: this.Camera.gb28181
        }).then((rsp) => {
          this.getStatus()
          if (rsp && rsp.success) {
@@ -508,7 +522,6 @@
    //实时、轮询切换
    changePoll(row) {
      //判断是新增还是更新
      debugger
      if (this.Camera.cameraId && this.Camera.cameraId !== undefined) {
        if (this.PollData.RealTimeSum < this.PollData.channelTotal) {
          if (row.value) {
@@ -516,10 +529,10 @@
          } else {
            this.Camera.dealWay = false
          }
          debugger
          changeRunType({
            camera_ids: [this.Camera.cameraId],
            run_type: this.Camera.dealWay ? 1 : 0
            run_type: this.Camera.dealWay ? 1 : 0,
            isGb: this.Camera.gb28181
          }).then((rsp) => {
            if (rsp && rsp.success) {
              this.$notify({
@@ -536,7 +549,6 @@
        } else {
          if (this.Camera.dealWay) {
            this.Camera.dealWay = false
            debugger
            changeRunType({
              camera_ids: [this.Camera.cameraId],
              run_type: this.Camera.dealWay ? 1 : 0