eventDetail.vue 11.2 KB
<template>
    <div class="pic-detail">
        <el-dialog title="详情" :visible.sync="isShow" :before-close='beforeHideModal'>
            <el-row>
                <el-col :span="16">
                    <div @mousemove='picMove' class="pic-wrap">
                        <img v-if="curPicData.picsEmpty" :src="carImg" alt="暂无图片" title="暂无图片" slot="reference" class='pictures small' />
                        <!-- <img v-if="curPicData.pics" :src="carImg" alt="暂无图片" slot="reference" class='pictures small' /> -->
                        <el-popover placement="left-end" width="305" trigger="hover" v-if="!curPicData.picsEmpty">
                            <div :style="{backgroundImage: 'url('+curPicData.pic+')',backgroundRepeat:'no-repeat'}" alt="" id="big" class='big'></div>
                            <img :src="curPicData.pic" alt="" slot="reference" class='pictures small' />
                        </el-popover>
                    </div>
                </el-col>
                <!-- 交通 -->
                <el-col :span="8" v-if="curPicData.event_type === 'vehicle' || curPicData.event_type === 'xcycle'|| curPicData.event_type === 'pedestrian'">
                    <ul class="pic-info">
                        <li v-if="curPicData.event_type === 'vehicle'" :title="curPicData.vehicle_body_type_text">
                            <span>车辆类型:</span>
                            <span>{{ curPicData.vehicle_body_type_text }}</span>
                        </li>
                        <li v-if="curPicData.event_type === 'vehicle'" :title="curPicData.vehicle_plate_text">
                            <span>车牌号码:</span>
                            <span>{{ curPicData.vehicle_plate_text }}</span>
                        </li>
                        <li v-if="curPicData.event_type === 'vehicle'" :title="curPicData.plate_type_text">
                            <span>车牌类型:</span>
                            <span>{{ curPicData.plate_type_text }}</span>
                        </li>
                        <li :title="curPicData.shoot_date">
                            <span>经过日期:</span>
                            <span>{{ curPicData.shoot_date }}</span>
                        </li>
                        <li :title="curPicData.shoot_time">
                            <span>经过时间:</span>
                            <span>{{ curPicData.shoot_time }}</span>
                        </li>
                        <li :title="curPicData.location_name">
                            <span>经过地点:</span>
                            <span>{{ curPicData.location_name }}</span>
                        </li>
                        <li v-if="curPicData.event_type === 'vehicle'" :title="curPicData.vehicle_body_logo_text">
                            <span>车辆品牌:</span>
                            <span>{{ curPicData.vehicle_body_logo_text }}</span>
                        </li>
                        <!-- <li :title="curPicData.vehicle_body_type_text">
                            <span>车辆类型:</span>
                            <span>{{ curPicData.vehicle_body_type_text }}</span>
                        </li> -->
                         <!-- 机动车 -->
                        <li v-if="curPicData.event_type === 'vehicle'" :title="curPicData.plate_color_text">
                            <span>车牌颜色:</span>
                            <span>{{ curPicData.plate_color_text }}</span>
                        </li>
                         <li v-if="curPicData.event_type === 'vehicle'" :title="curPicData.vehicle_body_color_text">
                            <span>车身颜色:</span>
                            <span>{{ curPicData.vehicle_body_color_text }}</span>
                        </li>
                        <li v-if="curPicData.event_type === 'vehicle'" :title="curPicData.RefinedFeature_text">
                            <span>标志物:</span>
                            <span>{{ curPicData.RefinedFeature_text }}</span>
                        </li>
                        <!-- 非机动车 -->
                                    <li v-if="curPicData.event_type === 'xcycle'" :title="curPicData.xcycle_type_text">
                          <span>骑车类型:</span>
                          <span>{{ curPicData.xcycle_type_text }}</span>
                        </li>
                        <li v-if="curPicData.event_type === 'xcycle'" :title="curPicData.xcycle_color_type">
                          <span>车辆颜色:</span>
                          <span>{{ curPicData.xcycle_color_type }}</span>
                        </li>
                        <li :title="curPicData.driver_face_sex"  v-if="curPicData.event_type === 'xcycle'">
                          <span>性别:</span>
                          <span>{{ curPicData.driver_face_sex }}</span>
                        </li>
                        <li v-if="curPicData.event_type === 'xcycle'" :title="curPicData.company">
                          <span>运营公司:</span>
                          <span>{{ curPicData.company }}</span>
                        </li>
                        <li v-if="curPicData.event_type === 'xcycle'" :title="curPicData.driver_face_upbody_text">
                          <span>上身颜色:</span>
                          <span>{{ curPicData.driver_face_upbody_text }}</span>
                        </li>
                        <li :title="curPicData.driver_face_lobody_text"  v-if="curPicData.event_type === 'xcycle'">
                          <span>速度:</span>
                          <span>{{ curPicData.location_speed }}</span>
                        </li>
                        <li :title="curPicData.driver_face_lobody_text"  v-if="curPicData.event_type === 'xcycle'">
                          <span>戴帽子:</span>
                          <span>{{ curPicData.driver_face_with_hats }}</span>
                        </li>
                                    <!-- 行人 -->
                        <li :title="curPicData.driver_face_sex" v-if="curPicData.event_type === 'pedestrian'">
                          <span>性别:</span>
                          <span>{{ curPicData.driver_face_sex }}</span>
                        </li>
                        <li :title="curPicData.driver_face_upbody_text" v-if="curPicData.event_type === 'pedestrian'">
                          <span>上身颜色:</span>
                          <span>{{ curPicData.driver_face_upbody_text }}</span>
                        </li>
                        <li :title="curPicData.driver_face_lobody_text" v-if="curPicData.event_type === 'pedestrian'">
                          <span>下身颜色:</span>
                          <span>{{ curPicData.driver_face_lobody_text }}</span>
                        </li>
                                    <li :title="curPicData.pedestrian_height"  v-if="curPicData.event_type === 'pedestrian'">
                          <span>身高:</span>
                          <span>{{ curPicData.pedestrian_height }}</span>
                        </li>
                                    <li :title="curPicData.driver_face_lobody_text"  v-if="curPicData.event_type === 'pedestrian'">
                          <span>速度:</span>
                          <span>{{ curPicData.location_speed }}</span>
                        </li>
                                    <li :title="curPicData.driver_face_lobody_text"  v-if="curPicData.event_type === 'pedestrian'">
                          <span>戴帽子:</span>
                          <span>{{ curPicData.driver_face_with_hats }}</span>
                        </li>
                        <li v-if="curPicData.illegalType" :title="curPicData.illegalType">
                          <span>违法类型:</span>
                          <span>{{ curPicData.illegalType }}</span>
                        </li>
                                </ul>
                            </el-col>
                            <el-col :span="8" v-if="curPicData.event_cate === 'behavior'">
                                <ul class="pic-info">
                                    <li :title="curPicData.shoot_date">
                                        <span>抓拍日期:</span>
                                        <span>{{ curPicData.shoot_date }}</span>
                                    </li>
                                    <li :title="curPicData.shoot_time">
                                        <span>抓拍时间:</span>
                                        <span>{{ curPicData.shoot_time }}</span>
                                    </li>
                                    <li :title="getCode('安防事件',curPicData.event_type)">
                                        <span>事件类型:</span>
                          <span>{{ getCode('安防事件',String(curPicData.event_type)) }}</span>
                        </li>
                        <li :title="curPicData.shoot_time" v-if="curPicData.event_type == '21'">
                            <span>区域人数:</span>
                            <span>{{ curPicData.event_data.density.persons }}</span>
                        </li>
                    </ul>
                </el-col>
            </el-row>
            <span slot="footer">
                <button class="closebtn" @click="beforeHideModal" style='width: 10%;'>关闭</button>
            </span>
        </el-dialog>
    </div>
</template>

<script>
export default {
    data() {
        return {
            carImg: '',
            isShow: false,
            curPicData:{}
        }
    },
    methods: {
        detailInfo: function (data) {
            this.curPicData = {};
            this.curPicData = data;
            this.isShow = true;
            this.$store.commit('setocxstate',0)
        },
        beforeHideModal: function () {
            this.isShow = false;
            this.$emit('closeDetailModal')
        },
        picMove: function (e) {
            var e = e || window.event;
            if (e.target.getAttribute('class').indexOf('small') > -1) {
                let imgWidth = e.target.width;
                let imgHeight = e.target.height;
                let x = 150-e.offsetX/imgWidth*1800;
                let y = 100-e.offsetY/imgHeight*1200;
                let bigimg = document.getElementById('big');
                bigimg.style.backgroundPosition = x +'px '+ y +'px'
            }else{
                return
            }
        }
    }

}
</script>

<style scoped>
    .pictures {
        width: 100%;
        max-height: 528px;
        cursor: zoom-in;
        height: 500px;
    }

    .pic-info {
        margin-bottom: 0;
    }

    .pic-info li {
        text-align: left;
        font-size: 18px;
        height: 48px;
        line-height: 48px;
        width: 100%;
        overflow: hidden;
        min-width: 235px;
    }

    .pic-info li span {
        float: left;
    }

    .pic-info li span:first-child {
        padding-left: 3%;
        margin-right: 10px;
        width: 91px;
    }
    .pic-info li span:last-child {
        width: 100px;       /*40%*/
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }
    .big {
		width: 300px;
		height: 200px;
		background-size: 1800px 1200px;
  }
  .closebtn{
    height: 30px;
    line-height: 30px;
  }

</style>