From 8720cf343de209a61b9be51701e150a21be0e3b9 Mon Sep 17 00:00:00 2001 From: "lijie.hu" Date: Mon, 1 Apr 2024 17:25:57 +0800 Subject: [PATCH] =?UTF-8?q?Add:=E5=A4=A7=E5=B1=8F=E5=88=9D=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../routes/data-v/second1/second1.component.html | 3 ++- .../routes/data-v/second1/second1.component.less | 9 +++++++++ src/app/routes/data-v/second1/second1.component.ts | 7 +++++-- src/app/routes/data-v/t1/t1.component.html | 2 +- src/app/routes/data-v/t1/t1.component.ts | 14 ++++++++------ 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/app/routes/data-v/second1/second1.component.html b/src/app/routes/data-v/second1/second1.component.html index e489c6a..ed21145 100644 --- a/src/app/routes/data-v/second1/second1.component.html +++ b/src/app/routes/data-v/second1/second1.component.html @@ -36,11 +36,12 @@
Car Image
-
+ Long Image +
车牌号: 苏E8888
diff --git a/src/app/routes/data-v/second1/second1.component.less b/src/app/routes/data-v/second1/second1.component.less index 7e5d933..6a37aab 100644 --- a/src/app/routes/data-v/second1/second1.component.less +++ b/src/app/routes/data-v/second1/second1.component.less @@ -247,6 +247,14 @@ } .info-container { + display: flex; + // flex: 1; /* 同样的,让信息容器也占据等同的空间 */ + flex-direction: column; + justify-content: space-around; + margin: 0 10px; + } + + .model-container{ display: flex; flex: 1; /* 同样的,让信息容器也占据等同的空间 */ flex-direction: column; @@ -254,6 +262,7 @@ margin: 0 10px; } + .info-button { margin: 5px 0; padding: 10px; diff --git a/src/app/routes/data-v/second1/second1.component.ts b/src/app/routes/data-v/second1/second1.component.ts index 7ddef72..16f9fc4 100644 --- a/src/app/routes/data-v/second1/second1.component.ts +++ b/src/app/routes/data-v/second1/second1.component.ts @@ -11,6 +11,7 @@ import { MqttService } from 'ngx-mqtt'; import { DataVCardComponent } from '../card/card.component'; import { DataVLjCarInfoTableComponent } from '../lj-car-info-table/lj-car-info-table.component'; import { DataVLjDashboardComponent } from '../lj-dashboard/lj-dashboard.component'; +import { DataVT1Component } from '../t1/t1.component'; import { DataVTitleComponent } from '../title/title.component'; import { AgGridComponentComponent } from '../workstation/ag-grid-component/ag-grid-component.component'; import { GridButtonValueRenderer } from '../workstation/grid-button/grid-button'; @@ -21,6 +22,7 @@ import { LjAgGridComponentComponent } from '../workstation/lj-ag-grid-component/ templateUrl: './second1.component.html', styleUrls: ['./second1.component.less'], imports: [ + DataVT1Component, DataVLjCarInfoTableComponent, AgGridAngular, AgGridComponentComponent, @@ -32,7 +34,8 @@ import { LjAgGridComponentComponent } from '../workstation/lj-ag-grid-component/ DataVLjDashboardComponent, CommonModule, ...SHARED_IMPORTS, - DataVLjCarInfoTableComponent + DataVLjCarInfoTableComponent, + DataVT1Component ] }) export class DataVSecond1Component implements OnInit { @@ -40,7 +43,7 @@ export class DataVSecond1Component implements OnInit { private readonly modal = inject(ModalHelper); private readonly elementRef = inject(ElementRef); private readonly titleService = inject(TitleService); - public items = [1, 2, 3]; + public items = [1]; public chartDom = document.getElementById('main')!; // public myChart = echarts.init(this.chartDom); diff --git a/src/app/routes/data-v/t1/t1.component.html b/src/app/routes/data-v/t1/t1.component.html index 4e1e1d5..d9575cc 100644 --- a/src/app/routes/data-v/t1/t1.component.html +++ b/src/app/routes/data-v/t1/t1.component.html @@ -1,5 +1,5 @@ -
+
diff --git a/src/app/routes/data-v/t1/t1.component.ts b/src/app/routes/data-v/t1/t1.component.ts index 6192976..6726e69 100644 --- a/src/app/routes/data-v/t1/t1.component.ts +++ b/src/app/routes/data-v/t1/t1.component.ts @@ -37,6 +37,8 @@ export class DataVT1Component implements OnInit { // 创建相机 this.camera = new THREE.PerspectiveCamera(40, window.innerWidth / window.innerHeight, 1, 20000); this.camera.position.set(2200, 300, -3100); + this.camera.fov = 60; // 调整视角大小 + this.camera.updateProjectionMatrix(); // 更新相机的投影矩阵 //创建场景 this.scene = new THREE.Scene(); @@ -78,7 +80,9 @@ export class DataVT1Component implements OnInit { this.renderer = new THREE.WebGLRenderer({ antialias: true }); this.renderer.setPixelRatio(window.devicePixelRatio); - this.renderer.setSize(window.innerWidth, window.innerHeight); + // this.renderer.setSize(window.innerWidth, window.innerHeight); + this.renderer.setSize(400, 300); // 设置渲染器的宽度和高度 + this.renderer.shadowMap.enabled = true; this.container.nativeElement.appendChild(this.renderer.domElement); @@ -96,8 +100,6 @@ export class DataVT1Component implements OnInit { //const axesHelper = new THREE.AxesHelper(1000); //this.scene.add(axesHelper); - - window.addEventListener('resize', this.onWindowResize); } public render(): void { @@ -107,9 +109,9 @@ export class DataVT1Component implements OnInit { } onWindowResize() { - this.camera.aspect = window.innerWidth / window.innerHeight; - this.camera.updateProjectionMatrix(); - this.renderer.setSize(window.innerWidth, window.innerHeight); + // this.camera.aspect = window.innerWidth / window.innerHeight; + // this.camera.updateProjectionMatrix(); + // this.renderer.setSize(window.innerWidth, window.innerHeight); } animate = () => { requestAnimationFrame(this.animate);