安琪酵母(西藏)益生菌信息采集中心智能实验室
longyvfengyun
2023-06-17 6bb86cdfedc79e9e9fe2e9d545ef3f1f5af0d7af
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
<script setup>
import {computed, onMounted} from "vue";
 
    const props = defineProps({
        name: {
            type: String,
            default: ""
        },
        cWidth: {
            type: Number,
            default: 100
        },
        cHeight: {
            type: Number,
            default: 100,
        },
        dWidth: {
            type: Number,
            default: 100
        },
        dHeight: {
            type: Number,
            default: 100
        },
        x: {
            type: Number,
            default: 0
        },
        y: {
            type: Number,
            default: 0
        }
    });
 
    const posStyle = computed(()=>{
        return {
            left: props.x*props.cWidth/props.dWidth+'px',
            top: props.y*props.cHeight/props.dHeight+'px'
        }
    });
</script>
 
<template>
    <div class="map-pin" :style="posStyle">
        <el-tooltip placement="top">
            <template #content>
                {{name}}
            </template>
            <div class="map-pin-content">
                    <div class="pin"></div>
                    <div class="pulse"></div>
            </div>
        </el-tooltip>
    </div>
</template>
 
<style lang="less" scoped>
@size: 24px;
.map-pin {
    position: absolute;
    cursor: pointer;
    .map-pin-content {
        position: relative;
        top: -@size - @size*0.1;
        left: -@size*0.5;
        .pin {
            width: @size;
            height: @size;
            border-radius: 50% 50% 50% 0;
            background-color: @font-color-high-light;
            transform: rotate(-45deg);
            &:hover {
                background-color: @font-color-primary;
            }
            &:active {
                background-color: @font-color-warning;
            }
            &:after {
                content: '';
                position: absolute;
                width: @size*0.5;
                height: @size*0.5;
                margin: @size*0.25 0 0 @size*0.25;
                background: #646767;
                border-radius: 50%;
            }
        }
        .pulse {
            position: absolute;
            background: rgba(0, 254, 255, 0.3);
            border-radius: 50%;
            height: @size*0.8;
            width: @size*0.8;
            margin-left: @size*0.1;
            margin-top: -@size*0.2;
            transform: rotateX(55deg);
        }
    }
}
</style>