ZZJ
2022-05-27 a689af1348938afd3b4506aad9b6d5057193e25d
src/views/hashrate/CameraManage/CameraRules/components/LinkageCameraBox.vue
@@ -1,6 +1,5 @@
<template>
  <div class="CameraBox">
    <div v-if="cameras">
  <div class="CameraBox" v-if="cameras">
      <div v-for="(camera, index) in cameraArr" :key="index" class="boxItem">
        <div class="header">
          <i class="iconfont">&#xe646;</i>
@@ -53,9 +52,6 @@
        <div class="button addRule" @click="addRule">添加新场景</div>
      </div>
    </div>
    <div class="empty" v-else>暂未获得摄像机信息</div>
  </div>
</template>
<script>
@@ -68,15 +64,16 @@
      type: Array,
    },
  },
  created() {
    this.getCameraInfo();
  },
  data() {
    return {
      cameraArr: [],
    };
  },
  created() {
    this.getCameraInfo();
  },
  computed: {},
  methods: {
    //是否进行视频分析处理
    pollEnable(row, index) {
@@ -112,7 +109,6 @@
              message: "配置失败",
            });
          }
          this.TreeDataPool.fetchTreeData();
        });
      }
      //    this.PollData.statisticTaskInfo();
@@ -127,14 +123,10 @@
        this.cameraArr[index].cameraId &&
        this.cameraArr[index].cameraId !== undefined
      ) {
        console.log(1);
        if (this.PollData.RealTimeSum < this.PollData.channelTotal) {
          if (row) {
            console.log(2);
            this.cameraArr[index].dealWay = true;
          } else {
            console.log(3);
            this.cameraArr[index].dealWay = false;
          }
          changeRunType({
@@ -174,7 +166,7 @@
            });
          }
        }
        this.TreeDataPool.fetchTreeData();
        //  this.TreeDataPool.fetchTreeData();
        //    this.PollData.statisticTaskInfo();
      }
    },
@@ -185,11 +177,19 @@
    },
    getCameraInfo() {
      this.cameraArr = [];
      if (this.cameras.length <= 0) {
        return;
      }
      let arr = [];
      this.cameras.forEach(async (id) => {
        if (!id) {
          return;
        }
        const rsp = await getCameraInfo(id);
        if (rsp.success) {
          this.cameraArr.push({
          arr.push({
            cameraId: rsp.data.id,
            cameraName: rsp.data.name ? rsp.data.name : "",
            analytics: rsp.data.runType !== -1 ? true : false,
@@ -201,6 +201,9 @@
          });
        }
      });
      this.cameraArr = arr;
      this.$forceUpdate();
    },
  },
  watch: {