gm-printer 10.14.4-beta.0 → 10.14.4-beta.3

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.4-beta.0",
3
+ "version": "10.14.4-beta.3",
4
4
  "description": "diy printer",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -17,12 +17,10 @@ class EditorCutomizedConfig extends React.Component {
17
17
  editStore.setMultiDigitDecimal(value)
18
18
  }
19
19
 
20
-
21
-
22
20
  render() {
23
21
  const {
24
22
  editStore,
25
- editStore: { isAutoFilling,isMultiDigitDecimal }
23
+ editStore: { isAutoFilling, isMultiDigitDecimal }
26
24
  } = this.props
27
25
  // 是table
28
26
  if (editStore.computedRegionIsTable) {
@@ -37,7 +35,10 @@ class EditorCutomizedConfig extends React.Component {
37
35
  </Flex>
38
36
  <Flex alignCenter className='gm-padding-top-5'>
39
37
  <div>{i18next.t('是否开启多位小数')}:</div>
40
- <Switch checked={isMultiDigitDecimal} onChange={this.handleMultiDigitDecimal} />
38
+ <Switch
39
+ checked={isMultiDigitDecimal}
40
+ onChange={this.handleMultiDigitDecimal}
41
+ />
41
42
  </Flex>
42
43
  </>
43
44
  )
@@ -68,6 +68,13 @@ class EditorStore {
68
68
  @action
69
69
  setMultiDigitDecimal(bool) {
70
70
  this.isMultiDigitDecimal = bool
71
+ set(this.config, {
72
+ specialControlConfig: {
73
+ multiDigitDecimal: bool
74
+ }
75
+ })
76
+
77
+ this.selected && this.changeTableDataKey(this.selected, 'multiDigitDecimal')
71
78
  }
72
79
 
73
80
  @observable
@@ -195,6 +202,7 @@ class EditorStore {
195
202
  this.insertPanel = 'header'
196
203
  this.mockData = data
197
204
  this.isAutoFilling = false
205
+ this.isMultiDigitDecimal = false
198
206
  }
199
207
 
200
208
  @action
@@ -613,6 +621,7 @@ class EditorStore {
613
621
 
614
622
  @action
615
623
  changeTableDataKey(name, key) {
624
+ console.log('changeTableDataKey', name)
616
625
  const arr = name.split('.')
617
626
  const { dataKey, overallOrder, subtotal } = this.config.contents[arr[2]]
618
627
  const keyArr = dataKey.split('_')
@@ -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
  /**
@@ -100,7 +105,7 @@ class ContextMenu extends React.Component {
100
105
  const isCategoryActive = keyArr.includes('category')
101
106
  const isSubtotalActive = subtotal.show
102
107
  const isOverallOrder = overallOrder?.show
103
-
108
+ console.log('name', name)
104
109
  return (
105
110
  <>
106
111
  <div
@@ -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