| | |
| | | if (!el || !parent) return |
| | | |
| | | const cs = getComputedStyle(parent) |
| | | const inner = |
| | | parent.clientHeight - |
| | | parseFloat(cs.paddingTop || '0') - |
| | | parseFloat(cs.paddingBottom || '0') |
| | | const pb = parseFloat(cs.paddingBottom || '0') |
| | | |
| | | // 父级高度不可测(auto/0)时保留 CSS 回退,不设内联高度 |
| | | measuredHeight.value = inner > 0 ? `${inner}px` : undefined |
| | | /* |
| | | * 【2026-11-28 修复·1600×900 看不到底部按钮(叫号/过号/重叫/暂停/停止候诊)】 |
| | | * |
| | | * 旧实现:可用高度 = parent.clientHeight − 父级上下 padding。 |
| | | * 但父级(AppView 的 <section>)高度是 **min-height + 由内容撑开**, |
| | | * 于是形成循环依赖:内容(含 footer)把父级撑高 → 我们再把根元素设成"父级那么高" |
| | | * ⇒ 根元素永远 ≥ 内容高度,页面比视口高,footer 被推到折叠线以下, |
| | | * 医生必须滚动才能看到按钮(紧凑模式也救不了,因为压缩的是内容不是根高度)。 |
| | | * |
| | | * 现在改为**以视口为基准**(与父级当前高度无关,不循环): |
| | | * 可用高度 = window.innerHeight − 本页在文档中的顶端 − 父级 padding-bottom |
| | | * 这样 1600×900(浏览器可视高约 780)也一定能把 footer 放进屏幕内。 |
| | | */ |
| | | const rect = el.getBoundingClientRect() |
| | | const docTop = rect.top + (window.scrollY || document.documentElement.scrollTop || 0) |
| | | |
| | | // 布局底部的应用页脚(AppView 里 <Footer> 与内容 section 是兄弟节点)也会占高度, |
| | | // 不扣掉就会多出一条 20~40px 的页面滚动,把我们的底部按钮压到折叠线以下。 |
| | | // 通过"内容 section 的下一个兄弟"来识别,识别不到就当没有(不扣)。 |
| | | const nextSibling = parent.nextElementSibling as HTMLElement | null |
| | | const hasFooter = !!nextSibling && /footer/i.test(nextSibling.className || '') |
| | | const footerH = hasFooter ? nextSibling!.getBoundingClientRect().height : 0 |
| | | |
| | | const available = window.innerHeight - docTop - pb - footerH |
| | | // 极端小视口兜底 240px(再小就没有可用空间了) |
| | | measuredHeight.value = available > 0 ? `${Math.max(240, Math.round(available))}px` : undefined |
| | | |
| | | // 宽度变化(含窗口缩放)时重新夹一次右栏宽度, |
| | | // 否则拖宽后把窗口缩小,右侧栏可能把左侧内容挤没。 |
| | |
| | | if (parent && typeof ResizeObserver !== 'undefined') { |
| | | ro = new ResizeObserver(scheduleMeasure) |
| | | ro.observe(parent) |
| | | } else { |
| | | window.addEventListener('resize', scheduleMeasure) |
| | | } |
| | | // 【2026-11-28】窗口尺寸/浏览器缩放变化**一定**要重算:父级高度可能没变(min-height 撑满), |
| | | // 但视口变了 → 可用高度就变了。旧实现只在没有 ResizeObserver 时才监听 resize, |
| | | // 于是"最大化/还原窗口"后高度不刷新,footer 又跑到屏幕外。 |
| | | window.addEventListener('resize', scheduleMeasure) |
| | | // 侧边栏折叠/展开(菜单宽度变化)或 TagsView 开关同样会改变可用高度 |
| | | window.addEventListener('orientationchange', scheduleMeasure) |
| | | }) |
| | | |
| | | onBeforeUnmount(() => { |
| | |
| | | ro?.disconnect() |
| | | ro = undefined |
| | | window.removeEventListener('resize', scheduleMeasure) |
| | | window.removeEventListener('orientationchange', scheduleMeasure) |
| | | }) |
| | | </script> |
| | | |
| | |
| | | .doctor-page :deep(.el-button--default) { |
| | | height: 32px; |
| | | padding: 0 14px; |
| | | font-size: 14px; |
| | | font-size: 15px; |
| | | } |
| | | |
| | | /* 表格 / 队列列表内的行内按钮:小一档,避免把表格行撑高 */ |
| | |
| | | .doctor-page :deep(.queue-list .el-button:not(.is-link)) { |
| | | height: 28px; |
| | | padding: 0 10px; |
| | | font-size: 13px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | /* 链接式按钮(表头「撤销」、候选区「立即补人」等):只放大字号,不加高度 */ |
| | | .doctor-page :deep(.el-button.is-link) { |
| | | height: auto; |
| | | padding: 0 4px; |
| | | font-size: 14px; |
| | | font-size: 15px; |
| | | } |
| | | |
| | | /* ---------- 围观模式(只读)提示条 ---------- */ |
| | | .doctor-page__readonly-tip { |
| | | flex: none; |
| | | padding: 4px 12px; |
| | | font-size: 13px; |
| | | font-size: 14px; |
| | | line-height: 20px; |
| | | color: var(--el-color-warning); |
| | | background-color: var(--el-color-warning-light-9); |
| | |
| | | } |
| | | |
| | | .doctor-page__header { |
| | | height: 36px; |
| | | height: 32px; |
| | | } |
| | | |
| | | .doctor-page__readonly-tip { |
| | |
| | | } |
| | | |
| | | .doctor-page__footer { |
| | | padding: 2px 0 2px 8px; |
| | | padding: 1px 0 1px 8px; |
| | | } |
| | | |
| | | /* 【2026-11-28】紧凑模式下底部按钮再矮一档:1600×900 上把高度还给内容区 */ |
| | | .doctor-page__footer :deep(.el-button), |
| | | .doctor-page__footer :deep(.el-button--small) { |
| | | height: 28px; |
| | | padding: 0 10px; |
| | | font-size: 14px; |
| | | } |
| | | |
| | | .doctor-page__content { |
| | | padding: 4px 8px; |
| | | } |
| | | } |
| | | </style> |