he wei
2025-06-06 895129470d7ee48183fc15b9ee18ef0880503e5d
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
<template>
    <el-tooltip :class="stateName" effect="dark" :content="content" placement="bottom">
        <div class="statusWarp" @click="handleClick">
            <i class="iconfont" :class="icon"></i>
        </div>
    </el-tooltip>
</template>
 
<script>
    export default {
        props: {
            state: {
                type: Number,
                default: 0
            },
            icon: {
                type: String,
                default: '',
            },
            content: {
                type: String,
                default: '未知'
            }
        },
        methods: {
            handleClick() {
                this.$emit('handleClick')
            }
        },
        computed: {
            stateName() {
                let result = '';
                switch (this.state) {
                    case 0:
                        result = 'error-state';
                        break;
                    case 1:
                        result = "";
                        break;
                    case 2:
                        result = "stop-state";
                        break;
                }
                return result;
            }
        }
    }
</script>
 
<style scoped>
    
    .statusWarp{
        margin-right: 14px;
        vertical-align: top;
        cursor: pointer;
        width: 22px;
        height: 22px;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        border-radius: 50%;
    }
    .iconfont {
        font-size: 12px;
        color: #041f6c;
    }
</style>