guanqb
2023-02-15 2f2fc8178b85edd198dab6f5fb50c7d5d6e4cec8
src/components/map/components/mapPopup.vue
@@ -1,8 +1,8 @@
<template>
    <div>
        <div v-if="detailsPopup" class="divForms-dom" id="divFormsDomBox">
        <div v-if="detailsPopup.showBox" class="divForms-dom" id="divFormsDomBox">
            <div style="width: 100%; height: 100%; transform: translate(0, 50%);">
                <div class="divForms divForms-theme">
                <div class="divForms divForms-theme" :class="{ 'scale-dom': scaleDomFlag }">
                    <div class="divForms-wrap">
                        <div class="area">
                            <div class="arrow-lt"></div>
@@ -14,13 +14,21 @@
                            <div class="label-wrap">
                                <div class="title">
                                    警情信息
                                    <div class="details-btn" @click="popupDetailShow">详情>>></div>
                                    <div class="details-btn" @click="popupDetailShow">
                                        详情
                                        <span>>>></span>
                                    </div>
                                    <div class="close" @click="closePopup" title="关闭"></div>
                                </div>
                                <div class="change-btn">
                                    <div @click="currentBtn = '接警信息'" :class="{ on: currentBtn == '接警信息' }">接警信息</div>
                                    <div @click="currentBtnChange('出警信息')" :class="{ on: currentBtn == '出警信息' }">出警信息
                                    </div>
                                <div class="change-btn" v-show="detailsPopup.showBtn">
                                    <div
                                        @click="currentBtn = '接警信息'"
                                        :class="{ on: currentBtn == '接警信息' }"
                                    >接警信息</div>
                                    <div
                                        @click="currentBtnChange('出警信息')"
                                        :class="{ on: currentBtn == '出警信息' }"
                                    >出警信息</div>
                                </div>
                                <div v-show="currentBtn == '接警信息'" class="label-content">
@@ -33,8 +41,8 @@
                                        <div>{{ dataPopup.JJYXM }}</div>
                                    </div>
                                    <div class="item">
                                        <div>接警时间:</div>
                                        <div>{{ dataPopup.JJSJ }}</div>
                                        <div>报警时间:</div>
                                        <div>{{ dataPopup.BJSJ }}</div>
                                    </div>
                                    <div class="item">
                                        <div>报警人:</div>
@@ -62,7 +70,10 @@
                                    </div>
                                </div>
                                <div v-show="currentBtn == '出警信息'" class="label-content">
                                <div
                                    v-show="currentBtn == '出警信息' && JSON.stringify(CJdata) != '{}'"
                                    class="label-content"
                                >
                                    <div class="item">
                                        <div>处警单位:</div>
                                        <div>{{ CJdata.CJDWMC }}</div>
@@ -100,6 +111,11 @@
                                        <div>{{ CJdata.MEMO }}</div>
                                    </div>
                                </div>
                                <div
                                    v-show="currentBtn == '出警信息' && JSON.stringify(CJdata) == '{}'"
                                    class="label-content no-data"
                                >暂无数据</div>
                            </div>
                        </div>
                        <div class="b-t-l"></div>
@@ -119,35 +135,71 @@
export default {
    name: 'mapPopup',
    inject: ["getWidth", 'userInfo'],
    data () {
        return {
            currentBtn: '接警信息',
            CJdata: {}
            CJdata: {},
            scaleDomFlag: false
        }
    },
    computed: {
        ...mapGetters([
            'detailsPopup',
            'dataPopup'
        ])
    },
    watch: {
        detailsPopup: {
            handler (newData, oldData) {
                if (newData.showBox == false) {
                    this.currentBtn = '接警信息'
                }
            }
        }
    },
    mounted () {
        if (this.getWidth() > 7000) {
            this.scaleDomFlag = true
        } else {
            this.scaleDomFlag = false
        }
    },
    methods: {
        closePopup () {
            this.currentBtn = '接警信息'
            this.$store.commit('SET_DETAILSPOPUP', false)
            this.$store.commit('SET_DETAILSPOPUP', {
                showBox: false,
                showBtn: false
            })
        },
        currentBtnChange (type) {
            this.currentBtn = type
            this.CJdata = {}
            getActAsPoliceList(this.dataPopup.JJDBH, '').then(res => {
                this.CJdata = res.data.data.records
            getActAsPoliceList(this.dataPopup.JJDBH, this.userInfo.dept_id).then(res => {
                if (res.data.data.records.length > 0) {
                    this.CJdata = res.data.data.records[0]
                }
            })
        },
        popupDetailShow () {
            this.$EventBus.$emit('policeSituationSiteClick', this.dataPopup)
            if (this.detailsPopup.showBtn == true) {
                this.$EventBus.$emit('policeSituationSiteClick', this.dataPopup)
            } else {
                this.$EventBus.$emit('housingPoliceSiteClick', this.dataPopup)
            }
        }
    }
}
@@ -158,6 +210,11 @@
    position: fixed;
    left: 0;
    z-index: 1 !important;
    .scale-dom {
        transform: scale(3);
        transform-origin: left;
    }
}
.divForms .arrow {
@@ -171,16 +228,20 @@
}
.divForms-theme .area {
    background-image: linear-gradient(135deg,
    background-image: linear-gradient(
            135deg,
            transparent 30px,
            #1831a79a 30px,
            #3f487ba6 50%,
            transparent 50%),
        linear-gradient(-45deg,
            transparent 50%
        ),
        linear-gradient(
            -45deg,
            transparent 30px,
            #1831a79a 30px,
            #3f487ba6 50.1%,
            transparent 50%);
            transparent 50%
        );
}
.divForms .area {
@@ -273,14 +334,14 @@
        align-items: center;
        justify-content: space-around;
        &>div {
        & > div {
            width: 36%;
            height: 36px;
            line-height: 36px;
            cursor: pointer;
        }
        &>div.on {
        & > div.on {
            color: #3d95f3;
            border-bottom: 2px solid #3d95f3;
        }
@@ -298,7 +359,7 @@
            margin: 0 10px;
            text-align: left;
            &>div:first-child {
            & > div:first-child {
                width: 112px;
                text-align: justify;
                display: inline-block;
@@ -306,7 +367,7 @@
                margin-right: 20px;
            }
            &>div:nth-of-type(2) {
            & > div:nth-of-type(2) {
                width: calc(100% - 120px);
                max-width: 190px;
                overflow: hidden;
@@ -314,9 +375,14 @@
                white-space: nowrap;
            }
        }
    }
    .label-content.no-data {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 240px;
    }
}
.divForms .title {
@@ -332,6 +398,10 @@
        right: 28px;
        height: 100%;
        cursor: pointer;
        span {
            font-size: 14px;
        }
    }
    .details-btn:hover {
@@ -357,9 +427,7 @@
}
.divForms-theme .title {
    background-image: linear-gradient(135deg,
            transparent 25px,
            #1c309e9a 25px);
    background-image: linear-gradient(135deg, transparent 25px, #1c309e9a 25px);
}
.divForms-theme .arrow,