ztxkui 4.2.23-607 → 4.2.23-608
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/dist/TableDemo/BasicTable.js +27 -0
- package/dist/TableDemo/data.d.ts +2 -0
- package/dist/TableDemo/data.js +2 -0
- package/dist/UI/Table/DetaiTable.js +1 -0
- package/dist/components/Table/hooks/useColumns.js +17 -12
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/Table/table.js +7 -5
- package/dist/components/Table/utils/getSummaryData.js +4 -0
- package/dist/components/electron-signatures/electronComponents/electron-seal-list.js +2 -2
- package/dist/components/electron-signatures/qunjComponents/qunj-list.js +2 -2
- package/package.json +1 -1
|
@@ -285,6 +285,29 @@ var BasicTable = function (_a) {
|
|
|
285
285
|
dataIndex: 'ladingSalePrice',
|
|
286
286
|
align: 'center',
|
|
287
287
|
},
|
|
288
|
+
{
|
|
289
|
+
title: i18next.t('开单数量-豁免居中'),
|
|
290
|
+
key: 'ladingQuantity-exempt-center',
|
|
291
|
+
dataIndex: 'ladingQuantity',
|
|
292
|
+
align: 'center',
|
|
293
|
+
disableNumberAlignRight: true,
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
title: i18next.t('开单数量-豁免默认'),
|
|
297
|
+
key: 'ladingQuantity-exempt-default',
|
|
298
|
+
dataIndex: 'ladingQuantity',
|
|
299
|
+
disableNumberAlignRight: true,
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
title: i18next.t('开单件数-豁免(自定义render)'),
|
|
303
|
+
key: 'test10-exempt',
|
|
304
|
+
dataIndex: 'test10',
|
|
305
|
+
align: 'center',
|
|
306
|
+
disableNumberAlignRight: true,
|
|
307
|
+
render: function (text, record) {
|
|
308
|
+
return React.createElement("span", null, text && toThousand(exactRound(text, 3)));
|
|
309
|
+
},
|
|
310
|
+
},
|
|
288
311
|
{
|
|
289
312
|
title: i18next.t('开单金额'),
|
|
290
313
|
// width: 100,
|
|
@@ -386,6 +409,10 @@ var BasicTable = function (_a) {
|
|
|
386
409
|
key: 'purchaseContractAmount',
|
|
387
410
|
toFixedNum: 2,
|
|
388
411
|
},
|
|
412
|
+
{
|
|
413
|
+
key: 'ladingQuantity',
|
|
414
|
+
toFixedNum: 2,
|
|
415
|
+
},
|
|
389
416
|
],
|
|
390
417
|
},
|
|
391
418
|
] })));
|
package/dist/TableDemo/data.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare const dataSource: {
|
|
|
13
13
|
test10: string;
|
|
14
14
|
test101: string;
|
|
15
15
|
test102: string;
|
|
16
|
+
ladingQuantity: number;
|
|
16
17
|
}[];
|
|
17
18
|
export declare const dataSource5: {
|
|
18
19
|
id: string;
|
|
@@ -43,6 +44,7 @@ export declare const dataSource2: {
|
|
|
43
44
|
test10: string;
|
|
44
45
|
test101: string;
|
|
45
46
|
test102: string;
|
|
47
|
+
ladingQuantity: number;
|
|
46
48
|
}[];
|
|
47
49
|
export declare const dataSource3: {
|
|
48
50
|
id: string;
|
package/dist/TableDemo/data.js
CHANGED
|
@@ -18,6 +18,7 @@ export var dataSource = new Array(100).fill(500).map(function (item, index) {
|
|
|
18
18
|
test10: "" + (1001022 + index),
|
|
19
19
|
test101: "" + (1001022 + index),
|
|
20
20
|
test102: "" + (1001022 + index),
|
|
21
|
+
ladingQuantity: 1234.5 + index * 10.25,
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
24
|
return {
|
|
@@ -37,6 +38,7 @@ export var dataSource = new Array(100).fill(500).map(function (item, index) {
|
|
|
37
38
|
test10: "" + (10022 + index),
|
|
38
39
|
test101: "" + (10022 + index),
|
|
39
40
|
test102: "" + (10022 + index),
|
|
41
|
+
ladingQuantity: 1234.5 + index * 10.25,
|
|
40
42
|
// test111: index + 1,
|
|
41
43
|
// children: new Array(8).fill(1).map((item, index) => {
|
|
42
44
|
// return {
|
|
@@ -1767,6 +1767,7 @@ export default function EditTable() {
|
|
|
1767
1767
|
dataIndex: 'orderNumber',
|
|
1768
1768
|
key: 'orderNumber',
|
|
1769
1769
|
align: 'center',
|
|
1770
|
+
disableNumberAlignRight: true,
|
|
1770
1771
|
render: function (text) { return toThousand(exactRound(text, number_precision)); },
|
|
1771
1772
|
},
|
|
1772
1773
|
{
|
|
@@ -433,7 +433,8 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
|
|
|
433
433
|
}
|
|
434
434
|
_column.ellipsis = false;
|
|
435
435
|
}
|
|
436
|
-
if (tableNumberFormatter === null || tableNumberFormatter === void 0 ? void 0 : tableNumberFormatter(columnTitle, dataIndex, _column))
|
|
436
|
+
if ((tableNumberFormatter === null || tableNumberFormatter === void 0 ? void 0 : tableNumberFormatter(columnTitle, dataIndex, _column)) &&
|
|
437
|
+
!_column.disableNumberAlignRight) {
|
|
437
438
|
_column.align = 'left';
|
|
438
439
|
}
|
|
439
440
|
var align = _column.align;
|
|
@@ -801,15 +802,15 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
|
|
|
801
802
|
}
|
|
802
803
|
if (typeof selfResult === 'string' ||
|
|
803
804
|
typeof selfResult === 'number') {
|
|
804
|
-
return renderText(selfResult);
|
|
805
|
+
return renderText(selfResult, _column.disableNumberAlignRight);
|
|
805
806
|
}
|
|
806
807
|
if (typeof selfResult === 'object' && selfResult.children) {
|
|
807
808
|
console.log(i18next.t('命中逻辑'));
|
|
808
|
-
return __assign(__assign({}, selfResult), { children: renderText(selfResult.children) });
|
|
809
|
+
return __assign(__assign({}, selfResult), { children: renderText(selfResult.children, _column.disableNumberAlignRight) });
|
|
809
810
|
}
|
|
810
811
|
// 这里的selfResult可能是一个react组件,没法判断其包含的到底是一个数字,还是什么
|
|
811
812
|
// 所以这里认为 只要命中了 tableNumberFormatter 就全部靠右显示
|
|
812
|
-
if (isNumberInputAlignRight) {
|
|
813
|
+
if (isNumberInputAlignRight && !_column.disableNumberAlignRight) {
|
|
813
814
|
return React.createElement("div", { style: { textAlign: 'right' } }, selfResult);
|
|
814
815
|
}
|
|
815
816
|
// // 去掉千分符 还是数字的话
|
|
@@ -828,12 +829,14 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
|
|
|
828
829
|
};
|
|
829
830
|
}
|
|
830
831
|
}
|
|
831
|
-
function getResultCom(val) {
|
|
832
|
+
function getResultCom(val, disableAlignRight) {
|
|
832
833
|
var valResult = isNumberInputThousandth ? toThousand(val) : val;
|
|
833
|
-
return isNumberInputAlignRight ? (React.createElement("div", { style: { textAlign: 'right' } }, valResult)) : (valResult);
|
|
834
|
+
return isNumberInputAlignRight && !disableAlignRight ? (React.createElement("div", { style: { textAlign: 'right' } }, valResult)) : (valResult);
|
|
834
835
|
}
|
|
835
|
-
function renderText(selfResult) {
|
|
836
|
-
if (isPercentage(selfResult) &&
|
|
836
|
+
function renderText(selfResult, disableAlignRight) {
|
|
837
|
+
if (isPercentage(selfResult) &&
|
|
838
|
+
isNumberInputAlignRight &&
|
|
839
|
+
!disableAlignRight) {
|
|
837
840
|
return React.createElement("div", { style: { textAlign: 'right' } }, selfResult);
|
|
838
841
|
}
|
|
839
842
|
// 去掉千分符 还是数字的话
|
|
@@ -841,7 +844,7 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
|
|
|
841
844
|
? selfResult.replace(/,/g, '')
|
|
842
845
|
: selfResult;
|
|
843
846
|
if (isNumber(newValue)) {
|
|
844
|
-
return getResultCom(newValue);
|
|
847
|
+
return getResultCom(newValue, disableAlignRight);
|
|
845
848
|
}
|
|
846
849
|
return selfResult;
|
|
847
850
|
}
|
|
@@ -899,20 +902,22 @@ function getNewColumns(basicConfig, editableConfig, dynamicConfig, otherConfig)
|
|
|
899
902
|
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;
|
|
900
903
|
if (isNumber(newValue_1) && isNumber(text)) {
|
|
901
904
|
return (tableNumberFormatter === null || tableNumberFormatter === void 0 ? void 0 : tableNumberFormatter(title, dataIndex, _column))
|
|
902
|
-
? getResultCom(customDecimalFieldRender === null || customDecimalFieldRender === void 0 ? void 0 : customDecimalFieldRender(text, record, index))
|
|
905
|
+
? getResultCom(customDecimalFieldRender === null || customDecimalFieldRender === void 0 ? void 0 : customDecimalFieldRender(text, record, index), _column.disableNumberAlignRight)
|
|
903
906
|
: customDecimalFieldRender === null || customDecimalFieldRender === void 0 ? void 0 : customDecimalFieldRender(text, record, index);
|
|
904
907
|
}
|
|
905
908
|
}
|
|
906
909
|
if (!(tableNumberFormatter === null || tableNumberFormatter === void 0 ? void 0 : tableNumberFormatter(title, dataIndex, _column))) {
|
|
907
910
|
return value;
|
|
908
911
|
}
|
|
909
|
-
if (isPercentage(value) &&
|
|
912
|
+
if (isPercentage(value) &&
|
|
913
|
+
isNumberInputAlignRight &&
|
|
914
|
+
!_column.disableNumberAlignRight) {
|
|
910
915
|
return React.createElement("div", { style: { textAlign: 'right' } }, value);
|
|
911
916
|
}
|
|
912
917
|
// 去掉千分符 还是数字的话
|
|
913
918
|
var newValue = typeof value === 'string' ? (_b = value === null || value === void 0 ? void 0 : value.replace) === null || _b === void 0 ? void 0 : _b.call(value, /,/g, '') : value;
|
|
914
919
|
if (isNumber(newValue)) {
|
|
915
|
-
return getResultCom(newValue);
|
|
920
|
+
return getResultCom(newValue, _column.disableNumberAlignRight);
|
|
916
921
|
}
|
|
917
922
|
}
|
|
918
923
|
catch (err) {
|
|
@@ -59,6 +59,9 @@ export interface IColumnType<RecordType> extends Omit<ColumnType<RecordType>, 'r
|
|
|
59
59
|
disablePrecisionControl?: boolean;
|
|
60
60
|
/**是否加上千分符 */
|
|
61
61
|
thousand?: boolean;
|
|
62
|
+
/** 是否禁用数字列自动右对齐(含 align 强制改写)。
|
|
63
|
+
* 设置后该列即使命中全局数字列判定,也尊重此处显式配置的 align */
|
|
64
|
+
disableNumberAlignRight?: boolean;
|
|
62
65
|
/**表头别名 */
|
|
63
66
|
titleAlias?: string;
|
|
64
67
|
/** 强制使用这个宽度。这个属性暂时仅仅只是处理操作按钮的宽度 */
|
|
@@ -1173,7 +1173,7 @@ function Table(props) {
|
|
|
1173
1173
|
var title = summary.title, key = summary.key, titleIndex = summary.titleIndex, list = summary.list, columnList = summary.columnList, onClickHandle = summary.onClickHandle;
|
|
1174
1174
|
return (React.createElement(AntTable.Summary.Row, { key: key }, Array.isArray(list) &&
|
|
1175
1175
|
list.map(function (item, index) {
|
|
1176
|
-
var _a, _b;
|
|
1176
|
+
var _a, _b, _c, _d;
|
|
1177
1177
|
var data = {
|
|
1178
1178
|
index: index,
|
|
1179
1179
|
column: Array.isArray(columnList)
|
|
@@ -1182,14 +1182,16 @@ function Table(props) {
|
|
|
1182
1182
|
num: item,
|
|
1183
1183
|
};
|
|
1184
1184
|
if (titleIndex === index) {
|
|
1185
|
-
return (React.createElement(AntTable.Summary.Cell, { key: index, index: index, align: isNumberInputAlignRight
|
|
1185
|
+
return (React.createElement(AntTable.Summary.Cell, { key: index, index: index, align: isNumberInputAlignRight &&
|
|
1186
|
+
!((_a = data === null || data === void 0 ? void 0 : data.column) === null || _a === void 0 ? void 0 : _a.disableNumberAlignRight)
|
|
1186
1187
|
? 'right'
|
|
1187
|
-
: (
|
|
1188
|
+
: (_b = data === null || data === void 0 ? void 0 : data.column) === null || _b === void 0 ? void 0 : _b.align }, onClickHandle ? (React.createElement("div", { onClick: function () { return onClickHandle === null || onClickHandle === void 0 ? void 0 : onClickHandle(data); } }, title)) : (title)));
|
|
1188
1189
|
}
|
|
1189
1190
|
else {
|
|
1190
|
-
return (React.createElement(AntTable.Summary.Cell, { key: index, index: index, align: isNumberInputAlignRight
|
|
1191
|
+
return (React.createElement(AntTable.Summary.Cell, { key: index, index: index, align: isNumberInputAlignRight &&
|
|
1192
|
+
!((_c = data === null || data === void 0 ? void 0 : data.column) === null || _c === void 0 ? void 0 : _c.disableNumberAlignRight)
|
|
1191
1193
|
? 'right'
|
|
1192
|
-
: (
|
|
1194
|
+
: (_d = data === null || data === void 0 ? void 0 : data.column) === null || _d === void 0 ? void 0 : _d.align },
|
|
1193
1195
|
React.createElement("div", { style: {
|
|
1194
1196
|
color: '#333',
|
|
1195
1197
|
}, onClick: function () {
|
|
@@ -80,6 +80,7 @@ function getSummaryData(summaryConfig, pageData, columns, _a, option) {
|
|
|
80
80
|
key: col === null || col === void 0 ? void 0 : col.key,
|
|
81
81
|
dataIndex: col === null || col === void 0 ? void 0 : col.dataIndex,
|
|
82
82
|
align: col === null || col === void 0 ? void 0 : col.align,
|
|
83
|
+
disableNumberAlignRight: col === null || col === void 0 ? void 0 : col.disableNumberAlignRight,
|
|
83
84
|
});
|
|
84
85
|
});
|
|
85
86
|
}
|
|
@@ -88,6 +89,7 @@ function getSummaryData(summaryConfig, pageData, columns, _a, option) {
|
|
|
88
89
|
key: col === null || col === void 0 ? void 0 : col.key,
|
|
89
90
|
dataIndex: col === null || col === void 0 ? void 0 : col.dataIndex,
|
|
90
91
|
align: col === null || col === void 0 ? void 0 : col.align,
|
|
92
|
+
disableNumberAlignRight: col === null || col === void 0 ? void 0 : col.disableNumberAlignRight,
|
|
91
93
|
});
|
|
92
94
|
}
|
|
93
95
|
});
|
|
@@ -153,6 +155,7 @@ function getSummaryData(summaryConfig, pageData, columns, _a, option) {
|
|
|
153
155
|
key: col === null || col === void 0 ? void 0 : col.key,
|
|
154
156
|
dataIndex: col === null || col === void 0 ? void 0 : col.dataIndex,
|
|
155
157
|
align: col === null || col === void 0 ? void 0 : col.align,
|
|
158
|
+
disableNumberAlignRight: col === null || col === void 0 ? void 0 : col.disableNumberAlignRight,
|
|
156
159
|
});
|
|
157
160
|
});
|
|
158
161
|
}
|
|
@@ -161,6 +164,7 @@ function getSummaryData(summaryConfig, pageData, columns, _a, option) {
|
|
|
161
164
|
key: col === null || col === void 0 ? void 0 : col.key,
|
|
162
165
|
dataIndex: col === null || col === void 0 ? void 0 : col.dataIndex,
|
|
163
166
|
align: col === null || col === void 0 ? void 0 : col.align,
|
|
167
|
+
disableNumberAlignRight: col === null || col === void 0 ? void 0 : col.disableNumberAlignRight,
|
|
164
168
|
});
|
|
165
169
|
}
|
|
166
170
|
});
|
|
@@ -92,7 +92,7 @@ var ElectronSealList = function (_a) {
|
|
|
92
92
|
setSelectedOwner(ownerList[0]);
|
|
93
93
|
}
|
|
94
94
|
}, [ownerList, selectedOwner]);
|
|
95
|
-
// 悬浮延迟切换:停留
|
|
95
|
+
// 悬浮延迟切换:停留 400ms 才切换,快速划过(如跨行移动)不触发
|
|
96
96
|
var hoverTimerRef = useRef(null);
|
|
97
97
|
useEffect(function () {
|
|
98
98
|
return function () { return clearTimeout(hoverTimerRef.current); };
|
|
@@ -103,7 +103,7 @@ var ElectronSealList = function (_a) {
|
|
|
103
103
|
clearTimeout(hoverTimerRef.current);
|
|
104
104
|
hoverTimerRef.current = setTimeout(function () {
|
|
105
105
|
setSelectedOwner(owner);
|
|
106
|
-
},
|
|
106
|
+
}, 400);
|
|
107
107
|
};
|
|
108
108
|
var clearHoverTimer = function () {
|
|
109
109
|
clearTimeout(hoverTimerRef.current);
|
|
@@ -56,7 +56,7 @@ var QunjList = function (props) {
|
|
|
56
56
|
setSelectedCompany(companyList[0]);
|
|
57
57
|
}
|
|
58
58
|
}, [companyList, selectedCompany]);
|
|
59
|
-
// 悬浮延迟切换:停留
|
|
59
|
+
// 悬浮延迟切换:停留 400ms 才切换,快速划过(如跨行移动)不触发
|
|
60
60
|
var hoverTimerRef = useRef(null);
|
|
61
61
|
useEffect(function () {
|
|
62
62
|
return function () { return clearTimeout(hoverTimerRef.current); };
|
|
@@ -67,7 +67,7 @@ var QunjList = function (props) {
|
|
|
67
67
|
clearTimeout(hoverTimerRef.current);
|
|
68
68
|
hoverTimerRef.current = setTimeout(function () {
|
|
69
69
|
setSelectedCompany(company);
|
|
70
|
-
},
|
|
70
|
+
}, 400);
|
|
71
71
|
};
|
|
72
72
|
var clearHoverTimer = function () {
|
|
73
73
|
clearTimeout(hoverTimerRef.current);
|