feat(junction): add stage2 object selection scope controls
This commit is contained in:
1 parent
b89c5fd174
commit
de6ef8e64b
8 files changed
+131
-5
No files matched your search
@@ -17,6 +17,8 @@ interface Props {
|
||||
session: JunctionSession;
|
||||
dirty?: boolean;
|
||||
diagnostics?: Array<{ id: string; message: string; rule: string; severity?: string }>;
|
||||
selectedObjectKey?: string | null;
|
||||
onSelectObject?: (key: string) => void;
|
||||
facilitySummary?: { crosswalks: number; stopLines: number; signals: number };
|
||||
state?: WorkbenchState;
|
||||
onClose: () => void;
|
||||
@@ -59,6 +61,8 @@ export function JunctionWorkspace({
|
||||
onUpdateComplexNodes,
|
||||
onCandidateMarkersChange,
|
||||
diagnostics = [],
|
||||
selectedObjectKey = null,
|
||||
onSelectObject,
|
||||
facilitySummary = { crosswalks: 0, stopLines: 0, signals: 0 },
|
||||
state,
|
||||
handles = [],
|
||||
@@ -228,7 +232,24 @@ export function JunctionWorkspace({
|
||||
</p>
|
||||
<dl>
|
||||
<dt>道路臂</dt>
|
||||
<dd>{structure.arms.map((arm) => arm.label).join('、') || '无'}</dd>
|
||||
<dd>
|
||||
{structure.arms.length ? (
|
||||
<span className="junction-workspace__object-list">
|
||||
{structure.arms.map((arm) => (
|
||||
<button
|
||||
type="button"
|
||||
key={arm.key}
|
||||
className={selectedObjectKey === arm.key ? 'is-selected' : undefined}
|
||||
onClick={() => onSelectObject?.(arm.key)}
|
||||
>
|
||||
{arm.label}
|
||||
</button>
|
||||
))}
|
||||
</span>
|
||||
) : (
|
||||
'无'
|
||||
)}
|
||||
</dd>
|
||||
<dt>角部</dt>
|
||||
<dd>{structure.corners.length ? structure.corners.map((corner) => corner.label).join('、') : '无'}</dd>
|
||||
<dt>设施</dt>
|
||||
@@ -242,10 +263,12 @@ export function JunctionWorkspace({
|
||||
<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}
|
||||
<button type="button" onClick={() => onSelectObject?.(item.objectKey)}>
|
||||
<strong>
|
||||
{item.severity === 'pass' ? '通过' : item.severity === 'warning' ? '警告' : '阻塞'}
|
||||
</strong>{' '}
|
||||
{item.message}
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
Reference in new issue
Block a user