schangxiang@126.com
2025-09-10 3d43ffa3152110b7823f9fa6320c08a6ae02358a
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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
<template>
    <div class="demonstration">
        <img src="./assets/demonstration/bgImg.png" class="bgImg" alt="">
        <!-- 标题 -->
        <div class="title" @click="fullScreen">
            <img src="./assets/demonstration/titleImg.png" alt="">
            <div class="titleContent">
                广州西门子能源变压器有限公司配变工厂
            </div>
        </div>
        <!-- 左边标题 -->
        <div class="aside">
            <img src="./assets/demonstration/left.png" alt="">
            <div class="asideContent">
                {{currentTime}}
            </div>
        </div>
        <!-- 右边标题 -->
        <div class="aside right">
            <img src="./assets/demonstration/right.png" alt="">
            <div class="asideContent">
                {{weekDay}}
            </div>
        </div>
        <!-- 主题内容区域 -->
        <div class="content">
            <img src="./assets/demonstration/borderImg.png" alt="">
            <!-- 标题 -->
            <div class="insertTitle">
                <img src="./assets/demonstration/insertTitle.png" alt="">
                <div class="insertContent">
                    <span>智能仓库2d动画展示</span>
                </div>
            </div>
            <!-- 左边上办公点 -->
            <div class="workLeft">
                <img src="./assets/demonstration/out.png" alt="">
            </div>
            <!-- 人 -->
            <div class="people">
                <img src="./assets/demonstration/pepple.png" alt="">
            </div>
            <!-- 左边滑带 -->
            <div class="load">
                <img src="./assets/demonstration/load.png" alt="">
            </div>
            <!-- RGV -->
            <div class="rgv" :style="{top:rgv2}">
                <img src="./assets/demonstration/rgv.png" alt="">
            </div>
            <!-- 左边下办公点 -->
            <div class="workLeft" style="top: 36%;">
                <img src="./assets/demonstration/out.png" alt="">
            </div>
            <div class="people peopleLeft">
                <img src="./assets/demonstration/pepple.png" alt="">
            </div>
            <!-- 带键盘的操作 -->
            <div class="mouse">
                <img src="./assets/demonstration/mouse.png" alt="">
            </div>
            <!-- 一根轨道 -->
            <div class="gd">
                <img src="./assets/demonstration/gd.png" alt="">
            </div>
            <!-- 人 -->
            <div class="people peopleLeft2">
                <img src="./assets/demonstration/pepple.png" alt="">
            </div>
            <!-- 左边叉车 -->
            <div class="cc">
                <img src="./assets/demonstration/cc.png" alt="">
            </div>
            <!-- 叉车 -->
            <div class="cc2">
                <img src="./assets/demonstration/cc2.png" alt="">
            </div>
            <div class="cc2 leftcc">
                <img src="./assets/demonstration/cc2.png" alt="">
            </div>
            <!-- 第一排货架 -->
            <div class="hj">
                <!-- 左边货架 -->
                <div class="hj_left">
                    <img src="./assets/demonstration/hjk.png" alt="">
                </div>
                <!-- 中间轨道 -->
                <div class="hj_center">
                    <img src="./assets/demonstration/gd1.png" alt="">
                </div>
                <!-- 右边货架 -->
                <div class="hj_right">
                    <img src="./assets/demonstration/hjk.png" alt="">
                </div>
            </div>
            <!-- 堆垛机轨道 -->
            <div class="ddj_gd">
                <div></div>
                <div></div>
            </div>
            <!-- 堆垛机一号 -->
            <div class="ddj" :style="{left:srm2}">
                <img src="./assets/demonstration/ddj.png" alt="">
            </div>
            <!-- 第二排货架 -->
            <div class="hj hj2">
                <!-- 左边货架 -->
                <div class="hj_left">
                    <img src="./assets/demonstration/hjk.png" alt="">
                </div>
                <!-- 中间轨道 -->
                <div class="hj_center">
                    <img src="./assets/demonstration/gd1.png" alt="">
                </div>
                <!-- 右边货架 -->
                <div class="hj_right">
                    <img src="./assets/demonstration/hjk.png" alt="">
                </div>
            </div>
            <!-- 第三排货架 -->
            <div class="hj hj3">
                <!-- 左边货架 -->
                <div class="hj_left">
                    <img src="./assets/demonstration/hjk.png" alt="">
                </div>
                <!-- 中间轨道 -->
                <div class="hj_center">
                    <img src="./assets/demonstration/gd2.png" alt="">
                </div>
                <!-- 右边货架 -->
                <div class="hj_right">
                    <img src="./assets/demonstration/hjk.png" alt="">
                </div>
            </div>
            <!-- 堆垛机轨道 -->
            <div class="ddj_gd ddj_gd2">
                <div></div>
                <div></div>
            </div>
            <!-- 堆垛机二号 -->
            <div class="ddj ddj2" :style="{left:srm1}">
                <img src="./assets/demonstration/ddj.png" alt="">
            </div>
            <!-- 第四排货架 -->
            <div class="hj hj2 hj4">
                <!-- 左边货架 -->
                <div class="hj_left">
                    <img src="./assets/demonstration/hjk.png" alt="">
                </div>
                <!-- 中间轨道 -->
                <div class="hj_center">
                    <img src="./assets/demonstration/gd2.png" alt="">
                </div>
                <!-- 右边货架 -->
                <div class="hj_right">
                    <img src="./assets/demonstration/hjk.png" alt="">
                </div>
            </div>
            <!-- 右边滑带 -->
            <div class="load load2">
                <img src="./assets/demonstration/load.png" alt="">
            </div>
            <!-- RGV -->
            <div class="rgv rgv2" :style="{top:rgv1}">
                <img src="./assets/demonstration/rgv.png" alt="">
            </div>
            <!-- 右边办公点1 -->
            <div class="workLeft worrkRight">
                <img src="./assets/demonstration/out.png" alt="">
            </div>
            <!-- 物料1 -->
            <div class="mat">
                <img src="./assets/demonstration/mat.png" alt="">
            </div>
            <!-- 右边办公点2 -->
            <div class="workLeft worrkRight worrkRight2">
                <img src="./assets/demonstration/out.png" alt="">
            </div>
            <!-- 物料2 -->
            <div class="mat mat2">
                <img src="./assets/demonstration/mat.png" alt="">
            </div>
            <!-- 带键盘的操作 -->
            <div class="mouse mouse2">
                <img src="./assets/demonstration/mouse.png" alt="">
            </div>
            <!-- 左边框 -->
            <div class="k_left">
                <img src="./assets/demonstration/k_left.png" alt="">
            </div>
            <!-- 叉车人合一 -->
            <div class="ccr">
                <img src="./assets/demonstration/ccr.png" alt="">
            </div>
            <!-- 有边框 -->
            <div class="k_right">
                <img src="./assets/demonstration/k_right.png" alt="">
            </div>
            <!-- 叉车人合一 -->
            <div class="ccr ccr2">
                <img src="./assets/demonstration/ccr.png" alt="">
            </div>
        </div>
        <!-- 出库 -->
        <div class="outer">
            <img src="./assets/demonstration/screen.png" alt="">
            <!-- 当日出库 -->
            <div class="outerContent">当日出库</div>
            <!-- 数量 -->
            <div class="count">{{outerNum}}</div>
        </div>
        <!-- 入库 -->
        <div class="outer inner">
            <img src="./assets/demonstration/screen.png" alt="">
            <!-- 当日出库 -->
            <div class="outerContent">当日入库</div>
            <!-- 数量 -->
            <div class="count">{{innerNum}}</div>
        </div>
    </div>
</template>
<script>
// import request from '@/utils/request'
export default {
  data() {
    return {
      currentTime: '', //当前系统时间
      rgv1: '', //rgv1的位置
      rgv2: '', //rgv2的位置
      srm1: '', //堆垛机一号位置
      srm2: '', //堆垛机二号位置
      val: 1000,
      outerNum: 12345, //出库数量
      innerNum: 23355 //入库数量
    }
  },
  created() {
    //当前时间
    this.setCurrentTime()
    //获取设备位置
    this.everyPosition()
  },
  computed: {
    weekDay() {
      let day = new Date().getDay()
      switch (day) {
        case 0:
          return '星期天'
          break
        case 1:
          return '星期一'
          break
        case 2:
          return '星期二'
          break
        case 3:
          return '星期三'
          break
        case 4:
          return '星期四'
          break
        case 5:
          return '星期五'
          break
        case 6:
          return '星期六'
          break
      }
    }
  },
  methods: {
    //当前时间
    formatTime() {
      let date = new Date()
      //获取年份
      let year = date.getFullYear()
      //获取月份
      let month = date.getMonth() + 1
      month = month >= 10 ? month : '0' + month
      //获取天数
      let day = date.getDate()
      day = day >= 10 ? day : '0' + day
      //获取小时
      let hour = date.getHours()
      hour = hour >= 10 ? hour : '0' + hour
      //获取分钟
      let min = date.getMinutes()
      min = min >= 10 ? min : '0' + min
      //获取秒
      let second = date.getSeconds()
      second = second >= 10 ? second : '0' + second
      //拼接时间字符串
      this.currentTime = `${year}-${month}-${day} ${hour}:${min}:${second}`
    },
    //500ms刷新一次
    setCurrentTime() {
      setInterval(this.formatTime, 500)
    },
    //获取rgv位置
    getPositionList() {
      // const url = '';
      // const params = {};
      // this.common.ajax(url,params,res=>{
      //     if(res.result) {
      //         this.rgv1 = this.getRgvPosition(res.result.rgv1,434,17461,60.5,14.3);
      //         this.rgv2 = this.getRgvPosition(res.result.rgv2,520,17519,63.5,14.3);
      //         this.srm1 = this.getSrmPosition(res.restult.srm1,1488,40819,14.3,78.8);
      //         this.srm2 = this.getSrmPosition(res.restult.srm1,1511,39977,14.3,78.8);
      //         this.outerNum = res.result.exitTaskQty;
      //         this.innerNum = res.result.entryTaskQty;
      //     }else {
      //        the.$message.error(res.Msg);
      //     }
      // })
 
      const url = '/api/task/getPosition'
      const params = {}
      var callback = res => {
        if (res.result === true) {
          this.rgv1 = this.getRgvPosition(res.data[0], 434, 17461, 14.3, 60.5)
          var num = parseInt(res.data[1])
          if (res.data[1] > 9800 && res.data[1] < 12000) {
            num += 400
          }
          this.rgv2 = this.getRgvPosition(num, 520, 17519, 14.3, 63.5)
          this.srm1 = this.getSrmPosition(res.data[2], 1488, 42306, 14.5, 78.8)
          var num2 = parseInt(res.data[3])
          if (res.data[3] > 3041 && res.data[3] < 13611) {
            num2 += 600
          }
          console.log(res.data[3])
          this.srm2 = this.getSrmPosition(num2, 1511, 41469, 14.3, 78.8)
          this.outerNum = res.data[5]
          this.innerNum = res.data[4]
        } else {
          return this.$message.error('获取失败')
        }
      }
      this.common.ajax(url, params, callback, true)
    },
    getPositionList2() {
      // const url = '';
      // const params = {};
      // this.common.ajax(url,params,res=>{
      //     if(res.result) {
      //         this.rgv1 = this.getRgvPosition(res.result.rgv1,434,17461,60.5,14.3);
      //         this.rgv2 = this.getRgvPosition(res.result.rgv2,520,17519,63.5,14.3);
      //         this.srm1 = this.getSrmPosition(res.restult.srm1,1488,40819,14.3,78.8);
      //         this.srm2 = this.getSrmPosition(res.restult.srm1,1511,39977,14.3,78.8);
      //         this.outerNum = res.result.exitTaskQty;
      //         this.innerNum = res.result.entryTaskQty;
      //     }else {
      //        the.$message.error(res.Msg);
      //     }
      // })
 
      const url = '/api/task/getPosition'
      const params = {}
      var callback = res => {
        if (res.result === true) {
          this.rgv1 = this.getRgvPosition(res.data[0], 434, 17461, 14.3, 60.5)
          var num = parseInt(res.data[1])
          if (res.data[1] > 9800 && res.data[1] < 12000) {
            num += 400
          }
          this.rgv2 = this.getRgvPosition(num, 520, 17519, 14.3, 63.5)
          this.srm1 = this.getSrmPosition(res.data[2], 1488, 42306, 14.5, 78.8)
          var num2 = parseInt(res.data[3])
          if (res.data[3] > 3041 && res.data[3] < 13611) {
            num2 += 600
          }
          console.log(res.data[3])
          this.srm2 = this.getSrmPosition(num2, 1511, 41469, 14.3, 78.8)
          this.outerNum = res.data[5]
          this.innerNum = res.data[4]
        } else {
          return this.$message.error('获取失败')
        }
      }
      this.common.ajax(url, params, callback, false)
    },
    //每三秒获取一下设备位置
    everyPosition() {
      setInterval(this.getPositionList, 3000)
      console.log(this.val)
    },
    //rgv的位置计算
    getRgvPosition(current, mins, maxs, maxp, minp) {
      if (current <= mins) {
        return minp + '%'
      } else if (current >= maxs) {
        return maxp + '%'
      } else {
        return (current - mins) * (maxp - minp) / (maxs - mins) + minp + '%'
      }
    },
    //堆垛机位置计算
    getSrmPosition(current, mins, maxs, minp, maxp) {
      if (current <= mins) {
        return minp + '%'
      } else if (current >= maxs) {
        return maxp + '%'
      } else {
        return (current - mins) * (maxp - minp) / (maxs - mins) + minp + '%'
      }
    },
    //全屏展示
    fullScreen() {
      this.$router.push('/demonstration')
    }
  }
}
</script>
<style lang="scss" scoped>
.demonstration {
  width: 100%;
  height: 100%;
  position: relative;
  .bgImg {
    width: 100%;
  }
  .aside {
    position: absolute;
    width: 21%;
    left: 1.5%;
    top: 10px;
    img {
      width: 100%;
    }
    .asideContent {
      position: absolute;
      width: 100%;
      font-size: 15px;
      top: 10%;
      padding-left: 5%;
      box-sizing: border-box;
      color: #00eaff;
      font-weight: bold;
    }
  }
  .right {
    left: 77.5%;
    .asideContent {
      padding-left: 0;
      text-align: center;
    }
  }
  .title {
    position: absolute;
    width: 58%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    img {
      width: 100%;
    }
    .titleContent {
      position: absolute;
      width: 100%;
      left: 0;
      top: 15%;
      font-size: 20px;
      font-weight: 900;
      color: #00eaff;
      text-align: center;
    }
  }
  .content {
    position: absolute;
    width: 96.8%;
    left: 50%;
    top: 8%;
    transform: translateX(-50%);
    img {
      width: 100%;
    }
    .insertTitle {
      position: absolute;
      width: 13.5%;
      left: 1%;
      top: 2%;
      img {
        width: 100%;
      }
      .insertContent {
        position: absolute;
        width: 65%;
        height: 90%;
        left: 0;
        top: 0;
        text-align: center;
        color: #00eaff;
        font-size: 12px;
        font-weight: bold;
        display: flex;
        justify-content: center;
        align-items: center;
      }
    }
    .workLeft {
      position: absolute;
      transform: scale(1, 0.9);
      width: 9%;
      left: 2%;
      top: 14.3%;
      img {
        width: 100%;
      }
    }
    .people {
      position: absolute;
      width: 1.5%;
      left: 6%;
      top: 12%;
      z-index: 10;
      transform: rotate(-180deg);
      img {
        width: 100;
      }
    }
    .load {
      position: absolute;
      width: 3.7%;
      top: 10%;
      left: 10.5%;
      img {
        width: 100%;
      }
    }
    // rgv 二号 左右
    .rgv {
      position: absolute;
      width: 2.5%;
      left: 11.2%;
      top: 63.5%; //14.3%
      transition: all 4s;
      img {
        width: 100%;
      }
    }
    .peopleLeft {
      transform: rotate(0deg);
      left: 3%;
      top: 47%;
    }
    .mouse {
      position: absolute;
      width: 4%;
      left: 6.5%;
      top: 52%;
      transform: rotate(90deg);
      img {
        width: 100%;
      }
    }
    // 两根轨道
    .gd {
      position: absolute;
      width: 8%;
      top: 63%;
      left: 3%;
      img {
        width: 100%;
      }
    }
    // 轨道人
    .peopleLeft2 {
      transform: rotate(180deg);
      left: 5%;
      top: 60%;
    }
    // 叉车
    .cc {
      position: absolute;
      width: 6%;
      left: 3.5%;
      top: 72%;
      transform: rotate(90deg);
      img {
        width: 100%;
      }
    }
    // 右边两个叉车
    .cc2 {
      position: absolute;
      width: 5%;
      left: 14%;
      top: 57%;
      img {
        width: 100%;
      }
    }
    .leftcc {
      top: 62%;
      transform: rotateX(180deg);
    }
    // 货架
    .hj {
      position: absolute;
      width: 75%;
      left: 14.3%;
      top: 14%;
      .hj_left,
      .hj_right {
        width: 8.4%;
        float: left;
        img {
          width: 100%;
        }
      }
      .hj_right {
        float: right;
      }
      .hj_center {
        position: absolute;
        width: 90%;
        left: 50%;
        bottom: 0;
        transform: translateX(-50%);
        img {
          width: 100%;
        }
      }
    }
    .hj2 {
      top: 22.6%;
      .hj_center {
        bottom: 10%;
      }
    }
    // 堆垛机轨道
    .ddj_gd {
      position: absolute;
      width: 70%;
      left: 50%;
      top: 20%;
      transform: translateX(-50%);
      div {
        width: 100%;
        height: 2px;
        background: #ccc;
      }
      div:last-child {
        border-top: 1px dashed #eee;
      }
    }
    // 堆垛机
    .ddj {
      position: absolute;
      width: 10%;
      left: 14.5%;
      top: 18%;
      transition: all 4s;
      img {
        width: 100%;
      }
    }
    // 第三排货架
    .hj3 {
      top: 26.2%;
    }
    .hj4 {
      top: 34.5%;
    }
    .ddj_gd2 {
      top: 32%;
    }
    .ddj2 {
      width: 10%;
      top: 30%;
    }
    .load2 {
      left: 89.2%;
    }
    // 右边工作架
    .worrkRight {
      width: 6%;
      left: 83.2%;
      top: 55%;
      transform: scale(1, 1.6);
    }
    .worrkRight2 {
      left: 93%;
      transform: rotateY(180deg) scale(1, 1.6);
    }
    // 物料
    .mat {
      position: absolute;
      width: 4%;
      left: 86%;
      top: 59%;
      img {
        width: 100%;
      }
    }
    .mat2 {
      left: 92.5%;
    }
    .mouse2 {
      left: 89%;
      top: 73.5%;
      transform: rotate(0);
    }
    // 左边框
    .k_left {
      position: absolute;
      width: 4%;
      left: 84.5%;
      top: 73%;
      img {
        width: 100%;
      }
    }
    // 叉车和人
    .ccr {
      position: absolute;
      width: 6%;
      left: 80%;
      top: 74%;
      transform: rotate(90deg);
      img {
        width: 100%;
      }
    }
    // 右边框
    .k_right {
      position: absolute;
      width: 3%;
      left: 93.5%;
      top: 73%;
      img {
        width: 100%;
      }
    }
    .ccr2 {
      left: 95%;
    }
    // rgv一号
    .rgv2 {
      left: 89.8%;
      top: 60.5%; //14.3
      z-index: 10;
    }
  }
  // 出库
  .outer {
    position: absolute;
    width: 20%;
    left: 25%;
    top: 58%;
    img {
      width: 100%;
    }
    .outerContent {
      position: absolute;
      width: 80%;
      left: 10%;
      top: 15%;
      font-size: 20px;
      color: #00eaff;
      text-align: center;
      font-weight: bold;
    }
    .count {
      position: absolute;
      width: 80%;
      left: 10%;
      top: 40%;
      font-size: 50px;
      color: #fff;
      text-align: center;
      font-weight: 500;
    }
  }
  .inner {
    left: 56%;
  }
}
</style>