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
@@ -94,6 +94,7 @@ function App() {
|
||||
const [status, setStatus] = useState('正在加载工作台...');
|
||||
const [filter, setFilter] = useState<'all' | 'candidates' | 'other'>('all');
|
||||
const [marking, setMarking] = useState<Record<string, unknown> | null>(null);
|
||||
const [selectedObjectKey, setSelectedObjectKey] = useState<string | null>(null);
|
||||
const [junctionRoute, setJunctionRoute] = useState<JunctionRef | null>(() => {
|
||||
if (typeof window === 'undefined') return null;
|
||||
const match = window.location.pathname.match(/^\/junction\/(node|cluster)\/([^/]+)$/);
|
||||
@@ -900,6 +901,14 @@ function App() {
|
||||
};
|
||||
const handleFeature = (properties: Record<string, unknown>) => {
|
||||
setMarking(properties);
|
||||
const objectKey = properties.signal_uid
|
||||
? `signal:${String(properties.signal_uid)}`
|
||||
: properties.crossing_node_id
|
||||
? `${properties.provenance === 'stop-line' ? 'stop-line' : 'crossing'}:${String(properties.crossing_node_id)}`
|
||||
: properties.road_id
|
||||
? `road-arm:${String(properties.road_id)}`
|
||||
: null;
|
||||
setSelectedObjectKey(objectKey);
|
||||
// A crosswalk is six features but one editable thing; a stop line is one.
|
||||
// `provenance` picks which, and therefore which layer holds its siblings —
|
||||
// the two share `crossing_node_id`, so keying on that alone would merge a
|
||||
@@ -1156,6 +1165,8 @@ function App() {
|
||||
dirty={Boolean(junctionSession.dirty || signalDirty)}
|
||||
state={state}
|
||||
diagnostics={junctionDiagnostics}
|
||||
selectedObjectKey={selectedObjectKey}
|
||||
onSelectObject={(key) => setSelectedObjectKey(key)}
|
||||
facilitySummary={junctionFacilitySummary}
|
||||
onClose={closeJunction}
|
||||
onEnableComplex={
|
||||
@@ -1236,6 +1247,9 @@ function App() {
|
||||
onSignalStatus={setStatus}
|
||||
onUpdateSignal={updateSignal}
|
||||
onSelectFacility={(facility) => {
|
||||
setSelectedObjectKey(
|
||||
`${facility.kind === 'crosswalk' ? 'crossing' : facility.kind}:${facility.id.split(':').slice(1).join(':')}`,
|
||||
);
|
||||
const source =
|
||||
facility.kind === 'crosswalk'
|
||||
? state.layers.crosswalks
|
||||
|
||||
Reference in new issue
Block a user