From e47a38e9dd2e8a4fd6f3c90d06b30672deb56633 Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Wed, 5 Jul 2023 16:06:16 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=AE=89=E4=BF=A1=E7=9B=92?= =?UTF-8?q?=E5=AD=90=E5=9B=BE=E7=89=87=E8=B6=85=E5=87=BA=E5=B1=8F=E5=B9=95?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- proxy.config.json | 4 ++-- .../host-config/host-config.component.ts | 1 - .../image-label-anxin.component.ts | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/proxy.config.json b/proxy.config.json index ee63e5b..24dc19c 100644 --- a/proxy.config.json +++ b/proxy.config.json @@ -1,13 +1,13 @@ { "/api": { - "target": "http://121.36.37.70:8080/", + "target": "http://10.156.134.53:9001/", "测试":"http://121.36.37.70:8080/", "生产":"http://10.156.134.53:9001/", "secure": false, "changeOrigin": true }, "/signalr": { - "target": "http://121.36.37.70:8080/", + "target": "http://10.156.134.53:9001/", "secure": false, "ws": true, "logLevel": "debug" diff --git a/src/app/system-management/host-config/host-config.component.ts b/src/app/system-management/host-config/host-config.component.ts index e00cc8a..df89b6e 100644 --- a/src/app/system-management/host-config/host-config.component.ts +++ b/src/app/system-management/host-config/host-config.component.ts @@ -1633,7 +1633,6 @@ rule_threshold: data.server = server; data.obs = obs; } - //填充caps数组 this.listOfData.forEach((item: any) => { if (item.isEnabled) { diff --git a/src/app/system-management/image-label-anxin/image-label-anxin.component.ts b/src/app/system-management/image-label-anxin/image-label-anxin.component.ts index 04a6a50..566003c 100644 --- a/src/app/system-management/image-label-anxin/image-label-anxin.component.ts +++ b/src/app/system-management/image-label-anxin/image-label-anxin.component.ts @@ -107,9 +107,21 @@ export class ImageLabelAnxinComponent implements OnInit { // 图片加载完后,将其显示在canvas中 var img = new Image(); img.src = this.imgItem ? this.imgItem : '../../../assets/images/bgImg.png'; + + console.log('img', img); + img.onload = () => { + console.log('原始宽度', img.width); + console.log('原始高度', img.height); + if (img.width > 1920) { + img.height = img.height * (1920 / img.width); + img.width = 1920; + } this.canvasWidth = img.width; this.canvasHeight = img.height; + console.log('显示宽度', this.canvasWidth); + console.log('显示高度', this.canvasHeight); + // return; window.setTimeout(() => { // 加载图片 this.ctx.drawImage(img, 0, 0, this.canvasWidth, this.canvasHeight); @@ -499,7 +511,7 @@ export class ImageLabelAnxinComponent implements OnInit { save() { console.log(this.camerasData.dimensionedPointsAnxin); console.log('标点数据', this.PolygonData); - // return; + for (const key in this.PolygonData) { const element = this.PolygonData[key]; if (element.Points.length !== 0 && element.Points.length <= 2) { @@ -544,6 +556,7 @@ export class ImageLabelAnxinComponent implements OnInit { }; console.log('标点结果', this.camerasData.dimensionedPointsAnxin); + // return; this.http .put(`/api/Cameras/${this.camerasData.id}/DimensionedPoints`, body) .subscribe((data) => {