jinlin
2023-11-10 ec5237992ac60b6eb0df07ad3f5038b52a582882
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
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
<template>
  <div class="aui-navbar" :class="`aui-navbar--${$store.state.navbarLayoutType}`">
    <div class="aui-navbar__header">
      <h1 class="aui-navbar__brand" @click="gotoHome" style="font-size: 16px">
        <img :src="srcUrl" width="30" height="30" alt="">
        <a class="aui-navbar__brand-lg" href="javascript:;">
          {{ $store.state.word.systemName }}<span style="color:red">{{ $store.state.word.mj }}</span></a>
        <a class="aui-navbar__brand-mini" href="javascript:;">{{ $store.state.word.systemName }}&ensp;<span
          style="color:red">{{ $store.state.word.mj }}</span></a>
      </h1>
    </div>
    <div class="aui-navbar__body">
      <el-menu class="aui-navbar__menu mr-auto" mode="horizontal">
        <!--        <el-menu-item index="1" @click="$store.state.sidebarFold = !$store.state.sidebarFold">-->
        <!--          <svg class="icon-svg aui-navbar__icon-menu aui-navbar__icon-menu&#45;&#45;switch" aria-hidden="true">-->
        <!--            <use xlink:href="#icon-outdent"></use>-->
        <!--          </svg>-->
        <!--        </el-menu-item>-->
        <el-menu-item index="2" @click="getRecordNumber(3);Collapse()">
          <i class="el-icon-s-fold"></i>
        </el-menu-item>
        <el-menu-item index="3" @click="refresh()">
          <i class="el-icon-refresh"></i>
        </el-menu-item>
        <el-menu-item index="4" >
          <span style="font-size: 16px">联系人: 杨凯,15072707727</span>
        </el-menu-item>
      </el-menu>
      <!--      <el-form :inline="true" @submit.native.prevent @keyup.enter.native="search()" style="margin-right: 5px;">-->
      <!--        <el-form-item>-->
      <!--          <el-input v-model="dataForm.keyword" placeholder="综合查询" id="materialSearch"-->
      <!--                    style="width: 300px;margin-top:5px;"/>-->
      <!--        </el-form-item>-->
      <!--        &lt;!&ndash;<el-form-item class="message-btn">&ndash;&gt;-->
      <!--        &lt;!&ndash;<zt-button type="query" @click="search()" style="margin-top:9px;"></zt-button>&ndash;&gt;-->
      <!--        &lt;!&ndash;</el-form-item>&ndash;&gt;-->
      <!--      </el-form>-->
      <el-menu class="aui-navbar__menu" mode="horizontal" style=":hover{background:none} !important;">
        <!--        <el-menu-item>-->
        <!--          <local-ship-selector v-model="localShip" placeholder="舷号"/>-->
        <!--        </el-menu-item>-->
          <el-menu-item v-if="help_show" index="4">
            <el-badge :value="feedCount" class="item" :hidden="!isAdmin">
            <el-tooltip class="item" effect="dark" content="意见反馈" placement="bottom">
              <i @click="toFeedBack()" style="font-size: 24px;margin-top:22px" class="el-icon-edit-outline"></i>
            </el-tooltip>
            </el-badge>
          </el-menu-item>
<!--        <el-menu-item>-->
<!--          <el-badge :value="feedCount" class="item" :hidden="!isAdmin">-->
<!--          <el-button @click="toFeedBack()" type="text">意见反馈</el-button>-->
<!--          </el-badge>-->
<!--        </el-menu-item>-->
        <el-tooltip class="item" effect="dark" content="帮助" placement="bottom">
          <el-menu-item v-if="help_show" index="4">
            <router-link tag="a" target="_blank" :to="{name:'userHelp',params:{id:0}}">
              <i class="bz-iconfont icon-bangzhu"></i>
            </router-link>
          </el-menu-item>
        </el-tooltip>
        <!--<el-menu-item class="menu">
          <el-badge :value="taskCount" class="item">
            <el-popover
              placement="bottom"
              width="800"
              trigger="hover">
              <i @click="task()" slot="reference" class="wt-iconfont icon-lingdang"></i>
              <zt-button type="primary" style="margin-bottom: 6px; float: right; margin-right: 40px"
                         @click="addOneClassFile1">一键已阅
              </zt-button>
              <el-table :data="gridData" lazy load="true" style="margin-top:10px;" height="300"
                        :default-sort="{prop: 'createDate', order: 'descending'}">
                <el-table-column width="80" type="index" :index="indexMethod" label="序号" align="center">
                </el-table-column>
                <el-table-column property="deptName,model,taskType" label="摘要" align="center">
                  <template slot-scope="scope">
                    <span @click="getJsfa(scope.row)" v-if="scope.row.code === 1" style="cursor: pointer">
                      {{ scope.row.deptName }}已上传{{ scope.row.model }}工程{{ scope.row.busiFieldName }}
                    </span>
                    <span style="cursor: pointer" v-else>{{ scope.row.model }}工程工程单{{ scope.row.taskType }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="操作" width="130" align="center">
                  <template v-slot="{ row }">
                    <zt-table-button v-if="row.code === 1" @click="addOneClassFile(row,1)">已阅</zt-table-button>
                    &lt;!&ndash;                      <zt-table-button v-if="row.code === 1" @click="addOneClassFile(row,2)">一键已阅</zt-table-button>&ndash;&gt;
                    <zt-table-button v-else @click="task(row)" style="color: coral">办理</zt-table-button>
                  </template>
                </el-table-column>
                <template slot="append">
                  <InfiniteLoading
                    @infinite="load"
                    spinner="circles"
                    force-use-infinite-wrapper=".el-table__body-wrapper">
                    <div slot="spinner">加载中...</div>
                    <div slot="no-more">所有数据加载完毕</div>
                    <div slot="no-results">加载完毕</div>
                  </InfiniteLoading>
                </template>
              </el-table>
            </el-popover>
          </el-badge>
        </el-menu-item>-->
        <el-menu-item v-if="$store.state.isGoToHome"  @click="goToIndex()">回到首页</el-menu-item>
        <!--<a href="#" @click="myNoticeRouter()"><i class="el-icon-bell"></i></a>-->
        <!--</el-badge>-->
        <!--</el-menu-item>-->
        <el-tooltip class="item" effect="dark" content="全屏" placement="bottom">
          <el-menu-item index="4" @click="fullscreenHandle('formal')">
            <svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true">
              <use xlink:href="#icon-fullscreen"></use>
            </svg>
          </el-menu-item>
        </el-tooltip>
        <el-tooltip class="item" effect="dark" content="投屏" placement="bottom">
          <el-menu-item index="4" @click="fullscreenHandle('large')" style="padding-top:2px;">
            <i class="el-icon-full-screen" aria-hidden="true">
              <use xlink:href="#icon-fullscreen"></use>
            </i>
          </el-menu-item>
        </el-tooltip>
        <el-menu-item index="1" class="aui-navbar__avatar" v-if="loginType === 'syLogin'">
          <el-dropdown trigger="click" @command="changeSystem">
            <span class="el-dropdown-link" style="font-weight: 700;font-size: 20px">
              {{ systemName }}
            </span>
            <el-dropdown-menu slot="dropdown" class="el-dropdown-link-xt">
              <el-dropdown-item :command="item" v-for="item in systemList" :key="item.name" :value="item.id" v-show="!item.disabled">
                {{ item.text }}
              </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </el-menu-item>
        <el-menu-item index="5" class="aui-navbar__avatar" @click="getRecordNumber(4)">
          <el-dropdown placement="bottom" :show-timeout="0">
            <span class="el-dropdown-link">
              <!--<img src="~@/assets/img/avatar.png">-->
              <span>{{ $store.state.user.name }}({{ userRoleInfo.roleName }})</span>
              <i class="el-icon-arrow-down"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item @click.native="changeTheme()">{{ $t('changeTheme') }}</el-dropdown-item>
              <!--              <el-dropdown-item @click.native="updatePasswordHandle()">{{ $t('updatePassword.title') }}-->
              <!--              </el-dropdown-item>-->
              <el-dropdown-item @click.native="logoutHandle()">{{ $t('logout') }}</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </el-menu-item>
        <div class="aui-theme-tools" :class="{ 'aui-theme-tools--open': isOpen }">
          <!-- <div class="aui-theme-tools__toggle" @click="isOpen = !isOpen">
            <svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-setting"></use></svg>
          </div> -->
          <div id="div_panel" class="aui-theme-tools__content">
            <div class="aui-theme-tools__item">
              <h3>主题</h3>
              <div style="margin: 20px 0">
                <el-radio-group v-model="$store.state.theme" size="mini" @change="themehangeHandle">
                  <el-radio-button label="light">浅色</el-radio-button>
                  <el-radio-button label="high">深色</el-radio-button>
                </el-radio-group>
              </div>
            </div>
          </div>
        </div>
      </el-menu>
    </div>
    <!-- 弹窗, 修改密码 -->
    <update-password v-if="updatePasswordVisible" ref="updatePassword"></update-password>
<!--    <el-dialog title="系统功能" top="10vh" append-to-body width='85%' v-if="dialogVisible" v-dialogDrag :visible.sync="dialogVisible">-->
<!--      <el-tabs id="scheduleTabs" v-model="activeName" @tab-click="getDiagramProject">-->
<!--        <el-tab-pane label="问题解决方案" name="1">-->
<!--          <QuestionSolution></QuestionSolution>-->
<!--        </el-tab-pane>-->
<!--        <el-tab-pane label="表关联管理" name="2">-->
<!--          <TableRelation></TableRelation>-->
<!--        </el-tab-pane>-->
<!--        <el-tab-pane label="数据字典" name="3">-->
<!--          <DatabaseTableInfo></DatabaseTableInfo>-->
<!--        </el-tab-pane>-->
<!--        <el-tab-pane label="表结构维护" name="4">-->
<!--          <TableStructMaintain></TableStructMaintain>-->
<!--        </el-tab-pane>-->
<!--      </el-tabs>-->
<!--    </el-dialog>-->
    <sysFeedBack ref="sysFeedBack" @refreshDataList="getFeedCount"></sysFeedBack>
  </div>
 
</template>
<script>
  import Cookies from 'js-cookie'
  import screenfull from 'screenfull'
  // import UpdatePassword from './main-navbar-update-password'
  import {clearLoginInfo} from '../../../packages/utils'
  import debounce from 'lodash/debounce'
  import router from '../../router'
  import InfiniteLoading from 'vue-infinite-loading'
  import srcUrl from '../../../public/logo.png'
 
  function addEventHandler(target, type, func) {
    if (target.addEventListener) {
      target.addEventListener(type, func, false)
    } else if (target.attachEvent) {
      target.attachEvent('on' + type, func)
    } else {
      target['on' + type] = func
    }
  }
 
  function removeEventHandler(target, type, func) {
    if (target.removeEventListener) {
      target.removeEventListener(type, func, false)
    } else if (target.detachEvent) {
      target.detachEvent('on' + type, func)
    } else {
      delete target['on' + type]
    }
  }
 
  function documentMouseDown(e) {
    var element = typeof event !== 'undefined' ? event.srcElement : e.target
    var downPanel = false
    while (element) {
      downPanel = element === document.getElementById('div_panel')
      if (downPanel) break
      element = element.parentNode
    }
    if (!downPanel) {
      removeEventHandler(document, 'mousedown', documentMouseDown)
      document.getElementById('div_panel').style.display = 'none'
    }
  }
 
  // var socket = null
  export default {
    inject: ['Collapse', 'refresh'],
    props: {
      letter: String,
      falg: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        help_show:true,
        loginType:'',
        activeName: '1',
        dialogVisible: false,
        recordNumber: 0,
        srcUrl: srcUrl,
        pageIndex: 1,
        pageSize: 60,
        technologyurl: '',
        userRoleInfo: {},
        msg: '',
        gridData: [],
        isOpen: false,
        localShip: 0,
        themeColor: '',
        dataForm: {
          keyword: ''
        },
        updatePasswordVisible: false,
        messageTip: false,
        taskCount: '',
        taskList: [],
        feedCount:'',
        system:'',
        isAdmin:false
      }
    },
    computed: {
      systemList() {
        return [
          {
            permission: ['menu:technicalConditions'],
            path: 'http://' +
              location.hostname +
              ':8080/technicalConditions/boatSystemStructure',
/*              ?username=' +
              Cookies.get('username') + '&loginType=' +
              Cookies.get('loginType') + '&token=' +
              Cookies.get('singleSignToken') + '&area=' +
              Cookies.get('area'),*/
            key: 'technicalConditions',
            text: '技术状态'
          },
          {
            permission: ['menu:replaceProblem'],
            path: 'http://' +
              location.hostname +
              ':8080/replaceProblem/replaceProjectHomePage',
              // ?username=' +
              // Cookies.get('username') + '&loginType=' +
              // Cookies.get('loginType') + '&token=' +
              // Cookies.get('singleSignToken') + '&area=' +
              // Cookies.get('area'),
            key: 'replaceProblem',
            text: '改换装'
          },
          {
            permission: ['menu:jszl'],
            path: 'http://' +
              location.hostname +
              ':1811/login?username=' +
              Cookies.get('username') + '&loginType=' +
              Cookies.get('loginType') + '&token=' +
              Cookies.get('singleSignToken') + '&area=' +
              Cookies.get('area'),
            text: '技术资料',
          },
          {
            permission: ['menu:smj'],
            path:
              'http://' +
              location.hostname + ':8020/#/single?' + 'username=' +
              Cookies.get('username') + '&system=smj' +
              '&loginType=' +
              Cookies.get('loginType') + '&token=' +
              Cookies.get('singleSignToken') + '&area=' +
              Cookies.get('area'),
            text: '寿命件数据'
          },
          {
            permission: ['menu:ajqc'],
            path:
              'http://' +
              location.hostname +
              ':1812/login?username=' +
              Cookies.get('username') + '&loginType=' +
              Cookies.get('loginType') + '&token=' +
              Cookies.get('singleSignToken') + '&area=' +
              Cookies.get('area'),
            text: '器材数据',
            disabled: !(Cookies.get('area') === 'O')
          },
          {
            permission: ['menu:ajqc'],
            path:
              'http://' +
              location.hostname +
              ':1800/login?username=' +
              Cookies.get('username') + '&loginType=' +
              Cookies.get('loginType') + '&token=' +
              Cookies.get('singleSignToken') + '&area=' +
              Cookies.get('area'),
            text: '器材数据',
            disabled: !(Cookies.get('area') === '1')
          },
          {
            permission: ['menu:syajqc'],
            path:
              'http://' +
              location.hostname +
              ':1813/login?username=' +
              Cookies.get('username') + '&loginType=' +
              Cookies.get('loginType') + '&token=' +
              Cookies.get('singleSignToken') + '&area=' +
              Cookies.get('area'),
            text: '器材数据',
            disabled: !(Cookies.get('area') === '2')
          },
          {
            permission: ['menu:qddjxl'],
            path: 'http://' +
                location.hostname +
              ':8080/qdGradeRepair/maintenanceHome?username=' +
              Cookies.get('username') + '&loginType=' +
              Cookies.get('loginType') + '&token=' +
              Cookies.get('singleSignToken') + '&area=' +
              Cookies.get('area'),
            key: 'qdGradeRepair',
            text: '等级修理',
            disabled: !(Cookies.get('area') === '1')
          },
          {
            permission: ['menu:qdlqx'],
            path: 'http://' +
                location.hostname +
              ':8080/qdRepair/qdlndex?username=' +
              Cookies.get('username') + '&loginType=' +
              Cookies.get('loginType') + '&token=' +
              Cookies.get('singleSignToken') + '&area=' +
              Cookies.get('area'),
            key: 'qdRepair',
            text: '临抢修',
            disabled: !(Cookies.get('area') === '1')
          },
          {
            permission: ['menu:sydjxl'],
            path: 'http://' +
              location.hostname + ':8020/#/single?' + 'username=' +
              Cookies.get('username') + '&system=wxxt' +
              '&loginType=' +
              Cookies.get('loginType') +
              '&token=' + Cookies.get('singleSignToken') + '&area=' +
              Cookies.get('area'),
            key: 'gradeRepair',
            text: '修理数据',
            disabled: !(Cookies.get('area') === 'O')
          },
          {
            permission: ['menu:sydjxl'],
            path:
              'http://' +
              location.hostname + ':8020/#/single?' + 'username=' +
              Cookies.get('username') + '&loginType=' +
              Cookies.get('loginType') + '&system=djxl' +
              '&token=' + Cookies.get('singleSignToken') + '&area=' +
              Cookies.get('area'),
            key: 'gradeRepair',
            text: '等级修理',
            disabled: !(Cookies.get('area') === '2')
          },
          {
            permission: ['menu:peixun'],
            path:
              'http://' +
              location.hostname + ':8221/single?' + 'username=' +
              Cookies.get('username') + '&loginType=' +
              Cookies.get('loginType') + '&token=' +
              Cookies.get('singleSignToken') + '&area=' +
              Cookies.get('area'),
            key: 'peixun',
            text: '培训系统'
          },
          {
            permission: ['menu:preventivemaintenance'],
            path: 'http://' +
              location.hostname + ':8080/preventiveMaintenance/troopProject?username=' +
              Cookies.get('username') +
              '&loginType=' +
              Cookies.get('loginType') +
              '&token=' + Cookies.get('singleSignToken') + '&area=' +
              Cookies.get('area'),
            key: 'preventiveMaintenance',
            text: '预防性维修'
          },
          // {
          //   permission: ['menu:checkManage'],
          //   path: '/stateManagement/manage', key: 'stateManagement',
          //   text: '应急排查'
          // },
          {
            permission: ['menu:pinggu'],
            path:
              'http://' +
              location.hostname + ':8701/user/ssoLogin?' + 'username=' +
              Cookies.get('username') + '&loginType=' +
              Cookies.get('loginType') +
              '&token=' + Cookies.get('singleSignToken') + '&area=' +
              Cookies.get('area'),
            key: 'pinggu',
            disabled: Cookies.get('area') === '2',
            text: '技术状态评估'
          }
          // ,
          // {
          //   permission: 0,
          //   path: '/qualityProblem/inhandle', key: 'qualityProblem',
          //   text: '质量问题管理'
          // },
          // {
          //   permission: ['menu:feedback'], path: ' /feedback/knowledge', key: 'feedback',
          //   text: '经验反馈',
          //   img: require('@/assets/image/select/situationlmg/21.png'),
          //   imgdisabled: require('@/assets/image/select/situationImg/21.disabled.png')
          // },
          // {
          //   permission: ['menu:system'], key: 'system',
          //   text: '系统配置'
          // },
          // {
          //   permission: ['menu:workflow'], key: 'workflow',
          //   text: '协同办公',
          //   img: require('@/assets/image/select/situationlmg/22.png'),
          //   imgdisabled: require('@/assets/image/select/situationlmg/22.disabled.png')
          // }
        ]
      },
      systemName() {
        if (Cookies.get('system') == 'djxl') {
          return this.systemList[10].text
        } else if (Cookies.get('system') == 'smj'){
          return this.systemList[3].text
        } else if (Cookies.get('system') == 'wxxt'){
          return this.systemList[9].text
        }
      }
    },
    // components: {
    //   // UpdatePassword,
    //   InfiniteLoading,
    //   TableStructMaintain,
    //   TableRelation,
    //   QuestionSolution,
    //   DatabaseTableInfo,
    //   sysFeedBack
    // },
    created() {
      let that = this
      this.getUserRoleInfo()
      this.$EventBus.$on('changeTheme', function () {
        that.isOpen = true
      })
      //this.systemList = window.SITE_CONFIG['menuList']
      console.log(this.systemList, 'this.systemList')
      this.loginType=Cookies.get('loginType')
      // Cookies.get('loginType')
    },
    watch: {
      themeColor(val) {
        this.$router.go(0)
      },
      '$route.params.keyword'() {
        this.dataForm.keyword = this.$route.params.keyword
        this.query()
      },
      localShip(val) {
        this.$store.commit('setLocalShip', val)
      },
    },
    mounted() {
      // alert(`${window.SITE_CONFIG['apiURL']}/sys/oss/commFile?fileFlag=logo`)
      // this.srcUrl = `${window.SITE_CONFIG['apiURL']}/sys/oss/commFile?fileFlag=logo&token=${Cookies.get('token')}`
      // this.srcUrl = require('../../../public/logo.png')
 
      // this.$http.get('http://127.0.0.1:8086/life-protection/sys/oss/commFile?fileFlag=logo').then(res => {
      //   console.log(res,'res')
      // })
      // this.getUserRoleInfo()
      this.system = this.$store.state.user.system
/*      alert(this.system)
      if(this.system){
        if(this.system==='djxl'|| this.system==='smj'){
          this.help_show = true
        }
      }*/
      // if (Cookies.get('system') === "djxl" || Cookies.get('system') === "smj" ){
      //   this.help_show = true
      // }
 
      this.$EventBus.$on('formSubmit', (msg) => {
        this.msg = msg
        this.getOneClassFile()
        // console.log(msg)
      })
      this.$EventBus.$on('reLogin', () => {
        this.gotoLogin()
      })
      this.$EventBus.$on('singleSignVerify', () => {
        let token = Cookies.get('singleSignToken')
        let verifyUrl = Cookies.get('singleSignVerifyUrl')
        // console.log('singleSignVerifyUrl', verifyUrl)
        // console.log('singleSignToken',token)
        if (verifyUrl && token) {
          console.log('do singleSignVerify')
/*          this.$http2.get(verifyUrl, {params: {token: token}}).then(res => {
            console.log(res,'singleSignVerify return')
          })*/
        }
      })
 
      if (Cookies.get('loginMethod') === 'single'){
        this.technologyurl = 'http://'+location.hostname+':8080/select'
        this.loginUrl = 'http://'+location.hostname+':8080/login'
      }else{
        this.technologyurl = 'http://'+location.hostname+':8020/#/home'
        this.loginUrl = 'http://'+location.hostname+':8020/#/login'
      }
/*      this.$http.get('/sys/data/export/inte/technologyurl').then(res => {
        this.technologyurl = res.data.url
      })
      this.$http.get('/sys/data/export/inte/loginurl').then(res => {
        this.loginUrl = res.data.url
      })*/
 
      this.getTaskCount()
      this.getFeedCount()
      this.getOneClassFile()
      // console.log(this.$store.state.user,'this.$store.state.user.debug navbar6666666666')
      if (!this.$store.state.debug) {
        setInterval(this.getOneClassFile, 60000)
      }
 
      if (this.$store.state.user.isCjRole) {
        this.$http.get('/task/taskCenter/page').then(res => {
          console.log(res.data, 'res.data嘿嘿嘿')
          let data = res.data
          for (let val of data) {
            if (val.stepMarker == 'work_cjtx') {
              this.$http.get(`/task/planTask/${val.bizId}`).then(res => {
                let DiffDay = this.getDiffDay(res.data.checkDate, new Date())
                if (DiffDay <= 7 && DiffDay > -1) {
                  return this.$tip.confirm('工程项目' + val.topic + '的第' + res.data.startPeriod + '期的周计划任务审核时间剩余' + DiffDay + '天,请尽快完成任务填写!')
                }
              })
            }
          }
        })
      }
      this.isAdmin = this.$store.state.user.isAdmin
    },
    methods: {
      getHelp(){
        console.log(this.system)
        if(this.system&&this.system==='smj'){
          window.open('./help/smjVideo/index.html','_blank');
        }else if(this.system==='djxl') {
          window.open('./help/djxlVideo/index.html','_blank');
        }
      },
      async load($state) {
        //调用获取表格数据的接口
        await this.$http.get(`/task/OneClassFile/fileNotice?pageIndex=${this.pageIndex}&pageSize=${this.pageSize}`).then(res => {
          console.log(res, 'res')
          if (res && res.success) {
            if (this.pageIndex === 1) {
              this.gridData = res.data     //首先加载后端返回的第一页的数据显示在表格中
              $state.complete()   //加载完成的状态
            } else {
              if (!res.data || res.data.length < this.pageSize) {
                $state.complete()   //加载完成的状态
              } else {
                this.gridData = this.gridData.concat(res.data)   //将后端新返回的数据拼接在原表格后面
                $state.loaded()     //加载中的状态
              }
            }
            this.pageIndex++    //鼠标在表格底部滑动时,翻页,即当前页数+1
            console.log('123333333333')
          } else {
            $state.complete()      //加载完成的状态
          }
        })
      },
      getDiffDay(date_1, date_2) {
        // 计算两个日期之间的差值
        let totalDays, diffDate
        let myDate_1 = Date.parse(date_1)
        let myDate_2 = Date.parse(date_2)
        // 将两个日期都转换为毫秒格式,然后做差
        diffDate = Math.abs(myDate_1 - myDate_2) // 取相差毫秒数的绝对值
        totalDays = Math.floor(diffDate / (1000 * 3600 * 24)) // 向下取整
        // console.log(totalDays)
        return totalDays    // 相差的天数
      },
      // 获取当前用户登录信息
      getUserRoleInfo() {
        return this.$http.get('/user/userRoleInfo').then(res => {
          this.loading = false
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          this.userRoleInfo = res.data
          if(this.$store.state.user.isZcRole ||
              this.userRoleInfo.roleName=='总体所角色' ||
              this.userRoleInfo.roleName=='代表室角色' ||
              this.userRoleInfo.roleName=='助理角色'||
              this.userRoleInfo.roleName=='部长角色' ||
              this.userRoleInfo.roleName=='处长角色'){
            this.$store.state.isGoToHome = true
          } else{
            this.$store.state.isGoToHome = false
          }
          console.log(this.userRoleInfo, 'userRoleInfo')
        }).catch(() => {
        })
      },
      async gotoHome() {
/*        let res = await this.$http.post('/logout')
        if (!res.success) {
          console.log(res.msg)
        }
        clearLoginInfo()
*/
        window.location.href = this.technologyurl
      },
      // 退出
      async logoutHandle() {
        if (await this.$tip.confirm(this.$t('prompt.info', {'handle': this.$t('logout')}))) {
          let res = await this.$http.post('/logout')
          if (!res.success) {
            return this.$message.error(res.msg)
          }
          this.gotoLogin()
        }
      },
      async gotoLogin() {
        clearLoginInfo()
        console.log(Cookies.get('loginMethod'), 'gotoLogin loginMethod')
        if (Cookies.get('loginMethod') === 'single') {
          window.location.href = this.loginUrl
        } else {
          this.$router.push({name: 'login'})
        }
      },
      async addOneClassFile1() {
        let fileIds = ''
        for (let i = 0; i < this.gridData.length; i++) {
          if (this.gridData[i].code === 1) {
            fileIds = fileIds + this.gridData[i].fileId + ','
          }
        }
        let planId = {
          fileIds: fileIds,
          readerid: this.$store.state.user.id
        }
        let res = await this.$http.post(`/task/OneClassFile/documentReadingRecord`, planId)
        if (res.success) {
          this.getOneClassFile('allRead')
        }
      },
      indexMethod(index) {
        return index += 1
      },
      getJsfa(row) {
        let _this = this
        console.log(row, 'row')
        if (row.busiFieldName === '修理技术方案' || row.busiFieldName === '技术方案2') {
          _this.$router.push({
            name: 'sy-maintain-task-xqzb-repair-skill-scheme',
            params: {
              productId: row.productId
            }
          })
        }
        if (row.busiFieldName === '进厂协议') {
          _this.$router.push({
            name: 'sy-maintain-task-jcxl-JT-enteringPlant.vue',
            params: {
              productId: row.productId
            }
          })
        }
        if (row.busiFieldName === '综合验收') {
          _this.$router.push({
            name: 'sy-maintain-task-jyys-synthetical-test',
            params: {
              productId: row.productId
            }
          })
        }
      },
      async getOneClassFile(code) {
        //console.log(code)
        let res = await this.$http.get(`/task/OneClassFile/fileNotice?pageIndex=${this.pageIndex}&pageSize=${this.pageSize}`)
        if (res.success) {
          console.log(res.data)
          if(res.data.length>0){
            if(res.data[0].total!==undefined){
              this.taskCount = res.data[0].total
            }
            // res.data.sort((a, b) => new Date(b.createDate).getTime() - new Date(a.createDate).getTime())
            this.gridData = res.data
            if (code !== 'allRead') {
              this.pageIndex++
            }
            //console.log(this.gridData, 'this.gridData')
          }
        }
      },
      async addOneClassFile(row, code) {
        let fileIds = ''
        for (let i = 0; i < this.gridData.length; i++) {
          if (this.gridData[i].code === 1) {
            fileIds = fileIds + this.gridData[i].fileId + ','
 
          }
        }
        let planId
        if (code === 1) {
          planId = {
            fileid: row.fileId,
            readerid: this.$store.state.user.id
          }
        }
        if (code === 2) {
          planId = {
            fileIds: fileIds,
            readerid: this.$store.state.user.id
          }
        }
 
        // let userName = this.$store.state.user.id
        // console.log(userName,'userName userName')
        let res = await this.$http.post(`/task/OneClassFile/documentReadingRecord`, planId)
        if (res.success) {
          this.getOneClassFile()
        }
      },
      task(row) {
        this.getRecordNumber(1)
        let menuId = '1439894944222408706'
        let route = window.SITE_CONFIG['dynamicMenuRoutes'].filter(item => item.meta.menuId === menuId)[0]
        if (route === undefined) {
          this.$tip.alert('没有配置菜单权限')
          return
        }
        let params = {
          projectId: row.id, approveStepId: row.approveStepId
        }
        if (Object.keys(params).length > 0) {
          params = Object.assign(params, route.meta.params)
        }
        this.$router.push({
          name: menuId,
          params: params
        })
      },
      async getTaskCount() {
        let res = await this.$http.get(`/task/taskCenter/page`)
        if (res.success) {
          // this.taskCount = res.data.length
          this.taskList = res.data
          // console.log(this.taskList, "12311")
        }
      },
      async getFeedCount() {
        let count = 0
        let res = await this.$http.get(`/sys/feedback/page`)
        if (res.success) {
          console.log(res.data, "feedback......")
          res.data.forEach((item) => {
            if (item.isFinish === null || item.isFinish === 'undefined') {
              count++
            }
          })
          this.feedCount = count
        }
      },
      goToIndex() {
        console.log(this.$store.state.user.roleName,'this.$store.state.user.roleName')
        this.$router.push({name: 'TestDjxlHome',params: {roleName: this.$store.state.user.roleName}})
        // window.console.log(this.$route.name)
      },
      async toFeedBack(){
        this.$nextTick(() => {
          this.$refs.sysFeedBack.$refs.dialog.init();
        })
      },
      themehangeHandle(val) {
        this.themeColor = val
        Cookies.set('systemTheme', val)
        let body = document.querySelector('body')
        let clazz = body.className
        if (val === 'light') {
          clazz = clazz.replace(' high', '').replace(' light', '')
        } else {
          clazz = clazz.replace(' light', '').replace(' high', '')
        }
        body.className = clazz + ' ' + val
        this.isOpen = false
      },
      search() {
        let keyword = document.getElementById('materialSearch').value
        this.$EventBus.$emit('search', keyword)
        if (keyword) {
          this.$router.push({
            name: 'search',
            params: {
              keyword: keyword
            }
          })
        } else {
        }
      },
      // 更换主题
      changeTheme() {
        document.getElementById('div_panel').style.display = ''
        addEventHandler(document, 'mousedown', documentMouseDown)
        this.$EventBus.$emit('changeTheme')
      },
      myNoticeRouter() {
        this.$router.replace('notice-notice-user')
      },
      getUnReadCount() {
        this.$http.get(`/sys/notice/my/unread`).then(res => {
          if (res.code !== 0) {
            return this.$message.error(res.msg)
          }
          if (res.data > 0) {
            this.messageTip = true
          }
        }).catch(() => {
        })
      },
      // 全屏
      fullscreenHandle(param) {
        this.getRecordNumber(2)
        if (!screenfull.enabled) {
          return this.$message({
            message: this.$t('fullscreen.prompt'),
            type: 'warning',
            duration: 500
          })
        }
        // this.is_sidebar = false
        // this.$emit('getSide',this.is_sidebar)
        this.$emit('windowResize', param, this.recordNumber)
        this.$EventBus.$emit('netWorkDiagramHeight', '网络图高度')
        if (!screenfull.isFullscreen) {
          screenfull.toggle()
        }
      },
      getRecordNumber(param) {
        if (param == this.recordNumber + 1) {
          this.recordNumber = param
          if (param == 4) {
            this.recordNumber = 0
            this.dialogVisible = true
 
            this.$store.state.debugging = true
          }
        } else {
          this.recordNumber = 0
        }
      },
      // fullscreenHandleResize(){
      //   if (!screenfull.enabled) {
      //     return this.$message({
      //       message: this.$t('fullscreen.prompt'),
      //       type: 'warning',
      //       duration: 500
      //     })
      //   }
      //   console.log('111111111')
      //   this.$emit('windowResizeHandle','open');
      //   screenfull.toggle()
      // },
      // 修改密码
      // updatePasswordHandle() {
      //   this.updatePasswordVisible = true
      //   this.$nextTick(() => {
      //     this.$refs.updatePassword.init()
      //   })
      // },
      changeSystem(system) {
        console.log(Cookies.get('token'),'Cookies token')
        console.log(system.path,'system.path')
        this.$nextTick(() => {
          window.location.href = system.path
          if (system.path.indexOf('8020')>-1) {
            window.location.reload()
          }
        })
 
        /*      this.$store.state.contentTabs = []
              this.systemName = system.name
              Cookies.set('systemId', system.id)
              this.$store.commit('setMenuList', system.children)
              if (system.children.length > 0) {
                let firstMenu = system.children[0]
                if ((firstMenu.children || []).length > 0) {
                  firstMenu = firstMenu.children[0]
                }
                //if ((firstMenu.url || '').length > 0 && (firstMenu.remark || firstMenu.name).indexOf('首页') >= 0) {
                if ((firstMenu.url || '').length > 0) {
                  this.gotoRouteHandle(firstMenu.id)
                }
              }*/
      },
      gotoRouteHandle(menuId) {
        let route = window.SITE_CONFIG['dynamicMenuRoutes'].filter(item => item.meta.menuId === menuId)[0]
        if (route) {
          this.$router.push({name: route.name})
        }
      },
    }
  }
</script>
<style>
.v-modal {
  opacity: 1;
  background: rgb(48 33 33 / 50%)
}
 
.el-dropdown-link-xt {
  background: #586587;
}
 
.el-dropdown-link-xt .el-dropdown-menu__item {
  color: #fff;
  padding-left: 10px;
  font-size: 16px;
}
 
.el-dropdown-link-xt .el-dropdown-menu__item:hover {
  color: #fff;
  background: #17507c !important
}
</style>