diff --git a/src/api/device/system.js b/src/api/device/system.js index 55356a9..ae5b3a5 100644 --- a/src/api/device/system.js +++ b/src/api/device/system.js @@ -8,6 +8,9 @@ export function getSafetyState(robotId) { }) } +/** + * 恢复机器人运行状态;payload 与旧 recoverSafetyState 保持一致,便于调用方渐进迁移。 + */ export function restoreOperationalState(data) { return request({ url: '/api/system/restoreOperationalState', @@ -17,7 +20,7 @@ export function restoreOperationalState(data) { } /** - * @deprecated Use restoreOperationalState. + * @deprecated 请改用 restoreOperationalState,旧接口仅保留给未迁移调用方。 */ export function recoverSafetyState(data) { return request({ diff --git a/src/utils/flowResources.js b/src/utils/flowResources.js index b6f8a98..54e9462 100644 --- a/src/utils/flowResources.js +++ b/src/utils/flowResources.js @@ -4,6 +4,7 @@ export const FLOW_SCHEMA_VERSION = 2 export const DEFAULT_ROLE_KEY = 'default_executor' export const FLOW_NODE_RESOURCE_OWNER = 'FLOW_NODE' export const USER_RESOURCE_OWNER = 'USER' +// 图片分析节点的输出契约会被节点配置、参数面板和旧流程迁移复用,集中定义避免字段漂移。 export const IMAGE_ANALYSIS_OUTPUT_PARAMS = Object.freeze([ { name: 'result', type: 'object', desc: '按提示词返回的结果', children: [], disabled: true }, { name: 'resultText', type: 'string', desc: '模型返回的原始文本', disabled: true }, @@ -102,6 +103,7 @@ export const normalizeFlowResourceSchema = (sourceGraph) => { graph.edges = Array.isArray(graph.edges) ? graph.edges : [] graph.nodes.forEach((node) => { node.type = LEGACY_NODE_TYPE_ALIASES[node.type] || node.type + // 早期图片分析图数据可能只保存节点类型,加载时补齐运行端识别所需的协议字段。 if (node.type === 'imageAnalysis') { const properties = node.properties || (node.properties = {}) properties.action = 'IMAGE_ANALYZE' @@ -109,6 +111,7 @@ export const normalizeFlowResourceSchema = (sourceGraph) => { properties.outputType = 'json' properties.outputParams = clone(IMAGE_ANALYSIS_OUTPUT_PARAMS) } + // 视频分析新增 result/detailedOutput 后,打开旧流程时补齐输出字段,后续节点才能稳定引用。 if (node.properties?.action === 'VIDEO_ANALYZE') { const outputParams = Array.isArray(node.properties.outputParams) ? node.properties.outputParams diff --git a/src/views/flow/components/ParamsDrawer.vue b/src/views/flow/components/ParamsDrawer.vue index c33a11f..f88c393 100644 --- a/src/views/flow/components/ParamsDrawer.vue +++ b/src/views/flow/components/ParamsDrawer.vue @@ -69,6 +69,7 @@ const currentComponent = computed(() => { if (['deviceUniversal', 'device_universal'].includes(type)) return DeviceUniversal if (type === 'actionQueue') return ActionQueueParams if (type === 'mediaAnalysis') return MediaAnalysisParams + // 图片分析支持多图、参考图和自由提示词输出,使用独立面板保持媒体分析面板聚焦音视频。 if (type === 'imageAnalysis') return ImageAnalysisParams if (type === 'branch') return SwitchNodeParams return null diff --git a/src/views/flow/components/TaskExecutionLog.vue b/src/views/flow/components/TaskExecutionLog.vue index c088627..2e08500 100644 --- a/src/views/flow/components/TaskExecutionLog.vue +++ b/src/views/flow/components/TaskExecutionLog.vue @@ -178,6 +178,7 @@ const analysisOf = (log) => { const profileCode = String(output.profileCode || '').toLowerCase() const isAudio = analysisType.includes('AUDIO') || profileCode.includes('audio') || Number(log.logType) === 4 const isVideo = analysisType.includes('VIDEO') || profileCode.includes('video') || Number(log.logType) === 3 + // 图片分析没有历史 logType 枚举,只依赖新协议中的 analysisType/profileCode 识别。 const isImage = analysisType.includes('IMAGE') || profileCode.includes('image') // 仅有媒体类型还不足以展示分析面板,至少要存在一个分析状态或业务结果字段。 @@ -252,6 +253,7 @@ const analysisOf = (log) => { matchLabel: isAudio ? '' : matched === true ? '匹配' : matched === false ? '未匹配' : '', confidence, passedLabel: passed === true ? '通过' : passed === false ? '未通过' : '', + // 图片分析由提示词决定输出形态,优先展示模型文本或字符串结果,避免把枚举型原因当摘要。 summary: output.summary || output.conclusion || output.resultText || (typeof output.result === 'string' ? output.result : '') || (/^[A-Z_]+$/.test(String(output.decisionReason || '')) ? '' : output.decisionReason) diff --git a/src/views/flow/components/params/ImageAnalysisParams.vue b/src/views/flow/components/params/ImageAnalysisParams.vue index 9c1d4df..67e3156 100644 --- a/src/views/flow/components/params/ImageAnalysisParams.vue +++ b/src/views/flow/components/params/ImageAnalysisParams.vue @@ -1,3 +1,7 @@ +