gm-printer-label 3.0.8 → 3.0.9-beta.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 CHANGED
@@ -1 +1 @@
1
- [{"/Users/min/Documents/GMFE/gm-util/gm-printer-label/src/util.js":"1","/Users/min/Documents/GMFE/gm-util/gm-printer-label/src/common/editor_compoents/edit_select.js":"2","/Users/min/Documents/GMFE/gm-util/gm-printer-label/src/common/editor_compoents/edit.js":"3","/Users/min/Documents/GMFE/gm-util/gm-printer-label/src/common/editor_compoents/component.js":"4"},{"size":1365,"mtime":1635154061961,"results":"5","hashOfConfig":"6"},{"size":5505,"mtime":1635767717933,"results":"7","hashOfConfig":"6"},{"size":2694,"mtime":1635767728834,"results":"8","hashOfConfig":"6"},{"size":11621,"mtime":1635767876018,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"18d3ysg",{"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/min/Documents/GMFE/gm-util/gm-printer-label/src/util.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer-label/src/common/editor_compoents/edit_select.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer-label/src/common/editor_compoents/edit.js",[],"/Users/min/Documents/GMFE/gm-util/gm-printer-label/src/common/editor_compoents/component.js",[]]
1
+ [{"/Volumes/GM/gm-printer-label/src/printer/printer.js":"1","/Volumes/GM/gm-printer-label/src/common/config.js":"2"},{"size":1229,"mtime":1644819297912},{"size":1109,"mtime":1644819243904}]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-printer-label",
3
- "version": "3.0.8",
3
+ "version": "3.0.9-beta.0",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -32,6 +32,31 @@ const pageTypeMap = {
32
32
  '40X30': {
33
33
  width: '40mm',
34
34
  height: '28mm'
35
+ },
36
+ // 箱签
37
+ A4: {
38
+ width: '210mm',
39
+ height: '297mm'
40
+ },
41
+ A5: {
42
+ width: '148mm',
43
+ height: '210mm'
44
+ },
45
+ 'A4/2': {
46
+ width: '210mm',
47
+ height: '140mm'
48
+ },
49
+ 'A4/3': {
50
+ width: '210mm',
51
+ height: '93mm'
52
+ },
53
+ '241x280': {
54
+ width: '241mm',
55
+ height: '280mm'
56
+ },
57
+ '241x140': {
58
+ width: '241mm',
59
+ height: '140mm'
35
60
  }
36
61
  }
37
62
 
@@ -41,7 +66,4 @@ const borderStyleList = [
41
66
  { value: 'dotted', text: i18next.t('圆点') }
42
67
  ]
43
68
 
44
- export {
45
- borderStyleList,
46
- pageTypeMap
47
- }
69
+ export { borderStyleList, pageTypeMap }
@@ -11,12 +11,16 @@ class Printer extends React.Component {
11
11
  render () {
12
12
  const { config, selected, data } = this.props
13
13
  const { type, style, customizeWidth, customizeHeight } = config.page
14
+ const isDiy = type === '-1' || type === 'diy'
14
15
  return (
15
- <div className='gm-printer-label' style={{
16
- ...style,
17
- width: type === '-1' ? customizeWidth + 'mm' : pageTypeMap[type].width,
18
- height: type === '-1' ? customizeHeight + 'mm' : pageTypeMap[type].height
19
- }}>
16
+ <div
17
+ className='gm-printer-label'
18
+ style={{
19
+ ...style,
20
+ width: isDiy ? customizeWidth + 'mm' : pageTypeMap[type].width,
21
+ height: isDiy ? customizeHeight + 'mm' : pageTypeMap[type].height
22
+ }}
23
+ >
20
24
  <Page config={config.page}>
21
25
  {_.map(config.blocks, (block, i) => (
22
26
  <Block