gm-printer 10.42.1 → 10.42.2-beta.0

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.42.1",
3
+ "version": "10.42.2-beta.0",
4
4
  "description": "diy printer",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -49,10 +49,15 @@ class Panel extends React.Component {
49
49
  diffY = -diffY
50
50
  }
51
51
 
52
+ // 高度不允许拖成负数:负 height 是非法 CSS,浏览器按 0 渲染,
53
+ // 但分页的配置兜底会取到负值,导致末页预留为负、内容溢出与固定页脚重叠
54
+ const height =
55
+ Math.max(0, parseInt(pxAdd(config.style.height, diffY), 10)) + 'px'
56
+
52
57
  dispatchMsg('gm-printer-panel-style-set', {
53
58
  name,
54
59
  style: {
55
- height: pxAdd(config.style.height, diffY)
60
+ height
56
61
  }
57
62
  })
58
63
  }
@@ -248,7 +248,9 @@ class PrinterStore {
248
248
  const raw = this.config?.sign?.style?.height
249
249
  if (raw == null || raw === '') return 0
250
250
  const parsed = parseFloat(raw)
251
- return Number.isFinite(parsed) ? parsed : 0
251
+ // 负高度(编辑器历史版本可拖出如 -161px)会让末页签名预留为负,
252
+ // 单页虚增可容纳高度,固定页脚时表格溢出与页脚重叠;非正值一律按 0
253
+ return parsed > 0 ? parsed : 0
252
254
  }
253
255
 
254
256
  /** 处理采购单的明细