foodConten.vue
2.44 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
<template>
<div class="stacker-status-container">
<!-- 顶部标题栏 -->
<div class="status-header">
<span class="div-span-title">堆垛机状态(当前)</span>
<div class="status-legend">
<div class="legend-item">
<span class="legend-color color-run"></span>
<span>运行</span>
</div>
<div class="legend-item">
<span class="legend-color color-idle"></span>
<span>待机</span>
</div>
<div class="legend-item">
<span class="legend-color color-error"></span>
<span>故障</span>
</div>
</div>
</div>
<!-- 主体内容区 -->
<div id="status-chart"></div>
</div>
</template>
<script>
export default {
data() {
return {
sysData: {},
initDataList: [],
dianLiangOne: window.dianLiangOne,
}
},
methods: {
// 生产情况
getData(data) {
let tempData = [
{ value: data.srmEquipmentRecords.run, itemStyle: { color: '#00e068' } }, // 运行:绿色
{ value: data.srmEquipmentRecords.free, itemStyle: { color: '#ffb800' } }, // 待机:橙色
{ value: data.srmEquipmentRecords.error, itemStyle: { color: '#ff3333' } }, // 故障:红色
]
// 初始化ECharts实例
let myChart = this.$echarts.init(document.getElementById('status-chart'))
this.dianLiangOne.series[0].data = tempData
myChart.clear()
myChart.setOption(this.dianLiangOne)
window.onresize = myChart.resize
},
},
mounted() {
// this.getData()
//eslint-disable-next-line no-debugger
debugger
},
}
</script>
<style scoped>
/* 最外层容器:深色背景,和截图一致 */
.stacker-status-container {
width: 32vw;
height: 22vw;
border: 1px solid #1e3a7a;
border-radius: 0.3vw;
/* padding: 1.5vw; */
position: relative;
overflow: hidden;
}
/* 顶部标题栏 */
.status-header {
width: 100%;
height: 3vw;
display: flex;
padding: 0.2vw 0 0 0.5vw;
}
/* 状态图例 */
.status-legend {
display: flex;
font-size: 1.8vw;
color: #ffffff;
margin: -1.6vw 0 0 4vw;
}
.legend-item {
display: flex;
align-items: center;
gap: 0.5vw;
font-size: 1.1vw;
}
.legend-color {
width: 1vw;
height: 1vw;
border-radius: 0.2vw;
margin-left: 1vw;
}
.color-run {
background-color: #00e068;
}
.color-idle {
background-color: #ffb800;
}
.color-error {
background-color: #ff3333;
}
.color-offline {
background-color: #888888;
}
/* 主体内容区:左右分栏 */
#status-chart {
width: 100%;
height: calc(100%);
display: flex;
align-items: center;
/* gap: 3vw; */
}
</style>