style(junction): fold facilities and clarify diagnostics
This commit is contained in:
1 parent
a0bdd25c9d
commit
2b49a78b99
2 files changed
+91
-4
No files matched your search
@@ -106,6 +106,7 @@ export function JunctionWorkspace({
|
||||
);
|
||||
const [selectedCandidateNodes, setSelectedCandidateNodes] = useState<string[]>([]);
|
||||
const [candidateNodePickerOpen, setCandidateNodePickerOpen] = useState(false);
|
||||
const [facilitiesOpen, setFacilitiesOpen] = useState(false);
|
||||
const candidateNodes = useMemo(
|
||||
() =>
|
||||
(candidate?.nodeIds?.length
|
||||
@@ -260,15 +261,28 @@ export function JunctionWorkspace({
|
||||
<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('、')
|
||||
: '无'}
|
||||
{structure.facilities.length ? (
|
||||
<details
|
||||
className="junction-workspace__structure-facilities"
|
||||
open={facilitiesOpen}
|
||||
onToggle={(event) => setFacilitiesOpen(event.currentTarget.open)}
|
||||
>
|
||||
<summary>已识别 {structure.facilities.length} 项设施</summary>
|
||||
<ul>
|
||||
{structure.facilities.map((facility) => (
|
||||
<li key={facility.key}>{facility.label}</li>
|
||||
))}
|
||||
</ul>
|
||||
</details>
|
||||
) : (
|
||||
'无'
|
||||
)}
|
||||
</dd>
|
||||
</dl>
|
||||
{standardDiagnostics.length ? (
|
||||
<ul aria-label="标准诊断">
|
||||
{standardDiagnostics.map((item) => (
|
||||
<li key={item.id} className={item.severity === 'blocking' ? 'blocking' : undefined}>
|
||||
<li key={item.id} className={`junction-workspace__standard-diagnostic is-${item.severity}`}>
|
||||
<button type="button" onClick={() => onSelectObject?.(item.objectKey)}>
|
||||
<strong>
|
||||
{item.severity === 'pass' ? '通过' : item.severity === 'warning' ? '警告' : '阻塞'}
|
||||
|
||||
Reference in new issue
Block a user