gm-printer 10.14.10 → 10.15.1-beta.1

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.14.10",
3
+ "version": "10.15.1-beta.1",
4
4
  "description": "diy printer",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -12,10 +12,15 @@ class EditorCutomizedConfig extends React.Component {
12
12
  editStore.handleChangeTableData(value)
13
13
  }
14
14
 
15
+ handleMultiDigitDecimal = value => {
16
+ const { editStore } = this.props
17
+ editStore.setMultiDigitDecimal(value)
18
+ }
19
+
15
20
  render() {
16
21
  const {
17
22
  editStore,
18
- editStore: { isAutoFilling }
23
+ editStore: { isAutoFilling, isMultiDigitDecimal }
19
24
  } = this.props
20
25
  // 是table
21
26
  if (editStore.computedRegionIsTable) {
@@ -28,6 +33,13 @@ class EditorCutomizedConfig extends React.Component {
28
33
  <Flex className='gm-padding-top-5 gm-text-red' column>
29
34
  {i18next.t('注意:填充仅支持单栏数据使用')}
30
35
  </Flex>
36
+ <Flex alignCenter className='gm-padding-top-5'>
37
+ <div>{i18next.t('是否开启多位小数')}:</div>
38
+ <Switch
39
+ checked={isMultiDigitDecimal}
40
+ onChange={this.handleMultiDigitDecimal}
41
+ />
42
+ </Flex>
31
43
  </>
32
44
  )
33
45
  } else {
@@ -49,6 +49,10 @@ class EditorStore {
49
49
  @observable
50
50
  isAutoFilling = false
51
51
 
52
+ /** 是否开启多位小数,默认不开启,取两位 */
53
+ @observable
54
+ isMultiDigitDecimal = false
55
+
52
56
  defaultTableDataKey = 'orders'
53
57
 
54
58
  // 默认table的dataKey
@@ -61,6 +65,16 @@ class EditorStore {
61
65
  this.isAutoFilling = bol
62
66
  }
63
67
 
68
+ @action
69
+ setMultiDigitDecimal(bool) {
70
+ this.isMultiDigitDecimal = bool
71
+ set(this.config, {
72
+ specialControlConfig: {
73
+ multiDigitDecimal: bool
74
+ }
75
+ })
76
+ }
77
+
64
78
  @observable
65
79
  overallOrderShow = false
66
80
 
@@ -191,6 +205,7 @@ class EditorStore {
191
205
  this.insertPanel = 'header'
192
206
  this.mockData = data
193
207
  this.isAutoFilling = false
208
+ this.isMultiDigitDecimal = false
194
209
  }
195
210
 
196
211
  @action
@@ -26,7 +26,7 @@ class ContextMenu extends React.Component {
26
26
  const {
27
27
  editStore,
28
28
  editStore: {
29
- config: { autoFillConfig }
29
+ config: { autoFillConfig, specialControlConfig }
30
30
  }
31
31
  } = this.props
32
32
 
@@ -36,6 +36,11 @@ class ContextMenu extends React.Component {
36
36
  autoFillConfig?.dataKey
37
37
  )
38
38
  }
39
+ /** 初始化特殊控制的配置 */
40
+ if (specialControlConfig?.multiDigitDecimal) {
41
+ // 多位小数
42
+ editStore.setMultiDigitDecimal(specialControlConfig?.multiDigitDecimal)
43
+ }
39
44
  }
40
45
 
41
46
  /**
@@ -48,6 +48,15 @@ class PrinterStore {
48
48
  @observable
49
49
  isAutoFilling = false
50
50
 
51
+ /** 是否开启多位小数,默认不开启,取两位 */
52
+ @observable
53
+ isMultiDigitDecimal = false
54
+
55
+ @action
56
+ setMultiDigitDecimal(bool) {
57
+ this.isMultiDigitDecimal = bool
58
+ }
59
+
51
60
  @action
52
61
  init(config, data) {
53
62
  this.ready = false