refactor(measure): centralize measure type config and migrate API

- Add unified MEASURE_TYPES config in types/measure.ts
- Export MEASURE_MODES_ORDERED, ENGINE_TYPE_TO_MODE, MODE_TO_ENGINE_TYPE
- Refactor measure-dialog-manager to use centralized config
- Refactor measure-panel to use MEASURE_TYPES for icons/order/valueType
- Simplify engine/index.ts measureMap with dynamic key access
- Add measure settings API (saveMeasureSetting) with cache sync
- Add direct engine event listening for measure-changed and section-move
- Update i18n keys for 8 measure modes
This commit is contained in:
yuding
2026-02-02 18:18:36 +08:00
parent 316f42ae6b
commit 044cd0e034
14 changed files with 5566 additions and 5539 deletions

View File

@@ -76,14 +76,14 @@ export const enUS: TranslationDictionary = {
btnName: 'Measure',
dialogTitle: 'Measure',
modes: {
clearHeight: 'Clear Height',
clearDistance: 'Clear Distance',
distance: 'Distance',
minDistance: 'Min Distance',
angle: 'Angle',
elevation: 'Elevation',
volume: 'Volume',
laserDistance: 'Laser Distance',
point: 'Point',
angle: 'Angle',
area: 'Area',
slope: 'Slope',
spaceVolume: 'Space Volume',
},
actions: {
expand: 'Expand',
@@ -97,14 +97,14 @@ export const enUS: TranslationDictionary = {
y: 'Y:',
z: 'Z:',
value: {
clearHeight: 'Clear Height:',
clearDistance: 'Clear Distance:',
distance: 'Distance:',
minDistance: 'Min Distance:',
angle: 'Angle:',
elevation: 'Elevation:',
volume: 'Volume:',
laserDistance: 'Laser Distance:',
point: 'Point:',
angle: 'Angle:',
area: 'Area:',
slope: 'Slope:',
spaceVolume: 'Space Volume:',
}
},
units: {
@@ -113,14 +113,14 @@ export const enUS: TranslationDictionary = {
m: 'm',
km: 'km',
deg: '°',
m3: 'm³',
m2: 'm²',
percent: '%',
},
settings: {
title: 'Settings',
unit: 'Unit:',
precision: 'Precision:',
hint: 'Distance, min distance and elevation use this unit by default; angle and volume use their own units.',
hint: 'Distance, clear distance, clear height and elevation use this unit by default; angle and area use their own units.',
save: 'Save',
cancel: 'Cancel',
}