DeviceData.vue
24.5 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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<template>
<el-container>
<div class="card-container">
<el-card class="box-card" v-for="(item, index) in srmList">
<div class="container">
<el-row class="row-root">
<span class="big-span">{{item.name}}</span> 一 <span>{{item.disable==false?"启用":"禁用"}}</span>
</el-row>
<el-divider></el-divider>
<el-descriptions :column="3" size="mini" border>
<el-descriptions-item label-class-name="descriptions-label" label="操作模式"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="水平测距"><el-tag size="small" :type="item.horizontalDistance==null?'danger':''">{{ item.horizontalDistance==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="起升测距"><el-tag size="small" :type="item.verticalDistance==null?'danger':''">{{ item.verticalDistance==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="是否转轨模式"><el-tag size="small" :type="item.expendMode==null?'danger':''">{{ item.expendMode==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="最大列"><el-tag size="small" :type="item.manageSmallColumn==null?'danger':''">{{ item.manageSmallColumn==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="最小列"><el-tag size="small" :type="item.manageMaxColumn==null?'danger':''">{{ item.manageMaxColumn==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="货叉标志"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="总故障" span="2"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="设备行走" span="3">
<el-row>
<el-col :span="8">
列:<el-input placeholder="请输入列" style="width: 80px;" size="mini" v-model="input1"></el-input>
</el-col>
<el-col :span="8">
层:<el-input placeholder="请输入层" style="width: 80px;" size="mini" v-model="input1"></el-input>
</el-col>
<el-col :span="8" style="display: flex; align-items: center;">
<el-button type="warning" size="mini">行走任务</el-button>
</el-col>
</el-row>
</el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="操作" span="3">
<el-button type="warning" size="mini">重新下发</el-button>
<el-button type="warning" size="mini">空取</el-button>
<el-button type="warning" size="mini">重入</el-button>
<el-button type="warning" size="mini">取货错误</el-button>
</el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="操作">
<el-button type="danger" size="mini">货叉1任务删除</el-button>
</el-descriptions-item>
</el-descriptions>
<el-tabs :active-name="srmList.length > 0 ? 'one' + srmList[0].name : ''" type="card" @tab-click="handleClick">
<el-tab-pane label="报警" :name="'one' + item.name" >
<div style="overflow-y: auto;height:35.7vh">
<el-alert
v-for="item in 40"
title="错误提示的文案"
type="error"
show-icon
:closable="false"
style="margin-bottom: 5px">
</el-alert>
</div>
</el-tab-pane>
<el-tab-pane label="货叉1数据" :name="'two' + item.name">
<el-divider content-position="center">PLC</el-divider>
<el-descriptions :column="3" size="mini" border>
<el-descriptions-item label-class-name="descriptions-label" label="货叉测距"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="是否有货"><el-tag size="small" :type="item.horizontalDistance==null?'danger':''">{{ item.horizontalDistance==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="货叉是否在中心"><el-tag size="small" :type="item.verticalDistance==null?'danger':''">{{ item.verticalDistance==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="排"><el-tag size="small" :type="item.expendMode==null?'danger':''">{{ item.expendMode==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="列"><el-tag size="small" :type="item.manageSmallColumn==null?'danger':''">{{ item.manageSmallColumn==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="层"><el-tag size="small" :type="item.manageMaxColumn==null?'danger':''">{{ item.manageMaxColumn==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="任务状态"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="任务类型"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="任务号"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="取货排"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="取货列"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="取货层"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="放货排"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="放货列"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="放货层"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="是否故障"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="屏蔽"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
</el-descriptions>
<el-divider content-position="center">WCS</el-divider>
<el-descriptions :column="3" size="mini" border>
<el-descriptions-item label-class-name="descriptions-label" label="任务类型"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="叠盘索引"><el-tag size="small" :type="item.horizontalDistance==null?'danger':''">{{ item.horizontalDistance==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="任务号"><el-tag size="small" :type="item.verticalDistance==null?'danger':''">{{ item.verticalDistance==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="取货排"><el-tag size="small" :type="item.expendMode==null?'danger':''">{{ item.expendMode==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="取货列"><el-tag size="small" :type="item.manageSmallColumn==null?'danger':''">{{ item.manageSmallColumn==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="取货层"><el-tag size="small" :type="item.manageMaxColumn==null?'danger':''">{{ item.manageMaxColumn==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="放货排"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="放货列"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="放货层"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
</el-descriptions>
</el-tab-pane>
</el-tabs>
</div>
</el-card>
<el-card class="box-card" v-for="item in rgvList">
<div class="container">
<el-row class="row-root">
<span class="big-span">{{item.name}}</span> 一 <span>{{item.disable==false?"启用":"禁用"}}</span>
</el-row>
<el-divider></el-divider>
<el-descriptions :column="3" size="mini" border>
<el-descriptions-item label-class-name="descriptions-label" label="操作模式"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="水平测距"><el-tag size="small" :type="item.horizontalDistance==null?'danger':''">{{ item.horizontalDistance==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="当前位置"><el-tag size="small" :type="item.verticalDistance==null?'danger':''">{{ item.verticalDistance==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="总故障"><el-tag size="small" :type="item.expendMode==null?'danger':''">{{ item.expendMode==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="最小位置"><el-tag size="small" :type="item.manageSmallColumn==null?'danger':''">{{ item.manageSmallColumn==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="最大位置"><el-tag size="small" :type="item.manageMaxColumn==null?'danger':''">{{ item.manageMaxColumn==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="操作" span="3">
<el-button type="warning" size="mini">重新下发</el-button>
</el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="操作">
<el-button type="danger" size="mini">货叉1任务删除</el-button>
<el-button type="danger" size="mini">货叉2任务删除</el-button>
</el-descriptions-item>
</el-descriptions>
<el-tabs :active-name="rgvList.length > 0 ? 'one' + rgvList[0].name : ''" type="card" @tab-click="handleClick">
<el-tab-pane label="报警" :name="'one' + item.name">
<div style="overflow-y: auto;height:42.5vh">
<el-alert
v-for="item in 30"
title="错误提示的文案"
type="error"
show-icon
:closable="false"
style="margin-bottom: 5px">
</el-alert>
</div>
</el-tab-pane>
<el-tab-pane label="货叉1数据" :name="'two' + item.name">
<el-divider content-position="center">PLC</el-divider>
<el-descriptions :column="3" size="mini" border>
<el-descriptions-item label-class-name="descriptions-label" label="有无货" span='3'><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="任务状态"><el-tag size="small" :type="item.horizontalDistance==null?'danger':''">{{ item.horizontalDistance==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="任务类型"><el-tag size="small" :type="item.verticalDistance==null?'danger':''">{{ item.verticalDistance==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="任务号"><el-tag size="small" :type="item.expendMode==null?'danger':''">{{ item.expendMode==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="取货排"><el-tag size="small" :type="item.manageSmallColumn==null?'danger':''">{{ item.manageSmallColumn==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="取货列"><el-tag size="small" :type="item.manageMaxColumn==null?'danger':''">{{ item.manageMaxColumn==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="取货层"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="放货排"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="放货列"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="放货层"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="长"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="宽"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="高"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="重"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="货物类型"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="条码"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
</el-descriptions>
<el-divider content-position="center">WCS</el-divider>
<el-descriptions :column="3" size="mini" border>
<el-descriptions-item label-class-name="descriptions-label" label="任务类型"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="任务号" span='2'><el-tag size="small" :type="item.horizontalDistance==null?'danger':''">{{ item.horizontalDistance==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="取货排"><el-tag size="small" :type="item.verticalDistance==null?'danger':''">{{ item.verticalDistance==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="取货列"><el-tag size="small" :type="item.expendMode==null?'danger':''">{{ item.expendMode==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="取货层"><el-tag size="small" :type="item.manageSmallColumn==null?'danger':''">{{ item.manageSmallColumn==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="放货排"><el-tag size="small" :type="item.manageMaxColumn==null?'danger':''">{{ item.manageMaxColumn==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="放货列"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="放货层"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="长"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="宽"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="高"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="重"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="货物类型"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label="条码"><el-tag size="small" :type="item.operationModel==null?'danger':''">{{ item.operationModel==null?'未获取':item.operationModel }}</el-tag></el-descriptions-item>
</el-descriptions>
</el-tab-pane>
</el-tabs>
</div>
</el-card>
<el-divider></el-divider>
</div>
</el-container>
</template>
<script>
import { getRGVInfo, getSRMInfo } from "@/api/main";
export default {
name: "DeviceData",
data() {
return {
srmList: [],
rgvList: [],
interval: null,
isCurrentTab: false,
};
},
props: {
// 定义接收的 startDeal 变量
startDeal: {
type: Boolean,
default: false,
},
},
watch: {
// 监听 startDeal 变量的变化
startDeal(newValue, oldValue) {
console.log('处理状态发生变化:', newValue);
// 可以在这里添加处理逻辑
},
},
beforeDestroy() {
clearInterval(this.interval)
},
mounted() {
// this.start();
},
methods: {
//开始刷新数据
start(){
this.isCurrentTab = true;
if(this.startDeal) {
this.interval = setInterval(() => {
getSRMInfo().then((response) => {
this.srmList = response.data;
this.srmList = [...this.srmList,...this.srmList,...this.srmList,...this.srmList,...this.srmList,...this.srmList,...this.srmList,...this.srmList,...this.srmList,...this.srmList,...this.srmList];
});
getRGVInfo().then((response) => {
this.rgvList = response.data;
this.rgvList = [...this.rgvList,...this.rgvList,...this.rgvList,...this.rgvList];
});
}, 1000)
};
},
//停止刷新数据
stop(){
this.isCurrentTab = false;
clearInterval(this.interval)
}
},
};
</script>
<style lang="scss" scoped>
.box-card {
width: 30vw;
// height: 72vh;
margin-left: 10px;
margin-bottom: 10px;
overflow-y: auto;
}
// 新增的容器样式
.card-container {
display: flex;
flex-wrap: wrap; // 允许元素换行
max-height: 75vh; // 设置最大高度,超出显示滚动条
overflow-y: auto; // 超出最大高度时显示纵向滚动条
}
.container{
text-align: center;
}
.row-root{
color:blue;
font-weight: bolder;
margin-bottom: -10px;
}
.big-span{
font-size: 16pt;
}
</style>
<style>
.descriptions-label {
text-align: right !important;
/* color:black !important; */
}
.el-divider--horizontal {
margin: 12px 0px;
}
</style>