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' ? '警告' : '阻塞'}
|
||||
|
||||
@@ -756,6 +756,79 @@ pre {
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
.junction-workspace__object-list {
|
||||
display: grid;
|
||||
gap: 5px;
|
||||
}
|
||||
.junction-workspace__object-list button {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 6px 9px;
|
||||
border: 1px solid #d8e1df;
|
||||
border-radius: 4px;
|
||||
background: #f8fbfa;
|
||||
color: #23423a;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
.junction-workspace__object-list button:hover,
|
||||
.junction-workspace__object-list button.is-selected {
|
||||
border-color: #0e7490;
|
||||
background: #e6f4f6;
|
||||
color: #075985;
|
||||
}
|
||||
.junction-workspace__structure-facilities {
|
||||
border: 1px solid #d8e1df;
|
||||
border-radius: 4px;
|
||||
background: #fbfdfc;
|
||||
}
|
||||
.junction-workspace__structure-facilities summary {
|
||||
padding: 6px 9px;
|
||||
color: #31574c;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
}
|
||||
.junction-workspace__structure-facilities ul {
|
||||
display: grid;
|
||||
gap: 3px;
|
||||
margin: 0;
|
||||
padding: 0 9px 8px 25px;
|
||||
color: #50645e;
|
||||
font-size: 12px;
|
||||
}
|
||||
.junction-workspace__standard-diagnostic {
|
||||
margin-top: 5px;
|
||||
padding: 7px 9px;
|
||||
border-left: 3px solid #94a3b8;
|
||||
border-radius: 3px;
|
||||
background: #f8fafc;
|
||||
color: #475569;
|
||||
font-size: 12px;
|
||||
}
|
||||
.junction-workspace__standard-diagnostic button {
|
||||
width: 100%;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: inherit;
|
||||
text-align: left;
|
||||
cursor: pointer;
|
||||
}
|
||||
.junction-workspace__standard-diagnostic.is-pass {
|
||||
border-left-color: #2f855a;
|
||||
background: #f0fdf4;
|
||||
color: #166534;
|
||||
}
|
||||
.junction-workspace__standard-diagnostic.is-warning {
|
||||
border-left-color: #d49318;
|
||||
background: #fffaf0;
|
||||
color: #7c5a16;
|
||||
}
|
||||
.junction-workspace__standard-diagnostic.is-blocking,
|
||||
.junction-workspace__standard-diagnostic.is-error {
|
||||
border-left-color: #c2413b;
|
||||
background: #fff1f0;
|
||||
color: #9f2f2a;
|
||||
}
|
||||
.junction-workspace__facility-selection {
|
||||
margin: 8px 0 0;
|
||||
padding: 6px 8px;
|
||||
|
||||
Reference in new issue
Block a user