From 05f4f007a7b8258c9ffd4405317091b14c149f3c Mon Sep 17 00:00:00 2001 From: zhanghao <774378400@qq.com> Date: Tue, 4 Aug 2026 09:05:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=9A=E7=94=A8=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/flow/components/ParamsDrawer.vue | 2 + .../components/params/Device_universal.vue | 463 ++++++++++++++++++ src/views/flow/config.js | 17 + .../flow/nodes/function/device_universal.vue | 135 +++++ src/views/flow/vue-flow/FlowNode.vue | 2 + 5 files changed, 619 insertions(+) create mode 100644 src/views/flow/components/params/Device_universal.vue create mode 100644 src/views/flow/nodes/function/device_universal.vue diff --git a/src/views/flow/components/ParamsDrawer.vue b/src/views/flow/components/ParamsDrawer.vue index 8bf7661..af78070 100644 --- a/src/views/flow/components/ParamsDrawer.vue +++ b/src/views/flow/components/ParamsDrawer.vue @@ -31,6 +31,7 @@ import CodeNodeParams from './params/CodeNodeParams.vue' import HttpNodeParams from './params/HttpNodeParams.vue' import SdAgentNodeParams from './params/SdAgentNodeParams.vue' import RecognizeNodeParams from './params/RecognizeNodeParams.vue' +import DeviceUniversal from './params/device_universal.vue' const props = defineProps({ drawer: Boolean, @@ -49,6 +50,7 @@ const currentComponent = computed(() => { if (type === 'http') return HttpNodeParams if (type === 'sdAgent') return SdAgentNodeParams if (type === 'recognize') return RecognizeNodeParams + if (type === 'device_universal') return DeviceUniversal return null }) diff --git a/src/views/flow/components/params/Device_universal.vue b/src/views/flow/components/params/Device_universal.vue new file mode 100644 index 0000000..165b95c --- /dev/null +++ b/src/views/flow/components/params/Device_universal.vue @@ -0,0 +1,463 @@ + + + + + + 输入参数 + + + + + + + + + + + + + + + + + + + + + + + + + + + visibleChange(visible, index, property.quote) + " + @change="(value) => cascaderChange(value, index, formData, 'nodeParams')" + /> + + + + + + + + + + + + + + + + 输出参数 + + + + + + addFormItem(e, 'outputParams')" + class="addFormItem" + > + + + + + + deleteTopLevelItem(path, 'outputParams')" + /> + + + + + + + + + + \ No newline at end of file diff --git a/src/views/flow/config.js b/src/views/flow/config.js index 02cb59b..a82eafe 100644 --- a/src/views/flow/config.js +++ b/src/views/flow/config.js @@ -323,6 +323,23 @@ function handler(params) { ], outputType: 'json' }, + { + icon: cameraSvg, + name: "通用指令", + type: "device_universal", + desc: "执行设备通用指令", + action: 'DEVICE_EXECUTE_JSON_COMMAND', + nodeType: 'EDGE', + nodeParams: [ + { name: "terminalId", type: "input", input: "", disabled: true }, + { name: "deviceId", type: "input", input: "", required: false, disabled: true }, + { name: "requestJson", type: "input", input: `{ + "a":123 +}`, required: false, disabled: true }, + ], + outputParams: [], + outputType: 'json' + }, { icon: videoSvg, name: "机械臂", diff --git a/src/views/flow/nodes/function/device_universal.vue b/src/views/flow/nodes/function/device_universal.vue new file mode 100644 index 0000000..3b06103 --- /dev/null +++ b/src/views/flow/nodes/function/device_universal.vue @@ -0,0 +1,135 @@ + + + + + + + + + + + + + {{ errorInfoData }} + + + + + + + + + diff --git a/src/views/flow/vue-flow/FlowNode.vue b/src/views/flow/vue-flow/FlowNode.vue index 93f36d1..43e4af1 100644 --- a/src/views/flow/vue-flow/FlowNode.vue +++ b/src/views/flow/vue-flow/FlowNode.vue @@ -74,6 +74,7 @@ import CodeNode from "../nodes/function/codeNode.vue"; import CurrentLoopNode from "../nodes/function/currentLoop.vue"; import SdAgentNode from "../nodes/function/sdAgent.vue"; import RecognizeNode from "../nodes/function/recognize.vue"; +import DeviceUniversal from "../nodes/function/device_universal.vue"; const props = defineProps({ id: String, @@ -98,6 +99,7 @@ const componentMap = { currentLoop: CurrentLoopNode, sdAgent: SdAgentNode, recognize: RecognizeNode, + device_universal: DeviceUniversal, }; const flowStore = useFlowStore();