@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
|
@@ -19,7 +19,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
19
19
|
import "antd/es/form/style";
|
|
20
20
|
import _Form from "antd/es/form";
|
|
21
21
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
22
|
-
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "searchForm", "searchKey", "defaultOne"],
|
|
22
|
+
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "afterOpen", "isTooltip", "searchForm", "searchKey", "defaultOne"],
|
|
23
23
|
_excluded2 = ["onOk"],
|
|
24
24
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
|
25
25
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -27,7 +27,7 @@ import { SearchOutlined } from '@ant-design/icons';
|
|
|
27
27
|
import { useDeepCompareEffect, useMount, useSetState } from 'ahooks';
|
|
28
28
|
import { debounce, isArray, isEqual, isFunction, omit } from 'lodash';
|
|
29
29
|
import { ReactSVG } from 'react-svg';
|
|
30
|
-
import React, { forwardRef,
|
|
30
|
+
import React, { forwardRef, useImperativeHandle, useMemo } from 'react';
|
|
31
31
|
import { ProForm, ProDrawerForm, ProTable, useProConfig, ProSelect } from '../../../../index';
|
|
32
32
|
import Container from '../../Container';
|
|
33
33
|
import viewSvg from '../../../../assets/view.svg';
|
|
@@ -53,6 +53,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
53
53
|
style = props.style,
|
|
54
54
|
className = props.className,
|
|
55
55
|
beforeOpen = props.beforeOpen,
|
|
56
|
+
afterOpen = props.afterOpen,
|
|
56
57
|
isTooltip = props.isTooltip,
|
|
57
58
|
searchForm = props.searchForm,
|
|
58
59
|
searchKey = props.searchKey,
|
|
@@ -137,10 +138,10 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
137
138
|
}, _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
|
138
139
|
manual: true,
|
|
139
140
|
onSuccess: function onSuccess(res) {
|
|
140
|
-
var _res$data;
|
|
141
|
+
var _res$data, _ref5;
|
|
141
142
|
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;
|
|
142
143
|
setState({
|
|
143
|
-
options: transformResponse ? transformResponse(res === null || res === void 0 ? void 0 : res.data) : list
|
|
144
|
+
options: (_ref5 = transformResponse ? transformResponse(res === null || res === void 0 ? void 0 : res.data) : list) !== null && _ref5 !== void 0 ? _ref5 : []
|
|
144
145
|
});
|
|
145
146
|
}
|
|
146
147
|
})),
|
|
@@ -166,9 +167,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
166
167
|
};
|
|
167
168
|
var handleFormat = onFormat || defaultOptionRender;
|
|
168
169
|
if (showCodeName) {
|
|
169
|
-
handleFormat = function handleFormat(
|
|
170
|
-
var value =
|
|
171
|
-
label =
|
|
170
|
+
handleFormat = function handleFormat(_ref6) {
|
|
171
|
+
var value = _ref6.value,
|
|
172
|
+
label = _ref6.label;
|
|
172
173
|
return "".concat(value, "-").concat(label);
|
|
173
174
|
};
|
|
174
175
|
}
|
|
@@ -237,7 +238,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
237
238
|
onChange(val, option);
|
|
238
239
|
};
|
|
239
240
|
var handleClick = /*#__PURE__*/function () {
|
|
240
|
-
var
|
|
241
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
241
242
|
var _yield$beforeOpen, res;
|
|
242
243
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
243
244
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -272,6 +273,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
272
273
|
setState({
|
|
273
274
|
onOff: true
|
|
274
275
|
});
|
|
276
|
+
setTimeout(function () {
|
|
277
|
+
afterOpen === null || afterOpen === void 0 ? void 0 : afterOpen({
|
|
278
|
+
setInnerState: setState
|
|
279
|
+
});
|
|
280
|
+
}, 100);
|
|
275
281
|
}
|
|
276
282
|
case 14:
|
|
277
283
|
case "end":
|
|
@@ -280,7 +286,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
280
286
|
}, _callee);
|
|
281
287
|
}));
|
|
282
288
|
return function handleClick() {
|
|
283
|
-
return
|
|
289
|
+
return _ref7.apply(this, arguments);
|
|
284
290
|
};
|
|
285
291
|
}();
|
|
286
292
|
var handleClose = function handleClose() {
|
|
@@ -299,7 +305,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
299
305
|
}
|
|
300
306
|
};
|
|
301
307
|
var handleFinish = /*#__PURE__*/function () {
|
|
302
|
-
var
|
|
308
|
+
var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
303
309
|
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
|
304
310
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
305
311
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -360,11 +366,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
360
366
|
}, _callee2, null, [[0, 18]]);
|
|
361
367
|
}));
|
|
362
368
|
return function handleFinish() {
|
|
363
|
-
return
|
|
369
|
+
return _ref8.apply(this, arguments);
|
|
364
370
|
};
|
|
365
371
|
}();
|
|
366
372
|
var handleSearch = /*#__PURE__*/function () {
|
|
367
|
-
var
|
|
373
|
+
var _ref9 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
368
374
|
var values;
|
|
369
375
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
370
376
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -383,7 +389,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
383
389
|
}, _callee3);
|
|
384
390
|
}));
|
|
385
391
|
return function handleSearch() {
|
|
386
|
-
return
|
|
392
|
+
return _ref9.apply(this, arguments);
|
|
387
393
|
};
|
|
388
394
|
}();
|
|
389
395
|
var _rowSelection = _objectSpread({
|
|
@@ -437,7 +443,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
437
443
|
};
|
|
438
444
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
439
445
|
var getInitValues = /*#__PURE__*/function () {
|
|
440
|
-
var
|
|
446
|
+
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
441
447
|
var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
|
442
448
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
443
449
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -495,12 +501,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
495
501
|
}, _callee4);
|
|
496
502
|
}));
|
|
497
503
|
return function getInitValues() {
|
|
498
|
-
return
|
|
504
|
+
return _ref10.apply(this, arguments);
|
|
499
505
|
};
|
|
500
506
|
}();
|
|
501
507
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
502
508
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
|
503
|
-
var
|
|
509
|
+
var _ref11 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
504
510
|
var _useRequest$options4, _useRequest$options5;
|
|
505
511
|
var queryBean, page, params, res, _res$data3, _list2, list, _data2, nextSelectRowKeys;
|
|
506
512
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
@@ -548,7 +554,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
548
554
|
}, _callee5);
|
|
549
555
|
}));
|
|
550
556
|
return function getDefaultOneValues() {
|
|
551
|
-
return
|
|
557
|
+
return _ref11.apply(this, arguments);
|
|
552
558
|
};
|
|
553
559
|
}();
|
|
554
560
|
useImperativeHandle(ref, function () {
|
|
@@ -579,7 +585,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
579
585
|
});
|
|
580
586
|
}
|
|
581
587
|
});
|
|
582
|
-
|
|
588
|
+
useDeepCompareEffect(function () {
|
|
583
589
|
if (onOff && !visible) {
|
|
584
590
|
var _useRequest$options6;
|
|
585
591
|
if ((useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options6 = useRequest.options) === null || _useRequest$options6 === void 0 ? void 0 : _useRequest$options6.manual) !== true) {
|
|
@@ -615,34 +621,39 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
615
621
|
setState(nextState);
|
|
616
622
|
}
|
|
617
623
|
}, [onOff, visible, value]);
|
|
618
|
-
|
|
619
|
-
if (value && !visible && isInit) {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
pageSize: 50,
|
|
632
|
-
queryBean: _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.defaultParams), initParams)
|
|
633
|
-
} : _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
634
|
-
var nextParams = transformParams ? transformParams(params) : params;
|
|
635
|
-
run(nextParams);
|
|
636
|
-
setState({
|
|
637
|
-
isInit: false
|
|
638
|
-
});
|
|
639
|
-
}, 300);
|
|
640
|
-
} else {
|
|
641
|
-
getInitValues();
|
|
624
|
+
useDeepCompareEffect(function () {
|
|
625
|
+
if (value && !visible && isInit && !readOnly) {
|
|
626
|
+
getInitValues();
|
|
627
|
+
}
|
|
628
|
+
}, [value, visible, isInit]);
|
|
629
|
+
useDeepCompareEffect(function () {
|
|
630
|
+
if (value && !visible && readOnly) {
|
|
631
|
+
var _options$some;
|
|
632
|
+
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) {
|
|
633
|
+
return item[valueKey] === value;
|
|
634
|
+
});
|
|
635
|
+
if (isHasValue) {
|
|
636
|
+
return;
|
|
642
637
|
}
|
|
638
|
+
// 加定时器 修复依赖数据同步更新未取到问题
|
|
639
|
+
setTimeout(function () {
|
|
640
|
+
var _useRequest$options7, _useRequest$options8;
|
|
641
|
+
var initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
|
642
|
+
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
|
643
|
+
var _contentForm$getField2;
|
|
644
|
+
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));
|
|
645
|
+
}
|
|
646
|
+
var params = withPagination ? {
|
|
647
|
+
pageNum: 1,
|
|
648
|
+
pageSize: 50,
|
|
649
|
+
queryBean: _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options7 = useRequest.options) === null || _useRequest$options7 === void 0 ? void 0 : _useRequest$options7.defaultParams), initParams)
|
|
650
|
+
} : _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
651
|
+
var nextParams = transformParams ? transformParams(params) : params;
|
|
652
|
+
run(nextParams);
|
|
653
|
+
}, 300);
|
|
643
654
|
}
|
|
644
|
-
}, [value,
|
|
645
|
-
|
|
655
|
+
}, [value, options, visible, useRequest]);
|
|
656
|
+
useDeepCompareEffect(function () {
|
|
646
657
|
if (!value) {
|
|
647
658
|
if (defaultOne) {
|
|
648
659
|
getDefaultOneValues();
|
|
@@ -742,7 +753,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
742
753
|
children: customRender
|
|
743
754
|
});
|
|
744
755
|
}
|
|
745
|
-
|
|
756
|
+
useDeepCompareEffect(function () {
|
|
746
757
|
if (isTooltip && value) {
|
|
747
758
|
var dom = document.getElementById(uuid);
|
|
748
759
|
dom.addEventListener('mouseover', function (e) {
|
|
@@ -779,7 +790,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
779
790
|
}, [value, isTooltip]);
|
|
780
791
|
useDeepCompareEffect(function () {
|
|
781
792
|
setState({
|
|
782
|
-
options: tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource
|
|
793
|
+
options: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource) || []
|
|
783
794
|
});
|
|
784
795
|
}, [tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource]);
|
|
785
796
|
// 当搜索条件只有一个时,且为输入框,默认设置suffix
|
|
@@ -13,11 +13,9 @@ import { tools } from '@zat-design/utils';
|
|
|
13
13
|
import Container from '../../Container';
|
|
14
14
|
import locale from '../../../../locale';
|
|
15
15
|
import ProForm from '../../../../ProForm';
|
|
16
|
-
var formatAmount = tools.formatAmount
|
|
17
|
-
formatPercent = tools.formatPercent,
|
|
18
|
-
formatPerMill = tools.formatPerMill;
|
|
16
|
+
var formatAmount = tools.formatAmount;
|
|
19
17
|
var ProNumberRange = function ProNumberRange(props) {
|
|
20
|
-
var _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
|
18
|
+
var _document$querySelect, _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
|
21
19
|
var _props$value = props.value,
|
|
22
20
|
value = _props$value === void 0 ? [] : _props$value,
|
|
23
21
|
_props$onChange = props.onChange,
|
|
@@ -42,6 +40,7 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
42
40
|
viewEmpty = _ref.viewEmpty,
|
|
43
41
|
valueType = _ref.valueType;
|
|
44
42
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
43
|
+
var addonAfterDomWidth = (_document$querySelect = document.querySelector('.ant-input-number-group-addon')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientWidth;
|
|
45
44
|
var _useSetState = useSetState({
|
|
46
45
|
range: value || []
|
|
47
46
|
}),
|
|
@@ -87,11 +86,15 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
87
86
|
};
|
|
88
87
|
var cls = classnames({
|
|
89
88
|
'pro-number-range': true,
|
|
89
|
+
'pro-number-range-after': addonAfter,
|
|
90
|
+
'pro-number-range-before': addonBefore,
|
|
90
91
|
className: className
|
|
91
92
|
});
|
|
92
93
|
// 查看模式
|
|
93
94
|
if (isView || props.isView) {
|
|
94
|
-
if (isEmpty(value)) {
|
|
95
|
+
if (isEmpty(value) || (value === null || value === void 0 ? void 0 : value.every(function (item) {
|
|
96
|
+
return typeof item !== 'number';
|
|
97
|
+
}))) {
|
|
95
98
|
return viewEmpty;
|
|
96
99
|
}
|
|
97
100
|
switch (valueType) {
|
|
@@ -188,6 +191,9 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
188
191
|
},
|
|
189
192
|
addonBefore: addonBefore
|
|
190
193
|
}, valueProps), {}, {
|
|
194
|
+
style: addonAfter ? {
|
|
195
|
+
width: "calc(50% - ".concat(16 + addonAfterDomWidth / 2, "px)")
|
|
196
|
+
} : null,
|
|
191
197
|
min: min !== null && min !== void 0 ? min : (_valueProps = valueProps) === null || _valueProps === void 0 ? void 0 : _valueProps.min,
|
|
192
198
|
max: (_ref2 = (_ref3 = (_value$ = value === null || value === void 0 ? void 0 : value[1]) !== null && _value$ !== void 0 ? _value$ : range[1]) !== null && _ref3 !== void 0 ? _ref3 : max) !== null && _ref2 !== void 0 ? _ref2 : (_valueProps2 = valueProps) === null || _valueProps2 === void 0 ? void 0 : _valueProps2.max
|
|
193
199
|
}, childProps === null || childProps === void 0 ? void 0 : childProps[0])), _jsx(_Input, {
|
|
@@ -208,6 +214,9 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
208
214
|
},
|
|
209
215
|
addonAfter: addonAfter
|
|
210
216
|
}, valueProps), {}, {
|
|
217
|
+
style: addonAfter ? {
|
|
218
|
+
width: "calc(50% - ".concat(16 - addonAfterDomWidth / 2, "px)")
|
|
219
|
+
} : null,
|
|
211
220
|
min: (_ref4 = (_ref5 = (_value$2 = value === null || value === void 0 ? void 0 : value[0]) !== null && _value$2 !== void 0 ? _value$2 : range[0]) !== null && _ref5 !== void 0 ? _ref5 : min) !== null && _ref4 !== void 0 ? _ref4 : (_valueProps3 = valueProps) === null || _valueProps3 === void 0 ? void 0 : _valueProps3.min,
|
|
212
221
|
max: max !== null && max !== void 0 ? max : (_valueProps4 = valueProps) === null || _valueProps4 === void 0 ? void 0 : _valueProps4.max
|
|
213
222
|
}, childProps === null || childProps === void 0 ? void 0 : childProps[1]))]
|
|
@@ -92,7 +92,7 @@ export function ProAddress(_ref3) {
|
|
|
92
92
|
secondCitys = _useState6[0],
|
|
93
93
|
setSecondCitys = _useState6[1];
|
|
94
94
|
var queryCity = /*#__PURE__*/function () {
|
|
95
|
-
var _ref5 = _asyncToGenerator(
|
|
95
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(code, type) {
|
|
96
96
|
var cityList, _cityList, newList, _secondCitys;
|
|
97
97
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
98
98
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FormInstance } from 'antd';
|
|
2
|
+
import { NamePath } from 'antd/lib/form/interface';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { DiffOriginalParams } from '../../utils/diffOriginal';
|
|
5
|
+
import { DiffConfigProps } from '../../propsType';
|
|
6
|
+
interface Props {
|
|
7
|
+
name?: NamePath;
|
|
8
|
+
names?: NamePath[];
|
|
9
|
+
namesStr?: string;
|
|
10
|
+
diffConfig?: DiffConfigProps;
|
|
11
|
+
form: FormInstance;
|
|
12
|
+
equalWith?: DiffOriginalParams['equalWith'];
|
|
13
|
+
valuePropName?: string;
|
|
14
|
+
[name: string]: any;
|
|
15
|
+
}
|
|
16
|
+
declare const ChangedWrapper: React.FC<Props>;
|
|
17
|
+
export default ChangedWrapper;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import "antd/es/space/style";
|
|
2
|
+
import _Space from "antd/es/space";
|
|
3
|
+
import "antd/es/tooltip/style";
|
|
4
|
+
import _Tooltip from "antd/es/tooltip";
|
|
5
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
7
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
8
|
+
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName", "normalize"];
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import { get } from 'lodash';
|
|
12
|
+
import React, { useMemo } from 'react';
|
|
13
|
+
import { diffOriginal } from '../../utils/diffOriginal';
|
|
14
|
+
import { useProConfig } from '../../../ProConfigProvider';
|
|
15
|
+
import { isEmpty } from '../../../utils';
|
|
16
|
+
var ChangedWrapper = function ChangedWrapper(props) {
|
|
17
|
+
var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
|
|
18
|
+
var name = props.name,
|
|
19
|
+
names = props.names,
|
|
20
|
+
namesStr = props.namesStr,
|
|
21
|
+
form = props.form,
|
|
22
|
+
equalWith = props.equalWith,
|
|
23
|
+
children = props.children,
|
|
24
|
+
type = props.type,
|
|
25
|
+
diffConfig = props.diffConfig,
|
|
26
|
+
_props$valuePropName = props.valuePropName,
|
|
27
|
+
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
28
|
+
normalize = props.normalize,
|
|
29
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
30
|
+
var _useProConfig = useProConfig('ProForm'),
|
|
31
|
+
isDiffAll = _useProConfig.isDiffAll;
|
|
32
|
+
var originalValues = diffConfig.originalValues,
|
|
33
|
+
changeTipColor = diffConfig.changeTipColor,
|
|
34
|
+
addTipColor = diffConfig.addTipColor;
|
|
35
|
+
var toolTip = (_diffConfig$toolTip = diffConfig.toolTip) !== null && _diffConfig$toolTip !== void 0 ? _diffConfig$toolTip : true;
|
|
36
|
+
var isWatch = toolTip && !['FormList', 'ProEditTable'].includes(type);
|
|
37
|
+
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
|
38
|
+
return get(originalValues, name);
|
|
39
|
+
}) : get(originalValues, name);
|
|
40
|
+
var noChange = !equalWith && (!originalValues || isDiffAll ? false : isEmpty(originalValue));
|
|
41
|
+
var diffType = useMemo(function () {
|
|
42
|
+
if (!isWatch || noChange) return 'same';
|
|
43
|
+
var _value = normalize ? normalize(props[valuePropName]) : props[valuePropName];
|
|
44
|
+
return diffOriginal({
|
|
45
|
+
originalValue: originalValue,
|
|
46
|
+
value: _value,
|
|
47
|
+
form: form,
|
|
48
|
+
equalWith: equalWith
|
|
49
|
+
// name: namesStr || name,
|
|
50
|
+
});
|
|
51
|
+
}, [isWatch, noChange, props[valuePropName], originalValue]);
|
|
52
|
+
var isAdd = diffType === 'add';
|
|
53
|
+
var isChanged = diffType === 'changed';
|
|
54
|
+
var tipContent = useMemo(function () {
|
|
55
|
+
if (!isWatch || noChange) return undefined;
|
|
56
|
+
return /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), {}, _defineProperty({
|
|
57
|
+
isView: true
|
|
58
|
+
}, valuePropName, originalValue))) : undefined;
|
|
59
|
+
}, [originalValue, children]);
|
|
60
|
+
if (!isWatch || noChange) {
|
|
61
|
+
// 嵌套子组件
|
|
62
|
+
var isNestedField = ['ProEditTable'].includes(type);
|
|
63
|
+
return /*#__PURE__*/React.isValidElement(children) && /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({
|
|
64
|
+
originalValues: isNestedField ? originalValues : undefined
|
|
65
|
+
}, children.props), rest));
|
|
66
|
+
}
|
|
67
|
+
var tipOpenCalc = function tipOpenCalc() {
|
|
68
|
+
if (!toolTip) return false;
|
|
69
|
+
// 传入undefined 鼠标移入显示移出隐藏
|
|
70
|
+
return isChanged ? undefined : false;
|
|
71
|
+
};
|
|
72
|
+
var style = {
|
|
73
|
+
'--zaui-contract-bg': changeTipColor,
|
|
74
|
+
'--zaui-contract-bg-add': addTipColor
|
|
75
|
+
};
|
|
76
|
+
var diffClassName = classNames({
|
|
77
|
+
'pro-form-item-changed': isChanged,
|
|
78
|
+
'pro-form-item-add': isAdd
|
|
79
|
+
});
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
|
|
82
|
+
return _jsx(_Tooltip, {
|
|
83
|
+
open: tipOpenCalc(),
|
|
84
|
+
// mouseEnterDelay={1}
|
|
85
|
+
getPopupContainer: function getPopupContainer(target) {
|
|
86
|
+
return target.parentElement;
|
|
87
|
+
},
|
|
88
|
+
title: _jsxs(_Space, {
|
|
89
|
+
direction: "vertical",
|
|
90
|
+
children: [_jsxs(_Space, {
|
|
91
|
+
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
92
|
+
}), _showEllipse && _jsxs(_Space, {
|
|
93
|
+
children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
|
|
94
|
+
isView: true
|
|
95
|
+
})) : undefined]
|
|
96
|
+
})]
|
|
97
|
+
}),
|
|
98
|
+
placement: "topLeft",
|
|
99
|
+
children: _jsx("div", {
|
|
100
|
+
className: diffClassName,
|
|
101
|
+
style: style,
|
|
102
|
+
children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
|
|
103
|
+
otherProps: _objectSpread(_objectSpread({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
|
|
104
|
+
isDiffChange: isChanged
|
|
105
|
+
})
|
|
106
|
+
})) : undefined
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
export default ChangedWrapper;
|
|
@@ -22,7 +22,7 @@ var ConfirmWrapper = function ConfirmWrapper(props) {
|
|
|
22
22
|
var _ProForm$useFieldProp = ProForm.useFieldProps(),
|
|
23
23
|
form = _ProForm$useFieldProp.form;
|
|
24
24
|
var handleChange = /*#__PURE__*/function () {
|
|
25
|
-
var _ref = _asyncToGenerator(
|
|
25
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(value) {
|
|
26
26
|
var _len,
|
|
27
27
|
other,
|
|
28
28
|
_key,
|
|
@@ -28,7 +28,7 @@ import valueTypeMap from '../../utils/valueType';
|
|
|
28
28
|
import tipSvg from '../../../assets/tip.svg';
|
|
29
29
|
import useRules from '../../utils/useRules';
|
|
30
30
|
import ConfirmWrapper from './ConfirmWrapper';
|
|
31
|
-
import
|
|
31
|
+
import ChangedWrapper from './ChangedWrapper';
|
|
32
32
|
// 这个组件只管渲染, 参数的整理在外部处理
|
|
33
33
|
var Render = function Render(props) {
|
|
34
34
|
var _ref2, _ref3, _ref4, _ref5, _otherProps$names2;
|
|
@@ -46,12 +46,11 @@ var Render = function Render(props) {
|
|
|
46
46
|
formDisabled = props.formDisabled,
|
|
47
47
|
type = props.type,
|
|
48
48
|
isSelect = props.isSelect,
|
|
49
|
-
originalValues = props.originalValues,
|
|
50
49
|
equalWith = props.equalWith,
|
|
51
50
|
requiredOnView = props.requiredOnView,
|
|
52
|
-
originalDiffTip = props.originalDiffTip,
|
|
53
51
|
confirm = props.confirm,
|
|
54
|
-
globalControl = props.globalControl
|
|
52
|
+
globalControl = props.globalControl,
|
|
53
|
+
diffConfig = props.diffConfig;
|
|
55
54
|
var colProps = props.colProps;
|
|
56
55
|
// 剔除一些不是FormItem的属性, 防止控制台报warning
|
|
57
56
|
var labelWidth = formItemProps.labelWidth,
|
|
@@ -241,7 +240,7 @@ var Render = function Render(props) {
|
|
|
241
240
|
_args = functionArgs([].concat(args));
|
|
242
241
|
}
|
|
243
242
|
var inList = _otherFormItemProps === null || _otherFormItemProps === void 0 ? void 0 : (_otherFormItemProps$n3 = _otherFormItemProps.namePath) === null || _otherFormItemProps$n3 === void 0 ? void 0 : _otherFormItemProps$n3.length;
|
|
244
|
-
if (
|
|
243
|
+
if (/*#__PURE__*/React.isValidElement(AutoComponent)) {
|
|
245
244
|
var _AutoComponent$props$, _AutoComponent$props, _lastComponentProps$c;
|
|
246
245
|
((_AutoComponent$props$ = (_AutoComponent$props = AutoComponent === null || AutoComponent === void 0 ? void 0 : AutoComponent.props)[changeKey]) === null || _AutoComponent$props$ === void 0 ? void 0 : _AutoComponent$props$.call.apply(_AutoComponent$props$, [_AutoComponent$props].concat(_toConsumableArray(_args)))) || ((_lastComponentProps$c = lastComponentProps[changeKey]) === null || _lastComponentProps$c === void 0 ? void 0 : _lastComponentProps$c.call.apply(_lastComponentProps$c, [lastComponentProps].concat(_toConsumableArray(_args))));
|
|
247
246
|
return false;
|
|
@@ -291,7 +290,7 @@ var Render = function Render(props) {
|
|
|
291
290
|
* onBlur参数重置 (value, record, { form, index, namePath, option }) => void
|
|
292
291
|
*/
|
|
293
292
|
var handleBlur = /*#__PURE__*/function () {
|
|
294
|
-
var _ref7 = _asyncToGenerator(
|
|
293
|
+
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
295
294
|
var _len3,
|
|
296
295
|
args,
|
|
297
296
|
_key3,
|
|
@@ -374,7 +373,7 @@ var Render = function Render(props) {
|
|
|
374
373
|
if (originComponent) {
|
|
375
374
|
delete childProps.otherProps;
|
|
376
375
|
}
|
|
377
|
-
var child = /*#__PURE__*/React.isValidElement(AutoComponent) ? (
|
|
376
|
+
var child = /*#__PURE__*/React.isValidElement(AutoComponent) ? (/*#__PURE__*/React.cloneElement(AutoComponent, childProps)) : _jsx(AutoComponent, _objectSpread(_objectSpread({}, omit(lastComponentProps, [].concat(lastComponentPropsFilter, ['debounceWait']))), {}, {
|
|
378
377
|
otherProps: _objectSpread(_objectSpread({}, otherProps), {}, {
|
|
379
378
|
show: show,
|
|
380
379
|
disabled: lastDisabled,
|
|
@@ -427,17 +426,18 @@ var Render = function Render(props) {
|
|
|
427
426
|
span: 24 // 默认占一行
|
|
428
427
|
});
|
|
429
428
|
}
|
|
430
|
-
if (
|
|
431
|
-
child = _jsx(
|
|
429
|
+
if (diffConfig) {
|
|
430
|
+
child = _jsx(ChangedWrapper, {
|
|
432
431
|
name: formItemProps.name,
|
|
433
432
|
names: otherProps.names,
|
|
434
433
|
namesStr: namesStr,
|
|
435
|
-
|
|
434
|
+
diffConfig: diffConfig,
|
|
436
435
|
form: form,
|
|
437
436
|
equalWith: equalWith,
|
|
438
|
-
originalDiffTip: originalDiffTip,
|
|
439
437
|
type: type,
|
|
440
438
|
onChange: handleChange,
|
|
439
|
+
valuePropName: _otherFormItemProps.valuePropName,
|
|
440
|
+
normalize: _otherFormItemProps.normalize,
|
|
441
441
|
children: child
|
|
442
442
|
});
|
|
443
443
|
}
|
|
@@ -2,7 +2,7 @@ import { ColProps } from 'antd';
|
|
|
2
2
|
import { FormInstance } from 'antd/es/form/Form';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { ProColumnProps } from './propsType';
|
|
5
|
-
import {
|
|
5
|
+
import { DiffConfigProps } from '../../propsType';
|
|
6
6
|
interface Props<T = any> {
|
|
7
7
|
isView?: boolean;
|
|
8
8
|
columns: ProColumnProps[];
|
|
@@ -13,11 +13,10 @@ interface Props<T = any> {
|
|
|
13
13
|
viewEmpty?: React.ReactNode;
|
|
14
14
|
openState?: boolean;
|
|
15
15
|
labelWidth?: string | number;
|
|
16
|
-
|
|
16
|
+
diffConfig?: DiffConfigProps;
|
|
17
17
|
clearNotShow?: boolean;
|
|
18
18
|
requiredOnView?: boolean;
|
|
19
19
|
required?: boolean | boolean[] | (() => boolean | boolean[]);
|
|
20
|
-
originalDiffTip?: boolean;
|
|
21
20
|
globalControl?: boolean;
|
|
22
21
|
}
|
|
23
22
|
declare const RenderFields: React.FC<Props>;
|
|
@@ -22,11 +22,10 @@ var RenderFields = function RenderFields(props) {
|
|
|
22
22
|
viewEmpty = _props$viewEmpty === void 0 ? '-' : _props$viewEmpty,
|
|
23
23
|
openState = props.openState,
|
|
24
24
|
labelWidth = props.labelWidth,
|
|
25
|
-
originalValues = props.originalValues,
|
|
26
25
|
outerClearNotShow = props.clearNotShow,
|
|
27
26
|
requiredOnView = props.requiredOnView,
|
|
28
27
|
required = props.required,
|
|
29
|
-
|
|
28
|
+
diffConfig = props.diffConfig,
|
|
30
29
|
globalControl = props.globalControl;
|
|
31
30
|
// 是否包含隐藏字段
|
|
32
31
|
var hiddenData = columns.filter(function (item) {
|
|
@@ -154,6 +153,7 @@ var RenderFields = function RenderFields(props) {
|
|
|
154
153
|
if (['ProCollapse', 'Container'].includes(_type)) {
|
|
155
154
|
componentProps.show = show;
|
|
156
155
|
componentProps.clearNotShow = clearNotShow;
|
|
156
|
+
componentProps.diffConfig = diffConfig;
|
|
157
157
|
}
|
|
158
158
|
// switch与SwitchCheckbox单独添加valuePropName
|
|
159
159
|
if (['Switch', 'SwitchCheckbox'].includes(_type)) {
|
|
@@ -206,10 +206,9 @@ var RenderFields = function RenderFields(props) {
|
|
|
206
206
|
otherProps: otherProps,
|
|
207
207
|
fieldProps: isFunction(fieldProps) ? fieldProps : null,
|
|
208
208
|
isSelect: _isSelect,
|
|
209
|
-
|
|
209
|
+
diffConfig: diffConfig,
|
|
210
210
|
equalWith: equalWith,
|
|
211
211
|
requiredOnView: requiredOnView,
|
|
212
|
-
originalDiffTip: originalDiffTip,
|
|
213
212
|
globalControl: globalControl
|
|
214
213
|
})
|
|
215
214
|
}, "".concat(_formItemProps.name || _formItemProps.label).concat(index));
|
|
@@ -30,7 +30,8 @@ import { ProUploadProps } from '../../../ProUpload/propsType';
|
|
|
30
30
|
import { ProTreeProps } from '../../../ProTree/propsType';
|
|
31
31
|
import { GroupProps as GroupCopyProps } from '../combination/Group/propsType';
|
|
32
32
|
import { ProCollapseProps } from '../../../ProLayout/components/ProCollapse/PropTypes';
|
|
33
|
-
import { DistributiveOmit } from '../../propsType';
|
|
33
|
+
import { DistributiveOmit, DiffConfigProps } from '../../propsType';
|
|
34
|
+
import { DiffOriginalParams } from '../../utils/diffOriginal';
|
|
34
35
|
export type ComponentMap = keyof typeof componentMap;
|
|
35
36
|
type ValidateKey = keyof typeof validate;
|
|
36
37
|
type RegExpKey = keyof typeof regExp;
|
|
@@ -196,12 +197,12 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
196
197
|
* @default -
|
|
197
198
|
*/
|
|
198
199
|
labelWidth?: string | number;
|
|
199
|
-
disabled?: boolean | ReactiveFunction<Values, boolean>;
|
|
200
|
+
disabled?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
|
|
200
201
|
trim?: boolean;
|
|
201
202
|
upperCase?: boolean;
|
|
202
203
|
hiddenNames?: string[] | any[];
|
|
203
204
|
rules?: ProRule[] | ReactiveFunction<Values, ProRule[]>;
|
|
204
|
-
equalWith?:
|
|
205
|
+
equalWith?: DiffOriginalParams['equalWith'];
|
|
205
206
|
required?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
|
|
206
207
|
labelRequired?: boolean;
|
|
207
208
|
toISOString?: boolean;
|
|
@@ -267,7 +268,7 @@ export interface RenderProps<Values = any> {
|
|
|
267
268
|
form: FormInstance<Values>;
|
|
268
269
|
fieldProps?: ReactiveFunction<Values, React.ReactNode>;
|
|
269
270
|
isSelect: boolean;
|
|
270
|
-
|
|
271
|
+
diffConfig: DiffConfigProps;
|
|
271
272
|
requiredOnView?: boolean;
|
|
272
273
|
confirm?: ProFormColumnProps['confirm'];
|
|
273
274
|
globalControl?: boolean;
|