gm-printer-label 3.0.10 → 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 +1 -1
- package/package.json +1 -1
- package/src/common/config.js +34 -4
- package/src/common/editor_compoents/edit_modify_filed.js +72 -49
- package/src/index.js +2 -0
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/
|
|
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
package/src/common/config.js
CHANGED
|
@@ -41,7 +41,37 @@ const borderStyleList = [
|
|
|
41
41
|
{ value: 'dotted', text: i18next.t('圆点') }
|
|
42
42
|
]
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
|
52
|
-
|
|
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
|
|
58
|
-
|
|
60
|
+
<Fonter
|
|
61
|
+
style={style}
|
|
62
|
+
onChange={this.handleChangeBlock.bind(this, 'style')}
|
|
63
|
+
/>
|
|
59
64
|
<Separator/>
|
|
60
|
-
<TextAlign
|
|
61
|
-
|
|
65
|
+
<TextAlign
|
|
66
|
+
style={style}
|
|
67
|
+
onChange={this.handleChangeBlock.bind(this, 'style')}
|
|
68
|
+
/>
|
|
62
69
|
<Gap/>
|
|
63
70
|
|
|
64
|
-
<Textarea
|
|
65
|
-
|
|
71
|
+
<Textarea
|
|
72
|
+
value={text}
|
|
73
|
+
placeholder='请输入填充内容'
|
|
74
|
+
onChange={this.handleChangeBlock.bind(this, 'text')}
|
|
75
|
+
/>
|
|
66
76
|
</div>
|
|
67
77
|
)}
|
|
68
|
-
{type === 'line' &&
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
|
75
|
-
|
|
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
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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
|
|
90
|
-
|
|
110
|
+
<Size
|
|
111
|
+
style={style}
|
|
112
|
+
withoutWidth
|
|
113
|
+
onChange={this.handleChangeBlock.bind(this, 'style')}
|
|
114
|
+
/>
|
|
91
115
|
<div>
|
|
92
|
-
<button onClick={this.handleRotateBarcode}>
|
|
93
|
-
'旋转')}
|
|
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
|
|
100
|
-
|
|
124
|
+
<Size
|
|
125
|
+
style={style}
|
|
126
|
+
withoutWidth
|
|
127
|
+
onChange={this.handleChangeBlock.bind(this, 'style')}
|
|
128
|
+
/>
|
|
101
129
|
<div>
|
|
102
|
-
<button onClick={this.handleRotateBarcode}>
|
|
103
|
-
'旋转')}
|
|
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
|
|
110
|
-
|
|
138
|
+
<Size
|
|
139
|
+
style={style}
|
|
140
|
+
withoutWidth
|
|
141
|
+
onChange={this.handleChangeBlock.bind(this, 'style')}
|
|
142
|
+
/>
|
|
111
143
|
<div>
|
|
112
|
-
<button onClick={this.handleRotateBarcode}>
|
|
113
|
-
'旋转')}
|
|
144
|
+
<button onClick={this.handleRotateBarcode}>
|
|
145
|
+
{i18next.t('旋转')}
|
|
146
|
+
</button>
|
|
114
147
|
</div>
|
|
115
148
|
</div>
|
|
116
149
|
)}
|
|
117
|
-
<TipInfo
|
|
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
|
-
|
|
124
|
-
text={
|
|
125
|
-
|
|
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>
|