diff --git a/frontends/apps/simple-platform-vue/src/components/workflow/NodePalette.vue b/frontends/apps/simple-platform-vue/src/components/workflow/NodePalette.vue index 20534b6..8e14e3b 100644 --- a/frontends/apps/simple-platform-vue/src/components/workflow/NodePalette.vue +++ b/frontends/apps/simple-platform-vue/src/components/workflow/NodePalette.vue @@ -75,8 +75,9 @@ function onDragStart(e: DragEvent, type: string) { diff --git a/frontends/apps/simple-platform-vue/src/views/admin/OrchestrationView.vue b/frontends/apps/simple-platform-vue/src/views/admin/OrchestrationView.vue new file mode 100644 index 0000000..ebd8c27 --- /dev/null +++ b/frontends/apps/simple-platform-vue/src/views/admin/OrchestrationView.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/frontends/apps/simple-platform-vue/src/workflow/assignCarParams.ts b/frontends/apps/simple-platform-vue/src/workflow/assignCarParams.ts index a4adff3..88ef76e 100644 --- a/frontends/apps/simple-platform-vue/src/workflow/assignCarParams.ts +++ b/frontends/apps/simple-platform-vue/src/workflow/assignCarParams.ts @@ -1,12 +1,12 @@ import type { ParamFieldDef } from '@/types/workflow' export const ASSIGN_STRATEGY_OPTIONS = [ - { label: '指定车辆', value: 'fixed' }, - { label: '指定类型', value: 'byType' } + { label: '指定车辆', value: 'carId' }, + { label: '指定类型', value: 'carType' } ] as const -const FIXED = { key: 'strategy', equals: 'fixed' as const } -const BY_TYPE = { key: 'strategy', equals: 'byType' as const } +const BY_CAR_ID = { key: 'strategy', equals: 'carId' as const } +const BY_CAR_TYPE = { key: 'strategy', equals: 'carType' as const } /** 分配车辆:指定车辆 / 指定类型 */ export function assignCarParams(): ParamFieldDef[] { @@ -16,7 +16,7 @@ export function assignCarParams(): ParamFieldDef[] { label: '分配策略', type: 'select', required: true, - defaultValue: 'fixed', + defaultValue: 'carId', options: [...ASSIGN_STRATEGY_OPTIONS] }, { @@ -25,7 +25,7 @@ export function assignCarParams(): ParamFieldDef[] { type: 'string', required: true, placeholder: '如 C01', - when: FIXED + when: BY_CAR_ID }, { key: 'carType', @@ -33,7 +33,7 @@ export function assignCarParams(): ParamFieldDef[] { type: 'string', required: true, placeholder: '如 Forklift / SimpleLite.RCS.Cars.AgvCar', - when: BY_TYPE + when: BY_CAR_TYPE } ] } diff --git a/frontends/apps/simple-platform-vue/src/workflow/nodeCatalog.ts b/frontends/apps/simple-platform-vue/src/workflow/nodeCatalog.ts index b581553..3d1f0c0 100644 --- a/frontends/apps/simple-platform-vue/src/workflow/nodeCatalog.ts +++ b/frontends/apps/simple-platform-vue/src/workflow/nodeCatalog.ts @@ -132,7 +132,7 @@ export const DEMO_WORKFLOW: WorkflowDefinition = { viewport: { x: 0, y: 0, zoom: 1 }, nodes: [ { id: 'n1', type: 'start', label: '开始', position: { x: 60, y: 200 }, params: {} }, - { id: 'n2', type: 'assignCar', label: '分配车辆', position: { x: 240, y: 180 }, params: { strategy: 'fixed', carId: 'C01' } }, + { id: 'n2', type: 'assignCar', label: '分配车辆', position: { x: 240, y: 180 }, params: { strategy: 'carId', carId: 'C01' } }, { id: 'n3', type: 'gotoSite', label: '前往入库点', position: { x: 460, y: 180 }, params: { siteId: 'S001' } }, { id: 'n4', @@ -140,7 +140,7 @@ export const DEMO_WORKFLOW: WorkflowDefinition = { label: '取货', position: { x: 680, y: 180 }, params: { - actionType: 'pick', + actionType: 'fetch', actionParameters: '[{"key":"loadType","value":"pallet"}]' } }, diff --git a/frontends/apps/simple-platform-vue/src/workflow/vda5050ActionParams.ts b/frontends/apps/simple-platform-vue/src/workflow/vda5050ActionParams.ts index af6cc4e..605a25d 100644 --- a/frontends/apps/simple-platform-vue/src/workflow/vda5050ActionParams.ts +++ b/frontends/apps/simple-platform-vue/src/workflow/vda5050ActionParams.ts @@ -2,9 +2,8 @@ import type { ParamFieldDef } from '@/types/workflow' /** 动作类型选项 */ export const ACTION_TYPE_OPTIONS = [ - { label: '取货', value: 'pick' }, - { label: '放货', value: 'drop' }, - { label: '充电', value: 'startCharging' } + { label: '取货', value: 'fetch' }, + { label: '放货', value: 'put' } ] as const /** 执行动作:对齐 VDA5050 Order.actions[] 单条 Action 结构(不含 actionId,下发时由运行时生成) */ @@ -15,7 +14,7 @@ export function executeActionParams(): ParamFieldDef[] { label: '动作类型', type: 'select', required: true, - defaultValue: 'pick', + defaultValue: 'fetch', options: [...ACTION_TYPE_OPTIONS] }, { diff --git a/frontends/apps/simple-platform-vue/src/workflow/workflowUtils.ts b/frontends/apps/simple-platform-vue/src/workflow/workflowUtils.ts index 43079af..b2240ad 100644 --- a/frontends/apps/simple-platform-vue/src/workflow/workflowUtils.ts +++ b/frontends/apps/simple-platform-vue/src/workflow/workflowUtils.ts @@ -1,7 +1,7 @@ import { toRaw } from 'vue' import type { ParamFieldDef, WorkflowDefinition, WorkflowEdgeDef, WorkflowNodeDef } from '@/types/workflow' import type { WorkflowCatalogExport } from '@/workflow/workflowLibrary' -import { NODE_CATALOG_MAP, defaultParamsForType } from '@/workflow/nodeCatalog' +import { defaultParamsForType, NODE_CATALOG_MAP } from '@/workflow/nodeCatalog' import { WAIT_EVENT_HANDLES, WAIT_EVENT_HANDLE_LABELS } from '@/workflow/waitEventParams' /** 深拷贝流程定义(workflow 为纯 JSON 结构,避免 structuredClone 对 Proxy/不可克隆对象报错) */ @@ -72,8 +72,10 @@ export const WORKFLOW_CATALOG_VERSION = 3 export const WORKFLOW_EDITOR_STORAGE_KEY = 'workflowEditor.draft' const DEPRECATED_ASSIGN_STRATEGY: Record = { - nearest: 'fixed', - idle: 'byType' + nearest: 'carId', + idle: 'carType', + fixed: 'carId', + byType: 'carType' } function isFieldVisible(field: ParamFieldDef, params: Record): boolean { @@ -268,11 +270,12 @@ export function attachNextIds( }) } -/** 导出用:附带 nextId 的流程快照 */ +/** 导出用:附带 nextId 的流程快照(params 按当前控件 schema 规范化) */ export function workflowForExport(def: WorkflowDefinition): WorkflowDefinition { + const normalized = normalizeWorkflow(def) return { - ...def, - nodes: attachNextIds(def.nodes, def.edges) + ...normalized, + nodes: attachNextIds(normalized.nodes, normalized.edges) } }