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
<!DOCTYPE html>
<html lang="zh-cn">
 
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>设备状态看板</title>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="css/bootstrap-table.min.css">
    <link rel="stylesheet" type="text/css" href="css/index.css">
    <link rel="stylesheet" type="text/css" href="css/ReportPlatform.css">
    <script src="js/jquery.min.js"></script>
    <script src='js/echarts.min.js'></script>
    <script src="js/bootstrap.min.js"></script>
    <script src='js/bootstrap-table.min.js'></script>
    <script src='js/bootstrap-table-zh-CN.min.js'></script>
    <script src="js/jquery.SuperSlide.2.1.3.js"></script>
    <script src='js/template.js'></script>
    <script src="js/jquery.qrcode.min.js"></script>
    <script src="js/webConfig.js"></script>
    <style>
        .clock {
            font-family: 'BebasNeueRegular', Arial, Helvetica, sans-serif;
            font-size: 20px;
            width: 450px;
            float: right;
            color: #fff;
            margin-top: -75px;
            margin-right: 5px;
            color: #09d1ea;
        }
 
            .clock #Date {
                text-align: center;
                text-shadow: 0 0 0px #00c6ff;
            }
 
            .clock ul {
                width: 450px;
                margin: 0 auto;
                padding: 0px;
                list-style: none;
                text-align: right;
                margin-left: 15px;
                position: relative;
            }
 
                .clock ul li {
                    display: inline;
                    font-size: 24px;
                    text-align: left;
                    font-family: 'BebasNeueRegular', Arial, Helvetica, sans-serif;
                    text-shadow: 0 0 0px #00c6ff;
                }
 
        body {
            padding-left: 50px;
            padding-right: 50px;
        }
 
        .title {
            font-size: 44px;
            font-family: PingFangSC;
            font-weight: 500;
            color: rgba(9, 209, 234, 1);
            text-align: center;
            background: url(img/img_little_new.png) center no-repeat;
            margin-bottom: 30px;
        }
 
        .col-sm-12 {
            position: relative;
            min-height: 1px;
            padding-right: 0px;
            padding-left: 0px;
        }
 
        .top {
            /* border: 1px solid #00c6ff; */
            height: 900px;
        }
 
        .left {
            /* border: 1px solid #00c6ff; */
            height: 300px;
        }
 
        .top1 {
            /* border: 1px solid #00c6ff; */
            height: 150px;
        }
 
        .ctn {
            /* border: 1px solid #00c6ff; */
            height: 450px;
        }
 
        .bottom {
            /* border: 1px solid #00c6ff; */
            height: 600px;
        }
 
        .bottom1 {
            /* border: 1px solid #00c6ff; */
            height: 750px;
        }
 
        .bottom_left {
            /* border: 1px solid #00c6ff; */
            height: 300px;
        }
 
        .col-sm-8,
        .col-sm-6,
        .col-sm-4,
        .col-sm-3,
        .col-sm-2 {
            /* border: 1px solid #00c6ff; */
            position: relative;
            min-height: 1px;
            padding-right: 0px;
            padding-left: 0px;
        }
 
        #cTitle {
            width: 50px;
            height: 450px;
            font-size: 25px;
            line-height: 30px;
            color: #00c6ff;
            border: 1px solid #333
        }
 
        .col-sm-12,
        .col-sm-2,
        .col-sm-3,
        .col-sm-4,
        .col-sm-6,
        .col-sm-8 {
            position: relative;
            min-height: 1px;
            padding-right: 0px;
            padding-left: 0px;
        }
 
        #mychart1,
        #mychart2 {
            width: 100%;
            border: none;
            height: 450px;
        }
 
        #cList0 {
            height: 450px;
            width: 3%;
            /* border: 1px solid #00c6ff; */
            float: left;
        }
 
        #cList1 {
            float: left;
        }
 
            #cList1 li {
                float: left;
                height: 450px;
                color: #00c6ff;
                font-size: 20px;
                /*文字居中*/
                text-align: center;
                /*display: flex;*/
            }
 
                #cList1 li span {
                    /*文字居中*/
                    display: inline-block;
                    height: 100%;
                    /*文字居中*/
                    /*文字竖排*/
                    writing-mode: vertical-lr;
                    /*从左向右 从右向左是 writing-mode: vertical-rl;*/
                    writing-mode: tb-lr;
                    /*IE浏览器的从左向右 从右向左是 writing-mode: tb-rl;*/
                }
 
        #cList2 {
            height: 450px;
            width: 97%;
            /* border: 1px solid #00c6ff; */
            float: left;
        }
 
        table tr td {
            text-align: center;
            vertical-align: middle !important;
            /*border: 1px solid #464646;*/
            border-right: 0px;
            height: 40px;
            font-size: 25px;
            font-family: '黑体';
            font-family: Arial;
            border: none;
        }
 
        .table > caption + thead > tr:first-child > td,
        .table > caption + thead > tr:first-child > th,
        .table > colgroup + thead > tr:first-child > td,
        .table > colgroup + thead > tr:first-child > th,
        .table > thead:first-child > tr:first-child > td,
        .table > thead:first-child > tr:first-child > th {
            background-color: #000;
            color: #3bff72;
        }
 
        .fixed-table-container tbody td .th-inner,
        .fixed-table-container thead th .th-inner {
            font-size: 28px;
            color: #09d1ea;
            padding: 20px 0 15px 0;
        }
 
        #tb_order tr td {
            text-align: center;
            height: 32px;
            line-height: 32px;
            font-size: 25px;
            /* font-family: '黑体'; */
            color: #a6a8ae;
            font-family: Arial;
            /* border: 1px solid #464646; */
            border: none;
        }
 
        .bootstrap-table .table {
            border-radius: none
        }
 
        th {
            background-color: transparent !important;
        }
 
        td {
            background-color: transparent;
        }
 
        tr {
            background-color: transparent
        }
 
        #tb_order,
        #tb_order1 tr:nth-child(even) {
            background: #080c1c;
        }
 
        .fixed-table-container tbody td .th-inner,
        .fixed-table-container thead th .th-inner {
            text-align: left;
        }
 
        .progress {
            background-color: darkblue;
        }
 
        #tb_order,
        #tb_order1 tr:nth-child(even) {
            background: #000000;
        }
 
        #tb_order1 tr th {
            /*border: 1px solid #464646;*/
            border: none;
            font-size: 22px;
        }
 
        #tb_order1 tr td {
            text-align: center;
            height: 32px;
            line-height: 32px;
            font-size: 18px;
            font-family: '黑体';
            font-family: Arial;
            /*border:1px solid #464646;*/
            border: none;
        }
 
        #tb_order1 tr:hover {
            background: #000000;
        }
 
        .pull-right,
        .fixed-table-pagination .pagination-detail,
        .fixed-table-pagination div.pagination {
            display: none;
        }
    </style>
    <script type="text/javascript">
        var CallHouseCode = '01';//叫料看板仓库编码
 
 
        var interval;//计时器
        var interval1;//计时器
        var interval2;//计时器
        var num = 0;
        var num1 = 0;
        var TLProgress = 0;  //退料率
        var CallData = [];  //饼图结果数组
        var CAllDataX = [];  //柱状图x轴
        var CAllDataXval = [];  //柱状图y轴
        $(document).ready(function () {
            // 创建两个变量,一个数组中的月和日的名称
            var monthNames = ["1 月", "2 月", "3 月", "4 月", "5 月", "6 月", "7 月", "8 月", "9 月", "10 月", "11 月", "12 月"];
            setInterval(function () {
                var date1 = new Date;
                var year = date1.getFullYear();
                var month = date1.getMonth();
                var day = date1.getDate();
                var hh = date1.getHours();
                var mm = date1.getMinutes();
                var ss = date1.getSeconds();
                var dayNames = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
                var Stamp = new Date();
                $('#Date').html(year + "&nbsp;年" + " " + monthNames[month] + ' ' + day + "&nbsp;日&nbsp;&nbsp;" + ' ' + dayNames[Stamp.getDay()]);
                $("#hours").html((hh < 10 ? ("0" + hh) : hh));
                $("#min").html((mm < 10 ? ("0" + mm) : mm));
                $("#sec").html((ss < 10 ? ("0" + ss) : ss));
            }, 1000);
        });
        $(function () {
            var mychart1 = echarts.init(document.getElementById('mychart1'));
            var mychart2 = echarts.init(document.getElementById('mychart2'));
            TopData();
            BottomData();
            Chart(mychart1, mychart2);
 
            // 定时器
            interval = setInterval(function () {
                $("#tb_order").bootstrapTable('refresh');
            }, 10000);
            interval2 = setInterval(function () {
                CallData = [];
                CAllDataX = [];
                CAllDataXval = [];
                Chart(mychart1, mychart2);
            }, 20000);
            //根据窗口的大小变动图表 --- 重点
            window.onresize = function () {
                mychart1.resize();
                mychart2.resize();
            }
        })
 
        function Chart(mychart1, mychart2) {
            $.ajax({
                url: GetWEBURL() + "/loaddata/EquipmentStatusBillPie",
                dataType: "JSON",
                async: false,//使用同步的方式,true为异步方式
                type: "Get",
                data: { "CallHouseCode": CallHouseCode },
                success: function (data) {
                    //饼图
                    CallData.push(data.Table[0]["column3"]);
                    CallData.push(data.Table[0]["column4"]);
                    CallData.push(data.Table[0]["column5"]);
                    CallData.push(data.Table[0]["column6"]);
                    CallData.push(data.Table[0]["column7"]);
                    //柱状图
                    $.each(data.Table1, function (index, val) {
                        CAllDataX.push(val.countDay);
                        CAllDataXval.push(val.HName);
                    });
                },
                error: function (data) {
 
                }
            })
 
            const colorList = ['#91CC75 ', '#5470C6', '#73C0DE', '#EE6666', '#FAC858']
            option1 = {
                title: [
                    {
                        show: true,
                        text: '设备运行状态',
                        textStyle: {
                            color: '#00c6ff',
                            fontSize: '16',
                        },
                        left: 'center',
                    }
                ],
                tooltip: {
                    trigger: 'item',
                },
                // legend: {
                //     orient: 'vertical',
                //     left: 'left'
                // },
                color: colorList,
                series: [
                    {
                        name: '占比',
                        type: 'pie',
                        radius: '60 %',//大小
                        itemStyle: {
                            borderWidth: 3,
                            borderColor: '#000000'
                        },
                        data: [
                            { value: CallData[0], name: '工作' },
                            { value: CallData[1], name: '待机' },
                            { value: CallData[2], name: '离线' },
                            { value: CallData[3], name: '报警' },
                            { value: CallData[4], name: '维修' }
                        ],
                    }
                ]
            };
 
            option2 = {
                title: {
                    text: '稼动率对比',
                    left: '0',
                    top: 2,
                    textStyle: {
                        fontSize: 20,
                        color: '#00c6ff',
                        fontFamily: "微软雅黑"
                    },
                },
                color: ['#5b9bd5', '#ed7d31', '#a9d18e', '#ffc000'],
                tooltip: {
 
                },
                grid: {
                    left: "20%",//grid 组件离容器左侧的距离。
                    right: "30px",
                    bottom: "20%" //
                },
                legend: {
                    left: 'right',
                    data: ['叫料数', '配送数'],
                    textStyle: {
                        color: '#00c6ff',
                        fontSize: 16,
                        fontFamily: "微软雅黑"
                    }
 
                },
                xAxis: [
                    {
                        type: 'category',
                        data: CAllDataXval,
                        axisTick: {
                            alignWithLabel: true
                        },
                        axisLine: {
                            show: true,
                            lineStyle: {
                                color: '#00c6ff',
                                type: 'solid', //设置网格线类型 dotted:虚线   solid:实线
                                width: 1, //隐藏y轴
                            }
                        },
                        axisLabel: {
                            show: true,
                            interval: 0, //控制X轴刻度全部显示
                            rotate: 45, //倾斜角度
                            textStyle: {
                                color: '#00c6ff', //坐标值得具体的颜色
                                fontSize: '16'
                            }
                        }
                    }
                ],
                yAxis: [
                    {
                        type: 'value',
                        axisLine: {
                            show: false,
 
                        },
                        splitLine: { //网格线
                            lineStyle: {
                                color: '#00c6ff',
 
                            },
                            show: true //隐藏或显示
                        },
                        axisLabel: {
                            textStyle: {
                                color: '#00c6ff', //坐标值得具体的颜色
                                fontSize: '16'
                            }
                        }
                    }
                ],
                series: [
                    {
                        data: CAllDataX,
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
                            color: 'rgba(180, 180, 180, 0.2)'
                        },
                        label: {
                            show: true,
                            position: 'inside' //top
                        }
                    }
 
                ]
            };
 
            mychart1.setOption(option1);
            mychart2.setOption(option2);
 
        }
        function TopData() {
            $('#tb_order').bootstrapTable({
                url: GetWEBURL() + '/loaddata/EquipmentStatusData',
                //data: dataJson,
                method: 'get',                      //请求方式(*)
                dataType: "json",
                queryParams: queryParams,
                striped: false,                      //是否显示行间隔色
                cache: false,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
                pagination: true,                   //是否显示分页(*)
                sortable: false,                     //是否启用排序
                sortable: false,                      //是否启用排序
                search: false,                       //是否启用搜索框
                sidePagination: "server",           //分页方式:client客户端分页,server服务端分页(*)
                pageNumber: 1,                       //初始化加载第一页,默认第一页
                strictSearch: false,                //设置为 true启用 全匹配搜索,否则为模糊搜索
                clickToSelect: true,                //是否启用点击选中行
                singleSelect: true,                  //设置True 将禁止多选
                uniqueId: "ID",                     //每一行的唯一标识,一般为主键列
                cardView: false,                    //是否显示详细视图
                detailView: false,                   //是否显示父子表
 
                columns: [
                    { field: 'column1', title: '设备数量', align: "left" },
                    { field: 'column2', title: '开机率', align: "left" },
                    { field: 'column3', title: '工作', align: "left" },
                    { field: 'column4', title: '待机', align: "left" },
                    { field: 'column5', title: '离线', align: "left" },
                    { field: 'column6', title: '报警', align: "left" },
                    { field: 'column7', title: '维修', align: "left" }
                    //{ field: 'column7', title: '保养', align: "left" }
                ],
                onClickRow: function (row, $element) {
 
                },
                onCheck: function (row, $element) {
 
                },
                onLoadSuccess: function (row) {
                    var num_total = (row.total) / 8
                    if (num >= num_total) {
                        num = 0
                    }
                }
 
            })
        }
        function BottomData() {
            $.ajax({
                url: GetWEBURL() + "/loaddata/EquipmentStatusBillList",
                dataType: "JSON",
                async: false,//使用同步的方式,true为异步方式
                type: "Get",
                data: { "CallHouseCode": CallHouseCode },
                success: function (data) {
                    for (var i = 0; i < data.Table.length; i++) {
                        var html1 = '';
 
                        html1 += '<div class="col-sm-12 col-md-2" >';
                        if (data.Table[i]["设备状态"] == '离线')
                            html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#9A9999">';
                        else if (data.Table[i]["设备状态"] == '工作')
                            html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#259D27">';
                        else if (data.Table[i]["设备状态"] == '待机')
                            html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#199687">';
                        else if (data.Table[i]["设备状态"] == '报警')
                            html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#FC522A">';
 
                        html1 += '<dl>';
                        //html1 += '<img src="img/device.png">'
                        html1 += '<dd class="tcenter">';
                        html1 += '<h1><span></span><span id="ptn' + (i + 1) + '">' + data.Table[i]["设备名称"] + '</span></h1>';
                        html1 += '<h1><span>运行总时间:' + data.Table[i]["运行总时间"] + '</span></h1>';
                        html1 += '<h1><span>待机总时间:' + data.Table[i]["待机总时间"] + '</span><span id="pts' + (i + 1) + '">' + '' + '</span></h1>';
                        html1 += '<h1><span>工作总时间:' + data.Table[i]["工作总时间"] + '</span><span id="pts' + (i + 1) + '">' + '' + '</span></h1>';
                        html1 += '<h1><span>设备稼动率:</span><span>' + data.Table[i]["设备稼动率"] + '</span><span style="margin-left:20px;">报警次数:</span><span>' + data.Table[i]["报警次数"] + '</span></h1>';
                        html1 += '<h1><span>设备状态:' + data.Table[i]["设备状态"] + '</span><span id="pts' + (i + 1) + '">' + '' + '</span></h1>';
                        html1 += '</div > ';
                        html1 += '</div>';
                        html1 += '</dd>';
                        html1 += '</dl>';
                        html1 += '</div>';
                        html1 += '</div>';
                        $("#btomleft").append(html1);
                    }
                },
                error: function (data) {
 
                }
            })
 
            //for (var i = 0; i < 20; i++) {
            //    var html1 = '';
            //    html1 += '<div class="col-sm-12 col-md-2" >';
            //    if (i == 2 || i == 4 || i == 6)
            //        html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#91CC75"  onclick="CheckBtom(this,' + (i + 1) + ')">';
            //    else if (i % 2 == 0)
            //        html1 += '<div class="cns" id="bs' + (i + 1) + '" style=""  onclick="CheckBtom(this,' + (i + 1) + ')">';
            //    else
            //        html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#EE6666; color:#FFF"  onclick="CheckBtom(this,' + (i + 1) + ')">';
 
            //    html1 += '<dl>';
            //    //html1 += '<img src="img/device.png">'
            //    html1 += '<dd class="tcenter">';
            //    html1 += '<h1><span>设备名称:</span><span id="ptn' + (i + 1) + '">' + '测试设备机' + i + '</span></h1>';
            //    html1 += '<h1><span>工单:MO20220901001' + i + '</span></h1>';
            //    html1 += '<h1><span>产品名称:底壳组件</span><span id="pts' + (i + 1) + '">' + '' + '</span></h1>';
            //    html1 += '<h1><span>产品规格型号:645mm*320mm</span><span id="pts' + (i + 1) + '">' + '' + '</span></h1>';
            //    html1 += '<h1><span>计划数量:</span><span>100' + i + '</span><span style="margin-left:20px;">汇报总数:</span><span>' + i + '</span></h1>';
            //    html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span>';
            //    html1 += '</div > ';
            //    html1 += '</div>';
            //    html1 += '</dd>';
            //    html1 += '</dl>';
            //    html1 += '</div>';
            //    html1 += '</div>';
            //    $("#btomleft").append(html1);
            //}
        }
        //得到查询的参数
        function queryParams(params) {
            num += 1;
            var temp = {   //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
                CallHouseCode: CallHouseCode,
                limit: params.limit,   //页面大小
                offset: num,  //页码
            };
            return temp;
        }
        //得到查询的参数
        function queryParams1(params) {
            num1 += 1;
            var temp = {   //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
                CallHouseCode: CallHouseCode,
                limit: params.limit,   //页面大小
                offset: num1,  //页码
            };
            return temp;
        }
    </script>
</head>
 
<body>
    <div class='title'>设备状态看板</div>
    <div class="clock">
        <ul>
            <li id="Date"></li>
            <li id="hours"> </li>
            <li id="point">:</li>
            <li id="min"> </li>
            <li id="point">:</li>
            <li id="sec"> </li>
        </ul>
 
    </div>
    <div class="col-sm-9 top">
        <div class="col-sm-12 top1">
            <div id="cList2 top1">
                <table id="tb_order" class="table-condensed table-responsive tb_order" data-filter-control="true">
                </table>
            </div>
        </div>
        <div class="col-sm-12 bottom1">
            <div id="btomleft">
 
            </div>
        </div>
 
    </div>
    <div class="col-sm-3 top">
        <div class="col-sm-12">
            <div id="mychart1"></div>
        </div>
        <div class="col-sm-12">
            <div id="mychart2"></div>
        </div>
    </div>
 
</body>
 
</html>