ztxkui 4.2.23-607 → 4.2.23-609
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/Detail/index.js +15 -1
- package/dist/UI/Detail/test.d.ts +106 -0
- package/dist/UI/Detail/test.js +75 -0
- package/dist/UI/Table/DetaiTable.js +1 -0
- package/dist/components/Input/InputQuill.js +6 -2
- package/dist/components/Input/InputQuillRead.js +5 -2
- 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 +2 -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 {
|
package/dist/UI/Detail/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import React, { useMemo, useRef } from 'react';
|
|
|
3
3
|
import { DetailHeader, OperationBtnGroup, Container, Button, InputNumber, Input, Tabs, Dropdown, DatePicker, Collapse, Modal, Tooltip, } from '../../index.build';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
5
5
|
import EditTable from '../Table/EditTable';
|
|
6
|
+
import { obj } from './test';
|
|
6
7
|
var Detail = function () {
|
|
7
8
|
var rangeDatesRef = useRef(null);
|
|
8
9
|
var items = useMemo(function () {
|
|
@@ -214,7 +215,20 @@ var Detail = function () {
|
|
|
214
215
|
React.createElement(InputNumber, { precision: 6, min: 0 }),
|
|
215
216
|
React.createElement(InputNumber, { precision: 0, min: 0, formatterType: "currency" }),
|
|
216
217
|
React.createElement(Input, { placeholder: i18next.t('若遇"共同责任"、"授权委托"审批情形,则"合同金额"字段填写(拟)授信金额。') }),
|
|
217
|
-
React.createElement(Input.Quill, { placeholder: i18next.t('若遇"共同责任"、"授权委托"审批情形,则"合同金额"字段填写(拟)授信金额。')
|
|
218
|
+
React.createElement(Input.Quill, { placeholder: i18next.t('若遇"共同责任"、"授权委托"审批情形,则"合同金额"字段填写(拟)授信金额。'), onChange: function (value) {
|
|
219
|
+
console.log(value);
|
|
220
|
+
} }),
|
|
221
|
+
React.createElement(Input.Quill, { placeholder: i18next.t('若遇"共同责任"、"授权委托"审批情形,则"合同金额"字段填写(拟)授信金额。'), onChange: function (value) {
|
|
222
|
+
console.log(value);
|
|
223
|
+
} }),
|
|
224
|
+
"111",
|
|
225
|
+
React.createElement(Input.QuillRead, { escapeHtml: true,
|
|
226
|
+
// value={
|
|
227
|
+
// '111<img+src="x"+onerror="eval(unescape(\'%61%6c%65%72%74%28%22%78%73%73%34%22%29%3b\'))">' ??
|
|
228
|
+
// ''
|
|
229
|
+
// }
|
|
230
|
+
value: obj.mark }),
|
|
231
|
+
"222",
|
|
218
232
|
React.createElement(Tabs, { isHeader: true }, Array.from({ length: 6 }, function (_, i) { return (React.createElement(Tabs.TabPane, { key: i, tab: React.createElement(Dropdown, { trigger: ['contextMenu'], overlay: React.createElement("div", null,
|
|
219
233
|
React.createElement("a", null, i18next.t('编辑')),
|
|
220
234
|
React.createElement("a", null, i18next.t('删除'))) },
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
export namespace obj {
|
|
2
|
+
const id: string;
|
|
3
|
+
const tenantId: string;
|
|
4
|
+
const serviceId: string;
|
|
5
|
+
const serverIp: string;
|
|
6
|
+
const serverHost: string;
|
|
7
|
+
const env: string;
|
|
8
|
+
const remoteIp: string;
|
|
9
|
+
const userAgent: string;
|
|
10
|
+
const requestUri: string;
|
|
11
|
+
const method: string;
|
|
12
|
+
const methodClass: string;
|
|
13
|
+
const methodName: string;
|
|
14
|
+
const params: string;
|
|
15
|
+
const createBy: string;
|
|
16
|
+
const createTime: string;
|
|
17
|
+
const requestType: number;
|
|
18
|
+
const mobileModel: any;
|
|
19
|
+
const appVersion: any;
|
|
20
|
+
const offlineVersion: any;
|
|
21
|
+
const system: number;
|
|
22
|
+
const paramsCleanRegex: any;
|
|
23
|
+
const logLevel: string;
|
|
24
|
+
const logId: string;
|
|
25
|
+
const logData: string;
|
|
26
|
+
const mark: string;
|
|
27
|
+
const logModule: string;
|
|
28
|
+
const operationName: any;
|
|
29
|
+
const operationTime: any;
|
|
30
|
+
const logExtra: any;
|
|
31
|
+
const createByName: string;
|
|
32
|
+
const createDeptByName: string;
|
|
33
|
+
const mobile: boolean;
|
|
34
|
+
const systemName: string;
|
|
35
|
+
const requestTypeName: string;
|
|
36
|
+
}
|
|
37
|
+
export namespace obj1 {
|
|
38
|
+
const id_1: string;
|
|
39
|
+
export { id_1 as id };
|
|
40
|
+
const tenantId_1: string;
|
|
41
|
+
export { tenantId_1 as tenantId };
|
|
42
|
+
const serviceId_1: string;
|
|
43
|
+
export { serviceId_1 as serviceId };
|
|
44
|
+
const serverIp_1: string;
|
|
45
|
+
export { serverIp_1 as serverIp };
|
|
46
|
+
const serverHost_1: string;
|
|
47
|
+
export { serverHost_1 as serverHost };
|
|
48
|
+
const env_1: string;
|
|
49
|
+
export { env_1 as env };
|
|
50
|
+
const remoteIp_1: string;
|
|
51
|
+
export { remoteIp_1 as remoteIp };
|
|
52
|
+
const userAgent_1: string;
|
|
53
|
+
export { userAgent_1 as userAgent };
|
|
54
|
+
const requestUri_1: string;
|
|
55
|
+
export { requestUri_1 as requestUri };
|
|
56
|
+
const method_1: string;
|
|
57
|
+
export { method_1 as method };
|
|
58
|
+
const methodClass_1: string;
|
|
59
|
+
export { methodClass_1 as methodClass };
|
|
60
|
+
const methodName_1: string;
|
|
61
|
+
export { methodName_1 as methodName };
|
|
62
|
+
const params_1: string;
|
|
63
|
+
export { params_1 as params };
|
|
64
|
+
const createBy_1: string;
|
|
65
|
+
export { createBy_1 as createBy };
|
|
66
|
+
const createTime_1: string;
|
|
67
|
+
export { createTime_1 as createTime };
|
|
68
|
+
const requestType_1: number;
|
|
69
|
+
export { requestType_1 as requestType };
|
|
70
|
+
const mobileModel_1: any;
|
|
71
|
+
export { mobileModel_1 as mobileModel };
|
|
72
|
+
const appVersion_1: any;
|
|
73
|
+
export { appVersion_1 as appVersion };
|
|
74
|
+
const offlineVersion_1: any;
|
|
75
|
+
export { offlineVersion_1 as offlineVersion };
|
|
76
|
+
const system_1: number;
|
|
77
|
+
export { system_1 as system };
|
|
78
|
+
const paramsCleanRegex_1: any;
|
|
79
|
+
export { paramsCleanRegex_1 as paramsCleanRegex };
|
|
80
|
+
const logLevel_1: string;
|
|
81
|
+
export { logLevel_1 as logLevel };
|
|
82
|
+
const logId_1: string;
|
|
83
|
+
export { logId_1 as logId };
|
|
84
|
+
const logData_1: string;
|
|
85
|
+
export { logData_1 as logData };
|
|
86
|
+
const mark_1: string;
|
|
87
|
+
export { mark_1 as mark };
|
|
88
|
+
const logModule_1: string;
|
|
89
|
+
export { logModule_1 as logModule };
|
|
90
|
+
const operationName_1: any;
|
|
91
|
+
export { operationName_1 as operationName };
|
|
92
|
+
const operationTime_1: any;
|
|
93
|
+
export { operationTime_1 as operationTime };
|
|
94
|
+
const logExtra_1: any;
|
|
95
|
+
export { logExtra_1 as logExtra };
|
|
96
|
+
const createByName_1: string;
|
|
97
|
+
export { createByName_1 as createByName };
|
|
98
|
+
const createDeptByName_1: string;
|
|
99
|
+
export { createDeptByName_1 as createDeptByName };
|
|
100
|
+
const mobile_1: boolean;
|
|
101
|
+
export { mobile_1 as mobile };
|
|
102
|
+
const systemName_1: string;
|
|
103
|
+
export { systemName_1 as systemName };
|
|
104
|
+
const requestTypeName_1: string;
|
|
105
|
+
export { requestTypeName_1 as requestTypeName };
|
|
106
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
export var obj = {
|
|
3
|
+
id: '2085200609873104606',
|
|
4
|
+
tenantId: '000000',
|
|
5
|
+
serviceId: 'zmdms-scm-order',
|
|
6
|
+
serverIp: 'fe80:0:0:0:12:34ff:fe06:6e85%eth0:18101',
|
|
7
|
+
serverHost: 'zmdms-scm-order-test-zmdmsscm-5464cbd67-mdb2j',
|
|
8
|
+
env: 'test',
|
|
9
|
+
remoteIp: '172.28.7.23',
|
|
10
|
+
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36',
|
|
11
|
+
requestUri: '/quotation/update',
|
|
12
|
+
method: 'POST',
|
|
13
|
+
methodClass: 'com.zmdms.core.log.logger.ZmdmsLogger',
|
|
14
|
+
methodName: 'info',
|
|
15
|
+
params: '{"id":"2094543572492935213","createUser":"8177127521209909288","createDept":"381761329295575035","createTime":"2026-08-21 15:57:09","updateUser":"8177127521209909288","updateTime":"2026-08-21 15:58:49","status":10,"isDeleted":0,"xid":null,"quotationNo":"BJ26000021","companyId":"1415837991701037057","companyName":"浙商中拓集团股份有限公司","depId":"381761329295575035","depName":"中拓本部","officeId":"1514579225679962114","officeName":"总部职能","firstDepId":null,"firstDepName":"","secondDepId":null,"secondDepName":"","profitCenterId":null,"profitCenterName":null,"customerMemberId":"8780290016480822868","customerMemberName":"CESHI","customerEmail":null,"salesmanId":"8177127521209909288","salesman":"申胜","currency":"CNY","totalQuantity":1,"totalAmount":1,"hasSent":null,"hasSealTakenOut":null,"verificationCode":null,"sealAddress":null,"predictProfit":null,"pricingType":"","disputeResolution":null,"areaScope":null,"mark":"\\"><img src=\\"x\\" onerror=\\"eval(unescape(\'%61%6c%65%72%74%28%22%78%73%73%34%22%29%3b\'))\\">","approveUser":null,"approveTime":null,"approveOpinion":null,"wfType":null,"wfProcessInstId":null,"wfParams":null,"approveFailInfo":null,"constituteOffer":0,"offerCustomer":null,"approveType":null,"exchangeRateRmb":"1.00","totalAmountRmb":1,"predictProfitRmb":null,"createUserName":"申胜","hasSentName":null,"statusName":"草稿","hasSealTakenOutName":null,"sealAddressName":null,"currencyName":null,"disputeResolutionName":null,"quotationWorkFlowVO":null,"electronicSealInfo":null,"approveTypeName":null,"officeCode":"Z098","secondDepCode":"","firstDepCode":"","constituteOfferName":"否","offerCustomerName":null,"attachmentDTOS":[],"postDate":"2026-08-21","postingDate":"2026-08-21","quotationDetailDTOList":[{"id":"2094543572492935214","createUser":"8177127521209909288","createDept":"381761329295575035","createTime":"2026-08-21 15:57:09","updateUser":"8177127521209909288","updateTime":"2026-08-21 15:58:49","status":1,"isDeleted":0,"xid":null,"quotationId":"2094543572492935213","quotationNo":"BJ26000021","quotationSubNo":"BJ26000021001","materialDescription":"1","quantityUnit":"Z34","quantityUnitName":"箱","quantity":"1.000000","unitPrice":"1.00","deliveryDate":null,"validityPeriodDate":null,"paymentMethod":null,"repaymentConditions":null,"mark":null,"unitPriceRmb":"1.00","paymentMethodName":null,"amount":"1.00","amountRmb":"1.00","_isUpdateData":true}]}',
|
|
16
|
+
createBy: '申胜',
|
|
17
|
+
createTime: '2026-08-21 16:00:55',
|
|
18
|
+
requestType: 1,
|
|
19
|
+
mobileModel: null,
|
|
20
|
+
appVersion: null,
|
|
21
|
+
offlineVersion: null,
|
|
22
|
+
system: 5,
|
|
23
|
+
paramsCleanRegex: null,
|
|
24
|
+
logLevel: 'info',
|
|
25
|
+
logId: '2094543572492935213',
|
|
26
|
+
logData: '修改',
|
|
27
|
+
// "mark": "\"><img src=\"x\" onerror=\"eval(unescape('%61%6c%65%72%74%28%22%78%73%73%34%22%29%3b'))\">",
|
|
28
|
+
// mark: '<p>"&gt;&lt;img src="x" onerror="eval(unescape('%61%6c%65%72%74%28%22%78%73%73%34%22%29%3b'))"&gt;</p>',
|
|
29
|
+
mark: '<p>"><a href="javascript:alert(1)">你好</a></p>',
|
|
30
|
+
logModule: '报价单',
|
|
31
|
+
operationName: null,
|
|
32
|
+
operationTime: null,
|
|
33
|
+
logExtra: null,
|
|
34
|
+
createByName: '申胜',
|
|
35
|
+
createDeptByName: '中拓本部',
|
|
36
|
+
mobile: false,
|
|
37
|
+
systemName: '中拓供应链',
|
|
38
|
+
requestTypeName: 'web',
|
|
39
|
+
};
|
|
40
|
+
export var obj1 = {
|
|
41
|
+
id: '2085200609873104558',
|
|
42
|
+
tenantId: '000000',
|
|
43
|
+
serviceId: 'zmdms-scm-order',
|
|
44
|
+
serverIp: 'fe80:0:0:0:12:34ff:fe06:6e85%eth0:18101',
|
|
45
|
+
serverHost: 'zmdms-scm-order-test-zmdmsscm-5464cbd67-mdb2j',
|
|
46
|
+
env: 'test',
|
|
47
|
+
remoteIp: '172.28.7.23',
|
|
48
|
+
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36',
|
|
49
|
+
requestUri: '/quotation/save',
|
|
50
|
+
method: 'POST',
|
|
51
|
+
methodClass: 'com.zmdms.core.log.logger.ZmdmsLogger',
|
|
52
|
+
methodName: 'info',
|
|
53
|
+
params: '{"companyId":"1415837991701037057","companyName":"浙商中拓集团股份有限公司","officeCode":"Z098","depId":"381761329295575035","depName":"中拓本部","salesmanId":"8177127521209909288","salesman":"申胜","constituteOffer":0,"currency":"CNY","exchangeRateRmb":1,"totalQuantity":1,"totalAmount":1,"totalAmountRmb":1,"pricingType":"","customerMemberId":"8780290016480822868","customerEmail":null,"predictProfit":null,"disputeResolution":null,"areaScope":null,"mark":"“><img+src=\\"x\\"+onerror=\\"eval(unescape(\'%61%6c%65%72%74%28%22%78%73%73%34%22%29%3b\'))\\">","customerMemberName":"CESHI","postDate":"2026-08-21","postingDate":"2026-08-21","quotationDetailDTOList":[{"_isUpdateData":false,"quantityUnit":"Z34","quantityUnitName":"箱","materialDescription":"1","quantity":1,"unitPrice":1,"unitPriceRmb":1,"amount":1,"amountRmb":1}],"status":10}',
|
|
54
|
+
createBy: '申胜',
|
|
55
|
+
createTime: '2026-08-21 15:57:09',
|
|
56
|
+
requestType: 1,
|
|
57
|
+
mobileModel: null,
|
|
58
|
+
appVersion: null,
|
|
59
|
+
offlineVersion: null,
|
|
60
|
+
system: 5,
|
|
61
|
+
paramsCleanRegex: null,
|
|
62
|
+
logLevel: 'info',
|
|
63
|
+
logId: '2094543572492935213',
|
|
64
|
+
logData: '新增',
|
|
65
|
+
mark: '“><img+src="x"+onerror="eval(unescape(\'%61%6c%65%72%74%28%22%78%73%73%34%22%29%3b\'))">',
|
|
66
|
+
logModule: '报价单',
|
|
67
|
+
operationName: null,
|
|
68
|
+
operationTime: null,
|
|
69
|
+
logExtra: null,
|
|
70
|
+
createByName: '申胜',
|
|
71
|
+
createDeptByName: '中拓本部',
|
|
72
|
+
mobile: false,
|
|
73
|
+
systemName: '中拓供应链',
|
|
74
|
+
requestTypeName: 'web',
|
|
75
|
+
};
|
|
@@ -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
|
{
|
|
@@ -22,6 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
};
|
|
23
23
|
import React, { useMemo } from 'react';
|
|
24
24
|
import ReactQuill from 'react-quill';
|
|
25
|
+
import DOMPurify from 'dompurify';
|
|
25
26
|
import 'react-quill/dist/quill.snow.css';
|
|
26
27
|
/**
|
|
27
28
|
* @description HTML转义,将HTML标签转为实体字符
|
|
@@ -76,10 +77,13 @@ var CustomToolbar = function (_a) {
|
|
|
76
77
|
var InputQuill = function (_a) {
|
|
77
78
|
var value = _a.value, onBlur = _a.onBlur, buttons = _a.buttons, _b = _a.escapeHtml, escapeHtml = _b === void 0 ? false : _b, onChange = _a.onChange, props = __rest(_a, ["value", "onBlur", "buttons", "escapeHtml", "onChange"]);
|
|
78
79
|
var toolbarId = useMemo(function () { return "toolbar-" + Math.random().toString(36).substring(2, 11); }, []);
|
|
79
|
-
//
|
|
80
|
+
// 如果启用了转义,显示时需要反转义;
|
|
81
|
+
// 进入编辑器前统一净化,防止存库值被污染时(历史脏数据/后端拼接)注入恶意标签,
|
|
82
|
+
// 不再单独依赖 Quill 内部的格式白名单做安全边界
|
|
80
83
|
var displayValue = useMemo(function () {
|
|
81
84
|
var val = getValue(value);
|
|
82
|
-
|
|
85
|
+
var html = escapeHtml && val ? unescapeHtmlContent(val) : val;
|
|
86
|
+
return html ? DOMPurify.sanitize(html) : html;
|
|
83
87
|
}, [value, escapeHtml]);
|
|
84
88
|
// 处理onChange,如果启用了转义,输出时进行转义
|
|
85
89
|
var handleChange = function (content) {
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import React, { useRef, useEffect, useState, useMemo } from 'react';
|
|
2
|
+
import DOMPurify from 'dompurify';
|
|
2
3
|
import { unescapeHtmlContent } from './InputQuill';
|
|
3
4
|
var InputQuillRead = function (_a) {
|
|
4
5
|
var value = _a.value, _b = _a.escapeHtml, escapeHtml = _b === void 0 ? false : _b;
|
|
5
6
|
var contentRef = useRef(null);
|
|
6
7
|
var _c = useState(undefined), height = _c[0], setHeight = _c[1];
|
|
7
|
-
//
|
|
8
|
+
// 如果启用了转义,显示时需要反转义;
|
|
9
|
+
// 反转义/原始HTML在注入 innerHTML 前必须经过净化,防止 onerror 等事件属性与 script 造成 XSS
|
|
8
10
|
var displayValue = useMemo(function () {
|
|
9
|
-
|
|
11
|
+
var val = escapeHtml && value ? unescapeHtmlContent(value) : value;
|
|
12
|
+
return val ? DOMPurify.sanitize(val) : val;
|
|
10
13
|
}, [value, escapeHtml]);
|
|
11
14
|
useEffect(function () {
|
|
12
15
|
if (contentRef.current && displayValue) {
|
|
@@ -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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ztxkui",
|
|
3
|
-
"version": "4.2.23-
|
|
3
|
+
"version": "4.2.23-609",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "React components library",
|
|
6
6
|
"author": "zt-front-end",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"axios": "^0.21.1",
|
|
17
17
|
"classnames": "^2.2.6",
|
|
18
18
|
"dayjs": "^1.10.4",
|
|
19
|
+
"dompurify": "^3.4.14",
|
|
19
20
|
"file-saver": "^2.0.5",
|
|
20
21
|
"html-docx-js": "^0.3.1",
|
|
21
22
|
"immutability-helper": "^3.1.1",
|