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 ?? '')