feat(junction): expose stage1 structure and standards panel

This commit is contained in:
que01 committed 2026-09-07 14:52:06 +08:00
1 parent 0f804b71d1
commit fc7fe81eff
15 files changed
+434 -17

No files matched your search

+6
View File
@@ -189,6 +189,9 @@ export interface EditPreviewResponse {
diagnostics: EditDiagnostic[];
handles: HandleManifest;
layers: Partial<Record<PreviewLayerName, GeoJson | null>>;
junctionStructure?: import('../types/state').JunctionStructure | null;
standardsProfile?: { id: string; label: string };
standardsDiagnostics?: import('../types/state').StandardsDiagnostic[];
}
export interface EditStateResponse {
@@ -200,6 +203,9 @@ export interface EditStateResponse {
constraintStates: ConstraintStateReport[];
diagnostics: EditDiagnostic[];
handles: HandleManifest;
junctionStructure?: import('../types/state').JunctionStructure | null;
standardsProfile?: { id: string; label: string };
standardsDiagnostics?: import('../types/state').StandardsDiagnostic[];
}
/**
@@ -170,6 +170,8 @@ export function JunctionWorkspace({
() => (state ? junctionFacilities(state, descriptor.nodeIds, roads) : []),
[descriptor.nodeIds, roads, state],
);
const structure = state?.junctionStructure;
const standardDiagnostics = state?.standardsDiagnostics || [];
return (
<section className="junction-workspace" aria-label="路口编辑工作区">
<header className="junction-workspace__header">
@@ -217,6 +219,39 @@ export function JunctionWorkspace({
</dd>
</dl>
<section className="junction-workspace__validation" aria-label="路口验证">
{structure ? (
<section className="junction-workspace__standards" aria-label="结构与标准">
<h3>结构与标准</h3>
<p>
{state?.standardsProfile?.label || '项目默认标准'} · {structure.shape.label} ·{' '}
{structure.shape.effectiveArmCount} 条有效道路臂
</p>
<dl>
<dt>道路臂</dt>
<dd>{structure.arms.map((arm) => arm.label).join('、') || '无'}</dd>
<dt>角部</dt>
<dd>{structure.corners.length ? structure.corners.map((corner) => corner.label).join('、') : '无'}</dd>
<dt>设施</dt>
<dd>
{structure.facilities.length
? structure.facilities.map((facility) => facility.label).join('、')
: '无'}
</dd>
</dl>
{standardDiagnostics.length ? (
<ul aria-label="标准诊断">
{standardDiagnostics.map((item) => (
<li key={item.id} className={item.severity === 'blocking' ? 'blocking' : undefined}>
<strong>
{item.severity === 'pass' ? '通过' : item.severity === 'warning' ? '警告' : '阻塞'}
</strong>{' '}
{item.message}
</li>
))}
</ul>
) : null}
</section>
) : null}
{candidate || complexEnabled ? (
<div className="junction-workspace__candidate" aria-label="复杂路口候选信息">
<strong>{complexEnabled ? '当前复杂路口组成' : '附近可合并节点'}</strong>
+24
View File
@@ -87,6 +87,27 @@ export interface Diagnostic {
geometry?: { type: string; coordinates: unknown };
manualCandidates?: Array<{ roadId: string; distanceMeters: number }>;
}
export interface JunctionStructure {
schema: string;
junctionKey: string;
label: string;
shape: { kind: string; label: string; effectiveArmCount: number; throughPairCount: number };
arms: Array<{
key: string;
label: string;
directionality: string;
carriageway?: { laneCount?: number; effectiveWidthMeters?: number };
}>;
corners: Array<{ key: string; label: string; fromArmKey: string; toArmKey: string }>;
facilities: Array<{ key: string; kind: string; label: string }>;
}
export interface StandardsDiagnostic {
id: string;
severity: string;
rule: string;
objectKey: string;
message: string;
}
export interface WorkbenchState {
active?: boolean;
areaId: string;
@@ -106,4 +127,7 @@ export interface WorkbenchState {
junctionClusters?: JunctionClusterConfig[];
junctionShapes?: JunctionShapeSummary[];
} | null;
junctionStructure?: JunctionStructure | null;
standardsProfile?: { id: string; label: string };
standardsDiagnostics?: StandardsDiagnostic[];
}