gm-printer-label 3.2.0 → 3.2.1-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/.github/workflows/release.yml +46 -0
- package/package.json +9 -6
- package/src/common/editor_compoents/edit.js +3 -0
- package/src/common/editor_compoents/edit_modify_filed.js +7 -0
- package/src/common/editor_compoents/index.js +1 -1
- package/src/common/editor_compoents/store.js +13 -1
- package/src/common/editor_compoents/{style.lesss → style.less} +23 -2
- package/src/printer/block.js +40 -1
- package/src/printer/index.js +2 -2
- package/src/printer/printer.js +1 -0
- /package/src/printer/{normalize.csss → normalize.css} +0 -0
- /package/src/printer/{style.lesss → style.less} +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
permissions:
|
|
4
|
+
contents: write
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
tags:
|
|
9
|
+
- 'v*'
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
release:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v3
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- name: Set node
|
|
20
|
+
uses: actions/setup-node@v3
|
|
21
|
+
with:
|
|
22
|
+
node-version: 16.x
|
|
23
|
+
registry-url: 'https://registry.npmjs.org'
|
|
24
|
+
|
|
25
|
+
- name: ChangeLog
|
|
26
|
+
run: npx changelogithub
|
|
27
|
+
env:
|
|
28
|
+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
29
|
+
|
|
30
|
+
- name: Setup
|
|
31
|
+
run: npm i -g @antfu/ni
|
|
32
|
+
|
|
33
|
+
- name: Install
|
|
34
|
+
run: nci
|
|
35
|
+
|
|
36
|
+
- name: Release
|
|
37
|
+
run: |
|
|
38
|
+
if [[ ${{ github.ref }} == *refs/tags/*-beta* ]]; then
|
|
39
|
+
npm publish --tag beta
|
|
40
|
+
elif [[ ${{ github.ref }} == *refs/tags/*-alpha* ]]; then
|
|
41
|
+
npm publish --tag alpha
|
|
42
|
+
else
|
|
43
|
+
npm publish
|
|
44
|
+
fi
|
|
45
|
+
env:
|
|
46
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-printer-label",
|
|
3
|
-
"version": "3.2.0",
|
|
3
|
+
"version": "3.2.1-beta.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"start": "webpack-dev-server",
|
|
9
9
|
"publish-latest": "npm publish --force-publish --registry https://registry.npmjs.org/",
|
|
10
10
|
"publish-beta": "npm publish --force-publish --dist-tag beta --preid beta --registry https://registry.npmjs.org/",
|
|
11
|
-
"publish-alpha": "npm publish --force-publish --dist-tag alpha --preid alpha --registry https://registry.npmjs.org/"
|
|
11
|
+
"publish-alpha": "npm publish --force-publish --dist-tag alpha --preid alpha --registry https://registry.npmjs.org/",
|
|
12
|
+
"release": "bumpp"
|
|
12
13
|
},
|
|
13
14
|
"lint-staged": {
|
|
14
15
|
"./src/**/*.js": [
|
|
@@ -31,11 +32,12 @@
|
|
|
31
32
|
"classnames": "^2.2.5",
|
|
32
33
|
"lodash": "^4.17.10",
|
|
33
34
|
"moment": "^2.22.2",
|
|
35
|
+
"qrcode.react": "^0.9.2",
|
|
34
36
|
"react": "^16.8.5",
|
|
35
|
-
"react-dom": "^16.8.5"
|
|
36
|
-
"qrcode.react": "^0.9.2"
|
|
37
|
+
"react-dom": "^16.8.5"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
40
|
+
"bumpp": "^9.1.0",
|
|
39
41
|
"clipboard": "^2.0.1",
|
|
40
42
|
"gm-svg": "^0.3.10",
|
|
41
43
|
"gm-util": "^5.10.4",
|
|
@@ -71,6 +73,7 @@
|
|
|
71
73
|
"gm-util": "^5.12.3",
|
|
72
74
|
"gm_static_storage": "^1.2.0",
|
|
73
75
|
"husky": "^0.14.3",
|
|
76
|
+
"jsbarcode": "^3.11.0",
|
|
74
77
|
"less": "^3.0.4",
|
|
75
78
|
"less-loader": "^4.1.0",
|
|
76
79
|
"lint-staged": "^7.2.2",
|
|
@@ -83,6 +86,7 @@
|
|
|
83
86
|
"precss": "^3.1.2",
|
|
84
87
|
"prop-types": "^15.6.1",
|
|
85
88
|
"query-string": "^6.2.0",
|
|
89
|
+
"raw-loader": "^4.0.2",
|
|
86
90
|
"react": "^16.8.5",
|
|
87
91
|
"react-dom": "^16.8.5",
|
|
88
92
|
"react-hot-loader": "^3.1.3",
|
|
@@ -91,7 +95,6 @@
|
|
|
91
95
|
"url-loader": "^1.0.1",
|
|
92
96
|
"webpack": "^4.10.1",
|
|
93
97
|
"webpack-cli": "^3.3.0",
|
|
94
|
-
"webpack-dev-server": "^3.1.4"
|
|
95
|
-
"jsbarcode": "^3.11.0"
|
|
98
|
+
"webpack-dev-server": "^3.1.4"
|
|
96
99
|
}
|
|
97
100
|
}
|
|
@@ -23,6 +23,8 @@ class Edit extends React.Component {
|
|
|
23
23
|
|
|
24
24
|
render () {
|
|
25
25
|
const {
|
|
26
|
+
// 用来区分内标和分拣
|
|
27
|
+
type,
|
|
26
28
|
data,
|
|
27
29
|
initDefaultTemp,
|
|
28
30
|
defaultTempList,
|
|
@@ -74,6 +76,7 @@ class Edit extends React.Component {
|
|
|
74
76
|
>
|
|
75
77
|
<ContextMenu>
|
|
76
78
|
<Printer
|
|
79
|
+
type={type}
|
|
77
80
|
selected={editStore.selected}
|
|
78
81
|
config={editStore.config}
|
|
79
82
|
data={data}
|
|
@@ -102,6 +102,13 @@ class EditModifyFiled extends React.Component {
|
|
|
102
102
|
onChange={this.handleChangeBlock.bind(this, 'style')}
|
|
103
103
|
/>
|
|
104
104
|
)}
|
|
105
|
+
{type === 'new_production_barcode' && (
|
|
106
|
+
<Size
|
|
107
|
+
withoutWidth
|
|
108
|
+
style={style}
|
|
109
|
+
onChange={this.handleChangeBlock.bind(this, 'style')}
|
|
110
|
+
/>
|
|
111
|
+
)}
|
|
105
112
|
{type === 'diyqrcode' && (
|
|
106
113
|
<div>
|
|
107
114
|
<Size
|
|
@@ -224,6 +224,19 @@ class EditStore {
|
|
|
224
224
|
}
|
|
225
225
|
})
|
|
226
226
|
break
|
|
227
|
+
case 'new_production_barcode':
|
|
228
|
+
this.config.blocks.push({
|
|
229
|
+
type,
|
|
230
|
+
new_production_barcode: i18next.t('{{新商品条码}}'),
|
|
231
|
+
style: {
|
|
232
|
+
position: 'absolute',
|
|
233
|
+
left: '0px',
|
|
234
|
+
top: '0px',
|
|
235
|
+
height: '30px',
|
|
236
|
+
width: '165px'
|
|
237
|
+
}
|
|
238
|
+
})
|
|
239
|
+
break
|
|
227
240
|
case 'rack_barcode':
|
|
228
241
|
this.config.blocks.push({
|
|
229
242
|
type,
|
|
@@ -238,7 +251,6 @@ class EditStore {
|
|
|
238
251
|
})
|
|
239
252
|
break
|
|
240
253
|
case 'delivery_qrcode':
|
|
241
|
-
|
|
242
254
|
this.config.blocks.push({
|
|
243
255
|
type,
|
|
244
256
|
delivery_qrcode: i18next.t('{{配送单二维码}}'),
|
|
@@ -273,12 +273,30 @@
|
|
|
273
273
|
div[data-productionbarcode] {
|
|
274
274
|
outline: 1px solid red;
|
|
275
275
|
|
|
276
|
+
&::before {
|
|
277
|
+
content: attr(data-title);
|
|
278
|
+
position: absolute;
|
|
279
|
+
font-style: italic;
|
|
280
|
+
left: 0;
|
|
281
|
+
right: 0;
|
|
282
|
+
top: calc(50% - 0.5em);
|
|
283
|
+
bottom: 0;
|
|
284
|
+
text-align: center;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
div[data-newproductionbarcode] {
|
|
289
|
+
outline: 1px solid red;
|
|
290
|
+
|
|
276
291
|
&::before {
|
|
277
292
|
content: '商品条码';
|
|
278
293
|
position: absolute;
|
|
279
294
|
font-style: italic;
|
|
280
|
-
left:
|
|
295
|
+
left: 0;
|
|
296
|
+
right: 0;
|
|
281
297
|
top: calc(50% - 0.5em);
|
|
298
|
+
bottom: 0;
|
|
299
|
+
text-align: center;
|
|
282
300
|
}
|
|
283
301
|
}
|
|
284
302
|
|
|
@@ -289,8 +307,11 @@
|
|
|
289
307
|
content: '商品溯源二维码';
|
|
290
308
|
position: absolute;
|
|
291
309
|
font-style: italic;
|
|
292
|
-
left:
|
|
310
|
+
left: 0;
|
|
311
|
+
right: 0;
|
|
293
312
|
top: calc(50% - 0.5em);
|
|
313
|
+
bottom: 0;
|
|
314
|
+
text-align: center;
|
|
294
315
|
}
|
|
295
316
|
}
|
|
296
317
|
|
package/src/printer/block.js
CHANGED
|
@@ -130,6 +130,7 @@ class Block extends React.Component {
|
|
|
130
130
|
fieldType,
|
|
131
131
|
fieldKey,
|
|
132
132
|
production_barcode,
|
|
133
|
+
new_production_barcode,
|
|
133
134
|
merchandise_trace_qrcode,
|
|
134
135
|
rack_barcode,
|
|
135
136
|
delivery_qrcode
|
|
@@ -287,8 +288,10 @@ class Block extends React.Component {
|
|
|
287
288
|
/>
|
|
288
289
|
) : (
|
|
289
290
|
<div
|
|
290
|
-
data-productionbarcode=
|
|
291
|
+
data-productionbarcode={template(production_barcode, data)}
|
|
291
292
|
data-name={index}
|
|
293
|
+
// 内标里叫做"PDA出入库条码"
|
|
294
|
+
data-title={this.props.type === 'inner_label' ? 'PDA出入库条码' : '商品条码'}
|
|
292
295
|
style={{ width: '100%', height: '100%' }}
|
|
293
296
|
>
|
|
294
297
|
<svg
|
|
@@ -302,6 +305,42 @@ class Block extends React.Component {
|
|
|
302
305
|
/>
|
|
303
306
|
</div>
|
|
304
307
|
)
|
|
308
|
+
} else if (type === 'new_production_barcode') {
|
|
309
|
+
// 判断是否是69码
|
|
310
|
+
const reg = /^69[0-9]{11}$/
|
|
311
|
+
const is69 = reg.test(template(new_production_barcode, data))
|
|
312
|
+
content = isStation ? (
|
|
313
|
+
<BarCode
|
|
314
|
+
data-newproductionbarcode={template(new_production_barcode, data)}
|
|
315
|
+
value={template(new_production_barcode, data)}
|
|
316
|
+
textMargin={0}
|
|
317
|
+
margin={0}
|
|
318
|
+
height={parseInt(style.height) - 14}
|
|
319
|
+
width={2}
|
|
320
|
+
displayValue={is69}
|
|
321
|
+
format={is69 ? 'EAN13' : undefined}
|
|
322
|
+
dataName={new_production_barcode}
|
|
323
|
+
background='transparent'
|
|
324
|
+
/>
|
|
325
|
+
) : (
|
|
326
|
+
<div
|
|
327
|
+
data-newproductionbarcode={template(new_production_barcode, data)}
|
|
328
|
+
data-name={index}
|
|
329
|
+
style={{ width: '100%', height: '100%' }}
|
|
330
|
+
>
|
|
331
|
+
<svg
|
|
332
|
+
style={{ height: '100%', width: '100%' }}
|
|
333
|
+
data-newproductionbarcode={template(new_production_barcode, data)}
|
|
334
|
+
// 需要减去14才能打印出正确高度
|
|
335
|
+
data-doublepage={doublePage}
|
|
336
|
+
data-height={parseInt(style.height) - 14}
|
|
337
|
+
data-format={is69 ? 'EAN13' : undefined}
|
|
338
|
+
displayValue={is69}
|
|
339
|
+
data-name={index}
|
|
340
|
+
id={`newproduction${template(new_production_barcode, data)}`}
|
|
341
|
+
/>
|
|
342
|
+
</div>
|
|
343
|
+
)
|
|
305
344
|
} else if (type === 'package_id_qrcode') {
|
|
306
345
|
content = isStation ? (
|
|
307
346
|
<QrCode
|
package/src/printer/index.js
CHANGED
|
@@ -7,9 +7,9 @@ import ReactDOM from 'react-dom'
|
|
|
7
7
|
import BatchPrinter from './batch_printer'
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line
|
|
10
|
-
import normalizeCSS from '
|
|
10
|
+
import normalizeCSS from '!!raw-loader!less-loader!./normalize.css'
|
|
11
11
|
// eslint-disable-next-line
|
|
12
|
-
import printerCSS from '
|
|
12
|
+
import printerCSS from '!!raw-loader!less-loader!./style.less'
|
|
13
13
|
import { afterImgAndSvgLoaded } from '../util'
|
|
14
14
|
|
|
15
15
|
function getHtml (props) {
|
package/src/printer/printer.js
CHANGED
|
File without changes
|
|
File without changes
|