增强地图编辑 CAD 能力与反射对象管理体验。
补充对齐/批量建站 API,并优化反射面板、历史栈与字段管理相关交互。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -12,11 +12,13 @@ import { ref, computed } from 'vue'
|
||||
*/
|
||||
|
||||
export type EditToolId =
|
||||
// 选择组
|
||||
// 选择组(左侧仅保留「仅*」过滤;单选/框选等由画布默认交互承担)
|
||||
| 'select.single'
|
||||
| 'select.rect'
|
||||
| 'select.lasso'
|
||||
| 'select.byType.site'
|
||||
| 'select.byType.straight'
|
||||
| 'select.byType.curve'
|
||||
| 'select.byType.bezier'
|
||||
| 'select.byType.polyline'
|
||||
| 'select.byType.arc'
|
||||
@@ -28,6 +30,7 @@ export type EditToolId =
|
||||
| 'draw.site'
|
||||
| 'draw.sites.continuous'
|
||||
| 'draw.track.polyline'
|
||||
| 'draw.tracks.continuous'
|
||||
| 'draw.track.bezier'
|
||||
| 'draw.track.arc'
|
||||
| 'draw.track.nurbs'
|
||||
@@ -41,7 +44,6 @@ export type EditToolId =
|
||||
| 'transform.move'
|
||||
| 'transform.rotate'
|
||||
| 'transform.scale'
|
||||
| 'transform.duplicate'
|
||||
| 'transform.copy'
|
||||
| 'transform.paste'
|
||||
| 'transform.delete'
|
||||
@@ -82,7 +84,8 @@ export interface SnapState {
|
||||
}
|
||||
|
||||
export function useEditTool() {
|
||||
const activeTool = ref<EditToolId>('transform.move')
|
||||
// 空闲默认:不落在已移除的「移动」上,侧栏无高亮(画布仍可点选)。
|
||||
const activeTool = ref<EditToolId>('select.single')
|
||||
const snap = ref<SnapState>({ grid: false, gridSizeMm: 100, object: true, endpoint: true, midpoint: false, toAngleDeg: undefined })
|
||||
const showControlPoints = ref(true)
|
||||
const showControlHandles = ref(true)
|
||||
@@ -105,17 +108,20 @@ export function useEditTool() {
|
||||
'select.single': '单选',
|
||||
'select.rect': '矩形框选',
|
||||
'select.lasso': '圈选',
|
||||
'select.byType.site': '按类型选 - 站点',
|
||||
'select.byType.bezier': '按类型选 - 贝塞尔',
|
||||
'select.byType.polyline': '按类型选 - 折线',
|
||||
'select.byType.arc': '按类型选 - 弧',
|
||||
'select.byType.decor': '按类型选 - 装饰物',
|
||||
'select.byType.currentLayer': '按类型选 - 当前图层',
|
||||
'select.byType.site': '仅站点',
|
||||
'select.byType.straight': '仅直线',
|
||||
'select.byType.curve': '仅曲线',
|
||||
'select.byType.bezier': '仅曲线',
|
||||
'select.byType.polyline': '仅直线',
|
||||
'select.byType.arc': '仅曲线',
|
||||
'select.byType.decor': '仅装饰',
|
||||
'select.byType.currentLayer': '当前图层',
|
||||
'select.invert': '反选',
|
||||
'select.clear': '清空选中',
|
||||
'draw.site': '添加站点',
|
||||
'draw.sites.continuous': '连续添加站点',
|
||||
'draw.track.polyline': '添加折线路径',
|
||||
'draw.track.polyline': '添加直线路径',
|
||||
'draw.tracks.continuous': '连续添加直线路径',
|
||||
'draw.track.bezier': '添加贝塞尔路径',
|
||||
'draw.track.arc': '添加弧形路径',
|
||||
'draw.track.nurbs': '添加 NURBS 路径',
|
||||
@@ -128,7 +134,6 @@ export function useEditTool() {
|
||||
'transform.move': '移动',
|
||||
'transform.rotate': '旋转',
|
||||
'transform.scale': '缩放',
|
||||
'transform.duplicate': '复制副本',
|
||||
'transform.copy': '复制',
|
||||
'transform.paste': '粘贴',
|
||||
'transform.delete': '删除',
|
||||
|
||||
@@ -98,5 +98,19 @@ export function useHistory(opts: UseHistoryOptions = {}) {
|
||||
}
|
||||
}
|
||||
|
||||
return { undoStack, redoStack, busy, canUndo, canRedo, run, undo, redo, clear, composite }
|
||||
return {
|
||||
undoStack,
|
||||
redoStack,
|
||||
busy,
|
||||
canUndo,
|
||||
canRedo,
|
||||
maxDepth,
|
||||
undoCount: computed(() => undoStack.value.length),
|
||||
redoCount: computed(() => redoStack.value.length),
|
||||
run,
|
||||
undo,
|
||||
redo,
|
||||
clear,
|
||||
composite
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user