Browse Source

[完善]预警框显示失败增加打印信息

beijing
邵佳豪 2 years ago
parent
commit
3fbf678218
  1. 2
      src/app/app.component.ts
  2. 5
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html
  3. 11
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss
  4. 12
      src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts

2
src/app/app.component.ts

@ -19,7 +19,7 @@ export class AppComponent {
public token: CacheTokenService,
private notificationService: NzNotificationService
) {}
VERSION = 20230712;
VERSION = 20230728;
ngOnInit(): void {
this.sayHello();
}

5
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.html

@ -28,8 +28,6 @@
{{typeArr[item.id].name}}
</label>
</ng-container>
<!-- <button nz-button nzType="primary" (click)="downImg()">导出图片</button> -->
</div>
<div class="content">
@ -45,6 +43,9 @@
<div *ngIf="isCarStop && isAnxin" class="pageturning nextpage" (click)="pageturning('next')">
<i nz-icon nzType="right" nzTheme="outline"></i>
</div>
<div *ngIf="isAnxin && coordinate.length === 0" class="noCoordinate">
预警坐标信息获取失败
</div>
</ng-container>
<ng-template #elseTemplate2>
<iframe style="margin-bottom: 12px;" width="100%" height="100%" [src]="fileUrl" frameborder="0"></iframe>

11
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.scss

@ -143,7 +143,16 @@
.pageturning:hover {
color: #40a9ff;
}
.noCoordinate{
color: red;
font-weight: 600;
font-size: 22px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
z-index: 999;
}
.lastpage {
left: 20px;
}

12
src/app/pages/today-warning/get-out-of-line-details/get-out-of-line-details.component.ts

@ -231,6 +231,7 @@ export class GetOutOfLineDetailsComponent implements OnInit {
canvasLabel() {
let imgBg: any = document.getElementById("img");
imgBg.onload = () => {
console.log("图片加载完毕...");
this.canvasWidth = imgBg.offsetWidth;
this.canvasHeight = imgBg.offsetHeight;
const canvas: any = document.querySelector("#canvas");
@ -238,10 +239,11 @@ export class GetOutOfLineDetailsComponent implements OnInit {
const cWidth = canvas.width,
cHeight = canvas.height;
setTimeout(() => {
console.log("以图画底,描绘预警框...");
// 以图画底
this.ctx.drawImage(imgBg, 0, 0, cWidth, cHeight);
this.strokeRect(this.currentCoordinate);
}, 0);
}, 100);
};
}
@ -298,14 +300,6 @@ export class GetOutOfLineDetailsComponent implements OnInit {
this.ctx.fillRect(startPoint[0], startPoint[1], 10, 10);
this.ctx.fillStyle = this.typeArr[item.id].color;
this.ctx.font = "16px Verdana";
let name = this.typeArr[item.id].name;
// this.ctx.fillText(
// name,
// startPoint[0],
// startPoint[1] < 20 || item.id === 2 || item.id === 3
// ? endPoint[1] + 18
// : startPoint[1] - 5
// );
}
}
});

Loading…
Cancel
Save