Skip to content

Commit

Permalink
modify system initialize process
Browse files Browse the repository at this point in the history
  • Loading branch information
baisui1981 committed Mar 28, 2024
1 parent 88fee9d commit 47feef8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 20 deletions.
16 changes: 2 additions & 14 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 21 additions & 6 deletions src/common/init.system.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: `
<nz-alert nzType="info" nzMessage="初次使用TIS,系统需要对相关配置进行初始化" nzShowIcon></nz-alert>
<tis-page-header [result]="this.result" [showBreadcrumb]="false">
<button nz-button nzType="primary" (click)="startInitialize()" [nzLoading]="_startInitialize">开始初始化</button>
</tis-page-header>
<nz-progress *ngIf="_startInitialize" [nzPercent]="_percent" nzStatus="active"></nz-progress>
<nz-alert nzType="info" nzMessage="初次使用TIS,系统需要对相关配置进行初始化" nzShowIcon></nz-alert>
<tis-page-header [result]="this.result" [showBreadcrumb]="false">
<button nz-button nzType="primary" (click)="startInitialize()" [nzLoading]="_startInitialize">开始初始化</button>
</tis-page-header>
<nz-progress *ngIf="_startInitialize" [nzPercent]="_percent" [nzStatus]="_progressStatus"></nz-progress>
`
})
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);
}

Expand All @@ -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(() => {

});
}
}

0 comments on commit 47feef8

Please sign in to comment.