seimin 9 månader sedan
förälder
incheckning
9f6c3b263a
1 ändrade filer med 7 tillägg och 21 borttagningar
  1. 7 21
      src/app/views/inspection-plan/inspection-plan.component.ts

+ 7 - 21
src/app/views/inspection-plan/inspection-plan.component.ts

@@ -368,33 +368,19 @@ export class InspectionPlanComponent implements OnInit {
368 368
     //执行时间 start
369 369
     this.planTypeChange(data.planType.value);
370 370
     if (data.planType.value == "year") {
371
-      this.validateForm.controls.doYear.setValue(
372
-        format(data.execTime, "yyyy-MM-dd HH:mm:ss")
373
-      );
374
-      this.validateForm.controls.execTime.setValue(
375
-        format(data.execTime, "yyyy-MM-dd HH:mm:ss")
376
-      );
371
+      this.validateForm.controls.doYear.setValue(new Date(data.execTime));
372
+      this.validateForm.controls.execTime.setValue(new Date(data.execTime));
377 373
     } else if (data.planType.value == "month") {
378 374
       this.validateForm.controls.doMonth.setValue(data.planDay);
379
-      this.validateForm.controls.execTime.setValue(
380
-        format(data.execTime, "yyyy-MM-dd HH:mm:ss")
381
-      );
375
+      this.validateForm.controls.execTime.setValue(new Date(data.execTime));
382 376
     } else if (data.planType.value == "week") {
383 377
       this.validateForm.controls.doWeek.setValue(data.planDay);
384
-      this.validateForm.controls.execTime.setValue(
385
-        format(data.execTime, "yyyy-MM-dd HH:mm:ss")
386
-      );
378
+      this.validateForm.controls.execTime.setValue(new Date(data.execTime));
387 379
     } else if (data.planType.value == "day") {
388
-      this.validateForm.controls.execTime.setValue(
389
-        format(data.execTime, "yyyy-MM-dd HH:mm:ss")
390
-      );
380
+      this.validateForm.controls.execTime.setValue(new Date(data.execTime));
391 381
     } else if (data.planType.value == "none") {
392
-      this.validateForm.controls.doNone.setValue(
393
-        format(data.execTime, "yyyy-MM-dd HH:mm:ss")
394
-      );
395
-      this.validateForm.controls.execTime.setValue(
396
-        format(data.execTime, "yyyy-MM-dd HH:mm:ss")
397
-      );
382
+      this.validateForm.controls.doNone.setValue(new Date(data.execTime));
383
+      this.validateForm.controls.execTime.setValue(new Date(data.execTime));
398 384
     }
399 385
     //执行时间 end
400 386
   }