安琪酵母(西藏)益生菌信息采集中心智能实验室
longyvfengyun
2023-10-09 d310c767eef62fc8202f531e7492ecd58779af72
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
<script setup>
import {computed} from "vue";
 
const props = defineProps({
    type: {
        type: [Number, String],
        default: 0,
    },
    blBl: {
        type: Boolean,
        default: true
    }
});
 
const lightState = computed(()=>{
    let state = "";
    let type = props.type > 1 ? 1 : props.type;
    switch (type) {
        case 1:
            state = "error-light";
            break;
        case -1:
            state = "gray-light";
            break;
        default:
            state = "";
            break;
    }
 
    if(props.blBl) {
        state+=" bl-bl"
    }
 
    return state;
});
</script>
 
<template>
    <div class="hdw-light" :class="lightState"></div>
</template>
 
<style lang="less" scoped>
/* light */
.hdw-light {
    position: relative;
    display: inline-block;
    width: 22px;
    height: 22px;
    vertical-align: middle;
}
 
.hdw-light:before {
    content: "";
    display: inline-block;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -5px;
    margin-left: -5px;
    width: 10px;
    height: 10px;
    border-radius: 10px;
    background-color: #4afd88;
    box-shadow: 0 0 6px 6px #4afd8880;
}
 
.hdw-light.error-light.bl-bl:before {
    background-color: #fd5b67;
    animation: errorLight 1000ms infinite;
    box-shadow: 0 0 6px 6px #fd586480;
}
.hdw-light.error-light:before {
    background-color: #fd5b67;
    box-shadow: 0 0 6px 6px #fd586480;
}
.hdw-light.gray-light:before {
    background-color: #878787;
    width: 12px;
    height: 12px;
    box-shadow: none;
}
 
@keyframes errorLight {
    0% {
        opacity: 1;
        box-shadow: 0 0 6px 6px #fd586480;
    }
    50% {
        opacity: 0.3;
        box-shadow: 0 0 0 0 #fd586480;
    }
    100% {
        opacity: 1;
        box-shadow: 0 0 6px 6px #fd586480;
    }
}
</style>