seimin 1 месяц назад
Родитель
Сommit
c9d0390be5
19 измененных файлов с 62 добавлено и 33 удалено
  1. 6 0
      src/app/app-routing.module.ts
  2. 2 2
      src/app/views/new-statistics/maintenance-statistics/building-statistics/building-statistics.component.ts
  3. 2 2
      src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.component.ts
  4. 2 2
      src/app/views/new-statistics/maintenance-statistics/category-source-statistics/category-source-statistics.component.ts
  5. 2 2
      src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.component.ts
  6. 2 2
      src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.component.ts
  7. 2 2
      src/app/views/new-statistics/maintenance-statistics/consumable-statistics/consumable-statistics.component.ts
  8. 2 2
      src/app/views/new-statistics/maintenance-statistics/department-evaluate-statistics/department-evaluate-statistics.component.ts
  9. 2 2
      src/app/views/new-statistics/maintenance-statistics/department-incident-statistics/department-incident-statistics.component.ts
  10. 2 2
      src/app/views/new-statistics/maintenance-statistics/department-source-statistics/department-source-statistics.component.ts
  11. 2 2
      src/app/views/new-statistics/maintenance-statistics/floor-statistics/floor-statistics.component.ts
  12. 2 2
      src/app/views/new-statistics/maintenance-statistics/group-statistics/group-statistics.component.ts
  13. 2 2
      src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.component.ts
  14. 2 0
      src/app/views/new-statistics/maintenance-statistics/maintenance-statistics.component.less
  15. 18 3
      src/app/views/new-statistics/maintenance-statistics/maintenance-statistics.component.ts
  16. 2 2
      src/app/views/new-statistics/maintenance-statistics/tripartite-company-statistics/tripartite-company-statistics.component.ts
  17. 2 2
      src/app/views/new-statistics/maintenance-statistics/user-statistics/user-statistics.component.ts
  18. 2 2
      src/app/views/new-statistics/maintenance-statistics/work-hour-statistics/work-hour-statistics.component.ts
  19. 6 0
      src/app/views/new-statistics/services/tab.service.ts

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

@@ -185,6 +185,12 @@ const routes: Routes = [
185 185
     path: "newStatistics",
186 186
     loadChildren: () => import("./views/new-statistics/new-statistics.module").then((m) => m.NewStatisticsModule),
187 187
   },
188
+  // 临时路由
189
+  {
190
+    path: "redirect",
191
+    redirectTo: '/',
192
+    pathMatch: 'full'
193
+  },
188 194
   // 管理端首页
189 195
   {
190 196
     path: '**',

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/building-statistics/building-statistics.component.ts

@@ -34,8 +34,8 @@ export class BuildingStatisticsComponent implements OnInit, AfterViewInit {
34 34
   @HostListener('window:resize')
35 35
   onResize(): void {
36 36
     setTimeout(() => {
37
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
38
-      console.log('this.tableHeight:', this.tableHeight)
37
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
38
+
39 39
     }, 0)
40 40
   }
41 41
 

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/category-one-statistics/category-one-statistics.component.ts

@@ -34,8 +34,8 @@ export class CategoryOneStatisticsComponent implements OnInit, AfterViewInit {
34 34
   @HostListener('window:resize')
35 35
   onResize(): void {
36 36
     setTimeout(() => {
37
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
38
-      console.log('this.tableHeight:', this.tableHeight)
37
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
38
+
39 39
     }, 0)
40 40
   }
41 41
 

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/category-source-statistics/category-source-statistics.component.ts

@@ -34,8 +34,8 @@ export class CategorySourceStatisticsComponent implements OnInit, AfterViewInit
34 34
   @HostListener('window:resize')
35 35
   onResize(): void {
36 36
     setTimeout(() => {
37
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
38
-      console.log('this.tableHeight:', this.tableHeight)
37
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
38
+
39 39
     }, 0)
40 40
   }
41 41
 

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/category-three-statistics/category-three-statistics.component.ts

@@ -45,8 +45,8 @@ export class CategoryThreeStatisticsComponent implements OnInit, AfterViewInit {
45 45
   @HostListener('window:resize')
46 46
   onResize(): void {
47 47
     setTimeout(() => {
48
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
49
-      console.log('this.tableHeight:', this.tableHeight)
48
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
49
+
50 50
     }, 0)
51 51
   }
52 52
 

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/category-two-statistics/category-two-statistics.component.ts

@@ -44,8 +44,8 @@ export class CategoryTwoStatisticsComponent implements OnInit, AfterViewInit {
44 44
   @HostListener('window:resize')
45 45
   onResize(): void {
46 46
     setTimeout(() => {
47
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
48
-      console.log('this.tableHeight:', this.tableHeight)
47
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
48
+
49 49
     }, 0)
50 50
   }
51 51
 

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/consumable-statistics/consumable-statistics.component.ts

@@ -44,8 +44,8 @@ export class ConsumableStatisticsComponent implements OnInit, AfterViewInit {
44 44
   @HostListener('window:resize')
45 45
   onResize(): void {
46 46
     setTimeout(() => {
47
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
48
-      console.log('this.tableHeight:', this.tableHeight)
47
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
48
+
49 49
     }, 0)
50 50
   }
51 51
 

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/department-evaluate-statistics/department-evaluate-statistics.component.ts

@@ -36,8 +36,8 @@ export class DepartmentEvaluateStatisticsComponent implements OnInit, AfterViewI
36 36
   @HostListener('window:resize')
37 37
   onResize(): void {
38 38
     setTimeout(() => {
39
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
40
-      console.log('this.tableHeight:', this.tableHeight)
39
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
40
+
41 41
     }, 0)
42 42
   }
43 43
 

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/department-incident-statistics/department-incident-statistics.component.ts

@@ -36,8 +36,8 @@ export class DepartmentIncidentStatisticsComponent implements OnInit, AfterViewI
36 36
   @HostListener('window:resize')
37 37
   onResize(): void {
38 38
     setTimeout(() => {
39
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
40
-      console.log('this.tableHeight:', this.tableHeight)
39
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
40
+
41 41
     }, 0)
42 42
   }
43 43
 

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/department-source-statistics/department-source-statistics.component.ts

@@ -36,8 +36,8 @@ export class DepartmentSourceStatisticsComponent implements OnInit, AfterViewIni
36 36
   @HostListener('window:resize')
37 37
   onResize(): void {
38 38
     setTimeout(() => {
39
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
40
-      console.log('this.tableHeight:', this.tableHeight)
39
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
40
+
41 41
     }, 0)
42 42
   }
43 43
 

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/floor-statistics/floor-statistics.component.ts

@@ -44,8 +44,8 @@ export class FloorStatisticsComponent implements OnInit, AfterViewInit {
44 44
   @HostListener('window:resize')
45 45
   onResize(): void {
46 46
     setTimeout(() => {
47
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
48
-      console.log('this.tableHeight:', this.tableHeight)
47
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
48
+
49 49
     }, 0)
50 50
   }
51 51
 

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/group-statistics/group-statistics.component.ts

@@ -34,8 +34,8 @@ export class GroupStatisticsComponent implements OnInit, AfterViewInit {
34 34
   @HostListener('window:resize')
35 35
   onResize(): void {
36 36
     setTimeout(() => {
37
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
38
-      console.log('this.tableHeight:', this.tableHeight)
37
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
38
+
39 39
     }, 0)
40 40
   }
41 41
 

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/incident-statistics/incident-statistics.component.ts

@@ -44,8 +44,8 @@ export class IncidentStatisticsComponent implements OnInit, AfterViewInit {
44 44
   @HostListener('window:resize')
45 45
   onResize(): void {
46 46
     setTimeout(() => {
47
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
48
-      console.log('this.tableHeight:', this.tableHeight)
47
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
48
+
49 49
     }, 0)
50 50
   }
51 51
 

+ 2 - 0
src/app/views/new-statistics/maintenance-statistics/maintenance-statistics.component.less

@@ -51,6 +51,8 @@
51 51
       .icon_transport{
52 52
         color: #666666;
53 53
         font-size: 24px;
54
+        position: relative;
55
+        top: 2px;
54 56
       }
55 57
     }
56 58
   }

+ 18 - 3
src/app/views/new-statistics/maintenance-statistics/maintenance-statistics.component.ts

@@ -25,7 +25,7 @@ export class MaintenanceStatisticsComponent implements OnInit, OnDestroy {
25 25
   }
26 26
 
27 27
   ngOnDestroy(){
28
-    this.sessionRemove();
28
+    // this.sessionRemove();
29 29
     this.tabService.deleteAllRouteSnapshot();
30 30
   }
31 31
 
@@ -70,6 +70,14 @@ export class MaintenanceStatisticsComponent implements OnInit, OnDestroy {
70 70
   queryType;//查询范围
71 71
   // 初始化院区、部门显示
72 72
   initHospitalAndDuty(hospitalOrDuty){
73
+    let sessionData = JSON.parse(sessionStorage.getItem('maintenanceStatistics'));
74
+    console.log(sessionData);
75
+    if(sessionData){
76
+      this.hospital = sessionData.hospital;
77
+      this.duty = sessionData.duty;
78
+      this.queryType = sessionData.queryType;
79
+      return;
80
+    }
73 81
     let type = 'hospital';//默认是院区
74 82
     if(hospitalOrDuty.type){
75 83
       // 当前是责任部门
@@ -108,7 +116,7 @@ export class MaintenanceStatisticsComponent implements OnInit, OnDestroy {
108 116
 
109 117
   // 缓存数据
110 118
   sessionSave(){
111
-    sessionStorage.setItem('maintenanceStatistics', JSON.stringify({queryType: this.queryType, hospitalId: this.hospital ? this.hospital.id : undefined, dutyId: this.duty ? this.duty.id : undefined}))
119
+    sessionStorage.setItem('maintenanceStatistics', JSON.stringify({queryType: this.queryType, hospitalId: this.hospital ? this.hospital.id : undefined, dutyId: this.duty ? this.duty.id : undefined, hospital: this.hospital, duty: this.duty}));
112 120
   }
113 121
 
114 122
   // 清除缓存数据
@@ -131,7 +139,14 @@ export class MaintenanceStatisticsComponent implements OnInit, OnDestroy {
131 139
     this.queryRangeFlag = false;
132 140
 
133 141
     this.sessionSave();
134
-    this.router.navigate([`newStatistics/${this.route.parent.snapshot.routeConfig.path}/${this.activeSecondMenuLink}`], { replaceUrl: true });
142
+    // this.tabService.deleteRouteSnapshot(`/newStatistics/${this.route.parent.snapshot.routeConfig.path}/${this.activeSecondMenuLink}`);
143
+    // this.router.navigate([`/newStatistics/${this.route.parent.snapshot.routeConfig.path}/${this.activeSecondMenuLink}`], { replaceUrl: true });
144
+
145
+    this.router.navigateByUrl('/redirect', {
146
+      skipLocationChange: true
147
+    }).then(() => {
148
+      this.router.navigate([`/newStatistics/${this.route.parent.snapshot.routeConfig.path}/${this.activeSecondMenuLink}`], { replaceUrl: true });
149
+    });
135 150
   }
136 151
   cancelQueryRange() {
137 152
     this.queryRangeFlag = false;

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/tripartite-company-statistics/tripartite-company-statistics.component.ts

@@ -44,8 +44,8 @@ export class TripartiteCompanyStatisticsComponent implements OnInit, AfterViewIn
44 44
   @HostListener('window:resize')
45 45
   onResize(): void {
46 46
     setTimeout(() => {
47
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
48
-      console.log('this.tableHeight:', this.tableHeight)
47
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
48
+
49 49
     }, 0)
50 50
   }
51 51
 

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/user-statistics/user-statistics.component.ts

@@ -44,8 +44,8 @@ export class UserStatisticsComponent implements OnInit, AfterViewInit {
44 44
   @HostListener('window:resize')
45 45
   onResize(): void {
46 46
     setTimeout(() => {
47
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
48
-      console.log('this.tableHeight:', this.tableHeight)
47
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
48
+
49 49
     }, 0)
50 50
   }
51 51
 

+ 2 - 2
src/app/views/new-statistics/maintenance-statistics/work-hour-statistics/work-hour-statistics.component.ts

@@ -44,8 +44,8 @@ export class WorkHourStatisticsComponent implements OnInit, AfterViewInit {
44 44
   @HostListener('window:resize')
45 45
   onResize(): void {
46 46
     setTimeout(() => {
47
-      this.tableHeight = window.innerHeight - 64 - 64 - 36 - 48 - 8 - 45 - 54 - this.getMoreFilter;
48
-      console.log('this.tableHeight:', this.tableHeight)
47
+      this.tableHeight = window.innerHeight - document.querySelector('.searchDataWrap').clientHeight - 64 - 36 - 48 - 8 - document.querySelector('.ant-table-header').clientHeight - 55 - this.getMoreFilter - 2;
48
+
49 49
     }, 0)
50 50
   }
51 51
 

+ 6 - 0
src/app/views/new-statistics/services/tab.service.ts

@@ -22,6 +22,8 @@ export class TabService {
22 22
       	console.log('event:', event)
23 23
         if(event.urlAfterRedirects.startsWith('/newStatistics/')){
24 24
           this.updateTabs(event.urlAfterRedirects);
25
+        }else if(event.urlAfterRedirects !== '/'){
26
+          sessionStorage.removeItem('maintenanceStatistics')
25 27
         }
26 28
       });
27 29
   }
@@ -33,6 +35,10 @@ export class TabService {
33 35
     this.tabs = [];
34 36
   }
35 37
 
38
+  public deleteRouteSnapshot(path){
39
+    SimpleReuseStrategy.deleteRouteSnapshot(path);
40
+  }
41
+
36 42
   private updateTabs(url: string) {
37 43
     const normalizedUrl = this.getNormalizedUrl(url);
38 44
     const existingTab = this.tabs.find(t => t.path === normalizedUrl);