heyujie
2022-06-16 3e998850b5c4af147a60ed0b86b47379fc9eb1f2
src/pages/cameraAccess/components/SeparateRules.vue
@@ -34,7 +34,13 @@
              @change="changePoll"
            />
          </div>
          <div
            v-if="Camera.analytics"
            class="flex-box"
            v-show="cameraType === 'camera'"
          >
            <span class="label">处理状态: {{ camStatus }}</span>
          </div>
          <div
            v-if="Camera.analytics"
            class="flex-box"
@@ -256,7 +262,7 @@
import { savePolygon } from "@/api/polygon";
import { pasteRules } from "@/api/task";
import { getCameraInfo } from "@/api/camera";
import { saveCameraScene } from "@/api/scene";
import { changeRunType } from "@/api/pollConfig";
@@ -309,20 +315,8 @@
          prevEl: ".swiper-local-prev",
        },
      },
      // swiperOption: {
      //   slidesPerView: 5,
      //   spaceBetween: 8,
      //   pagination: {
      //     el: ".swiper-pagination",
      //     clickable: true
      //   },
      //   navigation: {
      //     nextEl: ".swiper-next-border",
      //     prevEl: ".swiper-pre-border"
      //   }
      // },
      tableRuleList: [],
      camStatus:'',
      cameraId: "",
      showSysInfo: false,
      showCanvas: true,
@@ -357,6 +351,29 @@
    },
  },
  methods: {
    getStatus() {
      getCameraInfo(this.Camera.cameraId).then((res) => {
        if (res.success) {
          switch (res.data.status) {
            case 0:
              this.camStatus = "未配规则";
              return
            case 1:
              this.camStatus = "等待轮询处理";
              return
            case 2:
              this.camStatus = "正在执行分析处理";
              return
            case -1:
              this.camStatus = "其他情况导致未处理";
              return
            case -2:
              this.camStatus = "故障导致未处理";
              return
          }
        }
      });
    },
    prevClick() {
      if (this.swiperIndex == 0) {
        if (this.stackFilesPage > 1) {
@@ -550,11 +567,11 @@
        val = -1;
      }
      if (this.Camera.cameraId && this.Camera.cameraId !== undefined) {
        debugger;
        changeRunType({
          camera_ids: [this.Camera.cameraId],
          run_type: val,
        }).then((rsp) => {
          this.getStatus()
          if (rsp && rsp.success) {
            this.$notify({
              type: "success",