Parcourir la source

院区系统名称和大屏名称

seimin il y a 1 an
Parent
commit
728837cba5

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

@@ -26,6 +26,11 @@ const routes: Routes = [
26
     path: 'login',
26
     path: 'login',
27
     loadChildren: () => import('./views/login/login.module').then(m => m.LoginModule)
27
     loadChildren: () => import('./views/login/login.module').then(m => m.LoginModule)
28
   },
28
   },
29
+  // 登录
30
+  {
31
+    path: 'login/:hosId',
32
+    loadChildren: () => import('./views/login/login.module').then(m => m.LoginModule)
33
+  },
29
   // 管理端
34
   // 管理端
30
   {
35
   {
31
     path: 'main',
36
     path: 'main',

+ 16 - 1
src/app/app.component.ts

@@ -9,7 +9,22 @@ import { MarkingService } from './services/marking.service';
9
 })
9
 })
10
 export class AppComponent {
10
 export class AppComponent {
11
   constructor(private titleService:Title, private tool:ToolService, private markingService: MarkingService){
11
   constructor(private titleService:Title, private tool:ToolService, private markingService: MarkingService){
12
-    this.tool.getSysNameAndLogoAsync().subscribe(result => {
12
+    let reg = /^#\/login\/?(\d*)$/;
13
+    let isHosIdLogin = reg.test(location.hash);
14
+    let hosId;
15
+    console.log(isHosIdLogin)
16
+    if(isHosIdLogin){
17
+      // 登录页
18
+      hosId = location.hash.replace(reg, '$1');
19
+    }else if(location.hash == '#/main/sysConfig'){
20
+      // 系统配置页
21
+      hosId = '';
22
+    }else{
23
+      // 其他页面
24
+      hosId = this.tool.getCurrentHospital().id;
25
+    }
26
+    console.log(hosId);
27
+    this.tool.getSysNameAndLogoAsync(hosId).subscribe(result => {
13
       let marking = result.project || '';
28
       let marking = result.project || '';
14
       let logoTitle = result.sysName || '';
29
       let logoTitle = result.sysName || '';
15
       let logoUrl = location.origin + '/file' + result.logo || '';
30
       let logoUrl = location.origin + '/file' + result.logo || '';

+ 2 - 2
src/app/services/main.service.ts

@@ -715,8 +715,8 @@ export class MainService {
715
     );
715
     );
716
   }
716
   }
717
   // 获取logo和title
717
   // 获取logo和title
718
-  getSysNameAndLogo(): any {
719
-    return this.http.get(host.host + "/auth/getSysNameAndLogo", {});
718
+  getSysNameAndLogo(hosId): any {
719
+    return this.http.get(host.host + "/auth/getSysNameAndLogo" + (hosId ? '?hosId=' + hosId : ''), {});
720
   }
720
   }
721
 
721
 
722
   //获取启动中的工作分配方案
722
   //获取启动中的工作分配方案

+ 2 - 2
src/app/services/tool.service.ts

@@ -12,8 +12,8 @@ export class ToolService {
12
   constructor(private mainService: MainService) {}
12
   constructor(private mainService: MainService) {}
13
 
13
 
14
   // 获取logoUrl和logoTitle
14
   // 获取logoUrl和logoTitle
15
-  getSysNameAndLogoAsync(){
16
-    return this.mainService.getSysNameAndLogo();
15
+  getSysNameAndLogoAsync(hosId = ''){
16
+    return this.mainService.getSysNameAndLogo(hosId);
17
   }
17
   }
18
 
18
 
19
   // 设置logoTitle
19
   // 设置logoTitle

+ 7 - 1
src/app/views/data-dictionary/data-dictionary.component.ts

@@ -71,7 +71,13 @@ export class DataDictionaryComponent implements OnInit {
71
         dictionaryName: '统计分类',
71
         dictionaryName: '统计分类',
72
         key: 'statistics_date_type',
72
         key: 'statistics_date_type',
73
         type: 'dictionary',
73
         type: 'dictionary',
74
-      }
74
+      },
75
+      {
76
+        id: -3,
77
+        dictionaryName: '大扫描提示',
78
+        key: 'bigScan_special_msg',
79
+        type: 'dictionary',
80
+      },
75
     ];
81
     ];
76
     if (Object.keys(this.checkedDictionary).length) {
82
     if (Object.keys(this.checkedDictionary).length) {
77
       this.dictionaryList.forEach((item) => {
83
       this.dictionaryList.forEach((item) => {

+ 14 - 3
src/app/views/fuwutai/fuwutai.component.ts

@@ -19,6 +19,7 @@ import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
19
 import { Subject } from "rxjs";
19
 import { Subject } from "rxjs";
20
 import { debounceTime } from "rxjs/operators";
20
 import { debounceTime } from "rxjs/operators";
21
 import { SourceId } from "src/app/type/types";
21
 import { SourceId } from "src/app/type/types";
22
+import { ToolService } from 'src/app/services/tool.service';
22
 @Component({
23
 @Component({
23
   selector: "app-fuwutai",
24
   selector: "app-fuwutai",
24
   templateUrl: "./fuwutai.component.html",
25
   templateUrl: "./fuwutai.component.html",
@@ -106,7 +107,8 @@ export class FuwutaiComponent implements OnInit {
106
     private msg: NzMessageService,
107
     private msg: NzMessageService,
107
     private notification: NzNotificationService,
108
     private notification: NzNotificationService,
108
     private phones: WebsocketPhoneService,
109
     private phones: WebsocketPhoneService,
109
-    private sers: WebsocketSerService
110
+    private sers: WebsocketSerService,
111
+    private tool: ToolService,
110
   ) {}
112
   ) {}
111
   validateFormZy!: FormGroup;
113
   validateFormZy!: FormGroup;
112
   validateFormQt!: FormGroup;
114
   validateFormQt!: FormGroup;
@@ -1185,21 +1187,30 @@ export class FuwutaiComponent implements OnInit {
1185
     // 假退出
1187
     // 假退出
1186
     this.btnLoading = false;
1188
     this.btnLoading = false;
1187
     this.closeLogoutModal();
1189
     this.closeLogoutModal();
1190
+    let hospital = this.tool.getCurrentHospital();
1191
+    if(hospital){
1192
+      this.router.navigate(["login", hospital.id]);
1193
+    }else{
1194
+      this.router.navigateByUrl("login");
1195
+    }
1188
     localStorage.removeItem("user");
1196
     localStorage.removeItem("user");
1189
     localStorage.removeItem("menu");
1197
     localStorage.removeItem("menu");
1190
     localStorage.removeItem("phones");
1198
     localStorage.removeItem("phones");
1191
     localStorage.removeItem("index");
1199
     localStorage.removeItem("index");
1192
-    this.router.navigateByUrl("login");
1193
     // 假退出
1200
     // 假退出
1194
     this.mainService.logOut().subscribe((data) => {
1201
     this.mainService.logOut().subscribe((data) => {
1195
       this.btnLoading = false;
1202
       this.btnLoading = false;
1196
       this.closeLogoutModal();
1203
       this.closeLogoutModal();
1197
       if (data.status == 200) {
1204
       if (data.status == 200) {
1205
+        if(hospital){
1206
+          this.router.navigate(["login", hospital.id]);
1207
+        }else{
1208
+          this.router.navigateByUrl("login");
1209
+        }
1198
         localStorage.removeItem("user");
1210
         localStorage.removeItem("user");
1199
         localStorage.removeItem("menu");
1211
         localStorage.removeItem("menu");
1200
         localStorage.removeItem("phones");
1212
         localStorage.removeItem("phones");
1201
         localStorage.removeItem("index");
1213
         localStorage.removeItem("index");
1202
-        this.router.navigateByUrl("login");
1203
       }
1214
       }
1204
     });
1215
     });
1205
   }
1216
   }

+ 12 - 2
src/app/views/hushijiandan/hushijiandan.component.ts

@@ -4156,19 +4156,29 @@ export class HushijiandanComponent implements OnInit {
4156
   logOut(): void {
4156
   logOut(): void {
4157
     let that = this;
4157
     let that = this;
4158
     // 假退出
4158
     // 假退出
4159
+    let hospital = this.tool.getCurrentHospital();
4160
+    if(hospital){
4161
+      this.router.navigate(["login", hospital.id]);
4162
+    }else{
4163
+      this.router.navigateByUrl("login");
4164
+    }
4159
     localStorage.removeItem("user");
4165
     localStorage.removeItem("user");
4160
     localStorage.removeItem("menu");
4166
     localStorage.removeItem("menu");
4161
     localStorage.removeItem("phones");
4167
     localStorage.removeItem("phones");
4162
     localStorage.removeItem("index");
4168
     localStorage.removeItem("index");
4163
-    that.router.navigateByUrl("login");
4169
+
4164
     // 假退出
4170
     // 假退出
4165
     that.mainService.logOut().subscribe((data) => {
4171
     that.mainService.logOut().subscribe((data) => {
4166
       if (data.status == 200) {
4172
       if (data.status == 200) {
4173
+        if(hospital){
4174
+          this.router.navigate(["login", hospital.id]);
4175
+        }else{
4176
+          this.router.navigateByUrl("login");
4177
+        }
4167
         localStorage.removeItem("user");
4178
         localStorage.removeItem("user");
4168
         localStorage.removeItem("menu");
4179
         localStorage.removeItem("menu");
4169
         localStorage.removeItem("phones");
4180
         localStorage.removeItem("phones");
4170
         localStorage.removeItem("index");
4181
         localStorage.removeItem("index");
4171
-        that.router.navigateByUrl("login");
4172
       }
4182
       }
4173
     });
4183
     });
4174
   }
4184
   }

+ 23 - 3
src/app/views/login/login.component.ts

@@ -7,6 +7,8 @@ import http from "../../../assets/js/http";
7
 import { AES, mode, pad, enc } from "crypto-js";
7
 import { AES, mode, pad, enc } from "crypto-js";
8
 import { baseUrlType } from "src/app/type/types";
8
 import { baseUrlType } from "src/app/type/types";
9
 import { ToolService } from 'src/app/services/tool.service';
9
 import { ToolService } from 'src/app/services/tool.service';
10
+import { Title } from '@angular/platform-browser';
11
+import { MarkingService } from 'src/app/services/marking.service';
10
 @Component({
12
 @Component({
11
   selector: "app-login",
13
   selector: "app-login",
12
   templateUrl: "./login.component.html",
14
   templateUrl: "./login.component.html",
@@ -22,7 +24,9 @@ export class LoginComponent implements OnInit {
22
     private fb: FormBuilder,
24
     private fb: FormBuilder,
23
     private mainService: MainService,
25
     private mainService: MainService,
24
     private msg: NzMessageService,
26
     private msg: NzMessageService,
25
-    private tool: ToolService
27
+    private tool: ToolService,
28
+    private titleService: Title,
29
+    private markingService: MarkingService,
26
   ) {}
30
   ) {}
27
   ngOnInit() {
31
   ngOnInit() {
28
     this.http = http;
32
     this.http = http;
@@ -163,8 +167,24 @@ export class LoginComponent implements OnInit {
163
             localStorage.removeItem("remember");
167
             localStorage.removeItem("remember");
164
           }
168
           }
165
         }
169
         }
166
-        this.toRoute2(data);
167
-        this.initMenu(data.user.menu);
170
+        // 重置系统名称和大屏名称
171
+        console.log(data.user);
172
+        let hosId = data.user.user.currentHospital ? data.user.user.currentHospital.id : ''
173
+        this.tool.getSysNameAndLogoAsync(hosId).subscribe(result => {
174
+          let marking = result.project || '';
175
+          let logoTitle = result.sysName || '';
176
+          let logoUrl = location.origin + '/file' + result.logo || '';
177
+          let faviconUrl = location.origin + '/file' + result.favicon || '';
178
+          this.markingService.setMarking(marking);
179
+          this.tool.setSysName(logoTitle);
180
+          this.tool.setLogo(logoUrl);
181
+          this.tool.setFavicon(faviconUrl);
182
+          this.titleService.setTitle(this.tool.logoTitle);
183
+          (document.querySelector('#favicon') as any).href = this.tool.faviconUrl;
184
+
185
+          this.toRoute2(data);
186
+          this.initMenu(data.user.menu);
187
+        })
168
       } else {
188
       } else {
169
         this.msg.error(data.remarks, {
189
         this.msg.error(data.remarks, {
170
           nzDuration: 1000,
190
           nzDuration: 1000,

+ 13 - 2
src/app/views/main/main.component.ts

@@ -452,21 +452,32 @@ export class MainComponent implements OnInit {
452
   // 退出
452
   // 退出
453
   logOut(): void {
453
   logOut(): void {
454
     // 假退出
454
     // 假退出
455
+    let hospital = this.tool.getCurrentHospital();
456
+    if(hospital){
457
+      this.router.navigate(["login", hospital.id]);
458
+    }else{
459
+      this.router.navigateByUrl("login");
460
+    }
455
     localStorage.removeItem("user");
461
     localStorage.removeItem("user");
456
     localStorage.removeItem("menu");
462
     localStorage.removeItem("menu");
457
     localStorage.removeItem("phones");
463
     localStorage.removeItem("phones");
458
     localStorage.removeItem("index");
464
     localStorage.removeItem("index");
459
-    this.router.navigateByUrl("login");
465
+
460
     // 假退出
466
     // 假退出
461
     this.mainService.logOut().subscribe((data) => {
467
     this.mainService.logOut().subscribe((data) => {
462
       if (data.status == 200) {
468
       if (data.status == 200) {
469
+        if(hospital){
470
+          this.router.navigate(["login", hospital.id]);
471
+        }else{
472
+          this.router.navigateByUrl("login");
473
+        }
463
         localStorage.removeItem("user");
474
         localStorage.removeItem("user");
464
         localStorage.removeItem("menu");
475
         localStorage.removeItem("menu");
465
         localStorage.removeItem("phones");
476
         localStorage.removeItem("phones");
466
         localStorage.removeItem("index");
477
         localStorage.removeItem("index");
467
-        this.router.navigateByUrl("login");
468
       }
478
       }
469
     });
479
     });
480
+
470
   }
481
   }
471
 
482
 
472
   // 连接websocket
483
   // 连接websocket

+ 13 - 2
src/app/views/pharmacy/pharmacy.component.ts

@@ -248,21 +248,32 @@ export class PharmacyComponent implements OnInit {
248
   // 退出
248
   // 退出
249
   logOut(): void {
249
   logOut(): void {
250
     // 假退出
250
     // 假退出
251
+    let hospital = this.tool.getCurrentHospital();
252
+    if(hospital){
253
+      this.router.navigate(["login", hospital.id]);
254
+    }else{
255
+      this.router.navigateByUrl("login");
256
+    }
251
     localStorage.removeItem("user");
257
     localStorage.removeItem("user");
252
     localStorage.removeItem("menu");
258
     localStorage.removeItem("menu");
253
     localStorage.removeItem("phones");
259
     localStorage.removeItem("phones");
254
     localStorage.removeItem("index");
260
     localStorage.removeItem("index");
255
-    this.router.navigateByUrl("login");
261
+
256
     // 假退出
262
     // 假退出
257
     this.mainService.logOut().subscribe((data) => {
263
     this.mainService.logOut().subscribe((data) => {
258
       if (data.status == 200) {
264
       if (data.status == 200) {
265
+        if(hospital){
266
+          this.router.navigate(["login", hospital.id]);
267
+        }else{
268
+          this.router.navigateByUrl("login");
269
+        }
259
         localStorage.removeItem("user");
270
         localStorage.removeItem("user");
260
         localStorage.removeItem("menu");
271
         localStorage.removeItem("menu");
261
         localStorage.removeItem("phones");
272
         localStorage.removeItem("phones");
262
         localStorage.removeItem("index");
273
         localStorage.removeItem("index");
263
-        this.router.navigateByUrl("login");
264
       }
274
       }
265
     });
275
     });
276
+
266
   }
277
   }
267
   //待配药
278
   //待配药
268
   print(id?) {
279
   print(id?) {

+ 13 - 2
src/app/views/pharmacy2/pharmacy2.component.ts

@@ -419,21 +419,32 @@ export class Pharmacy2Component implements OnInit, OnDestroy {
419
   // 退出
419
   // 退出
420
   logOut(): void {
420
   logOut(): void {
421
     // 假退出
421
     // 假退出
422
+    let hospital = this.tool.getCurrentHospital();
423
+    if(hospital){
424
+      this.router.navigate(["login", hospital.id]);
425
+    }else{
426
+      this.router.navigateByUrl("login");
427
+    }
422
     localStorage.removeItem("user");
428
     localStorage.removeItem("user");
423
     localStorage.removeItem("menu");
429
     localStorage.removeItem("menu");
424
     localStorage.removeItem("phones");
430
     localStorage.removeItem("phones");
425
     localStorage.removeItem("index");
431
     localStorage.removeItem("index");
426
-    this.router.navigateByUrl("login");
432
+
427
     // 假退出
433
     // 假退出
428
     this.mainService.logOut().subscribe((data) => {
434
     this.mainService.logOut().subscribe((data) => {
429
       if (data.status == 200) {
435
       if (data.status == 200) {
436
+        if(hospital){
437
+          this.router.navigate(["login", hospital.id]);
438
+        }else{
439
+          this.router.navigateByUrl("login");
440
+        }
430
         localStorage.removeItem("user");
441
         localStorage.removeItem("user");
431
         localStorage.removeItem("menu");
442
         localStorage.removeItem("menu");
432
         localStorage.removeItem("phones");
443
         localStorage.removeItem("phones");
433
         localStorage.removeItem("index");
444
         localStorage.removeItem("index");
434
-        this.router.navigateByUrl("login");
435
       }
445
       }
436
     });
446
     });
447
+
437
   }
448
   }
438
   //待配药
449
   //待配药
439
   print(id?) {
450
   print(id?) {

+ 12 - 2
src/app/views/specimen-view2/specimen-view2.component.ts

@@ -453,21 +453,31 @@ export class SpecimenView2Component implements OnInit, OnDestroy {
453
   // 退出
453
   // 退出
454
   logOut(): void {
454
   logOut(): void {
455
     // 假退出
455
     // 假退出
456
+    let hospital = this.tool.getCurrentHospital();
457
+    if(hospital){
458
+      this.router.navigate(["login", hospital.id]);
459
+    }else{
460
+      this.router.navigateByUrl("login");
461
+    }
456
     localStorage.removeItem("user");
462
     localStorage.removeItem("user");
457
     localStorage.removeItem("menu");
463
     localStorage.removeItem("menu");
458
     localStorage.removeItem("phones");
464
     localStorage.removeItem("phones");
459
     localStorage.removeItem("index");
465
     localStorage.removeItem("index");
460
-    this.router.navigateByUrl("login");
461
     // 假退出
466
     // 假退出
462
     this.mainService.logOut().subscribe((data) => {
467
     this.mainService.logOut().subscribe((data) => {
463
       if (data.status == 200) {
468
       if (data.status == 200) {
469
+        if(hospital){
470
+          this.router.navigate(["login", hospital.id]);
471
+        }else{
472
+          this.router.navigateByUrl("login");
473
+        }
464
         localStorage.removeItem("user");
474
         localStorage.removeItem("user");
465
         localStorage.removeItem("menu");
475
         localStorage.removeItem("menu");
466
         localStorage.removeItem("phones");
476
         localStorage.removeItem("phones");
467
         localStorage.removeItem("index");
477
         localStorage.removeItem("index");
468
-        this.router.navigateByUrl("login");
469
       }
478
       }
470
     });
479
     });
480
+
471
   }
481
   }
472
 
482
 
473
   // 右侧菜单
483
   // 右侧菜单