Pārlūkot izejas kodu

院区系统名称和大屏名称

seimin 1 gadu atpakaļ
vecāks
revīzija
728837cba5

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

@@ -26,6 +26,11 @@ const routes: Routes = [
26 26
     path: 'login',
27 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 36
     path: 'main',

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

@@ -9,7 +9,22 @@ import { MarkingService } from './services/marking.service';
9 9
 })
10 10
 export class AppComponent {
11 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 28
       let marking = result.project || '';
14 29
       let logoTitle = result.sysName || '';
15 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 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 12
   constructor(private mainService: MainService) {}
13 13
 
14 14
   // 获取logoUrl和logoTitle
15
-  getSysNameAndLogoAsync(){
16
-    return this.mainService.getSysNameAndLogo();
15
+  getSysNameAndLogoAsync(hosId = ''){
16
+    return this.mainService.getSysNameAndLogo(hosId);
17 17
   }
18 18
 
19 19
   // 设置logoTitle

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

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

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

@@ -19,6 +19,7 @@ import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
19 19
 import { Subject } from "rxjs";
20 20
 import { debounceTime } from "rxjs/operators";
21 21
 import { SourceId } from "src/app/type/types";
22
+import { ToolService } from 'src/app/services/tool.service';
22 23
 @Component({
23 24
   selector: "app-fuwutai",
24 25
   templateUrl: "./fuwutai.component.html",
@@ -106,7 +107,8 @@ export class FuwutaiComponent implements OnInit {
106 107
     private msg: NzMessageService,
107 108
     private notification: NzNotificationService,
108 109
     private phones: WebsocketPhoneService,
109
-    private sers: WebsocketSerService
110
+    private sers: WebsocketSerService,
111
+    private tool: ToolService,
110 112
   ) {}
111 113
   validateFormZy!: FormGroup;
112 114
   validateFormQt!: FormGroup;
@@ -1185,21 +1187,30 @@ export class FuwutaiComponent implements OnInit {
1185 1187
     // 假退出
1186 1188
     this.btnLoading = false;
1187 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 1196
     localStorage.removeItem("user");
1189 1197
     localStorage.removeItem("menu");
1190 1198
     localStorage.removeItem("phones");
1191 1199
     localStorage.removeItem("index");
1192
-    this.router.navigateByUrl("login");
1193 1200
     // 假退出
1194 1201
     this.mainService.logOut().subscribe((data) => {
1195 1202
       this.btnLoading = false;
1196 1203
       this.closeLogoutModal();
1197 1204
       if (data.status == 200) {
1205
+        if(hospital){
1206
+          this.router.navigate(["login", hospital.id]);
1207
+        }else{
1208
+          this.router.navigateByUrl("login");
1209
+        }
1198 1210
         localStorage.removeItem("user");
1199 1211
         localStorage.removeItem("menu");
1200 1212
         localStorage.removeItem("phones");
1201 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 4156
   logOut(): void {
4157 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 4165
     localStorage.removeItem("user");
4160 4166
     localStorage.removeItem("menu");
4161 4167
     localStorage.removeItem("phones");
4162 4168
     localStorage.removeItem("index");
4163
-    that.router.navigateByUrl("login");
4169
+
4164 4170
     // 假退出
4165 4171
     that.mainService.logOut().subscribe((data) => {
4166 4172
       if (data.status == 200) {
4173
+        if(hospital){
4174
+          this.router.navigate(["login", hospital.id]);
4175
+        }else{
4176
+          this.router.navigateByUrl("login");
4177
+        }
4167 4178
         localStorage.removeItem("user");
4168 4179
         localStorage.removeItem("menu");
4169 4180
         localStorage.removeItem("phones");
4170 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 7
 import { AES, mode, pad, enc } from "crypto-js";
8 8
 import { baseUrlType } from "src/app/type/types";
9 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 12
 @Component({
11 13
   selector: "app-login",
12 14
   templateUrl: "./login.component.html",
@@ -22,7 +24,9 @@ export class LoginComponent implements OnInit {
22 24
     private fb: FormBuilder,
23 25
     private mainService: MainService,
24 26
     private msg: NzMessageService,
25
-    private tool: ToolService
27
+    private tool: ToolService,
28
+    private titleService: Title,
29
+    private markingService: MarkingService,
26 30
   ) {}
27 31
   ngOnInit() {
28 32
     this.http = http;
@@ -163,8 +167,24 @@ export class LoginComponent implements OnInit {
163 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 188
       } else {
169 189
         this.msg.error(data.remarks, {
170 190
           nzDuration: 1000,

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

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

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

@@ -248,21 +248,32 @@ export class PharmacyComponent implements OnInit {
248 248
   // 退出
249 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 257
     localStorage.removeItem("user");
252 258
     localStorage.removeItem("menu");
253 259
     localStorage.removeItem("phones");
254 260
     localStorage.removeItem("index");
255
-    this.router.navigateByUrl("login");
261
+
256 262
     // 假退出
257 263
     this.mainService.logOut().subscribe((data) => {
258 264
       if (data.status == 200) {
265
+        if(hospital){
266
+          this.router.navigate(["login", hospital.id]);
267
+        }else{
268
+          this.router.navigateByUrl("login");
269
+        }
259 270
         localStorage.removeItem("user");
260 271
         localStorage.removeItem("menu");
261 272
         localStorage.removeItem("phones");
262 273
         localStorage.removeItem("index");
263
-        this.router.navigateByUrl("login");
264 274
       }
265 275
     });
276
+
266 277
   }
267 278
   //待配药
268 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 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 428
     localStorage.removeItem("user");
423 429
     localStorage.removeItem("menu");
424 430
     localStorage.removeItem("phones");
425 431
     localStorage.removeItem("index");
426
-    this.router.navigateByUrl("login");
432
+
427 433
     // 假退出
428 434
     this.mainService.logOut().subscribe((data) => {
429 435
       if (data.status == 200) {
436
+        if(hospital){
437
+          this.router.navigate(["login", hospital.id]);
438
+        }else{
439
+          this.router.navigateByUrl("login");
440
+        }
430 441
         localStorage.removeItem("user");
431 442
         localStorage.removeItem("menu");
432 443
         localStorage.removeItem("phones");
433 444
         localStorage.removeItem("index");
434
-        this.router.navigateByUrl("login");
435 445
       }
436 446
     });
447
+
437 448
   }
438 449
   //待配药
439 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 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 462
     localStorage.removeItem("user");
457 463
     localStorage.removeItem("menu");
458 464
     localStorage.removeItem("phones");
459 465
     localStorage.removeItem("index");
460
-    this.router.navigateByUrl("login");
461 466
     // 假退出
462 467
     this.mainService.logOut().subscribe((data) => {
463 468
       if (data.status == 200) {
469
+        if(hospital){
470
+          this.router.navigate(["login", hospital.id]);
471
+        }else{
472
+          this.router.navigateByUrl("login");
473
+        }
464 474
         localStorage.removeItem("user");
465 475
         localStorage.removeItem("menu");
466 476
         localStorage.removeItem("phones");
467 477
         localStorage.removeItem("index");
468
-        this.router.navigateByUrl("login");
469 478
       }
470 479
     });
480
+
471 481
   }
472 482
 
473 483
   // 右侧菜单