illegalEvent.vue 5.96 KB
<template>
  <div class="pic-content scrollbar">
    <el-row v-if="illegalAlarmData.length > 0">
      <!-- 交通事件类 -->
      <!-- 机动车事件 -->
      <el-col
        :span="22"
        class="pic-box"
        v-for="(item, index) in illegalAlarmData"
        :key="index"
        v-if="item.event_cate !== 'flow'"
      >
        <el-col :span="12" v-if="item.task_algo_type != '1'">
          <el-card :body-style="{ padding: 0 }">
            <div class="img-wrap" @click="showInfo(index)">
              <b class="img-border"></b>
              <div class="picbackground">
                <img :src="item.pic" class="photos" />
              </div>
            </div>
          </el-card>
        </el-col>
        <el-col
          :lg="11"
          :md="14"
          :sm="13"
          v-if="item.event_type === 'vehicle' || item.event_type === 'xcycle'"
        >
          <ul class="pic-info">
            <!-- <li :title="item.shoot_date">
							<span>抓拍日期:</span>
							<span>{{ item.shoot_date }}</span>
						</li>
						<li :title="item.shoot_time">
							<span>抓拍时间:</span>
							<span>{{ item.shoot_time }}</span>
						</li>
						<li :title="item.location_name">
							<span>地点名称:</span>
							<span>{{ item.location_name }}</span>
						</li> -->
            <li
              v-if="item.event_type === 'vehicle'"
              :title="item.vehicle_plate_text"
            >
              <span>车牌号码:</span>
              <span>{{ item.vehicle_plate_text }}</span>
            </li>
            <!-- <li v-if="item.event_type === 'vehicle'" :title="item.vehicle_body_type_text">
							<span>车辆类型:</span>
							<span>{{ item.vehicle_body_type_text }}</span>
						</li> -->
            <li
              v-if="item.event_type === 'vehicle'"
              :title="item.vehicle_body_color_text"
            >
              <span>车身颜色:</span>
              <span>{{ item.vehicle_body_color_text }}</span>
            </li>
            <li
              v-if="item.event_type === 'vehicle'"
              :title="item.vehicle_body_logo_text"
            >
              <span>车辆品牌:</span>
              <span>{{ item.vehicle_body_logo_text }}</span>
            </li>
            <li
              v-if="item.event_type === 'vehicle'"
              :title="item.vehicle_plate_text"
            >
              <span>违法类型:</span>
              <span>{{ item.illegalType }}</span>
            </li>
            <!-- 非机动车 -->
            <li
              v-if="item.event_type === 'xcycle'"
              :title="item.xcycle_type_text"
            >
              <span>骑车类型:</span>
              <span>{{ item.xcycle_type_text }}</span>
            </li>
            <li
              v-if="item.event_type === 'xcycle'"
              :title="item.xcycle_color_type"
            >
              <span>车辆颜色:</span>
              <span>{{ item.xcycle_color_type }}</span>
            </li>
            <li
              :title="item.driver_face_lobody_text"
              v-if="item.event_type === 'xcycle'"
            >
              <span>速度:</span>
              <span>{{ item.location_speed }}</span>
            </li>
            <li v-if="item.event_type === 'xcycle'">
              <span>违法类型:</span>
              <span>{{ item.illegalType }}</span>
            </li>
          </ul>
        </el-col>
        <!-- 行人事件 -->
        <el-col :span="12" v-if="item.event_type === 'pedestrian'">
          <ul class="pic-info">
            <!-- <li :title="item.shoot_date">
							<span>抓拍日期:</span>
							<span>{{ item.shoot_date }}</span>
						</li>
						<li :title="item.shoot_time">
							<span>抓拍时间:</span>
							<span>{{ item.shoot_time }}</span>
						</li> -->
            <li :title="item.driver_face_sex">
              <span>性别:</span>
              <span>{{ item.driver_face_sex }}</span>
            </li>
            <li :title="item.pedestrian_height">
              <span>身高:</span>
              <span>{{ item.pedestrian_height }}</span>
            </li>
            <li :title="item.driver_face_lobody_text">
              <span>速度:</span>
              <span>{{ item.location_speed }}</span>
            </li>
            <li v-if="item.illegalType" :title="item.illegalType">
              <span>违法类型:</span>
              <span>{{ item.illegalType }}</span>
            </li>
          </ul>
        </el-col>
        <!--安防事件-->
        <el-col :span="12" v-if="item.event_cate === 'behavior'">
          <ul class="pic-info">
            <li :title="item.shoot_date">
              <span>抓拍日期:</span>
              <span>{{ item.shoot_date }}</span>
            </li>
            <li :title="item.shoot_time">
              <span>抓拍时间:</span>
              <span>{{ item.shoot_time }}</span>
            </li>
            <li :title="item.event_type">
              <span>事件类型:</span>
              <span>{{ item.event_type }}</span>
            </li>
            <li v-if="item.illegalType" :title="item.illegalType">
              <span>违法类型:</span>
              <span>{{ item.illegalType }}</span>
            </li>
          </ul>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>
<script>
export default {
  data() {
    return {
      illegalAlarmData: []
    };
  },
  props: ["itemData"],
  methods: {
    showInfo: function(index) {
      this.curPicData = this.illegalAlarmData[index];
      if (this.curPicData) {
        this.$emit("showDitail", this.curPicData);
      }
    }
  },
  created() {},
  mounted() {},
  watch: {
    itemData(val) {
      if (val == "") {
        this.illegalAlarmData = [];
        return;
      }
      if (val.illegalType && val.illegalTypestate == 1) {
        if (this.illegalAlarmData.length > 20) {
          this.illegalAlarmData.pop();
        } else {
          this.illegalAlarmData.unshift(val);
        }
      }
    }
  }
};
</script>
<style lang="stylus" scoped></style>