fix: 优化考试过程信号查看的界面

This commit is contained in:
wangzhongjie 2025-06-20 16:00:50 +08:00
parent ee0b96125c
commit 0be3e1b970
4 changed files with 55 additions and 31 deletions

View File

@ -1,15 +1,44 @@
import SignalDisplayComponent from '../compontents/SignalDisplay' import SignalDisplayComponent from '../compontents/SignalDisplay'
import TabComponent from '../compontents/Tab'
@CustomDialog @CustomDialog
export default struct SignalTrajectoryDialog { export default struct SignalTrajectoryDialog {
@State active: number = 0
private controller?: CustomDialogController private controller?: CustomDialogController
build() { build() {
Row() { // Scroll() {
SignalDisplayComponent()
}.width(1200).height(1200).border({ Column() {
width: 1, Flex(
color: "red" {
}) 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)
} }
} }

View File

@ -25,7 +25,6 @@ struct SignDisplayPage {
right: 10 right: 10
}) })
TabComponent({ TabComponent({
isShowTrajectory: true,
activeIndex: this.active, activeIndex: this.active,
onchange: (index: number) => { onchange: (index: number) => {
this.active = index this.active = index
@ -42,8 +41,7 @@ struct SignDisplayPage {
}.width("100%").height(100) }.width("100%").height(100)
SignalDisplayComponent({ SignalDisplayComponent({
active: this.active, active: this.active
isShowTrajectory: true
}) })
} }
.width('100%') .width('100%')

View File

@ -19,8 +19,6 @@ export default struct SignalDisplayComponent {
@State rawData: string = "$GPS,,,,,,,,,,,,,,,,,,,,,,,,,,,,," @State rawData: string = "$GPS,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"
// 车道信息 // 车道信息
@State laneSignal: PerLane = InitialPerLane @State laneSignal: PerLane = InitialPerLane
// 是否现实轨迹
@State isShowTrajectory: boolean = false
aboutToAppear(): void { aboutToAppear(): void {
DifferentialAndSignal.onMsg((data: string) => { DifferentialAndSignal.onMsg((data: string) => {
@ -111,29 +109,27 @@ export default struct SignalDisplayComponent {
Text(this.rawData).fontSize(20).fontColor("#fff") Text(this.rawData).fontSize(20).fontColor("#fff")
}.backgroundColor("#282828").width("100%").height("100%") }.backgroundColor("#282828").width("100%").height("100%")
} else { } else {
if (this.isShowTrajectory) { // 轨迹查看
// 轨迹查看 Flex() {
Flex() { Column() {
Column() { CoordinateComponent({
CoordinateComponent({ isItHorizontal: false,
isItHorizontal: false, heightNum: 40,
heightNum: 40, data: this.GPSColum
data: this.GPSColum })
}) }.width("20%")
}.width("20%")
Column() { Column() {
LaneComponent({ LaneComponent({
laneSignal: this.laneSignal laneSignal: this.laneSignal
}) })
}.width("20%") }.width("20%")
Column() { Column() {
trajectoryComponent() trajectoryComponent()
}.height("100%").width("60%") }.height("100%").width("60%")
}.backgroundColor("#282828").width("100%").height("100%") }.backgroundColor("#282828").width("100%").height("100%")
}
} }
} }
.width("100%") .width("100%")

View File

@ -50,6 +50,7 @@ struct TabItemComponent {
topLeft: 20, topLeft: 20,
topRight: 20, topRight: 20,
}) })
.backgroundColor("#262420")
.border({ .border({
width: { top: 1, left: 1, right: 1 }, width: { top: 1, left: 1, right: 1 },
color: this.active ? "#ECAD5C" : "#DDCBAC" color: this.active ? "#ECAD5C" : "#DDCBAC"