From 31e84dadd1f5ba5fa8a25417a38323076259f363 Mon Sep 17 00:00:00 2001
From: 3030332422 <3030332422@qq.com>
Date: Wed, 17 Sep 2025 16:25:46 +0800
Subject: [PATCH] =?UTF-8?q?update:=E5=8A=A8=E6=80=81=E8=8E=B7=E5=8F=96?=
=?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=B7=A5=E5=85=B7=E5=88=97=E8=A1=A8=E5=B9=B6?=
=?UTF-8?q?=E4=BC=98=E5=8C=96=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
main/manager-web/src/apis/module/device.js | 17 ++
.../src/components/McpToolCallDialog.vue | 168 ++++++++++++------
.../src/views/DeviceManagement.vue | 2 +-
3 files changed, 127 insertions(+), 60 deletions(-)
diff --git a/main/manager-web/src/apis/module/device.js b/main/manager-web/src/apis/module/device.js
index bd1697b7..03ed3519 100644
--- a/main/manager-web/src/apis/module/device.js
+++ b/main/manager-web/src/apis/module/device.js
@@ -102,4 +102,21 @@ export default {
});
}).send();
},
+ // 发送设备指令
+ sendDeviceCommand(deviceId, mcpData, callback) {
+ RequestService.sendRequest()
+ .url(`${getServiceUrl()}/device/commands/${deviceId}`)
+ .method('POST')
+ .data(mcpData)
+ .success((res) => {
+ RequestService.clearRequestTime();
+ callback(res);
+ })
+ .networkFail((err) => {
+ console.error('发送设备指令失败:', err);
+ RequestService.reAjaxFun(() => {
+ this.sendDeviceCommand(deviceId, mcpData, callback);
+ });
+ }).send();
+ },
}
\ No newline at end of file
diff --git a/main/manager-web/src/components/McpToolCallDialog.vue b/main/manager-web/src/components/McpToolCallDialog.vue
index 6c7b9a24..dc1306bb 100644
--- a/main/manager-web/src/components/McpToolCallDialog.vue
+++ b/main/manager-web/src/components/McpToolCallDialog.vue
@@ -19,7 +19,11 @@