From 0135fbc4744738ef367527d05c4c428540d91956 Mon Sep 17 00:00:00 2001 From: 18086616529 <344820985@qq.com> Date: Wed, 10 Jun 2026 09:21:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=BC=96=E6=8E=92=E6=BB=9A=E5=8A=A8=E6=9D=A1=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/workflow/NodePalette.vue | 5 +- .../components/workflow/WorkflowEditor.vue | 6 +- .../src/views/admin/MissionEditorView.vue | 31 +++++++++ .../src/views/admin/OrchestrationView.vue | 67 +++++++++++++++++++ .../src/workflow/assignCarParams.ts | 14 ++-- .../src/workflow/nodeCatalog.ts | 2 +- .../src/workflow/workflowUtils.ts | 13 ++-- 7 files changed, 122 insertions(+), 16 deletions(-) create mode 100644 frontends/apps/simple-platform-vue/src/views/admin/MissionEditorView.vue create mode 100644 frontends/apps/simple-platform-vue/src/views/admin/OrchestrationView.vue 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..e7a23e6 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', diff --git a/frontends/apps/simple-platform-vue/src/workflow/workflowUtils.ts b/frontends/apps/simple-platform-vue/src/workflow/workflowUtils.ts index 43079af..5b150dd 100644 --- a/frontends/apps/simple-platform-vue/src/workflow/workflowUtils.ts +++ b/frontends/apps/simple-platform-vue/src/workflow/workflowUtils.ts @@ -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) } } From 2703392652fc692133318ed3cd1fae5f3748d1b0 Mon Sep 17 00:00:00 2001 From: 18086616529 <344820985@qq.com> Date: Thu, 18 Jun 2026 15:17:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=BC=96=E6=8E=92=E7=95=8C=E9=9D=A2=E7=9A=84Json=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AF=BC=E5=87=BA=E7=9A=84=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/workflow/WorkflowEditor.vue | 3 ++- .../apps/simple-platform-vue/src/workflow/nodeCatalog.ts | 2 +- .../src/workflow/vda5050ActionParams.ts | 7 +++---- .../apps/simple-platform-vue/src/workflow/workflowUtils.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontends/apps/simple-platform-vue/src/components/workflow/WorkflowEditor.vue b/frontends/apps/simple-platform-vue/src/components/workflow/WorkflowEditor.vue index d5a0223..da939c3 100644 --- a/frontends/apps/simple-platform-vue/src/components/workflow/WorkflowEditor.vue +++ b/frontends/apps/simple-platform-vue/src/components/workflow/WorkflowEditor.vue @@ -364,7 +364,8 @@ async function onImportJson() { } const warnCount = prepared.reduce( - (sum, w) => sum + validateWorkflow(w).filter((i) => i.level === 'warning').length, + (sum, w) => + sum + validateWorkflow(w).filter((i) => i.level === 'warning').length, 0 ) if (warnCount > 0) { diff --git a/frontends/apps/simple-platform-vue/src/workflow/nodeCatalog.ts b/frontends/apps/simple-platform-vue/src/workflow/nodeCatalog.ts index e7a23e6..3d1f0c0 100644 --- a/frontends/apps/simple-platform-vue/src/workflow/nodeCatalog.ts +++ b/frontends/apps/simple-platform-vue/src/workflow/nodeCatalog.ts @@ -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 5b150dd..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/不可克隆对象报错) */