whyczyk
2021-07-31 04c2eb1db65b16f8d1b5c6a3b1eda6bb843f2bc3
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
<template>
    <div class="mw-diagram-panel">
        <div class="mw-diagram-panel-title">{{title}}</div>
        <div class="mw-diagram-panel-content">
            <table>
                <tbody>
                    <tr v-for="(item, index) in list" :key="'first'+index">
                        <td class="item-label">{{item.label}}</td>
                        <td class="item-value">{{item.value}}{{item.unit}}</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</template>
 
<script>
export default {
    props: {
        title: {
            type: String,
            default: "齿轮箱(默认)"
        },
        list: {
            type: Array,
            default() {
                return [
                    {
                        label: '当前转距:',
                        value: 280,
                        unit: "kN·m",
                    },
                    {
                        label: '受试电机转速:',
                        value: 2,
                        unit: "r/min",
                    },
                    {
                        label: '测功电机转速:',
                        value: 100,
                        unit: "r/min",
                    }
                ]
            }
        }
    },
}
</script>
 
<style scoped>
.mw-diagram-panel {
    position: absolute;
    z-index: 10;
    padding: 8px;
    border: 1px solid #5d69cd;
    background-color: #2c3377;
    border-radius: 8px;
    box-shadow: 4px 6px 55px 2px rgba(61, 94, 220, 0.8);
    min-width: 120px;
}
.mw-diagram-panel-title {
    text-align: center;
    color: #ffff13;
    font-size: 14px;
}
.mw-diagram-panel-content table {
    font-size: 12px;
}
.mw-diagram-panel-content table td {
    padding: 2px 0;
}
.mw-diagram-panel-content .item-label{
    text-align: right;
}
.mw-diagram-panel-content .item-value {
    padding-right: 8px;
}
</style>