gm-printer 10.13.7 → 10.13.8-alpha.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/.eslintcache +1 -1
- package/package.json +1 -1
- package/src/common/editor_edit_field.js +1 -17
- package/src/common/editor_select.js +5 -4
- package/src/common/editor_store.js +7 -0
- package/src/common/editor_title.js +3 -2
- package/src/common/get_editor_css.js +1 -1
- package/src/common/hoc_with_shadow_dom.js +5 -5
- package/src/common/hoc_with_store.js +64 -25
- package/src/config.js +2 -0
- package/src/editor/context_menu.js +12 -2
- package/src/editor_account/context_menu.js +7 -3
- package/src/editor_purchase/context_menu.js +5 -0
- package/src/editor_purchase/editor_special_table.js +8 -1
- package/src/editor_salemenus/context_menu.js +5 -1
- package/src/editor_settle/context_menu.js +20 -9
- package/src/editor_statement/context_menu.js +6 -2
- package/src/editor_stockin/context_menu.js +7 -3
- package/src/editor_stockout/context_menu.js +5 -1
- package/src/index.js +2 -1
- package/src/printer/barcode.js +6 -0
- package/src/printer/get_css.js +1 -1
- package/src/util.js +1 -1
- package/yarn-error.log +9663 -0
- package/build/demo.js +0 -54
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/Users/
|
|
1
|
+
[{"/Users/min/Documents/GMFE/gm-util/gm-printer/src/util.js":"1","/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/get_css.js":"2","/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/barcode.js":"3","/Users/min/Documents/GMFE/gm-util/gm-printer/src/index.js":"4","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_stockout/context_menu.js":"5","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_stockin/context_menu.js":"6","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_statement/context_menu.js":"7","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_settle/context_menu.js":"8","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_salemenus/context_menu.js":"9","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_purchase/editor_special_table.js":"10","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_purchase/context_menu.js":"11","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_account/context_menu.js":"12","/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor/context_menu.js":"13","/Users/min/Documents/GMFE/gm-util/gm-printer/src/config.js":"14","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/hoc_with_store.js":"15","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/hoc_with_shadow_dom.js":"16","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/get_editor_css.js":"17","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_title.js":"18","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_store.js":"19","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_select.js":"20","/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_edit_field.js":"21"},{"size":7133,"mtime":1638862566087,"results":"22","hashOfConfig":"23"},{"size":291,"mtime":1638935573926,"results":"24","hashOfConfig":"23"},{"size":523,"mtime":1638935549030,"results":"25","hashOfConfig":"23"},{"size":1093,"mtime":1638861826721,"results":"26","hashOfConfig":"23"},{"size":2315,"mtime":1638930939570,"results":"27","hashOfConfig":"23"},{"size":2314,"mtime":1638930918783,"results":"28","hashOfConfig":"23"},{"size":1100,"mtime":1638930900747,"results":"29","hashOfConfig":"23"},{"size":2062,"mtime":1638930869535,"results":"30","hashOfConfig":"23"},{"size":3013,"mtime":1638930838581,"results":"31","hashOfConfig":"23"},{"size":4379,"mtime":1638935458586,"results":"32","hashOfConfig":"23"},{"size":2543,"mtime":1638935387181,"results":"33","hashOfConfig":"23"},{"size":2965,"mtime":1638935364549,"results":"34","hashOfConfig":"23"},{"size":3519,"mtime":1638930747457,"results":"35","hashOfConfig":"23"},{"size":2833,"mtime":1638861837310,"results":"36","hashOfConfig":"23"},{"size":4212,"mtime":1638935746667,"results":"37","hashOfConfig":"23"},{"size":861,"mtime":1638931446915,"results":"38","hashOfConfig":"23"},{"size":178,"mtime":1638931439249,"results":"39","hashOfConfig":"23"},{"size":3272,"mtime":1638931374761,"results":"40","hashOfConfig":"23"},{"size":22205,"mtime":1638862315362,"results":"41","hashOfConfig":"23"},{"size":4903,"mtime":1638931210449,"results":"42","hashOfConfig":"23"},{"size":13268,"mtime":1638930638946,"results":"43","hashOfConfig":"23"},{"filePath":"44","messages":"45","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"jpc0be",{"filePath":"46","messages":"47","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"54","messages":"55","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"58","messages":"59","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"60","messages":"61","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"62","messages":"63","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"64","messages":"65","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"66","messages":"67","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"68","messages":"69","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"70","messages":"71","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"72","messages":"73","errorCount":2,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"74","messages":"75","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"76","messages":"77","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"78","messages":"79","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"80","messages":"81","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"82","messages":"83","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"84","messages":"85","errorCount":1,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"/Users/min/Documents/GMFE/gm-util/gm-printer/src/util.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/get_css.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/printer/barcode.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/index.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_stockout/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_stockin/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_statement/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_settle/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_salemenus/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_purchase/editor_special_table.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_purchase/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor_account/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/editor/context_menu.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/config.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/hoc_with_store.js",["86","87"],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/hoc_with_shadow_dom.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/get_editor_css.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_title.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_store.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_select.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer/src/common/editor_edit_field.js",["88","89","90"],{"ruleId":"91","severity":2,"message":"92","line":10,"column":29,"nodeType":"93","endLine":10,"endColumn":35},{"ruleId":"91","severity":2,"message":"94","line":145,"column":63,"nodeType":"93","endLine":145,"endColumn":71},{"ruleId":"95","severity":1,"message":"96","line":265,"column":13,"nodeType":"97","endLine":265,"endColumn":49},{"ruleId":"95","severity":1,"message":"96","line":283,"column":13,"nodeType":"97","endLine":283,"endColumn":56},{"ruleId":"98","severity":2,"message":"99","line":436,"column":22,"nodeType":"100","messageId":"101","endLine":436,"endColumn":31},"react/prop-types","'config' is missing in props validation","Identifier","'mockData' is missing in props validation","react/jsx-handler-names","Handler function for onChange prop key must begin with 'handle'","JSXAttribute","gmfe/i18n-check","t函数的key只能为字符串常量(Literal),请使用单引号或双引号包裹","MemberExpression","isVariable"]
|
package/package.json
CHANGED
|
@@ -205,12 +205,6 @@ class EditorField extends React.Component {
|
|
|
205
205
|
(editStore.computedTableSpecialConfig.subtotal &&
|
|
206
206
|
get(subtotal, 'isUpperLowerCaseSeparate')) ||
|
|
207
207
|
false
|
|
208
|
-
// 位置交换
|
|
209
|
-
const subtotalCommutationPlace =
|
|
210
|
-
(editStore.computedTableSpecialConfig.subtotal &&
|
|
211
|
-
get(subtotal, 'isCommutationPlace')) ||
|
|
212
|
-
false
|
|
213
|
-
|
|
214
208
|
return (
|
|
215
209
|
<div>
|
|
216
210
|
<Title title={i18next.t('编辑字段')} />
|
|
@@ -276,7 +270,7 @@ class EditorField extends React.Component {
|
|
|
276
270
|
</Flex>
|
|
277
271
|
|
|
278
272
|
<Flex alignCenter className='gm-padding-top-5 gm-text-desc'>
|
|
279
|
-
{i18next.t('
|
|
273
|
+
{i18next.t('商品排列仅适用于双栏、三栏商品设置')}
|
|
280
274
|
</Flex>
|
|
281
275
|
|
|
282
276
|
<Gap height='5px' />
|
|
@@ -376,16 +370,6 @@ class EditorField extends React.Component {
|
|
|
376
370
|
onChange={this.handleSubtotalStyleChange}
|
|
377
371
|
/>
|
|
378
372
|
</Flex>
|
|
379
|
-
{/* <Flex style={{ margin: '5px 0 5px 62px' }}>
|
|
380
|
-
<Flex alignCenter>
|
|
381
|
-
<input
|
|
382
|
-
type='checkbox'
|
|
383
|
-
checked={subtotalCommutationPlace}
|
|
384
|
-
onChange={editStore.setSubtotalCommutationPlace}
|
|
385
|
-
/>
|
|
386
|
-
</Flex>
|
|
387
|
-
<Flex> {i18next.t('合计、每页合计交换位置')}</Flex>
|
|
388
|
-
</Flex> */}
|
|
389
373
|
<EditorSubtotalCheck
|
|
390
374
|
subtotalCheckDisabled
|
|
391
375
|
subtotalChecked={subtotalNeedUpperCase}
|
|
@@ -126,7 +126,7 @@ class EditorSelector extends React.Component {
|
|
|
126
126
|
</Flex>
|
|
127
127
|
|
|
128
128
|
{this.props.isPurchase && (
|
|
129
|
-
|
|
129
|
+
<>
|
|
130
130
|
<Flex alignCenter className='gm-padding-top-5'>
|
|
131
131
|
<div>{i18next.t('批量打印设置')}:</div>
|
|
132
132
|
<Select
|
|
@@ -146,7 +146,7 @@ class EditorSelector extends React.Component {
|
|
|
146
146
|
连续打印(一张采购单可能出现多个供应商)
|
|
147
147
|
</p>
|
|
148
148
|
</div>
|
|
149
|
-
|
|
149
|
+
</>
|
|
150
150
|
)}
|
|
151
151
|
|
|
152
152
|
<Flex alignCenter className='gm-padding-top-5 gm-text-red'>
|
|
@@ -158,9 +158,10 @@ class EditorSelector extends React.Component {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
EditorSelector.propTypes = {
|
|
161
|
-
isPurchase: PropTypes.bool
|
|
161
|
+
isPurchase: PropTypes.bool,
|
|
162
|
+
editStore: PropTypes.object
|
|
162
163
|
}
|
|
163
|
-
EditorSelector.
|
|
164
|
+
EditorSelector.defaultProps = {
|
|
164
165
|
isPurchase: false
|
|
165
166
|
}
|
|
166
167
|
|
|
@@ -427,7 +427,14 @@ class EditorStore {
|
|
|
427
427
|
newDataKey = _.concat(keyArr, key)
|
|
428
428
|
}
|
|
429
429
|
|
|
430
|
+
if (newDataKey.includes('multi') && key === 'multi3') {
|
|
431
|
+
newDataKey = _.without(newDataKey, 'multi')
|
|
432
|
+
} else if (newDataKey.includes('multi3') && key === 'multi') {
|
|
433
|
+
newDataKey = _.without(newDataKey, 'multi3')
|
|
434
|
+
}
|
|
435
|
+
|
|
430
436
|
newDataKey = _.sortBy(newDataKey, [
|
|
437
|
+
o => o === 'multi3',
|
|
431
438
|
o => o === 'multi',
|
|
432
439
|
o => o === 'category',
|
|
433
440
|
o => o === 'orders'
|
|
@@ -126,9 +126,10 @@ class EditorTitle extends React.Component {
|
|
|
126
126
|
|
|
127
127
|
EditorTitle.propTypes = {
|
|
128
128
|
onSave: PropTypes.func.isRequired,
|
|
129
|
-
isPurchase: PropTypes.bool
|
|
129
|
+
isPurchase: PropTypes.bool,
|
|
130
|
+
editStore: PropTypes.object
|
|
130
131
|
}
|
|
131
|
-
EditorTitle.
|
|
132
|
+
EditorTitle.defaultProps = {
|
|
132
133
|
isPurchase: false
|
|
133
134
|
}
|
|
134
135
|
|
|
@@ -8,21 +8,21 @@ const withShadowDom = WrapCom => {
|
|
|
8
8
|
return class extends React.Component {
|
|
9
9
|
ref = React.createRef()
|
|
10
10
|
|
|
11
|
-
componentDidMount
|
|
11
|
+
componentDidMount() {
|
|
12
12
|
const shadowRoot = this.ref.current.attachShadow({ mode: 'open' })
|
|
13
13
|
// 在window下挂 shadow root
|
|
14
14
|
window.shadowRoot = shadowRoot
|
|
15
|
-
ReactDOM.render(<WrapCom {...this.props}/>, shadowRoot)
|
|
15
|
+
ReactDOM.render(<WrapCom {...this.props} />, shadowRoot)
|
|
16
16
|
insertCSS(getPrinterCSS() + getEditorCSS(), shadowRoot)
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
componentWillUnmount
|
|
19
|
+
componentWillUnmount() {
|
|
20
20
|
// 移除示例,不然很多意想不到的事情发生
|
|
21
21
|
ReactDOM.unmountComponentAtNode(window.shadowRoot)
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
render
|
|
25
|
-
return <div id='shadowroot' ref={this.ref}/>
|
|
24
|
+
render() {
|
|
25
|
+
return <div id='shadowroot' ref={this.ref} />
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -4,29 +4,65 @@ import { getStyleWithDiff } from '../util'
|
|
|
4
4
|
|
|
5
5
|
const withStore = store => WrapComponent =>
|
|
6
6
|
class extends React.Component {
|
|
7
|
-
constructor
|
|
7
|
+
constructor(props) {
|
|
8
8
|
super(props)
|
|
9
9
|
this.store = store
|
|
10
10
|
this.store.init(props.config)
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
componentDidMount
|
|
14
|
-
window.document.addEventListener(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
window.document.addEventListener(
|
|
19
|
-
|
|
13
|
+
componentDidMount() {
|
|
14
|
+
window.document.addEventListener(
|
|
15
|
+
'gm-printer-select',
|
|
16
|
+
this.handlePrinterSelect
|
|
17
|
+
)
|
|
18
|
+
window.document.addEventListener(
|
|
19
|
+
'gm-printer-select-region',
|
|
20
|
+
this.handleSelectedRegion
|
|
21
|
+
)
|
|
22
|
+
window.document.addEventListener(
|
|
23
|
+
'gm-printer-panel-style-set',
|
|
24
|
+
this.handlePrinterPanelStyleSet
|
|
25
|
+
)
|
|
26
|
+
window.document.addEventListener(
|
|
27
|
+
'gm-printer-block-style-set',
|
|
28
|
+
this.handlePrinterBlockStyleSet
|
|
29
|
+
)
|
|
30
|
+
window.document.addEventListener(
|
|
31
|
+
'gm-printer-block-text-set',
|
|
32
|
+
this.handlePrinterBlockTextSet
|
|
33
|
+
)
|
|
34
|
+
window.document.addEventListener(
|
|
35
|
+
'gm-printer-table-drag',
|
|
36
|
+
this.handlePrinterTableDrag
|
|
37
|
+
)
|
|
20
38
|
window.document.addEventListener('keydown', this.handleKeyDown)
|
|
21
39
|
}
|
|
22
40
|
|
|
23
|
-
componentWillUnmount
|
|
24
|
-
window.document.removeEventListener(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
window.document.removeEventListener(
|
|
29
|
-
|
|
41
|
+
componentWillUnmount() {
|
|
42
|
+
window.document.removeEventListener(
|
|
43
|
+
'gm-printer-select',
|
|
44
|
+
this.handlePrinterSelect
|
|
45
|
+
)
|
|
46
|
+
window.document.removeEventListener(
|
|
47
|
+
'gm-printer-select-region',
|
|
48
|
+
this.handleSelectedRegion
|
|
49
|
+
)
|
|
50
|
+
window.document.removeEventListener(
|
|
51
|
+
'gm-printer-panel-style-set',
|
|
52
|
+
this.handlePrinterPanelStyleSet
|
|
53
|
+
)
|
|
54
|
+
window.document.removeEventListener(
|
|
55
|
+
'gm-printer-block-style-set',
|
|
56
|
+
this.handlePrinterBlockStyleSet
|
|
57
|
+
)
|
|
58
|
+
window.document.removeEventListener(
|
|
59
|
+
'gm-printer-block-text-set',
|
|
60
|
+
this.handlePrinterBlockTextSet
|
|
61
|
+
)
|
|
62
|
+
window.document.removeEventListener(
|
|
63
|
+
'gm-printer-table-drag',
|
|
64
|
+
this.handlePrinterTableDrag
|
|
65
|
+
)
|
|
30
66
|
window.document.removeEventListener('keydown', this.handleKeyDown)
|
|
31
67
|
}
|
|
32
68
|
|
|
@@ -35,31 +71,31 @@ const withStore = store => WrapComponent =>
|
|
|
35
71
|
this.store.setSelectedRegion(selected)
|
|
36
72
|
}
|
|
37
73
|
|
|
38
|
-
handlePrinterSelect =
|
|
74
|
+
handlePrinterSelect = e => {
|
|
39
75
|
const { selected } = e.detail
|
|
40
76
|
this.store.setSelected(selected)
|
|
41
77
|
}
|
|
42
78
|
|
|
43
|
-
handlePrinterPanelStyleSet =
|
|
79
|
+
handlePrinterPanelStyleSet = e => {
|
|
44
80
|
const { name, style } = e.detail
|
|
45
81
|
this.store.setConfigPanelStyle(name, style)
|
|
46
82
|
}
|
|
47
83
|
|
|
48
|
-
handlePrinterBlockStyleSet =
|
|
84
|
+
handlePrinterBlockStyleSet = e => {
|
|
49
85
|
const { style } = e.detail
|
|
50
86
|
this.store.setConfigBlockBy('style', style)
|
|
51
87
|
}
|
|
52
88
|
|
|
53
|
-
handlePrinterBlockTextSet =
|
|
89
|
+
handlePrinterBlockTextSet = e => {
|
|
54
90
|
const { text } = e.detail
|
|
55
91
|
this.store.setConfigBlockBy('text', text)
|
|
56
92
|
}
|
|
57
93
|
|
|
58
|
-
handlePrinterTableDrag =
|
|
94
|
+
handlePrinterTableDrag = e => {
|
|
59
95
|
this.store.exchangeTableColumn(e.detail.target, e.detail.source)
|
|
60
96
|
}
|
|
61
97
|
|
|
62
|
-
handleKeyDown =
|
|
98
|
+
handleKeyDown = e => {
|
|
63
99
|
if (e.target !== window.document.body) {
|
|
64
100
|
return
|
|
65
101
|
}
|
|
@@ -81,7 +117,11 @@ const withStore = store => WrapComponent =>
|
|
|
81
117
|
diffY += 1
|
|
82
118
|
}
|
|
83
119
|
|
|
84
|
-
const newStyle = getStyleWithDiff(
|
|
120
|
+
const newStyle = getStyleWithDiff(
|
|
121
|
+
this.store.computedSelectedInfo.style,
|
|
122
|
+
diffX,
|
|
123
|
+
diffY
|
|
124
|
+
)
|
|
85
125
|
|
|
86
126
|
this.store.setConfigBlockBy('style', newStyle)
|
|
87
127
|
} else if (this.store.computedIsSelectTable) {
|
|
@@ -100,13 +140,12 @@ const withStore = store => WrapComponent =>
|
|
|
100
140
|
}
|
|
101
141
|
}
|
|
102
142
|
|
|
103
|
-
render
|
|
143
|
+
render() {
|
|
104
144
|
return (
|
|
105
145
|
<Provider editStore={this.store} mockData={this.props.mockData}>
|
|
106
|
-
<WrapComponent {...this.props}/>
|
|
146
|
+
<WrapComponent {...this.props} />
|
|
107
147
|
</Provider>
|
|
108
148
|
)
|
|
109
149
|
}
|
|
110
150
|
}
|
|
111
|
-
|
|
112
151
|
export default withStore
|
package/src/config.js
CHANGED
|
@@ -4,7 +4,7 @@ import CommonContextMenu from '../common/common_context_menu'
|
|
|
4
4
|
import { inject, observer } from 'mobx-react'
|
|
5
5
|
import _ from 'lodash'
|
|
6
6
|
import { Printer } from '../printer'
|
|
7
|
-
import
|
|
7
|
+
import PropTypes from 'prop-types'
|
|
8
8
|
|
|
9
9
|
const blockTypeList = [
|
|
10
10
|
{ value: '', text: i18next.t('插入文本') },
|
|
@@ -62,6 +62,7 @@ class ContextMenu extends React.Component {
|
|
|
62
62
|
const keyArr = dataKey.split('_')
|
|
63
63
|
|
|
64
64
|
const isMultiActive = keyArr.includes('multi')
|
|
65
|
+
const isThreeActive = keyArr.includes('multi3')
|
|
65
66
|
const isCategoryActive = keyArr.includes('category')
|
|
66
67
|
const isSubtotalActive = subtotal.show
|
|
67
68
|
|
|
@@ -73,6 +74,12 @@ class ContextMenu extends React.Component {
|
|
|
73
74
|
>
|
|
74
75
|
{i18next.t('双栏商品')}
|
|
75
76
|
</div>
|
|
77
|
+
<div
|
|
78
|
+
onClick={this.handleChangeTableDataKey.bind(this, 'multi3', name)}
|
|
79
|
+
className={isThreeActive ? 'active' : ''}
|
|
80
|
+
>
|
|
81
|
+
{i18next.t('三栏商品')}
|
|
82
|
+
</div>
|
|
76
83
|
<div
|
|
77
84
|
onClick={this.handleChangeTableDataKey.bind(this, 'category', name)}
|
|
78
85
|
className={isCategoryActive ? 'active' : ''}
|
|
@@ -107,5 +114,8 @@ class ContextMenu extends React.Component {
|
|
|
107
114
|
)
|
|
108
115
|
}
|
|
109
116
|
}
|
|
110
|
-
|
|
117
|
+
ContextMenu.propTypes = {
|
|
118
|
+
editStore: PropTypes.object.isRequired,
|
|
119
|
+
mockData: PropTypes.object.isRequired
|
|
120
|
+
}
|
|
111
121
|
export default ContextMenu
|
|
@@ -4,6 +4,7 @@ import CommonContextMenu from '../common/common_context_menu'
|
|
|
4
4
|
import { inject, observer } from 'mobx-react'
|
|
5
5
|
import _ from 'lodash'
|
|
6
6
|
import { Printer } from '../printer'
|
|
7
|
+
import PropTypes from 'prop-types'
|
|
7
8
|
|
|
8
9
|
const blockTypeList = [
|
|
9
10
|
{ value: '', text: i18next.t('插入文本') },
|
|
@@ -50,8 +51,8 @@ class ContextMenu extends React.Component {
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
const arr = name.split('.')
|
|
53
|
-
const {
|
|
54
|
-
const keyArr = dataKey.split('_')
|
|
54
|
+
const { subtotal } = this.props.editStore.config.contents[arr[2]]
|
|
55
|
+
// const keyArr = dataKey.split('_')
|
|
55
56
|
|
|
56
57
|
// const isMultiActive = keyArr.includes('multi')
|
|
57
58
|
// const isCategoryActive = keyArr.includes('category')
|
|
@@ -99,5 +100,8 @@ class ContextMenu extends React.Component {
|
|
|
99
100
|
)
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
|
|
103
|
+
ContextMenu.propTypes = {
|
|
104
|
+
editStore: PropTypes.object.isRequired,
|
|
105
|
+
mockData: PropTypes.object.isRequired
|
|
106
|
+
}
|
|
103
107
|
export default ContextMenu
|
|
@@ -3,6 +3,7 @@ import React from 'react'
|
|
|
3
3
|
import CommonContextMenu from '../common/common_context_menu'
|
|
4
4
|
import { inject, observer } from 'mobx-react'
|
|
5
5
|
import { Printer } from '../printer'
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
6
7
|
import _ from 'lodash'
|
|
7
8
|
|
|
8
9
|
const blockTypeList = [
|
|
@@ -84,4 +85,8 @@ class ContextMenu extends React.Component {
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
|
|
88
|
+
ContextMenu.propTypes = {
|
|
89
|
+
editStore: PropTypes.object.isRequired,
|
|
90
|
+
mockData: PropTypes.object.isRequired
|
|
91
|
+
}
|
|
87
92
|
export default ContextMenu
|
|
@@ -119,6 +119,12 @@ class TableDetailEditor extends React.Component {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
TableDetailEditor.propTypes = {
|
|
123
|
+
addFields: PropTypes.object.isRequired,
|
|
124
|
+
editStore: PropTypes.object,
|
|
125
|
+
config: PropTypes.object
|
|
126
|
+
}
|
|
127
|
+
|
|
122
128
|
@inject('editStore')
|
|
123
129
|
@observer
|
|
124
130
|
class EditorSpecialTable extends React.Component {
|
|
@@ -144,7 +150,8 @@ class EditorSpecialTable extends React.Component {
|
|
|
144
150
|
}
|
|
145
151
|
|
|
146
152
|
EditorSpecialTable.propTypes = {
|
|
147
|
-
addFields: PropTypes.object.isRequired
|
|
153
|
+
addFields: PropTypes.object.isRequired,
|
|
154
|
+
editStore: PropTypes.object
|
|
148
155
|
}
|
|
149
156
|
|
|
150
157
|
export default EditorSpecialTable
|
|
@@ -4,6 +4,7 @@ import _ from 'lodash'
|
|
|
4
4
|
import CommonContextMenu from '../common/common_context_menu'
|
|
5
5
|
import { inject, observer } from 'mobx-react'
|
|
6
6
|
import { Printer } from '../printer'
|
|
7
|
+
import PropTypes from 'prop-types'
|
|
7
8
|
import { hasSubtotalBtnTableDataKeySet } from './editor'
|
|
8
9
|
|
|
9
10
|
const blockTypeList = [
|
|
@@ -101,5 +102,8 @@ class ContextMenu extends React.Component {
|
|
|
101
102
|
)
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
|
-
|
|
105
|
+
ContextMenu.propTypes = {
|
|
106
|
+
editStore: PropTypes.object.isRequired,
|
|
107
|
+
mockData: PropTypes.object.isRequired
|
|
108
|
+
}
|
|
105
109
|
export default ContextMenu
|
|
@@ -4,6 +4,7 @@ import CommonContextMenu from '../common/common_context_menu'
|
|
|
4
4
|
import { inject, observer } from 'mobx-react'
|
|
5
5
|
import { Printer } from '../printer'
|
|
6
6
|
import _ from 'lodash'
|
|
7
|
+
import PropTypes from 'prop-types'
|
|
7
8
|
|
|
8
9
|
const blockTypeList = [
|
|
9
10
|
{ value: '', text: i18next.t('插入文本') },
|
|
@@ -17,13 +18,13 @@ const blockTypeList = [
|
|
|
17
18
|
}))
|
|
18
19
|
@observer
|
|
19
20
|
class ContextMenu extends React.Component {
|
|
20
|
-
handleSubtotal =
|
|
21
|
+
handleSubtotal = name => {
|
|
21
22
|
const { editStore } = this.props
|
|
22
23
|
|
|
23
24
|
editStore.setSubtotalShow(name)
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
hasSubtotalBtn =
|
|
27
|
+
hasSubtotalBtn = name => {
|
|
27
28
|
if (!name) return false
|
|
28
29
|
|
|
29
30
|
const arr = name.split('.')
|
|
@@ -34,7 +35,7 @@ class ContextMenu extends React.Component {
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
renderOrderActionBtn =
|
|
38
|
+
renderOrderActionBtn = name => {
|
|
38
39
|
if (!this.hasSubtotalBtn(name)) {
|
|
39
40
|
return null
|
|
40
41
|
}
|
|
@@ -45,18 +46,24 @@ class ContextMenu extends React.Component {
|
|
|
45
46
|
const isSubtotalActive = subtotal.show
|
|
46
47
|
|
|
47
48
|
return (
|
|
48
|
-
|
|
49
|
-
<div
|
|
50
|
-
|
|
49
|
+
<>
|
|
50
|
+
<div
|
|
51
|
+
onClick={this.handleSubtotal.bind(this, name)}
|
|
52
|
+
className={isSubtotalActive ? 'active' : ''}
|
|
53
|
+
>
|
|
54
|
+
{i18next.t('每页合计')}
|
|
51
55
|
</div>
|
|
52
|
-
|
|
56
|
+
</>
|
|
53
57
|
)
|
|
54
58
|
}
|
|
55
59
|
|
|
56
|
-
render
|
|
60
|
+
render() {
|
|
57
61
|
const { editStore, mockData } = this.props
|
|
58
62
|
return (
|
|
59
|
-
<CommonContextMenu
|
|
63
|
+
<CommonContextMenu
|
|
64
|
+
renderTableAction={this.renderOrderActionBtn}
|
|
65
|
+
insertBlockList={blockTypeList}
|
|
66
|
+
>
|
|
60
67
|
<Printer
|
|
61
68
|
key={editStore.computedPrinterKey}
|
|
62
69
|
selected={editStore.selected}
|
|
@@ -69,4 +76,8 @@ class ContextMenu extends React.Component {
|
|
|
69
76
|
}
|
|
70
77
|
}
|
|
71
78
|
|
|
79
|
+
ContextMenu.propTypes = {
|
|
80
|
+
editStore: PropTypes.object.isRequired,
|
|
81
|
+
mockData: PropTypes.object.isRequired
|
|
82
|
+
}
|
|
72
83
|
export default ContextMenu
|
|
@@ -3,6 +3,7 @@ import React from 'react'
|
|
|
3
3
|
import CommonContextMenu from '../common/common_context_menu'
|
|
4
4
|
import { inject, observer } from 'mobx-react'
|
|
5
5
|
import { Printer } from '../printer'
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
6
7
|
|
|
7
8
|
const blockTypeList = [
|
|
8
9
|
{ value: '', text: i18next.t('插入文本') },
|
|
@@ -16,7 +17,7 @@ const blockTypeList = [
|
|
|
16
17
|
}))
|
|
17
18
|
@observer
|
|
18
19
|
class ContextMenu extends React.Component {
|
|
19
|
-
render
|
|
20
|
+
render() {
|
|
20
21
|
const { editStore, mockData } = this.props
|
|
21
22
|
return (
|
|
22
23
|
<CommonContextMenu insertBlockList={blockTypeList}>
|
|
@@ -31,5 +32,8 @@ class ContextMenu extends React.Component {
|
|
|
31
32
|
)
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
+
ContextMenu.propTypes = {
|
|
36
|
+
editStore: PropTypes.object.isRequired,
|
|
37
|
+
mockData: PropTypes.object.isRequired
|
|
38
|
+
}
|
|
35
39
|
export default ContextMenu
|
|
@@ -3,6 +3,7 @@ import React from 'react'
|
|
|
3
3
|
import CommonContextMenu from '../common/common_context_menu'
|
|
4
4
|
import { inject, observer } from 'mobx-react'
|
|
5
5
|
import { Printer } from '../printer'
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
6
7
|
|
|
7
8
|
const blockTypeList = [
|
|
8
9
|
{ value: '', text: i18next.t('插入文本') },
|
|
@@ -32,7 +33,7 @@ class ContextMenu extends React.Component {
|
|
|
32
33
|
const isMultiActive = keyArr.includes('multi')
|
|
33
34
|
|
|
34
35
|
return (
|
|
35
|
-
|
|
36
|
+
<>
|
|
36
37
|
<div
|
|
37
38
|
onClick={this.handleChangeTableDataKey.bind(this, 'multi', name)}
|
|
38
39
|
className={isMultiActive ? 'active' : ''}
|
|
@@ -51,7 +52,7 @@ class ContextMenu extends React.Component {
|
|
|
51
52
|
>
|
|
52
53
|
{i18next.t('入库金额小计')}
|
|
53
54
|
</div>
|
|
54
|
-
|
|
55
|
+
</>
|
|
55
56
|
)
|
|
56
57
|
}
|
|
57
58
|
|
|
@@ -73,5 +74,8 @@ class ContextMenu extends React.Component {
|
|
|
73
74
|
)
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
|
|
77
|
+
ContextMenu.propTypes = {
|
|
78
|
+
editStore: PropTypes.object.isRequired,
|
|
79
|
+
mockData: PropTypes.object.isRequired
|
|
80
|
+
}
|
|
77
81
|
export default ContextMenu
|