Compare commits

..

No commits in common. "9715101faf2fa230a4f1a1345339f2c19c52a1e0" and "a3b3f7a1c358dbf3cb89942905de527eef6fe650" have entirely different histories.

3 changed files with 4 additions and 59 deletions

View File

@ -76,12 +76,4 @@ export function getAgvStatus(params) {
method: 'get', method: 'get',
params: params params: params
}) })
} }
export function getArmJointState(params) {
return request({
url: '/api/arm/getJointState',
method: 'get',
params: params
})
}

View File

@ -11,7 +11,7 @@
</el-button> </el-button>
</template> </template>
<div class="form__container"> <div class="form__container">
<el-button type="primary" v-if="['AGV_MOVE_TO_POINT', 'ARM_MOVE_TO_POINT', 'ARM_MOVE_TO_J'].includes(props.data.properties.action)" size="small" @click="openRobotForm(props.data.properties.action)">获取位置</el-button> <el-button type="primary" v-if="['AGV_MOVE_TO_POINT', 'ARM_MOVE_TO_POINT'].includes(props.data.properties.action)" size="small" @click="openRobotForm(props.data.properties.action)">获取位置</el-button>
<el-form :inline="true" :model="formData" :rules="rules" ref="dynamicFormRef" label-position="top" <el-form :inline="true" :model="formData" :rules="rules" ref="dynamicFormRef" label-position="top"
label-width="auto"> label-width="auto">
<div v-for="(property, index) in formData.nodeParams" :key="index"> <div v-for="(property, index) in formData.nodeParams" :key="index">
@ -106,7 +106,7 @@ import { Plus, Minus } from '@element-plus/icons-vue'
import FormItemRecursive from '../FormItemRecursive.vue' import FormItemRecursive from '../FormItemRecursive.vue'
import { getInput } from '@/utils/flow' import { getInput } from '@/utils/flow'
import { useQuote } from './useQuote.js' import { useQuote } from './useQuote.js'
import { getArmStatus, getArmJointState, getAgvStatus } from '@/api/device/flow' import { getArmStatus, getAgvStatus } from '@/api/device/flow'
import { de } from 'element-plus/es/locale/index.mjs' import { de } from 'element-plus/es/locale/index.mjs'
const props = defineProps({ const props = defineProps({
@ -298,30 +298,6 @@ const submitRobotForm = () => {
} }
} }
}) })
} else if (robotFormAction.value === 'ARM_MOVE_TO_J') {
robotFormRef.value.validate(async (valid) => {
if (valid) {
try {
const response = await getArmJointState({
deviceId: robotForm.deviceId,
terminalId: robotForm.terminalId
})
if (response && response.data) {
const target = response.data.position || response.data.positions
if (!Array.isArray(target) || target.length === 0) {
throw new Error('机械臂未返回有效的关节位置')
}
dialogVisible.value = false
const targetParam = formData.nodeParams.find(param => param.name === 'target')
const deviceParam = formData.nodeParams.find(param => param.name === 'deviceId')
if (targetParam) targetParam.input = JSON.stringify(target)
if (deviceParam) deviceParam.input = robotForm.deviceId
}
} catch (error) {
console.error('获取机械臂关节位置失败:', error)
}
}
})
} }
} }
@ -407,4 +383,4 @@ defineExpose({ validateAndSave })
cursor: pointer; cursor: pointer;
} }
} }
</style> </style>

View File

@ -37,11 +37,6 @@ const audioOptions = () => {
}] }]
} }
const booleanOptions = () => [
{ value: false, label: '否' },
{ value: true, label: '是' }
]
const httpMethodOptions = () => { const httpMethodOptions = () => {
return [{ return [{
value: 'POST', value: 'POST',
@ -365,24 +360,6 @@ function handler(params) {
], ],
outputType: 'json' outputType: 'json'
}, },
{
icon: videoSvg,
name: "机械臂关节运动",
type: "serviceNode",
desc: "通过关节空间插值运动到目标关节位置",
action: 'ARM_MOVE_TO_J',
nodeType: 'EDGE',
nodeParams: [
{ name: "deviceId", type: "input", input: "", disabled: true },
{ name: "target", type: "input", input: "[0, 0, 0, 0, 0, 0]", disabled: true },
{ name: "velocity", type: "input", componentType: 'number', max: 5, step: 0.1, input: 0.5, disabled: true },
{ name: "acceleration", type: "input", componentType: 'number', max: 5, step: 0.1, input: 1, disabled: true },
{ name: "blendRadius", type: "input", componentType: 'number', max: 5, step: 0.01, input: 0, required: false, disabled: true },
{ name: "jointVelocityLimits", type: "input", input: "", required: false, disabled: true },
{ name: "asynchronous", type: "input", input: false, componentType: 'select', selectOptions: booleanOptions(), required: false, disabled: true }
],
outputType: 'json'
},
{ {
icon: cameraSvg, icon: cameraSvg,
name: "开始监听报警事件", name: "开始监听报警事件",