AgvLine.vue
6.21 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
<template>
<div class="app-body">
<Header title="AGV可视化" ></Header>
<div class="dv-content-body">
<!-- 顶部头表 -->
<div class="dv-content-body-bottom-list">
<dv-border-box-8 :dur="35" :color="[, '#ffffff']">
<div style="width: 100;height: 5%;">
<!-- <span class="div-span-title">AGV路线图</span> -->
</div>
<div style="display: flex; width: 100%;height: 90%;position: relative;">
<div style="color: white;margin-left: 1vw;">
<div
style="display: flex;
justify-content: flex-start;
align-items: center;"
>
<div style="width: 1vw;height: 1vw;background: #98afdb;"></div>
<div
style=" font-size: 1vw;
width: 8vw;
margin-left: 0.3vw; "
>
过道
</div>
</div>
<div
style="display: flex;
justify-content: flex-start;
align-items: center;"
>
<div style="width: 1vw;height: 1vw;background: #006fdf;"></div>
<div
style=" font-size: 1vw;
width: 8vw;
margin-left: 0.3vw; "
>
AGV站点
</div>
</div>
<div
style="display: flex;
justify-content: flex-start;
align-items: center;"
>
<div style="width: 1vw;height: 1vw;background: #ff0000;"></div>
<div
style=" font-size: 1vw;
width: 8vw;
margin-left: 0.3vw; "
>
立库区点位
</div>
</div>
<div
style="display: flex;
justify-content: flex-start;
align-items: center;"
>
<div style="width: 1vw;height: 1vw;background: #90ee90;"></div>
<div
style=" font-size: 1vw;
width: 8vw;
margin-left: 0.3vw; "
>
充电桩点位
</div>
</div>
</div>
<div style="width: 100%;height: 90%;position: relative;left: -5vw;top: 2vw;">
<div id="bubble-container"></div>
</div>
</div>
</dv-border-box-8>
</div>
</div>
</div>
</template>
<script>
import Header from '@/layout/appHead'
import headLeft from '@/components/headLeft'
import headRight from '@/components/headRight'
import footerLeft from '@/components/footerLeft'
import footerCenter from '@/components/footerCenter'
import footerRight from '@/components/footerRight'
export default {
data() {
return {
baseUrlOff: 'http://127.0.0.1:6001/api/BulletinBoard/Mes/V1/ReadData1',
baseUrlOnLine: window.appConfig.baseUrlint,
sysData: {},
sysInitTimeNum: 55,
sysTimeNum: 55,
sysinfo: [],
}
},
components: {
Header,
headLeft,
headRight,
footerLeft,
footerCenter,
footerRight,
},
methods: {
getAGVData() {
let opt = {
urlSuffix: window.baseOnLineOrOff ? this.baseUrlOnLine : this.baseUrlOff,
// urlSuffix: 'http://127.0.0.1:6001/api/BulletinBoard/Mes/V1/ReadData1',
logTitle: 'AGV-位置状态',
isUrlALL: true,
headers: window.baseOnLineOrOff,
header: window.baseOnLineOrOff,
isHanderAjaxSuccessActionLoad: true,
}
let callBackFn = (res) => {
if (!this.ajaxSuccessDataBeforeFour(res, opt.logTitle)) return
setTimeout(() => {
this.sed()
}, 300)
}
''.ajax(this, opt, callBackFn)
},
ajaxSuccessDataBeforeFour(res, title) {
if (res.data.data == null || res.data.data.length == 0) {
this.sysData = []
''.Log(title + '无数据', 'getData')
return false
}
return true
},
sed() {
this.agvLineData = this.sysData
var agvLineDatas = this.agvLineData
if (agvLineDatas) {
function formatMarkInfo(agvLineDatas) {
return agvLineDatas.map((item) => ({
id: `a_${item.landmark}`,
taskNumber: item.taskNo,
carCode: item.agvNumber,
speed: item.speed,
status: item.status,
startLandmark: item.startLandmark,
endLandmark: item.endLandmark,
battery: item.battery,
}))
}
var markInfos = formatMarkInfo(agvLineDatas)
window.findMarkInfo(markInfos, this.sysinfo)
this.sysinfo = markInfos
}
},
intInterval: function() {
''.intInterval(this, this.sysInitTimeNum, () => {
this.getAGVData()
})
},
},
mounted() {
debugger
let coordinatelist = window.coordinatelist
let agvMarkList = []
coordinatelist.forEach((i) => {
agvMarkList.push({ ...i, top: i.y * 1.2 + 'vw', left: i.x * 1.2 + 2 + 'vw' })
})
window.initMarksLine('#bubble-container', agvMarkList)
this.getAGVData()
this.intInterval()
},
}
</script>
<style lang="scss" scoped>
.app-body {
height: 100%;
width: 100%;
.dv-content-body {
height: 90%;
width: 100%;
// background: rebeccapurple;
}
.dv-content-body-head-list {
display: flex;
justify-content: space-between;
align-items: center;
height: 20%;
}
.dv-content-body-bottom-list {
width: 98.8%;
display: flex;
height: 100%;
justify-content: space-between;
align-items: center;
margin: auto;
}
}
</style>
<style lang="scss">
.bubble {
position: absolute;
border: 1px solid yellow;
top: -11.5vh;
left: 230%;
transform: translateX(-50%);
background: transparent;
border-radius: 8px;
display: inline-block;
width: 8vw;
animation: blink 13s infinite;
background-color: #010e2b;
z-index: 99;
//overflow: hidden; /* 添加这一行 */
}
.bubble::before {
content: '';
position: absolute;
top: 107%;
left: 19%;
transform: translateX(-50%);
width: 4%;
height: 4px;
background-color: red;
border-style: solid;
border-radius: 50%;
animation: pulse 1s infinite;
z-index: 2;
opacity: 0; /* 添加这一行 */
transition: opacity 0.5s; /* 添加这一行 */
}
.bubble.show::before {
opacity: 1; /* 添加这一行 */
}
@keyframes blink {
0% {
opacity: 1;
}
50% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@keyframes pulse {
0% {
transform: scale(1);
opacity: 1;
}
100% {
transform: scale(2);
opacity: 0;
}
}
</style>