feat: complete complex junction transition editing
This commit is contained in:
1 parent
801d8be980
commit
79f83412e6
18 files changed
+400
-59
No files matched your search
@@ -26,6 +26,11 @@ interface Props {
|
||||
onApply: () => void;
|
||||
onDiscard: () => void;
|
||||
onSave: () => void;
|
||||
onUndo?: () => void;
|
||||
onRedo?: () => void;
|
||||
canUndo?: boolean;
|
||||
canRedo?: boolean;
|
||||
status?: string;
|
||||
editMode?: boolean;
|
||||
onEnableEdit?: () => void;
|
||||
onEnableComplex?: (nodeIds: string[]) => void;
|
||||
@@ -61,6 +66,11 @@ export function JunctionWorkspace({
|
||||
onApply,
|
||||
onDiscard,
|
||||
onSave,
|
||||
onUndo,
|
||||
onRedo,
|
||||
canUndo = false,
|
||||
canRedo = false,
|
||||
status,
|
||||
editMode = false,
|
||||
onEnableEdit,
|
||||
onEnableComplex,
|
||||
@@ -202,8 +212,8 @@ export function JunctionWorkspace({
|
||||
{complexEnabled
|
||||
? editable
|
||||
? editMode
|
||||
? '可编辑外部车行道宽度'
|
||||
: '当前按复杂路口渲染,开启编辑后可调整外部车行道宽度'
|
||||
? '可编辑车行道与路口几何参数'
|
||||
: '当前按复杂路口渲染,开启编辑后可调整几何参数'
|
||||
: '当前按复杂路口渲染'
|
||||
: descriptor.status === 'candidate'
|
||||
? '当前按普通路口渲染,可切换为复杂路口'
|
||||
@@ -519,7 +529,14 @@ export function JunctionWorkspace({
|
||||
update={onUpdateSignal}
|
||||
/>
|
||||
) : null}
|
||||
{status ? <p role="status">{status}</p> : null}
|
||||
<div className="junction-workspace__actions">
|
||||
<Button onClick={onUndo} disabled={!canUndo}>
|
||||
撤销
|
||||
</Button>
|
||||
<Button onClick={onRedo} disabled={!canRedo}>
|
||||
重做
|
||||
</Button>
|
||||
<Button onClick={onApply} disabled={!dirty}>
|
||||
应用到工作区
|
||||
</Button>
|
||||
|
||||
@@ -60,7 +60,9 @@ export function junctionLabelForHandle(handle: EditHandle, roads: Road[], juncti
|
||||
}
|
||||
const clusterAnchor = handle.anchor;
|
||||
if (
|
||||
(handle.kind === 'cluster-carriageway-width' || handle.kind === 'cluster-carriageway-cutback') &&
|
||||
(handle.kind === 'cluster-carriageway-width' ||
|
||||
handle.kind === 'cluster-carriageway-cutback' ||
|
||||
handle.kind === 'cluster-carriageway-transition-length') &&
|
||||
clusterAnchor.type === 'cluster-carriageway'
|
||||
) {
|
||||
const road = roads.find((item) => clusterAnchor.sourceRoadIds.includes(item.id));
|
||||
|
||||
Reference in new issue
Block a user