longyvfengyun
2024-03-25 4b6b56fc1cbd9f6be12a5bc439e496f29c4b51a1
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
<script setup>
import {VideoCameraFilled} from "@element-plus/icons-vue";
import {computed} from "vue";
 
const props = defineProps({
    state: {
        type: Number,
        default: 0
    }
});
 
const iconClass = computed(()=>{
    const state = props.state;
    return {
        normal: state === 0,   // 正常
        warning: state === 1,   // 告警
        danger: state === 2,    // 异常
    };
})
</script>
 
<template>
    <div class="video-item-icon" :class="iconClass">
        <el-icon class="video-icon"><VideoCameraFilled /></el-icon>
    </div>
</template>
 
<style scoped lang="less">
.video-item-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 20px;
    vertical-align: middle;
    &.normal {
        color: #11f11b;
    }
    &.warning {
        color: #f6b032;
        animation: warning 1s infinite;
    }
    &.danger {
        color: #FF0000;
        animation: danger 1s infinite;
    }
}
 
@keyframes warning {
    0% {
        color: #f6b032;
    }
    50% {
        color: #FFFFFF;
  }
    100% {
        color: #f6b032;
    }
}
 
@keyframes danger {
    0% {
        color: #FF0000;
    }
    50% {
        color: #FFFFFF;
    }
    100% {
        color: #FF0000;
    }
}
</style>