Browse Source

故障实时播报

seimin 3 months ago
parent
commit
da6a8bc141

+ 1 - 1
proxy.conf.json

@@ -1,6 +1,6 @@
1 1
 {
2 2
   "/service": {
3
-		"target": "http://192.168.4.105",
3
+		"target": "http://192.168.3.108",
4 4
     "logLevel": "debug",
5 5
     "changeOrigin": true,
6 6
     "pathRewrite": {

File diff suppressed because it is too large
+ 87 - 10
src/app/views/realtime-broadcast/realtime-broadcast.component.html


+ 458 - 34
src/app/views/realtime-broadcast/realtime-broadcast.component.less

@@ -1,6 +1,14 @@
1 1
 @import "../../../../src/theme.less";
2
+.icon_transport{
3
+  color: @primary-color;
4
+}
5
+.blue{
6
+  color: #57D8FF;
7
+}
2 8
 :host {
3
-  width: 100%;
9
+  width: 100vw;
10
+  height: 100vh;
11
+  background-color: #00253F;
4 12
   .save {
5 13
     position: fixed;
6 14
     left: 0;
@@ -121,57 +129,473 @@
121 129
       }
122 130
     }
123 131
   }
124
-  .incidentConfig{
125
-    padding-bottom: 24px;
132
+  .realtimeBroadcast{
126 133
     height: 100%;
127 134
     display: flex;
128 135
     flex-direction: column;
129 136
     justify-content: space-between;
130
-    background-color: #F0F2F5;
131
-    .tagsAndTemplete{
132
-      height: 64px;
137
+    color: #fff;
138
+    .header{
139
+      height: 48px;
140
+      padding: 0 16px;
133 141
       display: flex;
134 142
       justify-content: space-between;
135 143
       align-items: center;
136
-      .tags{
137
-        height: 100%;
138
-        background: #fff;
139
-        flex: 1;
140
-        padding: 16px 24px;
144
+      background-color: #012F48;
145
+      .title{
141 146
         display: flex;
142 147
         align-items: center;
143
-        justify-content: space-between;
144
-        position: relative;
145
-        .transport-peizhizhongxin{
146
-          color: @primary-color;
148
+        h1{
149
+          margin: 0;
150
+          font-size: 16px;
151
+          font-weight: normal;
152
+          color: #FFFFFF;
153
+        }
154
+        h2{
155
+          margin: 0;
147 156
           font-size: 20px;
148
-          margin-right: 8px;;
157
+          font-weight: bold;
158
+          color: #FFFFFF;
159
+          margin-left: 50px;
149 160
         }
150
-        .tagList{
151
-          width: 100%;
152
-          height: 100%;
153
-          position: absolute;
154
-          left: 0;
155
-          top: 50%;
156
-          transform: translateY(-50%);
161
+      }
162
+      .userInfo {
163
+        height: 100%;
164
+        float: right;
165
+        padding: 0 24px;
166
+        box-sizing: border-box;
167
+        font-size: 14px;
168
+
169
+        // 下拉列表
170
+        &.dropdown{
171
+          position: relative;
172
+          height: 48px;
173
+          line-height: 48px;
174
+          .dropdown-content {
175
+            position: absolute;
176
+            top: 48px;
177
+            background-color: #fff;
178
+            width: 156px;
179
+            box-shadow: 0px 2px 4px 1px #D9D9D9;
180
+            z-index: 999999;
181
+            border-radius: 4px;
182
+            border: 1px solid rgba(0,0,0,0.15);
183
+            color: rgba(0,0,0,0.65);
184
+            &.ct{
185
+              left: 50%;
186
+              transform: translateX(-50%);
187
+            }
188
+            &.r8{
189
+              right: 8px;
190
+            }
191
+          }
192
+
193
+          .dropdown-content .dropdownItem {
194
+            height: 40px;
195
+            cursor: pointer;
196
+            display: flex;
197
+            align-items: center;
198
+            padding: 0 24px;
199
+          }
200
+
201
+          .dropdown-content .dropdownItem:hover {
202
+            background-color: #e9f7e9;
203
+          }
204
+        }
205
+
206
+        .wel {
207
+          line-height: 15px;
208
+          white-space: nowrap;
209
+          overflow: hidden;//文本超出隐藏
210
+          text-overflow: ellipsis;//文本超出省略号替代
211
+        }
212
+
213
+        .user {
214
+          overflow: hidden;
215
+          height: 48px;
157 216
           display: flex;
158 217
           justify-content: center;
159 218
           align-items: center;
160
-          span{
161
-            height: 100%;
162
-            display: inline-block;
163
-            padding: 0 24px;
219
+          font-size: 16px;
220
+          cursor: pointer;
221
+
222
+          img {
223
+            width: 32px;
224
+            height: 32px;
225
+            margin-right: 8px;
226
+          }
227
+
228
+          span, .transport-xiala1 {
229
+            height: 48px;
230
+            line-height: 48px;
231
+          }
232
+        }
233
+
234
+        .logOut {
235
+          text-align: right;
236
+          color: @primary-color;
237
+          line-height: 20px;
238
+
239
+          span {
164 240
             cursor: pointer;
165
-            display: flex;
166
-            justify-content: center;
167
-            align-items: center;
168
-            &.active{
169
-              color: @primary-color;
170
-              background: #F0F6ED;
171
-            }
241
+            padding: 10px;
172 242
           }
173 243
         }
174 244
       }
175 245
     }
176 246
   }
247
+
248
+  // 调度台copy过来的
249
+  /* 工单总数 */
250
+  .lists_box {
251
+    width: 100%;
252
+    height: calc(100vh - 56px);
253
+    display: flex;
254
+    margin-bottom: 8px;
255
+  }
256
+
257
+  .lists {
258
+    flex: 1;
259
+    margin-right: 16px;
260
+    overflow: hidden;
261
+    position: relative;
262
+  }
263
+
264
+  .lists:nth-child(1) {
265
+    margin-left: 16px;
266
+  }
267
+
268
+  /* 头部 */
269
+  .lists .head {
270
+    height: 52px;
271
+    display: flex;
272
+    align-items: center;
273
+    justify-content: space-between;
274
+    font-size: 16px;
275
+    position: relative;
276
+    z-index: 8;
277
+    background-color: #164967;
278
+    box-shadow: 0px 3px 6px 1px #092543;
279
+    margin: 8px 0;
280
+    padding: 0 8px;
281
+    .title_bold{
282
+      font-weight: bold;
283
+    }
284
+    .refreshSeconds{
285
+      font-size: 14px;
286
+    }
287
+  }
288
+
289
+  .lists .head .shuaxin {
290
+    float: right;
291
+    color: @primary-color;
292
+    cursor: pointer;
293
+  }
294
+
295
+  .lists .head .shuaxin i {
296
+    font-size: 12px;
297
+  }
298
+
299
+  .lists .head .shuaxin span {
300
+    font-size: 12px;
301
+  }
302
+
303
+  /* 搜索 */
304
+  .lists .searchBox {
305
+    width: 100%;
306
+    padding: 10px 2%;
307
+    background: #f9fafb;
308
+    position: relative;
309
+    z-index: 8;
310
+    display: flex;
311
+    justify-content: space-between;
312
+    align-items: center;
313
+
314
+    .search {
315
+      height: 34px;
316
+      width: 90%;
317
+      background-color: white;
318
+      border: 1px rgb(225, 229, 232) solid;
319
+      border-radius: 20px;
320
+      overflow: hidden;
321
+    }
322
+  }
323
+
324
+  .lists input {
325
+    padding-left: 3%;
326
+    color: black;
327
+    height: 32px;
328
+    width: 80%;
329
+    float: left;
330
+    border: none;
331
+
332
+    &:focus {
333
+      outline: none;
334
+    }
335
+  }
336
+
337
+  .lists input::-webkit-input-placeholder {
338
+    color: #999999;
339
+  }
340
+
341
+  .lists .magnifier {
342
+    width: 14%;
343
+    height: 32px;
344
+    line-height: 32px;
345
+    float: left;
346
+    border-left: 1px rgb(225, 229, 232) solid;
347
+    cursor: pointer;
348
+    text-align: right;
349
+  }
350
+
351
+  .lists .magnifier i {
352
+    color: #999999;
353
+  }
354
+
355
+  .lists .magnifier span {
356
+    color: @primary-color;
357
+  }
358
+
359
+  /* 单子内容盒子 */
360
+  .lists .cots_body {
361
+    width: 100%;
362
+    height: calc(100% - 68px);
363
+    background: #0f384e;
364
+    border: 1px solid #7D7D7D;
365
+    color: #fff;
366
+  }
367
+
368
+  /* loading */
369
+  .cots_body .loading {
370
+    width: 100%;
371
+    height: 100%;
372
+    position: absolute;
373
+    left: 0;
374
+    top: 0;
375
+  }
376
+
377
+  /* 暂无数据 */
378
+  .cots_body .no_data {
379
+    width: 100%;
380
+    height: 100%;
381
+    position: absolute;
382
+    left: 0;
383
+    top: 0;
384
+    font-size: 24px;
385
+    font-weight: bold;
386
+    display: flex;
387
+    justify-content: center;
388
+    align-items: center;
389
+  }
390
+
391
+  /* 未分派 */
392
+  .weifenpai .list {
393
+    height: 117px;
394
+    border-bottom: 1px solid #7D7D7D;
395
+    position: relative;
396
+    overflow: hidden;
397
+    display: flex;
398
+  }
399
+  // 转出院记录
400
+  .patientLog .list {
401
+    height: auto !important;
402
+    th,
403
+    td {
404
+      text-align: center !important;
405
+    }
406
+  }
407
+
408
+  /* 左边 */
409
+  .left_cots {
410
+    width: 100%;
411
+    float: left;
412
+    padding: 0 8px;
413
+    cursor: pointer;
414
+    position: relative;
415
+  }
416
+
417
+  /* 急标 */
418
+  .left_cots .ji {
419
+    position: absolute;
420
+    right: -3px;
421
+    top: -3px;
422
+    width: 30px;
423
+  }
424
+
425
+  /* 右边 */
426
+  .right_bots {
427
+    width: 20%;
428
+    border-left: 1px #e1e5e8 solid;
429
+    padding: 8px 0;
430
+  }
431
+
432
+  /* 上按钮 */
433
+  .right_bots .top_bot {
434
+    width: 70%;
435
+    border-radius: 4px;
436
+    color: white;
437
+    background-color: @primary-color;
438
+    border: 1px @primary-color solid;
439
+    cursor: pointer;
440
+    height: 27px;
441
+    margin-bottom: 8px;
442
+  }
443
+
444
+  .slider {
445
+    position: absolute;
446
+    // top: 98px;
447
+    bottom: 0;
448
+    right: 0;
449
+    width: 100%;
450
+    height: 2px;
451
+
452
+    &.sgreen {
453
+      background: rgb(86, 186, 182);
454
+    }
455
+
456
+    &.syellow {
457
+      background: rgb(245, 166, 35);
458
+    }
459
+    &.sred {
460
+      background: #d81e06;
461
+    }
462
+  }
463
+
464
+  /* 中按钮 */
465
+  .right_bots .mid_bot {
466
+    width: 70%;
467
+    border-radius: 4px;
468
+    color: white;
469
+    background-color: @primary-color;
470
+    border: 1px @primary-color solid;
471
+    cursor: pointer;
472
+    height: 27px;
473
+  }
474
+
475
+  /* 下按钮 */
476
+  .right_bots .btm_bot {
477
+    width: 70%;
478
+    border-radius: 4px;
479
+    color: #78797a;
480
+    background-color: #FFF;
481
+    border: 1px #e5e9ed solid;
482
+    cursor: pointer;
483
+    height: 27px;
484
+  }
485
+
486
+  /* 工单 */
487
+  .weifenpai .left_cots .gongdan {
488
+    height: 24px;
489
+    margin: 4px 0;
490
+    line-height: 24px;
491
+    text-align: center;
492
+  }
493
+
494
+  .weifenpai .left_cots .gongdan .left {
495
+    float: left;
496
+    font-size: 14px;
497
+  }
498
+  .gongdan_name {
499
+    max-width: 80% !important;
500
+    overflow: hidden !important;
501
+    text-overflow: ellipsis !important;
502
+    white-space: nowrap !important;
503
+  }
504
+
505
+  .weifenpai .left_cots .gongdan .right {
506
+    float: right;
507
+
508
+    &.colorRed {
509
+      color: red;
510
+    }
511
+  }
512
+
513
+  .weifenpai .left_cots .gongdan .right span:nth-child(1) {
514
+    float: right;
515
+    font-size: 12px;
516
+
517
+    &.colorRed {
518
+      color: red;
519
+    }
520
+  }
521
+
522
+  .weifenpai .left_cots .gongdan .right span:nth-child(2) {
523
+    float: right;
524
+    border-radius: 50%;
525
+    width: 10px;
526
+    height: 10px;
527
+    background-color: red;
528
+    margin-top: 7px;
529
+    margin-right: 8px;
530
+  }
531
+
532
+  /* 地点 */
533
+  .weifenpai .didian {
534
+    height: 24px;
535
+    line-height: 24px;
536
+    margin: 4px 0;
537
+    display: flex;
538
+  }
539
+
540
+  .weifenpai .didian .left {
541
+    float: left;
542
+    font-size: 14px;
543
+    flex: 1;
544
+    white-space: nowrap;
545
+    overflow: hidden;//文本超出隐藏
546
+    text-overflow: ellipsis;//文本超出省略号替代
547
+    &.noEllipsis{
548
+      white-space: normal;
549
+      overflow: visible;
550
+      text-overflow: inherit;
551
+      word-break: break-all;
552
+    }
553
+  }
554
+
555
+  .weifenpai .didian .right {
556
+    float: right;
557
+    flex: 1;
558
+    white-space: nowrap;
559
+    overflow: hidden;//文本超出隐藏
560
+    text-overflow: ellipsis;//文本超出省略号替代
561
+    text-align: right;
562
+  }
563
+
564
+  .weifenpai .didian .right i {
565
+    font-size: 12px;
566
+    color: @primary-color;
567
+  }
568
+
569
+  .weifenpai .didian .right span {
570
+    font-size: 12px;
571
+  }
572
+
573
+  /* 时间 */
574
+  .weifenpai .shijian {
575
+    height: 24px;
576
+    line-height: 24px;
577
+    margin: 4px 0;
578
+  }
579
+
580
+  .weifenpai .shijian .left {
581
+    float: left;
582
+  }
583
+
584
+  .weifenpai .shijian .right {
585
+    float: right;
586
+    font-size: 12px;
587
+  }
588
+
589
+  .weifenpai .shijian .left i {
590
+    color: @primary-color;
591
+    font-size: 14px;
592
+
593
+    &.colorRed {
594
+      color: red;
595
+    }
596
+  }
597
+
598
+  .weifenpai .shijian .left span {
599
+    font-size: 12px;
600
+  }
177 601
 }

+ 333 - 9
src/app/views/realtime-broadcast/realtime-broadcast.component.ts

@@ -1,33 +1,115 @@
1
-import { Component, OnInit } from "@angular/core";
1
+import { Component, OnInit, AfterViewInit } from "@angular/core";
2 2
 import { Validators, FormGroup, FormBuilder } from '@angular/forms';
3 3
 import { Subject } from 'rxjs';
4 4
 import { debounceTime } from 'rxjs/operators';
5 5
 import { MainService } from 'src/app/services/main.service';
6 6
 import { ToolService } from 'src/app/services/tool.service';
7
+import { NzMessageService } from 'ng-zorro-antd';
8
+import { Router } from '@angular/router';
9
+import { Swiper, Autoplay } from 'swiper';
10
+Swiper.use([Autoplay]);
11
+import chunk from 'lodash-es/chunk';
7 12
 
8 13
 @Component({
9 14
   selector: "app-realtime-broadcast",
10 15
   templateUrl: "./realtime-broadcast.component.html",
11 16
   styleUrls: ["./realtime-broadcast.component.less"],
12 17
 })
13
-export class RealtimeBroadcastComponent implements OnInit {
18
+export class RealtimeBroadcastComponent implements OnInit,AfterViewInit {
14 19
   constructor(
15 20
     private fb: FormBuilder,
16 21
     private mainService: MainService,
17 22
     private tool: ToolService,
23
+    private message: NzMessageService,
24
+    public router: Router,
18 25
   ){}
19 26
   validateForm: FormGroup; //表单
20 27
   isMask:boolean = false; //遮罩
21 28
   changeInpSubject = new Subject(); //防抖
29
+  showDropdown:boolean = false; //下拉
30
+  loginUser: any = this.tool.getCurrentUserInfo(); //登录人信息
22 31
 
23 32
   ngOnInit(): void {
24 33
     //防抖
25 34
     this.changeInpSubject.pipe(debounceTime(500)).subscribe(({type, searchText}) => {
26 35
       // this.getHospitalList(type, searchText);
27 36
     });
28
-    this.isMask = true;
29 37
     this.initForm();
30
-    this.getHospitalType();
38
+  }
39
+
40
+  ngAfterViewInit(){
41
+    this.computedNum();
42
+    this.getIncidentStatusList();
43
+  }
44
+
45
+  ngOnDestroy(){
46
+    clearInterval(this.timer);
47
+    this.mySwiper1pending && this.mySwiper1pending.destroy();
48
+    this.mySwiper2handler && this.mySwiper2handler.destroy();
49
+    this.mySwiper3overtime && this.mySwiper3overtime.destroy();
50
+  }
51
+
52
+  mySwiper1pending:Swiper;
53
+  mySwiper2handler:Swiper;
54
+  mySwiper3overtime:Swiper;
55
+  swiperEnter(key){
56
+    this['mySwiper' + key] && this['mySwiper' + key].autoplay.stop();
57
+  }
58
+
59
+  swiperLeave(key){
60
+    this['mySwiper' + key] && this['mySwiper' + key].autoplay.start();
61
+  }
62
+
63
+  // 轮播
64
+  startSwiper(type){
65
+    let _this = this;
66
+    this['mySwiper' + type] && this['mySwiper' + type].destroy();
67
+    setTimeout(() => {
68
+      this['mySwiper' + type] = new Swiper('#mySwiper' + type, {
69
+        autoplay: {
70
+          delay: this.config.rollingSeconds * 1000,
71
+          // stopOnLastSlide: false,
72
+          // disableOnInteraction: false,
73
+        },
74
+        observer: true, //修改swiper自己或子元素时,自动初始化swiper
75
+        observeParents: true, //修改swiper的父元素时,自动初始化swiper
76
+        allowTouchMove: false, //禁止触摸滑动
77
+        // loop: true,
78
+        // pagination: {
79
+        //   el: '.swiper-pagination',
80
+        //   clickable: true, //轮播按钮支持点击
81
+        // },
82
+        on: {
83
+          // slideChangeTransitionEnd: function(swiper) {
84
+          //   _this.activeIndex = swiper.realIndex;
85
+          // },
86
+          click: function(swiper, event){
87
+            let parentNode = (event as any).target.closest('.list');
88
+            let hasClass = parentNode !== null;
89
+            if(hasClass){
90
+              const id = parentNode.getAttribute('data-id');
91
+              if(id !== null){
92
+                _this.openItsmDetails({id});
93
+              }
94
+            }
95
+          }
96
+        },
97
+      });
98
+    }, 0)
99
+  }
100
+
101
+  // 定时器
102
+  timer = null;
103
+  num:number = 0;
104
+  startGetList(){
105
+    clearInterval(this.timer);
106
+    this.timer = setInterval(() => {
107
+      this.num--;
108
+      if(this.num < 0){
109
+        this.num = this.config.refreshSeconds;
110
+        this.refreshIncidentList();
111
+      }
112
+    }, 1000)
31 113
   }
32 114
 
33 115
   // 初始化form表单
@@ -41,6 +123,20 @@ export class RealtimeBroadcastComponent implements OnInit {
41 123
     });
42 124
   }
43 125
 
126
+  // 展示弹窗
127
+  showConfig(isEdit = false){
128
+    this.isMask = true;
129
+    this.getHospitalType();
130
+    if(isEdit && this.config.id){
131
+      this.validateForm.controls.deptIds.setValue(this.config.deptIds.split(',').map(v => +v));
132
+      this.validateForm.controls.groupIds.setValue(this.config.groupIds ? this.config.groupIds.split(',').map(v => +v) : []);
133
+      this.config.groupList && (this.groupList = this.config.groupList);
134
+      this.validateForm.controls.showOvertime.setValue(this.config.showOvertime);
135
+      this.validateForm.controls.refreshSeconds.setValue(this.config.refreshSeconds);
136
+      this.validateForm.controls.rollingSeconds.setValue(this.config.rollingSeconds);
137
+    }
138
+  }
139
+
44 140
   // 关闭遮罩
45 141
   hideModal(){
46 142
     this.isMask = false;
@@ -66,7 +162,7 @@ export class RealtimeBroadcastComponent implements OnInit {
66 162
   hospitalList:any[] = [];
67 163
   getHospitalList() {
68 164
     let type = this.hospitalTypes.find(v => v.value == 6);
69
-    let data = {
165
+    let postData = {
70 166
       hospital: {
71 167
         type: type || undefined,
72 168
       },
@@ -74,19 +170,32 @@ export class RealtimeBroadcastComponent implements OnInit {
74 170
       sum: 99999,
75 171
     };
76 172
     this.mainService
77
-      .getFetchDataList("data", "hospital", data)
173
+      .getFetchDataList("data", "hospital", postData)
78 174
       .subscribe((result) => {
79 175
         this.hospitalList = result.list || [];
80 176
       });
81 177
   }
82 178
 
179
+  // 修改维修科室
180
+  changeHospital(arr){
181
+    this.getGroupList();
182
+    this.validateForm.controls.groupIds.setValue([]);
183
+  }
184
+
185
+  // 打开运维分组
186
+  openChangeGroup(flag){
187
+    flag && this.getGroupList();
188
+  }
189
+
83 190
   // 获取运维分组
84 191
   groupList:any[] = [];
85
-  getGourpList() {
192
+  getGroupList() {
86 193
     if(!this.validateForm.value.deptIds.length){
194
+      this.isLoading = false;
195
+      this.groupList = [];
87 196
       return;
88 197
     }
89
-    let data = {
198
+    let postData = {
90 199
       group2: {
91 200
         hospitalIds: this.validateForm.value.deptIds.toString(),
92 201
         typeIds: 3,
@@ -95,9 +204,224 @@ export class RealtimeBroadcastComponent implements OnInit {
95 204
       sum: 20,
96 205
     };
97 206
     this.mainService
98
-      .getFetchDataList("data", "group2", data)
207
+      .getFetchDataList("data", "group2", postData)
99 208
       .subscribe((result) => {
209
+        this.isLoading = false;
100 210
         this.groupList = result.list || [];
101 211
       });
102 212
   }
213
+
214
+  // 根据用户查询配置
215
+  config:any = {};
216
+  getConfig() {
217
+    let postData = {
218
+      incidentViewConfig: {
219
+        userId: this.tool.getCurrentUserInfo().id,
220
+      },
221
+      idx: 0,
222
+      sum: 1,
223
+    };
224
+    this.mainService
225
+      .getFetchDataList("simple/data", "incidentViewConfig", postData)
226
+      .subscribe((res:any) => {
227
+        let result = res.list || [];
228
+        if(result.length){
229
+          this.config = result[0];
230
+          this.num = this.config.refreshSeconds;
231
+
232
+          // 初始化故障工单列表
233
+          if(this.config.showOvertime == 1){
234
+            this.incidentList['3overtime'] = {
235
+              name: '延期处理',
236
+              list: [],
237
+            }
238
+            this.getIncidentList('1pending');
239
+            this.getIncidentList('2handler');
240
+            this.getIncidentList('3overtime');
241
+          }else{
242
+            delete this.incidentList['3overtime'];
243
+            this.getIncidentList('1pending');
244
+            this.getIncidentList('2handler');
245
+          }
246
+        }else{
247
+          this.config = {};
248
+          this.showConfig();
249
+        }
250
+      });
251
+  }
252
+  // 计算可视区范围展示信息的条数
253
+  pageSize = 0;
254
+  computedNum(){
255
+    let h = (document.querySelector('.lists_box') as HTMLElement).offsetHeight;
256
+    this.pageSize = Math.floor((h / 117));
257
+  }
258
+
259
+  // 刷新故障工单列表
260
+  refreshIncidentList() {
261
+    if(this.config.showOvertime == 1){
262
+      this.getIncidentList('1pending');
263
+      this.getIncidentList('2handler');
264
+      this.getIncidentList('3overtime');
265
+    }else{
266
+      this.getIncidentList('1pending');
267
+      this.getIncidentList('2handler');
268
+    }
269
+  }
270
+
271
+  // 获取故障工单状态
272
+  incidentStatusList:any[] = [];
273
+  getIncidentStatusList() {
274
+    this.mainService.getDictionary("list", "incident_status").subscribe((result) => {
275
+      this.incidentStatusList = result || [];
276
+      this.getConfig();
277
+    });
278
+  }
279
+
280
+  // 获取故障工单列表
281
+  loading:boolean = false;
282
+  incidentList:any = {
283
+    '1pending': {
284
+      name: '待接单',
285
+      list: [],
286
+    },
287
+    '2handler': {
288
+      name: '待处理',
289
+      list: [],
290
+    },
291
+    // '3overtime': {
292
+    //   name: '延期处理',
293
+    //   list: [],
294
+    // }
295
+  }
296
+  getIncidentList(type: string) {
297
+    this.loading = true;
298
+    let postData: any = {
299
+      idx: 0,
300
+      sum: 99999,
301
+      incident: {
302
+        assignee: this.tool.getCurrentUserId(),
303
+        deleteFlag: 0,
304
+				candidateGroups: this.config.groupIds ? this.config.groupIds.toString() : undefined,
305
+				dutyIds: this.config.deptIds.toString(),
306
+        queryTask: 'all',
307
+      },
308
+    };
309
+    if(type == '1pending'){
310
+      postData.incident.statusId = this.incidentStatusList.find(v => v.value === 'pending').id;
311
+    }else if(type == '2handler'){
312
+      postData.incident.statusId = this.incidentStatusList.find(v => v.value === 'handler').id;
313
+      postData.incident.overtime = this.config.showOvertime;
314
+    }else if(type == '3overtime'){
315
+      postData.incident.statusId = this.incidentStatusList.find(v => v.value === 'handler').id;
316
+      postData.incident.overtime = 1;
317
+    }
318
+    this.mainService
319
+      .getFetchDataList("simple/data", "incident", postData)
320
+      .subscribe((res:any) => {
321
+        this.loading = false;
322
+
323
+        let list = res.list || [];
324
+        this.incidentList[type].list = chunk(list, this.pageSize);
325
+        // console.log(this.incidentList)
326
+
327
+        this.startSwiper(type);
328
+        this.startGetList();
329
+      });
330
+  }
331
+
332
+  // 优先级颜色
333
+  priorityColor(priorityId) {
334
+    // 极低|低
335
+    if(priorityId == 1 || priorityId == 2){
336
+      return '';
337
+    } else if(priorityId == 3){
338
+      return 'yellow';
339
+    } else if(priorityId == 4 || priorityId == 5){
340
+      return 'red';
341
+    }
342
+  }
343
+
344
+  // 保存
345
+  btnLoading:boolean = false;
346
+  submitForm(){
347
+    for (const i in this.validateForm.controls) {
348
+      this.validateForm.controls[i].markAsDirty({ onlySelf: true });
349
+      this.validateForm.controls[i].updateValueAndValidity();
350
+    }
351
+    if (this.validateForm.invalid) return;
352
+    this.btnLoading = true;
353
+    let postData = {
354
+      id: this.config.id || undefined,
355
+      hosId: this.tool.getCurrentHospital().id,
356
+      userId: this.tool.getCurrentUserInfo().id,
357
+      deptIds: this.validateForm.value.deptIds.toString(),
358
+      groupIds: this.validateForm.value.groupIds.toString() || undefined,
359
+      showOvertime: this.validateForm.value.showOvertime,
360
+      refreshSeconds: this.validateForm.value.refreshSeconds,
361
+      rollingSeconds: this.validateForm.value.rollingSeconds,
362
+    }
363
+    this.mainService
364
+      .simplePost("addData", "incidentViewConfig", postData)
365
+      .subscribe((data) => {
366
+        this.btnLoading = false;
367
+        this.hideModal();
368
+        if (data.status == 200) {
369
+          this.showDropdown = false;
370
+          this.message.success("保存成功");
371
+          this.getConfig();
372
+        } else {
373
+          this.message.error(data.msg || '保存失败');
374
+        }
375
+      });
376
+  }
377
+
378
+  // 详情-弹窗
379
+  detailModalShow = false; //弹窗开关
380
+  coopData:any = {};
381
+  openItsmDetails(data) {
382
+    this.coopData = data;
383
+    this.detailModalShow = true;
384
+  }
385
+  // 关闭弹窗
386
+  closeDetailModelOrder(e) {
387
+    this.detailModalShow = JSON.parse(e).show;
388
+  }
389
+  // 弹窗确定
390
+  confirmDetailModelOrder(e){
391
+    console.log(e);
392
+    this.detailModalShow = false;
393
+  }
394
+
395
+  // 回到系统管理
396
+  toMain() {
397
+    this.router.navigateByUrl("main");
398
+  }
399
+
400
+  // 退出
401
+  logOut(): void {
402
+    // 假退出
403
+    let hospital = this.tool.getCurrentHospital();
404
+    if(hospital){
405
+      this.router.navigate(["login", hospital.id]);
406
+    }else{
407
+      this.router.navigateByUrl("login");
408
+    }
409
+    localStorage.removeItem("user");
410
+    localStorage.removeItem("menu");
411
+    localStorage.removeItem("index");
412
+
413
+    // 假退出
414
+    this.mainService.logOut().subscribe((data) => {
415
+      if (data.status == 200) {
416
+        if(hospital){
417
+          this.router.navigate(["login", hospital.id]);
418
+        }else{
419
+          this.router.navigateByUrl("login");
420
+        }
421
+        localStorage.removeItem("user");
422
+        localStorage.removeItem("menu");
423
+        localStorage.removeItem("index");
424
+      }
425
+    });
426
+  }
103 427
 }

+ 2 - 0
src/app/views/realtime-broadcast/realtime-broadcast.module.ts

@@ -4,6 +4,7 @@ import { CommonModule } from '@angular/common';
4 4
 import { RealtimeBroadcastRoutingModule } from './realtime-broadcast-routing.module';
5 5
 import { RealtimeBroadcastComponent } from './realtime-broadcast.component';
6 6
 import { ShareModule } from 'src/app/share/share.module';
7
+import { IncidentDetailModule } from 'src/app/components/incidentManagement/incident-detail/incident-detail.module';
7 8
 
8 9
 
9 10
 @NgModule({
@@ -14,6 +15,7 @@ import { ShareModule } from 'src/app/share/share.module';
14 15
     CommonModule,
15 16
     RealtimeBroadcastRoutingModule,
16 17
     ShareModule,
18
+    IncidentDetailModule,
17 19
   ]
18 20
 })
19 21
 export class RealtimeBroadcastModule { }