ztxkui 4.2.18-69 → 4.2.18-70
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.
|
@@ -296,6 +296,7 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
|
|
|
296
296
|
_columns.forEach(function (col, index) {
|
|
297
297
|
var _column = __assign({}, col);
|
|
298
298
|
var columnTitle = _column.title;
|
|
299
|
+
var dataIndex = col.dataIndex || col.key;
|
|
299
300
|
var align = _column.align;
|
|
300
301
|
// 这里解决一个bug,对于dataSource.slice().reverse() 之后。scu配置的字段并不会更新 render中的index
|
|
301
302
|
if (_column.shouldCellUpdate) {
|
|
@@ -418,7 +419,7 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
|
|
|
418
419
|
if (!_column.hideColumn) {
|
|
419
420
|
_newColumns.push(_column);
|
|
420
421
|
}
|
|
421
|
-
if (tableNumberFormatter === null || tableNumberFormatter === void 0 ? void 0 : tableNumberFormatter(columnTitle)) {
|
|
422
|
+
if (tableNumberFormatter === null || tableNumberFormatter === void 0 ? void 0 : tableNumberFormatter(columnTitle, dataIndex, _column)) {
|
|
422
423
|
_column.align = 'right';
|
|
423
424
|
}
|
|
424
425
|
// 添加render字段
|
|
@@ -579,7 +580,7 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
|
|
|
579
580
|
selfResult = customDecimalFieldRender === null || customDecimalFieldRender === void 0 ? void 0 : customDecimalFieldRender(text, record, index);
|
|
580
581
|
}
|
|
581
582
|
}
|
|
582
|
-
if (!(tableNumberFormatter === null || tableNumberFormatter === void 0 ? void 0 : tableNumberFormatter(title))) {
|
|
583
|
+
if (!(tableNumberFormatter === null || tableNumberFormatter === void 0 ? void 0 : tableNumberFormatter(title, dataIndex, _column))) {
|
|
583
584
|
return selfResult;
|
|
584
585
|
}
|
|
585
586
|
if (typeof selfResult === 'string' ||
|
|
@@ -624,6 +625,7 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
|
|
|
624
625
|
if (isNumber(newValue)) {
|
|
625
626
|
return getResultCom(newValue);
|
|
626
627
|
}
|
|
628
|
+
return selfResult;
|
|
627
629
|
}
|
|
628
630
|
// 20250623 如果text返回的是数字形数据,那么转成带千分符的值
|
|
629
631
|
function isNumber(val) {
|
|
@@ -677,12 +679,12 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
|
|
|
677
679
|
// 去掉千分符 还是数字的话
|
|
678
680
|
var newValue_1 = typeof value === 'string' ? (_a = value === null || value === void 0 ? void 0 : value.replace) === null || _a === void 0 ? void 0 : _a.call(value, /,/g, '') : value;
|
|
679
681
|
if (isNumber(newValue_1) && isNumber(text)) {
|
|
680
|
-
return (tableNumberFormatter === null || tableNumberFormatter === void 0 ? void 0 : tableNumberFormatter(title))
|
|
682
|
+
return (tableNumberFormatter === null || tableNumberFormatter === void 0 ? void 0 : tableNumberFormatter(title, dataIndex, _column))
|
|
681
683
|
? getResultCom(customDecimalFieldRender === null || customDecimalFieldRender === void 0 ? void 0 : customDecimalFieldRender(text, record, index))
|
|
682
684
|
: customDecimalFieldRender === null || customDecimalFieldRender === void 0 ? void 0 : customDecimalFieldRender(text, record, index);
|
|
683
685
|
}
|
|
684
686
|
}
|
|
685
|
-
if (!(tableNumberFormatter === null || tableNumberFormatter === void 0 ? void 0 : tableNumberFormatter(title))) {
|
|
687
|
+
if (!(tableNumberFormatter === null || tableNumberFormatter === void 0 ? void 0 : tableNumberFormatter(title, dataIndex, _column))) {
|
|
686
688
|
return value;
|
|
687
689
|
}
|
|
688
690
|
if (isPercentage(value) && isNumberInputAlignRight) {
|
|
@@ -12,7 +12,7 @@ export interface IZtxkConfig {
|
|
|
12
12
|
* 规则2:字段中包含:单价、总价、金额、数量的需要加上
|
|
13
13
|
* 前提条件是,字段值是数字类型(这个规则组件内部会实现)
|
|
14
14
|
*/
|
|
15
|
-
tableNumberFormatter?: (text: string) => boolean | null | undefined | void;
|
|
15
|
+
tableNumberFormatter?: (text: string, fieldName?: string, column?: any) => boolean | null | undefined | void;
|
|
16
16
|
/**
|
|
17
17
|
* 处理显示的自定义小数位字段
|
|
18
18
|
*/
|