Kaynağa Gözat

代码合并解决冲突

seimin 4 ay önce
ebeveyn
işleme
e28c2bd201

+ 3 - 2
src/app/app-routing.module.ts

@@ -24,7 +24,8 @@ import { OtherConfigGuard } from './guard/OtherConfig.guard';
24 24
 //业务页面控制查看权限
25 25
 import { PageConfigGuard } from './guard/PageConfig.guard';
26 26
 import { NurseConfigGuard } from './guard/nurseConfig.guard';
27
-
27
+//系统配置查看权限
28
+import { SystemConfigGuard } from './guard/SystemConfig.guard';
28 29
 const routes: Routes = [
29 30
   // 默认
30 31
   {
@@ -117,7 +118,7 @@ const routes: Routes = [
117 118
 	{
118 119
 	  path: 'systemConfig',
119 120
 	  loadChildren: () => import('./views/system-config/system-config.module').then(m => m.SystemConfigModule),
120
-	  canActivate: [PageConfigGuard]
121
+	  canActivate: [SystemConfigGuard]
121 122
 	},
122 123
   // 业务页面控制查看
123 124
   {

+ 4 - 4
src/app/components/incidentManagement/incident-create/incident-create.component.ts

@@ -883,7 +883,7 @@ export class IncidentCreateComponent implements OnInit {
883 883
         "category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
884 884
         "priorityId": this.incidentModel.priorityId || undefined,
885 885
         "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
886
-        "title": category.mutiCategory,
886
+        // "title": category.mutiCategory,
887 887
         "description": this.incidentModel.description,
888 888
         "directProcess": 1,
889 889
         "handleDescription": this.incidentModel.handleDescription,
@@ -998,7 +998,7 @@ export class IncidentCreateComponent implements OnInit {
998 998
         "category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
999 999
         "priorityId": this.incidentModel.priorityId || undefined,
1000 1000
         "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
1001
-        "title": category.mutiCategory,
1001
+        // "title": category.mutiCategory,
1002 1002
         "description": this.incidentModel.description,
1003 1003
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
1004 1004
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
@@ -1072,7 +1072,7 @@ export class IncidentCreateComponent implements OnInit {
1072 1072
         "category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
1073 1073
         "priorityId": this.incidentModel.priorityId || undefined,
1074 1074
         "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
1075
-        "title": category ? category.mutiCategory : '',
1075
+        // "title": category ? category.mutiCategory : '',
1076 1076
         "description": this.incidentModel.description,
1077 1077
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
1078 1078
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
@@ -1174,7 +1174,7 @@ export class IncidentCreateComponent implements OnInit {
1174 1174
         "category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
1175 1175
         "priorityId": this.incidentModel.priorityId || undefined,
1176 1176
         "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
1177
-        "title": category ? category.mutiCategory : '',
1177
+        // "title": category ? category.mutiCategory : '',
1178 1178
         "description": this.incidentModel.description,
1179 1179
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
1180 1180
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,

+ 22 - 0
src/app/guard/SystemConfig.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 SystemConfigGuard 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 == 'systemConfig');
15
+    }
16
+    if (!can) {
17
+      this.router.navigate(['login']);
18
+      return false
19
+    }
20
+    return true;
21
+  }
22
+}

+ 3 - 3
src/app/services/websocket-incoming.service.ts

@@ -2,7 +2,7 @@
2 2
  * @Author: seimin
3 3
  * @Date: 2024-09-24 16:34:47
4 4
  * @LastEditors: seimin
5
- * @LastEditTime: 2024-09-29 15:41:54
5
+ * @LastEditTime: 2024-11-28 03:12:59
6 6
  * @Description: 来电弹屏websocket服务
7 7
  */
8 8
 import { Injectable } from "@angular/core";
@@ -24,8 +24,8 @@ export class WebsocketIncomingService {
24 24
 
25 25
   // 连接websocket { userCount }
26 26
   private user = JSON.parse(localStorage.getItem("user")); //用户信息
27
-  connectWs(): Observable<any> {
28
-    let userCount = this.user.user.account + "|" + this.getPhoneNumber();
27
+  connectWs(phoneNumber): Observable<any> {
28
+    let userCount = this.user.user.account + "|" + phoneNumber;
29 29
     if(this.getSign() === 'box'){
30 30
       return this.phoneService.connectWs(http.phoneWs, { userCount });
31 31
     }

+ 18 - 3
src/app/services/websocket-phone.service.ts

@@ -2,7 +2,7 @@
2 2
  * @Author: seimin
3 3
  * @Date: 2024-03-11 11:11:09
4 4
  * @LastEditors: seimin
5
- * @LastEditTime: 2024-09-24 16:38:23
5
+ * @LastEditTime: 2024-11-28 03:03:38
6 6
  * @Description: 录音盒websocket服务
7 7
  */
8 8
 import { Injectable } from "@angular/core";
@@ -60,15 +60,17 @@ export class WebsocketPhoneService {
60 60
       console.log("ws连接关闭" + new Date().toLocaleString(), this.isHandler);
61 61
       this.ws = null;
62 62
       console.log(response)
63
-      if (!this.isHandler && response.status === 408) {
63
+      if (!this.isHandler && response.status === 408 && sessionStorage.getItem('phoneNumber')) {
64 64
         this.reconnect(this.url, this.urlParams);
65
+      }else{
66
+        this.updateProperty(false);
65 67
       }
66 68
     };
67 69
 
68 70
     request.onError = (response) => {
69 71
       console.log("ws连接错误", this.isHandler);
70 72
       this.ws = null;
71
-      if (response.status === 0) {
73
+      if (response.status === 0 && sessionStorage.getItem('phoneNumber')) {
72 74
         this.reconnect(this.url, this.urlParams);
73 75
       }
74 76
     };
@@ -119,4 +121,17 @@ export class WebsocketPhoneService {
119 121
       this.ws.close();
120 122
     }
121 123
   }
124
+
125
+  // 创建一个Subject来发送和接收数据
126
+  private updateData = new Subject<any>();
127
+
128
+  // 提供一个方法来发送数据
129
+  updateProperty(data: any) {
130
+    this.updateData.next(data);
131
+  }
132
+
133
+  // 提供一个方法来订阅数据
134
+  getDataUpdate(): Subject<any> {
135
+    return this.updateData;
136
+  }
122 137
 }

+ 3 - 46
src/app/share/pathology-add/pathology-add.component.html

@@ -281,7 +281,7 @@
281 281
   <!-- 打印 -->
282 282
   <div id="report" style="display: none;">
283 283
 		<div class="monad">
284
-			<div *ngIf="printData && printData.specimenList && printData.specimenList.length>1 && operation != 'addPrint'" style="border: 1px solid #AAAAAA;
284
+			<div *ngIf="printData && printData.specimenList && printData.specimenList.length" style="border: 1px solid #AAAAAA;
285 285
 				border-radius: 5px;font-size: 12px;">
286 286
 				 <div style="display: flex;align-items: center;flex-wrap: nowrap;height: 80px;padding: 0 1px;">
287 287
 					 <div style="width: 60%;height: 70px;text-align: center;">
@@ -325,51 +325,8 @@
325 325
 				</div>
326 326
 			</div>
327 327
 			
328
-			<div *ngIf="printData && printData.specimenList && printData.specimenList.length>0 && operation == 'addPrint'" style="border: 1px solid #AAAAAA;
329
-				border-radius: 5px;font-size: 12px;">
330
-				 <div style="display: flex;align-items: center;flex-wrap: nowrap;height: 80px;padding: 0 1px;">
331
-					 <div style="width: 60%;height: 70px;text-align: center;">
332
-						 <img style="max-width: 90%;height: 80%;" [src]="printData.applyBarCode" alt="">
333
-						 <div>{{printData.applyCode}}</div>
334
-					 </div>
335
-					 <div style="width: 40%;height: 100%;text-align: center;display: flex;align-items: center;">
336
-						 <img style="max-width: 100%;max-height: 100%;" [src]="tool.logoUrl" alt="">
337
-					 </div>
338
-				 </div>
339
-				<div style="display: flex;border-bottom: 1px solid #AAAAAA;">
340
-					<div style="width:20%;border-right: 1px solid #AAAAAA;border-top: 1px solid #aaa;padding:1px;">患者姓名</div>
341
-					<div style="width:50%;border-right: 1px solid #AAAAAA;border-top: 1px solid #aaa;padding:1px;">{{printData.patientName}}</div>
342
-					<div style="width:14%;border-right: 1px solid #AAAAAA;border-top: 1px solid #aaa;padding:1px;">性别</div>
343
-					<div style="width:16%;padding:1px;border-top: 1px solid #aaa;">{{printData.specimenList[0].patientGender}}</div>
344
-				</div>
345
-				<div style="display: flex;border-bottom: 1px solid #AAAAAA;">
346
-					<div style="width:20%;border-right: 1px solid #AAAAAA;padding:1px;">住院号</div>
347
-					<div style="width:50%;border-right: 1px solid #AAAAAA;padding:1px;">{{printData.residenceNo}}</div>
348
-					<div style="width:14%;border-right: 1px solid #AAAAAA;padding:1px;">年龄</div>
349
-					<div style="width:16%;padding:1px;"> {{printData.patientAge}}岁</div>
350
-				</div>
351
-				<div style="display: flex;border-bottom: 1px solid #AAAAAA;">
352
-					<div style="width:20%;border-right: 1px solid #AAAAAA;padding:1px;">科室 </div>
353
-					<div style="width:50%;border-right: 1px solid #AAAAAA;
354
-					padding:1px;overflow: hidden;white-space: nowrap">{{printData.patientDept}}</div>
355
-					<div style="width:14%;border-right: 1px solid #AAAAAA;padding:1px;">床号</div>
356
-					<div style="width:16%;padding:1px;">{{printData.patientBedNum}}床</div>
357
-				</div>
358
-				<div style="display: flex;border-bottom: 1px solid #AAAAAA;">
359
-					<div style="width:20%;border-right: 1px solid #AAAAAA;padding:1px;">部位 </div>
360
-					<div style="width:50%;border-right: 1px solid #AAAAAA;
361
-					padding:1px;overflow: hidden;white-space: nowrap">{{printData.takePart}}</div>
362
-					<div style="width:14%;border-right: 1px solid #AAAAAA;padding:1px;">标本数</div>
363
-					<div style="width:16%;padding:1px;">{{printData.specimenNum}}</div>
364
-				</div>
365
-				<div style="display: flex;">
366
-					<div style="width:20%;box-sizing: border-box;border-right: 1px solid #AAAAAA;padding:1px;">日期</div>
367
-					<div style="width:80%;box-sizing: border-box;padding:1px;border-right: 1px solid #fff;">{{printData.specimenList[0].inVitroTime|date:'yyyy-MM-dd'}}</div>
368
-				</div>
369
-			</div>
370
-			
371
-			<div style="height: 70px;" *ngIf="printData && printData.specimenList && printData.specimenList.length==1 && operation == 'addPrint'"></div>
372
-			<div style="height: 20px;" *ngIf="printData && printData.specimenList && printData.specimenList.length>1 && operation != 'addPrint'"></div>
328
+			<div style="height: 70px;" *ngIf="printData && printData.specimenList && printData.specimenList.length==1"></div>
329
+			<div style="height: 20px;" *ngIf="printData && printData.specimenList && printData.specimenList.length>1"></div>
373 330
 			<div style="font-size: 12px;" *ngIf="printData && printData.specimenList && printData.specimenList.length>0">
374 331
 				<div *ngFor="let data of printData.specimenList; let index=index;">
375 332
 				 <div style="height: 50px;" *ngIf="printData && printData.specimenList && printData.specimenList.length>1"></div>

+ 1 - 0
src/app/share/pathology-detail/pathology-detail.component.html

@@ -156,6 +156,7 @@
156 156
 				</div>
157 157
 				
158 158
 			</div>
159
+			<div style="height: 70px;" *ngIf="printData && printData.specimenList && printData.specimenList.length==1"></div>
159 160
 			<div style="height: 20px;" *ngIf="printData && printData.specimenList && printData.specimenList.length>1"></div>
160 161
 			<div style="font-size: 12px;" *ngIf="printData && printData.specimenList && printData.specimenList.length>0">
161 162
 				<div *ngFor="let data of printData.specimenList; let index=index;">

+ 1 - 1
src/app/views/fuwutai/fuwutai.component.html

@@ -926,7 +926,7 @@
926 926
           </button>
927 927
         </div>
928 928
       </div>
929
-      <div class="fixedMenu" *ngIf="!websocketLoading && !incomingService.getPhoneNumber()">
929
+      <div class="fixedMenu" *ngIf="!incomingService.getPhoneNumber()">
930 930
         <div class="menuItems">
931 931
           <button nz-button nzType="link" class="item itemLink" (click)="showBindExtensionNumber()">
932 932
             绑定分机

+ 32 - 17
src/app/views/fuwutai/fuwutai.component.ts

@@ -116,7 +116,12 @@ export class FuwutaiComponent implements OnInit {
116 116
     private http: HttpClient,
117 117
     public route: ActivatedRoute,
118 118
     public incomingService: WebsocketIncomingService,
119
-  ) {}
119
+  ) {
120
+    // 在组件中订阅服务的Observable
121
+    this.phones.getDataUpdate().subscribe(data => {
122
+      this.websocketLoading = data;
123
+    });
124
+  }
120 125
   validateFormZy!: FormGroup;
121 126
   validateFormQt!: FormGroup;
122 127
   // ---------------------------------------
@@ -804,6 +809,7 @@ export class FuwutaiComponent implements OnInit {
804 809
     TLWSA.onOpenreturn = (err) => {
805 810
       err = Number(err);
806 811
       if (!err) {
812
+        _this.incomingService.setPhoneNumber(TLWSA.phoneNumber);
807 813
         _this.websocketLoading = false;
808 814
         _this.cancelBindExtensionNumber();
809 815
         console.log('呼叫中心连接成功-----seimin');
@@ -888,12 +894,17 @@ export class FuwutaiComponent implements OnInit {
888 894
       clearTimeout(timer);
889 895
       if(location.hash === '#/dispatchingDesk'){
890 896
         console.log('与服务器网络连接中断-----seimin');
891
-        _this.msg.info('与服务器网络连接中断,2分钟后重连')
892
-        console.log('2分钟后自动重连-----seimin')
893
-        timer = setTimeout(function () {
894
-          //连接
895
-          tlwsa.tlaOpen(_this.incomingService.getSocketUrl());
896
-        }, 120000)
897
+        if(this.incomingService.getPhoneNumber()){
898
+          _this.msg.info('与服务器网络连接中断,2分钟后重连')
899
+          console.log('2分钟后自动重连-----seimin')
900
+          timer = setTimeout(function () {
901
+            //连接
902
+            TLWSA.phoneNumber = _this.incomingService.getPhoneNumber();
903
+            tlwsa.tlaOpen(_this.incomingService.getSocketUrl());
904
+          }, 120000)
905
+        }else{
906
+          _this.websocketLoading = false;
907
+        }
897 908
       }
898 909
     }
899 910
     //签入回调函数
@@ -1349,14 +1360,15 @@ export class FuwutaiComponent implements OnInit {
1349 1360
 
1350 1361
   showBindExtensionNumber() {
1351 1362
     this.showBindExtensionNumberModal = true;
1363
+    this.websocketLoading = false;
1352 1364
   }
1353 1365
 
1354 1366
   // 保存绑定分机-签入
1355 1367
   checkIn(phoneNumber){
1356 1368
     this.websocketLoading = true;
1357
-    this.incomingService.setPhoneNumber(phoneNumber);
1369
+    // this.incomingService.setPhoneNumber(phoneNumber);
1358 1370
     this.incomingService.closeWs(true);
1359
-    this.getWebsocketPhone();
1371
+    this.getWebsocketPhone(phoneNumber);
1360 1372
   }
1361 1373
 
1362 1374
   // 签出
@@ -1385,11 +1397,11 @@ export class FuwutaiComponent implements OnInit {
1385 1397
     // tel1: '',//目的号码对象
1386 1398
     // tel2: '',//转接坐席对象
1387 1399
   }
1388
-  getWebsocketPhone() {
1400
+  getWebsocketPhone(phoneNumber) {
1389 1401
     const sign = this.incomingService.getSign();
1390 1402
     if(sign === 'box'){
1391 1403
       // 录音盒
1392
-      this.incomingService.connectWs().subscribe((data) => {
1404
+      this.incomingService.connectWs(phoneNumber).subscribe((data) => {
1393 1405
         // data = { status: 201, phone: '013581394341' };//ceshi
1394 1406
         console.log(data);
1395 1407
         console.log(this.incidentModel);
@@ -1397,6 +1409,7 @@ export class FuwutaiComponent implements OnInit {
1397 1409
 
1398 1410
         // 200签入 201摘机 202来电
1399 1411
         if (data.status == 200 && data.phone) {
1412
+          this.incomingService.setPhoneNumber(phoneNumber);
1400 1413
           this.incidentModel = {};
1401 1414
           this.incidentMsg = {};
1402 1415
           this.incidentModel.callID = data.callId || undefined;
@@ -1426,6 +1439,7 @@ export class FuwutaiComponent implements OnInit {
1426 1439
       // 呼叫中心----start
1427 1440
       this.preState = '';
1428 1441
       //连接
1442
+      TLWSA.phoneNumber = phoneNumber;
1429 1443
       tlwsa.tlaOpen(this.incomingService.getSocketUrl());
1430 1444
     }else{
1431 1445
       this.websocketLoading = false;
@@ -2485,7 +2499,7 @@ export class FuwutaiComponent implements OnInit {
2485 2499
       this.incomingService.removePhoneNumber();
2486 2500
     }
2487 2501
     if (this.incomingService.getPhoneNumber()) {
2488
-      this.getWebsocketPhone();
2502
+      this.getWebsocketPhone(this.incomingService.getPhoneNumber());
2489 2503
     }else{
2490 2504
       this.websocketLoading = false;
2491 2505
     }
@@ -2832,7 +2846,7 @@ export class FuwutaiComponent implements OnInit {
2832 2846
         "category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
2833 2847
         "priorityId": this.incidentModel.priorityId || undefined,
2834 2848
         "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
2835
-        "title": category.mutiCategory,
2849
+        // "title": category.mutiCategory,
2836 2850
         "description": this.incidentModel.description,
2837 2851
         "directProcess": 1,
2838 2852
         "handleDescription": this.incidentModel.handleDescription,
@@ -3522,7 +3536,8 @@ export class FuwutaiComponent implements OnInit {
3522 3536
     }
3523 3537
 
3524 3538
     let category = this.applicationCategoryList.find(v => v.id == this.incidentModel.category);
3525
-    if(!this.incidentModel.duty){
3539
+    console.log('故障现象对象=>>>>>',category)
3540
+		if(!this.incidentModel.duty){
3526 3541
       this.msg.warning(`故障现象【${category.mutiCategory}】没有设置责任部门!`);
3527 3542
       return;
3528 3543
     }
@@ -3572,7 +3587,7 @@ export class FuwutaiComponent implements OnInit {
3572 3587
         "category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
3573 3588
         "priorityId": this.incidentModel.priorityId || undefined,
3574 3589
         "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
3575
-        "title": category.mutiCategory,
3590
+        // "title": category.mutiCategory,
3576 3591
         "description": this.incidentModel.description,
3577 3592
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
3578 3593
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
@@ -3646,7 +3661,7 @@ export class FuwutaiComponent implements OnInit {
3646 3661
         "category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
3647 3662
         "priorityId": this.incidentModel.priorityId || undefined,
3648 3663
         "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
3649
-        "title": category ? category.mutiCategory : '',
3664
+        // "title": category ? category.mutiCategory : '',
3650 3665
         "description": this.incidentModel.description,
3651 3666
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
3652 3667
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
@@ -3746,7 +3761,7 @@ export class FuwutaiComponent implements OnInit {
3746 3761
         "category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
3747 3762
         "priorityId": this.incidentModel.priorityId || undefined,
3748 3763
         "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
3749
-        "title": category ? category.mutiCategory : '',
3764
+        // "title": category ? category.mutiCategory : '',
3750 3765
         "description": this.incidentModel.description,
3751 3766
         "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
3752 3767
         "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,