From 1a26063ce26c3971f57cb6769de5baa1d34f1a66 Mon Sep 17 00:00:00 2001 From: zhanghao <774378400@qq.com> Date: Mon, 3 Aug 2026 16:53:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20agv=E8=8E=B7=E5=8F=96=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/device/flow.js | 8 ++++++ .../components/params/BasicNodeParams.vue | 28 +++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/api/device/flow.js b/src/api/device/flow.js index f309674..5985597 100644 --- a/src/api/device/flow.js +++ b/src/api/device/flow.js @@ -68,4 +68,12 @@ export function getArmStatus(params) { method: 'get', params: params }) +} + +export function getAgvStatus(params) { + return request({ + url: '/api/agv/getRuntimeState', + method: 'get', + params: params + }) } \ No newline at end of file diff --git a/src/views/flow/components/params/BasicNodeParams.vue b/src/views/flow/components/params/BasicNodeParams.vue index b79b875..cbdc827 100644 --- a/src/views/flow/components/params/BasicNodeParams.vue +++ b/src/views/flow/components/params/BasicNodeParams.vue @@ -106,7 +106,7 @@ import { Plus, Minus } from '@element-plus/icons-vue' import FormItemRecursive from '../FormItemRecursive.vue' import { getInput } from '@/utils/flow' import { useQuote } from './useQuote.js' -import { getArmStatus } from '@/api/device/flow' +import { getArmStatus, getAgvStatus } from '@/api/device/flow' import { de } from 'element-plus/es/locale/index.mjs' const props = defineProps({ @@ -244,7 +244,31 @@ const robotFormAction = ref() const submitRobotForm = () => { if (robotFormAction.value === 'AGV_MOVE_TO_POINT') { - + robotFormRef.value.validate(async (valid) => { + if (valid) { + try { + const response = await getAgvStatus({ deviceId: robotForm.deviceId, terminalId: robotForm.terminalId }) + if (response && response.data) { + dialogVisible.value = false + const { x, y, theta } = response.data.pose + const testMap = { + x: x, + y: y, + theta: theta, + deviceId: robotForm.deviceId + } + // 将获取到的位置信息设置到 formData 中 + formData.nodeParams.forEach(param => { + if (testMap.hasOwnProperty(param.name)) { + param.input = testMap[param.name] + } + }) + } + } catch (error) { + console.error('获取位置信息失败:', error) + } + } + }) } else if (robotFormAction.value === 'ARM_MOVE_TO_POINT') { robotFormRef.value.validate(async (valid) => { if (valid) {