1
huanghongfeng
2025-09-12 a1a0c91857b670152ec7d4afa7bc4140953a5e98
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
<template>
  <div id="index" ref="appRef">
    <div class="bg">
      <dv-loading v-if="loading">Loading...</dv-loading>
      <div v-else class="host-body">
        <div class="d-flex jc-center">
          <dv-decoration-10 class="dv-dec-10" />
          <div class="d-flex jc-center">
            <dv-decoration-8 class="dv-dec-8" :color="['#568aea', '#000000']" />
            <div class="title">
              <span class="title-text">中车数据大屏</span>
              <dv-decoration-6 class="dv-dec-6" :reverse="true" :color="['#50e3c2', '#67a1e5']" />
            </div>
            <dv-decoration-8 class="dv-dec-8" :reverse="true" :color="['#568aea', '#000000']" />
          </div>
          <dv-decoration-10 class="dv-dec-10-s" />
        </div>
 
        <!-- 第二行 -->
        <div class="d-flex jc-between px-2">
          <div class="d-flex aside-width">
            <div class="react-left ml-4 react-l-s">
              <span class="react-before"></span>
              <span class="text">设备运行状态</span>
            </div>
            <div class="react-right ml-3">
              <span class="text">货位信息统计</span>
            </div>
          </div>
          <div class="d-flex aside-width">
            <div class="react-right bg-color-blue mr-3">
              <span class="text fw-b">检修信息统计</span>
            </div>
            <div class="react-right mr-4 react-l-s">
              <span class="react-after"></span>
              <!-- <span class="text">{{ dateYear }} {{ dateWeek }} {{ dateDay }}</span> -->
            </div>
          </div>
        </div>
 
        <div style="margin-top: 30px;display: flex;">
          <div style="width: 75%;">
            <!-- 第三行数据 -->
            <div style="display: flex;width: 100%;">
 
              <!-- ===================================出入库口=================================== -->
              <div class="container">
                <div class="flex-container">
                  <div style="display: flex; justify-content: space-between;">
                    <div v-for="(item, index) in plcData" :key="index" style="margin-left: 1px; width: 35%;">
                      <div style="height: 90px; position: relative; margin-top: 5%; opacity: 0.8;" :style="{
                        background: item.handShake ? '#228B22' : '#00ffff',
                        transition: 'background 3s ease-in-out'
                      }">
                        <div v-show="item.handShake"
                          style="position: absolute; width: 50px; height: 50px; background-color: goldenrod; border-radius: 10px; top: 50%; left: 50%; transform: translate(-50%, -50%); animation: fadeIn 3s ease-in-out;">
                        </div>
                        <div v-show="!item.handShake"
                          style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 16px; color: #000;">
                        </div>
                        <img src="../assets/linesd.png" class="image" style="height: 90px;" />
                      </div>
                    </div>
                  </div>
 
 
 
                </div>
              </div>
              <!-- ===================================出入库口=================================== -->
 
              <div style="width: 62%;height: 560px;">
 
 
 
                <!--=========================================================货架与堆垛机部分=======================================================-->
                <div style="width: 100%;height: 425px;">
 
                   <div class="grid-container">
                    <div v-for="(item, index) in gridItems.slice(108, 216)" :key="index" class="grid-item"
                      :style="{ 'background-color': GetBgColor(item) }">
                    </div>
                  </div>
 
 
                  <div style="border: 1px solid #fff;width: 100%;height: 85px;background-color: #000;">
                    <div :style="{
                      background: !plcData6 ? '#228B22' : '#00ffff',
                      transition: 'background 3s ease-in-out',
                      width: '10%',
                      height: '70px',
                      marginTop: '7px',
                      transition: 'margin-left 10s ease',  // 添加动画效果,平滑过渡
                      marginLeft: !plcData6 ? '85%' : '1%',  // 计算margin-left,根据ddjSC值控制位置
                      display: 'flex',
                      justifyContent: 'center',
                      alignItems: 'center',
                      borderRadius: '10px'
                    }" :class="{ 'moving': !plcData6 }">
                      <img src="../assets/ddj.png" style="height: 55px;" />
                    </div>
                  </div>
 
 
                  <div class="grid-container">
                    <div v-for="(item, index) in gridItems.slice(0, 108)" :key="index" class="grid-item" :style="{
                      'background-color': GetBgColor(item),//hidden
                      'visibility': index === 100 || index === 101 || index === 96 || index === 97 ? 'hidden' : 'visible'
                    }">
                   
                    </div>
                  </div>
                </div>
                <!--=========================================================货架与堆垛机部分=======================================================-->
 
 
                <!--=========================================================检修出入库站台部分=======================================================-->
                <div
                  style="width: 100%;height: 100px;display: flex;margin: 15px auto; justify-content: space-around; align-items: center;">
 
 
                  <div v-for="(item, index) in plcData3" :key="index" style="width: 20%; height: 85px;">
                    <div style="height: 90px; position: relative; margin-top: 5%; opacity: 0.8;" :style="{
                      background: item.handShake ? '#228B22' : '#00ffff',
                      transition: 'background 3s ease-in-out'
                    }">
                      <div v-show="item.handShake"
                        style="position: absolute; width: 50px; height: 50px; background-color: goldenrod; border-radius: 10px; top: 50%; left: 50%; transform: translate(-50%, -50%); animation: fadeIn 3s ease-in-out;">
                      </div>
                      <div v-show="!item.handShake"
                        style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 16px; color: #000;">
                      </div>
                      <img src="../assets/lines.png" class="image" style="height: 90px;" />
                    </div>
                  </div>
 
                </div>
                <!--=========================================================检修出入库站台部分=======================================================-->
              </div>
 
 
 
              <!--=========================================================出库站台部分=======================================================-->
              <div style="width: 23%;margin-top: 165px;">
                <div class="flex-container">
                  <div style="display: flex; justify-content: space-between;">
                    <div v-for="(item, index) in plcData2" :key="index" style="margin-left: 1px; width: 35%;">
                      <div style="height: 90px; position: relative; margin-top: 5%; opacity: 0.8;" :style="{
                        background: item.handShake ? '#228B22' : '#00ffff',
                        transition: 'background 3s ease-in-out'
                      }">
                        <div v-show="item.handShake"
                          style="position: absolute; width: 50px; height: 50px; background-color: goldenrod; border-radius: 10px; top: 50%; left: 50%; transform: translate(-50%, -50%); animation: fadeIn 3s ease-in-out;">
                        </div>
                        <div v-show="!item.handShake"
                          style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 16px; color: #000;">
                        </div>
                        <img src="../assets/linesd.png" class="image" style="height: 90px;" />
                      </div>
                    </div>
                  </div>
                </div>
              </div>
              <!--=========================================================出库站台部分=======================================================-->
 
            </div>
 
 
 
            <div>
              <!--=========================================================RGV部分=======================================================-->
              <div style="border: 1px solid #fff;width: 87%;height: 85px;margin: auto; position: relative;">
                <div style="width: 14%; height: 85px;position: relative;" :style="{
                  background: plcData5 ? '#228B22' : '#00ffff',
                  transition: 'background 3s ease-in-out',
                  marginLeft: plcData5 ? '86%' : '1%',
                }" :class="{ 'moving': plcData5 }">
 
                  <div v-show="plcData5"
                    style="position: absolute; width: 50px; height: 50px; background-color: goldenrod; border-radius: 10px; top: 50%; left: 50%; transform: translate(-50%, -50%); animation: fadeIn 3s ease-in-out;">
                  </div>
 
                  <div v-show="!plcData5"
                    style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 16px; color: #000;">
                    
                  </div>
 
                  <img src="../assets/lines.png" class="image" style="height: 90px;" />
                </div>
              </div>
              <!--=========================================================RGV部分=======================================================-->
 
              <!--=========================================================第一检修台=======================================================-->
              <centerRight2 :plcData4="plcData4" />
            </div>
 
          </div>
 
          <div style="width: 25%;margin-left: 10px;">
            <div style="height: 450px;width: 100%;margin-top: 20px;color: #000;">
              <dv-border-box-12>
                <centerLeft1 />
              </dv-border-box-12>
            </div>
 
            <div style="height: 430px;width: 100%;margin-top: 20px;color: #000;">
              <dv-border-box-12 style="width: 100%;">
                <bottomLeft />
              </dv-border-box-12>
            </div>
          </div>
        </div>
      </div>
 
 
    </div>
  </div>
</template>
 
<script>
import drawMixin from "../utils/drawMixin";
import { formatTime } from '../utils/index.js'
import centerLeft1 from './centerLeft1'
import centerLeft2 from './centerLeft2'
import centerRight2 from './centerRight2'
 
import center from './center'
import bottomLeft from './bottomLeft'
import axios from 'axios'
 
export default {
  mixins: [drawMixin],
  data() {
    return {
      timing: null,
      loading: true,
      dateDay: null,
      dateYear: null,
      dateWeek: null,
      weekday: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
      ddjSC: false,
      plcData: [],
      plcData2: [],
      plcData3: [],
      plcData4:[],
      plcData5:false,
      gridItems: [],  // 初始化为空数组
      plcData6:false,
      infoMsg: [
        { bgcolor: "rgba(255, 255, 255, 0)", msg: "空货位", state: "0" },
        { bgcolor: "#ff0", msg: "出入库锁定", state: "1" },
        //{ bgcolor: "#FFA500", msg: "有货", state: "2" },
        { bgcolor: "rgba(0, 255, 0, 1)", msg: "合格", state: "12" },
        { bgcolor: "#FF6347", msg: "待修", state: "11" },
        { bgcolor: "#4C6E91", msg: "空托锁定", state: "98" },
        { bgcolor: "#f0f0f0", msg: "空托盘", state: "99" },
        { bgcolor: "#FF0000", msg: "禁用", state: "100" }
      ],
    }
  },
  components: {
    centerLeft1,
    centerLeft2,
    centerRight2,
    center,
    bottomLeft,
  },
  
  beforeDestroy() {
    clearInterval(this.timing)
  },
  methods: {
    timeFn() {
      this.timing = setInterval(() => {
        this.dateDay = formatTime(new Date(), 'HH: mm: ss')
        this.dateYear = formatTime(new Date(), 'yyyy-MM-dd')
        this.dateWeek = this.weekday[new Date().getDay()];
        this.loadLocalData();
      }, 2000)
    },
 
    cancelLoading() {
      setTimeout(() => {
        this.loading = false
      }, 1000)
    },
    toggleMovement() {
      axios.post("http://10.78.70.112:8099/api/Task/EquipmentInformation").then((res) => {
        this.plcData = res.data.storage_platform;
        this.plcData2 = res.data.outbound_platform;
        this.plcData3=res.data.agv_platform;
        this.plcData4=res.data.maintenance_platform;
        this.plcData5=res.data.agv_plat[0].handShake;
        
      }).catch((res) => {
        
      })
    },
    GetBgColor(col) {
      let bgColor = "#b7ba6b";
      // 优先显示禁用状态
      if (col.location_lock) {
        this.infoMsg.forEach((el) => {
          if (el.state == "100") {
            bgColor = el.bgcolor;
          }
        });
      } else {
        this.infoMsg.forEach((el) => {
          if (el.state == col.location_state) {
            bgColor = el.bgcolor;
            
          }
        });
      }
      return bgColor;
    },
    loadLocalData() {
     axios.post("http://10.78.70.112:8098/api/Task/GetLocationStatu2").then((x) => {
      // axios.post("http://127.0.0.1:9290/api/Task/GetLocationStatu2").then((x) => {
        this.gridItems=[]
        this.gridItems = x.data;
      })
    },
    loadLocalSC() {
      axios.post("http://10.78.70.112:8099/api/Task/EquipmentInformationsc").then((res) => {
        this.plcData6 = res.data;
      })
    }
  },
  mounted() {
    document.title = '中车显示大屏';
    this.timeFn();
    this.loadLocalData(); 
    this.cancelLoading()
    this.toggleMovement();
    setInterval(() => {
      this.toggleMovement();
      this.loadLocalSC()
    }, 2000);
 
    
    //this.loadLocalSC();
    // this.interval2 = setInterval(() => {
    //   this.loadLocalData();
      
    // }, 2000);
    // this.interval = setInterval(() => {
    //   this.loadLocalSC();
    // }, 20000);
  },
}
</script>
 
<style lang="scss">
@import '../assets/scss/index.scss';
 
@keyframes move {
  0% {
    margin-left: 1%;
  }
  30% {
    margin-left: 40%;
  }
  50% {
    margin-left: 86%;
  }
  100% {
    margin-left: 1%;
  }
}
 
.moving {
  animation: move 14s infinite ease-in-out;
  color: green;
}
.scroll-container {
  width: 85%;
  height: 95px;
  margin: 5px auto;
  border: 1px solid #fff;
  overflow-y: auto;
  /* 添加垂直滚动条 */
  display: flex;
  flex-direction: column;
  /* 垂直排列子元素 */
}
 
.scroll-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 95px;
  border-bottom: 1px solid #ddd;
  background-color: aqua;
}
 
.scroll-item img {
  height: 70%;
  margin-right: 10px;
}
 
.scroll-item p {
  margin: 0;
}
</style>