headCenter.vue
4.6 KB
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<template>
<div style="width: 100%;height: 100%;display: flex;">
<div style="width: 20%;height: 100%;">
<div style="width: 100%; height: 100%; position: relative; left: 0vw; top: 0vw;">
<div class="location">
<div class="item" style="margin-bottom: 15px;">
<div class="name">焊机</div>
<div class="value">38台</div>
</div>
<div class="item" style="margin-bottom: 15px;">
<div class="name">带锯床</div>
<div class="value">1台</div>
</div>
<div class="item">
<div class="name">切坡一体机</div>
<div class="value">1台</div>
</div>
</div>
</div>
</div>
<div style="width: 60%;height: 100%;border: 2px solid #3879c9;">
<div class="title-text">在线设备</div>
<div class="container">
<!-- 每列数据 -->
<div v-for="(item, index) in dataList" :key="index" class="column-wrapper">
<div class="data-column">
<!-- 上半部分:实际电流 -->
<div class="data-item">
<div class="value2">{{ item.current }}</div>
<div class="label">实际电流</div>
</div>
<!-- 虚线分隔 -->
<div class="divider"></div>
<!-- 下半部分:实际电压 -->
<div class="data-item">
<div class="value2">{{ item.voltage }}</div>
<div class="label">实际电压</div>
</div>
</div>
<!-- 列标题 -->
<div class="column-title">{{ item.title }}</div>
</div>
</div>
</div>
<div style="width: 20%;height: 100%;">
<div style="width: 100%; height: 100%; position: relative; left: 0vw; top: 0vw;">
<div class="location">
<div class="item" style="margin-bottom: 15px;background-color: #33af3362;">
<div class="name" style="color: #00d200;">在线</div>
<div class="value" style="color: #00d200;">35台</div>
</div>
<div class="item" style="background-color: #ff00005e;">
<div class="name" style="color: #ff0000;">故障</div>
<div class="value" style="color: #ff0000;">0台</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
sysinfo: [],
form: {
},
dataList: [
{ current: '22A', voltage: '220V', title: '1号焊机' },
{ current: '22A', voltage: '220V', title: '2号焊机' },
{ current: '22A', voltage: '220V', title: '5号焊机' },
{ current: '22A', voltage: '220V', title: '8号焊机' },
{ current: '22A', voltage: '220V', title: '带锯床' },
{ current: '22A', voltage: '220V', title: '切坡一体机' }
]
}
},
methods: {
sed(data) {
this.form = data;
},
},
mounted() {
debugger
},
}
</script>
<style lang="scss" scoped>
.title-text {
width: 100%;
height: 3vh;
font-size: 2vh;
font-weight: 600;
color: #fff;
text-align: left;
padding-left: 1vw;
}
.location {
height: 100%;
display: flex;
// border: 2px solid #3879c9;
flex-direction: column;
justify-content: space-between;
// align-items: center;
margin: 0vh 7px 0px 7px;
}
.location2 {
height: 100%;
display: flex;
// border: 2px solid #3879c9;
justify-content: space-between;
// align-items: center;
margin: 0px 0 10px 7px;
}
.box {
flex: 1;
/* 左右各占50%宽度 */
height: 100%;
display: flex;
// flex-direction: column;
/* 内部item上下排列 */
justify-content: space-around;
/* item均匀分布 */
// align-items: center;
/* item水平居中 */
}
.item {
width: 90%;
height: 44%;
border-radius: 5px;
border: 1px solid #67c8fb;
display: flex;
flex-direction: row;
justify-content: space-between;
/* 名称左、数值右 */
align-items: center;
/* 内容垂直居中 */
padding: 0 10px;
/* 内容不贴边框 */
background-color: #062448;
}
/* 名称/数值样式区分 */
.name {
color: #fff;
font-size: 18px;
}
.value {
color: #67c8fb;
font-size: 24px;
font-weight: bold;
}
.container {
display: flex;
flex-wrap: wrap;
gap: 2.4vh;
/* 列之间的间距 */
padding: 1vh;
// background-color: #0a1428;
color: #fff;
}
.column-wrapper {
display: flex;
flex-direction: column;
align-items: center;
// 控制整体列宽
min-width: 8.4vw;
height: 100%;
}
.data-column {
width: 100%;
border: 2px solid #00bfff;
border-radius: 8px;
padding: 2.7vh;
box-sizing: border-box;
text-align: center;
}
.data-item {
// margin-bottom: 16px;
text-align: center;
}
.value2 {
font-size: 3vh;
font-weight: bold;
color: #00bfff;
margin-bottom: 0.4vh;
}
.label {
font-size: 12px;
color: #ccc;
}
.divider {
width: 100%;
height: 1px;
border-top: 1px dashed #00bfff;
margin: 10px 0;
// color: #e30b0ba5;
}
.column-title {
font-size: 14px;
color: #ccc;
margin-top: 10px;
text-align: center;
}
</style>