From be27214928a43cacff975265a7c67e2e2461fd0c Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期六, 28 十一月 2026 19:39:01 +0800
Subject: [PATCH] 打印小票
---
src/components/DoctorPageLayout/src/DoctorPageLayout.vue | 66 ++++++++++++++++++++++++++-------
1 files changed, 52 insertions(+), 14 deletions(-)
diff --git a/src/components/DoctorPageLayout/src/DoctorPageLayout.vue b/src/components/DoctorPageLayout/src/DoctorPageLayout.vue
index f1f54c2..87ba476 100644
--- a/src/components/DoctorPageLayout/src/DoctorPageLayout.vue
+++ b/src/components/DoctorPageLayout/src/DoctorPageLayout.vue
@@ -302,13 +302,34 @@
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锛夋妸鐖剁骇鎾戦珮 鈫� 鎴戜滑鍐嶆妸鏍瑰厓绱犺鎴�"鐖剁骇閭d箞楂�"
+ * 鈬� 鏍瑰厓绱犳案杩� 鈮� 鍐呭楂樺害锛岄〉闈㈡瘮瑙嗗彛楂橈紝footer 琚帹鍒版姌鍙犵嚎浠ヤ笅锛�
+ * 鍖荤敓蹇呴』婊氬姩鎵嶈兘鐪嬪埌鎸夐挳锛堢揣鍑戞ā寮忎篃鏁戜笉浜嗭紝鍥犱负鍘嬬缉鐨勬槸鍐呭涓嶆槸鏍归珮搴︼級銆�
+ *
+ * 鐜板湪鏀逛负**浠ヨ鍙d负鍩哄噯**锛堜笌鐖剁骇褰撳墠楂樺害鏃犲叧锛屼笉寰幆锛夛細
+ * 鍙敤楂樺害 = window.innerHeight 鈭� 鏈〉鍦ㄦ枃妗d腑鐨勯《绔� 鈭� 鐖剁骇 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 鐨勪笅涓�涓厔寮�"鏉ヨ瘑鍒紝璇嗗埆涓嶅埌灏卞綋娌℃湁锛堜笉鎵o級銆�
+ 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
+ // 鏋佺灏忚鍙e厹搴� 240px锛堝啀灏忓氨娌℃湁鍙敤绌洪棿浜嗭級
+ measuredHeight.value = available > 0 ? `${Math.max(240, Math.round(available))}px` : undefined
// 瀹藉害鍙樺寲锛堝惈绐楀彛缂╂斁锛夋椂閲嶆柊澶逛竴娆″彸鏍忓搴︼紝
// 鍚﹀垯鎷栧鍚庢妸绐楀彛缂╁皬锛屽彸渚ф爮鍙兘鎶婂乏渚у唴瀹规尋娌°��
@@ -336,9 +357,13 @@
if (parent && typeof ResizeObserver !== 'undefined') {
ro = new ResizeObserver(scheduleMeasure)
ro.observe(parent)
- } else {
- window.addEventListener('resize', scheduleMeasure)
}
+ // 銆�2026-11-28銆戠獥鍙e昂瀵�/娴忚鍣ㄧ缉鏀惧彉鍖�**涓�瀹�**瑕侀噸绠楋細鐖剁骇楂樺害鍙兘娌″彉锛坢in-height 鎾戞弧锛夛紝
+ // 浣嗚鍙e彉浜� 鈫� 鍙敤楂樺害灏卞彉浜嗐�傛棫瀹炵幇鍙湪娌℃湁 ResizeObserver 鏃舵墠鐩戝惉 resize锛�
+ // 浜庢槸"鏈�澶у寲/杩樺師绐楀彛"鍚庨珮搴︿笉鍒锋柊锛宖ooter 鍙堣窇鍒板睆骞曞銆�
+ window.addEventListener('resize', scheduleMeasure)
+ // 渚ц竟鏍忔姌鍙�/灞曞紑锛堣彍鍗曞搴﹀彉鍖栵級鎴� TagsView 寮�鍏冲悓鏍蜂細鏀瑰彉鍙敤楂樺害
+ window.addEventListener('orientationchange', scheduleMeasure)
})
onBeforeUnmount(() => {
@@ -346,6 +371,7 @@
ro?.disconnect()
ro = undefined
window.removeEventListener('resize', scheduleMeasure)
+ window.removeEventListener('orientationchange', scheduleMeasure)
})
</script>
@@ -509,7 +535,7 @@
.doctor-page :deep(.el-button--default) {
height: 32px;
padding: 0 14px;
- font-size: 14px;
+ font-size: 15px;
}
/* 琛ㄦ牸 / 闃熷垪鍒楄〃鍐呯殑琛屽唴鎸夐挳锛氬皬涓�妗o紝閬垮厤鎶婅〃鏍艰鎾戦珮 */
@@ -517,21 +543,21 @@
.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);
@@ -705,7 +731,7 @@
}
.doctor-page__header {
- height: 36px;
+ height: 32px;
}
.doctor-page__readonly-tip {
@@ -714,7 +740,19 @@
}
.doctor-page__footer {
- padding: 2px 0 2px 8px;
+ padding: 1px 0 1px 8px;
+ }
+
+ /* 銆�2026-11-28銆戠揣鍑戞ā寮忎笅搴曢儴鎸夐挳鍐嶇煯涓�妗o細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>
--
Gitblit v1.9.3