From 0be3e1b9703ff664d45759f39aa99634cad4416b Mon Sep 17 00:00:00 2001 From: wangzhongjie Date: Fri, 20 Jun 2025 16:00:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E8=80=83=E8=AF=95?= =?UTF-8?q?=E8=BF=87=E7=A8=8B=E4=BF=A1=E5=8F=B7=E6=9F=A5=E7=9C=8B=E7=9A=84?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/Judge/SignalTrajectoryDialog.ets | 41 ++++++++++++++++--- entry/src/main/ets/pages/SignDisplay.ets | 4 +- .../ets/pages/compontents/SignalDisplay.ets | 40 ++++++++---------- entry/src/main/ets/pages/compontents/Tab.ets | 1 + 4 files changed, 55 insertions(+), 31 deletions(-) diff --git a/entry/src/main/ets/pages/Judge/SignalTrajectoryDialog.ets b/entry/src/main/ets/pages/Judge/SignalTrajectoryDialog.ets index 31375a1..d0c1ea2 100644 --- a/entry/src/main/ets/pages/Judge/SignalTrajectoryDialog.ets +++ b/entry/src/main/ets/pages/Judge/SignalTrajectoryDialog.ets @@ -1,15 +1,44 @@ import SignalDisplayComponent from '../compontents/SignalDisplay' +import TabComponent from '../compontents/Tab' @CustomDialog export default struct SignalTrajectoryDialog { + @State active: number = 0 private controller?: CustomDialogController build() { - Row() { - SignalDisplayComponent() - }.width(1200).height(1200).border({ - width: 1, - color: "red" - }) + // Scroll() { + + Column() { + Flex( + { + justifyContent: FlexAlign.SpaceBetween, + alignItems: ItemAlign.Center + } + ) { + TabComponent({ + isShowTrajectory: true, + activeIndex: this.active, + onchange: (index: number) => { + this.active = index + } + }) + // 关闭按钮 + Image($rawfile('judge/close.png')).height(50).onClick(() => { + this.controller?.close() + }) + } + + Scroll() { + Column() { + SignalDisplayComponent({ + active: this.active + }) + }.height(890) + }.width("100%") + .height(700) + }.width(1500) + + // }.width(1200).height(900) } } \ No newline at end of file diff --git a/entry/src/main/ets/pages/SignDisplay.ets b/entry/src/main/ets/pages/SignDisplay.ets index 93a2c67..37c28a7 100644 --- a/entry/src/main/ets/pages/SignDisplay.ets +++ b/entry/src/main/ets/pages/SignDisplay.ets @@ -25,7 +25,6 @@ struct SignDisplayPage { right: 10 }) TabComponent({ - isShowTrajectory: true, activeIndex: this.active, onchange: (index: number) => { this.active = index @@ -42,8 +41,7 @@ struct SignDisplayPage { }.width("100%").height(100) SignalDisplayComponent({ - active: this.active, - isShowTrajectory: true + active: this.active }) } .width('100%') diff --git a/entry/src/main/ets/pages/compontents/SignalDisplay.ets b/entry/src/main/ets/pages/compontents/SignalDisplay.ets index 8ec08e4..91a8569 100644 --- a/entry/src/main/ets/pages/compontents/SignalDisplay.ets +++ b/entry/src/main/ets/pages/compontents/SignalDisplay.ets @@ -19,8 +19,6 @@ export default struct SignalDisplayComponent { @State rawData: string = "$GPS,,,,,,,,,,,,,,,,,,,,,,,,,,,,," // 车道信息 @State laneSignal: PerLane = InitialPerLane - // 是否现实轨迹 - @State isShowTrajectory: boolean = false aboutToAppear(): void { DifferentialAndSignal.onMsg((data: string) => { @@ -111,29 +109,27 @@ export default struct SignalDisplayComponent { Text(this.rawData).fontSize(20).fontColor("#fff") }.backgroundColor("#282828").width("100%").height("100%") } else { - if (this.isShowTrajectory) { - // 轨迹查看 - Flex() { - Column() { - CoordinateComponent({ - isItHorizontal: false, - heightNum: 40, - data: this.GPSColum - }) - }.width("20%") + // 轨迹查看 + Flex() { + Column() { + CoordinateComponent({ + isItHorizontal: false, + heightNum: 40, + data: this.GPSColum + }) + }.width("20%") - Column() { - LaneComponent({ - laneSignal: this.laneSignal - }) - }.width("20%") + Column() { + LaneComponent({ + laneSignal: this.laneSignal + }) + }.width("20%") - Column() { - trajectoryComponent() - }.height("100%").width("60%") + Column() { + trajectoryComponent() + }.height("100%").width("60%") - }.backgroundColor("#282828").width("100%").height("100%") - } + }.backgroundColor("#282828").width("100%").height("100%") } } .width("100%") diff --git a/entry/src/main/ets/pages/compontents/Tab.ets b/entry/src/main/ets/pages/compontents/Tab.ets index 818735f..bba6d22 100644 --- a/entry/src/main/ets/pages/compontents/Tab.ets +++ b/entry/src/main/ets/pages/compontents/Tab.ets @@ -50,6 +50,7 @@ struct TabItemComponent { topLeft: 20, topRight: 20, }) + .backgroundColor("#262420") .border({ width: { top: 1, left: 1, right: 1 }, color: this.active ? "#ECAD5C" : "#DDCBAC"