headCenter.vue
2.86 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
<template>
<div>
<div class="title-text">仓库设备目前状态</div>
<div class="location">
<div class="item" v-for="(item, index) in tableList" :key="index">
<div>
<span>{{ item.type }}: </span>
<span class="infoStle-normal">{{ item.name }}</span>
</div>
<div>
<span>运行状态: </span>
<span :class="eqName(item.status)">{{ item.status }}</span>
</div>
<div>
<span>报警信息: </span>
<span :class="eqInfo(item.status)">{{ item.info }}</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
tableList: []
}
},
methods: {
getData(data) {
this.tableList = data
},
createChartId(index) {
return 'main_' + index
},
eqName(name) {
if (name == '待机') {
return 'agvStle-yolle'
} else if (name == '任务执行中') {
return 'agvStle-status'
} else if (name == '故障') {
return 'agvStle-error'
} else if (name == '运行') {
return 'agvStle-run'
}
},
eqInfo(name) {
if (name == '故障') {
return 'infoStle-error'
} else {
return 'infoStle-normal'
}
},
battery() {
setTimeout(() => {
for (let i = 0; i < this.contents.length; i++) {
let myChart = this.$echarts.init(document.getElementById('main_' + i))
dianLiangOne.series[1].data = [this.contents[i].powerLevel]
myChart.clear()
myChart.setOption(dianLiangOne)
window.onresize = myChart.resize
}
}, 200)
},
getTaskText(typeCode) {
switch (typeCode) {
case 0:
return '无任务'
case 1:
return '取货'
case 2:
return '放货'
case 3:
return '充电'
case 4:
return '行走'
}
},
},
mounted() {
// this.battery()
// this.getAGVDataTwo()
// this.getAGVDataThere()
// this.intInterval()
},
}
</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: 90%;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: repeat(2, 1fr);
gap: 0px;
padding: 0px;
box-sizing: border-box;
}
.item {
padding: 0vh 1vh 1vh 2vh;
color: #fff;
font-size: 2vh;
display: flex;
flex-direction: column;
justify-content: center;
>div {
margin-bottom: 5px;
&:last-child {
margin-bottom: 0vh;
}
}
}
// .multiline-ellipsis {
// display: inline-block;
// /* 必须有宽度限制,inline 元素无法限制宽度 */
// max-width: 200px;
// /* 根据你的布局调整 */
// white-space: nowrap;
// overflow: hidden;
// text-overflow: ellipsis;
// }
.agvStle-run {
font-size: 1.9vh !important;
color: #00d384;
}
.agvStle-error {
font-size: 1.9vh !important;
color: #ff5447;
}
.infoStle-normal {
font-size: 1.9vh !important;
color: #fff;
}
.infoStle-error {
font-size: 1.9vh !important;
color: #ff5447;
}
</style>