wang-hao-jie
2022-08-25 57dcc73636bb7d8dce89c808eb8cc988a7512264
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>拉西瓦水电站监测展示后台</title>
    <link rel="stylesheet" href="../css/zxx/indexPublic.css">
    <link rel="stylesheet" href="../css/zxx/index.css">
    <link rel="stylesheet" href="/layui/css/layui.css">
    <script src="../js/jquery-1.10.1.min.js"></script>
    <script src="../js/echarts.js"></script>
    <script src="../js/zxx/flexible.js"></script>
    <script type="text/javascript" src="../js/jplayer/js/jquery.jplayer.min.js"></script>
    <script src="../layui/layui.js"></script>
    <style>
        *{
            font-family: "微软雅黑 Light";
        }
        .work-tanBox{
            position: fixed;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.7);
        }
        .work-tanBox-inside{
            width: 100%;
            height: 100%;
            position: relative;
        }
        .work-tanBox-bj{
            background:url("../img/zxx/work-tanImg.png") no-repeat center;
            background-size: 100% 100%;
            width: 4.53125rem;
            height: 4rem;
            position: absolute;
            left: calc(50% - 2.265625rem);
            top:calc(50% - 1.7448rem);
            padding: 0.2083rem;
            box-sizing: border-box;
        }
        .work-tanBox-title{
            position: absolute;
            left: calc(50% - 2.265625rem);
            top:calc(45% - 1.7448rem);
            width: 4.53125rem;
            text-align: center;
            color: #fff;
            font-size: 0.1354rem;
        }
        .work-tan-line{
            display: flex;
            align-items: center;
        }
        .work-tan-block{
            display: flex;
            align-items: center;
            margin-right: 0.2604rem;
        }
        .work-tan-line h1{
            color: #00f0ff;
            font-size: 0.09375rem;
            line-height: 2;
        }
        .work-tan-line h2{
            color: #fff;
            font-size: 0.09375rem;
            margin-left: 0.0521rem;
            line-height: 2.5;
        }
        .work-tan-line h3{
            color: #fff;
            font-size: 0.0729rem;
            margin-left: 0.1042rem;
            line-height: 2.5;
        }
        .work-tan-top{
            border-bottom: 2px dotted #00eaff; /*no*/
        }
        .work-tan-bottom{
            display: flex;
            flex-direction: column;
        }
        .work-tab-bottom-line{
            display: flex;
        }
        .work-tab-bottom-line h1{
            color: #00f0ff;
            font-size: 0.09375rem;
            flex: 1;
            text-align: center;
            margin-top: 0.1042rem;
            line-height: 2.5;
        }
        .work-tab-bottom-line h2{
            color: #fff;
            font-size: 0.0729rem;
            flex: 1;
            text-align: center;
            line-height: 2.5;
        }
        .work-tab-bottom-scroll{
            max-height:1.4rem;
            overflow-y: scroll;
        }
        .work-tab-bottom-scroll::-webkit-scrollbar{
            width: 0!important;
        }
        .work-tab-bottom-scroll{
            -ms-overflow-style: none;
        }
        .work-tab-bottom-scroll{
            scrollbar-width:none;
        }
        .closeButton{
            position: absolute;
            right: -0.15625rem;
            top:-0.15625rem;
            width: 0.0833rem;
            height: 0.0833rem;
            cursor: pointer;
        }
        .button1 {
 
            width: 100px;
 
            height: 30px;
 
            font-size: 18px;
 
            font-family: 微软雅黑;
 
            letter-spacing: 8px;
 
            padding-left: 12px;
 
            border-radius: 5px;
 
            background: -webkit-linear-gradient(top, #66B5E6, #2e88c0);
 
            background: -moz-linear-gradient(top, #66B5E6, #2e88c0);
 
            background: linear-gradient(top, #66B5E6, #2e88c0);
 
            background: -ms-linear-gradient(top, #66B5E6, #2e88c0);
 
            border: 1px solid #2576A8;
 
            box-shadow: 0 1px 2px #B8DCF1 inset, 0 -1px 0 #316F96 inset;
 
            color: #fff;
 
            text-shadow: 1px 1px 0.5px #22629B;
 
        }
 
        .button1:hover {
 
            background: -webkit-linear-gradient(top, #8DC9EF, #4E9FD1);
 
            background: -moz-linear-gradient(top, #8DC9EF, #4E9FD1);
 
            background: linear-gradient(top, #8DC9EF, #4E9FD1);
 
            background: -ms-linear-gradient(top, #8DC9EF, #4E9FD1);
 
        }
        .shouquandidian{
            max-height: 0.7rem;
            overflow-y: scroll;
            align-items: baseline;
        }
        #o_areaName{
            width: 78%;
        }
    </style>
</head>
<body>
<div class="index-wrap">
    <!--     <img class="bjGif" src="../img/zxx/bjGif.gif" alt="">-->
    <script src="../js/zxx/header.js"></script>
    <!--<div class="index-header">
       <div class="titlesBox">
           <img class="hearLogo" src="../img/zxx/hearLogo.png" alt="">
       </div>
       <ul class="nav-left">
           <li class="nav-block"><a class="active" href="">首页</a></li>
           <li class="nav-block"><a href="">组织人员管理</a></li>
           <li class="nav-block"><a href="">设备管理</a></li>
       </ul>
       <ul class="nav-right">
           <li class="nav-block"><a href="">首页</a></li>
           <li class="nav-block"><a href="">组织人员管理</a></li>
           <li class="nav-block"><img src="./image/openBtn.png" alt=""></li>
       </ul>
   </div>-->
    <div class="index-name">
        <h1 id="operate"></h1>
    </div>
    <div class="index-main">
        <div class="main-left">
            <div class="main-number">
                <div class="title-box">
                    <img src="../img/zxx/titleIcon1.png" alt="">
                    <h1>门禁授权总数</h1>
                </div>
                <div class="main-number2">
                    <h1 id="work_num"></h1>
                    <!--<h2>当前工作区总人数</h2>-->
                </div>
                <div class="main-number3" id="main-number3">
                </div>
            </div>
            <div class="main-number numberTop" onclick="toLog1(1)">
                <div class="title-box">
                    <img src="../img/zxx/titleIcon2.png" alt="">
                    <h1>工作区人员记录</h1>
                </div>
                <div class="main-number4">
                    <!--<h1>05-20 14:10 <font class="name">张三丰</font>离开6F机组技术供水</h1>-->
                </div>
            </div>
        </div>
        <div class="main-middle">
            <div class="middle-box1">
                <div class="title-box">
                    <img src="../img/zxx/titleIcon5.png" alt="">
                    <h1>监控预警</h1>
                </div>
                <div class="middle-number1">
                    <div class="middleBox-main1">
                        <div class="middle-box-left">
                            <div class="middleIcon-box">
                                <img class="middleIcon1" src="../img/zxx/middleIcon1.png" alt="">
                                <img class="middleIcon2" src="../img/zxx/middleIcon2.gif" alt="">
                            </div>
                            <div>
                                <h1>硬件对接</h1>
                                <h1 id="duijie">运行正常</h1>
                            </div>
                        </div>
                        <div class="middle-box-left">
                            <div class="middleIcon-box">
                                <img class="middleIcon1" src="../img/zxx/middleIcon3.gif" alt="">
                            </div>
                            <div>
                                <h1>核心进程</h1>
                                <h1>运行正常</h1>
                            </div>
                        </div>
                    </div>
                    <div class="middleBox-main2">
                        <div class="middleBox-block">
                            <img src="..//img/zxx/middleImg1.png" alt="">
                            <div class="middle-content">
                                <h1><font class="ts1" id="online">0</font> <span class="s23">/</span> <font class="ts2" id="noOnline">200</font></h1>
                                <h2>指纹读头</h2>
                            </div>
                        </div>
                        <div class="middleBox-block">
                            <img src="../img/zxx/middleImg2.png" alt="">
                            <div class="middle-content">
                                <h1><font class="ts1">0</font> <span class="s23">/</span> <font class="ts2" id="countSum">200</font></h1>
                                <h2>门禁</h2>
                            </div>
                        </div>
                    </div>
                    <div class="middleBox-main3" id="readHeadStatusContent" onclick="toLog1(3)">
                        <!--<h1 class="errorRizhi">异常日志</h1>
                        <div class="middle-content-box">
                            <div class="middle-line errorLine">
                                <span></span>
                                <h1>02-09 14:20 5号指纹读头恢复正常02-09 14:20 5号指纹读头恢复正常</h1>
                            </div>
                            <div class="middle-line">
                                <span></span>
                                <h1>02-09 14:20 5号指纹读头恢复正常</h1>
                            </div>
                            <div class="middle-line errorLine">
                                <span></span>
                                <h1>02-09 14:20 5号指纹读头恢复正常</h1>
                            </div>
                        </div>-->
 
                    </div>
                </div>
            </div>
            <div class="middle-number2">
                <div class="title-box">
                    <img src="../img/zxx/titleIcon6.png" alt="">
                    <h1>门禁许可</h1>
                </div>
                <div class="middleBox-main4">
                    <div class="cj-mj" onclick="goMjxk()">
                        <img src="../img/zxx/middle-mj.png" alt="">
                        <h1>创建门禁许可</h1>
                    </div>
                    <!--<div class="cj-mj2">
                       <h1>2020-05-20 14:10</h1>
                       <h2>6F机组技术供水1号、2号、3号、4号、5号、6号、7
                           </h2>
                    </div>
                    <div class="cj-mj2 nowzx">
                        <h1>2020-05-20 14:10</h1>
                        <h2>6F机组技术供水1号、2号、3号、4号、5号、6号、7
                        </h2>
                    </div>-->
                </div>
            </div>
 
        </div>
        <div class="main-left">
            <div class="main-number numberBetween">
                <div class="clock-top redFont" onclick="openDoor()">
                    <img src="../img/zxx/clockImg1.png" alt="">
                    <h1>全厂门禁系统一键解锁</h1>
                </div>
                <div class="clock-top greenFont" onclick="closeDoor()">
                    <img src="../img/zxx/clockImg2.png" alt="">
                    <h1>全厂门禁系统一键恢复</h1>
                </div>
                <!--<div class="title-box">
                    <img src="../img/zxx/titleIcon3.png" alt="">
                    <h1>授权数据统计</h1>
                </div>
                <div class="main-number2">
                    <h1 id="auth_count"></h1>
                    <h2>授权总次数</h2>
                </div>
                <div class="main-number3">
                    <div class="number3-block">
                        <h1 id="long_auth_data"></h1>
                        <h2>长期授权</h2>
                    </div>
                    <div class="number3-block">
                        <h1 id="short_auth_data"></h1>
                        <h2>临时授权</h2>
                    </div>
                    <div class="number3-block">
                        <h1 id="ERP_auth_data"></h1>
                        <h2>ERP授权</h2>
                    </div>
                </div>-->
            </div>
            <div class="main-number numberTop">
                <div class="title-box">
                    <img src="../img/zxx/titleIcon4.png" alt="">
                    <h1>门禁开启数据统计</h1>
                </div>
                <div class="main-number2">
                    <h1 id="mj_open_count"></h1>
                    <h2>门禁开启总次数 </h2>
                </div>
                <div class="main-number3">
                    <div class="number3-block">
                        <h1 id="long_auth_mj"></h1>
                        <h2>长期授权</h2>
                    </div>
                    <div class="number3-block">
                        <h1 id="short_auth_mj"></h1>
                        <h2>临时授权</h2>
                    </div>
                    <div class="number3-block">
                        <h1 id="ERP_auth_mj"></h1>
                        <h2>工作票授权</h2>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
 
<div class="work-tanBox" style="display: none">
    <div class="work-tanBox-inside">
        <h1 class="work-tanBox-title">工作票执行情况</h1>
        <div class="work-tanBox-bj">
            <img class="closeButton" src="/img/zxx/closeBtn.png" alt="">
            <div class="work-tan-top">
                <div class="work-tan-line">
                    <button style="float: right" class="button1" onclick="quxiao()">取消</button>
                    <button style="float: right" class="button1" onclick="zhongzhi()">终止</button>
                </div>
                <div class="work-tan-line">
                    <h1>工作票名称 :</h1>
                    <h2 id="o_name">6F机组蜗壳盘型阀关闭</h2>
                    <h3 id="o_time">2020-10-21 09:25——2020-10-21 10:25</h3>
                </div>
                <div class="work-tan-line">
                    <div class="work-tan-block">
                        <h1>工作票类型 :</h1>
                        <h2 id="o_type">临时授权</h2>
                    </div>
                    <div class="work-tan-block">
                        <h1>工作票编号 :</h1>
                        <h2 id="o_no">25362486356</h2>
                    </div>
                </div>
                <div class="work-tan-line">
                    <h1>负责人 :</h1>
                    <h2 id="o_fuzeren">张三丰</h2>
                </div>
                <div class="work-tan-line">
                    <h1>同行人 :</h1>
                    <h2 id="o_tongxingren">胡康宝</h2>
                </div>
                <div class="work-tan-line">
                    <div class="work-tan-block">
                        <h1>工作票授权人 :</h1>
                        <h2 id="o_shouquanren">吴丽丽</h2>
                    </div>
                    <div class="work-tan-block">
                        <h1>工作票授权时间 :</h1>
                        <h2 id="o_shouquanTime">2020-10-21 14:00</h2>
                    </div>
                </div>
                <div class="work-tan-line shouquandidian">
                    <h1>授权地点 :</h1>
                    <h2 id="o_areaName"></h2>
                </div>
            </div>
            <div class="work-tan-bottom">
                <div class="work-tab-bottom-line">
                    <h1>点位</h1>
                    <h1>进门时间</h1>
                    <h1>出门时间</h1>
                    <h1>工作时长</h1>
                </div>
                <div class="work-tab-bottom-scroll" id="logContent">
                    <div class="work-tab-bottom-line">
                        <h2>6F机组技术供水1号</h2>
                        <h2>2020-10-21 14:00</h2>
                        <h2>2020-10-21 16:45</h2>
                        <h2>2小时45分钟</h2>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
 
<!-- 播放声音 -->
<div class="jp-audio" style="width: 0px; height: 0px;">
    <div class="jp-type-single">
        <div id="jquery_jplayer_1" class="jp-jplayer"></div>
    </div>
    <div id="jp_playlist_1" class="jp-playlist"></div>
</div>
 
<script src="../js/zxx/ajaxUtil.js"></script>
<script>
 
    // 授权饼状图
    function pie1(res,num){
        var myChart = echarts.init(document.getElementById('main-number3'));
        var datas = res
 
        var colors = ['#08a4ed', '#f93e60', '#36d4a7']
        var legendData = []
        for (var j = 0; j < datas.length; j++) {
            var data = {
                name: datas[j].name,
                icon: 'circle',
                textStyle: {
                    fontSize: 14,
                    color: colors[j]
                }
            }
            legendData.push(data)
        }
        var objData = array2obj(datas, 'name')
        console.log(objData)
        option = {
            legend: {
                orient: 'vertical',
                top: 'center',
                left: '40%',
                itemGap: 20,
                data: legendData,
                formatter: function (name) {
                    return `   ${name}   ${objData[name].value} 人`
                },
                textStyle: {
                    rich: {
                        value: {
                            color: '#82baff',
                            fontSize: 24,
                            fontWeight: 600,
                            fontFamily: 'HuaKang',
                            padding: [0, 10, 0, 30]
                        },
                        unit: {
                            color: '#82baff',
                            fontSize: 14,
                            fontWeight: 600,
                            fontFamily: 'HuaKang',
                            padding: [0, 50, 0, 0]
                        },
                        percent: {
                            color: '#82baff',
                            fontSize: 24,
                            fontWeight: 600,
                            fontFamily: 'HuaKang',
                            padding: [0, 10, 0, 0]
                        }
                    }
                }
            },
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b} : {c} ({d}%)'
            },
            color: colors,
            visualMap: {
                show: false,
                min: 50,
                max: 600,
                inRange: {
                    //colorLightness: [0, 1]
                }
            },
            series: [
                {
                    name: '访问来源',
                    type: 'pie',
                    radius: '60%',
                    center: ['20%', '50%'],
                    label:{
                        normal: {
                            show: false,
                            fontSize:14
                        },
                    },
                    labelLine:{
                        normal: {
                            show: false,
                            lineStyle: {
                                color: 'rgba(255, 255, 255, 0.3)'
                            },
                        }
                    },
                    data: datas,
                    roseType: 'radius',
                    animationType: 'scale',
                    animationEasing: 'elasticOut',
                    animationDelay: function (idx) {
                        return Math.random() * 200
                    }
                }
            ]
        }
 
        /**
         * @introduction 把数组中key值相同的那一项提取出来,组成一个对象
         * @description 详细描述
         * @param {参数类型} array 传入的数组 [{a:"1",b:"2"},{a:"2",b:"3"}]
         * @param {参数类型} key  属性名 a
         * @return {返回类型说明}
         * @exception [违例类型] [违例类型说明]
         */
        function array2obj (array, key) {
            var resObj = {}
            for (var i = 0; i < array.length; i++) {
                resObj[array[i][key]] = array[i]
            }
            return resObj
        }
 
        myChart.setOption(option);
    };
 
    var visitForm = {};
    visitForm.pageNum = 1
    visitForm.pageSize = 30
    $(function () {
        //获取操作人和操作时间
        //$.operate.post("/station/workUser/getWorkUserAuthorizationType", {}, getWorkUserAuthorizationType);
        $.operate.post("/station/workUser/getUserAndTime", {}, getUserAndTime);
        //获取门禁许可(工单)
        $.operate.post("/station/order/getOrderList", {validFlag:1}, getOrderList);
        //统计读头在线状态
        $.operate.post("/station/head/countShowStatus", {}, getShowStatus);
        //读头在线状态内容
        $.operate.post("/station/equipment/list", {}, getEquipmentStatus);
        //门禁数量
        $.operate.post("/station/door/countSum", {}, getCountSum);
        //统计
        $.operate.post("/station/statistic/list", {}, getStatistic);
        $.operate.post("/station/log/list", visitForm, getVisitLog);
 
        setInterval(function () {
            //统计读头在线状态
            $.operate.post("/station/head/countShowStatus", {}, getShowStatus);
            //读头在线状态内容
            $.operate.post("/station/equipment/list", {}, getEquipmentStatus);
            //门禁数量
            $.operate.post("/station/door/countSum", {}, getCountSum);
        }, 1000*60*2);
 
        setInterval(function () {
            //统计
            $.operate.post("/station/statistic/list", {}, getStatistic);
            $.operate.post("/station/log/list", visitForm, getVisitLog);
        }, 1000*10);
 
        $(document).ready(function () {
            $("#jquery_jplayer_1").jPlayer({
                ready: function (event) {
                    $(this).jPlayer("setMedia", {
                        oga: "/mp3/baojing.mp3"
                    });
                },
                swfPath: "${ctx}/jplayer/js",
                supplied: " oga",
                wmode: "window"
            });
 
        });
    });
 
    function getVisitLog(res){
        if(res.rows) {
            $(".main-number4").empty();
            var userWorkStr = [];
            var visitLogList = res.rows;
            $.each(visitLogList, function (key, value) {
                var direction = value.direction == 0 ? " 进门" : " 出门"
                userWorkStr.push("<h1>"+value.createTime+" <font class='name'>"+value.userName+"</font> 在"+value.doorName+direction+"</h1>");
            });
 
            $(".main-number4").append(userWorkStr.join(''));
        }
    }
 
    var tl = null;
    function getStatistic(res) {
        if(res.statu1==0){
            $('#duijie').html('<font style="color:red">运行异常</font>')
            clearInterval(tl);
            $(document.body).removeAttr("style");
            tl = setInterval("shanShuo()", 500);
            $("#jquery_jplayer_1").jPlayer("play");
        }else{
            clearInterval(tl);
            $(document.body).removeAttr("style");
            $('#duijie').html('运行正常')
            $("#jquery_jplayer_1").jPlayer("stop");
        }
        $("#long_auth_mj").text(res.teamopen);
        $("#short_auth_mj").text(res.orderopen1);
        $("#ERP_auth_mj").text(res.orderopen2);
        $("#mj_open_count").text(res.teamopen+res.orderopen1+res.orderopen2);
 
        $("#work_num").text(res.teamnum+res.ordernum1+res.ordernum2);
        var jsonPie = [{value: res.teamnum, name: "长期授权"}, {value: res.ordernum1, name: "临时授权"}, {value: res.ordernum2, name: "工作票授权"}]
        pie1(jsonPie,$("#work_num").val());
    }
 
    var ssflag=0;
    function shanShuo(){
        if(ssflag==0){
            $(document.body).css({ width: '100%', height: '100%', zIndex: '99999', position: 'fixed',
                filter: 'Alpha(opacity=60)', backgroundColor: 'red', top: '0', left: '0', opacity: '0.6'
            });
            ssflag=1;
        }else{
            $(document.body).css({ width: '100%', height: '100%', zIndex: '99999', position: 'fixed',
                filter: 'Alpha(opacity=60)', backgroundColor: 'black', top: '0', left: '0', opacity: '0.6'
            });
            ssflag=0;
        }
    }
 
    //获取操作人和操作时间
    function getUserAndTime(res) {
        if(res.code == 0) {
            var user = res.data.user;
            // var time = res.data.time;
            if(user == null || user == "" || typeof user =="undefined") {
                $("#operate").text("当前操作员:未知");
            }else {
                $("#operate").text("当前操作员:"+user.userName);
            }
           /* if(time == null || time == "" || typeof time =="undefined") {
                $("#operatTime").text("未知");
            }else {
                $("#operatTime").text(time);
            }
            $("#operatTime").text(time);*/
        }
    }
 
    //获取工作区人数
    function getWorkNum(res) {
        if(res.code == 0) {
            var workNum = res.data;
            // $("#work_num").text(workNum);
        }
    }
 
    //获取用户授权方式(当前有效授权人数)
    function getWorkUserAuthorizationType(res) {
        pie1(res.data.model,res.data.num)
        if(res.code == 0) {
            var longAuth = res.data.longAuth;
            var shortAuth = res.data.shortAuth;
            var ERPAuth = res.data.ERPAuth;
            $("#long_auth").text(longAuth);
            $("#short_auth").text(shortAuth);
            $("#ERP_auth").text(ERPAuth);
            $("#work_num").text(res.data.num);
        }
    }
 
    //授权总次数
    function getAuthCount(res) {
        if(res.code == 0) {
            var authCount = res.data;
            $("#auth_count").text(authCount);
        }
    }
 
    //授权数据统计-》授权方式
    function getAuthDataType(res) {
        if(res.code == 0) {
            var longAuth = res.data.longAuth;
            var shortAuth = res.data.shortAuth;
            var ERPAuth = res.data.ERPAuth;
            $("#long_auth_data").text(longAuth);
            $("#short_auth_data").text(shortAuth);
            $("#ERP_auth_data").text(ERPAuth);
        }
    }
 
    //门禁开启总次数
    function getMjOpenCount(res) {
        if(res.code == 0) {
            var mjOpenCount = res.data;
            // $("#mj_open_count").text(mjOpenCount);
        }
    }
 
    //门禁开启数据统计-》授权方式
    function getMjOpenAuthType(res) {
        console.log(res)
        if(res.code == 0) {
            var longAuth = res.data.longAuth;
            var shortAuth = res.data.shortAuth;
            var ERPAuth = res.data.ERPAuth;
            var totalCount = res.data.num;
            console.log(shortAuth)
            console.log(ERPAuth)
            $("#long_auth_mj").text(longAuth);
            $("#short_auth_mj").text(shortAuth);
            $("#ERP_auth_mj").text(ERPAuth);
            $("#mj_open_count").text(totalCount);
        }
    }
 
    //工作区人员记录
    function getUserWorkLog(res) {
        if(res.code == 0) {
            var userWorkStr = [];
            var visitLogList = res.data;
            $.each(visitLogList, function (key, value) {
                var direction = value.direction == 0 ? "进门执行" : "出门结束"
                if(value.expandStatus == 1) {
                    userWorkStr.push("<h1>"+value.createTime+" <font class='name'>"+value.userName+"</font>"+direction+"任务</h1>");
                }else {
                    userWorkStr.push("<h1>"+value.createTime+" <font class='name'>"+value.userName+"</font>"+direction+""+value.workOrderName+"</h1>");
                }
            });
 
            $(".main-number4").append(userWorkStr.join(''));
        }
    }
 
    //获取门禁许可(工单)
    function getOrderList(res) {
        if(res.code == 0) {
            var orderStr = [];
            var orderlist = res.data;
            $.each(orderlist, function (key, value) {
                // var area = value.areaNames==null?"":value.areaNames;
                // var content = value.taskName + "区域" + area;
                orderStr.push("<div onclick='toLog2("+value.id+")' class='cj-mj2' style='width: 160px;'>");
                orderStr.push("<h1>"+value.createTime+"</h1>");
                orderStr.push("<h2>"+value.taskName+"</h2>");
                //orderStr.push("<button onclick='toLog1(2)'>查看详情</button>");
                orderStr.push("</div>");
            });
 
            $(".middleBox-main4").append(orderStr.join(''));
        }
    }
 
    function goMjxk(){
        window.location.href = "/createOrderLogin";
    }
 
    //读头状态统计
    function getShowStatus(res){
        $("#online").text(res.count2);
        $("#noOnline").text(res.count1);
 
    }
 
    //读头详细内容
    function getEquipmentStatus(res) {
        var content=''
        content+='<h1 class="errorRizhi">异常日志</h1>'
        content+='<div class="middle-content-box">'
        $.each(res, function (key, value) {
            if(value.status==1){
                content+='<div class="middle-line"> <span></span><h1>'+value.content+' 网络中断恢复</h1></div>'
            }else{
                content+='<div class="middle-line"> <span></span><h1>'+value.content+' 网络中断</h1></div>'
            }
 
        });
        content+='<div>'
        $('#readHeadStatusContent').html(content);
    }
 
 
    function goIndexBack(){
        window.location.href = "/indexBack";
    }
 
    function getCountSum(res){
        $("#countSum").text(res.countSum);
    }
 
    //一键开门
    function openDoor(){
        var msg=confirm("确认开锁吗!");
        if (msg==false) {
            return false;
        }if (msg==true) {
            $.operate.post("/station/opendoor/openDoor", {},function a(res) {
                alert("操作成功")
            });
        }
    }
 
    //一键关门
    function closeDoor(){
        var msg=confirm("确认恢复吗!");
        if (msg==false) {
            return false;
        }if (msg==true) {
            $.operate.post("/station/opendoor/openDoor", {},function a(res) {
                alert("操作成功")
            });
        }
 
    }
    function operatLog() {
        window.location.href = "/api/visit/goLogQuery";
    }
    function areaUnlock() {
        window.location.href = "/api/visit/areaUnlock";
    }
 
    function getzf(num) {
        if (parseInt(num) < 10) {
            num = '0' + num;
        }
        return num;
    }
 
 
    $(function () {
        setInterval(function(){
            var now = new Date();
            var year = now.getFullYear();
            var month = now.getMonth()+1;
            var date = now.getDate();
            var hours = now.getHours();
            var minutes = now.getMinutes();
            var seconds = now.getSeconds();
            var currentTime = year + "年" + getzf(month) + "月" + getzf(date) + "日 " + getzf(hours) + "时" + getzf(minutes) + "分" + getzf(seconds)+"秒";
                $("#operatTime").text(currentTime);
        },1000)
 
        /*setInterval(function () {
            //10秒刷新页面
            location.reload();
        } ,1000*10);*/
    });
 
    function toLog1(type) {
        window.location.href = "/api/visit/goLogQuery";
    }
 
    var o_id = "";
    function toLog2(id) {
        o_id = id;
        $.operate.post("/station/pushLog/findById", {id:id}, getPushLog);
        $.operate.post("/station/log/list2", {workOrderId:id}, pushLogByOrderId);
        $(".work-tanBox").show()
    }
 
    function getPushLog(v){
        $('#o_name').html(v.taskName);
        $('#o_time').html(v.startTime+" -- "+v.endTime);
        $('#o_fuzeren').html(v.userName);
        $('#o_tongxingren').html(v.togetherUserNames);
 
        $('#o_no').html(v.orderNo);
        if(v.openMode==0){
            $('#o_type').html("临时授权");
        }
        if(v.openMode==1){
            $('#o_type').html("工作票授权");
        }
        if(v.openMode==2){
            $('#o_type').html("外包工程工作票授权");
        }
        $('#o_shouquanTime').html(v.createTime);
        $('#o_shouquanren').html(v.createBy);
        $('#o_areaName').html(v.areaName);
 
    }
 
    $(".closeButton").click(function () {
        $(".work-tanBox").hide()
    })
 
    function  pushLogByOrderId(res) {
        $('#logContent').html("")
        var contents = "";
        for(var i=0;i<res.length;i++){
            var data = res[i];
            var endTime = "";
            if(data.endTime){
                endTime = data.endTime;
            }
            contents+='<div class="work-tab-bottom-line"><h2>'+data.areaName+'</h2><h2>'+data.createTime+'0</h2><h2>'+endTime+'</h2><h2>'+data.deptName+'</h2></div>';
        }
        $('#logContent').html(contents)
    }
 
    function quxiao() {
        var msg=confirm("确认取消吗!");
        if (msg==false) {
            return false;
        }if (msg==true) {
            $.operate.post("/station/order/quxiao", {id:o_id},function a(res) {
                alert("操作成功")
                location.reload();
            });
        }
    }
 
    function zhongzhi(){
        var msg=confirm("确认终止吗!");
        if (msg==false) {
            return false;
        }if (msg==true) {
            $.operate.post("/station/order/quxiao", {id:o_id},function a(res) {
                alert("操作成功")
                location.reload();
            });
        }
    }
</script>
</body>
</html>