fix(pdf): 防止数据块内容意外换行,强制单行显示
- 修改 PDFLayoutOptimizer 生成的 CSS,为 .kpi-value 和 .hero-kpi .value 添加 white-space: nowrap - 设置 width: 100% 确保文本框撑满容器宽度 - 移除 word-break: break-word 以避免非必要的换行 - 添加 text-overflow: ellipsis 处理溢出情况 Ref: fixed unexpected line breaks in PDF data blocks
Showing
1 changed file
with
7 additions
and
6 deletions
| @@ -915,16 +915,17 @@ p {{ | @@ -915,16 +915,17 @@ p {{ | ||
| 915 | height: auto; | 915 | height: auto; |
| 916 | display: flex; | 916 | display: flex; |
| 917 | flex-direction: column; | 917 | flex-direction: column; |
| 918 | + align-items: stretch !important; | ||
| 918 | gap: 8px; | 919 | gap: 8px; |
| 919 | }} | 920 | }} |
| 920 | 921 | ||
| 921 | .kpi-card .kpi-value {{ | 922 | .kpi-card .kpi-value {{ |
| 922 | font-size: {body_kpi_value}px !important; | 923 | font-size: {body_kpi_value}px !important; |
| 923 | line-height: 1.25; | 924 | line-height: 1.25; |
| 924 | - word-break: break-word; | ||
| 925 | - overflow-wrap: break-word; | ||
| 926 | - hyphens: auto; | ||
| 927 | - max-width: 100%; | 925 | + white-space: nowrap; |
| 926 | + width: 100%; | ||
| 927 | + overflow: hidden; | ||
| 928 | + text-overflow: ellipsis; | ||
| 928 | display: flex; | 929 | display: flex; |
| 929 | flex-wrap: nowrap; | 930 | flex-wrap: nowrap; |
| 930 | align-items: baseline; | 931 | align-items: baseline; |
| @@ -1158,8 +1159,8 @@ td {{ | @@ -1158,8 +1159,8 @@ td {{ | ||
| 1158 | 1159 | ||
| 1159 | .hero-kpi .value {{ | 1160 | .hero-kpi .value {{ |
| 1160 | font-size: {overview_kpi_value}px !important; | 1161 | font-size: {overview_kpi_value}px !important; |
| 1161 | - word-break: break-word; | ||
| 1162 | - overflow-wrap: break-word; | 1162 | + white-space: nowrap; |
| 1163 | + width: 100%; | ||
| 1163 | max-width: 100%; | 1164 | max-width: 100%; |
| 1164 | line-height: 1.1; | 1165 | line-height: 1.1; |
| 1165 | display: block; | 1166 | display: block; |
-
Please register or login to post a comment