From 985f108d3edbb57f1e8ac0144a903c8058e56c7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=84=E5=87=A4=E7=A7=91=E6=8A=80?= Date: Mon, 17 Feb 2025 17:48:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BF=9D=E5=AD=98=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZhiKongTaiWeb/src/components/DeviceCard.vue | 14 +++- ZhiKongTaiWeb/src/components/RoleSetting.vue | 71 ++++++++++---------- ZhiKongTaiWeb/src/components/panel.vue | 8 +++ manager/api/config.py | 2 +- 4 files changed, 59 insertions(+), 36 deletions(-) diff --git a/ZhiKongTaiWeb/src/components/DeviceCard.vue b/ZhiKongTaiWeb/src/components/DeviceCard.vue index a30c66ad..6ac439a0 100644 --- a/ZhiKongTaiWeb/src/components/DeviceCard.vue +++ b/ZhiKongTaiWeb/src/components/DeviceCard.vue @@ -16,7 +16,7 @@
- +
@@ -81,6 +81,18 @@ const handleDelete = () => { emit('delete'); } }; + +const handleConfigure = () => { + // 保存设备配置到 localStorage,确保 RoleSetting 可以访问 + if (props.deviceId && props.deviceConfig) { + localStorage.setItem(`deviceConfig_${props.deviceId}`, JSON.stringify({ + selected_module: props.selectedModules, + prompt: props.deviceConfig.prompt || '', + nickname: props.deviceConfig.nickname || '小智' + })); + } + emit('configure'); +};