diff --git a/src/editor/propEditors/JsonPreview.vue b/src/editor/propEditors/JsonPreview.vue new file mode 100644 index 0000000..85beb5f --- /dev/null +++ b/src/editor/propEditors/JsonPreview.vue @@ -0,0 +1,61 @@ + + + + + {{ JSON.stringify(props.modelValue, null, 2) }} + + + + diff --git a/src/editor/widgets/property/PropertyPanelConstant.ts b/src/editor/widgets/property/PropertyPanelConstant.ts index 59577b5..6f5e3c6 100644 --- a/src/editor/widgets/property/PropertyPanelConstant.ts +++ b/src/editor/widgets/property/PropertyPanelConstant.ts @@ -6,6 +6,7 @@ import TransformEditor from "@/editor/propEditors/TransformEditor.vue"; import InOutCenterEditor from "@/editor/propEditors/InOutCenterEditor.vue"; import BayEditor from "@/editor/propEditors/BayEditor.vue"; import PtrController from "@/editor/propEditors/PtrController.vue"; +import JsonPreview from "@/editor/propEditors/JsonPreview.vue"; const defDataFormProps: DataFormProps = { columnCount: 1, @@ -18,6 +19,7 @@ dataFormInputComponents.TransformEditor = markRaw(TransformEditor); dataFormInputComponents.InOutCenterEditor = markRaw(InOutCenterEditor); dataFormInputComponents.BayEditor = markRaw(BayEditor); dataFormInputComponents.PtrController = markRaw(PtrController); +dataFormInputComponents.JsonPreview = markRaw(JsonPreview); const basicFieldsSetter: Array = [ { diff --git a/src/modules/way/WayPropertySetter.ts b/src/modules/way/WayPropertySetter.ts index 1396379..d5b5f88 100644 --- a/src/modules/way/WayPropertySetter.ts +++ b/src/modules/way/WayPropertySetter.ts @@ -14,9 +14,78 @@ const propertySetter: PropertySetter = { inputProps: {} }, { - dataPath: 'originId', label: 'originId', input: 'InputNumber', - inputProps: {} + dataPath: 'dt.agvRotation', label: '旋转', input: 'SelectV2', + inputProps: { + placeholder: '请选择', + multiple: true, + clearable: true, + options: [ + { + label: 'FitBot300', + value: 'SlamFitBot300' + }, + { + label: 'FitBot500',//肥波500 + value: 'FitBot500' + }, + { + label: 'FitBot1000',//肥波1000 + value: 'FitBot1000' + }, + { + label: 'CL', //侧叉车型 + value: 'CY' + }, + { + label: 'CLX', //侧叉车型 + value: 'CLX' + }, + { + label: 'CC5', //侧叉车型 + value: 'CC' + }, + { + label: 'CC8', //侧叉车型 + value: 'CCX' + }, { + label: 'FreeShuttle',//飞梭车型 + value: 'FreeShuttle' + }, + { + label: 'NZ',// + value: 'NZ' + }, + { + label: 'FreeRoller',//滚筒车 + value: 'FreeRoller' + }, + { + label: 'SlamFitRoller',// + value: 'SlamFitRoller' + }, + { + label: 'ForkSeer', + value: 'ForkSeer' + }, + { + label: 'SurayRGV', + value: 'SurayRGV' + }, + { + label: 'BroachAGV', + value: 'BroachAGV' + }, + { + label: 'NYRGV', + value: 'NYRGV' + } + ] + } }, + { + dataPath: 'dt.linkStore', input: 'JsonPreview', + inputProps: {} + } ] } } diff --git a/src/utils/AmrMapConvert.ts b/src/utils/AmrMapConvert.ts index 279e440..b604dae 100644 --- a/src/utils/AmrMapConvert.ts +++ b/src/utils/AmrMapConvert.ts @@ -277,10 +277,10 @@ export function AmrMapConvert(from: any): Array { } // 货架高度是从 attribute[0].goodsAllocation[].layerHeight 读取的 - if(insertNode.t === 'rack') { + if (insertNode.t === 'rack') { const levelsInfo = amrNode.attribute[0].attrDetail const levelCount = levelsInfo.length - const levelHeight = _.map(levelsInfo, l=> new Decimal(l.val).div(d1000).toNumber() ) + const levelHeight = _.map(levelsInfo, l => new Decimal(l.val).div(d1000).toNumber()) insertNode.dt.levelCount = levelCount insertNode.dt.bays[0].levelHeight = levelHeight @@ -318,34 +318,34 @@ export function AmrMapConvert(from: any): Array { } // 这是潜伏AGV货位 - if(amrNode.type === 'CODE' && amrNode.attribute[0]?.rackTypeId === 3) { - lccMap.set(lccId+'C', { - "id": lccId+'C', - "t": "gstore", - "v": true, - "tf": [ + if (amrNode.type === 'CODE' && amrNode.attribute[0]?.rackTypeId === 3 && amrNode.attribute[0]?.attrValue === 'CellTypeRackLocation') { + lccMap.set(lccId + 'C', { + 'id': lccId + 'C', + 't': 'gstore', + 'v': true, + 'tf': [ [ new Decimal(amrNode.x).div(d100).toNumber(), 0, new Decimal(amrNode.y).div(d100).toNumber() ], - [0,0,0], - [0.5,0.01,0.5] + [0, 0, 0], + [0.5, 0.01, 0.5] ], - "dt": { - "in": [], - "out": [], - "center": [], - "strokeWidth": 0.05 + 'dt': { + 'in': [], + 'out': [], + 'center': [], + 'strokeWidth': 0.05 }, - "logicX": amrNode.logicX, - "logicY": amrNode.logicY + 'logicX': amrNode.logicX, + 'logicY': amrNode.logicY }) insertNode.dt.linkStore = [] - for(let c of amrNode.direction) { + for (let c of amrNode.direction) { insertNode.dt.linkStore.push({ - 'item': lccId+'C', + 'item': lccId + 'C', 'bay': 0, 'level': 0, 'cell': 0, 'direction': convertDirection(c) }) } @@ -498,6 +498,8 @@ function convertAmrDirectToLinkStoreDirection(direct: number): string { return 'right' } else if (direct === 4) { return 'left' + } else if (direct === 5) { + return 'right' } else { throw new Error('未知的方向: ' + direct) } @@ -529,17 +531,17 @@ function convertLinkStoreDistance(direction: string, storeNode: any) { // 根据方向,调整存储位的距离 function convertDirection(directions: string) { // N=up / S=down / E=right / W=left - if(directions === 'N') { + if (directions === 'N') { return 'up' } - if(directions === 'S'){ + if (directions === 'S') { return 'down' } - if(directions === 'E'){ + if (directions === 'E') { return 'right' } - if(directions === 'W'){ + if (directions === 'W') { return 'left' } - throw new Error('convertDirection error:'+ directions) + throw new Error('convertDirection error:' + directions) }
{{ JSON.stringify(props.modelValue, null, 2) }}