Bladeren bron

故障实时播报

seimin 4 maanden geleden
bovenliggende
commit
494fd8455d

+ 8 - 0
src/app/app-routing.module.ts

@@ -26,6 +26,8 @@ import { PageConfigGuard } from './guard/PageConfig.guard';
26 26
 import { NurseConfigGuard } from './guard/nurseConfig.guard';
27 27
 //系统配置查看权限
28 28
 import { SystemConfigGuard } from './guard/SystemConfig.guard';
29
+// 故障实时播报权限
30
+import { RealtimeBroadcastGuard } from './guard/realtimeBroadcast.guard';
29 31
 const routes: Routes = [
30 32
   // 默认
31 33
   {
@@ -172,6 +174,12 @@ const routes: Routes = [
172 174
 	  path: 'repositoryManageAdd/:id',
173 175
 	  loadChildren: () => import('./views/repository-manage-add/repository-manage-add.module').then(m => m.RepositoryManageAddModule),
174 176
 	},
177
+  // 故障实时播报
178
+  {
179
+    path: 'realtimeBroadcast',
180
+    loadChildren: () => import('./views/realtime-broadcast/realtime-broadcast.module').then(m => m.RealtimeBroadcastModule),
181
+    canActivate: [RealtimeBroadcastGuard]
182
+  },
175 183
   // 管理端首页
176 184
   {
177 185
     path: '**',

+ 1 - 0
src/app/components/incidentManagement/incident-ser-visit/incident-ser-visit.component.ts

@@ -353,6 +353,7 @@ export class IncidentSerVisitComponent implements OnInit {
353 353
   }
354 354
 
355 355
   // 回访-弹窗
356
+  coopData: any = {}; //当前操作列
356 357
   visitModalShow = false; //弹窗开关
357 358
   visit(e, data) {
358 359
     e.stopPropagation();

+ 22 - 0
src/app/guard/realtimeBroadcast.guard.ts

@@ -0,0 +1,22 @@
1
+import { Injectable } from '@angular/core';
2
+import { CanActivate, Router } from '@angular/router';
3
+
4
+@Injectable({
5
+  providedIn: 'root'
6
+})
7
+export class RealtimeBroadcastGuard implements CanActivate  {
8
+  constructor(public router: Router) { }
9
+
10
+  canActivate(): boolean {
11
+    const menus = JSON.parse(localStorage.getItem('menu'));
12
+    let can = false;
13
+    if (menus) {
14
+      can = menus.some(e => e.link == 'realtimeBroadcast');
15
+    }
16
+    if (!can) {
17
+      this.router.navigate(['login']);
18
+      return false
19
+    }
20
+    return true;
21
+  }
22
+}

+ 1 - 0
src/app/views/main/main.component.html

@@ -49,6 +49,7 @@
49 49
 							<div class="dropdownItem" *ngIf="sampling" (click)="toSampling()">门诊病理采样端</div>
50 50
 							<div class="dropdownItem" *ngIf="communicationBook" (click)="toCommunicationBook()">病理交接本</div>
51 51
 							<div class="dropdownItem" *ngIf="disinfectionSupplyRole" (click)="toDisinfectionSupply()">全局业务查看</div>
52
+							<div class="dropdownItem" *ngIf="realtimeBroadcastRole" (click)="toRealtimeBroadcast()">故障实时播报</div>
52 53
             </div>
53 54
           </div>
54 55
         </div>

+ 9 - 0
src/app/views/main/main.component.ts

@@ -34,6 +34,7 @@ export class MainComponent implements OnInit {
34 34
 	sampling: boolean = false; //门诊病理采样端权限
35 35
 	communicationBook: boolean = false; //病理交接本权限
36 36
   disinfectionSupplyRole: boolean = false; //全局业务查看权限
37
+  realtimeBroadcastRole: boolean = false; //全局业务查看权限
37 38
   incidentConfigRole: boolean = false; //事件配置权限
38 39
   otherConfigRole: boolean = false; //三方配置权限
39 40
   pageConfigRole: boolean = false; //业务页面控制权限
@@ -316,6 +317,10 @@ export class MainComponent implements OnInit {
316 317
         this.disinfectionSupplyRole = true;
317 318
         console.log("全局业务查看权限");
318 319
       }
320
+      if (e.link == "realtimeBroadcast") {
321
+        this.realtimeBroadcastRole = true;
322
+        console.log("故障实时播报权限");
323
+      }
319 324
       if (e.link == "incidentConfig") {
320 325
         this.incidentConfigRole = true;
321 326
         console.log("事件配置权限");
@@ -463,6 +468,10 @@ export class MainComponent implements OnInit {
463 468
   toDisinfectionSupply(): void {
464 469
     this.router.navigateByUrl("disinfectionSupply");
465 470
   }
471
+  // 故障实时播报
472
+  toRealtimeBroadcast(): void {
473
+    this.router.navigateByUrl("realtimeBroadcast");
474
+  }
466 475
   // 配置中心
467 476
   toConfigurationCenter(): void {
468 477
     this.iShowMenuModal = true;

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

@@ -0,0 +1,18 @@
1
+import { NgModule } from '@angular/core';
2
+import { Routes, RouterModule } from '@angular/router';
3
+import { RealtimeBroadcastComponent } from './realtime-broadcast.component';
4
+
5
+
6
+const routes: Routes = [
7
+  {
8
+    path: '',
9
+    component: RealtimeBroadcastComponent,
10
+  }
11
+];
12
+
13
+@NgModule({
14
+  imports: [RouterModule.forChild(routes)],
15
+  exports: [RouterModule]
16
+})
17
+export class RealtimeBroadcastRoutingModule { }
18
+

+ 81 - 0
src/app/views/realtime-broadcast/realtime-broadcast.component.html

@@ -0,0 +1,81 @@
1
+<div class="mask" *ngIf="isMask">
2
+  <div class="save add display_flex align-items_center justify-content_flex-center">
3
+    <div class="modalBody">
4
+      <div class="title">工单范围<i class="icon_transport transport-guanbi" (click)="hideModal()"></i>
5
+      </div>
6
+      <overlay-scrollbars #osComponentRef1 class="content">
7
+        <form nz-form [formGroup]="validateForm" class="addForm" (ngSubmit)="submitForm()">
8
+          <nz-form-item>
9
+            <nz-form-label [nzSpan]="6" nzRequired nzFor="deptIds">维修科室</nz-form-label>
10
+            <nz-form-control [nzSpan]="18" nzErrorTip="请选择维修科室!">
11
+              <nz-select nzMode="multiple" nzServerSearch [nzDropdownMatchSelectWidth]="false" nzAllowClear formControlName="deptIds" nzPlaceHolder="请选择维修科室" (ngModelChange)="changeHospital($event)">
12
+                <ng-container *ngFor="let option of hospitalList">
13
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.hosName" [nzValue]="option.id"></nz-option>
14
+                </ng-container>
15
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
16
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
17
+                </nz-option>
18
+              </nz-select>
19
+            </nz-form-control>
20
+          </nz-form-item>
21
+          <nz-form-item>
22
+            <nz-form-label [nzSpan]="6" nzFor="groupIds">运维分组</nz-form-label>
23
+            <nz-form-control [nzSpan]="18" nzErrorTip="请选择运维分组!">
24
+              <nz-select nzMode="multiple" (nzOnSearch)="changeCompanyInp(hosId,'add',$event)" [nzDropdownMatchSelectWidth]="false"
25
+                nzServerSearch nzShowSearch nzAllowClear formControlName="groupIds" nzPlaceHolder="请选择运维分组">
26
+                <ng-container *ngFor="let option of groupList">
27
+                  <nz-option *ngIf="!isLoading" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
28
+                </ng-container>
29
+                <nz-option *ngIf="isLoading" nzDisabled nzCustomContent>
30
+                  <i nz-icon nzType="loading" class="loading-icon"></i> 搜索中...
31
+                </nz-option>
32
+              </nz-select>
33
+            </nz-form-control>
34
+          </nz-form-item>
35
+          <nz-form-item>
36
+            <nz-form-label [nzSpan]="10" nzRequired nzFor="showOvertime">是否单独显示延期处理</nz-form-label>
37
+            <nz-form-control [nzSpan]="14" nzErrorTip="请选择是否单独显示延期处理!">
38
+              <nz-radio-group formControlName="showOvertime">
39
+                <label nz-radio [nzValue]="1">是</label>
40
+                <label nz-radio [nzValue]="0">否</label>
41
+              </nz-radio-group>
42
+            </nz-form-control>
43
+          </nz-form-item>
44
+          <nz-form-item>
45
+            <nz-form-label [nzSpan]="6" nzRequired nzFor="refreshSeconds">数据刷新</nz-form-label>
46
+            <nz-form-control [nzSpan]="18" nzErrorTip="请选择数据刷新!">
47
+              <nz-input-group nzAddOnAfter="秒">
48
+                <nz-input-number class="w100" formControlName="refreshSeconds" nzPlaceHolder="请输入数据刷新时间" [nzMin]="30" [nzStep]="1" [nzPrecision]="0"></nz-input-number>
49
+              </nz-input-group>
50
+            </nz-form-control>
51
+          </nz-form-item>
52
+          <nz-form-item>
53
+            <nz-form-label [nzSpan]="6" nzRequired nzFor="rollingSeconds">滚动频率</nz-form-label>
54
+            <nz-form-control [nzSpan]="18" nzErrorTip="请选择滚动频率!">
55
+              <nz-input-group nzAddOnAfter="秒">
56
+                <nz-input-number class="w100" formControlName="rollingSeconds" nzPlaceHolder="请输入滚动频率时间" [nzMin]="3" [nzStep]="1" [nzPrecision]="0"></nz-input-number>
57
+              </nz-input-group>
58
+            </nz-form-control>
59
+          </nz-form-item>
60
+        </form>
61
+      </overlay-scrollbars>
62
+      <div class="display_flex justify-content_flex-center">
63
+        <button nzType="primary" nz-button (click)="submitForm()" [nzLoading]="btnLoading">确认</button>
64
+        <button class="btn cancel" nz-button nzType="default" (click)="hideModal()">取消</button>
65
+      </div>
66
+    </div>
67
+  </div>
68
+</div>
69
+<div class="incidentConfig" *ngIf="isMask">
70
+  <div class="tagsAndTemplete">
71
+    <div class="tags">
72
+      <div><i class="icon_transport transport-peizhizhongxin"></i>配置中心&emsp;&gt;&emsp;事件配置</div>
73
+      <div class="tagList">
74
+        <span *ngFor="let tag of tagList" [ngClass]="{ active: activeTagLink === tag.link }" (click)="clickTag(tag)">{{ tag.title }}</span>
75
+      </div>
76
+      <button nz-button class="btn default" (click)="goBack()">返回</button>
77
+    </div>
78
+  </div>
79
+</div>
80
+
81
+

+ 177 - 0
src/app/views/realtime-broadcast/realtime-broadcast.component.less

@@ -0,0 +1,177 @@
1
+@import "../../../../src/theme.less";
2
+:host {
3
+  width: 100%;
4
+  .save {
5
+    position: fixed;
6
+    left: 0;
7
+    top: 0;
8
+    width: 100%;
9
+    height: 100%;
10
+    background: rgba(0, 0, 0, 0.4);
11
+    z-index: 99;
12
+
13
+    .modalBody {
14
+      width: 350px;
15
+      background: #fff;
16
+      border-radius: 5px;
17
+      padding: 10px 20px;
18
+      color: #333;
19
+
20
+      .title {
21
+        width: 100%;
22
+        text-align: center;
23
+        font-size: 18px;
24
+        position: relative;
25
+
26
+        i {
27
+          position: absolute;
28
+          right: 0;
29
+          top: 0;
30
+          font-size: 20px;
31
+          color: #666;
32
+          cursor: pointer;
33
+          padding: 0 5px;
34
+        }
35
+      }
36
+
37
+      .content {
38
+        width: 100%;
39
+        height: 117px;
40
+        background: #f9fafb;
41
+        border: 1px solid #e5e9ed;
42
+        border-radius: 5px;
43
+        overflow: hidden;
44
+        margin-top: 12px;
45
+
46
+        div {
47
+          text-align: center;
48
+          margin: 0;
49
+
50
+          &.icon {
51
+            margin-top: 17px;
52
+
53
+            i {
54
+              color: #34b349;
55
+              font-size: 30px !important;
56
+
57
+              &.transport-wenhao {
58
+                color: #f5a523;
59
+              }
60
+
61
+              &.transport-shibai {
62
+                color: #ff3a52;
63
+              }
64
+            }
65
+          }
66
+
67
+          &.defeat {
68
+            color: #333;
69
+            font-size: 18px;
70
+          }
71
+
72
+          &:nth-child(3) {
73
+            font-size: 14px;
74
+            color: #666;
75
+          }
76
+        }
77
+      }
78
+
79
+      button {
80
+        margin-top: 10px;
81
+
82
+        &.btn {
83
+          margin-left: 8px;
84
+        }
85
+      }
86
+    }
87
+
88
+    // 新增
89
+    &.add {
90
+      .modalBody {
91
+        width: 480px;
92
+        height: auto;
93
+
94
+        .content {
95
+          width: 100%;
96
+          height: auto;
97
+          padding: 19px 14px 0 14px;
98
+          max-height: 500px;
99
+          overflow-y: auto;
100
+
101
+          .addForm {
102
+            .ant-form-item {
103
+              margin-bottom: 8px;
104
+
105
+              .ant-form-item-label {
106
+                text-align: left;
107
+              }
108
+            }
109
+          }
110
+
111
+          .editForm {
112
+            .ant-form-item {
113
+              margin-bottom: 14px;
114
+            }
115
+          }
116
+        }
117
+
118
+        button:nth-child(1) {
119
+          margin-right: 20px;
120
+        }
121
+      }
122
+    }
123
+  }
124
+  .incidentConfig{
125
+    padding-bottom: 24px;
126
+    height: 100%;
127
+    display: flex;
128
+    flex-direction: column;
129
+    justify-content: space-between;
130
+    background-color: #F0F2F5;
131
+    .tagsAndTemplete{
132
+      height: 64px;
133
+      display: flex;
134
+      justify-content: space-between;
135
+      align-items: center;
136
+      .tags{
137
+        height: 100%;
138
+        background: #fff;
139
+        flex: 1;
140
+        padding: 16px 24px;
141
+        display: flex;
142
+        align-items: center;
143
+        justify-content: space-between;
144
+        position: relative;
145
+        .transport-peizhizhongxin{
146
+          color: @primary-color;
147
+          font-size: 20px;
148
+          margin-right: 8px;;
149
+        }
150
+        .tagList{
151
+          width: 100%;
152
+          height: 100%;
153
+          position: absolute;
154
+          left: 0;
155
+          top: 50%;
156
+          transform: translateY(-50%);
157
+          display: flex;
158
+          justify-content: center;
159
+          align-items: center;
160
+          span{
161
+            height: 100%;
162
+            display: inline-block;
163
+            padding: 0 24px;
164
+            cursor: pointer;
165
+            display: flex;
166
+            justify-content: center;
167
+            align-items: center;
168
+            &.active{
169
+              color: @primary-color;
170
+              background: #F0F6ED;
171
+            }
172
+          }
173
+        }
174
+      }
175
+    }
176
+  }
177
+}

+ 103 - 0
src/app/views/realtime-broadcast/realtime-broadcast.component.ts

@@ -0,0 +1,103 @@
1
+import { Component, OnInit } from "@angular/core";
2
+import { Validators, FormGroup, FormBuilder } from '@angular/forms';
3
+import { Subject } from 'rxjs';
4
+import { debounceTime } from 'rxjs/operators';
5
+import { MainService } from 'src/app/services/main.service';
6
+import { ToolService } from 'src/app/services/tool.service';
7
+
8
+@Component({
9
+  selector: "app-realtime-broadcast",
10
+  templateUrl: "./realtime-broadcast.component.html",
11
+  styleUrls: ["./realtime-broadcast.component.less"],
12
+})
13
+export class RealtimeBroadcastComponent implements OnInit {
14
+  constructor(
15
+    private fb: FormBuilder,
16
+    private mainService: MainService,
17
+    private tool: ToolService,
18
+  ){}
19
+  validateForm: FormGroup; //表单
20
+  isMask:boolean = false; //遮罩
21
+  changeInpSubject = new Subject(); //防抖
22
+
23
+  ngOnInit(): void {
24
+    //防抖
25
+    this.changeInpSubject.pipe(debounceTime(500)).subscribe(({type, searchText}) => {
26
+      // this.getHospitalList(type, searchText);
27
+    });
28
+    this.isMask = true;
29
+    this.initForm();
30
+    this.getHospitalType();
31
+  }
32
+
33
+  // 初始化form表单
34
+  initForm() {
35
+    this.validateForm = this.fb.group({
36
+      deptIds: [[], [Validators.required]],
37
+      groupIds: [[]],
38
+      showOvertime: [undefined, [Validators.required]],
39
+      refreshSeconds: [30, [Validators.required]],
40
+      rollingSeconds: [3, [Validators.required]],
41
+    });
42
+  }
43
+
44
+  // 关闭遮罩
45
+  hideModal(){
46
+    this.isMask = false;
47
+  }
48
+
49
+  // 边输边搜节流阀
50
+  isLoading = false;
51
+  changeInp(type, searchText) {
52
+    this.isLoading = true;
53
+    this.changeInpSubject.next({type, searchText});
54
+  }
55
+
56
+  // 获取院区类型
57
+  hospitalTypes:any[] = [];
58
+  getHospitalType() {
59
+    this.mainService.getDictionary("list", "hospital_type").subscribe((result) => {
60
+      this.hospitalTypes = result || [];
61
+      this.getHospitalList();
62
+    });
63
+  }
64
+
65
+  // 获取维修科室
66
+  hospitalList:any[] = [];
67
+  getHospitalList() {
68
+    let type = this.hospitalTypes.find(v => v.value == 6);
69
+    let data = {
70
+      hospital: {
71
+        type: type || undefined,
72
+      },
73
+      idx: 0,
74
+      sum: 99999,
75
+    };
76
+    this.mainService
77
+      .getFetchDataList("data", "hospital", data)
78
+      .subscribe((result) => {
79
+        this.hospitalList = result.list || [];
80
+      });
81
+  }
82
+
83
+  // 获取运维分组
84
+  groupList:any[] = [];
85
+  getGourpList() {
86
+    if(!this.validateForm.value.deptIds.length){
87
+      return;
88
+    }
89
+    let data = {
90
+      group2: {
91
+        hospitalIds: this.validateForm.value.deptIds.toString(),
92
+        typeIds: 3,
93
+      },
94
+      idx: 0,
95
+      sum: 20,
96
+    };
97
+    this.mainService
98
+      .getFetchDataList("data", "group2", data)
99
+      .subscribe((result) => {
100
+        this.groupList = result.list || [];
101
+      });
102
+  }
103
+}

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

@@ -0,0 +1,19 @@
1
+import { NgModule } from '@angular/core';
2
+import { CommonModule } from '@angular/common';
3
+
4
+import { RealtimeBroadcastRoutingModule } from './realtime-broadcast-routing.module';
5
+import { RealtimeBroadcastComponent } from './realtime-broadcast.component';
6
+import { ShareModule } from 'src/app/share/share.module';
7
+
8
+
9
+@NgModule({
10
+  declarations: [
11
+    RealtimeBroadcastComponent,
12
+  ],
13
+  imports: [
14
+    CommonModule,
15
+    RealtimeBroadcastRoutingModule,
16
+    ShareModule,
17
+  ]
18
+})
19
+export class RealtimeBroadcastModule { }