From 47feef8a0bca3cf3a5b33df13818d7e607b8ef62 Mon Sep 17 00:00:00 2001 From: mozhenghua Date: Thu, 28 Mar 2024 09:28:14 +0800 Subject: [PATCH] modify system initialize process --- .idea/workspace.xml | 16 ++-------------- src/common/init.system.component.ts | 27 +++++++++++++++++++++------ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 9956d89..997ab7a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,19 +6,7 @@ - - - - - - - - - - - - - + diff --git a/src/common/init.system.component.ts b/src/common/init.system.component.ts index 021fe44..bc2fa65 100644 --- a/src/common/init.system.component.ts +++ b/src/common/init.system.component.ts @@ -20,21 +20,25 @@ import {Component, OnInit} from "@angular/core"; import {BasicFormComponent} from "./basic.form.component"; import {TISService} from "./tis.service"; import {NzModalRef} from "ng-zorro-antd/modal"; +import {ActivatedRoute, Router} from "@angular/router"; +import {NzProgressStatusType} from "ng-zorro-antd/progress/typings"; @Component({ template: ` - - - - - + + + + + ` }) export class InitSystemComponent extends BasicFormComponent implements OnInit { _startInitialize = false; _percent = 0; - constructor(tisService: TISService, private activeModal: NzModalRef) { + _progressStatus: NzProgressStatusType = 'active'; + + constructor(tisService: TISService, private activeModal: NzModalRef, private router: Router, private route: ActivatedRoute) { super(tisService); } @@ -56,9 +60,20 @@ export class InitSystemComponent extends BasicFormComponent implements OnInit { clearInterval(timer); if (r.success) { this.activeModal.close(r); + this._progressStatus = "success"; + // this.router.navigateByUrl('/', {skipLocationChange: true}) + // .then(() => { + // this.router.navigate(["/"]); + // }); + window.location.reload(); } else { this.processResult(r); + this._progressStatus = 'exception'; } + }, () => { + this._progressStatus = 'exception'; + }).finally(() => { + }); } }