gm-printer 10.14.6 → 10.14.7-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/.eslintcache +1 -0
- package/package.json +1 -1
- package/src/common/component.js +6 -4
- package/src/common/editor_customize_config.js +13 -1
- package/src/common/editor_edit_field.js +26 -2
- package/src/common/editor_store.js +24 -0
- package/src/common/util.js +19 -0
- package/src/editor/context_menu.js +7 -2
- package/src/printer/store.js +9 -0
- package/yarn-error.log +9663 -0
package/.eslintcache
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[{"/Users/ganmeng/Documents/GM-项目/gm-printer/src/printer/store.js":"1","/Users/ganmeng/Documents/GM-项目/gm-printer/src/editor/context_menu.js":"2","/Users/ganmeng/Documents/GM-项目/gm-printer/src/common/editor_store.js":"3","/Users/ganmeng/Documents/GM-项目/gm-printer/src/common/editor_customize_config.js":"4"},{"size":18202,"mtime":1653550658475,"results":"5","hashOfConfig":"6"},{"size":5189,"mtime":1653550658475,"results":"7","hashOfConfig":"6"},{"size":36126,"mtime":1653550658474,"results":"8","hashOfConfig":"6"},{"size":1578,"mtime":1653550658473,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"cvcgct",{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/ganmeng/Documents/GM-项目/gm-printer/src/printer/store.js",[],"/Users/ganmeng/Documents/GM-项目/gm-printer/src/editor/context_menu.js",[],"/Users/ganmeng/Documents/GM-项目/gm-printer/src/common/editor_store.js",[],"/Users/ganmeng/Documents/GM-项目/gm-printer/src/common/editor_customize_config.js",[]]
|
package/package.json
CHANGED
package/src/common/component.js
CHANGED
|
@@ -602,16 +602,16 @@ Title.propTypes = {
|
|
|
602
602
|
text: PropTypes.object
|
|
603
603
|
}
|
|
604
604
|
|
|
605
|
-
const Radio = ({ id, value, radioChecked, checked }) => (
|
|
606
|
-
<div>
|
|
605
|
+
const Radio = ({ id, value, radioChecked, checked, style, inputName }) => (
|
|
606
|
+
<div style={style}>
|
|
607
607
|
<input
|
|
608
608
|
type='radio'
|
|
609
609
|
value={value}
|
|
610
610
|
id={id}
|
|
611
|
-
name='radio'
|
|
611
|
+
name={inputName ?? 'radio'}
|
|
612
612
|
onChange={radioChecked}
|
|
613
613
|
checked={checked}
|
|
614
|
-
style={{ margin: '5px
|
|
614
|
+
style={{ margin: '5px 5px 0 0' }}
|
|
615
615
|
/>
|
|
616
616
|
<label htmlFor={id}>{value}</label>
|
|
617
617
|
<Gap />
|
|
@@ -621,6 +621,8 @@ const Radio = ({ id, value, radioChecked, checked }) => (
|
|
|
621
621
|
Radio.propTypes = {
|
|
622
622
|
id: PropTypes.string,
|
|
623
623
|
value: PropTypes.string,
|
|
624
|
+
style: PropTypes.string,
|
|
625
|
+
inputName: PropTypes.string,
|
|
624
626
|
radioChecked: PropTypes.func,
|
|
625
627
|
checked: PropTypes.bool
|
|
626
628
|
}
|
|
@@ -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 {
|
|
@@ -14,10 +14,12 @@ import {
|
|
|
14
14
|
Textarea,
|
|
15
15
|
Title,
|
|
16
16
|
TipInfo,
|
|
17
|
-
Text
|
|
17
|
+
Text,
|
|
18
|
+
Radio
|
|
18
19
|
} from '../common/component'
|
|
19
20
|
import { get, toJS } from 'mobx'
|
|
20
21
|
import PropTypes from 'prop-types'
|
|
22
|
+
import { subtotalRadioList } from './util'
|
|
21
23
|
|
|
22
24
|
@inject('editStore')
|
|
23
25
|
@observer
|
|
@@ -399,7 +401,7 @@ class EditorField extends React.Component {
|
|
|
399
401
|
/>
|
|
400
402
|
|
|
401
403
|
<Flex>
|
|
402
|
-
<Flex>{i18next.t('
|
|
404
|
+
<Flex>{i18next.t('每页合计设置')}:</Flex>
|
|
403
405
|
<Fonter
|
|
404
406
|
style={subtotalStyle}
|
|
405
407
|
onChange={this.handleSubtotalStyleChange}
|
|
@@ -410,6 +412,28 @@ class EditorField extends React.Component {
|
|
|
410
412
|
onChange={this.handleSubtotalStyleChange}
|
|
411
413
|
/>
|
|
412
414
|
</Flex>
|
|
415
|
+
<Gap />
|
|
416
|
+
{!isSomeSubtotalTr && (
|
|
417
|
+
<div>
|
|
418
|
+
<Flex>{i18next.t('合金栏打印金额')}:</Flex>
|
|
419
|
+
<Flex style={{ marginLeft: 57 }}>
|
|
420
|
+
{subtotalRadioList.map(fields => {
|
|
421
|
+
return (
|
|
422
|
+
<Radio
|
|
423
|
+
style={{ marginLeft: 5 }}
|
|
424
|
+
id={fields.id}
|
|
425
|
+
value={fields.value}
|
|
426
|
+
key={fields.id}
|
|
427
|
+
inputName='subtotalRadio'
|
|
428
|
+
checked={subtotal?.fields?.[0].valueField === fields.id}
|
|
429
|
+
radioChecked={() => editStore.subtotalRadioCheck(fields)}
|
|
430
|
+
/>
|
|
431
|
+
)
|
|
432
|
+
})}
|
|
433
|
+
</Flex>
|
|
434
|
+
</div>
|
|
435
|
+
)}
|
|
436
|
+
|
|
413
437
|
<EditorSubtotalCheck
|
|
414
438
|
subtotalCheckDisabled
|
|
415
439
|
subtotalChecked={subtotalNeedUpperCase}
|
|
@@ -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
|
|
@@ -565,6 +580,15 @@ class EditorStore {
|
|
|
565
580
|
}
|
|
566
581
|
}
|
|
567
582
|
|
|
583
|
+
@action
|
|
584
|
+
subtotalRadioCheck(fields) {
|
|
585
|
+
if (this.selectedRegion) {
|
|
586
|
+
this.overallOrderShow = !this.overallOrderShow
|
|
587
|
+
const arr = this.selectedRegion.split('.')
|
|
588
|
+
this.config.contents[arr[2]].subtotal.fields[0].valueField = fields.id
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
|
|
568
592
|
@action
|
|
569
593
|
setOverallOrderShow(name) {
|
|
570
594
|
const arr = name.split('.')
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import i18next from '../../locales'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 每页合计设置单选按钮
|
|
5
|
+
* id的值是用来计算每页的金额总数,不要轻易随便改
|
|
6
|
+
* id值暂时使用_origin的值,可优化改为{{列.xxxx}}的值,改起来有代价,先不改
|
|
7
|
+
*/
|
|
8
|
+
const subtotalRadioList = [
|
|
9
|
+
{
|
|
10
|
+
value: i18next.t('下单金额'),
|
|
11
|
+
id: 'total_item_price'
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
value: i18next.t('出库金额'),
|
|
15
|
+
id: 'real_item_price'
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
export { subtotalRadioList }
|
|
@@ -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
|
package/src/printer/store.js
CHANGED
|
@@ -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
|