@zat-design/sisyphus-react 3.7.3 → 3.8.0-beat.10
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 +100 -4
- package/dist/less.esm.css +97 -4
- package/es/ProAction/index.js +1 -1
- package/es/ProDownload/index.js +3 -3
- package/es/ProDownload/utils.js +3 -3
- package/es/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/es/ProDrawerForm/components/ProModal/index.js +3 -3
- package/es/ProEditLabel/index.js +3 -3
- package/es/ProEditTable/components/ActionButton/index.js +3 -3
- package/es/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/es/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +29 -14
- package/es/ProEditTable/components/RenderField/index.js +10 -8
- package/es/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/es/ProEditTable/utils/config.js +2 -2
- package/es/ProEditTable/utils/index.js +5 -5
- package/es/ProEditTable/utils/tools.js +1 -1
- package/es/ProEnum/components/Group.js +10 -2
- package/es/ProEnum/hooks/useEnumRequest.js +2 -2
- package/es/ProEnum/index.js +6 -5
- package/es/ProEnum/style/index.less +14 -4
- package/es/ProEnum/utils/index.d.ts +1 -1
- package/es/ProEnum/utils/index.js +4 -0
- package/es/ProForm/components/combination/Container/index.js +5 -3
- package/es/ProForm/components/combination/Container/propsType.d.ts +2 -1
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/es/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/es/ProForm/components/combination/FormList/utils.js +6 -5
- package/es/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/es/ProForm/components/combination/Group/utils.js +8 -1
- package/es/ProForm/components/combination/ProCascader/index.js +6 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +57 -46
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProNumberRange/index.js +14 -5
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
- package/es/ProForm/components/old/ProAddress/index.js +1 -1
- package/es/ProForm/components/render/ChangedWrapper.d.ts +17 -0
- package/es/ProForm/components/render/ChangedWrapper.js +110 -0
- package/es/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/es/ProForm/components/render/Render.js +11 -11
- package/es/ProForm/components/render/RenderFields.d.ts +2 -3
- package/es/ProForm/components/render/RenderFields.js +3 -4
- package/es/ProForm/components/render/propsType.d.ts +5 -4
- package/es/ProForm/index.js +4 -7
- package/es/ProForm/propsType.d.ts +13 -2
- package/es/ProForm/style/index.less +103 -5
- package/es/ProForm/utils/diffOriginal.d.ts +4 -4
- package/es/ProForm/utils/diffOriginal.js +18 -7
- package/es/ProForm/utils/transformValue.js +17 -11
- package/es/ProForm/utils/useForm.js +1 -1
- package/es/ProForm/utils/useShouldUpdate.d.ts +2 -2
- package/es/ProForm/utils/useShouldUpdate.js +1 -1
- package/es/ProSelect/index.js +12 -11
- package/es/ProSelect/propsType.d.ts +4 -0
- package/es/ProSelect/utils/index.js +5 -4
- package/es/ProStep/components/Listener/index.d.ts +1 -1
- package/es/ProStep/components/Listener/index.js +6 -3
- package/es/ProStep/index.d.ts +1 -1
- package/es/ProStep/index.js +25 -18
- package/es/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/es/ProTable/components/FormatColumn/index.js +14 -8
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/es/ProTable/hooks/useAntdTable.js +3 -3
- package/es/ProTable/index.js +30 -13
- package/es/ProTable/propsType.d.ts +14 -1
- package/es/ProTable/style/index.less +1 -1
- package/es/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/es/ProTree/components/AdaptiveTooltip.js +55 -0
- package/es/ProTree/components/List.js +15 -3
- package/es/ProTree/components/ProTree.js +1 -1
- package/es/ProTree/components/ProTreeSelect/index.js +38 -5
- package/es/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
- package/es/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/es/ProTree/components/SearchTitle.d.ts +2 -0
- package/es/ProTree/components/SearchTitle.js +17 -8
- package/es/ProTree/components/Tree.js +1 -1
- package/es/ProTree/style/index.less +14 -0
- package/es/ProTreeModal/components/Tree.js +15 -17
- package/es/ProTreeModal/index.js +62 -7
- package/es/ProTreeModal/utils.d.ts +1 -0
- package/es/ProTreeModal/utils.js +21 -1
- package/es/ProUpload/components/ImageRender.js +1 -1
- package/es/ProViewer/index.js +2 -2
- package/es/old/ProEditableTable/index.js +4 -4
- package/es/style/theme/antd.less +5 -0
- package/es/style/theme/index.less +2 -1
- package/es/style/theme/tokens.less +1 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +13 -0
- package/lib/ProAction/index.js +1 -1
- package/lib/ProDownload/index.js +3 -3
- package/lib/ProDownload/utils.js +3 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.js +4 -4
- package/lib/ProDrawerForm/components/ProModal/index.js +3 -3
- package/lib/ProEditLabel/index.js +3 -3
- package/lib/ProEditTable/components/ActionButton/index.js +3 -3
- package/lib/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/lib/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +32 -15
- package/lib/ProEditTable/components/RenderField/index.js +10 -8
- package/lib/ProEditTable/components/RenderToolbar/index.js +1 -1
- package/lib/ProEditTable/utils/config.js +2 -2
- package/lib/ProEditTable/utils/index.js +5 -5
- package/lib/ProEditTable/utils/tools.js +1 -1
- package/lib/ProEnum/components/Group.js +10 -2
- package/lib/ProEnum/hooks/useEnumRequest.js +2 -2
- package/lib/ProEnum/index.js +6 -5
- package/lib/ProEnum/style/index.less +14 -4
- package/lib/ProEnum/utils/index.d.ts +1 -1
- package/lib/ProEnum/utils/index.js +4 -0
- package/lib/ProForm/components/combination/Container/index.js +5 -3
- package/lib/ProForm/components/combination/Container/propsType.d.ts +2 -1
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +2 -2
- package/lib/ProForm/components/combination/FormList/components/BlockTitle.js +1 -1
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +1 -1
- package/lib/ProForm/components/combination/FormList/utils.js +5 -4
- package/lib/ProForm/components/combination/Group/component/ComRender.js +1 -1
- package/lib/ProForm/components/combination/Group/utils.js +8 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +6 -3
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +1 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +56 -45
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProNumberRange/index.js +14 -5
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +5 -1
- package/lib/ProForm/components/old/ProAddress/index.js +1 -1
- package/lib/ProForm/components/render/ChangedWrapper.d.ts +17 -0
- package/lib/ProForm/components/render/ChangedWrapper.js +115 -0
- package/lib/ProForm/components/render/ConfirmWrapper.js +1 -1
- package/lib/ProForm/components/render/Render.js +11 -11
- package/lib/ProForm/components/render/RenderFields.d.ts +2 -3
- package/lib/ProForm/components/render/RenderFields.js +3 -4
- package/lib/ProForm/components/render/propsType.d.ts +5 -4
- package/lib/ProForm/index.js +4 -7
- package/lib/ProForm/propsType.d.ts +13 -2
- package/lib/ProForm/style/index.less +103 -5
- package/lib/ProForm/utils/diffOriginal.d.ts +4 -4
- package/lib/ProForm/utils/diffOriginal.js +18 -7
- package/lib/ProForm/utils/transformValue.js +17 -11
- package/lib/ProForm/utils/useForm.js +1 -1
- package/lib/ProForm/utils/useShouldUpdate.d.ts +2 -2
- package/lib/ProForm/utils/useShouldUpdate.js +1 -1
- package/lib/ProSelect/index.js +12 -11
- package/lib/ProSelect/propsType.d.ts +4 -0
- package/lib/ProSelect/utils/index.js +5 -4
- package/lib/ProStep/components/Listener/index.d.ts +1 -1
- package/lib/ProStep/components/Listener/index.js +6 -3
- package/lib/ProStep/index.d.ts +1 -1
- package/lib/ProStep/index.js +25 -18
- package/lib/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/lib/ProTable/components/FormatColumn/index.js +14 -8
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +2 -2
- package/lib/ProTable/hooks/useAntdTable.js +3 -3
- package/lib/ProTable/index.js +30 -13
- package/lib/ProTable/propsType.d.ts +14 -1
- package/lib/ProTable/style/index.less +1 -1
- package/lib/ProTree/components/AdaptiveTooltip.d.ts +4 -0
- package/lib/ProTree/components/AdaptiveTooltip.js +61 -0
- package/lib/ProTree/components/List.js +15 -3
- package/lib/ProTree/components/ProTree.js +1 -1
- package/lib/ProTree/components/ProTreeSelect/index.js +38 -5
- package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +2 -0
- package/lib/ProTree/components/ProTreeSelect/style/index.less +2 -2
- package/lib/ProTree/components/SearchTitle.d.ts +2 -0
- package/lib/ProTree/components/SearchTitle.js +19 -7
- package/lib/ProTree/components/Tree.js +1 -1
- package/lib/ProTree/style/index.less +14 -0
- package/lib/ProTreeModal/components/Tree.js +15 -17
- package/lib/ProTreeModal/index.js +61 -6
- package/lib/ProTreeModal/utils.d.ts +1 -0
- package/lib/ProTreeModal/utils.js +20 -0
- package/lib/ProUpload/components/ImageRender.js +1 -1
- package/lib/ProViewer/index.js +2 -2
- package/lib/old/ProEditableTable/index.js +4 -4
- package/lib/style/theme/antd.less +5 -0
- package/lib/style/theme/index.less +2 -1
- package/lib/style/theme/tokens.less +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +19 -0
- package/package.json +4 -4
- package/es/ProForm/components/render/Changed.d.ts +0 -14
- package/es/ProForm/components/render/Changed.js +0 -64
- package/lib/ProForm/components/render/Changed.d.ts +0 -14
- package/lib/ProForm/components/render/Changed.js +0 -69
- /package/es/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
- /package/es/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
- /package/es/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
- /package/es/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
- /package/lib/ProForm/utils/{useChanged.d.ts → _useChanged.d.ts} +0 -0
- /package/lib/ProForm/utils/{useChanged.js → _useChanged.js} +0 -0
- /package/lib/ProForm/utils/{useListChanged.d.ts → _useListChanged.d.ts} +0 -0
- /package/lib/ProForm/utils/{useListChanged.js → _useListChanged.js} +0 -0
|
@@ -82,7 +82,7 @@ var RenderToolbar = function RenderToolbar(config) {
|
|
|
82
82
|
toolbar.show = show !== null && show !== void 0 ? show : true;
|
|
83
83
|
toolbar.needConfirm = needConfirm !== null && needConfirm !== void 0 ? needConfirm : true;
|
|
84
84
|
toolbar.onEvent = /*#__PURE__*/function () {
|
|
85
|
-
var _ref = (0, _asyncToGenerator2.default)(
|
|
85
|
+
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(record, index) {
|
|
86
86
|
var onEvent, result;
|
|
87
87
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
88
88
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -69,7 +69,7 @@ var actions = exports.actions = {
|
|
|
69
69
|
});
|
|
70
70
|
},
|
|
71
71
|
save: function () {
|
|
72
|
-
var _save = (0, _asyncToGenerator2.default)(
|
|
72
|
+
var _save = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(_ref2) {
|
|
73
73
|
var record, editingKeys, setState, form, rowName, virtualRowName, result, updateData, nextEditingKeys, values;
|
|
74
74
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
75
75
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -172,7 +172,7 @@ var actions = exports.actions = {
|
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
174
|
add: function () {
|
|
175
|
-
var _add = (0, _asyncToGenerator2.default)(
|
|
175
|
+
var _add = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(_ref5) {
|
|
176
176
|
var _tableRef$current$que, _tableRef$current$que2;
|
|
177
177
|
var result, insertType, editingKeys, setState, form, name, virtualName, virtualKey, onlyOneLineMsg, tableRef, _ref5$prefixCls, prefixCls, nextData, rowKey, addData, nextEditingKeys;
|
|
178
178
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
@@ -30,7 +30,7 @@ var _excluded = ["type", "label", "show", "needConfirm", "onHandle", "onClick"],
|
|
|
30
30
|
// 渲染操作栏
|
|
31
31
|
var getActionColumn = function getActionColumn(config) {
|
|
32
32
|
var _cloneDeepWith = (0, _lodash.cloneDeepWith)(config, function (value) {
|
|
33
|
-
if (
|
|
33
|
+
if (/*#__PURE__*/_react.default.isValidElement(value)) {
|
|
34
34
|
return value;
|
|
35
35
|
}
|
|
36
36
|
}),
|
|
@@ -87,7 +87,7 @@ var getActionColumn = function getActionColumn(config) {
|
|
|
87
87
|
action.show = show !== null && show !== void 0 ? show : true;
|
|
88
88
|
action.needConfirm = needConfirm !== null && needConfirm !== void 0 ? needConfirm : true;
|
|
89
89
|
action.onEvent = /*#__PURE__*/function () {
|
|
90
|
-
var _ref = (0, _asyncToGenerator2.default)(
|
|
90
|
+
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(record, index) {
|
|
91
91
|
var _form$getFieldValue;
|
|
92
92
|
var rowName, _record, onEvent, result;
|
|
93
93
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
@@ -238,7 +238,7 @@ var transformColumns = exports.transformColumns = function transformColumns() {
|
|
|
238
238
|
children: [before, columnTitle, (0, _jsxRuntime.jsx)(_antd.Tooltip, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
239
239
|
title: tooltipTitle !== null && tooltipTitle !== void 0 ? tooltipTitle : tooltip
|
|
240
240
|
}, resetProps), {}, {
|
|
241
|
-
children: icon ? (
|
|
241
|
+
children: icon ? (/*#__PURE__*/_react.default.cloneElement(icon, {
|
|
242
242
|
className: 'icon-tip'
|
|
243
243
|
})) : (0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
|
244
244
|
className: "icon-tip",
|
|
@@ -384,8 +384,8 @@ var transformColumns = exports.transformColumns = function transformColumns() {
|
|
|
384
384
|
}
|
|
385
385
|
// cacheMap 用来存储缓存值,若有值后不再请求
|
|
386
386
|
if (JSON.stringify(cacheMap.current) === '{}') {
|
|
387
|
-
Promise.all(Object.entries(_cacheMap).map(
|
|
388
|
-
var _ref3 = (0, _asyncToGenerator2.default)(
|
|
387
|
+
Promise.all(Object.entries(_cacheMap).map(/*#__PURE__*/function () {
|
|
388
|
+
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(item) {
|
|
389
389
|
var _item, key, value, _ref4, service, option;
|
|
390
390
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
391
391
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -199,7 +199,7 @@ var handleScrollToError = exports.handleScrollToError = function handleScrollToE
|
|
|
199
199
|
*/
|
|
200
200
|
function cloneDeepFilterNode(value) {
|
|
201
201
|
return (0, _lodash.cloneDeepWith)(value, function (val) {
|
|
202
|
-
if (
|
|
202
|
+
if (/*#__PURE__*/_react.default.isValidElement(val)) {
|
|
203
203
|
return val;
|
|
204
204
|
}
|
|
205
205
|
});
|
|
@@ -50,7 +50,10 @@ var Group = function Group(props) {
|
|
|
50
50
|
}
|
|
51
51
|
return (0, _jsxRuntime.jsx)("div", {
|
|
52
52
|
id: id,
|
|
53
|
-
className: (0, _classnames.default)(
|
|
53
|
+
className: (0, _classnames.default)({
|
|
54
|
+
'pro-enum-group-root': true,
|
|
55
|
+
'pro-enum-group-root-disabled': disabled
|
|
56
|
+
}),
|
|
54
57
|
children: dataSource.map(function (item, index) {
|
|
55
58
|
return (0, _jsxRuntime.jsx)("div", {
|
|
56
59
|
onClick: function onClick() {
|
|
@@ -58,7 +61,12 @@ var Group = function Group(props) {
|
|
|
58
61
|
handleClick(item[fieldValue], index);
|
|
59
62
|
}
|
|
60
63
|
},
|
|
61
|
-
className: (0, _classnames.default)(
|
|
64
|
+
className: (0, _classnames.default)({
|
|
65
|
+
'pro-enum-group-item': true,
|
|
66
|
+
'pro-enum-group-item-selected': value === item[fieldValue],
|
|
67
|
+
'pro-enum-group-item-disabled-after': index === idx.current || index + 1 === idx.current,
|
|
68
|
+
'pro-enum-group-item-disabled': item.disabled
|
|
69
|
+
}),
|
|
62
70
|
children: item[fieldLabel]
|
|
63
71
|
}, item[fieldValue]);
|
|
64
72
|
})
|
|
@@ -59,7 +59,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
59
59
|
staleTime: 6e4 * 60
|
|
60
60
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
|
61
61
|
setCache: function () {
|
|
62
|
-
var _setCache = (0, _asyncToGenerator2.default)(
|
|
62
|
+
var _setCache = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(res) {
|
|
63
63
|
var response, _locale$ProEnum2, _useRequest$options, ignoreCodes, cacheData;
|
|
64
64
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
65
65
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -169,7 +169,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
169
169
|
}
|
|
170
170
|
}));
|
|
171
171
|
var mergeData = /*#__PURE__*/function () {
|
|
172
|
-
var _ref3 = (0, _asyncToGenerator2.default)(
|
|
172
|
+
var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
|
173
173
|
var cacheData, _useRequest$options2, _useRequest$options3, enumData, cacheCodes, codes, ignoreCodes, diff, response, res, _locale$ProEnum6;
|
|
174
174
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
175
175
|
while (1) switch (_context2.prev = _context2.next) {
|
package/lib/ProEnum/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var _getEnumLabel = _interopRequireDefault(require("./utils/getEnumLabel"));
|
|
|
26
26
|
var _useEnum = _interopRequireDefault(require("./hooks/useEnum"));
|
|
27
27
|
var _locale = _interopRequireDefault(require("../locale"));
|
|
28
28
|
require("./style/index.less");
|
|
29
|
-
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps"],
|
|
29
|
+
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps", "isView"],
|
|
30
30
|
_excluded2 = ["fieldNames", "clear", "cacheKey", "showCodeName"];
|
|
31
31
|
var ProEnum = function ProEnum(props) {
|
|
32
32
|
var _enumProps$showCodeNa;
|
|
@@ -40,10 +40,11 @@ var ProEnum = function ProEnum(props) {
|
|
|
40
40
|
onChange = props.onChange,
|
|
41
41
|
transformResponse = props.transformResponse,
|
|
42
42
|
otherProps = props.otherProps,
|
|
43
|
+
isView = props.isView,
|
|
43
44
|
enumProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
44
45
|
var _ref = otherProps || {},
|
|
45
|
-
isView = _ref.isView,
|
|
46
46
|
viewEmpty = _ref.viewEmpty;
|
|
47
|
+
var _isView = isView || (otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView);
|
|
47
48
|
var _ref2 = (0, _ProConfigProvider.useProConfig)('ProEnum') || {},
|
|
48
49
|
fieldNames = _ref2.fieldNames,
|
|
49
50
|
_ref2$clear = _ref2.clear,
|
|
@@ -153,7 +154,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
153
154
|
list = [];
|
|
154
155
|
}
|
|
155
156
|
}
|
|
156
|
-
if (
|
|
157
|
+
if (/*#__PURE__*/_react.default.isValidElement(component)) {
|
|
157
158
|
var Component = component;
|
|
158
159
|
return (0, _jsxRuntime.jsx)(Component, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, enumProps), {}, {
|
|
159
160
|
dataSource: list,
|
|
@@ -227,7 +228,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
227
228
|
if (!code && !dataSource && !useRequest) {
|
|
228
229
|
var _locale$ProEnum4;
|
|
229
230
|
_antd.message.error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum4 = _locale.default.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.errorNoEnumType);
|
|
230
|
-
return;
|
|
231
|
+
// return;
|
|
231
232
|
}
|
|
232
233
|
var transToLabel = function transToLabel(value) {
|
|
233
234
|
var list = dataList && dataList.length ? dataList : enumLists;
|
|
@@ -272,7 +273,7 @@ var ProEnum = function ProEnum(props) {
|
|
|
272
273
|
};
|
|
273
274
|
return (0, _lodash.isFunction)(props.optionRender) && record.length ? _optionRender() : labelList === null || labelList === void 0 ? void 0 : labelList.join(',');
|
|
274
275
|
};
|
|
275
|
-
if (
|
|
276
|
+
if (_isView) {
|
|
276
277
|
if (Array.isArray(value)) {
|
|
277
278
|
return (0, _jsxRuntime.jsx)(_Container.default, {
|
|
278
279
|
tooltip: true,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
@root-entry-name: 'default';
|
|
2
2
|
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
3
|
|
|
4
|
+
@zaui-disabled-bg: var(--zaui-disabled-bg);
|
|
5
|
+
|
|
4
6
|
.pro-enum {
|
|
5
7
|
&-tag-root {
|
|
6
8
|
display: flex;
|
|
@@ -19,7 +21,7 @@
|
|
|
19
21
|
justify-content: center;
|
|
20
22
|
margin-right: var(--zaui-space-size-sm);
|
|
21
23
|
padding: var(--zaui-space-size-xs) 10px;
|
|
22
|
-
background-color:
|
|
24
|
+
background-color: var(--zaui-disabled-bg);
|
|
23
25
|
border-radius: var(--zaui-space-size-xs);
|
|
24
26
|
cursor: pointer;
|
|
25
27
|
}
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
background-color: var(--zaui-brand);
|
|
30
32
|
}
|
|
31
33
|
&-tag-item-disabled {
|
|
32
|
-
background-color:
|
|
34
|
+
background-color: var(--zaui-disabled-bg);
|
|
33
35
|
pointer-events: none;
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -90,12 +92,20 @@
|
|
|
90
92
|
|
|
91
93
|
.pro-enum-group-item-disabled {
|
|
92
94
|
color: rgba(0, 0, 0, 0.25);
|
|
93
|
-
background:
|
|
95
|
+
background: var(--zaui-disabled-bg);
|
|
94
96
|
cursor: not-allowed;
|
|
95
97
|
}
|
|
96
98
|
}
|
|
97
99
|
|
|
98
100
|
&-group-root-disabled {
|
|
99
|
-
|
|
101
|
+
color: var(--zaui-aide-text);
|
|
102
|
+
|
|
103
|
+
.pro-enum-group-item {
|
|
104
|
+
background: var(--zaui-disabled-bg);
|
|
105
|
+
&.pro-enum-group-item-selected {
|
|
106
|
+
background: var(--zaui-brand-disabled);
|
|
107
|
+
border-color: var(--zaui-brand-disabled);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
100
110
|
}
|
|
101
111
|
}
|
|
@@ -5,7 +5,7 @@ interface EnumRes {
|
|
|
5
5
|
[key: string]: any;
|
|
6
6
|
}
|
|
7
7
|
export declare function getEnumData(storage: StorageType, cacheKey: string, baseEnumStorage?: any): EnumRes;
|
|
8
|
-
export declare function setEnumData(storage: StorageType, cacheKey: string, data:
|
|
8
|
+
export declare function setEnumData(storage: StorageType, cacheKey: string, data: any): boolean;
|
|
9
9
|
export declare function hasEnumList(storage: StorageType, cacheKey: any, code: string): DataOption[];
|
|
10
10
|
export declare function isObject(obj: any): boolean;
|
|
11
11
|
export declare function mergeCacheData(storage: string, code: string, cacheKey: string, responseData: any): void;
|
|
@@ -26,6 +26,10 @@ function getEnumData(storage, cacheKey, baseEnumStorage) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
function setEnumData(storage, cacheKey, data) {
|
|
29
|
+
var _Object$keys;
|
|
30
|
+
if (!((_Object$keys = Object.keys(data === null || data === void 0 ? void 0 : data.data)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length)) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
29
33
|
if (storage === 'localStorage') {
|
|
30
34
|
window.localStorage.setItem(cacheKey, JSON.stringify(data));
|
|
31
35
|
} else if (storage === 'sessionStorage') {
|
|
@@ -16,11 +16,12 @@ var _ProCollapse = _interopRequireDefault(require("../../../../ProLayout/compone
|
|
|
16
16
|
var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
|
|
17
17
|
var Container = function Container(props) {
|
|
18
18
|
var children = props.children,
|
|
19
|
-
otherProps = props.otherProps,
|
|
20
19
|
className = props.className,
|
|
21
20
|
container = props.container,
|
|
22
21
|
show = props.show,
|
|
23
|
-
clearNotShow = props.clearNotShow
|
|
22
|
+
clearNotShow = props.clearNotShow,
|
|
23
|
+
diffConfig = props.diffConfig,
|
|
24
|
+
otherProps = props.otherProps;
|
|
24
25
|
var _ref = _ProForm.default.useFieldProps() || {},
|
|
25
26
|
type = _ref.type,
|
|
26
27
|
form = _ref.form,
|
|
@@ -45,7 +46,8 @@ var Container = function Container(props) {
|
|
|
45
46
|
var childRender = function childRender() {
|
|
46
47
|
var child = (0, _jsxRuntime.jsx)(_RenderFields.default, (0, _objectSpread2.default)({
|
|
47
48
|
columns: _children,
|
|
48
|
-
form: form
|
|
49
|
+
form: form,
|
|
50
|
+
diffConfig: diffConfig
|
|
49
51
|
}, otherProps));
|
|
50
52
|
if (type === 'ProCollapse') {
|
|
51
53
|
return (0, _jsxRuntime.jsx)(_ProCollapse.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(props, ['otherProps', 'children', 'onBlur', 'onChange', 'placeholder', 'className'])), {}, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RowProps } from 'antd';
|
|
3
|
-
import { ProColumnProps, ProFormOtherProps } from '../../../propsType';
|
|
3
|
+
import { ProColumnProps, ProFormOtherProps, DiffConfigProps } from '../../../propsType';
|
|
4
4
|
export interface ContainerProps {
|
|
5
5
|
children?: ProColumnProps[];
|
|
6
6
|
otherProps?: ProFormOtherProps;
|
|
@@ -8,5 +8,6 @@ export interface ContainerProps {
|
|
|
8
8
|
className?: string;
|
|
9
9
|
container?: string | React.ReactNode;
|
|
10
10
|
show?: boolean | (() => boolean);
|
|
11
|
+
diffConfig?: DiffConfigProps;
|
|
11
12
|
clearNotShow?: boolean;
|
|
12
13
|
}
|
|
@@ -134,7 +134,7 @@ var ActionButton = function ActionButton(props) {
|
|
|
134
134
|
return _actionProps;
|
|
135
135
|
}, [props.actionProps]);
|
|
136
136
|
var handleClick = /*#__PURE__*/function () {
|
|
137
|
-
var _ref6 = (0, _asyncToGenerator2.default)(
|
|
137
|
+
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(defaultCallback, callback, index, item) {
|
|
138
138
|
var value, data;
|
|
139
139
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
140
140
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -273,7 +273,7 @@ var ActionButton = function ActionButton(props) {
|
|
|
273
273
|
},
|
|
274
274
|
children: label
|
|
275
275
|
}))
|
|
276
|
-
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (
|
|
276
|
+
}), "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index)) : (/*#__PURE__*/(0, _react.createElement)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, rest), {}, {
|
|
277
277
|
key: "".concat(item === null || item === void 0 ? void 0 : item.type).concat(index),
|
|
278
278
|
type: "text",
|
|
279
279
|
onClick: function onClick(e) {
|
|
@@ -20,7 +20,7 @@ var BlockTitle = function BlockTitle(props) {
|
|
|
20
20
|
if (!title) {
|
|
21
21
|
return (0, _jsxRuntime.jsx)("div", {});
|
|
22
22
|
}
|
|
23
|
-
if (
|
|
23
|
+
if (/*#__PURE__*/_react.default.isValidElement(title)) {
|
|
24
24
|
return title;
|
|
25
25
|
}
|
|
26
26
|
var titleContent = title;
|
|
@@ -59,7 +59,7 @@ var ToolbarButton = function ToolbarButton(props) {
|
|
|
59
59
|
return _toolbarProps;
|
|
60
60
|
}, [props.toolbarProps]);
|
|
61
61
|
var handleClick = /*#__PURE__*/function () {
|
|
62
|
-
var _ref2 = (0, _asyncToGenerator2.default)(
|
|
62
|
+
var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(defaultCallback, callback, item) {
|
|
63
63
|
var value, data;
|
|
64
64
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
65
65
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -30,11 +30,12 @@ var namesPathTransform = exports.namesPathTransform = function namesPathTransfor
|
|
|
30
30
|
// 比较memo
|
|
31
31
|
var memoWith = exports.memoWith = function memoWith(pre, next) {
|
|
32
32
|
return (0, _lodash.isEqualWith)(pre, next, function (objValue, othValue) {
|
|
33
|
-
if (
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
if ((0, _lodash.isFunction)(objValue) && (0, _lodash.isFunction)(othValue)) {
|
|
33
|
+
if (/*#__PURE__*/_react.default.isValidElement(objValue) && /*#__PURE__*/_react.default.isValidElement(othValue)) {
|
|
37
34
|
return true;
|
|
38
35
|
}
|
|
36
|
+
// 移除解决formlist函数里不更新问题
|
|
37
|
+
// if (isFunction(objValue) && isFunction(othValue)) {
|
|
38
|
+
// return true;
|
|
39
|
+
// }
|
|
39
40
|
});
|
|
40
41
|
};
|
|
@@ -56,7 +56,7 @@ var ComRender = function ComRender(props) {
|
|
|
56
56
|
};
|
|
57
57
|
var _props = mergedGetValueProps(fieldProps.value);
|
|
58
58
|
var componentProps = (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, fieldProps), rest), _props);
|
|
59
|
-
var Component = component ? (
|
|
59
|
+
var Component = component ? (/*#__PURE__*/_react.default.cloneElement(component, (0, _objectSpread3.default)({}, componentProps))) : (0, _jsxRuntime.jsx)(TypeComponent, (0, _objectSpread3.default)({}, componentProps));
|
|
60
60
|
var Com = getComRender(Component, props, componentProps);
|
|
61
61
|
return (0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
|
|
62
62
|
value: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, contextProps), {}, {
|
|
@@ -290,10 +290,17 @@ var useTransformColumns = exports.useTransformColumns = function useTransformCol
|
|
|
290
290
|
option: args === null || args === void 0 ? void 0 : args[1]
|
|
291
291
|
});
|
|
292
292
|
};
|
|
293
|
+
// 内外一个为true则为true
|
|
294
|
+
var getLastDisabled = function getLastDisabled() {
|
|
295
|
+
if (Array.isArray(groupProps.disabled)) {
|
|
296
|
+
return reactiveProps.disabled || groupProps.disabled[index];
|
|
297
|
+
}
|
|
298
|
+
return reactiveProps.disabled || groupProps.disabled;
|
|
299
|
+
};
|
|
293
300
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, column), {}, {
|
|
294
301
|
name: columnName
|
|
295
302
|
}, reactiveProps), {}, {
|
|
296
|
-
disabled:
|
|
303
|
+
disabled: getLastDisabled(),
|
|
297
304
|
getValueProps: transform === null || transform === void 0 ? void 0 : transform.getValueProps,
|
|
298
305
|
fieldProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, column === null || column === void 0 ? void 0 : column.fieldProps), {}, {
|
|
299
306
|
onChange: handleChange,
|
|
@@ -96,8 +96,11 @@ var ProCascader = function ProCascader(props) {
|
|
|
96
96
|
enumDataSource = _ref5$ === void 0 ? [] : _ref5$;
|
|
97
97
|
var realDataSource = (0, _react.useMemo)(function () {
|
|
98
98
|
var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
|
|
99
|
-
var result = isAddressMode && realLevel === 2 ? _filterDataSource(innerDataSource, level, fieldNames) : innerDataSource;
|
|
100
|
-
|
|
99
|
+
var result = (0, _index.transformDataName)(isAddressMode && realLevel === 2 ? _filterDataSource(innerDataSource, level, fieldNames) : innerDataSource, fieldNames);
|
|
100
|
+
if (transformResponse) {
|
|
101
|
+
return transformResponse(result);
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
101
104
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
|
102
105
|
var _useRequest = (0, _objectSpread3.default)({}, useRequest),
|
|
103
106
|
service = _useRequest.service,
|
|
@@ -112,7 +115,7 @@ var ProCascader = function ProCascader(props) {
|
|
|
112
115
|
defaultLabel = _useState4[0],
|
|
113
116
|
setDefaultLabel = _useState4[1];
|
|
114
117
|
var getFirstLevelOptions = /*#__PURE__*/function () {
|
|
115
|
-
var _ref6 = (0, _asyncToGenerator2.default)(
|
|
118
|
+
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
116
119
|
var _yield$service, data, newData, transFormData, serviceData;
|
|
117
120
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
118
121
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -33,7 +33,7 @@ var useDefaultOptions = function useDefaultOptions(options) {
|
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
var defaultService = /*#__PURE__*/function () {
|
|
36
|
-
var _ref = (0, _asyncToGenerator2.default)(
|
|
36
|
+
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
37
37
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
38
38
|
while (1) switch (_context.prev = _context.next) {
|
|
39
39
|
case 0:
|
|
@@ -25,7 +25,7 @@ var _Container = _interopRequireDefault(require("../../Container"));
|
|
|
25
25
|
var _view = _interopRequireDefault(require("../../../../assets/view.svg"));
|
|
26
26
|
var _useRequestList3 = _interopRequireDefault(require("./hooks/useRequestList"));
|
|
27
27
|
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
28
|
-
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "searchForm", "searchKey", "defaultOne"],
|
|
28
|
+
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "afterOpen", "isTooltip", "searchForm", "searchKey", "defaultOne"],
|
|
29
29
|
_excluded2 = ["onOk"],
|
|
30
30
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
|
31
31
|
var ProModalSelect = function ProModalSelect(props, ref) {
|
|
@@ -48,6 +48,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
48
48
|
style = props.style,
|
|
49
49
|
className = props.className,
|
|
50
50
|
beforeOpen = props.beforeOpen,
|
|
51
|
+
afterOpen = props.afterOpen,
|
|
51
52
|
isTooltip = props.isTooltip,
|
|
52
53
|
searchForm = props.searchForm,
|
|
53
54
|
searchKey = props.searchKey,
|
|
@@ -132,10 +133,10 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
132
133
|
}, (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
|
133
134
|
manual: true,
|
|
134
135
|
onSuccess: function onSuccess(res) {
|
|
135
|
-
var _res$data;
|
|
136
|
+
var _res$data, _ref5;
|
|
136
137
|
var list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list : res === null || res === void 0 ? void 0 : res.data;
|
|
137
138
|
setState({
|
|
138
|
-
options: transformResponse ? transformResponse(res === null || res === void 0 ? void 0 : res.data) : list
|
|
139
|
+
options: (_ref5 = transformResponse ? transformResponse(res === null || res === void 0 ? void 0 : res.data) : list) !== null && _ref5 !== void 0 ? _ref5 : []
|
|
139
140
|
});
|
|
140
141
|
}
|
|
141
142
|
})),
|
|
@@ -161,9 +162,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
161
162
|
};
|
|
162
163
|
var handleFormat = onFormat || defaultOptionRender;
|
|
163
164
|
if (showCodeName) {
|
|
164
|
-
handleFormat = function handleFormat(
|
|
165
|
-
var value =
|
|
166
|
-
label =
|
|
165
|
+
handleFormat = function handleFormat(_ref6) {
|
|
166
|
+
var value = _ref6.value,
|
|
167
|
+
label = _ref6.label;
|
|
167
168
|
return "".concat(value, "-").concat(label);
|
|
168
169
|
};
|
|
169
170
|
}
|
|
@@ -232,7 +233,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
232
233
|
onChange(val, option);
|
|
233
234
|
};
|
|
234
235
|
var handleClick = /*#__PURE__*/function () {
|
|
235
|
-
var
|
|
236
|
+
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
236
237
|
var _yield$beforeOpen, res;
|
|
237
238
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
238
239
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -267,6 +268,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
267
268
|
setState({
|
|
268
269
|
onOff: true
|
|
269
270
|
});
|
|
271
|
+
setTimeout(function () {
|
|
272
|
+
afterOpen === null || afterOpen === void 0 ? void 0 : afterOpen({
|
|
273
|
+
setInnerState: setState
|
|
274
|
+
});
|
|
275
|
+
}, 100);
|
|
270
276
|
}
|
|
271
277
|
case 14:
|
|
272
278
|
case "end":
|
|
@@ -275,7 +281,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
275
281
|
}, _callee);
|
|
276
282
|
}));
|
|
277
283
|
return function handleClick() {
|
|
278
|
-
return
|
|
284
|
+
return _ref7.apply(this, arguments);
|
|
279
285
|
};
|
|
280
286
|
}();
|
|
281
287
|
var handleClose = function handleClose() {
|
|
@@ -294,7 +300,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
294
300
|
}
|
|
295
301
|
};
|
|
296
302
|
var handleFinish = /*#__PURE__*/function () {
|
|
297
|
-
var
|
|
303
|
+
var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
|
298
304
|
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
|
299
305
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
300
306
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -355,11 +361,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
355
361
|
}, _callee2, null, [[0, 18]]);
|
|
356
362
|
}));
|
|
357
363
|
return function handleFinish() {
|
|
358
|
-
return
|
|
364
|
+
return _ref8.apply(this, arguments);
|
|
359
365
|
};
|
|
360
366
|
}();
|
|
361
367
|
var handleSearch = /*#__PURE__*/function () {
|
|
362
|
-
var
|
|
368
|
+
var _ref9 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
|
363
369
|
var values;
|
|
364
370
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
|
|
365
371
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -378,7 +384,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
378
384
|
}, _callee3);
|
|
379
385
|
}));
|
|
380
386
|
return function handleSearch() {
|
|
381
|
-
return
|
|
387
|
+
return _ref9.apply(this, arguments);
|
|
382
388
|
};
|
|
383
389
|
}();
|
|
384
390
|
var _rowSelection = (0, _objectSpread3.default)({
|
|
@@ -432,7 +438,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
432
438
|
};
|
|
433
439
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
434
440
|
var getInitValues = /*#__PURE__*/function () {
|
|
435
|
-
var
|
|
441
|
+
var _ref10 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4() {
|
|
436
442
|
var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
|
437
443
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee4$(_context4) {
|
|
438
444
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -490,12 +496,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
490
496
|
}, _callee4);
|
|
491
497
|
}));
|
|
492
498
|
return function getInitValues() {
|
|
493
|
-
return
|
|
499
|
+
return _ref10.apply(this, arguments);
|
|
494
500
|
};
|
|
495
501
|
}();
|
|
496
502
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
497
503
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
|
498
|
-
var
|
|
504
|
+
var _ref11 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5() {
|
|
499
505
|
var _useRequest$options4, _useRequest$options5;
|
|
500
506
|
var queryBean, page, params, res, _res$data3, _list2, list, _data2, nextSelectRowKeys;
|
|
501
507
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {
|
|
@@ -543,7 +549,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
543
549
|
}, _callee5);
|
|
544
550
|
}));
|
|
545
551
|
return function getDefaultOneValues() {
|
|
546
|
-
return
|
|
552
|
+
return _ref11.apply(this, arguments);
|
|
547
553
|
};
|
|
548
554
|
}();
|
|
549
555
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
@@ -574,7 +580,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
574
580
|
});
|
|
575
581
|
}
|
|
576
582
|
});
|
|
577
|
-
(0,
|
|
583
|
+
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
578
584
|
if (onOff && !visible) {
|
|
579
585
|
var _useRequest$options6;
|
|
580
586
|
if ((useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options6 = useRequest.options) === null || _useRequest$options6 === void 0 ? void 0 : _useRequest$options6.manual) !== true) {
|
|
@@ -610,34 +616,39 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
610
616
|
setState(nextState);
|
|
611
617
|
}
|
|
612
618
|
}, [onOff, visible, value]);
|
|
613
|
-
(0,
|
|
614
|
-
if (value && !visible && isInit) {
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
pageSize: 50,
|
|
627
|
-
queryBean: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.defaultParams), initParams)
|
|
628
|
-
} : (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
629
|
-
var nextParams = transformParams ? transformParams(params) : params;
|
|
630
|
-
run(nextParams);
|
|
631
|
-
setState({
|
|
632
|
-
isInit: false
|
|
633
|
-
});
|
|
634
|
-
}, 300);
|
|
635
|
-
} else {
|
|
636
|
-
getInitValues();
|
|
619
|
+
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
620
|
+
if (value && !visible && isInit && !readOnly) {
|
|
621
|
+
getInitValues();
|
|
622
|
+
}
|
|
623
|
+
}, [value, visible, isInit]);
|
|
624
|
+
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
625
|
+
if (value && !visible && readOnly) {
|
|
626
|
+
var _options$some;
|
|
627
|
+
var isHasValue = options === null || options === void 0 ? void 0 : (_options$some = options.some) === null || _options$some === void 0 ? void 0 : _options$some.call(options, function (item) {
|
|
628
|
+
return item[valueKey] === value;
|
|
629
|
+
});
|
|
630
|
+
if (isHasValue) {
|
|
631
|
+
return;
|
|
637
632
|
}
|
|
633
|
+
// 加定时器 修复依赖数据同步更新未取到问题
|
|
634
|
+
setTimeout(function () {
|
|
635
|
+
var _useRequest$options7, _useRequest$options8;
|
|
636
|
+
var initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
|
637
|
+
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
|
638
|
+
var _contentForm$getField2;
|
|
639
|
+
initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 ? void 0 : (_contentForm$getField2 = contentForm.getFieldsValue) === null || _contentForm$getField2 === void 0 ? void 0 : _contentForm$getField2.call(contentForm));
|
|
640
|
+
}
|
|
641
|
+
var params = withPagination ? {
|
|
642
|
+
pageNum: 1,
|
|
643
|
+
pageSize: 50,
|
|
644
|
+
queryBean: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.defaultParams), initParams)
|
|
645
|
+
} : (0, _objectSpread3.default)((0, _objectSpread3.default)({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
646
|
+
var nextParams = transformParams ? transformParams(params) : params;
|
|
647
|
+
run(nextParams);
|
|
648
|
+
}, 300);
|
|
638
649
|
}
|
|
639
|
-
}, [value,
|
|
640
|
-
(0,
|
|
650
|
+
}, [value, options, visible, useRequest]);
|
|
651
|
+
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
641
652
|
if (!value) {
|
|
642
653
|
if (defaultOne) {
|
|
643
654
|
getDefaultOneValues();
|
|
@@ -737,7 +748,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
737
748
|
children: customRender
|
|
738
749
|
});
|
|
739
750
|
}
|
|
740
|
-
(0,
|
|
751
|
+
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
741
752
|
if (isTooltip && value) {
|
|
742
753
|
var dom = document.getElementById(uuid);
|
|
743
754
|
dom.addEventListener('mouseover', function (e) {
|
|
@@ -774,7 +785,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
774
785
|
}, [value, isTooltip]);
|
|
775
786
|
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
776
787
|
setState({
|
|
777
|
-
options: tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource
|
|
788
|
+
options: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource) || []
|
|
778
789
|
});
|
|
779
790
|
}, [tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource]);
|
|
780
791
|
// 当搜索条件只有一个时,且为输入框,默认设置suffix
|