gm-printer 10.31.0 → 10.31.1
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/build/demo.js +1 -1
- package/package.json +1 -1
- package/src/printer/table_special_tr.js +16 -5
package/package.json
CHANGED
|
@@ -32,6 +32,13 @@ const SpecialTr = ({ data, config }) => {
|
|
|
32
32
|
compiled = () => template_text
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
const defaultFields = [
|
|
36
|
+
{
|
|
37
|
+
valueField: '下单金额'
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
const newFields = fields || defaultFields
|
|
41
|
+
|
|
35
42
|
switch (type) {
|
|
36
43
|
case 'flex':
|
|
37
44
|
// eslint-disable-next-line no-case-declarations
|
|
@@ -95,9 +102,13 @@ const SpecialTr = ({ data, config }) => {
|
|
|
95
102
|
throw Error('_special缺少text,请检查data_to_key处理table数据代码!')
|
|
96
103
|
|
|
97
104
|
if (isUpperLowerCaseSeparate) {
|
|
105
|
+
const UpperCaseBefore =
|
|
106
|
+
data[newFields[0].valueField]
|
|
107
|
+
?.upperLowerCaseSeparateAndUpperCaseBefore
|
|
108
|
+
|
|
98
109
|
const htmlStr = isUpperCaseBefore
|
|
99
|
-
?
|
|
100
|
-
: data[
|
|
110
|
+
? UpperCaseBefore
|
|
111
|
+
: data[newFields[0].valueField]?.upperLowerCaseSeparate
|
|
101
112
|
return (
|
|
102
113
|
<tr>
|
|
103
114
|
<td
|
|
@@ -119,12 +130,12 @@ const SpecialTr = ({ data, config }) => {
|
|
|
119
130
|
// eslint-disable-next-line no-case-declarations
|
|
120
131
|
const getHtml = () => {
|
|
121
132
|
if (isUpperCaseBefore) {
|
|
122
|
-
return data[
|
|
133
|
+
return data[newFields[0].valueField]?.upperCaseBefore
|
|
123
134
|
}
|
|
124
135
|
if (needUpperCase) {
|
|
125
|
-
return data[
|
|
136
|
+
return data[newFields[0].valueField]?.upperCaseText
|
|
126
137
|
}
|
|
127
|
-
return data[
|
|
138
|
+
return data[newFields[0]?.valueField]?.text || data.text
|
|
128
139
|
}
|
|
129
140
|
|
|
130
141
|
return (
|