zmdms-webui 3.5.2 → 3.5.3
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/es/applayoutheader/setting/fullCom.js +5 -1
- package/dist/es/applayoutheader/setting/userInfo.js +9 -5
- package/dist/es/applayoutheader/setting/userInfoModal.js +18 -12
- package/dist/es/applayoutheader/setting/userPwdModal.js +19 -13
- package/dist/es/applayoutheader/tabs/index.js +10 -6
- package/dist/es/applayoutsider/menu/Logo.js +5 -1
- package/dist/es/applayoutsider/menu/SearchInput.js +6 -2
- package/dist/es/applayoutsider/menu/SubMenu.js +6 -2
- package/dist/es/asyncdynamicsetting/asyncDynamicDrawer.js +2 -0
- package/dist/es/asyncdynamicsetting/useAsyncDrawer.js +2 -0
- package/dist/es/button/button.js +4 -2
- package/dist/es/button/buttonDownload.js +6 -4
- package/dist/es/button/buttonExport.js +8 -4
- package/dist/es/button/buttonPreview.js +6 -3
- package/dist/es/canvastable/canvasTable.js +33 -29
- package/dist/es/canvastable/components/CanvasTableMenu.js +5 -1
- package/dist/es/canvastable/components/FilterPopover.js +15 -11
- package/dist/es/canvastable/hooks/useProcessedColumns.js +7 -2
- package/dist/es/canvastable/hooks/useSummaryRow.js +6 -2
- package/dist/es/canvastable/hooks/useTableRender.js +5 -1
- package/dist/es/chatroom/chat-room.js +8 -3
- package/dist/es/config/i18n/en/appLayoutHeader.js +70 -0
- package/dist/es/config/i18n/en/appLayoutSider.js +14 -0
- package/dist/es/config/i18n/en/asyncDynamicSetting.js +42 -0
- package/dist/es/config/i18n/en/authLoading.js +6 -0
- package/dist/es/config/i18n/en/button.js +14 -0
- package/dist/es/config/i18n/en/canvasTable.js +50 -0
- package/dist/es/config/i18n/en/chatRoom.js +14 -0
- package/dist/es/config/i18n/en/datePicker.js +22 -0
- package/dist/es/config/i18n/en/detailList.js +6 -0
- package/dist/es/config/i18n/en/differences.js +6 -0
- package/dist/es/config/i18n/en/dynamicSetting.js +72 -0
- package/dist/es/config/i18n/en/electronSignatures.js +173 -0
- package/dist/es/config/i18n/en/enhanceSelect.js +8 -0
- package/dist/es/config/i18n/en/footer.js +8 -0
- package/dist/es/config/i18n/en/form.js +26 -0
- package/dist/es/config/i18n/en/formItem.js +8 -0
- package/dist/es/config/i18n/en/inputNumber.js +7 -0
- package/dist/es/config/i18n/en/login.js +76 -0
- package/dist/es/config/i18n/en/modal.js +8 -0
- package/dist/es/config/i18n/en/notAuthPage.js +8 -0
- package/dist/es/config/i18n/en/notRoutePage.js +8 -0
- package/dist/es/config/i18n/en/operationBtn.js +10 -0
- package/dist/es/config/i18n/en/print.js +16 -0
- package/dist/es/config/i18n/en/select.js +6 -0
- package/dist/es/config/i18n/en/table.js +65 -0
- package/dist/es/config/i18n/en/tabs.js +10 -0
- package/dist/es/config/i18n/en/translationButton.js +26 -0
- package/dist/es/config/i18n/en/tree.js +6 -0
- package/dist/es/config/i18n/en/uploadList.js +82 -0
- package/dist/es/config/i18n/en/ztTransfer.js +14 -0
- package/dist/es/config/i18n/en.js +65 -1
- package/dist/es/config/i18n/i18nInstance.js +33 -0
- package/dist/es/config/i18n/zh_cn/appLayoutHeader.js +70 -0
- package/dist/es/config/i18n/zh_cn/appLayoutSider.js +14 -0
- package/dist/es/config/i18n/zh_cn/asyncDynamicSetting.js +42 -0
- package/dist/es/config/i18n/zh_cn/authLoading.js +6 -0
- package/dist/es/config/i18n/zh_cn/button.js +14 -0
- package/dist/es/config/i18n/zh_cn/canvasTable.js +50 -0
- package/dist/es/config/i18n/zh_cn/chatRoom.js +14 -0
- package/dist/es/config/i18n/zh_cn/datePicker.js +22 -0
- package/dist/es/config/i18n/zh_cn/detailList.js +6 -0
- package/dist/es/config/i18n/zh_cn/differences.js +6 -0
- package/dist/es/config/i18n/zh_cn/dynamicSetting.js +72 -0
- package/dist/es/config/i18n/zh_cn/electronSignatures.js +342 -0
- package/dist/es/config/i18n/zh_cn/enhanceSelect.js +8 -0
- package/dist/es/config/i18n/zh_cn/footer.js +8 -0
- package/dist/es/config/i18n/zh_cn/form.js +26 -0
- package/dist/es/config/i18n/zh_cn/formItem.js +8 -0
- package/dist/es/config/i18n/zh_cn/inputNumber.js +7 -0
- package/dist/es/config/i18n/zh_cn/login.js +76 -0
- package/dist/es/config/i18n/zh_cn/modal.js +8 -0
- package/dist/es/config/i18n/zh_cn/notAuthPage.js +8 -0
- package/dist/es/config/i18n/zh_cn/notRoutePage.js +8 -0
- package/dist/es/config/i18n/zh_cn/operationBtn.js +10 -0
- package/dist/es/config/i18n/zh_cn/print.js +16 -0
- package/dist/es/config/i18n/zh_cn/select.js +6 -0
- package/dist/es/config/i18n/zh_cn/table.js +65 -0
- package/dist/es/config/i18n/zh_cn/tabs.js +10 -0
- package/dist/es/config/i18n/zh_cn/translationButton.js +26 -0
- package/dist/es/config/i18n/zh_cn/tree.js +6 -0
- package/dist/es/config/i18n/zh_cn/uploadList.js +82 -0
- package/dist/es/config/i18n/zh_cn/ztTransfer.js +14 -0
- package/dist/es/config/i18n/zh_cn.d.ts +538 -0
- package/dist/es/config/i18n/zh_cn.js +65 -1
- package/dist/es/config/index.js +1 -1
- package/dist/es/config/useLocale.d.ts +554 -0
- package/dist/es/config/useLocale.js +41 -8
- package/dist/es/datepicker/index.js +9 -3
- package/dist/es/datepicker/utils.js +32 -26
- package/dist/es/detaillist/item.js +7 -2
- package/dist/es/detaillist/list.js +2 -0
- package/dist/es/differences/differences.js +8 -1
- package/dist/es/dynamicsetting/dynamicDrawer.js +41 -24
- package/dist/es/dynamicsetting/hooks.js +2 -0
- package/dist/es/dynamicsetting/moreConfig.js +6 -2
- package/dist/es/dynamicsetting/useSearch.js +5 -1
- package/dist/es/dynamicsetting/useTemplate.js +19 -15
- package/dist/es/electronsignatures/content.js +52 -31
- package/dist/es/electronsignatures/filecomponents/file-upload.js +2 -0
- package/dist/es/electronsignatures/filecomponents/useFetchFileTypeData.js +2 -0
- package/dist/es/enhanceselect/enhance-select.js +7 -3
- package/dist/es/enhanceselect/list-query.js +2 -0
- package/dist/es/enhanceselect/page-query.js +2 -0
- package/dist/es/form/common-search-list.js +7 -2
- package/dist/es/form/form.js +9 -5
- package/dist/es/form/resetButton.js +16 -11
- package/dist/es/form/useCommonSearch.js +12 -9
- package/dist/es/formitem/formItem.js +4 -2
- package/dist/es/inputnumber/inputNumber.js +11 -2
- package/dist/es/inputnumber/utils.js +41 -8
- package/dist/es/login/forget-password.js +9 -5
- package/dist/es/login/index.js +12 -8
- package/dist/es/modal/modal.js +6 -2
- package/dist/es/operationbtn/operationBtn.js +5 -3
- package/dist/es/select/hooks.js +5 -1
- package/dist/es/table/components/ColumnAddDel.js +11 -5
- package/dist/es/table/components/EnhanceBodyCell.js +7 -5
- package/dist/es/table/components/FilterDropdown.js +7 -3
- package/dist/es/table/components/SortTitle.js +8 -4
- package/dist/es/table/components/TableMenu.js +5 -1
- package/dist/es/table/components/TitleOperation.js +5 -1
- package/dist/es/table/components/table-header-operation/FillDown.js +7 -3
- package/dist/es/table/excel.js +8 -4
- package/dist/es/table/hooks/useSelectSubtotal.js +8 -1
- package/dist/es/table/table.js +6 -4
- package/dist/es/table/useColumns.js +8 -4
- package/dist/es/table/useSummary.js +6 -2
- package/dist/es/table/useTableValidate.js +39 -7
- package/dist/es/table/utils.js +10 -5
- package/dist/es/tabs/tab-type.js +10 -1
- package/dist/es/title/title.js +2 -0
- package/dist/es/translationbutton/DownFile.js +8 -4
- package/dist/es/translationbutton/PreviewFile.js +5 -3
- package/dist/es/translationbutton/hooks.js +5 -1
- package/dist/es/translationbutton/translationButton.js +15 -12
- package/dist/es/tree/tree.js +8 -2
- package/dist/es/uploadlist/hooks.js +17 -11
- package/dist/es/uploadlist/uploadList.js +39 -26
- package/dist/es/uploadlist/uploadListDetail.js +15 -11
- package/dist/es/uploadlist/uploadTable.js +23 -19
- package/dist/es/uploadlist/utils.js +8 -1
- package/dist/es/zttransfer/Container.js +5 -1
- package/dist/es/zttransfer/SelectContainer.js +5 -1
- package/dist/es/zttransfer/zt-transfer.js +5 -1
- package/dist/index.build.d.ts +1 -0
- package/dist/index.es.js +1 -0
- package/package.json +5 -2
|
@@ -40,9 +40,38 @@ function formatCurrency(n) {
|
|
|
40
40
|
return n;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
/** 从原始输入字符串中提取小数位数,记录到 ref */
|
|
44
|
+
function trackDecimalLength(value, decimalLengthRef) {
|
|
45
|
+
if (decimalLengthRef && value) {
|
|
46
|
+
// 移除非数字和小数点的字符(如货币符号、千分符、百分号等)
|
|
47
|
+
var cleanValue = value.replace(/[^0-9.]/g, "");
|
|
48
|
+
var dotIndex = cleanValue.lastIndexOf(".");
|
|
49
|
+
if (dotIndex !== -1) {
|
|
50
|
+
decimalLengthRef.current = cleanValue.length - dotIndex - 1;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
decimalLengthRef.current = 0;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function getValue(value, isFocusRef, precision, decimalLengthRef) {
|
|
58
|
+
if (value && !isNaN(Number(value)) && precision) {
|
|
59
|
+
// 聚焦时,根据上次输入的小数位数补回被 JS 丢弃的尾零
|
|
60
|
+
// 例如:用户输入 21.00,JS 存为 21,decimalLengthRef 记录了 2,
|
|
61
|
+
// 此时用 toFixed(2) 补回为 "21.00"
|
|
62
|
+
if (isFocusRef.current && decimalLengthRef && decimalLengthRef.current > 0) {
|
|
63
|
+
var numValue = Number(value);
|
|
64
|
+
var numStr = numValue.toString();
|
|
65
|
+
var numDecimalLength = numStr.includes(".")
|
|
66
|
+
? numStr.split(".")[1].length
|
|
67
|
+
: 0;
|
|
68
|
+
if (decimalLengthRef.current > numDecimalLength) {
|
|
69
|
+
return numValue.toFixed(Math.min(decimalLengthRef.current, precision));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (!isFocusRef.current) {
|
|
73
|
+
return Number(value).toFixed(precision);
|
|
74
|
+
}
|
|
46
75
|
}
|
|
47
76
|
return value;
|
|
48
77
|
}
|
|
@@ -70,12 +99,12 @@ function saveSafeInteger(value, precision) {
|
|
|
70
99
|
}
|
|
71
100
|
return integerVal;
|
|
72
101
|
}
|
|
73
|
-
function getFormatter(formatterType, currencySymbol, isFocusRef, precision) {
|
|
102
|
+
function getFormatter(formatterType, currencySymbol, isFocusRef, precision, decimalLengthRef) {
|
|
74
103
|
if (formatterType === "currency") {
|
|
75
104
|
// let formatterFn: IFormatterFuc = (value) =>
|
|
76
105
|
// `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
77
106
|
var formatterFn = function (v) {
|
|
78
|
-
var value = getValue(v, isFocusRef, precision);
|
|
107
|
+
var value = getValue(v, isFocusRef, precision, decimalLengthRef);
|
|
79
108
|
var formattedValue = formatCurrency(value);
|
|
80
109
|
// 如果传入了货币符号,则添加货币符号前缀
|
|
81
110
|
if (currencySymbol) {
|
|
@@ -84,6 +113,7 @@ function getFormatter(formatterType, currencySymbol, isFocusRef, precision) {
|
|
|
84
113
|
return formattedValue;
|
|
85
114
|
};
|
|
86
115
|
var parserFn = function (val) {
|
|
116
|
+
trackDecimalLength(val, decimalLengthRef);
|
|
87
117
|
var value = val;
|
|
88
118
|
// 如果传入了货币符号,需要移除货币符号和空格
|
|
89
119
|
if (currencySymbol) {
|
|
@@ -103,10 +133,11 @@ function getFormatter(formatterType, currencySymbol, isFocusRef, precision) {
|
|
|
103
133
|
}
|
|
104
134
|
if (formatterType === "percent") {
|
|
105
135
|
var formatterFn = function (v) {
|
|
106
|
-
var value = getValue(v, isFocusRef, precision);
|
|
136
|
+
var value = getValue(v, isFocusRef, precision, decimalLengthRef);
|
|
107
137
|
return "".concat(value, "%");
|
|
108
138
|
};
|
|
109
139
|
var parserFn = function (value) {
|
|
140
|
+
trackDecimalLength(value, decimalLengthRef);
|
|
110
141
|
return value ? value.replace("%", "") : Number(value);
|
|
111
142
|
};
|
|
112
143
|
return {
|
|
@@ -117,10 +148,11 @@ function getFormatter(formatterType, currencySymbol, isFocusRef, precision) {
|
|
|
117
148
|
}
|
|
118
149
|
if (formatterType === "thousands") {
|
|
119
150
|
var formatterFn = function (v) {
|
|
120
|
-
var value = getValue(v, isFocusRef, precision);
|
|
151
|
+
var value = getValue(v, isFocusRef, precision, decimalLengthRef);
|
|
121
152
|
return "".concat(value, "\u2030");
|
|
122
153
|
};
|
|
123
154
|
var parserFn = function (value) {
|
|
155
|
+
trackDecimalLength(value, decimalLengthRef);
|
|
124
156
|
return value ? value.replace("‰", "") : Number(value);
|
|
125
157
|
};
|
|
126
158
|
return {
|
|
@@ -131,9 +163,10 @@ function getFormatter(formatterType, currencySymbol, isFocusRef, precision) {
|
|
|
131
163
|
}
|
|
132
164
|
return {
|
|
133
165
|
formatter: function (value) {
|
|
134
|
-
return getValue(value, isFocusRef, precision);
|
|
166
|
+
return getValue(value, isFocusRef, precision, decimalLengthRef);
|
|
135
167
|
},
|
|
136
168
|
parser: function (value) {
|
|
169
|
+
trackDecimalLength(value, decimalLengthRef);
|
|
137
170
|
// 移除千分符(兼容粘贴带千分符的数字)
|
|
138
171
|
value = value.replace(/,/g, "");
|
|
139
172
|
// 替换 。号
|
|
@@ -2,6 +2,9 @@ import { __assign, __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { memo, useCallback, useMemo, useState, useRef, useEffect } from 'react';
|
|
4
4
|
import { phoneValidate, validatePassword } from 'zmdms-utils';
|
|
5
|
+
import useLocale from '../config/useLocale.js';
|
|
6
|
+
import '../config/ZtxkContext.js';
|
|
7
|
+
import '../config/MyStorage.js';
|
|
5
8
|
import MemoForm from '../form/form.js';
|
|
6
9
|
import myMessage from '../message/index.js';
|
|
7
10
|
import Input from '../input/input.js';
|
|
@@ -11,6 +14,7 @@ import ModalComponent from '../modal/modal.js';
|
|
|
11
14
|
var countDownMaxTime = 60;
|
|
12
15
|
var ForgetPassword = function (_a) {
|
|
13
16
|
var checkUserPhone = _a.checkUserPhone, sendCode = _a.sendCode, submitRequest = _a.submitRequest, open = _a.open, setOpen = _a.setOpen;
|
|
17
|
+
var locale = useLocale().Login;
|
|
14
18
|
var form = MemoForm.useForm()[0];
|
|
15
19
|
var _b = useCountDwon(), countDown = _b[0], setCountDown = _b[1];
|
|
16
20
|
/**发送短信验证码 */
|
|
@@ -18,11 +22,11 @@ var ForgetPassword = function (_a) {
|
|
|
18
22
|
var phone = form.getFieldValue("phone");
|
|
19
23
|
var account = form.getFieldValue("account");
|
|
20
24
|
if (!account) {
|
|
21
|
-
myMessage.error(
|
|
25
|
+
myMessage.error(locale.usernameRequired);
|
|
22
26
|
return Promise.resolve(false);
|
|
23
27
|
}
|
|
24
28
|
if (!phone) {
|
|
25
|
-
myMessage.error(
|
|
29
|
+
myMessage.error(locale.phoneRequired);
|
|
26
30
|
return Promise.resolve(false);
|
|
27
31
|
}
|
|
28
32
|
if (!phoneValidate.regex.test(phone)) {
|
|
@@ -49,10 +53,10 @@ var ForgetPassword = function (_a) {
|
|
|
49
53
|
}, (countDown - 1) * 1000);
|
|
50
54
|
var _a = res.data, msg = _a.msg, success = _a.success;
|
|
51
55
|
if (success === "true") {
|
|
52
|
-
myMessage.success(
|
|
56
|
+
myMessage.success(locale.sendCodeSuccess);
|
|
53
57
|
}
|
|
54
58
|
else {
|
|
55
|
-
myMessage.warning(msg ||
|
|
59
|
+
myMessage.warning(msg || locale.sendCodeFailed);
|
|
56
60
|
}
|
|
57
61
|
})
|
|
58
62
|
.catch(function (err) {
|
|
@@ -60,7 +64,7 @@ var ForgetPassword = function (_a) {
|
|
|
60
64
|
setTimeout(function () {
|
|
61
65
|
resolve(1);
|
|
62
66
|
}, (countDown - 1) * 1000);
|
|
63
|
-
myMessage.warning(((_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) ||
|
|
67
|
+
myMessage.warning(((_b = (_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || locale.sendCodeFailed);
|
|
64
68
|
});
|
|
65
69
|
})
|
|
66
70
|
.catch(function () {
|
package/dist/es/login/index.js
CHANGED
|
@@ -4,6 +4,9 @@ import { useState, useEffect, useImperativeHandle } from 'react';
|
|
|
4
4
|
import { Form, Checkbox } from 'antd';
|
|
5
5
|
import { decrypt, encrypt } from './utils.js';
|
|
6
6
|
import ForgetPassword from './forget-password.js';
|
|
7
|
+
import useLocale from '../config/useLocale.js';
|
|
8
|
+
import '../config/ZtxkContext.js';
|
|
9
|
+
import '../config/MyStorage.js';
|
|
7
10
|
import Input from '../input/input.js';
|
|
8
11
|
import IconFont from '../icon/index.js';
|
|
9
12
|
import ButtonCom from '../button/button.js';
|
|
@@ -15,6 +18,7 @@ var USERPWS_KEY = "kVhfO";
|
|
|
15
18
|
var KEY = "simide";
|
|
16
19
|
var Login = function (props) {
|
|
17
20
|
var loginLogo = props.loginLogo, loginBg = props.loginBg, onFinishHandle = props.onFinishHandle, loading = props.loading, customRender = props.customRender, checkUserPhone = props.checkUserPhone, sendCode = props.sendCode, submitRequest = props.submitRequest, captcha = props.captcha, getCaptcha = props.getCaptcha, prefixRender = props.prefixRender, suffixRender = props.suffixRender, loginHandleRef = props.loginHandleRef, bottomPrefixRender = props.bottomPrefixRender, bottomSuffixRender = props.bottomSuffixRender;
|
|
21
|
+
var locale = useLocale().Login;
|
|
18
22
|
var _a = useState(false), open = _a[0], setOpen = _a[1];
|
|
19
23
|
var form = Form.useForm()[0];
|
|
20
24
|
useEffect(function () {
|
|
@@ -58,24 +62,24 @@ var Login = function (props) {
|
|
|
58
62
|
form: form,
|
|
59
63
|
};
|
|
60
64
|
});
|
|
61
|
-
return customRender ? (customRender({ form: form, rememberPsd: rememberPsd })) : (jsx("div", __assign({ className: "login-wrap", style: { backgroundImage: "url(".concat(loginBg, ")") } }, { children: jsxs(Form, __assign({ form: form, requiredMark: false, layout: "vertical", className: "login-form", onFinish: onFinish }, { children: [loginLogo ? (jsx("div", __assign({ className: "login-logo" }, { children: jsx("img", { src: loginLogo, title:
|
|
65
|
+
return customRender ? (customRender({ form: form, rememberPsd: rememberPsd })) : (jsx("div", __assign({ className: "login-wrap", style: { backgroundImage: "url(".concat(loginBg, ")") } }, { children: jsxs(Form, __assign({ form: form, requiredMark: false, layout: "vertical", className: "login-form", onFinish: onFinish }, { children: [loginLogo ? (jsx("div", __assign({ className: "login-logo" }, { children: jsx("img", { src: loginLogo, title: locale.logoTitle, alt: "zszt_logo" }) }))) : null, prefixRender, jsx(Item, __assign({ label: locale.accountLabel, name: "username", rules: [
|
|
62
66
|
{
|
|
63
67
|
required: true,
|
|
64
|
-
message:
|
|
68
|
+
message: locale.accountRequired,
|
|
65
69
|
},
|
|
66
|
-
] }, { children: jsx(Input, { size: "large", autoComplete: "username", prefix: jsx(IconFont, { type: "icon-yonghu", style: { fontSize: "14px", color: "rgba(0,0,0,.65)" } }) }) })), jsx(Item, __assign({ label:
|
|
70
|
+
] }, { children: jsx(Input, { size: "large", autoComplete: "username", prefix: jsx(IconFont, { type: "icon-yonghu", style: { fontSize: "14px", color: "rgba(0,0,0,.65)" } }) }) })), jsx(Item, __assign({ label: locale.passwordLabel, name: "password", rules: [
|
|
67
71
|
{
|
|
68
72
|
required: true,
|
|
69
|
-
message:
|
|
73
|
+
message: locale.passwordRequired,
|
|
70
74
|
},
|
|
71
|
-
] }, { children: jsx(Input.Password, { size: "large", autoComplete: "current-password", prefix: jsx(IconFont, { type: "icon-mima", style: { fontSize: "14px", color: "rgba(0,0,0,.65)" } }) }) })), suffixRender, captcha ? (jsx(Item, __assign({ label:
|
|
75
|
+
] }, { children: jsx(Input.Password, { size: "large", autoComplete: "current-password", prefix: jsx(IconFont, { type: "icon-mima", style: { fontSize: "14px", color: "rgba(0,0,0,.65)" } }) }) })), suffixRender, captcha ? (jsx(Item, __assign({ label: locale.captchaLabel, name: "captcha", rules: [
|
|
72
76
|
{
|
|
73
77
|
required: true,
|
|
74
|
-
message:
|
|
78
|
+
message: locale.captchaRequired,
|
|
75
79
|
},
|
|
76
|
-
] }, { children: jsx(Input, { size: "large", addonAfter: jsx("img", { src: (captcha === null || captcha === void 0 ? void 0 : captcha.image) || "", alt:
|
|
80
|
+
] }, { children: jsx(Input, { size: "large", addonAfter: jsx("img", { src: (captcha === null || captcha === void 0 ? void 0 : captcha.image) || "", alt: locale.captchaAlt, style: { height: "26px", cursor: "pointer" }, onClick: function () { return getCaptcha(); } }) }) }))) : null, jsx(Item, { children: jsx(ButtonCom, __assign({ htmlType: "submit", block: true, className: "form__item--button", loading: loading }, { children: locale.login })) }), bottomPrefixRender, jsxs("div", __assign({ className: "form__item--remember" }, { children: [jsx(Item, __assign({ name: "remember", valuePropName: "checked" }, { children: jsx(Checkbox, { children: locale.rememberPassword }) })), jsx("div", __assign({ className: "form__item--remember-forget", onClick: function () {
|
|
77
81
|
setOpen(true);
|
|
78
|
-
} }, { children:
|
|
82
|
+
} }, { children: locale.forgetPassword }))] })), bottomSuffixRender, jsx(ForgetPassword, { open: open, setOpen: setOpen, checkUserPhone: checkUserPhone, sendCode: sendCode, submitRequest: submitRequest })] })) })));
|
|
79
83
|
};
|
|
80
84
|
Login.displayName = "ZTXK_WEBUI_Login";
|
|
81
85
|
|
package/dist/es/modal/modal.js
CHANGED
|
@@ -6,10 +6,14 @@ import classNames from '../node_modules/classnames/index.js';
|
|
|
6
6
|
import { setCancelBtnProps } from './utils.js';
|
|
7
7
|
import useDraggable from './useDraggable.js';
|
|
8
8
|
import useResizable from './useResizable.js';
|
|
9
|
+
import useLocale from '../config/useLocale.js';
|
|
10
|
+
import '../config/ZtxkContext.js';
|
|
11
|
+
import '../config/MyStorage.js';
|
|
9
12
|
import myMessage from '../message/index.js';
|
|
10
13
|
|
|
11
14
|
var Modal = function (_a, ref) {
|
|
12
15
|
var className = _a.className, defaultOpen = _a.defaultOpen, defaultTitle = _a.defaultTitle, defaultConfirmMsg = _a.defaultConfirmMsg, defaultConfirmOkText = _a.defaultConfirmOkText, defaultType = _a.defaultType, confirmPreHandle = _a.confirmPreHandle, confirmOnOk = _a.confirmOnOk, onOk = _a.onOk, footer = _a.footer, onOkValidate = _a.onOkValidate, _b = _a.isDrag, isDrag = _b === void 0 ? true : _b, _c = _a.isResize, isResize = _c === void 0 ? false : _c, minWidth = _a.minWidth, minHeight = _a.minHeight, maxWidth = _a.maxWidth, maxHeight = _a.maxHeight, defaultHeight = _a.defaultHeight, modalTitle = _a.title, modalRender = _a.modalRender, resetProps = __rest(_a, ["className", "defaultOpen", "defaultTitle", "defaultConfirmMsg", "defaultConfirmOkText", "defaultType", "confirmPreHandle", "confirmOnOk", "onOk", "footer", "onOkValidate", "isDrag", "isResize", "minWidth", "minHeight", "maxWidth", "maxHeight", "defaultHeight", "title", "modalRender"]);
|
|
16
|
+
var locale = useLocale().Modal;
|
|
13
17
|
var classes = classNames("ztxk-modal", isResize && "ztxk-modal-resize", className);
|
|
14
18
|
// 模态框基本属性
|
|
15
19
|
var _d = useState(defaultOpen), open = _d[0], setOpen = _d[1];
|
|
@@ -69,7 +73,7 @@ var Modal = function (_a, ref) {
|
|
|
69
73
|
? options.confirmOkText
|
|
70
74
|
: confirmOkText
|
|
71
75
|
? confirmOkText
|
|
72
|
-
:
|
|
76
|
+
: locale.confirmSave,
|
|
73
77
|
keyboard: false,
|
|
74
78
|
maskClosable: false,
|
|
75
79
|
onOk: confirmOnOk
|
|
@@ -158,7 +162,7 @@ var Modal = function (_a, ref) {
|
|
|
158
162
|
modalRender: modalRender,
|
|
159
163
|
}), dragTitle = _m.dragTitle, dragModalRender = _m.dragModalRender;
|
|
160
164
|
var finalWidth = isResize ? resizableWidth : resetProps.width || "70%";
|
|
161
|
-
return (jsx(Modal$1, __assign({ open: open, onCancel: close, className: classes, okText:
|
|
165
|
+
return (jsx(Modal$1, __assign({ open: open, onCancel: close, className: classes, okText: locale.save, onOk: footer ? undefined : onOkHandle, title: dragTitle, keyboard: false, maskClosable: false, confirmLoading: loading, cancelButtonProps: { loading: loading }, footer: footer, modalRender: function (modal) {
|
|
162
166
|
var resized = resizableModalRender(modal);
|
|
163
167
|
var dragged = dragModalRender(resized);
|
|
164
168
|
return dragged;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { __assign, __rest } from '../_virtual/_tslib.js';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { useRef, useState } from 'react';
|
|
4
|
-
import '../config/
|
|
4
|
+
import useLocale from '../config/useLocale.js';
|
|
5
5
|
import useBaseContext from '../config/useBaseContext.js';
|
|
6
|
+
import '../config/ZtxkContext.js';
|
|
6
7
|
import '../config/MyStorage.js';
|
|
7
8
|
import { getFinalValue } from '../config/utils.js';
|
|
8
9
|
import classNames from '../node_modules/classnames/index.js';
|
|
@@ -14,6 +15,7 @@ var OperationBtn = function (props) {
|
|
|
14
15
|
var _a, _b, _c, _d, _e;
|
|
15
16
|
var statusBtnConfig = props.statusBtnConfig, authUserBtns = props.authUserBtns, callback = props.callback, isOperationBtnGroupShowMore = props.isOperationBtnGroupShowMore, _f = props.defaultShowNum, defaultShowNum = _f === void 0 ? 2 : _f, compact = props.compact;
|
|
16
17
|
var enableOperationBtnGroupShowMore = useBaseContext().enableOperationBtnGroupShowMore;
|
|
18
|
+
var locale = useLocale().OperationBtn;
|
|
17
19
|
// 操作按钮是否默认展示更多按钮
|
|
18
20
|
var isOperationBtnGroupShowMoreEnabled = getFinalValue(enableOperationBtnGroupShowMore, isOperationBtnGroupShowMore);
|
|
19
21
|
var containerRef = useRef(null);
|
|
@@ -40,7 +42,7 @@ var OperationBtn = function (props) {
|
|
|
40
42
|
isAuth = !!authUserBtns.find(function (item) { return item.code === authority; });
|
|
41
43
|
}
|
|
42
44
|
if (confirmMsg) {
|
|
43
|
-
return !isAuth ? null : (jsx(Popconfirm, __assign({ title: confirmMsg, cancelText:
|
|
45
|
+
return !isAuth ? null : (jsx(Popconfirm, __assign({ title: confirmMsg, cancelText: locale.no, okText: locale.yes, onConfirm: function () { return onClickHandle(type); } }, { children: jsx(ButtonCom, __assign({ type: "link", style: {
|
|
44
46
|
height: 28,
|
|
45
47
|
}, compact: compact, disabled: !isAuth }, resetConfig, { children: name })) }), type));
|
|
46
48
|
}
|
|
@@ -62,7 +64,7 @@ var OperationBtn = function (props) {
|
|
|
62
64
|
height: 28,
|
|
63
65
|
}, compact: compact, className: "operation_btn_more", onClick: function () {
|
|
64
66
|
setShowMore(!showMore);
|
|
65
|
-
} }, { children: [
|
|
67
|
+
} }, { children: [locale.more, jsx(IconFont, { type: "icon-a-lujingbiankuang", style: {
|
|
66
68
|
fontSize: 12,
|
|
67
69
|
marginLeft: 2,
|
|
68
70
|
color: "#768696",
|
package/dist/es/select/hooks.js
CHANGED
|
@@ -2,6 +2,9 @@ import { __assign } from '../_virtual/_tslib.js';
|
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useState, useRef, useMemo, useCallback, useEffect } from 'react';
|
|
4
4
|
import { unescapeString } from 'zmdms-utils';
|
|
5
|
+
import useLocale from '../config/useLocale.js';
|
|
6
|
+
import '../config/ZtxkContext.js';
|
|
7
|
+
import '../config/MyStorage.js';
|
|
5
8
|
import MemoSelect from './select.js';
|
|
6
9
|
import { Divider } from 'antd';
|
|
7
10
|
|
|
@@ -79,6 +82,7 @@ function createRenderItem(item, options) {
|
|
|
79
82
|
}
|
|
80
83
|
function useRenderChildren(props) {
|
|
81
84
|
var list = props.list, defaultList = props.defaultList, _a = props.dataKey, dataKey = _a === void 0 ? "id" : _a, _b = props.titleKey, titleKey = _b === void 0 ? "name" : _b, joinKey = props.joinKey, joinStr = props.joinStr, lineFeedKey = props.lineFeedKey, lineFeedStr = props.lineFeedStr, showAll = props.showAll, children = props.children, disabledValues = props.disabledValues, isDisabled = props.isDisabled, createKey = props.createKey, createId = props.createId;
|
|
85
|
+
var locale = useLocale().Select;
|
|
82
86
|
var resultList = useMemo(function () {
|
|
83
87
|
return concatHandle(list, {
|
|
84
88
|
arr2: defaultList,
|
|
@@ -91,7 +95,7 @@ function useRenderChildren(props) {
|
|
|
91
95
|
return children;
|
|
92
96
|
}
|
|
93
97
|
if (Array.isArray(resultList)) {
|
|
94
|
-
return (jsxs(Fragment, { children: [showAll ? (jsx(MemoSelect.Option, __assign({ title:
|
|
98
|
+
return (jsxs(Fragment, { children: [showAll ? (jsx(MemoSelect.Option, __assign({ title: locale.all, oldTitle: locale.all, value: "" }, { children: locale.all }))) : null, resultList === null || resultList === void 0 ? void 0 : resultList.map(function (item, index) {
|
|
95
99
|
if (!item) {
|
|
96
100
|
console.error("\u9ED8\u8BA4\u6570\u636E\u4E2D\u6709\u7A7A\u503C \u4F4D\u7F6E\u518Dlist\u4E2D\u7B2C".concat(index + 1, "\u9879"));
|
|
97
101
|
return null;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { __assign } from '../../_virtual/_tslib.js';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import { memo } from 'react';
|
|
4
|
+
import useLocale from '../../config/useLocale.js';
|
|
5
|
+
import '../../config/ZtxkContext.js';
|
|
6
|
+
import '../../config/MyStorage.js';
|
|
4
7
|
import MinusSquareOutlined from '../../node_modules/@ant-design/icons/es/icons/MinusSquareOutlined.js';
|
|
5
8
|
import PlusSquareOutlined from '../../node_modules/@ant-design/icons/es/icons/PlusSquareOutlined.js';
|
|
6
9
|
import PlusOutlined from '../../node_modules/@ant-design/icons/es/icons/PlusOutlined.js';
|
|
@@ -8,18 +11,21 @@ import MinusOutlined from '../../node_modules/@ant-design/icons/es/icons/MinusOu
|
|
|
8
11
|
import { Popconfirm } from 'antd';
|
|
9
12
|
|
|
10
13
|
var ColumnAddDel = function (_a) {
|
|
11
|
-
var isAdd = _a.isAdd, isDel = _a.isDel, onAddAndDel = _a.onAddAndDel, index = _a.index,
|
|
12
|
-
|
|
14
|
+
var isAdd = _a.isAdd, isDel = _a.isDel, onAddAndDel = _a.onAddAndDel, index = _a.index, delPopTitle = _a.delPopTitle;
|
|
15
|
+
var locale = useLocale().Table;
|
|
16
|
+
return (jsxs(Fragment, { children: [isAdd ? (jsx("div", __assign({ className: "ztxk-column--adddel-icon" }, { children: jsx(PlusOutlined, { title: locale.addRow, onClick: function () {
|
|
13
17
|
onAddAndDel && onAddAndDel("add", index);
|
|
14
|
-
} }) }))) : null, isDel ? (jsx("div", __assign({ className: "ztxk-column--adddel-icon" }, { children: jsx(Popconfirm, __assign({ title: delPopTitle, onConfirm: function () { return onAddAndDel && onAddAndDel("del", index); } }, { children: jsx(MinusOutlined, { title:
|
|
18
|
+
} }) }))) : null, isDel ? (jsx("div", __assign({ className: "ztxk-column--adddel-icon" }, { children: jsx(Popconfirm, __assign({ title: delPopTitle !== null && delPopTitle !== void 0 ? delPopTitle : locale.confirmDeleteRow, onConfirm: function () { return onAddAndDel && onAddAndDel("del", index); } }, { children: jsx(MinusOutlined, { title: locale.deleteRow }) })) }))) : null] }));
|
|
15
19
|
};
|
|
16
20
|
var ColumnDelAll = memo(function (_a) {
|
|
17
21
|
var onAddAndDel = _a.onAddAndDel;
|
|
18
|
-
|
|
22
|
+
var locale = useLocale().Table;
|
|
23
|
+
return (jsx(Popconfirm, __assign({ title: locale.confirmDeleteAll, onConfirm: function () { return onAddAndDel && onAddAndDel("delAll", 0); } }, { children: jsx(MinusSquareOutlined, { title: locale.deleteAllRows }) })));
|
|
19
24
|
});
|
|
20
25
|
var ColumnAdd = memo(function (_a) {
|
|
21
26
|
var onAddAndDel = _a.onAddAndDel;
|
|
22
|
-
|
|
27
|
+
var locale = useLocale().Table;
|
|
28
|
+
return (jsx(PlusSquareOutlined, { title: locale.appendRow, onClick: function () { return onAddAndDel && onAddAndDel("add", 0); } }));
|
|
23
29
|
});
|
|
24
30
|
var ColumnAddDel$1 = memo(ColumnAddDel);
|
|
25
31
|
|
|
@@ -6,8 +6,9 @@ import { getInnerIndex } from '../useInnerPagination.js';
|
|
|
6
6
|
import { getFormatter } from '../../inputnumber/utils.js';
|
|
7
7
|
import { useLatest } from 'ahooks';
|
|
8
8
|
import classNames from '../../node_modules/classnames/index.js';
|
|
9
|
-
import '../../config/
|
|
9
|
+
import { getLocale } from '../../config/useLocale.js';
|
|
10
10
|
import useBaseContext from '../../config/useBaseContext.js';
|
|
11
|
+
import '../../config/ZtxkContext.js';
|
|
11
12
|
import '../../config/MyStorage.js';
|
|
12
13
|
import Input from '../../input/input.js';
|
|
13
14
|
import InputNumber from '../../inputnumber/inputNumber.js';
|
|
@@ -297,7 +298,7 @@ var EnhanceCell = function (props) {
|
|
|
297
298
|
function validateHandle(_a) {
|
|
298
299
|
var validateRef = _a.validateRef, value = _a.value, itemRef = _a.itemRef, indexRef = _a.indexRef, titleRef = _a.titleRef, dataIndexRef = _a.dataIndexRef;
|
|
299
300
|
return __awaiter(this, void 0, void 0, function () {
|
|
300
|
-
var validate, item, index, title, dataIndex, validateFn, pattern, message, newItem, err_2, i, rp;
|
|
301
|
+
var validate, item, index, title, dataIndex, validateFn, pattern, message, locale, newItem, err_2, i, rp;
|
|
301
302
|
var _b;
|
|
302
303
|
return __generator(this, function (_c) {
|
|
303
304
|
switch (_c.label) {
|
|
@@ -309,6 +310,7 @@ function validateHandle(_a) {
|
|
|
309
310
|
dataIndex = dataIndexRef.current;
|
|
310
311
|
if (!validate) return [3 /*break*/, 5];
|
|
311
312
|
validateFn = validate.validate, pattern = validate.pattern, message = validate.message;
|
|
313
|
+
locale = getLocale().Table;
|
|
312
314
|
if (!(typeof validateFn === "function")) return [3 /*break*/, 4];
|
|
313
315
|
_c.label = 1;
|
|
314
316
|
case 1:
|
|
@@ -331,7 +333,7 @@ function validateHandle(_a) {
|
|
|
331
333
|
return [2 /*return*/, Promise.reject({
|
|
332
334
|
errors: Array.isArray(message)
|
|
333
335
|
? message[i]
|
|
334
|
-
: message ||
|
|
336
|
+
: message || locale.fillError,
|
|
335
337
|
})];
|
|
336
338
|
}
|
|
337
339
|
}
|
|
@@ -339,7 +341,7 @@ function validateHandle(_a) {
|
|
|
339
341
|
else {
|
|
340
342
|
if (!(pattern === null || pattern === void 0 ? void 0 : pattern.test(value))) {
|
|
341
343
|
return [2 /*return*/, Promise.reject({
|
|
342
|
-
errors: message ||
|
|
344
|
+
errors: message || locale.fillError,
|
|
343
345
|
})];
|
|
344
346
|
}
|
|
345
347
|
}
|
|
@@ -347,7 +349,7 @@ function validateHandle(_a) {
|
|
|
347
349
|
// 非空校验
|
|
348
350
|
if ((value === "" || value == null) && !validateFn && !pattern) {
|
|
349
351
|
return [2 /*return*/, Promise.reject({
|
|
350
|
-
errors:
|
|
352
|
+
errors: locale.requiredError,
|
|
351
353
|
})];
|
|
352
354
|
}
|
|
353
355
|
return [3 /*break*/, 6];
|
|
@@ -2,6 +2,9 @@ import { __assign } from '../../_virtual/_tslib.js';
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useMemo, useEffect, useState } from 'react';
|
|
4
4
|
import { useLatest } from 'ahooks';
|
|
5
|
+
import useLocale from '../../config/useLocale.js';
|
|
6
|
+
import '../../config/ZtxkContext.js';
|
|
7
|
+
import '../../config/MyStorage.js';
|
|
5
8
|
import Input from '../../input/input.js';
|
|
6
9
|
import ButtonCom from '../../button/button.js';
|
|
7
10
|
import myMessage from '../../message/index.js';
|
|
@@ -12,6 +15,7 @@ import QuestionCircleOutlined from '../../node_modules/@ant-design/icons/es/icon
|
|
|
12
15
|
* 列头过滤组件
|
|
13
16
|
*/
|
|
14
17
|
var FilterDropdown = function (props) {
|
|
18
|
+
var locale = useLocale().Table;
|
|
15
19
|
var dataSource = props.dataSource, filterKey = props.filterKey, filterSearchValue = props.filterSearchValue, filterSearchValueChange = props.filterSearchValueChange, defaultFilterSearchValue = props.defaultFilterSearchValue, filterSearchCheckboxValue = props.filterSearchCheckboxValue, defaultFilterSearchCheckboxValue = props.defaultFilterSearchCheckboxValue, filterSearchCheckboxValueChange = props.filterSearchCheckboxValueChange, setSelectedKeys = props.setSelectedKeys, confirm = props.confirm, clearFilters = props.clearFilters, searchValueInputRef = props.searchValueInputRef, onFilterChange = props.onFilterChange, column = props.column;
|
|
16
20
|
var columnRef = useLatest(column);
|
|
17
21
|
var lastSetSelectedKeys = useLatest(setSelectedKeys);
|
|
@@ -74,9 +78,9 @@ var FilterDropdown = function (props) {
|
|
|
74
78
|
closeDropdown: true,
|
|
75
79
|
});
|
|
76
80
|
};
|
|
77
|
-
return (jsxs("div", __assign({ className: "ztxk-table--filter", onKeyDown: function (e) { return e.stopPropagation(); } }, { children: [jsx(Input, { placeholder:
|
|
78
|
-
return (jsx(Checkbox, __assign({ value: item.value }, { children: item.value === "__null__" ?
|
|
79
|
-
}) })), jsxs("div", __assign({ className: "ztxk-table--filter__btn-container" }, { children: [jsxs(ButtonCom, __assign({ type: "primary", onClick: onSearchHand }, { children: [
|
|
81
|
+
return (jsxs("div", __assign({ className: "ztxk-table--filter", onKeyDown: function (e) { return e.stopPropagation(); } }, { children: [jsx(Input, { placeholder: locale.filterPlaceholder, value: searchValue, onChange: onSearchValueChange, onPressEnter: onSearchValuePressEnter, ref: searchValueInputRef }), jsx(Checkbox.Group, __assign({ className: "ztxk-table--filter__checkbox-container", value: searchCheckboxValue, onChange: onSearchCheckboxValueChange }, { children: currentData.map(function (item) {
|
|
82
|
+
return (jsx(Checkbox, __assign({ value: item.value }, { children: item.value === "__null__" ? locale.filterEmptyValue : item.value }), item.value));
|
|
83
|
+
}) })), jsxs("div", __assign({ className: "ztxk-table--filter__btn-container" }, { children: [jsxs(ButtonCom, __assign({ type: "primary", onClick: onSearchHand }, { children: [locale.filterSearch, jsx(Tooltip, __assign({ placement: "bottomLeft", title: locale.filterExpressionTip }, { children: jsx(QuestionCircleOutlined, {}) }))] })), jsx(ButtonCom, __assign({ onClick: onResetHand }, { children: locale.filterReset }))] }))] })));
|
|
80
84
|
};
|
|
81
85
|
// 获取数据
|
|
82
86
|
function getDataByKey(data, options) {
|
|
@@ -3,11 +3,15 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
4
|
import classNames from '../../node_modules/classnames/index.js';
|
|
5
5
|
import { ASCEND, DESCEND } from '../constant.js';
|
|
6
|
+
import useLocale from '../../config/useLocale.js';
|
|
7
|
+
import '../../config/ZtxkContext.js';
|
|
8
|
+
import '../../config/MyStorage.js';
|
|
6
9
|
import CaretUpOutlined from '../../node_modules/@ant-design/icons/es/icons/CaretUpOutlined.js';
|
|
7
10
|
import CaretDownOutlined from '../../node_modules/@ant-design/icons/es/icons/CaretDownOutlined.js';
|
|
8
11
|
|
|
9
12
|
var SortTitle = function (_a) {
|
|
10
13
|
var title = _a.title, field = _a.field, onChange = _a.onChange, customOrder = _a.customOrder, setCustomOrder = _a.setCustomOrder, align = _a.align, isStress = _a.isStress;
|
|
14
|
+
var locale = useLocale().Table;
|
|
11
15
|
var order = !customOrder
|
|
12
16
|
? null
|
|
13
17
|
: (customOrder === null || customOrder === void 0 ? void 0 : customOrder.field) === field
|
|
@@ -33,15 +37,15 @@ var SortTitle = function (_a) {
|
|
|
33
37
|
};
|
|
34
38
|
var currentTitle = useMemo(function () {
|
|
35
39
|
if (order === ASCEND) {
|
|
36
|
-
return
|
|
40
|
+
return locale.sortDescend;
|
|
37
41
|
}
|
|
38
42
|
else if (order === DESCEND) {
|
|
39
|
-
return
|
|
43
|
+
return locale.sortCancel;
|
|
40
44
|
}
|
|
41
45
|
else {
|
|
42
|
-
return
|
|
46
|
+
return locale.sortAscend;
|
|
43
47
|
}
|
|
44
|
-
}, [order]);
|
|
48
|
+
}, [order, locale]);
|
|
45
49
|
var titleClassName = classNames("ztxk-table--sorter-title", {
|
|
46
50
|
"ztxk-table--title-stress": isStress,
|
|
47
51
|
});
|
|
@@ -4,9 +4,13 @@ import { useState, useEffect, useImperativeHandle } from 'react';
|
|
|
4
4
|
import { Menu as it, Item as pt } from '../../node_modules/react-contexify/dist/index.js';
|
|
5
5
|
import screenfull from '../../node_modules/screenfull/index.js';
|
|
6
6
|
import { useLatest } from 'ahooks';
|
|
7
|
+
import useLocale from '../../config/useLocale.js';
|
|
8
|
+
import '../../config/ZtxkContext.js';
|
|
9
|
+
import '../../config/MyStorage.js';
|
|
7
10
|
|
|
8
11
|
var TableMenu = function (_a) {
|
|
9
12
|
var menuId = _a.menuId, tableRef = _a.tableRef, isFullscreenHandle = _a.isFullscreenHandle, tableMenuRef = _a.tableMenuRef;
|
|
13
|
+
var locale = useLocale().Table;
|
|
10
14
|
var _b = useState(false), isFull = _b[0], setIsFull = _b[1];
|
|
11
15
|
var isFullscreenHandleRef = useLatest(isFullscreenHandle);
|
|
12
16
|
function toggleFullscreen() {
|
|
@@ -59,7 +63,7 @@ var TableMenu = function (_a) {
|
|
|
59
63
|
useImperativeHandle(tableMenuRef, function () { return ({
|
|
60
64
|
toggleFullscreen: toggleFullscreen,
|
|
61
65
|
}); });
|
|
62
|
-
return (jsxs(Fragment, { children: [jsx(it, __assign({ id: menuId }, { children: jsx(pt, __assign({ data: "fullscreen", onClick: onMenuItemClick }, { children: isFull ?
|
|
66
|
+
return (jsxs(Fragment, { children: [jsx(it, __assign({ id: menuId }, { children: jsx(pt, __assign({ data: "fullscreen", onClick: onMenuItemClick }, { children: isFull ? locale.exitFullscreen : locale.fullscreen })) })), isFull ? (jsx("div", __assign({ className: "ztxk-table--exit-fullscreen", onClick: toggleFullscreen }, { children: locale.exitFullscreen }))) : null] }));
|
|
63
67
|
};
|
|
64
68
|
|
|
65
69
|
export { TableMenu as default };
|
|
@@ -3,12 +3,16 @@ import { jsx, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
import FillDown from './table-header-operation/FillDown.js';
|
|
5
5
|
import CopyColumn from './table-header-operation/CopyColumn.js';
|
|
6
|
+
import useLocale from '../../config/useLocale.js';
|
|
7
|
+
import '../../config/ZtxkContext.js';
|
|
8
|
+
import '../../config/MyStorage.js';
|
|
6
9
|
import ButtonCom from '../../button/button.js';
|
|
7
10
|
import DownOutlined from '../../node_modules/@ant-design/icons/es/icons/DownOutlined.js';
|
|
8
11
|
import { Dropdown } from 'antd';
|
|
9
12
|
|
|
10
13
|
var TitleOperation = function (_a) {
|
|
11
14
|
var copyKey = _a.copyKey, dataSourceRef = _a.dataSourceRef, isFillDown = _a.isFillDown, dataKey = _a.dataKey, onTableChange = _a.onTableChange, filterConfigRef = _a.filterConfigRef;
|
|
15
|
+
var locale = useLocale().Table;
|
|
12
16
|
var items = [];
|
|
13
17
|
// 如果需要添加复制粘贴功能
|
|
14
18
|
if (typeof copyKey === "string" || Array.isArray(copyKey)) {
|
|
@@ -24,7 +28,7 @@ var TitleOperation = function (_a) {
|
|
|
24
28
|
label: (jsx(FillDown, { dataKey: dataKey, isFillDown: isFillDown, dataSourceRef: dataSourceRef, onTableChange: onTableChange })),
|
|
25
29
|
});
|
|
26
30
|
}
|
|
27
|
-
return (jsx(Fragment, { children: items.length > 0 ? (jsx(Dropdown, __assign({ menu: { items: items }, trigger: ["click"] }, { children: jsx(ButtonCom, { style: { width: 20 }, type: "link", icon: jsx(DownOutlined, {}), title:
|
|
31
|
+
return (jsx(Fragment, { children: items.length > 0 ? (jsx(Dropdown, __assign({ menu: { items: items }, trigger: ["click"] }, { children: jsx(ButtonCom, { style: { width: 20 }, type: "link", icon: jsx(DownOutlined, {}), title: locale.toolsTip }) }))) : null }));
|
|
28
32
|
};
|
|
29
33
|
var TitleOperation$1 = memo(TitleOperation);
|
|
30
34
|
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { __assign } from '../../../_virtual/_tslib.js';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { memo } from 'react';
|
|
4
|
+
import useLocale from '../../../config/useLocale.js';
|
|
5
|
+
import '../../../config/ZtxkContext.js';
|
|
6
|
+
import '../../../config/MyStorage.js';
|
|
4
7
|
import myMessage from '../../../message/index.js';
|
|
5
8
|
import VerticalAlignBottomOutlined from '../../../node_modules/@ant-design/icons/es/icons/VerticalAlignBottomOutlined.js';
|
|
6
9
|
import { Tooltip } from 'antd';
|
|
7
10
|
|
|
8
11
|
var FillDown = function (_a) {
|
|
9
12
|
var isFillDown = _a.isFillDown, dataSourceRef = _a.dataSourceRef, dataKey = _a.dataKey, onTableChange = _a.onTableChange;
|
|
10
|
-
|
|
13
|
+
var locale = useLocale().Table;
|
|
14
|
+
return (jsx(Tooltip, __assign({ title: locale.fillDownTip }, { children: jsxs("div", __assign({ onClick: function () {
|
|
11
15
|
if (!Array.isArray(dataSourceRef === null || dataSourceRef === void 0 ? void 0 : dataSourceRef.current) ||
|
|
12
16
|
(dataSourceRef === null || dataSourceRef === void 0 ? void 0 : dataSourceRef.current.length) <= 1 ||
|
|
13
17
|
!isFillDown) {
|
|
14
|
-
myMessage.info(
|
|
18
|
+
myMessage.info(locale.noNeedFill);
|
|
15
19
|
return;
|
|
16
20
|
}
|
|
17
21
|
var newDataSource = [];
|
|
@@ -46,7 +50,7 @@ var FillDown = function (_a) {
|
|
|
46
50
|
field: dataKey,
|
|
47
51
|
});
|
|
48
52
|
}
|
|
49
|
-
} }, { children: [jsx(VerticalAlignBottomOutlined, { style: { fontSize: "16px" }, className: "thead-icon" }),
|
|
53
|
+
} }, { children: [jsx(VerticalAlignBottomOutlined, { style: { fontSize: "16px" }, className: "thead-icon" }), locale.fillDown] })) })));
|
|
50
54
|
};
|
|
51
55
|
var FillDown$1 = memo(FillDown);
|
|
52
56
|
|
package/dist/es/table/excel.js
CHANGED
|
@@ -5,6 +5,10 @@ import { useMemoizedFn } from 'ahooks';
|
|
|
5
5
|
import { IS_SUMMARY, MERGE_ROW_SPANS } from './constant.js';
|
|
6
6
|
import { plus, exactRound } from 'zmdms-utils';
|
|
7
7
|
import dayjs from 'dayjs';
|
|
8
|
+
import { getLocale } from '../config/useLocale.js';
|
|
9
|
+
import 'react';
|
|
10
|
+
import '../config/ZtxkContext.js';
|
|
11
|
+
import '../config/MyStorage.js';
|
|
8
12
|
|
|
9
13
|
// 内部常量,用于标记父数据
|
|
10
14
|
var IS_PARENT = "__is_parent__";
|
|
@@ -74,7 +78,7 @@ function exportToExcelWithMergeAndComments(records, columns, mergeKeys, numKeys,
|
|
|
74
78
|
if (childrenColumnName === void 0) { childrenColumnName = "children"; }
|
|
75
79
|
if (flatChildren === void 0) { flatChildren = true; }
|
|
76
80
|
if (!records || records.length === 0) {
|
|
77
|
-
throw new Error(
|
|
81
|
+
throw new Error(getLocale().Table.noDataToExport);
|
|
78
82
|
}
|
|
79
83
|
// 扁平化树形数据:flatChildren=false 时只保留父行(收起态导出)
|
|
80
84
|
var flattenedRecords = flatChildren
|
|
@@ -116,7 +120,7 @@ function exportToExcelWithMergeAndComments(records, columns, mergeKeys, numKeys,
|
|
|
116
120
|
});
|
|
117
121
|
summaryRow = excelData.leafColumns.map(function (col, index) {
|
|
118
122
|
if (index === 0)
|
|
119
|
-
return
|
|
123
|
+
return getLocale().Table.total;
|
|
120
124
|
var key = col.dataIndex;
|
|
121
125
|
if (col.isSummary && sumsByKey_1[key] !== undefined) {
|
|
122
126
|
if (col.totalCalcCallback) {
|
|
@@ -265,10 +269,10 @@ function addCommentsToWorksheet(worksheet, data, columns, headerRowCount) {
|
|
|
265
269
|
formulae: [0],
|
|
266
270
|
showErrorMessage: true,
|
|
267
271
|
errorStyle: "information",
|
|
268
|
-
errorTitle:
|
|
272
|
+
errorTitle: getLocale().Table.excelTip,
|
|
269
273
|
error: badgeText,
|
|
270
274
|
showInputMessage: true,
|
|
271
|
-
promptTitle:
|
|
275
|
+
promptTitle: getLocale().Table.excelTip,
|
|
272
276
|
prompt: badgeText,
|
|
273
277
|
};
|
|
274
278
|
}
|