gm-printer-label 3.0.10-beta.0 → 3.0.11

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/xurora/Desktop/gm-printer-label/src/util.js":"1","/Users/xurora/Desktop/gm-printer-label/src/printer/block.js":"2","/Users/xurora/Desktop/gm-printer-label/src/common/editor_compoents/store.js":"3"},{"size":1935,"mtime":1655908329945,"results":"4","hashOfConfig":"5"},{"size":10382,"mtime":1655964450049,"results":"6","hashOfConfig":"5"},{"size":7160,"mtime":1655951736143,"results":"7","hashOfConfig":"5"},{"filePath":"8","messages":"9","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"10llghp",{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/xurora/Desktop/gm-printer-label/src/util.js",[],"/Users/xurora/Desktop/gm-printer-label/src/printer/block.js",[],"/Users/xurora/Desktop/gm-printer-label/src/common/editor_compoents/store.js",[]]
1
+ [{"/Volumes/gm-project/gm-printer-label/src/index.js":"1","/Volumes/gm-project/gm-printer-label/src/common/editor_compoents/edit_modify_filed.js":"2","/Volumes/gm-project/gm-printer-label/src/common/config.js":"3"},{"size":180,"mtime":1658462117054,"results":"4","hashOfConfig":"5"},{"size":4629,"mtime":1658462013375},{"size":1699,"mtime":1658461960259},{"filePath":"6","messages":"7","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"17s6x9q","/Volumes/gm-project/gm-printer-label/src/index.js",[]]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-printer-label",
3
- "version": "3.0.10-beta.0",
3
+ "version": "3.0.11",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -41,7 +41,37 @@ const borderStyleList = [
41
41
  { value: 'dotted', text: i18next.t('圆点') }
42
42
  ]
43
43
 
44
- export {
45
- borderStyleList,
46
- pageTypeMap
47
- }
44
+ const DiyTimeType = [
45
+ {
46
+ type: '',
47
+ text: '格式“2022-01-01 19:00:00”,输入“单据日期:{{单据日期}}”;',
48
+ format: 'YYYY-MM-DD HH:mm:ss'
49
+ },
50
+ {
51
+ type: '时分',
52
+ text: '格式“2022-01-01 19:00”,输入“单据日期:{{单据日期_时分}}”;',
53
+ format: 'YYYY-MM-DD HH:mm'
54
+ },
55
+ {
56
+ type: '日期',
57
+ text: '格式“2022-01-01”,输入“单据日期:{{单据日期_日期}}”;',
58
+ format: 'YYYY-MM-DD'
59
+ },
60
+ {
61
+ type: '无年份',
62
+ text: '格式“01-01 19:00:00”,输入“单据日期:{{单据日期_无年份}}”;',
63
+ format: 'MM-DD HH:mm:ss'
64
+ },
65
+ {
66
+ type: '日期_无年份',
67
+ text: '格式“01-01”,输入“单据日期:{{单据日期_日期_无年份}}";',
68
+ format: 'MM-DD'
69
+ },
70
+ {
71
+ type: '时间',
72
+ text: '格式“19:00:00",输入“单据日期:{{单据日期_时间}}";',
73
+ format: 'HH:mm:ss'
74
+ }
75
+ ]
76
+
77
+ export { DiyTimeType, borderStyleList, pageTypeMap }
@@ -14,6 +14,7 @@ import {
14
14
  } from './component'
15
15
  import i18next from '../../../locales'
16
16
  import _ from 'lodash'
17
+ import { DiyTimeType } from '../config'
17
18
 
18
19
  @inject('editStore')
19
20
  @observer
@@ -48,93 +49,115 @@ class EditModifyFiled extends React.Component {
48
49
  <React.Fragment>
49
50
  <Title title={i18next.t('编辑字段')}/>
50
51
  <Gap/>
51
- <Position style={style}
52
- onChange={this.handleChangeBlock.bind(this, 'style')}/>
52
+ <Position
53
+ style={style}
54
+ onChange={this.handleChangeBlock.bind(this, 'style')}
55
+ />
53
56
  <Gap/>
54
57
 
55
58
  {(!type || type === 'text') && (
56
59
  <div>
57
- <Fonter style={style}
58
- onChange={this.handleChangeBlock.bind(this, 'style')}/>
60
+ <Fonter
61
+ style={style}
62
+ onChange={this.handleChangeBlock.bind(this, 'style')}
63
+ />
59
64
  <Separator/>
60
- <TextAlign style={style}
61
- onChange={this.handleChangeBlock.bind(this, 'style')}/>
65
+ <TextAlign
66
+ style={style}
67
+ onChange={this.handleChangeBlock.bind(this, 'style')}
68
+ />
62
69
  <Gap/>
63
70
 
64
- <Textarea value={text} placeholder='请输入填充内容'
65
- onChange={this.handleChangeBlock.bind(this, 'text')}/>
71
+ <Textarea
72
+ value={text}
73
+ placeholder='请输入填充内容'
74
+ onChange={this.handleChangeBlock.bind(this, 'text')}
75
+ />
66
76
  </div>
67
77
  )}
68
- {type === 'line' && <Line style={style}
69
- onChange={this.handleChangeBlock.bind(this,
70
- 'style')}/>}
71
- {(type === 'qrcode' || type === 'order_qrcode' || type ===
72
- 'package_id_qrcode' || type === 'image') && (
78
+ {type === 'line' && (
79
+ <Line
80
+ style={style}
81
+ onChange={this.handleChangeBlock.bind(this, 'style')}
82
+ />
83
+ )}
84
+ {(type === 'qrcode' ||
85
+ type === 'order_qrcode' ||
86
+ type === 'package_id_qrcode' ||
87
+ type === 'image') && (
73
88
  <div>
74
- <Size style={style}
75
- onChange={this.handleChangeBlock.bind(this, 'style')}/>
89
+ <Size
90
+ style={style}
91
+ onChange={this.handleChangeBlock.bind(this, 'style')}
92
+ />
76
93
  </div>
77
94
  )}
78
95
  {type === 'diyqrcode' && (
79
96
  <div>
80
- <Size style={style}
81
- onChange={this.handleChangeBlock.bind(this, 'style')}/>
82
- <Textarea value={text} placeholder='请输入填充内容'
83
- onChange={this.handleChangeBlock.bind(this, 'text')}/>
97
+ <Size
98
+ style={style}
99
+ onChange={this.handleChangeBlock.bind(this, 'style')}
100
+ />
101
+ <Textarea
102
+ value={text}
103
+ placeholder='请输入填充内容'
104
+ onChange={this.handleChangeBlock.bind(this, 'text')}
105
+ />
84
106
  </div>
85
- )
86
- }
107
+ )}
87
108
  {type === 'barcode' && (
88
109
  <div>
89
- <Size style={style} withoutWidth
90
- onChange={this.handleChangeBlock.bind(this, 'style')}/>
110
+ <Size
111
+ style={style}
112
+ withoutWidth
113
+ onChange={this.handleChangeBlock.bind(this, 'style')}
114
+ />
91
115
  <div>
92
- <button onClick={this.handleRotateBarcode}>{i18next.t(
93
- '旋转')}</button>
116
+ <button onClick={this.handleRotateBarcode}>
117
+ {i18next.t('旋转')}
118
+ </button>
94
119
  </div>
95
120
  </div>
96
121
  )}
97
122
  {type === 'in_stock_barcode' && (
98
123
  <div>
99
- <Size style={style} withoutWidth
100
- onChange={this.handleChangeBlock.bind(this, 'style')}/>
124
+ <Size
125
+ style={style}
126
+ withoutWidth
127
+ onChange={this.handleChangeBlock.bind(this, 'style')}
128
+ />
101
129
  <div>
102
- <button onClick={this.handleRotateBarcode}>{i18next.t(
103
- '旋转')}</button>
130
+ <button onClick={this.handleRotateBarcode}>
131
+ {i18next.t('旋转')}
132
+ </button>
104
133
  </div>
105
134
  </div>
106
135
  )}
107
136
  {type === 'diycode' && (
108
137
  <div>
109
- <Size style={style} withoutWidth
110
- onChange={this.handleChangeBlock.bind(this, 'style')}/>
138
+ <Size
139
+ style={style}
140
+ withoutWidth
141
+ onChange={this.handleChangeBlock.bind(this, 'style')}
142
+ />
111
143
  <div>
112
- <button onClick={this.handleRotateBarcode}>{i18next.t(
113
- '旋转')}</button>
144
+ <button onClick={this.handleRotateBarcode}>
145
+ {i18next.t('旋转')}
146
+ </button>
114
147
  </div>
115
148
  </div>
116
149
  )}
117
- <TipInfo text={i18next.t('说明:请勿修改{}中的内容,避免出现数据异常')}/>
150
+ <TipInfo
151
+ text={i18next.t('说明:请勿修改{}中的内容,避免出现数据异常')}
152
+ />
118
153
  {editStore.computedIsTime && (
119
154
  <div>
120
155
  <TipInfo
121
156
  text={i18next.t('注:可通过修改“{{}}”中的内容更改时间格式。')}
122
157
  />
123
- <TipInfo
124
- text={i18next.t(
125
- '1. 格式“1970-01-01 19:00:00”,输入“时间: {{当前时间}}”;'
126
- )}
127
- />
128
- <TipInfo
129
- text={i18next.t(
130
- '2. 格式“1970-01-01”,输入“时间: {{当前时间_年月日}}”;'
131
- )}
132
- />
133
- <TipInfo
134
- text={i18next.t(
135
- '3. 格式“19:00:00",输入“时间: {{当前时间_时间}}";'
136
- )}
137
- />
158
+ {_.map(DiyTimeType, (v, k) => (
159
+ <TipInfo text={`${k + 1}。${v.text}`}/>
160
+ ))}
138
161
  </div>
139
162
  )}
140
163
  </React.Fragment>
@@ -268,9 +268,9 @@
268
268
  }
269
269
  }
270
270
 
271
- div[data-merchandise_trace_qrcode] {
271
+ div[data-traceqrcode] {
272
272
  outline: 1px solid red;
273
-
273
+
274
274
  &::before {
275
275
  content: '商品溯源二维码';
276
276
  position: absolute;
package/src/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ export { DiyTimeType } from './common/config'
2
+
1
3
  export * from './printer'
2
4
  export { setLocale } from '../locales'
3
5
 
@@ -108,7 +108,6 @@ class Block extends React.Component {
108
108
  isStation,
109
109
  ...rest
110
110
  } = this.props
111
- console.log('test', merchandise_trace_qrcode)
112
111
  const { isEdit } = this.state
113
112
  let content = null
114
113
  if (!type || type === 'text') {
@@ -159,7 +158,6 @@ class Block extends React.Component {
159
158
  />
160
159
  )
161
160
  } else if (type === 'merchandise_trace_qrcode') {
162
- console.log('template(merchandise_trace_qrcode, data)', merchandise_trace_qrcode, data, template(merchandise_trace_qrcode, data))
163
161
  content = isStation ? (
164
162
  <QrCode
165
163
  value={miniAppLink + template(merchandise_trace_qrcode, data)}
@@ -167,7 +165,7 @@ class Block extends React.Component {
167
165
  />
168
166
  ) : (
169
167
  <div
170
- data-merchandise_trace_qrcode={template(merchandise_trace_qrcode, data)}
168
+ data-traceqrcode={template(merchandise_trace_qrcode, data)}
171
169
  data-width={style.width}
172
170
  data-height={style.height}
173
171
  data-name={index}
package/src/util.js CHANGED
@@ -75,7 +75,7 @@ function afterImgAndSvgLoaded (callback, $printer) {
75
75
  timer = setTimeout(afterImgAndSvgLoaded.bind(this, callback, $printer), 300)
76
76
  }
77
77
  }
78
- const miniAppLink = 'https://q.guanmai.cn/trace#/commodity_arch'
78
+ const miniAppLink = 'https://miniapp.guanmai.cn/traceability/?id='
79
79
  export {
80
80
  pxAdd,
81
81
  getStyleWithDiff,