gm-printer 10.28.7-beta.0 → 10.28.7

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.28.7-beta.0",
3
+ "version": "10.28.7",
4
4
  "description": "diy printer",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -7,7 +7,8 @@ import {
7
7
  DropDown,
8
8
  DropDownItem,
9
9
  DropDownItems,
10
- Dialog
10
+ Dialog,
11
+ Tip
11
12
  } from '../components'
12
13
  import { doPrint } from '../printer'
13
14
  import { toJS } from 'mobx'
@@ -46,6 +47,13 @@ class EditorTitle extends React.Component {
46
47
  handleSave = () => {
47
48
  const { editStore, isPurchase } = this.props
48
49
  const result = editStore.config
50
+ console.log(result, 'result')
51
+ if (result.isSave) {
52
+ Tip.warning(
53
+ i18next.t('检测到当前页面高度不足,无法完整渲染,请重新设置页面高度!')
54
+ )
55
+ return
56
+ }
49
57
  if (!isPurchase && result.batchPrintConfig) {
50
58
  delete result.batchPrintConfig
51
59
  }
@@ -76,7 +84,12 @@ class EditorTitle extends React.Component {
76
84
 
77
85
  handleSaveAs = () => {
78
86
  const { editStore } = this.props
79
-
87
+ if (editStore.config.isSave) {
88
+ Tip.warning(
89
+ i18next.t('检测到当前页面高度不足,无法完整渲染,请重新设置页面高度!')
90
+ )
91
+ return
92
+ }
80
93
  Dialog.render({
81
94
  title: i18next.t('另存为'),
82
95
  children: <DialogChildren editStore={editStore} />,
@@ -34,6 +34,7 @@ class PrinterStore {
34
34
 
35
35
  /** 当前页剩余空白高度 */
36
36
  @observable remainPageHeight = 0
37
+ @observable isSave = false
37
38
 
38
39
  data = {}
39
40
 
@@ -62,6 +63,12 @@ class PrinterStore {
62
63
  this.isMultiDigitDecimal = bool
63
64
  }
64
65
 
66
+ @action
67
+ setIsSave(bool) {
68
+ this.isSave = bool
69
+ this.config.isSave = bool
70
+ }
71
+
65
72
  @action
66
73
  init(config, data) {
67
74
  this.ready = false
@@ -255,6 +262,7 @@ class PrinterStore {
255
262
 
256
263
  @action
257
264
  computedPages() {
265
+ this.setIsSave(false)
258
266
  // 每次先初始化置空
259
267
  this.pages = []
260
268
  // 每页必有 页眉header, 页脚footer , 签名
@@ -264,6 +272,7 @@ class PrinterStore {
264
272
  Tip.warning(
265
273
  i18next.t('检测到当前页面高度不足,无法完整渲染,请重新设置页面高度!')
266
274
  )
275
+ this.setIsSave(true)
267
276
  return
268
277
  }
269
278
 
@@ -372,6 +381,7 @@ class PrinterStore {
372
381
  if (begin === 0 && end === 0 && index === 0) {
373
382
  index++
374
383
  this.pages = []
384
+ this.setIsSave(true)
375
385
  Tip.warning(
376
386
  i18next.t(
377
387
  '检测到当前页面高度不足,无法完整渲染,请重新设置页面高度!'