gm-printer 10.42.4-beta.0 → 10.42.4-beta.2
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 +9 -9
- package/locales/en.json +3 -0
- package/locales/th.json +3 -0
- package/locales/zh-HK.json +3 -0
- package/package.json +1 -1
- package/src/common/common_context_menu.js +6 -4
- package/src/common/component.js +64 -8
- package/src/common/editor_edit_field.js +6 -1
- package/src/common/editor_sort_setting.js +2 -12
- package/src/common/editor_store.js +35 -33
- package/src/common/hoc_with_store.js +9 -0
- package/src/common/style.lesss +43 -0
- package/src/editor/editor.js +1 -1
- package/src/editor/store.js +13 -0
- package/src/editor_account/editor.js +1 -1
- package/src/finance_voucher/components/table_subtotal_tr.js +12 -18
- package/src/index.js +2 -0
- package/src/printer/block.js +154 -4
- package/src/printer/compute_pages.js +2 -1
- package/src/printer/multi_column.js +1 -1
- package/src/printer/page_summary.js +3 -1
- package/src/printer/printer.js +8 -1
- package/src/printer/store.js +129 -38
- package/src/printer/table_diy_overallOrder_tr.js +8 -15
- package/src/printer/table_diy_summary_tr.js +18 -35
- package/src/printer/table_subtotal_tr.js +13 -16
- package/src/util.js +20 -1
- package/yarn-error.log +372 -152
package/src/util.js
CHANGED
|
@@ -120,7 +120,23 @@ function getOverallOrderTrHeight(overallOrder) {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
// eslint-disable-next-line
|
|
123
|
+
// 成本权限脱敏值:后端对无成本权限用户的金额字段返回 '***'(商品维度混合脱敏)
|
|
124
|
+
const MASKED_VALUE = '***'
|
|
125
|
+
const isMaskedValue = v => v === MASKED_VALUE
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* 脱敏感知求和:任一值为 '***' 则整体返回 '***'(口径:合计不能暴露脱敏行的贡献)
|
|
129
|
+
* 非数字值按 0 容错,同时兼容原始数值字段与渲染后字符串
|
|
130
|
+
* @param {Array} values 参与求和的值
|
|
131
|
+
*/
|
|
132
|
+
const maskedSum = values => {
|
|
133
|
+
if (values.some(isMaskedValue)) return MASKED_VALUE
|
|
134
|
+
return values.reduce((a, b) => a.plus(+b || 0), Big(0)).toFixed(2)
|
|
135
|
+
}
|
|
136
|
+
|
|
123
137
|
const coverDigit2Uppercase = n => {
|
|
138
|
+
// 脱敏值直接透传:否则 Math.abs('***') 得 NaN,Big(NaN) 会抛异常
|
|
139
|
+
if (isMaskedValue(n)) return MASKED_VALUE
|
|
124
140
|
if (_.isNil(n) || _.isNaN(n)) {
|
|
125
141
|
return '-'
|
|
126
142
|
}
|
|
@@ -384,5 +400,8 @@ export {
|
|
|
384
400
|
caclSingleDetailsPageHeight,
|
|
385
401
|
getArrayMid,
|
|
386
402
|
getColSpanLength,
|
|
387
|
-
getOverallOrderTrHeight
|
|
403
|
+
getOverallOrderTrHeight,
|
|
404
|
+
MASKED_VALUE,
|
|
405
|
+
isMaskedValue,
|
|
406
|
+
maskedSum
|
|
388
407
|
}
|