gm-printer 10.41.10-beta.178 → 10.41.10-beta.180

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-printer",
3
- "version": "10.41.10-beta.178",
3
+ "version": "10.41.10-beta.180",
4
4
  "description": "diy printer",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -216,9 +216,12 @@ class Table extends React.Component {
216
216
 
217
217
  if (!width) return tdStyle
218
218
  if (fontSize) minWidth = _.parseInt(fontSize) * 2
219
+ // 宽列也要锁 width:只设 minWidth 时打印阶段列宽会被该页内容重新分配,
220
+ // 与测量阶段(全量行 auto 布局)不一致,边界文本换行数漂移导致分页后页尾空白/溢出
219
221
  if (width >= 150) {
220
222
  tdStyle = {
221
- minWidth: width
223
+ minWidth: width,
224
+ width
222
225
  }
223
226
  } else {
224
227
  tdStyle = {
@@ -246,11 +249,16 @@ class Table extends React.Component {
246
249
  const needDiyTag = config.diyTagSubtotal?.show && dataKey.includes('tagDiy')
247
250
  const diyTagGroups = needDiyTag ? collectGroups(tableData, range) : []
248
251
 
252
+ // 列宽齐全(走过分页测量)时用 fixed:列宽锁定为测量值,不再随每页内容重新分配,
253
+ // 保证打印阶段换行/行高与测量阶段一致,分页边界才准确。
254
+ // 测量阶段自身(renderBefore)与合并打印首渲染(tablesInfo 为空)仍走 auto。
255
+ const isFixedLayout = thWidths.length === columns.length
256
+
249
257
  return (
250
258
  <table
251
259
  style={{
252
260
  // td会撑开table的宽度
253
- tableLayout: 'inherit',
261
+ tableLayout: isFixedLayout ? 'fixed' : 'inherit',
254
262
  wordBreak: 'break-all'
255
263
  }}
256
264
  >