@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
|
@@ -14,6 +14,7 @@ var _antd = require("antd");
|
|
|
14
14
|
var _lodash = require("lodash");
|
|
15
15
|
var _icons = require("@ant-design/icons");
|
|
16
16
|
var _ProIcon = _interopRequireDefault(require("../../../../../ProIcon"));
|
|
17
|
+
var _locale = _interopRequireDefault(require("../../../../../locale"));
|
|
17
18
|
var _excluded = ["label", "onClick", "onHandle", "actionType", "needConfirm", "confirmProps", "title"],
|
|
18
19
|
_excluded2 = ["onClick", "label"];
|
|
19
20
|
var getDefaultActions = function getDefaultActions(mode) {
|
|
@@ -22,26 +23,24 @@ var getDefaultActions = function getDefaultActions(mode) {
|
|
|
22
23
|
onClick: function onClick(record, _ref) {
|
|
23
24
|
var namePath = _ref.namePath,
|
|
24
25
|
index = _ref.index,
|
|
25
|
-
operation = _ref.operation
|
|
26
|
-
form = _ref.form;
|
|
26
|
+
operation = _ref.operation;
|
|
27
27
|
var add = operation.add;
|
|
28
28
|
add(undefined, index + 1);
|
|
29
29
|
},
|
|
30
30
|
type: 'text',
|
|
31
|
-
label:
|
|
31
|
+
label: "".concat(_locale.default.ProForm.formList_actions[0]),
|
|
32
32
|
icon: (0, _jsxRuntime.jsx)(_icons.PlusSquareOutlined, {})
|
|
33
33
|
},
|
|
34
34
|
delete: {
|
|
35
35
|
onClick: function onClick(record, _ref2) {
|
|
36
36
|
var namePath = _ref2.namePath,
|
|
37
37
|
index = _ref2.index,
|
|
38
|
-
operation = _ref2.operation
|
|
39
|
-
form = _ref2.form;
|
|
38
|
+
operation = _ref2.operation;
|
|
40
39
|
var remove = operation.remove;
|
|
41
40
|
remove(index);
|
|
42
41
|
},
|
|
43
42
|
type: 'text',
|
|
44
|
-
label:
|
|
43
|
+
label: "".concat(_locale.default.ProForm.formList_actions[1]),
|
|
45
44
|
icon: mode === 'less' ? (0, _jsxRuntime.jsx)(_ProIcon.default, {
|
|
46
45
|
type: "solid-close",
|
|
47
46
|
className: "single-delete"
|
|
@@ -53,39 +52,36 @@ var getDefaultActions = function getDefaultActions(mode) {
|
|
|
53
52
|
onClick: function onClick(record, _ref3) {
|
|
54
53
|
var namePath = _ref3.namePath,
|
|
55
54
|
index = _ref3.index,
|
|
56
|
-
operation = _ref3.operation
|
|
57
|
-
form = _ref3.form;
|
|
55
|
+
operation = _ref3.operation;
|
|
58
56
|
var add = operation.add;
|
|
59
57
|
add(record, index + 1);
|
|
60
58
|
},
|
|
61
59
|
type: 'text',
|
|
62
|
-
label:
|
|
60
|
+
label: "".concat(_locale.default.ProForm.formList_actions[2]),
|
|
63
61
|
icon: (0, _jsxRuntime.jsx)(_icons.CopyOutlined, {})
|
|
64
62
|
},
|
|
65
63
|
moveUp: {
|
|
66
64
|
onClick: function onClick(record, _ref4) {
|
|
67
65
|
var namePath = _ref4.namePath,
|
|
68
66
|
index = _ref4.index,
|
|
69
|
-
operation = _ref4.operation
|
|
70
|
-
form = _ref4.form;
|
|
67
|
+
operation = _ref4.operation;
|
|
71
68
|
var move = operation.move;
|
|
72
69
|
move(index, index - 1);
|
|
73
70
|
},
|
|
74
71
|
type: 'text',
|
|
75
|
-
label:
|
|
72
|
+
label: "".concat(_locale.default.ProForm.formList_actions[3]),
|
|
76
73
|
icon: (0, _jsxRuntime.jsx)(_icons.UpSquareOutlined, {})
|
|
77
74
|
},
|
|
78
75
|
moveDown: {
|
|
79
76
|
onClick: function onClick(record, _ref5) {
|
|
80
77
|
var namePath = _ref5.namePath,
|
|
81
78
|
index = _ref5.index,
|
|
82
|
-
operation = _ref5.operation
|
|
83
|
-
form = _ref5.form;
|
|
79
|
+
operation = _ref5.operation;
|
|
84
80
|
var move = operation.move;
|
|
85
81
|
move(index, index + 1);
|
|
86
82
|
},
|
|
87
83
|
type: 'text',
|
|
88
|
-
label:
|
|
84
|
+
label: "".concat(_locale.default.ProForm.formList_actions[4]),
|
|
89
85
|
icon: (0, _jsxRuntime.jsx)(_icons.DownSquareOutlined, {})
|
|
90
86
|
}
|
|
91
87
|
};
|
|
@@ -193,7 +189,7 @@ var ActionButton = function ActionButton(props) {
|
|
|
193
189
|
return false;
|
|
194
190
|
}
|
|
195
191
|
return _needConfirm ? (0, _jsxRuntime.jsx)(_antd.Popconfirm, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
196
|
-
title: title !== null && title !== void 0 ? title :
|
|
192
|
+
title: title !== null && title !== void 0 ? title : "".concat(_locale.default.ProForm.formList_confirmMessage),
|
|
197
193
|
onCancel: function onCancel(e) {
|
|
198
194
|
return e.stopPropagation();
|
|
199
195
|
},
|
|
@@ -216,7 +212,7 @@ var ActionButton = function ActionButton(props) {
|
|
|
216
212
|
}), "".concat(item === null || item === void 0 ? void 0 : item.actionType).concat(index));
|
|
217
213
|
}
|
|
218
214
|
return needConfirm ? (0, _jsxRuntime.jsx)(_antd.Popconfirm, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
219
|
-
title: title !== null && title !== void 0 ? title :
|
|
215
|
+
title: title !== null && title !== void 0 ? title : "".concat(_locale.default.ProForm.formList_confirmMessage),
|
|
220
216
|
onCancel: function onCancel(e) {
|
|
221
217
|
return e.stopPropagation();
|
|
222
218
|
},
|
|
@@ -13,6 +13,7 @@ var _antd = require("antd");
|
|
|
13
13
|
var _icons = require("@ant-design/icons");
|
|
14
14
|
var _lodash = require("lodash");
|
|
15
15
|
var _react = require("react");
|
|
16
|
+
var _locale = _interopRequireDefault(require("../../../../../locale"));
|
|
16
17
|
var _excluded = ["label", "onClick", "onHandle", "actionType"],
|
|
17
18
|
_excluded2 = ["onClick", "label"];
|
|
18
19
|
var actions = {
|
|
@@ -23,7 +24,7 @@ var actions = {
|
|
|
23
24
|
namePath = _ref.namePath;
|
|
24
25
|
operation.add();
|
|
25
26
|
},
|
|
26
|
-
label:
|
|
27
|
+
label: "".concat(_locale.default.ProForm.formList_actions[5]),
|
|
27
28
|
type: 'link',
|
|
28
29
|
icon: (0, _jsxRuntime.jsx)(_icons.PlusOutlined, {})
|
|
29
30
|
}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
.pro-form-list-block-title {
|
|
2
|
-
height: 14px;
|
|
3
|
-
margin:
|
|
4
|
-
padding-left:
|
|
5
|
-
font-weight: 600;
|
|
6
|
-
line-height: 14px;
|
|
7
|
-
border-left: 4px solid
|
|
2
|
+
height : 14px;
|
|
3
|
+
margin : @zaui-space-size-xs 0;
|
|
4
|
+
padding-left: @zaui-space-size-sm;
|
|
5
|
+
font-weight : 600;
|
|
6
|
+
line-height : 14px;
|
|
7
|
+
border-left : 4px solid @zaui-brand;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.pro-form-list {
|
|
11
|
-
display: flex;
|
|
11
|
+
display : flex;
|
|
12
12
|
padding-bottom: 0;
|
|
13
13
|
|
|
14
14
|
&.pro-form-list-last {
|
|
15
|
+
|
|
15
16
|
.pro-form-list-drag-handle,
|
|
16
17
|
.ant-form-item {
|
|
17
18
|
margin-bottom: 0 !important;
|
|
@@ -19,12 +20,12 @@
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
.single-delete {
|
|
22
|
-
width: 14px !important;
|
|
23
|
+
width : 14px !important;
|
|
23
24
|
height: 14px !important;
|
|
24
|
-
color:
|
|
25
|
+
color : @zaui-placeholder;
|
|
25
26
|
|
|
26
27
|
&:hover {
|
|
27
|
-
color:
|
|
28
|
+
color: @zaui-aide-text;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
|
|
@@ -35,19 +36,19 @@
|
|
|
35
36
|
.pro-form-list-action {
|
|
36
37
|
padding-bottom: var(--zaui-height-size-md, 16px);
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
margin-left:
|
|
39
|
+
&>.ant-space-item:first-child>.ant-btn-link {
|
|
40
|
+
margin-left: @zaui-space-size-sm;
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
.pro-form-list-drag-handle {
|
|
44
|
-
display: flex;
|
|
45
|
-
align-items: center;
|
|
46
|
-
height: @zaui-height-size-lg;
|
|
47
|
-
margin-bottom:
|
|
48
|
-
padding: 0;
|
|
45
|
+
display : flex;
|
|
46
|
+
align-items : center;
|
|
47
|
+
height : @zaui-height-size-lg;
|
|
48
|
+
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
49
|
+
padding : 0;
|
|
49
50
|
padding-right: @zaui-space-size-sm;
|
|
50
|
-
border: none;
|
|
51
|
+
border : none;
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
.pro-form-list-toolbar,
|
|
63
64
|
.pro-form-list-action {
|
|
64
65
|
.ant-btn-link {
|
|
65
|
-
padding:
|
|
66
|
+
padding: @zaui-space-size-xs 0;
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
.ant-btn-text:hover {
|
|
@@ -33,7 +33,7 @@ var Group = function Group(props) {
|
|
|
33
33
|
var fieldList = [];
|
|
34
34
|
var result = columns.map(function (item) {
|
|
35
35
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
36
|
-
disabled: props === null || props === void 0 ? void 0 : props.disabled
|
|
36
|
+
disabled: Boolean(props === null || props === void 0 ? void 0 : props.disabled)
|
|
37
37
|
}, item), {}, {
|
|
38
38
|
noStyle: (space === null || space === void 0 ? void 0 : space.compact) || (space === null || space === void 0 ? void 0 : space.separator),
|
|
39
39
|
parentNames: _parentNames
|
|
@@ -47,7 +47,7 @@ var Group = function Group(props) {
|
|
|
47
47
|
columns: (0, _utils.insertSeparator)(result, space, node, otherProps),
|
|
48
48
|
fieldList: fieldList
|
|
49
49
|
};
|
|
50
|
-
}, [name, columns, space]);
|
|
50
|
+
}, [name, columns, space, props]);
|
|
51
51
|
var _className = (0, _classnames2.default)((0, _defineProperty2.default)({
|
|
52
52
|
'pro-group': true,
|
|
53
53
|
'pro-group-diy-width': columns.some(function (item) {
|
|
@@ -19,8 +19,10 @@ var _antd = require("antd");
|
|
|
19
19
|
var _utils = require("@zat-design/utils");
|
|
20
20
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
|
21
21
|
var _useEnum = _interopRequireDefault(require("../../../../ProEnum/hooks/useEnum"));
|
|
22
|
-
var
|
|
22
|
+
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
23
|
+
var _excluded = ["className", "getPopupContainer", "hasDetail", "detailMaxLength", "fieldNames", "value", "disabled", "dataSource", "onChange", "useRequest", "transformResponse", "level", "isView", "enumCode", "code", "tooltip", "separator"];
|
|
23
24
|
var transformDataName = _utils.tools.transformDataName;
|
|
25
|
+
var Text = _antd.Typography.Text;
|
|
24
26
|
var filterDataSource = function filterDataSource(dataSource, level) {
|
|
25
27
|
return dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
26
28
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
|
@@ -46,7 +48,7 @@ var levelMap = {
|
|
|
46
48
|
3: 'county'
|
|
47
49
|
};
|
|
48
50
|
var ProAddressBar = function ProAddressBar(props) {
|
|
49
|
-
var _otherProps$otherProp, _ref11, _ref11$filter;
|
|
51
|
+
var _otherProps$otherProp, _ref11, _ref11$filter, _locale$ProAddressBar, _locale$ProAddressBar2, _locale$ProAddressBar3;
|
|
50
52
|
var _ref = (0, _ProConfigProvider.useProConfig)('ProAddressBar') || {},
|
|
51
53
|
configUseRequest = _ref.useRequest,
|
|
52
54
|
configTransformResponse = _ref.transformResponse,
|
|
@@ -55,8 +57,8 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
55
57
|
configFieldNames = _ref.fieldNames,
|
|
56
58
|
configEnumCode = _ref.enumCode,
|
|
57
59
|
configCode = _ref.code;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
var className = props.className,
|
|
61
|
+
getPopupContainer = props.getPopupContainer,
|
|
60
62
|
_props$hasDetail = props.hasDetail,
|
|
61
63
|
hasDetail = _props$hasDetail === void 0 ? true : _props$hasDetail,
|
|
62
64
|
_props$detailMaxLengt = props.detailMaxLength,
|
|
@@ -173,7 +175,7 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
173
175
|
transFormData = transformDataName(newData, {
|
|
174
176
|
label: fieldNames.label,
|
|
175
177
|
value: fieldNames.value,
|
|
176
|
-
children: 'children'
|
|
178
|
+
children: (fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'
|
|
177
179
|
});
|
|
178
180
|
setServiceData(realLevel === 2 ? filterDataSource(transFormData, level) : transFormData);
|
|
179
181
|
}
|
|
@@ -267,19 +269,19 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
267
269
|
}, [service]);
|
|
268
270
|
(0, _react.useEffect)(function () {
|
|
269
271
|
// 传入useRequest时初始化province展示
|
|
270
|
-
if (service && !fetched && province) {
|
|
272
|
+
if (service && loadData && !fetched && province) {
|
|
271
273
|
initAddressLabel('province', province, provinceOptions);
|
|
272
274
|
}
|
|
273
275
|
}, [province, fetched, provinceOptions]);
|
|
274
276
|
(0, _react.useEffect)(function () {
|
|
275
277
|
// 传入useRequest时初始化city展示
|
|
276
|
-
if (service && !fetched && province && city) {
|
|
278
|
+
if (service && loadData && !fetched && province && city) {
|
|
277
279
|
initAddressLabel('city', city, (0, _defineProperty2.default)({}, parentKey, province));
|
|
278
280
|
}
|
|
279
281
|
}, [province, city, fetched]);
|
|
280
282
|
(0, _react.useEffect)(function () {
|
|
281
283
|
// 传入useRequest时初始化county展示
|
|
282
|
-
if (service && !fetched && city && county) {
|
|
284
|
+
if (service && loadData && !fetched && city && county) {
|
|
283
285
|
initAddressLabel('county', county, (0, _defineProperty2.default)({}, parentKey, city));
|
|
284
286
|
}
|
|
285
287
|
}, [city, county, fetched]);
|
|
@@ -289,6 +291,12 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
289
291
|
setDefaultLabel(getAddressLabel(realDataSource, value));
|
|
290
292
|
}
|
|
291
293
|
}, [realIsView, value, realDataSource]);
|
|
294
|
+
(0, _react.useEffect)(function () {
|
|
295
|
+
// 传入useRequest但loadData为fasle查看时初始化展示
|
|
296
|
+
if (realIsView && value && (serviceData === null || serviceData === void 0 ? void 0 : serviceData.length) > 0) {
|
|
297
|
+
setDefaultLabel(getAddressLabel(serviceData, value));
|
|
298
|
+
}
|
|
299
|
+
}, [realIsView, value, serviceData]);
|
|
292
300
|
var handleLoadData = /*#__PURE__*/function () {
|
|
293
301
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4(selectedOptions) {
|
|
294
302
|
var targetOption, data;
|
|
@@ -322,14 +330,14 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
322
330
|
return _ref10.apply(this, arguments);
|
|
323
331
|
};
|
|
324
332
|
}();
|
|
325
|
-
var handleChange = function handleChange(changeValue) {
|
|
333
|
+
var handleChange = function handleChange(changeValue, selectedOptions) {
|
|
326
334
|
if (onChange) {
|
|
327
335
|
if (hasDetail && address) {
|
|
328
336
|
var realValue = changeValue || [];
|
|
329
337
|
realValue[realLevel] = address;
|
|
330
|
-
onChange(realValue);
|
|
338
|
+
onChange(realValue, selectedOptions);
|
|
331
339
|
} else {
|
|
332
|
-
onChange(changeValue);
|
|
340
|
+
onChange(changeValue, selectedOptions);
|
|
333
341
|
}
|
|
334
342
|
}
|
|
335
343
|
};
|
|
@@ -364,56 +372,66 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
364
372
|
var viewValue = ((_ref11 = [provinceLabel, cityLabel, countyLabel, value === null || value === void 0 ? void 0 : value[realLevel]]) === null || _ref11 === void 0 ? void 0 : (_ref11$filter = _ref11.filter(function (item) {
|
|
365
373
|
return !!item;
|
|
366
374
|
})) === null || _ref11$filter === void 0 ? void 0 : _ref11$filter.join(separator)) || '-';
|
|
367
|
-
return (0, _jsxRuntime.jsx)(
|
|
368
|
-
className:
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
disabled: disabled,
|
|
376
|
-
displayRender: function displayRender(label) {
|
|
377
|
-
return label === null || label === void 0 ? void 0 : label.filter(function (item) {
|
|
378
|
-
return !!item;
|
|
379
|
-
}).join('/');
|
|
380
|
-
},
|
|
381
|
-
showSearch: {
|
|
382
|
-
filter: handlefilter
|
|
383
|
-
},
|
|
384
|
-
onChange: handleChange
|
|
385
|
-
}) : (0, _jsxRuntime.jsx)(_antd.Cascader, {
|
|
386
|
-
className: hasDetail ? '' : 'no-detail',
|
|
387
|
-
placeholder: "\u8BF7\u9009\u62E9",
|
|
388
|
-
value: addressValue,
|
|
389
|
-
loadData: handleLoadData,
|
|
390
|
-
// @ts-ignore
|
|
391
|
-
options: provinces,
|
|
392
|
-
disabled: disabled,
|
|
393
|
-
displayRender: displayRender,
|
|
394
|
-
changeOnSelect: true,
|
|
395
|
-
// @ts-ignore
|
|
396
|
-
onChange: handleChange
|
|
397
|
-
}), hasDetail && (tooltip && disabled && address ? (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
398
|
-
title: address,
|
|
399
|
-
children: (0, _jsxRuntime.jsx)("span", {
|
|
400
|
-
className: "pro-address-detail",
|
|
401
|
-
children: (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
402
|
-
disabled: disabled,
|
|
403
|
-
value: address
|
|
404
|
-
})
|
|
405
|
-
})
|
|
406
|
-
}) : (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
407
|
-
allowClear: true,
|
|
408
|
-
autoComplete: "off",
|
|
409
|
-
disabled: disabled,
|
|
410
|
-
value: address,
|
|
411
|
-
maxLength: detailMaxLength,
|
|
412
|
-
placeholder: "\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740",
|
|
413
|
-
// @ts-ignore
|
|
414
|
-
onChange: handleAddressChange
|
|
415
|
-
}))]
|
|
375
|
+
return realIsView ? tooltip ? (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
376
|
+
className: className,
|
|
377
|
+
title: tooltip === true ? viewValue : tooltip,
|
|
378
|
+
children: (0, _jsxRuntime.jsx)(Text, {
|
|
379
|
+
ellipsis: {
|
|
380
|
+
tooltip: false
|
|
381
|
+
},
|
|
382
|
+
children: viewValue
|
|
416
383
|
})
|
|
384
|
+
}) : (0, _jsxRuntime.jsx)("span", {
|
|
385
|
+
className: className,
|
|
386
|
+
children: viewValue
|
|
387
|
+
}) : (0, _jsxRuntime.jsxs)("div", {
|
|
388
|
+
className: "pro-address ".concat(className),
|
|
389
|
+
children: [dataSource || addressCode || !loadData ? (0, _jsxRuntime.jsx)(_antd.Cascader, {
|
|
390
|
+
className: hasDetail ? '' : 'no-detail',
|
|
391
|
+
placeholder: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProAddressBar = _locale.default.ProAddressBar) === null || _locale$ProAddressBar === void 0 ? void 0 : _locale$ProAddressBar.placeholder,
|
|
392
|
+
value: addressValue,
|
|
393
|
+
options: !loadData ? serviceData : realDataSource,
|
|
394
|
+
disabled: disabled,
|
|
395
|
+
displayRender: function displayRender(label) {
|
|
396
|
+
return label === null || label === void 0 ? void 0 : label.filter(function (item) {
|
|
397
|
+
return !!item;
|
|
398
|
+
}).join('/');
|
|
399
|
+
},
|
|
400
|
+
showSearch: {
|
|
401
|
+
filter: handlefilter
|
|
402
|
+
},
|
|
403
|
+
onChange: handleChange
|
|
404
|
+
}) : (0, _jsxRuntime.jsx)(_antd.Cascader, {
|
|
405
|
+
className: hasDetail ? '' : 'no-detail',
|
|
406
|
+
placeholder: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProAddressBar2 = _locale.default.ProAddressBar) === null || _locale$ProAddressBar2 === void 0 ? void 0 : _locale$ProAddressBar2.placeholder,
|
|
407
|
+
value: addressValue,
|
|
408
|
+
loadData: handleLoadData,
|
|
409
|
+
// @ts-ignore
|
|
410
|
+
options: provinces,
|
|
411
|
+
disabled: disabled,
|
|
412
|
+
displayRender: displayRender,
|
|
413
|
+
changeOnSelect: true,
|
|
414
|
+
// @ts-ignore
|
|
415
|
+
onChange: handleChange
|
|
416
|
+
}), hasDetail && (tooltip && disabled && address ? (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
417
|
+
title: address,
|
|
418
|
+
children: (0, _jsxRuntime.jsx)("span", {
|
|
419
|
+
className: "pro-address-detail",
|
|
420
|
+
children: (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
421
|
+
disabled: disabled,
|
|
422
|
+
value: address
|
|
423
|
+
})
|
|
424
|
+
})
|
|
425
|
+
}) : (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
426
|
+
allowClear: true,
|
|
427
|
+
autoComplete: "off",
|
|
428
|
+
disabled: disabled,
|
|
429
|
+
value: address,
|
|
430
|
+
maxLength: detailMaxLength,
|
|
431
|
+
placeholder: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProAddressBar3 = _locale.default.ProAddressBar) === null || _locale$ProAddressBar3 === void 0 ? void 0 : _locale$ProAddressBar3.detailPlaceholder,
|
|
432
|
+
// @ts-ignore
|
|
433
|
+
onChange: handleAddressChange
|
|
434
|
+
}))]
|
|
417
435
|
});
|
|
418
436
|
};
|
|
419
437
|
// @ts-ignore
|
|
@@ -3,11 +3,12 @@ import { DefaultOptionType } from 'rc-select/lib/Select';
|
|
|
3
3
|
import { Service } from 'ahooks/lib/useRequest/src/types';
|
|
4
4
|
export interface AddressProps {
|
|
5
5
|
getPopupContainer?: () => ReactNode;
|
|
6
|
+
className?: string;
|
|
6
7
|
isView?: boolean;
|
|
7
8
|
value?: string[];
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
hasDetail?: boolean;
|
|
10
|
-
tooltip?: boolean;
|
|
11
|
+
tooltip?: boolean | ReactNode;
|
|
11
12
|
detailMaxLength?: number;
|
|
12
13
|
fieldNames?: {
|
|
13
14
|
label: string;
|
|
@@ -20,7 +21,7 @@ export interface AddressProps {
|
|
|
20
21
|
defaultParams?: any;
|
|
21
22
|
parentKey?: string;
|
|
22
23
|
};
|
|
23
|
-
onChange?: (value: string[]) => void;
|
|
24
|
+
onChange?: (value: string[], selectedOptions?: any[]) => void;
|
|
24
25
|
transformResponse?: (data: any[]) => any[];
|
|
25
26
|
level?: number;
|
|
26
27
|
enumCode?: string;
|
|
@@ -23,7 +23,8 @@ var _index = require("../../../../index");
|
|
|
23
23
|
var _Container = _interopRequireDefault(require("../../Container"));
|
|
24
24
|
var _view = _interopRequireDefault(require("../../../../assets/view.svg"));
|
|
25
25
|
var _useRequestList2 = _interopRequireDefault(require("./hooks/useRequestList"));
|
|
26
|
-
var
|
|
26
|
+
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
27
|
+
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "otherProps", "searchForm", "defaultOne"],
|
|
27
28
|
_excluded2 = ["onOk"],
|
|
28
29
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
|
29
30
|
var ProModalSelect = function ProModalSelect(props, ref) {
|
|
@@ -49,6 +50,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
49
50
|
isTooltip = props.isTooltip,
|
|
50
51
|
otherProps = props.otherProps,
|
|
51
52
|
searchForm = props.searchForm,
|
|
53
|
+
defaultOne = props.defaultOne,
|
|
52
54
|
restInputProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
53
55
|
var contentForm = _antd.Form.useFormInstance();
|
|
54
56
|
if (!configOption || Object.prototype.toString.call(configOption) !== '[object Object]') {
|
|
@@ -126,7 +128,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
126
128
|
transformResponse: transformResponse
|
|
127
129
|
}, (0, _objectSpread2.default)({
|
|
128
130
|
manual: true,
|
|
129
|
-
ready: (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || visible
|
|
131
|
+
ready: (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || visible || defaultOne
|
|
130
132
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
|
|
131
133
|
data = _useRequestList.data,
|
|
132
134
|
loading = _useRequestList.loading,
|
|
@@ -289,7 +291,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
289
291
|
_context2.next = 4;
|
|
290
292
|
break;
|
|
291
293
|
}
|
|
292
|
-
_antd.message.error(
|
|
294
|
+
_antd.message.error(_locale.default.ProModalSelect.checkMsg);
|
|
293
295
|
return _context2.abrupt("return", false);
|
|
294
296
|
case 4:
|
|
295
297
|
_data = isMultiple ? selectedRows : selectedRows === null || selectedRows === void 0 ? void 0 : selectedRows[0];
|
|
@@ -411,14 +413,14 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
411
413
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
412
414
|
var getInitValues = /*#__PURE__*/function () {
|
|
413
415
|
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4() {
|
|
414
|
-
var _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _list, list, _res$data, _data2, nextSelectRowKeys;
|
|
416
|
+
var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _list, list, _res$data, _data2, nextSelectRowKeys;
|
|
415
417
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee4$(_context4) {
|
|
416
418
|
while (1) switch (_context4.prev = _context4.next) {
|
|
417
419
|
case 0:
|
|
418
420
|
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
|
419
|
-
useRequest.initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm.getFieldsValue());
|
|
421
|
+
useRequest.initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 ? void 0 : (_contentForm$getField = contentForm.getFieldsValue) === null || _contentForm$getField === void 0 ? void 0 : _contentForm$getField.call(contentForm));
|
|
420
422
|
}
|
|
421
|
-
if (!(useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams)) {
|
|
423
|
+
if (!((useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || defaultOne)) {
|
|
422
424
|
_context4.next = 13;
|
|
423
425
|
break;
|
|
424
426
|
}
|
|
@@ -432,7 +434,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
432
434
|
});
|
|
433
435
|
return _context4.abrupt("return");
|
|
434
436
|
case 5:
|
|
435
|
-
queryBean = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.defaultParams), useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams);
|
|
437
|
+
queryBean = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.defaultParams), (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || {});
|
|
436
438
|
page = (0, _objectSpread2.default)({
|
|
437
439
|
pageNum: 1,
|
|
438
440
|
pageSize: 10
|
|
@@ -475,6 +477,61 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
475
477
|
return _ref9.apply(this, arguments);
|
|
476
478
|
};
|
|
477
479
|
}();
|
|
480
|
+
// 初始化回显,当传入initParams时,前端用来回险
|
|
481
|
+
var getDefaultOneValues = /*#__PURE__*/function () {
|
|
482
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5() {
|
|
483
|
+
var _useRequest$options4, _useRequest$options5;
|
|
484
|
+
var queryBean, page, params, res, _list2, list, _res$data2, _data3, nextSelectRowKeys;
|
|
485
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {
|
|
486
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
487
|
+
case 0:
|
|
488
|
+
queryBean = (0, _objectSpread2.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options4 = useRequest.options) === null || _useRequest$options4 === void 0 ? void 0 : _useRequest$options4.defaultParams);
|
|
489
|
+
page = (0, _objectSpread2.default)({
|
|
490
|
+
pageNum: 1,
|
|
491
|
+
pageSize: 10
|
|
492
|
+
}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options5 = useRequest.options) === null || _useRequest$options5 === void 0 ? void 0 : _useRequest$options5.page);
|
|
493
|
+
params = withPagination ? (0, _objectSpread2.default)((0, _objectSpread2.default)({}, page), {}, {
|
|
494
|
+
queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
|
|
495
|
+
}) : queryBean;
|
|
496
|
+
params = transformParams ? transformParams(params) : params;
|
|
497
|
+
_context5.next = 6;
|
|
498
|
+
return runAsync(params);
|
|
499
|
+
case 6:
|
|
500
|
+
res = _context5.sent;
|
|
501
|
+
if (res === null || res === void 0 ? void 0 : res.data) {
|
|
502
|
+
list = [];
|
|
503
|
+
if (transformResponse) {
|
|
504
|
+
list = transformResponse(res === null || res === void 0 ? void 0 : res.data);
|
|
505
|
+
} else {
|
|
506
|
+
list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list : res === null || res === void 0 ? void 0 : res.data;
|
|
507
|
+
}
|
|
508
|
+
_data3 = isMultiple ? list : (_list2 = list) === null || _list2 === void 0 ? void 0 : _list2[0];
|
|
509
|
+
nextSelectRowKeys = isMultiple ? value : [value];
|
|
510
|
+
if (labelInValue) {
|
|
511
|
+
onChange(_data3);
|
|
512
|
+
} else {
|
|
513
|
+
onChange(isMultiple ? _data3.map(function (item) {
|
|
514
|
+
return item[valueKey];
|
|
515
|
+
}) : _data3[valueKey]);
|
|
516
|
+
}
|
|
517
|
+
// 更新内部展示值
|
|
518
|
+
setState({
|
|
519
|
+
_value: _data3,
|
|
520
|
+
isInit: false,
|
|
521
|
+
selectedRows: list,
|
|
522
|
+
selectedRowKeys: nextSelectRowKeys
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
case 8:
|
|
526
|
+
case "end":
|
|
527
|
+
return _context5.stop();
|
|
528
|
+
}
|
|
529
|
+
}, _callee5);
|
|
530
|
+
}));
|
|
531
|
+
return function getDefaultOneValues() {
|
|
532
|
+
return _ref10.apply(this, arguments);
|
|
533
|
+
};
|
|
534
|
+
}();
|
|
478
535
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
479
536
|
return {
|
|
480
537
|
handleClick: handleClick,
|
|
@@ -506,8 +563,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
506
563
|
});
|
|
507
564
|
(0, _react.useEffect)(function () {
|
|
508
565
|
if (onOff && !visible) {
|
|
509
|
-
var _useRequest$
|
|
510
|
-
if ((useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$
|
|
566
|
+
var _useRequest$options6;
|
|
567
|
+
if ((useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options6 = useRequest.options) === null || _useRequest$options6 === void 0 ? void 0 : _useRequest$options6.manual) !== true) {
|
|
511
568
|
onReset();
|
|
512
569
|
}
|
|
513
570
|
var nextState = {
|
|
@@ -539,11 +596,15 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
539
596
|
}, [value, visible, isInit]);
|
|
540
597
|
(0, _react.useEffect)(function () {
|
|
541
598
|
if (!value) {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
599
|
+
if (defaultOne) {
|
|
600
|
+
getDefaultOneValues();
|
|
601
|
+
} else {
|
|
602
|
+
setState({
|
|
603
|
+
_value: undefined,
|
|
604
|
+
selectedRowKeys: [],
|
|
605
|
+
selectedRows: []
|
|
606
|
+
});
|
|
607
|
+
}
|
|
547
608
|
}
|
|
548
609
|
if (labelInValue && _value && !(0, _lodash.isEqual)(value, _value)) {
|
|
549
610
|
setState({
|
|
@@ -594,7 +655,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
594
655
|
onChange: handleChangeValue,
|
|
595
656
|
disabled: disabled,
|
|
596
657
|
addonAfter: forceAddonAfterRender(),
|
|
597
|
-
placeholder:
|
|
658
|
+
placeholder: _locale.default.ProModalSelect.select,
|
|
598
659
|
autoComplete: "off"
|
|
599
660
|
}, restInputProps)), (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
600
661
|
type: "hidden",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
> span {
|
|
24
24
|
position: relative;
|
|
25
|
-
font-size: var(--zaui-font-size
|
|
25
|
+
font-size: var(--zaui-font-size, 14px);
|
|
26
26
|
border: none;
|
|
27
27
|
border-radius: 50%;
|
|
28
28
|
}
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
&:hover {
|
|
58
58
|
.ant-input,
|
|
59
59
|
.ant-input-group-addon {
|
|
60
|
-
border-color:
|
|
60
|
+
border-color: @zaui-form-control-line;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
.ant-input-group-addon {
|
|
76
|
-
padding: 0px var(--zaui-space-size-
|
|
76
|
+
padding: 0px var(--zaui-space-size-sm, 8px);
|
|
77
77
|
background-color: var(--zaui-base-bg, #ffffff);
|
|
78
78
|
cursor: pointer;
|
|
79
79
|
|