Browse Source

进度条添加判断loading状态

dev
陈鹏飞 3 years ago
parent
commit
b4230642f6
  1. 6
      src/app/pages/left-domain/left-domain.component.ts
  2. 2
      src/app/pages/plan/plan.component.html
  3. 12
      src/app/pages/plan/plan.component.ts

6
src/app/pages/left-domain/left-domain.component.ts

@ -92,7 +92,7 @@ export class LeftDomainComponent implements OnInit {
this.FacilityList.forEach(item=>{
if (item.getPropertyData() && item.getPropertyData().img) {
window.setTimeout(() => {
new Viewer(this.element.nativeElement.querySelector(`#${id}${item.getID()}`), { url: 'data-original' });
new Viewer(this.element.nativeElement.querySelector(`#${id}${item.getID()}`), { url: 'data-original', navbar: false });
}, 0)
}
})
@ -127,11 +127,11 @@ export class LeftDomainComponent implements OnInit {
item.getPropertyData().img = ObjectsService.getFullPath(path + name)
if (this.beforeFence === 5) {
window.setTimeout(() => {
new Viewer(this.element.nativeElement.querySelector(`#pipelineViewer${item.getID()}`), { url: 'data-original' });
new Viewer(this.element.nativeElement.querySelector(`#pipelineViewer${item.getID()}`), { url: 'data-original', navbar: false });
}, 0)
} else if (this.beforeFence === 6) {
window.setTimeout(() => {
new Viewer(this.element.nativeElement.querySelector(`#orvrViewer${item.getID()}`), { url: 'data-original' });
new Viewer(this.element.nativeElement.querySelector(`#orvrViewer${item.getID()}`), { url: 'data-original', navbar: false });
}, 0)
}
PlanComponent.instance.isShowLoading = false //关闭遮罩

2
src/app/pages/plan/plan.component.html

@ -3,7 +3,7 @@
<div class="header">
<button *ngFor="let item of allFence; let key = index;" [ngClass]="{'selectFence': selectFence === key}" (click)="toggleHeaderFence(key)">
<label nz-dropdown [nzDropdownMenu]="menu" [nzDisabled]="item != '基本信息'">{{item}}<i nz-icon nzType="caret-up" nzTheme="outline" *ngIf="key === 0"></i></label>
<label nz-dropdown [nzDropdownMenu]="menu" [nzDisabled]="item != '基本信息' || selectFence != 0">{{item}}<i nz-icon nzType="caret-up" nzTheme="outline" *ngIf="key === 0"></i></label>
</button>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu class="dropDown">

12
src/app/pages/plan/plan.component.ts

@ -388,7 +388,7 @@ export class PlanComponent implements OnInit {
}
if (this.selectFence === 0 && this.beforeOnePropertyData.getPropertyData() && this.beforeOnePropertyData.getPropertyData().img) { //img
window.setTimeout(() => {
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original' });
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original', navbar: false });
}, 0)
}
}
@ -410,7 +410,7 @@ export class PlanComponent implements OnInit {
ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
this.beforeOnePropertyData.getPropertyData().img = ObjectsService.getFullPath(path + name)
window.setTimeout(() => {
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original' });
this.propertyImg = new Viewer(this.element.nativeElement.querySelector('#propertyImg'), { url: 'data-original', navbar: false });
}, 0)
this.isShowLoading = false //关闭遮罩
this.message.info("上传成功!");
@ -474,6 +474,12 @@ export class PlanComponent implements OnInit {
//更新进度条 值
updateProgress() {
if (this.isShowLoading) { //当前为loading状态
window.setTimeout(() => {
this.updateProgress()
}, 500);
return
}
if (this.progressList[this.nzCurrent] >= 100) {
this.progressList[this.nzCurrent] = 100
window.clearTimeout(this.updateTimer) //清除定时器
@ -634,7 +640,7 @@ export class PlanComponent implements OnInit {
initViewer() {
if (this.beforePlanNode.texture) {
window.setTimeout(() => {
this.planNodeImg = new Viewer(this.element.nativeElement.querySelector('#planNodeImg'), { url: 'data-original' });
this.planNodeImg = new Viewer(this.element.nativeElement.querySelector('#planNodeImg'), { url: 'data-original', navbar: false });
}, 0)
}
}

Loading…
Cancel
Save