@zat-design/sisyphus-react 3.1.5 → 3.2.0-beta.1
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/index.esm.css +176 -251
- package/es/ProAction/index.js +7 -5
- package/es/ProAction/index.less +3 -2
- package/es/ProConfigProvider/index.d.ts +2 -0
- package/es/ProConfigProvider/index.js +23 -2
- package/es/ProDownload/utils.js +6 -3
- package/es/ProDrawerForm/components/ProDrawer/index.js +6 -4
- package/es/ProDrawerForm/index.js +5 -3
- package/es/ProDrawerForm/style/index.less +15 -11
- package/es/ProEditLabel/style/index.less +2 -2
- package/es/ProEditTable/components/ActionButton/index.js +3 -2
- package/es/ProEditTable/components/RenderField/index.js +2 -1
- package/es/ProEditTable/index.js +7 -6
- package/es/ProEditTable/style/index.less +15 -8
- package/es/ProEditTable/utils/config.d.ts +8 -8
- package/es/ProEditTable/utils/config.js +20 -12
- package/es/ProEditTable/utils/index.js +3 -2
- package/es/ProEnum/hooks/useEnumRequest.js +17 -10
- package/es/ProEnum/index.js +9 -4
- package/es/ProEnum/style/index.less +1 -1
- package/es/ProForm/components/FormFooter/index.js +16 -20
- package/es/ProForm/components/base/Input/index.js +4 -3
- package/es/ProForm/components/base/InputNumber/index.js +4 -3
- package/es/ProForm/components/base/RangePicker/index.js +0 -3
- package/es/ProForm/components/base/Select/index.js +2 -1
- package/es/ProForm/components/base/Switch/index.js +9 -5
- package/es/ProForm/components/base/SwitchCheckbox/index.js +2 -1
- package/es/ProForm/components/base/TextArea/index.js +4 -2
- package/es/ProForm/components/base/TextArea/index.less +1 -1
- package/es/ProForm/components/combination/Container/style/index.less +0 -1
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
- package/es/ProForm/components/combination/FormList/style/index.less +20 -19
- package/es/ProForm/components/combination/Group/index.js +2 -2
- package/es/ProForm/components/combination/ProAddressBar/index.js +83 -63
- package/es/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/es/ProForm/components/combination/ProModalSelect/index.js +76 -15
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
- package/es/ProForm/components/combination/ProNumberRange/index.js +3 -2
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.js +3 -7
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -11
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +18 -1
- package/es/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/es/ProForm/components/render/Render.js +4 -2
- package/es/ProForm/components/render/RenderFields.js +10 -6
- package/es/ProForm/components/render/propsType.d.ts +5 -4
- package/es/ProForm/index.js +14 -2
- package/es/ProForm/style/index.less +77 -169
- package/es/ProForm/utils/index.d.ts +1 -1
- package/es/ProForm/utils/index.js +7 -2
- package/es/ProForm/utils/rulesCreator.js +2 -1
- package/es/ProForm/utils/useRules.js +4 -3
- package/es/ProForm/utils/useShouldUpdate.js +16 -16
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +7 -8
- package/es/ProLayout/components/Layout/Notice/index.js +3 -2
- package/es/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
- package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +2 -1
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
- package/es/ProLayout/components/ProHeader/components/index.d.ts +1 -0
- package/es/ProLayout/components/ProHeader/components/index.js +2 -1
- package/es/ProLayout/components/ProHeader/index.js +9 -6
- package/es/ProLayout/components/ProHeader/style/index.less +16 -7
- package/es/ProLayout/utils/index.js +1 -1
- package/es/ProSelect/index.d.ts +3 -3
- package/es/ProSelect/index.js +4 -2
- package/es/ProStep/components/Step/index.js +3 -1
- package/es/ProStep/style/index.less +0 -1
- package/es/ProTable/components/RenderColumn/index.d.ts +5 -5
- package/es/ProTable/components/RenderColumn/index.js +41 -25
- package/es/ProTable/index.js +10 -8
- package/es/ProTable/propsType.d.ts +2 -0
- package/es/ProTable/style/index.less +14 -1
- package/es/ProTable/useAntdTable.d.ts +12 -4
- package/es/ProTable/useAntdTable.js +18 -6
- package/es/ProTable/utils.d.ts +1 -1
- package/es/ProTable/utils.js +258 -201
- package/es/ProTabs/style/index.less +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +1 -1
- package/es/ProThemeTools/component/PrdTools/style/index.less +3 -3
- package/es/ProThemeTools/index.d.ts +2 -2
- package/es/ProThemeTools/index.js +24 -17
- package/es/ProThemeTools/propsType.d.ts +8 -6
- package/es/ProThemeTools/style/index.less +2 -2
- package/es/ProThemeTools/utils/index.d.ts +7 -0
- package/es/ProThemeTools/utils/index.js +19 -1
- package/es/ProTree/components/ProTree.js +6 -5
- package/es/ProTree/components/SearchTitle.d.ts +2 -2
- package/es/ProTree/components/SearchTitle.js +11 -1
- package/es/ProTree/components/Tree.js +9 -2
- package/es/ProTree/style/index.less +193 -141
- package/es/ProTreeModal/components/List.js +0 -14
- package/es/ProTreeModal/components/Trigger.js +9 -3
- package/es/ProTreeModal/index.js +29 -13
- package/es/ProTreeModal/style/index.less +2 -6
- package/es/ProUpload/components/ButtonRender.js +5 -2
- package/es/ProUpload/components/DragRender.js +8 -8
- package/es/ProUpload/components/Example.js +3 -1
- package/es/ProUpload/components/ImageRender.js +8 -6
- package/es/ProUpload/index.js +8 -6
- package/es/ProUpload/style/index.less +41 -39
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/locale/en_US.d.ts +138 -0
- package/es/locale/en_US.js +137 -0
- package/es/locale/index.d.ts +13 -0
- package/es/locale/index.js +32 -0
- package/es/locale/zh_CN.d.ts +137 -0
- package/es/locale/zh_CN.js +136 -0
- package/es/old/ProEditableTable/style/index.less +1 -2
- package/es/style/components.less +0 -1
- package/es/style/core/normalize.less +1 -2
- package/es/style/theme/antd.less +3 -4
- package/es/style/theme/index.less +80 -79
- package/es/style/theme/tokens.less +1 -0
- package/lib/ProAction/index.js +7 -5
- package/lib/ProAction/index.less +3 -2
- package/lib/ProConfigProvider/index.d.ts +2 -0
- package/lib/ProConfigProvider/index.js +22 -2
- package/lib/ProDownload/utils.js +4 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.js +6 -4
- package/lib/ProDrawerForm/index.js +5 -3
- package/lib/ProDrawerForm/style/index.less +15 -11
- package/lib/ProEditLabel/style/index.less +2 -2
- package/lib/ProEditTable/components/ActionButton/index.js +3 -2
- package/lib/ProEditTable/components/RenderField/index.js +4 -1
- package/lib/ProEditTable/index.js +7 -6
- package/lib/ProEditTable/style/index.less +15 -8
- package/lib/ProEditTable/utils/config.d.ts +8 -8
- package/lib/ProEditTable/utils/config.js +20 -12
- package/lib/ProEditTable/utils/index.js +3 -2
- package/lib/ProEnum/hooks/useEnumRequest.js +17 -10
- package/lib/ProEnum/index.js +9 -4
- package/lib/ProEnum/style/index.less +1 -1
- package/lib/ProForm/components/FormFooter/index.js +16 -19
- package/lib/ProForm/components/base/Input/index.js +4 -3
- package/lib/ProForm/components/base/InputNumber/index.js +4 -3
- package/lib/ProForm/components/base/RangePicker/index.js +1 -4
- package/lib/ProForm/components/base/Select/index.js +2 -1
- package/lib/ProForm/components/base/Switch/index.js +8 -5
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +2 -1
- package/lib/ProForm/components/base/TextArea/index.js +4 -2
- package/lib/ProForm/components/base/TextArea/index.less +1 -1
- package/lib/ProForm/components/combination/Container/style/index.less +0 -1
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
- package/lib/ProForm/components/combination/FormList/style/index.less +20 -19
- package/lib/ProForm/components/combination/Group/index.js +2 -2
- package/lib/ProForm/components/combination/ProAddressBar/index.js +78 -60
- package/lib/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.js +76 -15
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
- package/lib/ProForm/components/combination/ProNumberRange/index.js +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +3 -7
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -11
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +18 -1
- package/lib/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/lib/ProForm/components/old/InputRange/index.js +0 -1
- package/lib/ProForm/components/old/ProCertValidity/index.js +1 -1
- package/lib/ProForm/components/render/Render.js +5 -2
- package/lib/ProForm/components/render/RenderFields.js +9 -5
- package/lib/ProForm/components/render/propsType.d.ts +5 -4
- package/lib/ProForm/index.js +14 -2
- package/lib/ProForm/style/index.less +77 -169
- package/lib/ProForm/utils/index.d.ts +1 -1
- package/lib/ProForm/utils/index.js +7 -2
- package/lib/ProForm/utils/rulesCreator.js +2 -1
- package/lib/ProForm/utils/useRules.js +4 -3
- package/lib/ProForm/utils/useShouldUpdate.js +16 -16
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +7 -8
- package/lib/ProLayout/components/Layout/Notice/index.js +3 -2
- package/lib/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
- package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +3 -1
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
- package/lib/ProLayout/components/ProHeader/components/index.d.ts +1 -0
- package/lib/ProLayout/components/ProHeader/components/index.js +8 -1
- package/lib/ProLayout/components/ProHeader/index.js +9 -6
- package/lib/ProLayout/components/ProHeader/style/index.less +16 -7
- package/lib/ProLayout/utils/index.js +1 -1
- package/lib/ProSelect/index.d.ts +3 -3
- package/lib/ProSelect/index.js +4 -2
- package/lib/ProStep/components/Step/index.js +3 -1
- package/lib/ProStep/style/index.less +0 -1
- package/lib/ProTable/components/RenderColumn/index.d.ts +5 -5
- package/lib/ProTable/components/RenderColumn/index.js +38 -24
- package/lib/ProTable/components/TableResizable/index.js +8 -0
- package/lib/ProTable/index.js +10 -8
- package/lib/ProTable/propsType.d.ts +2 -0
- package/lib/ProTable/style/index.less +14 -1
- package/lib/ProTable/useAntdTable.d.ts +12 -4
- package/lib/ProTable/useAntdTable.js +19 -6
- package/lib/ProTable/utils.d.ts +1 -1
- package/lib/ProTable/utils.js +258 -201
- package/lib/ProTabs/index.js +1 -0
- package/lib/ProTabs/style/index.less +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +1 -1
- package/lib/ProThemeTools/component/PrdTools/style/index.less +3 -3
- package/lib/ProThemeTools/index.d.ts +2 -2
- package/lib/ProThemeTools/index.js +24 -16
- package/lib/ProThemeTools/propsType.d.ts +8 -6
- package/lib/ProThemeTools/style/index.less +2 -2
- package/lib/ProThemeTools/utils/index.d.ts +7 -0
- package/lib/ProThemeTools/utils/index.js +20 -2
- package/lib/ProTree/components/ProTree.js +6 -5
- package/lib/ProTree/components/SearchTitle.d.ts +2 -2
- package/lib/ProTree/components/SearchTitle.js +11 -1
- package/lib/ProTree/components/Tree.js +16 -2
- package/lib/ProTree/index.js +0 -1
- package/lib/ProTree/style/index.less +193 -141
- package/lib/ProTreeModal/components/List.js +0 -14
- package/lib/ProTreeModal/components/Tree.js +1 -0
- package/lib/ProTreeModal/components/Trigger.js +10 -3
- package/lib/ProTreeModal/index.js +29 -13
- package/lib/ProTreeModal/style/index.less +2 -6
- package/lib/ProUpload/components/ButtonRender.js +5 -2
- package/lib/ProUpload/components/DragRender.js +8 -8
- package/lib/ProUpload/components/Example.js +3 -1
- package/lib/ProUpload/components/ImageRender.js +8 -6
- package/lib/ProUpload/index.js +14 -5
- package/lib/ProUpload/style/index.less +41 -39
- package/lib/index.d.ts +2 -1
- package/lib/index.js +13 -1
- package/lib/locale/en_US.d.ts +138 -0
- package/lib/locale/en_US.js +143 -0
- package/lib/locale/index.d.ts +13 -0
- package/lib/locale/index.js +41 -0
- package/lib/locale/zh_CN.d.ts +137 -0
- package/lib/locale/zh_CN.js +142 -0
- package/lib/old/ProCertValidity/index.js +1 -1
- package/lib/old/ProEditableTable/style/index.less +1 -2
- package/lib/style/components.less +0 -1
- package/lib/style/core/normalize.less +1 -2
- package/lib/style/theme/antd.less +3 -4
- package/lib/style/theme/index.less +80 -79
- package/lib/style/theme/tokens.less +1 -0
- package/package.json +1 -1
- package/typings.d.ts +2 -0
- package/es/old/ProBackBtn/style/index.less +0 -19
- package/lib/old/ProBackBtn/style/index.less +0 -19
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
package/es/ProAction/index.js
CHANGED
|
@@ -11,9 +11,10 @@ import React from 'react';
|
|
|
11
11
|
import { useSetState } from 'ahooks';
|
|
12
12
|
import { isFunction } from 'lodash';
|
|
13
13
|
import { ProDrawerForm } from '../index';
|
|
14
|
+
import locale from '../locale';
|
|
14
15
|
import './index.less';
|
|
15
16
|
var ProAction = function ProAction(props) {
|
|
16
|
-
var _config$, _config$2, _config$index;
|
|
17
|
+
var _config$, _config$2, _locale$ProAction2, _config$index;
|
|
17
18
|
var children = props.children,
|
|
18
19
|
config = props.config;
|
|
19
20
|
var _Form$useForm = _Form.useForm(),
|
|
@@ -29,7 +30,8 @@ var ProAction = function ProAction(props) {
|
|
|
29
30
|
state = _useSetState2[0],
|
|
30
31
|
setState = _useSetState2[1];
|
|
31
32
|
if (!config || !Array.isArray(config)) {
|
|
32
|
-
|
|
33
|
+
var _locale$ProAction;
|
|
34
|
+
console.error(locale === null || locale === void 0 ? void 0 : (_locale$ProAction = locale.ProAction) === null || _locale$ProAction === void 0 ? void 0 : _locale$ProAction.errorMessage);
|
|
33
35
|
return _jsx(_Fragment, {
|
|
34
36
|
children: children
|
|
35
37
|
});
|
|
@@ -66,7 +68,7 @@ var ProAction = function ProAction(props) {
|
|
|
66
68
|
options = _ref2.options;
|
|
67
69
|
transformResponse = _ref2.transformResponse;
|
|
68
70
|
_context.next = 14;
|
|
69
|
-
return service === null || service === void 0 ? void 0 : service(options);
|
|
71
|
+
return service === null || service === void 0 ? void 0 : service(options === null || options === void 0 ? void 0 : options.defaultParams);
|
|
70
72
|
case 14:
|
|
71
73
|
_context.t1 = _context.sent;
|
|
72
74
|
if (_context.t1) {
|
|
@@ -92,7 +94,7 @@ var ProAction = function ProAction(props) {
|
|
|
92
94
|
newServicesArray[currentIndex] = res.data;
|
|
93
95
|
}
|
|
94
96
|
case 26:
|
|
95
|
-
options === null || options === void 0 ? void 0 : (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call(options, newServicesArray[currentIndex], options.defaultParams);
|
|
97
|
+
options === null || options === void 0 ? void 0 : (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call(options, newServicesArray[currentIndex], options === null || options === void 0 ? void 0 : options.defaultParams);
|
|
96
98
|
if (!service) {
|
|
97
99
|
newServicesArray[currentIndex] = null;
|
|
98
100
|
}
|
|
@@ -166,7 +168,7 @@ var ProAction = function ProAction(props) {
|
|
|
166
168
|
onConfirm: function onConfirm() {
|
|
167
169
|
return onActionRun(0, []);
|
|
168
170
|
},
|
|
169
|
-
title: ((_config$2 = config[0]) === null || _config$2 === void 0 ? void 0 : _config$2.title) ||
|
|
171
|
+
title: ((_config$2 = config[0]) === null || _config$2 === void 0 ? void 0 : _config$2.title) || (locale === null || locale === void 0 ? void 0 : (_locale$ProAction2 = locale.ProAction) === null || _locale$ProAction2 === void 0 ? void 0 : _locale$ProAction2.defaultTitle),
|
|
170
172
|
children: children
|
|
171
173
|
}) : ChildContent, state.open ? _jsx(ProDrawerForm, {
|
|
172
174
|
open: state.open,
|
package/es/ProAction/index.less
CHANGED
|
@@ -4,6 +4,7 @@ import { ProModalSelectPropsType } from '../ProForm/components/combination/ProMo
|
|
|
4
4
|
import { AddressProps } from '../ProForm/components/combination/ProAddressBar/propsType';
|
|
5
5
|
import { ProEnumConfig } from '../ProEnum/propsType';
|
|
6
6
|
export interface ProConfigState {
|
|
7
|
+
locale?: string;
|
|
7
8
|
ProEnum?: Partial<ProEnumConfig>;
|
|
8
9
|
ProSelect?: Partial<PropSelectProps> & Record<string, any>;
|
|
9
10
|
ProModalSelect?: Partial<ProModalSelectPropsType> & Record<string, any>;
|
|
@@ -19,5 +20,6 @@ export declare function useProConfig(): ConfigContext;
|
|
|
19
20
|
export declare function useProConfig(name: keyof ConfigContext['state']): ConfigContext['state'][keyof ConfigContext['state']];
|
|
20
21
|
export declare const ProConfigProvider: FC<{
|
|
21
22
|
value: ProConfigState;
|
|
23
|
+
locale?: string;
|
|
22
24
|
}>;
|
|
23
25
|
export default ProConfigProvider;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import "antd/es/config-provider/style";
|
|
2
|
+
import _ConfigProvider from "antd/es/config-provider";
|
|
1
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
5
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
4
6
|
import React, { useContext, useReducer } from 'react';
|
|
7
|
+
import zhCN from 'antd/es/locale/zh_CN';
|
|
8
|
+
import enUS from 'antd/es/locale/en_US';
|
|
5
9
|
import merge from 'lodash/merge';
|
|
6
10
|
import useEnumRequest from '../ProEnum/hooks/useEnumRequest';
|
|
11
|
+
import { setLanguage } from '../locale';
|
|
7
12
|
export var ProConfigContext = /*#__PURE__*/React.createContext({
|
|
8
13
|
state: {
|
|
9
14
|
ProEnum: {
|
|
@@ -17,6 +22,11 @@ export function useProConfig(name) {
|
|
|
17
22
|
var config = useContext(ProConfigContext);
|
|
18
23
|
return name ? config.state[name] : config;
|
|
19
24
|
}
|
|
25
|
+
var antdLangMap = {
|
|
26
|
+
'zh-CN': zhCN,
|
|
27
|
+
'en-US': enUS // en-US
|
|
28
|
+
};
|
|
29
|
+
|
|
20
30
|
var reducer = function reducer(state, action) {
|
|
21
31
|
var _state$ProEnum;
|
|
22
32
|
switch (action.type) {
|
|
@@ -43,13 +53,24 @@ export var ProConfigProvider = function ProConfigProvider(props) {
|
|
|
43
53
|
state = _useReducer2[0],
|
|
44
54
|
dispatch = _useReducer2[1];
|
|
45
55
|
useEnumRequest(_objectSpread(_objectSpread(_objectSpread({}, state.ProEnum), props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.ProEnum), props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.globalConfig), dispatch);
|
|
56
|
+
var cacheLang = localStorage.getItem('locale');
|
|
57
|
+
// 如果是用户切换了语言那么优先使用用户切换的,否则从缓存中取用户语言,在取默认值
|
|
58
|
+
var lang = (state === null || state === void 0 ? void 0 : state.locale) || cacheLang || (props === null || props === void 0 ? void 0 : props.locale);
|
|
59
|
+
// 如果缓存里没有语言,那么将配置的语言设置为当前系统语言
|
|
60
|
+
if (!(state === null || state === void 0 ? void 0 : state.locale) && !cacheLang && (props === null || props === void 0 ? void 0 : props.locale)) {
|
|
61
|
+
// 设置默认语言
|
|
62
|
+
setLanguage(props === null || props === void 0 ? void 0 : props.locale);
|
|
63
|
+
}
|
|
46
64
|
return _jsx(ProConfigContext.Provider, {
|
|
47
65
|
value: {
|
|
48
66
|
state: merge(state, props.value),
|
|
49
67
|
dispatch: dispatch
|
|
50
68
|
},
|
|
51
|
-
children:
|
|
52
|
-
|
|
69
|
+
children: _jsx(_ConfigProvider, {
|
|
70
|
+
locale: antdLangMap[lang],
|
|
71
|
+
children: _jsxs("div", {
|
|
72
|
+
children: [" ", props.children]
|
|
73
|
+
})
|
|
53
74
|
})
|
|
54
75
|
});
|
|
55
76
|
};
|
package/es/ProDownload/utils.js
CHANGED
|
@@ -4,7 +4,10 @@ import _message from "antd/es/message";
|
|
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
5
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
6
6
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
7
|
+
/* eslint-disable no-empty */
|
|
8
|
+
/* eslint-disable prefer-promise-reject-errors */
|
|
7
9
|
import { isFunction, get } from 'lodash';
|
|
10
|
+
import locale from '../locale';
|
|
8
11
|
var stringify = function stringify(data) {
|
|
9
12
|
var result = '';
|
|
10
13
|
if (data && Object.keys(data).length) {
|
|
@@ -109,8 +112,8 @@ export var DownloadRequest = /*#__PURE__*/function () {
|
|
|
109
112
|
_context.next = 7;
|
|
110
113
|
break;
|
|
111
114
|
}
|
|
112
|
-
_message.error(
|
|
113
|
-
return _context.abrupt("return", Promise.reject(
|
|
115
|
+
_message.error("".concat(locale.ProDownload.errorMessage));
|
|
116
|
+
return _context.abrupt("return", Promise.reject("".concat(locale.ProDownload.errorMessage)));
|
|
114
117
|
case 7:
|
|
115
118
|
if (!((_data === null || _data === void 0 ? void 0 : _data.status) > 200 || (_data === null || _data === void 0 ? void 0 : _data.code) === 401)) {
|
|
116
119
|
_context.next = 11;
|
|
@@ -138,7 +141,7 @@ export var DownloadRequest = /*#__PURE__*/function () {
|
|
|
138
141
|
}
|
|
139
142
|
return _context.abrupt("return", Promise.resolve(response));
|
|
140
143
|
case 20:
|
|
141
|
-
return _context.abrupt("return", Promise.reject(
|
|
144
|
+
return _context.abrupt("return", Promise.reject("".concat(locale.ProDownload.errorMessage)));
|
|
142
145
|
case 21:
|
|
143
146
|
case "end":
|
|
144
147
|
return _context.stop();
|
|
@@ -14,6 +14,7 @@ import { useScroll } from 'ahooks';
|
|
|
14
14
|
import { isArray } from 'lodash';
|
|
15
15
|
import { ReactSVG } from 'react-svg';
|
|
16
16
|
import closeSvg from '../../../assets/close.svg';
|
|
17
|
+
import locale from '../../../locale';
|
|
17
18
|
/**
|
|
18
19
|
* 抽屉组件
|
|
19
20
|
*/
|
|
@@ -46,6 +47,7 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
|
46
47
|
toggleLoading = _useState2[1];
|
|
47
48
|
var noRenderFooter = isView || footer === false || footer === null;
|
|
48
49
|
var onConfirm = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
50
|
+
var _locale$ProDrawerForm, _locale$ProDrawerForm2, _locale$ProDrawerForm3, _locale$ProDrawerForm4;
|
|
49
51
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
50
52
|
while (1) switch (_context.prev = _context.next) {
|
|
51
53
|
case 0:
|
|
@@ -54,10 +56,10 @@ var ProDrawer = function ProDrawer(_ref) {
|
|
|
54
56
|
} else if (!modalRef.current) {
|
|
55
57
|
modalRef.current = _Modal.confirm(_objectSpread({
|
|
56
58
|
className: 'width430',
|
|
57
|
-
title:
|
|
58
|
-
okText:
|
|
59
|
-
cancelText:
|
|
60
|
-
content:
|
|
59
|
+
title: locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm = locale.ProDrawerForm) === null || _locale$ProDrawerForm === void 0 ? void 0 : _locale$ProDrawerForm.isSureClose,
|
|
60
|
+
okText: locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm2 = locale.ProDrawerForm) === null || _locale$ProDrawerForm2 === void 0 ? void 0 : _locale$ProDrawerForm2.confirm,
|
|
61
|
+
cancelText: locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm3 = locale.ProDrawerForm) === null || _locale$ProDrawerForm3 === void 0 ? void 0 : _locale$ProDrawerForm3.cancel,
|
|
62
|
+
content: locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm4 = locale.ProDrawerForm) === null || _locale$ProDrawerForm4 === void 0 ? void 0 : _locale$ProDrawerForm4.secondTipsWhenSave,
|
|
61
63
|
onOk: function onOk() {
|
|
62
64
|
onCancel && onCancel();
|
|
63
65
|
},
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
var _locale$ProDrawerForm3;
|
|
3
4
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
5
|
import { forwardRef, useEffect, useImperativeHandle, useMemo } from 'react';
|
|
5
6
|
import { ProDrawer, ProModal } from './components';
|
|
6
7
|
import ProForm from '../ProForm';
|
|
7
8
|
import { transformBySize } from './utils';
|
|
9
|
+
import locale from '../locale';
|
|
8
10
|
var ProDrawerForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
9
|
-
var _okText;
|
|
11
|
+
var _okText, _locale$ProDrawerForm, _locale$ProDrawerForm2;
|
|
10
12
|
var visible = props.visible,
|
|
11
13
|
showType = props.showType,
|
|
12
14
|
okText = props.okText,
|
|
@@ -21,7 +23,7 @@ var ProDrawerForm = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
21
23
|
children = props.children;
|
|
22
24
|
showType = mode || showType;
|
|
23
25
|
isView = isView || disabled;
|
|
24
|
-
okText = (_okText = okText) !== null && _okText !== void 0 ? _okText : showType === 'Drawer' ?
|
|
26
|
+
okText = (_okText = okText) !== null && _okText !== void 0 ? _okText : showType === 'Drawer' ? locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm = locale.ProDrawerForm) === null || _locale$ProDrawerForm === void 0 ? void 0 : _locale$ProDrawerForm.save : locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm2 = locale.ProDrawerForm) === null || _locale$ProDrawerForm2 === void 0 ? void 0 : _locale$ProDrawerForm2.confirm;
|
|
25
27
|
visible = open !== null && open !== void 0 ? open : visible;
|
|
26
28
|
var width = props.width;
|
|
27
29
|
if (!width && size) {
|
|
@@ -83,7 +85,7 @@ ProDrawerForm.defaultProps = {
|
|
|
83
85
|
size: 'middle',
|
|
84
86
|
isConfirmClose: true,
|
|
85
87
|
maskClosable: false,
|
|
86
|
-
cancelText:
|
|
88
|
+
cancelText: locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm3 = locale.ProDrawerForm) === null || _locale$ProDrawerForm3 === void 0 ? void 0 : _locale$ProDrawerForm3.cancel,
|
|
87
89
|
proFormProps: {}
|
|
88
90
|
};
|
|
89
91
|
export default ProDrawerForm;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
justify-content: center;
|
|
9
9
|
width : 32px;
|
|
10
10
|
height : 38px;
|
|
11
|
-
color: var(--zaui-global-bg, #fff);
|
|
11
|
+
color : var(--zaui-global-bg, #fff);
|
|
12
12
|
cursor : pointer;
|
|
13
13
|
|
|
14
14
|
.close-icon {
|
|
@@ -17,12 +17,13 @@
|
|
|
17
17
|
z-index : 1;
|
|
18
18
|
font-size: var(--zaui-font-size-lg, 16px);
|
|
19
19
|
transform: translateZ(100px);
|
|
20
|
-
fill: var(--zaui-aide-text, #909090);
|
|
20
|
+
fill : var(--zaui-aide-text, #909090);
|
|
21
21
|
|
|
22
22
|
&:hover {
|
|
23
23
|
fill: var(--zaui-brand-active, #005AD9);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
|
|
26
|
+
>div {
|
|
26
27
|
height: 20px;
|
|
27
28
|
}
|
|
28
29
|
}
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
|
|
56
57
|
.pro-drawer-scrolling {
|
|
57
58
|
z-index : 1;
|
|
58
|
-
box-shadow: -12px 14px 14px -18px var(--zaui-shadow, rgba(56,56,56,0.15));
|
|
59
|
+
box-shadow: -12px 14px 14px -18px var(--zaui-shadow, rgba(56, 56, 56, 0.15));
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
.pro-drawer-content {
|
|
@@ -75,7 +76,7 @@
|
|
|
75
76
|
width : 100%;
|
|
76
77
|
padding : var(--zaui-space-size-md, 16px) var(--zaui-space-size-lg, 32px);
|
|
77
78
|
background-color: var(--zaui-global-bg, #fff);
|
|
78
|
-
box-shadow : 8px 2px 8px 0 var(--zaui-shadow, rgba(56,56,56,0.15));
|
|
79
|
+
box-shadow : 8px 2px 8px 0 var(--zaui-shadow, rgba(56, 56, 56, 0.15));
|
|
79
80
|
|
|
80
81
|
button {
|
|
81
82
|
margin-right: var(--zaui-space-size-sm, 8px);
|
|
@@ -91,6 +92,7 @@
|
|
|
91
92
|
padding : 0;
|
|
92
93
|
overflow-y: hidden;
|
|
93
94
|
}
|
|
95
|
+
|
|
94
96
|
.ant-drawer-content {
|
|
95
97
|
position: static;
|
|
96
98
|
}
|
|
@@ -105,15 +107,18 @@
|
|
|
105
107
|
.ant-modal-close-x {
|
|
106
108
|
.close-icon {
|
|
107
109
|
fill: var(--zaui-aide-text, #909090);
|
|
110
|
+
|
|
108
111
|
&:hover {
|
|
109
112
|
fill: var(--zaui-brand, #006aff);
|
|
110
113
|
}
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
}
|
|
117
|
+
|
|
114
118
|
.ant-modal-header {
|
|
115
119
|
padding : var(--zaui-space-size-md, 16px);
|
|
116
120
|
border-bottom: none;
|
|
121
|
+
|
|
117
122
|
.ant-modal-title {
|
|
118
123
|
font-weight: 600;
|
|
119
124
|
}
|
|
@@ -124,7 +129,7 @@
|
|
|
124
129
|
border-top: none;
|
|
125
130
|
|
|
126
131
|
.pro-modal-footer {
|
|
127
|
-
display: flex;
|
|
132
|
+
display : flex;
|
|
128
133
|
justify-content: space-between;
|
|
129
134
|
}
|
|
130
135
|
}
|
|
@@ -143,8 +148,7 @@
|
|
|
143
148
|
.pro-modal-no-footer {
|
|
144
149
|
.ant-modal-content {
|
|
145
150
|
.ant-modal-body {
|
|
146
|
-
|
|
147
|
-
padding-bottom : var(--zaui-space-size-md, 16px);
|
|
151
|
+
padding-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1))
|
|
148
152
|
}
|
|
149
153
|
}
|
|
150
154
|
}
|
|
@@ -153,7 +157,7 @@
|
|
|
153
157
|
z-index: 1;
|
|
154
158
|
|
|
155
159
|
.ant-modal-header {
|
|
156
|
-
box-shadow: -12px 14px 14px -18px var(--zaui-shadow, rgba(56,56,56,0.15));
|
|
160
|
+
box-shadow: -12px 14px 14px -18px var(--zaui-shadow, rgba(56, 56, 56, 0.15));
|
|
157
161
|
position : relative;
|
|
158
162
|
z-index : 1;
|
|
159
163
|
}
|
|
@@ -163,6 +167,6 @@
|
|
|
163
167
|
.ant-modal-footer {
|
|
164
168
|
position : relative;
|
|
165
169
|
z-index : 1;
|
|
166
|
-
box-shadow: 3px 2px 12px 0px var(--zaui-shadow, rgba(56,56,56,0.15));
|
|
170
|
+
box-shadow: 3px 2px 12px 0px var(--zaui-shadow, rgba(56, 56, 56, 0.15));
|
|
167
171
|
}
|
|
168
|
-
}
|
|
172
|
+
}
|
|
@@ -87,11 +87,11 @@
|
|
|
87
87
|
font-size : var(--zaui-font-size-lg, 16px);
|
|
88
88
|
font-weight : 500;
|
|
89
89
|
color : var(--zaui-text, #343434);
|
|
90
|
-
margin-bottom: var(--zaui-space-size-sm, 8px);
|
|
90
|
+
margin-bottom: calc(var(--zaui-space-size-sm, 8px) * var(--zaui-size; 1));
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
.pro-edit-label-tip {
|
|
94
|
-
margin-bottom: var(--zaui-space-size-md
|
|
94
|
+
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
95
95
|
color : #666;
|
|
96
96
|
|
|
97
97
|
.anticon-info-circle {
|
|
@@ -7,6 +7,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { isFunction, omit } from 'lodash';
|
|
9
9
|
import { iconMap } from '../../utils/config';
|
|
10
|
+
import locale from '../../../locale';
|
|
10
11
|
// 渲染操作按钮
|
|
11
12
|
var ActionButton = function ActionButton(_ref) {
|
|
12
13
|
var _editingKeys$includes, _btnConfig$buttonProp, _btnConfig$buttonProp2, _btnConfig$buttonProp3, _btnConfig$icon;
|
|
@@ -79,8 +80,8 @@ var ActionButton = function ActionButton(_ref) {
|
|
|
79
80
|
btnConfig.onEvent(record, index);
|
|
80
81
|
},
|
|
81
82
|
disabled: isDisabled,
|
|
82
|
-
okText:
|
|
83
|
-
cancelText:
|
|
83
|
+
okText: locale.ProEditTable.confirm,
|
|
84
|
+
cancelText: locale.ProEditTable.cancel,
|
|
84
85
|
children: /*#__PURE__*/React.isValidElement(btnConfig.label) ? /*#__PURE__*/React.cloneElement(btnConfig.label, _objectSpread(_objectSpread({}, omit(delBtnProps, ['buttonProps', 'isEditable'])), {}, {
|
|
85
86
|
record: record,
|
|
86
87
|
index: index,
|
|
@@ -20,6 +20,7 @@ import transformNames from '../../../ProForm/utils/transformNames';
|
|
|
20
20
|
import { FieldProvider } from '../../../ProForm/utils/useFieldProps';
|
|
21
21
|
import useRules from '../../../ProForm/utils/useRules';
|
|
22
22
|
import { isSelect } from '../../../ProForm/utils';
|
|
23
|
+
import locale from '../../../locale';
|
|
23
24
|
var RenderField = function RenderField(_ref) {
|
|
24
25
|
var _type, _type$replace, _fieldProps2, _fieldProps3, _fieldProps4, _names, _formItemChildProps$p, _TargetComponent4;
|
|
25
26
|
var value = _ref.text,
|
|
@@ -218,7 +219,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
218
219
|
TargetComponent = viewRender;
|
|
219
220
|
}
|
|
220
221
|
}
|
|
221
|
-
var defaultPlaceholder = ['Select', 'EnumSelect', 'DatePicker', 'RangePicker', 'Cascader', 'ProSelect', 'ProEnum', 'ProTimeLimit'].includes(type) ? "
|
|
222
|
+
var defaultPlaceholder = ['Select', 'EnumSelect', 'DatePicker', 'RangePicker', 'Cascader', 'ProSelect', 'ProEnum', 'ProTimeLimit'].includes(type) ? "".concat(locale.ProEditTable.select).concat(isString(label) ? label || title : '') : "".concat(locale.ProEditTable.enter).concat(isString(label) ? label || title : '');
|
|
222
223
|
var _placeholder = (_formItemChildProps$p = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.placeholder) !== null && _formItemChildProps$p !== void 0 ? _formItemChildProps$p : defaultPlaceholder;
|
|
223
224
|
var onChange = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.onChange;
|
|
224
225
|
var onFieldChange = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.onFieldChange;
|
package/es/ProEditTable/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import { transformColumns } from './utils';
|
|
|
20
20
|
import { getRandom, getNamePath } from './utils/tools';
|
|
21
21
|
import { DndWrapper, Row, Validator, Summary, RenderToolbar } from './components';
|
|
22
22
|
import Empty from '../assets/empty.png';
|
|
23
|
+
import locale from '../locale';
|
|
23
24
|
var ProEditTable = function ProEditTable(_ref, ref) {
|
|
24
25
|
var _resetProps$id, _resetProps$id$split, _value$2;
|
|
25
26
|
var value = _ref.value,
|
|
@@ -171,8 +172,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
|
|
|
171
172
|
src: Empty
|
|
172
173
|
}), _jsx("div", {
|
|
173
174
|
className: "content",
|
|
174
|
-
children: disabled || isForbiddenBtn('add') ?
|
|
175
|
-
children: ["\
|
|
175
|
+
children: disabled || isForbiddenBtn('add') ? locale.ProEditTable.noData : _jsxs(_Fragment, {
|
|
176
|
+
children: [locale.ProEditTable.noData, "\uFF0C", _jsx(RenderToolbar, _objectSpread({}, _objectSpread(_objectSpread({}, config), {}, {
|
|
176
177
|
toolbarProps: toolbarProps === null || toolbarProps === void 0 ? void 0 : (_toolbarProps$filter = toolbarProps.filter) === null || _toolbarProps$filter === void 0 ? void 0 : _toolbarProps$filter.call(toolbarProps, function (item) {
|
|
177
178
|
return item.type === 'add';
|
|
178
179
|
}),
|
|
@@ -321,9 +322,9 @@ ForwardProEditTable.defaultProps = {
|
|
|
321
322
|
disabled: false,
|
|
322
323
|
draggable: false,
|
|
323
324
|
stripe: true,
|
|
324
|
-
emptyBtnText:
|
|
325
|
-
onlyOneLineMsg:
|
|
326
|
-
deletePoConfirmMsg:
|
|
327
|
-
mulDeletePoConfirmMsg:
|
|
325
|
+
emptyBtnText: locale.ProEditTable.clickAdd,
|
|
326
|
+
onlyOneLineMsg: locale.ProEditTable.onlyOneLineMsg,
|
|
327
|
+
deletePoConfirmMsg: locale.ProEditTable.deletePoConfirmMsg,
|
|
328
|
+
mulDeletePoConfirmMsg: locale.ProEditTable.mulDeletePoConfirmMsg
|
|
328
329
|
};
|
|
329
330
|
export default ForwardProEditTable;
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
text-indent : 5px;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
.drag-wrapper {
|
|
61
61
|
display: flex;
|
|
62
62
|
.drag-icon {
|
|
@@ -110,12 +110,12 @@
|
|
|
110
110
|
line-height: 1;
|
|
111
111
|
content : "*";
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
|
|
114
114
|
&.is-required-left {
|
|
115
115
|
&::after {
|
|
116
116
|
display: none;
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
|
|
119
119
|
&::before {
|
|
120
120
|
position : static;
|
|
121
121
|
top : 0;
|
|
@@ -140,6 +140,13 @@
|
|
|
140
140
|
.ant-table-cell-fix-left,
|
|
141
141
|
.ant-table-cell-fix-right {
|
|
142
142
|
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.ant-table-cell-fix-right-first {
|
|
148
|
+
&::after {
|
|
149
|
+
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
143
150
|
}
|
|
144
151
|
}
|
|
145
152
|
|
|
@@ -175,12 +182,12 @@
|
|
|
175
182
|
line-height: 1;
|
|
176
183
|
content : "*";
|
|
177
184
|
}
|
|
178
|
-
|
|
185
|
+
|
|
179
186
|
&.is-required-left {
|
|
180
187
|
&::after {
|
|
181
188
|
display: none;
|
|
182
189
|
}
|
|
183
|
-
|
|
190
|
+
|
|
184
191
|
&::before {
|
|
185
192
|
position : static;
|
|
186
193
|
top : 0;
|
|
@@ -282,7 +289,7 @@
|
|
|
282
289
|
}
|
|
283
290
|
|
|
284
291
|
.pro-edit-table-header {
|
|
285
|
-
margin-bottom: var(--zaui-space-size-md
|
|
292
|
+
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
286
293
|
}
|
|
287
294
|
|
|
288
295
|
.pro-edit-table-toolbar-fixed {
|
|
@@ -300,11 +307,11 @@
|
|
|
300
307
|
display: flex;
|
|
301
308
|
align-items: center;
|
|
302
309
|
padding: 0 var(--zaui-space-size-xs, 4px);
|
|
303
|
-
|
|
310
|
+
|
|
304
311
|
&:first-child {
|
|
305
312
|
padding-left: 0;
|
|
306
313
|
}
|
|
307
|
-
|
|
314
|
+
|
|
308
315
|
span:nth-child(2) {
|
|
309
316
|
margin-left: var(--zaui-space-size-xs, 4px);
|
|
310
317
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const defaultBtnNameMap: {
|
|
2
|
-
add:
|
|
3
|
-
edit:
|
|
4
|
-
copy:
|
|
5
|
-
delete:
|
|
6
|
-
mulDelete:
|
|
7
|
-
save:
|
|
8
|
-
cancel:
|
|
9
|
-
custom:
|
|
2
|
+
add: any;
|
|
3
|
+
edit: any;
|
|
4
|
+
copy: any;
|
|
5
|
+
delete: any;
|
|
6
|
+
mulDelete: any;
|
|
7
|
+
save: any;
|
|
8
|
+
cancel: any;
|
|
9
|
+
custom: any;
|
|
10
10
|
};
|
|
11
11
|
export declare const iconMap: {
|
|
12
12
|
add: JSX.Element;
|
|
@@ -7,16 +7,18 @@ import "antd/es/message/style";
|
|
|
7
7
|
import _message from "antd/es/message";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
import { PlusOutlined } from '@ant-design/icons';
|
|
10
|
+
import { set } from 'lodash';
|
|
10
11
|
import { onDelete, getRandom } from './tools';
|
|
12
|
+
import locale from '../../locale';
|
|
11
13
|
export var defaultBtnNameMap = {
|
|
12
|
-
add:
|
|
13
|
-
edit:
|
|
14
|
-
copy:
|
|
15
|
-
delete:
|
|
16
|
-
mulDelete:
|
|
17
|
-
save:
|
|
18
|
-
cancel:
|
|
19
|
-
custom:
|
|
14
|
+
add: locale.ProEditTable.add,
|
|
15
|
+
edit: locale.ProEditTable.edit,
|
|
16
|
+
copy: locale.ProEditTable.copy,
|
|
17
|
+
delete: locale.ProEditTable.delete,
|
|
18
|
+
mulDelete: locale.ProEditTable.mulDelete,
|
|
19
|
+
save: locale.ProEditTable.save,
|
|
20
|
+
cancel: locale.ProEditTable.cancel,
|
|
21
|
+
custom: locale.ProEditTable.custom
|
|
20
22
|
};
|
|
21
23
|
// 默认按钮配置
|
|
22
24
|
export var iconMap = {
|
|
@@ -62,7 +64,7 @@ export var actions = {
|
|
|
62
64
|
},
|
|
63
65
|
save: function () {
|
|
64
66
|
var _save = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
|
|
65
|
-
var record, editingKeys, setState, form, rowName, virtualRowName, result, updateData, nextEditingKeys;
|
|
67
|
+
var record, editingKeys, setState, form, rowName, virtualRowName, result, updateData, nextEditingKeys, values;
|
|
66
68
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
67
69
|
while (1) switch (_context.prev = _context.next) {
|
|
68
70
|
case 0:
|
|
@@ -80,11 +82,14 @@ export var actions = {
|
|
|
80
82
|
} else {
|
|
81
83
|
delete record.isEditing;
|
|
82
84
|
}
|
|
83
|
-
|
|
85
|
+
// 防止value引用不变, 值不更新 - (自定义组件)
|
|
86
|
+
values = form.getFieldsValue();
|
|
87
|
+
set(values, rowName, record);
|
|
88
|
+
form.setFieldsValue(values);
|
|
84
89
|
setState({
|
|
85
90
|
editingKeys: nextEditingKeys
|
|
86
91
|
});
|
|
87
|
-
case
|
|
92
|
+
case 10:
|
|
88
93
|
case "end":
|
|
89
94
|
return _context.stop();
|
|
90
95
|
}
|
|
@@ -124,7 +129,10 @@ export var actions = {
|
|
|
124
129
|
selectedRowKeys: [record.rowKey]
|
|
125
130
|
});
|
|
126
131
|
} else {
|
|
127
|
-
|
|
132
|
+
// 防止value引用不变, 值不更新 - (自定义组件)
|
|
133
|
+
var values = form.getFieldsValue();
|
|
134
|
+
set(values, virtualRowName, record);
|
|
135
|
+
form.setFieldsValue(values);
|
|
128
136
|
}
|
|
129
137
|
},
|
|
130
138
|
delete: function _delete(_ref4) {
|
|
@@ -22,6 +22,7 @@ import { customValidate, getNamePath, splitNames } from './tools';
|
|
|
22
22
|
import ProTooltip from '../../ProTooltip';
|
|
23
23
|
import { RenderField, ActionButton } from '../components';
|
|
24
24
|
import tipSvg from '../../assets/tip.svg';
|
|
25
|
+
import locale from '../../locale';
|
|
25
26
|
// 渲染操作栏
|
|
26
27
|
var getActionColumn = function getActionColumn(config) {
|
|
27
28
|
var disabled = config.disabled,
|
|
@@ -141,7 +142,7 @@ var getActionColumn = function getActionColumn(config) {
|
|
|
141
142
|
return action;
|
|
142
143
|
});
|
|
143
144
|
return {
|
|
144
|
-
title:
|
|
145
|
+
title: locale.ProEditTable.operation,
|
|
145
146
|
key: 'action',
|
|
146
147
|
fixed: 'right',
|
|
147
148
|
width: actionWidth || (virtualKey ? '120px' : '60px'),
|
|
@@ -341,7 +342,7 @@ export var transformColumns = function transformColumns() {
|
|
|
341
342
|
if (disabled || isView) {
|
|
342
343
|
// 查看模式下过滤操作栏
|
|
343
344
|
_columns = _columns.filter(function (item) {
|
|
344
|
-
return item.title !==
|
|
345
|
+
return item.title !== locale.ProEditTable.operation;
|
|
345
346
|
});
|
|
346
347
|
} else {
|
|
347
348
|
var validateKeys = _columns.filter(function (i) {
|