Browse Source

fix: params resolve error

Signed-off-by: Carlos <568187512@qq.com>
Carlos 6 days ago
parent
commit
471e298a14

+ 5 - 1
src/app/pages/manager/hazard/hazard-tracking/hazard-tracking.component.ts

@@ -64,7 +64,11 @@ export class HazardTrackingComponent {
     this.route.queryParams.subscribe(params => {
       if (params['ids']) {
         this.isTaskRelative = true;
-        this.ids = params['ids'].map(Number);
+        if (Array.isArray(params['ids'])) {
+          this.ids = params['ids'].map(Number);
+        } else {
+          this.ids = [params['ids']];
+        }
       }
     });
   }

+ 1 - 0
src/app/pages/manager/hazard/inspection-plan/inspection-plan.component.ts

@@ -254,6 +254,7 @@ export class InspectionPlanComponent {
   }
   handleCloseDetail() {
     this.detailConfig.visible = false;
+    this.fetchPlans();
   }
   handleViewDetail(data: Hazard.InspectionPlan) {
     this.handleFetchDetail(data.id);