From 081ac6f924d64297736c962ea9ec64f6046206b3 Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Thu, 22 Oct 2026 11:34:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=8F=B0=E6=8C=89=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E8=87=AA=E9=80=82=E5=BA=94=E5=B8=83=E5=B1=80=EF=BC=8C?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E6=94=B6=E8=B5=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 传感器卡片:宽时排一行,中等宽度分两行(开关卡片一行、滑块卡片一行),窄时每行 2 个 - 收起后只留一行状态(警示灯、照明灯、温湿度光照读数、LED 文字),传感器开关仍可点击;收起状态记在浏览器本地 - 设计器的撤销 / 重做按钮不再在窄屏下折行 Co-Authored-By: Claude Opus 5.5 --- web/src/designer/FormDesigner.vue | 6 ++ web/src/scene/TrainingBoard.vue | 160 +++++++++++++++++++++++++++++- 2 files changed, 161 insertions(+), 5 deletions(-) diff --git a/web/src/designer/FormDesigner.vue b/web/src/designer/FormDesigner.vue index ae88bf8..f6fe933 100644 --- a/web/src/designer/FormDesigner.vue +++ b/web/src/designer/FormDesigner.vue @@ -566,6 +566,8 @@ const noop = () => {} } .actions button { + flex: none; + white-space: nowrap; padding: 2px 10px; border: 1px solid #c5ccd5; border-radius: 3px; @@ -580,7 +582,11 @@ const noop = () => {} } .tips { + min-width: 0; margin-left: 8px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; color: #7a838e; } diff --git a/web/src/scene/TrainingBoard.vue b/web/src/scene/TrainingBoard.vue index 68cfbb1..26c8521 100644 --- a/web/src/scene/TrainingBoard.vue +++ b/web/src/scene/TrainingBoard.vue @@ -20,6 +20,27 @@ const DIGITAL_INPUTS: { key: DigitalKey; label: string }[] = [ const showMore = ref(false) +// 收起后只留一行状态,给窗体显示区腾地方;收起与否记在浏览器本地 +const COLLAPSED_KEY = 'iot-sim:board-collapsed' +const collapsed = ref(readCollapsed()) + +function readCollapsed() { + try { + return localStorage.getItem(COLLAPSED_KEY) === '1' + } catch { + return false + } +} + +function setCollapsed(value: boolean) { + collapsed.value = value + try { + localStorage.setItem(COLLAPSED_KEY, value ? '1' : '0') + } catch { + // 浏览器禁用本地存储时只是记不住,不影响使用 + } +} + // 拖动滑块时先显示本地值,避免服务器回传前滑块跳动;发送做节流 const dragging = ref>>({}) let pending: Partial> = {} @@ -59,7 +80,37 @@ const ledText = computed(() => props.board?.ledText ?? '')