zhanghua
2022-12-14 cb763a17221a5520d6887b2470b5276e0855ede7
src/views/intelligentPatrol/studyJudge/index.vue
@@ -2,9 +2,10 @@
  <div class="study-judge">
    <div class="study-judge-header">
      <span
        >您有{{ countData.review }}条待审核报警信息,今日立案{{
          countData.register
        }}条,再学习{{ countData.study }}条</span
        >您有<span @click="openDialogTable">{{ countData.review }}</span
        >条待审核报警信息,今日立案{{ countData.register }}条,再学习{{
          countData.study
        }}条</span
      >
    </div>
    <div class="study-judge-main">
@@ -15,16 +16,12 @@
          <span>{{ currentEvent.address }}</span>
        </div>
        <div class="sjm-header-right">
          <el-button
            size="small"
            @click="createVideo(currentEvent, 'playerWin')"
            >实时预览</el-button
          >
          <el-button
            size="small"
            @click="createVideo(currentEvent, 'playerWin')"
            >录像回放</el-button
          >
          <el-button size="small" @click="createVideo(currentEvent, 'live')"
            >实时预览
          </el-button>
          <el-button size="small" @click="createVideo(currentEvent, 'playback')"
            >录像回放
          </el-button>
        </div>
      </div>
      <div class="sjm-content">
@@ -44,7 +41,16 @@
            <img :src="item" />
          </div>
        </div>
        <div class="sjm-content-center">地图容器</div>
        <div class="sjm-content-center">
          <div class="map">
            <MyMap :point="point" :zoom="zoom" :mark="mark"></MyMap>
            <!-- <iframe
              style="height: 488px; min-width: 460px"
              src="https://183.245.159.161:8282/OneMap/index.html#/OneMap?code=2&clientVersion=&skin=white&locale=zh&otherAuthor=allowable"
            ></iframe> -->
          </div>
        </div>
        <div class="sjm-content-right">
          <div class="card-box">
            <div class="card-header">
@@ -97,8 +103,8 @@
                    :label="item.id"
                    v-for="item in stateList"
                    :key="item.id"
                    >{{ item.label }}</el-radio
                  >
                    >{{ item.label }}
                  </el-radio>
                </el-radio-group>
              </el-form-item>
              <el-form-item label="大类名称:" prop="categoryId">
@@ -145,11 +151,11 @@
                <el-button
                  :disabled="currentPage === 1"
                  @click="pageChange('prev')"
                  >上一条</el-button
                >
                  >上一条
                </el-button>
                <el-button @click.native.prevent="handleConfirm"
                  >确认</el-button
                >
                  >确认
                </el-button>
                <el-button @click="pageChange('next')">下一条</el-button>
              </el-form-item>
            </el-form>
@@ -169,13 +175,15 @@
    <el-dialog
      :visible.sync="dialogCreate"
      title="查看视频"
      width="80%"
      v-show="dialogCreate"
      :before-close="handleClose2"
    >
      <div class="dom" style="width: 100%; height: 600px; position: relative">
        <div id="dom1" class="dom1"></div>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="isShowTable" title="报警信息" width="1200px">
      <inspection-table />
    </el-dialog>
  </div>
</template>
@@ -187,9 +195,12 @@
import { FILE_ORIGINAL_URL } from "@/utils";
import { validateCarNum } from "@/utils/validate";
import MyDispatch from "@/components/dispatch";
import InspectionTable from "@/views/intelligentPatrol/studyJudge/inspectionTable/index.vue";
import MyMap from "@/components/map";
export default {
  components: { MyDispatch },
  components: { MyDispatch, MyMap, InspectionTable },
  created() {
    this.getInspectionData();
    this.initEventParams();
@@ -222,6 +233,11 @@
      })
      .catch((err) => this.$message.error(err));
  },
  mounted() {
    this.timer = setInterval(() => {
      setTimeout(this.getInspectionData, 0);
    }, 1000 * 10);
  },
  data() {
    const validateCarNumber = (rule, value, callback) => {
      if (value) {
@@ -235,11 +251,13 @@
      }
    };
    return {
      timer: null,
      countData: {
        study: 0,
        review: 0,
        register: 0,
      },
      isShowTable: false,
      currentEvent: {},
      stateList: [
        {
@@ -304,9 +322,16 @@
      crtHeight: 600,
      domId: "dom1",
      ctrl: "ctrl1",
      playType: "live",
      point: null,
      mark: null,
      zoom: null,
    };
  },
  methods: {
    openDialogTable() {
      this.isShowTable = true;
    },
    pageChange(type) {
      if (type === "next") {
        this.currentPage += 1;
@@ -321,6 +346,12 @@
        .getInspectionData({ current: this.currentPage })
        .then(({ records }) => {
          this.currentEvent = records[0];
          this.point = {
            x: this.currentEvent.longitude,
            y: this.currentEvent.latitude,
          };
          this.zoom = 19;
          this.mark = { title: this.currentEvent.address };
          if (this.currentEvent?.picData) {
            this.imageList = this.currentEvent.picData
              .split(",")
@@ -450,6 +481,7 @@
      });
    },
    createVideo(item, ctrlType) {
      this.playType = ctrlType;
      const DHWsInstance = DHWs.getInstance();
      this.ws = DHWsInstance;
      console.log(this.ws);
@@ -465,10 +497,10 @@
        const params = [
          {
            // ctrlType: "realMonitorUI",
            ctrlType: ctrlType,
            ctrlType: "playerWin",
            ctrlCode: this.ctrl,
            ctrlProperty: {
              displayMode: 1,
              displayMode: ctrlType == "playback" ? 2 : 1,
              splitNum: 1,
              channelList: [{ channelId: item.videoCode }],
            },
@@ -477,6 +509,11 @@
          },
        ];
        this.setPos();
        // _this.ws.on("createCtrlResult", (res) => {
        //   console.warn(res);
        // });
        _this.ws
          .createCtrl(params)
          .then((res) => {
@@ -486,12 +523,30 @@
          .catch((e) => {
            console.log("error;", e);
          });
        _this.ws.on("createCtrlResult", (res) => {
          console.warn(res);
        });
        if (ctrlType == "playback") {
          const end = new Date();
          const start = new Date();
          start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
          let beginTime = _this.formatDate(start);
          let endTime = _this.formatDate(end);
          const params = [
            {
              ctrlCode: this.ctrl,
              array: [
                {
                  beginTime: beginTime,
                  endTime: endTime,
                  channelId: item.videoCode,
                },
              ],
            },
          ];
          _this.ws.openCtrlRecord(params);
        }
      }, 1000);
    },
    destroy() {
      // 调用销毁控件接口
      if (!this.isLogin) {
@@ -520,6 +575,27 @@
        window.fireEvent("onresize");
      }
    },
    // 时间戳转 yyyy-MM-dd HH:mm:ss
    formatDate(inputTime) {
      var date = new Date(inputTime);
      var y = date.getFullYear();
      var m = date.getMonth() + 1;
      m = m < 10 ? "0" + m : m;
      var d = date.getDate();
      d = d < 10 ? "0" + d : d;
      var h = date.getHours();
      h = h < 10 ? "0" + h : h;
      var minute = date.getMinutes();
      var second = date.getSeconds();
      minute = minute < 10 ? "0" + minute : minute;
      second = second < 10 ? "0" + second : second;
      return y + "-" + m + "-" + d + " " + h + ":" + minute + ":" + second;
    },
  },
  beforeDestroy() {
    clearInterval(this.timer);
    this.timer = null;
  },
};
</script>
@@ -549,7 +625,6 @@
          margin-left: 4vw;
        }
      }
      .sjm-header-right {
        flex: 1;
        display: flex;
@@ -584,6 +659,9 @@
        }
      }
      .sjm-content-center {
        width: calc(100% - 800px);
      }
      .sjm-content-right {
        .card-box {
          .card-header {
@@ -597,7 +675,7 @@
  .el-form {
    ::v-deep .el-form-item {
      margin-bottom: 5px;
      margin-bottom: 15px;
    }
    ::v-deep .el-form-item__label {
@@ -609,4 +687,9 @@
    color: #4b9bb7;
  }
}
.map {
  height: 100%;
  min-width: 460px;
}
</style>