linwei
2026-08-08 8da4838cddf8ac6e4879fb817cdd529f9ab889f5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<!--
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2023-03-02 09:39:32
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2025-12-01 18:53:47
 * @FilePath: \srs-police-affairs\src\components\map\components\mapSearchPopup.vue
 * @Description: 
 * 
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
-->
<template>
    <div>
        <div v-if="mapSearchPopup" class="popup-dom" id="mapSearchPopup">
            <div style="transform: translate(-50%, 0);">
                <!-- 样式自己修改 -->
                <div class="content" :class="{ 'scale-dom': scaleDomFlag }">
                    <div class="close-box">
                        <i class="el-icon-close" @click="closeCurPopup"></i>
                    </div>
                    <div class="url-code" v-if="mapSearchPopupData.showImg">
                        <el-image style="width: 100px; height: 100px" :src="mapSearchPopupData.url"
                            :preview-src-list="[mapSearchPopupData.url]">
                        </el-image>
                    </div>
                    {{ mapSearchPopupData.name }}
                </div>
                <div class="bottom-arrow"></div>
            </div>
        </div>
    </div>
</template>
 
<script>
import { mapGetters } from 'vuex'
 
export default {
    name: 'mapSearchPopup',
 
    inject: ["getWidth", 'userInfo'],
 
    data () {
        return {
            scaleDomFlag: false
        }
    },
 
    computed: {
        ...mapGetters([
            'mapSearchPopup',
            'mapSearchPopupData'
        ])
    },
 
    mounted () {
        if (this.getWidth() > 7000) {
            this.scaleDomFlag = true
        } else {
            this.scaleDomFlag = false
        }
 
    },
 
    methods: {
        closeCurPopup () {
            this.$EventBus.$emit("mapClearLayer", {
                layerName: "searchLayer",
                type: "VectorLayer",
            })
 
            this.$store.commit("SET_MAPSEARCHPOPUP", false)
 
            this.$store.commit("SET_MAPSEARCHPOPUPDATA", {})
        }
    }
}
</script>
 
<style lang="scss" scoped>
.popup-dom {
    position: fixed;
    top: -16px;
    left: 0;
    z-index: 1 !important;
 
    &>.popup-box {
        position: relative;
    }
 
    .bottom-arrow {
        position: absolute;
        left: 50%;
        bottom: 0px;
        width: 0;
        height: 0;
        border: 10px solid transparent;
        border-top-color: $bg-color;
        transform: translate(-50%, 100%);
    }
 
    .scale-dom {
        transform: scale(3);
        transform-origin: left;
    }
 
    .content {
        padding: 0.5vh;
        width: 220px;
        background: $bg-color;
        border-radius: 4px;
        color: #fff;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
 
        .close-box {
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: flex-end;
 
            ::v-deep(.el-icon-close) {
                cursor: pointer;
            }
        }
 
        .url-code {
            ::v-deep(img) {
                width: 64px;
                height: 64px;
                vertical-align: middle;
            }
        }
 
    }
 
}
</style>