#
whycq
2022-05-16 d36ff3f80b4891f56342d5fb6bcc4390497ae348
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
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
<template>
    <view class="container">
        <view class="floor-screen" :class="floorMove" >
            <view class="head">
                <text @click="port()">自动仓库WCS监控平台</text>
                <view class="time-tools">{{year}}-{{month}}-{{day}}&nbsp{{hours}}:{{minutes}}:{{seconds}}&nbsp{{week}}</view>
                <view class="button-left" @click="url()"></view>
                <view class="button-right" @click="ledId()"></view>
            </view>
            <view class="main">
                <view class="main-sides" style="width: 100%;">
                    <view class="box" style="height: 90%;">
                        <view class="box-border box-border1"></view>
                        <view class="box-border box-border2"></view>
                        <view class="box-border box-border3"></view>
                        <view class="box-border box-border4"></view>
                        <view style="width: 10%;height: 100%;display:inline-block;float: left;text-align: center;padding-top: 180px;">
                            <text>{{title}}</text>
                        </view>
                        <view style="width: 80%;height: 100%;display: inline-block;float: left;font-size: 160rpx;">
                            <text class="animate" v-show="!errorShow && pakinShow && pakinGun">{{newspaper}}</text>
                            <text v-show="errorShow">{{errorPaper}}</text>
                            <text v-show="pakinShow">{{newspaper}}</text>
                        </view>
                        <view style="width: 10%;height: 100%;display: inline-block;float: right;padding-top: 180px;">
                            <text>{{staNo}}</text>
                        </view>
                    </view>
                </view>
            </view>
        </view>
        <view class="top-screen" :class="topMove">
            <view class="head">
                <text @click="port()">自动仓库WCS监控平台</text>
                <view class="time-tools">{{year}}-{{month}}-{{day}}&nbsp{{hours}}:{{minutes}}:{{seconds}}&nbsp{{week}}</view>
                <view class="button-left" @click="url()"></view>
                <view class="button-right" @click="ledId()"></view>
            </view>
            <view class="main">
                <view class="main-sides">
                    <view class="box box-lg">
                        <view class="box-border box-border1"></view>
                        <view class="box-border box-border2"></view>
                        <view class="box-border box-border3"></view>
                        <view class="box-border box-border4"></view>
                        <view class="box-item introduce">
                            <h3>自动化立体仓库</h3>
                            <p class="english">Automatic Storageand Retrieval System</p>
                            <p class="introduce-content">  利用立体仓库设备可实现仓库高层合理化、存取自动化、操作简便化;自动化立体仓库是当前技术水平较高的形式。
                            自动化立体仓库的主体由货架、巷道式堆垛起重机、入(出)库工作台和自动运进(出)及操作控制系统组成。
                            货架是钢结构或钢筋混凝土结构的建筑物或结构体,货架内是标准尺寸的货位空间,巷道堆垛起重机穿行于货架之间的巷道中,完成存、取货的工作。管理上采用计算机及条形码技术。</p>
                        </view>
                        <view class="box-item charge-info">
                            <h3>仓库数据</h3>
                            <p class="english">warehouse data</p>
                            <view class="charge-info-item">
                                <image src="../../static/a1.png" mode="aspectFit"></image>
                                <view>
                                    <text class="count">{{xDistance}}</text>
                                    <text class="unit">m</text>
                                </view>
                                <view>累计走行距离(米)</view>
                            </view>
                            <view class="charge-info-item">
                                <image src="../../static/b1.png" mode="aspectFit"></image>
                                <view>
                                    <text class="count">{{yDistance}}</text>
                                    <text class="unit">m</text>
                                </view>
                                <view>累计升降距离(米)</view>
                            </view>
                            <view class="charge-info-item">
                                <image src="../../static/c1.png" mode="aspectFit"></image>
                                <view>
                                    <text class="count">{{xDuration}}</text>
                                    <text class="unit">m</text>
                                </view>
                                <view>累计走行时长(秒)</view>
                            </view>
                            <view class="charge-info-item">
                                <image src="../../static/d1.png" mode="aspectFit"></image>
                                <view>
                                    <text class="count">{{yDuration}}</text>
                                    <text class="unit">m</text>
                                </view>
                                <view>累计升降时长(秒)</view>
                            </view>
                        </view>
                        <view class="box-item use-info">
                            <view class="use-left">
                                <h3>库位使用率</h3>
                                <p class="english">EQUIPMENT USAGE THIS MONTH</p>
                            </view>
                            <view class="use-right">
                                <h3>20%</h3>
                                <p class="english">同比上月 + 5%</p>
                            </view>
                            <view class="use-main">
                                <view class="left">
                                    <view class="progressBar">
                                        <view class="progress" :style="'width:'+ usedPr + '%'"></view>
                                    </view>
                                    <!-- <progress percent="20"activeColor="#FF5722" backgroundColor="#233751" stroke-width="30"></progress> -->
                                </view>
                                <view class="right">
                                    {{used}}
                                </view>
                            </view>
                        </view>
                    </view>
                </view>
                <view class="main-sides">
                    <view class="box box-tp">
                        <view class="box-border box-border1"></view>
                        <view class="box-border box-border2"></view>
                        <view class="box-border box-border3"></view>
                        <view class="box-border box-border4"></view>
                        <view class="box-item right-item">
                            <view class="sub-left">
                                <h3>入出库统计</h3>
                                <p class="english">ORDER STATISTICS</p>
                            </view>
                            <view class="sub-right">
                                <h3>31</h3>
                                <p class="english">今日订单数</p>
                            </view>
                            <view class="sub-main">
                                <view class="charts-box">
                                  <qiun-data-charts type="line" :chartData="chartsDataLine1" :echartsH5="true" :echartsApp="true"/>
                                </view>
                            </view>
                        </view>
                    </view>
                    <view class="box box-md">
                        <view class="box-border box-border1"></view>
                        <view class="box-border box-border2"></view>
                        <view class="box-border box-border3"></view>
                        <view class="box-border box-border4"></view>
                        <view class="box-item right-item">
                            <view class="sub-left">
                                <h3>库存类型</h3>
                                <p class="english">INCOME DATE</p>
                            </view>
                            <view class="sub-right">
                                <h3>今天</h3>
                                <p class="english">Today</p>
                            </view>
                            <view class="sub-main">
                                <view class="charts-box ring">
                                    <qiun-data-charts type="ring" :opts="{legend:{position:'bottom'}}" :eopts="ringOpts" :chartData="chartsDataPie2" :echartsH5="true" :echartsApp="true"/>
                                </view>
                                <view class="sub-main-right">
                                    <view class="sub-info">
                                        <image src="../../static/g1.png" mode="aspectFit"></image>
                                        <text>在库</text>
                                        <text>{{stockCount}}</text>
                                    </view>
                                    <view class="sub-info">
                                        <image src="../../static/f1.png" mode="aspectFit"></image>
                                        <text>空库</text>
                                        <text>{{emptyCount}}</text>
                                    </view>
                                    <view class="sub-info">
                                        <image src="../../static/e1.png" mode="aspectFit"></image>
                                        <text>禁用</text>
                                        <text>{{noneCount}}</text>
                                    </view>
                                </view>
                            </view>
                        </view>
                    </view>
                    <view class="box box-bt">
                        <view class="box-border box-border1"></view>
                        <view class="box-border box-border2"></view>
                        <view class="box-border box-border3"></view>
                        <view class="box-border box-border4"></view>
                        <!-- <text>浙江中扬立库技术有限公司</text>
                        <text>当前版本号</text> -->
                        <view>浙江中扬立库技术有限公司</view>
                        <image src="../../static/barcode.png" mode="aspectFit"></image>
                    </view>
                </view>
            </view>
        </view>
        <view>
            <!-- 输入url -->
            <uni-popup ref="url" type="dialog">
                <uni-popup-dialog ref="inputClose" mode="input" title="配置url" :value="baseUrl"
                    placeholder="示例:192.168.1.1" @confirm="baseUrlConfirm"></uni-popup-dialog>
            </uni-popup>
        </view>
        <view>
            <!-- 输入ledId -->
            <uni-popup ref="ledId" type="dialog">
                <uni-popup-dialog ref="inputClose" mode="input" title="配置ledId" :value="baseLedId"
                    placeholder="示例:188" @confirm="ledIdConfirm"></uni-popup-dialog>
            </uni-popup>
        </view>
        <view>
            <!-- 输入port -->
            <uni-popup ref="port" type="dialog">
                <uni-popup-dialog ref="inputClose" mode="input" title="配置端口号" :value="basePort"
                    placeholder="示例:9090" @confirm="portConfirm"></uni-popup-dialog>
            </uni-popup>
        </view>
    </view>
</template>
 
<script>
    import ycqdata from '@/pages/index/data.json';
    import demodata from '@/mockdata/demodata.json';
    export default {
        data() {
            return {
                show: true,
                modeClass: 'fade',
                styles: {},
                baseUrl:'10.10.0.200',
                baseLedId:'',
                basePort:'',
                value: '',
                xDistance: 0,
                yDistance:0,
                xDuration:0,
                yDuration:0,
                used:317,
                usedPr: 90,
                stockCount:0,
                emptyCount:0,
                noneCount:0,
                chartsData: {
                    "Line": {
                        "categories": [],
                        "series": []
                    },
                    "Pie": {
                        "series": [{
                            "data": []
                        }]
                    },
                },
                chartsDataLine1: {},
                chartsDataPie2: {},
                ringOpts:{},
                year:2022,
                month:4,
                day:14,
                hours:13,
                minutes:38,
                seconds:13,
                week:'星期四',
                ani:'',
                // move: 'upMove 1.5s 1;',
                move:true,
                topMove:'topUp',
                floorMove:'',
                version:'',
                // newspaper:'拣料出库(4426)\n源库位:1200101\n目标站:186\n1101842-10000-22047518517\n\n',    
                newspaper:'',
                errorPaper:'',
                title:'',
                staNo:'',
                errorShow:'',
                pakinShow:'',
                pakinGun:'',
            }
        },
        mounted() {
            let that = this
            const BaseUrl = uni.getStorageSync('BaseUrl');
            const BaseLedId = uni.getStorageSync('BaseLedId');
            const BasePort = uni.getStorageSync('BasePort');
            if (BaseUrl && BaseLedId) {
                that.baseUrl = BaseUrl
                that.baseLedId = BaseLedId
                that.basePort = BasePort
            } else {
                that.baseUrl = ''
                that.baseLedId = ''
            }
        },
        onReady() {
            setTimeout(() => {
                // this.initlineChart();
                // this.initPieChart();
                
            }, 0);
            setTimeout(() => {
                // this.getServerData();
                // this.getOther();
                // this.getPakin();
            }, 1000);
            setInterval(() => {
                this.getDate();
                this.getPakin();
                this.getError();
                // this.getYYY();
                // this.getEEE();\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
                this.animation();
            },3000)
        },
        onLoad() {
            // var that=this
            // plus.runtime.getProperty( plus.runtime.appid, function ( wgtinfo ) {
            //     that.version=wgtinfo.version
            // });
        },
        methods: {
            
            getError() {
                let that = this
                uni.request({
                    url: "http://" + that.baseUrl + ":" + that.basePort + "/jkwcs/monitor/led/error",
                    data: {
                        ledId:that.baseLedId
                    },
                    method:'GET',
                    success(result) {
                        console.log(result)
                        let res = result.data 
                        if (res.data && res.data !== "") {
                            console.log('有异常')
                            that.title = ''
                            that.staNo = ''
                            that.pakinShow = false
                            that.errorShow = true
                            that.errorPaper = res.data
                            that.move = false // 显示
                        } else {
                            that.errorPaper = ''
                            that.errorShow = false
                            console.log('无异常')
                            console.log(that.pakinShow)
                            if (that.pakinShow) {
                                console.log('无异常,有拣货')
                                return;
                            } else {
                                that.move = true // 隐藏
                            }
                        }
                    }
                });
            },
            getPakin () {
                let that = this
                uni.request({
                    url: "http://" + that.baseUrl + ":" + that.basePort + "/jkwcs/monitor/led",
                    data: {
                        ledId:that.baseLedId
                    },
                    method:'GET',
                    success(result) {
                        console.log(result)
                        var newsData = ''
                        var str = ''
                        let res = result.data
                        if(res.data) {
                            console.log("拣货,有拣料")
                            if (res.data[0].matDtos.length > 0) {
                                console.log("有拣料,长度>8")
                                
                                that.pakinShow = true
                                that.pakinGun = true
                                // console.log(that.errorShow,that.pakinShow,that.pakinGun)
                                
                                if (res.data[0].ioType === 101) {
                                    that.title = '全板出库'
                                } else if(res.data[0].ioType === 103) {
                                    that.title = '检料出库'
                                }
                                that.staNo = '目标站' + res.data[0].staNo
                                for (var i = 0; i < res.data[0].matDtos.length; i++) {
                                    str = res.data[0].matDtos[i].matnr + ' - ' + res.data[0].matDtos[i].batch + '\n'
                                    newsData = newsData + str 
                                }
                                if (that.errorShow) {
                                    // that.pakinShow = false
                                    return;
                                } else {
                                    that.newspaper = newsData
                                    that.move = false
                                }
                                if (res.data[0].matDtos.length <= 8) {
                                    console.log("有拣料,长度<=8")
                                    that.errorShow = true
                                    that.pakinShow = true
                                    that.pakinGun  = false
                                    
                                }
                                console.log(that.errorShow,that.pakinShow,that.pakinGun)
                            } else {
                                that.move = true
                            }
                        }
                    
                    }
                })
            },
            animation() {
                if (this.move) {
                    this.topMove = 'topUp'
                    this.floorMove = 'floorUp'
                } else {
                    this.topMove = 'topDown'
                    this.floorMove = 'floorDown'
                }
            },
            getDateFormat(value) {
                var date = new Date();// 获取当前时间
                date.setDate(date.getDate() + value);// 设置天数 -1 天
                var m = date.getMonth() + 1
                var d = date.getDate()
                var newDate = m + '-' + d
                return newDate
            },
/*************** 折线图 *****************************************************************************************************/
            initlineChart() {
                let that = this
                uni.request({
                    url: "http://10.10.0.222:9090/jswcs/monitor/line/charts",
                    method:'GET',
                    success(result) {
                        var res = result.data
                        if (res.code === 200) {
                            that.chartsData.Line.categories = [that.getDateFormat(-11),that.getDateFormat(-10),that.getDateFormat(-9),that.getDateFormat(-8),that.getDateFormat(-7),that.getDateFormat(-6),that.getDateFormat(-5),that.getDateFormat(-4),that.getDateFormat(-3),that.getDateFormat(-2),that.getDateFormat(-1),that.getDateFormat(0),]
                            that.chartsData.Line.series = res.data.rows
                        }
                    }
                })
            },
/*************** 饼图 *****************************************************************************************************/
            initPieChart() {
                let that = this
                uni.request({
                    url: "http://10.10.0.222:9090/jswcs/monitor/loc/rep",
                    method:'GET',
                    success(result) {
                        var res = result.data
                        if (res.code === 200) {
                            that.chartsData.Pie.series[0].data = res.data.pie
                            that.stockCount = res.data.stockCount
                            that.emptyCount = res.data.emptyCount
                            that.noneCount = res.data.noneCount
                            that.used = res.data.used
                            that.usedPr = res.data.usedPr
                        }
                    }
                })
            },
            getOther() {
                let that = this
                uni.request({
                    // http://10.10.0.222:9090/jkwcs/monitor/led?ledId=186
                    url: "http://" + that.baseUrl + ":9090/jswcs/monitor/other",
                    data: {
                        crnId: 1, 
                        ledId: this.baseLedId,
                    },
                    success(result) {
                        var res = result.data
                        if (res.code === 200) {
                            that.xDistance = res.data.xDistance
                            that.yDistance = res.data.yDistance
                            that.xDuration = res.data.xDuration
                            that.yDuration = res.data.yDuration
                            console.log(res)
                        } else if (res.code === 403) {
                            
                        } else {
                            
                        }
                    }
                })
            },
            port() {
                this.$refs.port.open()
            },
            url() {
                this.$refs.url.open()
            },
            ledId() {
                this.$refs.ledId.open()
            },
            baseUrlConfirm(val) {
                this.baseUrl = val
                uni.setStorageSync('BaseUrl', this.baseUrl);
            },
            ledIdConfirm(val) {
                this.baseLedId = val
                uni.setStorageSync('BaseLedId', this.baseLedId);
            },
            portConfirm(val) {
                this.basePort = val
                uni.setStorageSync('BasePort',this.basePort);
            },
            getServerData() {
                this.chartsDataLine1=JSON.parse(JSON.stringify(this.chartsData.Line))
                this.chartsDataPie2=JSON.parse(JSON.stringify(this.chartsData.Pie))
            },
            complete(e) {
                console.log("渲染完成事件",e);
            },
            getDate() {
                var dt = new Date();
                this.year = dt.getFullYear();
                this.month = (dt.getMonth()+1) < 10 ? '0'+ (dt.getMonth()+1) : (dt.getMonth()+1);
                this.day = dt.getDate() < 10 ? '0'+dt.getDate() : dt.getDate();
                this.hours = dt.getHours() < 10 ? '0' + dt.getHours() : dt.getHours();
                this.minutes = dt.getMinutes() < 10 ? '0' + dt.getMinutes() : dt.getMinutes();
                this.seconds = dt.getSeconds() < 10 ? '0' + dt.getSeconds() : dt.getSeconds(); 
                this.weeks = dt.getDay(); 
                switch (this.weeks) {
                    case 0: this.week = "星期日"; break;
                    case 1: this.week = "星期一"; break;
                    case 2: this.week = "星期二"; break;
                    case 3: this.week = "星期三"; break;
                    case 4: this.week = "星期四"; break;
                    case 5: this.week = "星期五"; break;
                    default : this.week = "星期六";
                }
            },
        }
    }
</script>
 
<style>
    .animate {
        display: inline-block;
                /* white-space: nowrap; */
                animation: 25s wordsLoop linear infinite normal;
            }
     
            @keyframes wordsLoop {
                0% {
                    transform: translateY(100px);
                    -webkit-transform: translateY(100px);
                }
                100% {
                    transform: translateY(-100%);
                    -webkit-transform: translateY(-100%);
                }
            }
     
            @-webkit-keyframes wordsLoop {
                0% {
                    transform: translateY(100px);
                    -webkit-transform: translateY(100px);
                }
                100% {
                    transform: translateY(-100%);
                    -webkit-transform: translateY(-100%);
                }
            }
    /* animation:upMove 1.5s 1; */
    /* downMove */
    /* 上层向上 */
    .topUp {
        animation: topUp 1.5s 1;
        animation-fill-mode: both;
    }
    @keyframes topUp {
        from {
            opacity: 0.5;
            /* background-color:blue; */
            top:-1080px
            }
        to {
            opacity: 1;
            /* background-color:red; */
            top: 0;
        }
    }
    /* 上层向下 */
    .topDown {
        animation: topDown 1.5s 1;
        animation-fill-mode: both;
    }
    @keyframes topDown
        {
        from {
            opacity: 1;
            /* background-color:red; */
            top: 0;
        }
        to {
            opacity: 0.5;
            /* background-color:blue; */
            top:-1080px
        }
    }
    /* 下层向上 */
    .floorUp {
        animation: floorUp 1.5s 1;
        animation-fill-mode: both;
    }
    @keyframes floorUp {
        from {
            opacity: 0.5;
            /* background-color:blue; */
            top: 0px;
            }
        to {
            opacity: 1;
            /* background-color:red; */
            top: 1080px;
        }
    }
    /* 下层向下 */
    .floorDown {
        animation: floorDown 1.5s 1;
        animation-fill-mode: both;
    }
    @keyframes floorDown {
        from {
            opacity: 0.5;
            /* background-color:blue; */
            top: 1080px;
            }
        to {
            opacity: 1;
            /* background-color:red; */
            top: -0px;
        }
    }
    .top-screen {
        position: fixed;
        width: 1920px;
        height: 1080px;
        /* top: -1000px; */
        background-image: url(../../static/background.png);
        /* background:red; */
        /* animation:upMove 1.5s 1; */
        z-index: 999;
    }
    .floor-screen {
        width: 1920px;
        height: 1080px;
        position: relative;
        color: #FFFFFF;
        text-align: center;
        font-size: 200rpx;
        letter-spacing: 5rpx;
        background-image: url(../../static/background.png);
    }
    .container {
        width: 1920px;
        height: 1080px;
        
        position: relative;
        /* background: #000428;  
        background: -webkit-linear-gradient(to right, #004e92, #000428);  
        background: linear-gradient(to right, #004e92, #000428); */
    }
    .head {
        /* background-color: #55aaff; */
        width: 100%;
        height: 10%;
        text-align: center;
        line-height: 110px;
        color: #FFFFFF;
        font-size: 40px;
        font-weight: 700;
        letter-spacing: 5px;
    }
    .head text {
        transform: scale(1,0.9);
    }
    .time-tools {
        height: 5%;
        /* background-color: #007AFF; */
        position: absolute;
        top: 0;
        float: right;
        right: 50px;
        font-size: 16px;
        font-weight: 400;
        line-height: 70px;
        letter-spacing: 1px;
    }
    .button-left {
        position: absolute;
        background-image: url(../../static/right.png);
        background-size: 100% 100%;
        top: 1.8%;
        left: 21.3%;
        width: 13.5%;
        height: 8.5%;
        transform: scaleX(-1);
    }
    .button-right {
        position: absolute;
        background-image: url(../../static/right.png);
        background-size: 100% 100%;
        top: 1.8%;
        left: 65%;
        width: 13.5%;
        height: 8.5%;
    }
    .main {
        /* background-color: #3F536E; */
        position: relative;
        width: 100%;
        height: 90%;
    }
    .main-sides {
        /* background-color: #004E92; */
        position: relative;
        display: inline-block;
        float: left;
        width: 50%;
        height: 100%;
        /* margin: 2% auto 0 3.2%;
        border: 1px solid rgba(20, 80, 136, 1); */
    }
    .box {
        position: relative;
        /* background-color: #ffffff; */
        margin: 3% 2% 0 2%;
        width: 96%;
        height: 30%;
        border: 1px solid rgba(20, 80, 136, 1);
        overflow: hidden;
    }
    .box-lg {
        height: 94%;
    }
    .box-border {
        position: absolute;
        /* background-color: #4CD964; */
        width: 10px;
        height: 10px;
    }
    .box-border1 {
        top: 0;
        left: 0;
        border-left: 2px solid #31c4c4;
        border-top: 2px solid #31c4c4;
    }
    .box-border2 {
        top: 0;
        right: 0;
        border-right: 2px solid #31c4c4;
        border-top: 2px solid #31c4c4;
    }
    .box-border3 {
        bottom: 0;
        left: 0;
        border-bottom: 2px solid #31c4c4;
        border-left: 2px solid #31c4c4;
    }
    .box-border4 {
        bottom: 0;
        right: 0;
        border-right: 2px solid #31c4c4;
        border-bottom: 2px solid #31c4c4;
    }
    .content {
      display: flex;
      flex-direction: column;
      flex: 1;
    }
    
    .charts-box {
      width: 80%;
      height: 230px;
      margin-left: 10%;
      /* background-color: #fff; */
    }
    .ring {
        display: inline-block;
        float: left;
        width: 60%;
        height: 300px;
        margin-left: -10%;
    }
    .box-item {
        /* background-color: #2C405A; */
        width: 92%;
        height: 20%;
        margin-left: 4%;
        padding-top: 1em;
        color: #FFFFFF;
    }
    .introduce {
        height: 30%;
    }
    .introduce h2 {
        letter-spacing: 5px;
        
    }
    .english {
        font-size: 14px;
    }
    .introduce-content {
        font-size: 20px;
        padding-top: 2em;
        text-indent: 2em;
        line-height: 2em;
    }
    .charge-info {
        /* background-color: #2C405A; */
        height: 45%;
    }
    .charge-info-item {
        /* background-color: #EE6666; */
        display: inline-block;
        width: 50%;
        height: 40%;
    }
    .charge-info-item image {
        display: inline-block;
        float: left;
        /* background-color: #4CD964; */
        height: 100%;
        width: 20%;
    }
    .charge-info-item view {
        display: inline-block;
        position: relative;
        margin-left: 10%;
        width: 70%;
        height: 49%;
        /* background-color: #1890FF; */
    }
    .charge-info-item .count, .charge-info-item .unit{
        position: absolute;
        display: inline-block;
        font-size: 32px;
        bottom: 0;
        padding-left: 5%;
    }
    .charge-info-item .unit {
        font-size: 16px;
        float: right;
        right: 20%;
    }
    .footer {
        position: absolute;
        border: 1px solid rgba(20, 80, 136, 1);
        height: 15%;
    }
    .use-info {
        /* background-color: #007AFF; */
    }
    .use-left {
        display: inline-block;
        /* background-color: #2C405A; */
        width: 40%;
    }
    .use-right {
        display: inline-block;
        /* background-color: #2C405A; */
        float: right;
        width: 20%;
    }
    .use-main {
        width: 100%;
        height: 75%;
        /* background-color: #4CD964; */
    }
    .use-main .left {
        /* background-color: #ffaa7f; */
        display: inline-block;
        float: left;
        height: 100%;
        width: 70%;
        line-height: 20px;
    }
    .left .progressBar {
        /* margin-left: ; */
        margin-top: 9%;
        width: 100%;
        height: 20%;
        background-color: #233751;
        border-radius: 20px;
    }
    .left .progress {
        /* width: 90%; */
        height: 100%;
        background-color: #FF5722;
        border-radius: 20px;
    }
    .left progress {
        margin-left: 10%;
        margin-top: 10%;
        display: block;
    }
    .use-main .right {
        /* background-color: #ffaaff; */
        display: inline-block;
        float: right;
        height: 100%;
        width: 20%;
        font-size: 40px;
        color: #FF5722;
        line-height: 130px;
    }
    .box-tp {
        height: 30%;
    }
    .box-tp .sub-main {
        /* background-color: #FFFFFF; */
    }
    .box-md {
        height: 43%;
    }
    .box-md .sub-main {
    }
    .sub-main-right {
        display: inline-block;
        height: 100%;
        width: 50%;
    }
    .sub-info {
        width: 100%;
        height: 33%;
    }
    .sub-info image {
        display: inline-block;
        float: left;
        height: 100%;
        width: 15%;
    }
    .sub-info text {
        display: inline-block;
        width: 40%;
        height: 100%;
        text-align: center;
        line-height: 120px;
        font-size: 20px;
    }
    .box-bt {
        background-color: #063A7B;
        border: none;
        height: 15%;
        color: #FFFFFF;
    }
    .box-bt image {
        position: absolute;
        float: right;
        right: 0;
        top: 0;
        width: 20%;
        height: 100%;
    }
    .box-bt {
        font-size: 36px;
        line-height: 140px;
        text-indent: 5em;
    }
    .right-item {
        height: 94%;
    }
    .sub-left {
        display: inline-block;
        float: left;
        width: 40%;
    }
    .sub-right {
        display: inline-block;
        float: right;
        width: 20%;
    }
    .sub-main {
        position: absolute;
        /* background-color: #31C4C4; */
        width: 92%;
        height: 80%;
        bottom: 0;
    }
</style>