@zat-design/sisyphus-react 3.7.3 → 3.8.0
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/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/es/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +22 -10
- package/es/ProEditTable/components/RenderField/index.js +3 -3
- package/es/ProEnum/components/Group.js +10 -2
- package/es/ProEnum/index.js +5 -4
- 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/utils.js +5 -4
- package/es/ProForm/components/combination/ProModalSelect/index.js +50 -45
- 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/render/ChangedWrapper.d.ts +17 -0
- package/es/ProForm/components/render/ChangedWrapper.js +108 -0
- package/es/ProForm/components/render/Render.js +7 -8
- 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 +4 -3
- package/es/ProForm/index.js +3 -6
- 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/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 +5 -2
- package/es/ProStep/index.d.ts +1 -1
- package/es/ProStep/index.js +24 -17
- package/es/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/es/ProTable/components/FormatColumn/index.js +14 -8
- 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/ProTreeSelect/index.js +25 -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/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/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/ProEditTable/components/RenderField/{ListChanged.d.ts → ListChangedWrapper.d.ts} +4 -3
- package/lib/ProEditTable/components/RenderField/{ListChanged.js → ListChangedWrapper.js} +25 -11
- package/lib/ProEditTable/components/RenderField/index.js +3 -3
- package/lib/ProEnum/components/Group.js +10 -2
- package/lib/ProEnum/index.js +5 -4
- 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/utils.js +4 -3
- package/lib/ProForm/components/combination/ProModalSelect/index.js +49 -44
- 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/render/ChangedWrapper.d.ts +17 -0
- package/lib/ProForm/components/render/ChangedWrapper.js +113 -0
- package/lib/ProForm/components/render/Render.js +7 -8
- 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 +4 -3
- package/lib/ProForm/index.js +3 -6
- 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/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 +5 -2
- package/lib/ProStep/index.d.ts +1 -1
- package/lib/ProStep/index.js +24 -17
- package/lib/ProTable/components/FormatColumn/index.d.ts +7 -1
- package/lib/ProTable/components/FormatColumn/index.js +14 -8
- 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/ProTreeSelect/index.js +25 -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/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/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 +2 -1
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isEqualWith
|
|
1
|
+
import { isEqualWith } from 'lodash';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
/**
|
|
4
4
|
* namesPath生产 [['list', 0, 'min'], ['list', 0, 'max']] => list_0_min-list_0_max
|
|
@@ -26,8 +26,9 @@ export var memoWith = function memoWith(pre, next) {
|
|
|
26
26
|
if ( /*#__PURE__*/React.isValidElement(objValue) && /*#__PURE__*/React.isValidElement(othValue)) {
|
|
27
27
|
return true;
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
// 移除解决formlist函数里不更新问题
|
|
30
|
+
// if (isFunction(objValue) && isFunction(othValue)) {
|
|
31
|
+
// return true;
|
|
32
|
+
// }
|
|
32
33
|
});
|
|
33
34
|
};
|
|
@@ -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';
|
|
@@ -137,10 +137,10 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
137
137
|
}, _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
|
138
138
|
manual: true,
|
|
139
139
|
onSuccess: function onSuccess(res) {
|
|
140
|
-
var _res$data;
|
|
140
|
+
var _res$data, _ref5;
|
|
141
141
|
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
142
|
setState({
|
|
143
|
-
options: transformResponse ? transformResponse(res === null || res === void 0 ? void 0 : res.data) : list
|
|
143
|
+
options: (_ref5 = transformResponse ? transformResponse(res === null || res === void 0 ? void 0 : res.data) : list) !== null && _ref5 !== void 0 ? _ref5 : []
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
})),
|
|
@@ -166,9 +166,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
166
166
|
};
|
|
167
167
|
var handleFormat = onFormat || defaultOptionRender;
|
|
168
168
|
if (showCodeName) {
|
|
169
|
-
handleFormat = function handleFormat(
|
|
170
|
-
var value =
|
|
171
|
-
label =
|
|
169
|
+
handleFormat = function handleFormat(_ref6) {
|
|
170
|
+
var value = _ref6.value,
|
|
171
|
+
label = _ref6.label;
|
|
172
172
|
return "".concat(value, "-").concat(label);
|
|
173
173
|
};
|
|
174
174
|
}
|
|
@@ -237,7 +237,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
237
237
|
onChange(val, option);
|
|
238
238
|
};
|
|
239
239
|
var handleClick = /*#__PURE__*/function () {
|
|
240
|
-
var
|
|
240
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
241
241
|
var _yield$beforeOpen, res;
|
|
242
242
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
243
243
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -280,7 +280,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
280
280
|
}, _callee);
|
|
281
281
|
}));
|
|
282
282
|
return function handleClick() {
|
|
283
|
-
return
|
|
283
|
+
return _ref7.apply(this, arguments);
|
|
284
284
|
};
|
|
285
285
|
}();
|
|
286
286
|
var handleClose = function handleClose() {
|
|
@@ -299,7 +299,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
299
299
|
}
|
|
300
300
|
};
|
|
301
301
|
var handleFinish = /*#__PURE__*/function () {
|
|
302
|
-
var
|
|
302
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
303
303
|
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
|
304
304
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
305
305
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -360,11 +360,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
360
360
|
}, _callee2, null, [[0, 18]]);
|
|
361
361
|
}));
|
|
362
362
|
return function handleFinish() {
|
|
363
|
-
return
|
|
363
|
+
return _ref8.apply(this, arguments);
|
|
364
364
|
};
|
|
365
365
|
}();
|
|
366
366
|
var handleSearch = /*#__PURE__*/function () {
|
|
367
|
-
var
|
|
367
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
368
368
|
var values;
|
|
369
369
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
370
370
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -383,7 +383,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
383
383
|
}, _callee3);
|
|
384
384
|
}));
|
|
385
385
|
return function handleSearch() {
|
|
386
|
-
return
|
|
386
|
+
return _ref9.apply(this, arguments);
|
|
387
387
|
};
|
|
388
388
|
}();
|
|
389
389
|
var _rowSelection = _objectSpread({
|
|
@@ -437,7 +437,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
437
437
|
};
|
|
438
438
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
439
439
|
var getInitValues = /*#__PURE__*/function () {
|
|
440
|
-
var
|
|
440
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
441
441
|
var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
|
442
442
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
443
443
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -495,12 +495,12 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
495
495
|
}, _callee4);
|
|
496
496
|
}));
|
|
497
497
|
return function getInitValues() {
|
|
498
|
-
return
|
|
498
|
+
return _ref10.apply(this, arguments);
|
|
499
499
|
};
|
|
500
500
|
}();
|
|
501
501
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
502
502
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
|
503
|
-
var
|
|
503
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
504
504
|
var _useRequest$options4, _useRequest$options5;
|
|
505
505
|
var queryBean, page, params, res, _res$data3, _list2, list, _data2, nextSelectRowKeys;
|
|
506
506
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
@@ -548,7 +548,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
548
548
|
}, _callee5);
|
|
549
549
|
}));
|
|
550
550
|
return function getDefaultOneValues() {
|
|
551
|
-
return
|
|
551
|
+
return _ref11.apply(this, arguments);
|
|
552
552
|
};
|
|
553
553
|
}();
|
|
554
554
|
useImperativeHandle(ref, function () {
|
|
@@ -579,7 +579,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
581
|
});
|
|
582
|
-
|
|
582
|
+
useDeepCompareEffect(function () {
|
|
583
583
|
if (onOff && !visible) {
|
|
584
584
|
var _useRequest$options6;
|
|
585
585
|
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 +615,39 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
615
615
|
setState(nextState);
|
|
616
616
|
}
|
|
617
617
|
}, [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();
|
|
618
|
+
useDeepCompareEffect(function () {
|
|
619
|
+
if (value && !visible && isInit && !readOnly) {
|
|
620
|
+
getInitValues();
|
|
621
|
+
}
|
|
622
|
+
}, [value, visible, isInit]);
|
|
623
|
+
useDeepCompareEffect(function () {
|
|
624
|
+
if (value && !visible && readOnly) {
|
|
625
|
+
var _options$some;
|
|
626
|
+
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) {
|
|
627
|
+
return item[valueKey] === value;
|
|
628
|
+
});
|
|
629
|
+
if (isHasValue) {
|
|
630
|
+
return;
|
|
642
631
|
}
|
|
632
|
+
// 加定时器 修复依赖数据同步更新未取到问题
|
|
633
|
+
setTimeout(function () {
|
|
634
|
+
var _useRequest$options7, _useRequest$options8;
|
|
635
|
+
var initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
|
636
|
+
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
|
637
|
+
var _contentForm$getField2;
|
|
638
|
+
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));
|
|
639
|
+
}
|
|
640
|
+
var params = withPagination ? {
|
|
641
|
+
pageNum: 1,
|
|
642
|
+
pageSize: 50,
|
|
643
|
+
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)
|
|
644
|
+
} : _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options8 = useRequest.options) === null || _useRequest$options8 === void 0 ? void 0 : _useRequest$options8.defaultParams), initParams);
|
|
645
|
+
var nextParams = transformParams ? transformParams(params) : params;
|
|
646
|
+
run(nextParams);
|
|
647
|
+
}, 300);
|
|
643
648
|
}
|
|
644
|
-
}, [value,
|
|
645
|
-
|
|
649
|
+
}, [value, options, visible, useRequest]);
|
|
650
|
+
useDeepCompareEffect(function () {
|
|
646
651
|
if (!value) {
|
|
647
652
|
if (defaultOne) {
|
|
648
653
|
getDefaultOneValues();
|
|
@@ -742,7 +747,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
742
747
|
children: customRender
|
|
743
748
|
});
|
|
744
749
|
}
|
|
745
|
-
|
|
750
|
+
useDeepCompareEffect(function () {
|
|
746
751
|
if (isTooltip && value) {
|
|
747
752
|
var dom = document.getElementById(uuid);
|
|
748
753
|
dom.addEventListener('mouseover', function (e) {
|
|
@@ -779,7 +784,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
779
784
|
}, [value, isTooltip]);
|
|
780
785
|
useDeepCompareEffect(function () {
|
|
781
786
|
setState({
|
|
782
|
-
options: tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource
|
|
787
|
+
options: (tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource) || []
|
|
783
788
|
});
|
|
784
789
|
}, [tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource]);
|
|
785
790
|
// 当搜索条件只有一个时,且为输入框,默认设置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]))]
|
|
@@ -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,108 @@
|
|
|
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"];
|
|
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
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
29
|
+
var _useProConfig = useProConfig('ProForm'),
|
|
30
|
+
isDiffAll = _useProConfig.isDiffAll;
|
|
31
|
+
var originalValues = diffConfig.originalValues,
|
|
32
|
+
changeTipColor = diffConfig.changeTipColor,
|
|
33
|
+
addTipColor = diffConfig.addTipColor;
|
|
34
|
+
var toolTip = (_diffConfig$toolTip = diffConfig.toolTip) !== null && _diffConfig$toolTip !== void 0 ? _diffConfig$toolTip : true;
|
|
35
|
+
var isWatch = toolTip && !['FormList', 'ProEditTable'].includes(type);
|
|
36
|
+
var originalValue = (names === null || names === void 0 ? void 0 : names.length) ? names.map(function (name) {
|
|
37
|
+
return get(originalValues, name);
|
|
38
|
+
}) : get(originalValues, name);
|
|
39
|
+
var noChange = !equalWith && (!originalValues || isDiffAll ? false : isEmpty(originalValue));
|
|
40
|
+
var diffType = useMemo(function () {
|
|
41
|
+
if (!isWatch || noChange) return 'same';
|
|
42
|
+
return diffOriginal({
|
|
43
|
+
originalValue: originalValue,
|
|
44
|
+
value: props[valuePropName],
|
|
45
|
+
form: form,
|
|
46
|
+
equalWith: equalWith
|
|
47
|
+
// name: namesStr || name,
|
|
48
|
+
});
|
|
49
|
+
}, [isWatch, noChange, props[valuePropName], originalValue]);
|
|
50
|
+
var isAdd = diffType === 'add';
|
|
51
|
+
var isChanged = diffType === 'changed';
|
|
52
|
+
var tipContent = useMemo(function () {
|
|
53
|
+
if (!isWatch || noChange) return undefined;
|
|
54
|
+
return /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({}, children.props), {}, _defineProperty({
|
|
55
|
+
isView: true
|
|
56
|
+
}, valuePropName, originalValue))) : undefined;
|
|
57
|
+
}, [originalValue, children]);
|
|
58
|
+
if (!isWatch || noChange) {
|
|
59
|
+
// 嵌套子组件
|
|
60
|
+
var isNestedField = ['ProEditTable'].includes(type);
|
|
61
|
+
return /*#__PURE__*/React.isValidElement(children) && /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread({
|
|
62
|
+
originalValues: isNestedField ? originalValues : undefined
|
|
63
|
+
}, children.props), rest));
|
|
64
|
+
}
|
|
65
|
+
var tipOpenCalc = function tipOpenCalc() {
|
|
66
|
+
if (!toolTip) return false;
|
|
67
|
+
// 传入undefined 鼠标移入显示移出隐藏
|
|
68
|
+
return isChanged ? undefined : false;
|
|
69
|
+
};
|
|
70
|
+
var style = {
|
|
71
|
+
'--zaui-contract-bg': changeTipColor,
|
|
72
|
+
'--zaui-contract-bg-add': addTipColor
|
|
73
|
+
};
|
|
74
|
+
var diffClassName = classNames({
|
|
75
|
+
'pro-form-item-changed': isChanged,
|
|
76
|
+
'pro-form-item-add': isAdd
|
|
77
|
+
});
|
|
78
|
+
// @ts-ignore
|
|
79
|
+
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);
|
|
80
|
+
return _jsx(_Tooltip, {
|
|
81
|
+
open: tipOpenCalc(),
|
|
82
|
+
mouseEnterDelay: 1,
|
|
83
|
+
getPopupContainer: function getPopupContainer(target) {
|
|
84
|
+
return target.parentElement;
|
|
85
|
+
},
|
|
86
|
+
title: _jsxs(_Space, {
|
|
87
|
+
direction: "vertical",
|
|
88
|
+
children: [_jsxs(_Space, {
|
|
89
|
+
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
90
|
+
}), _showEllipse && _jsxs(_Space, {
|
|
91
|
+
children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
|
|
92
|
+
isView: true
|
|
93
|
+
})) : undefined]
|
|
94
|
+
})]
|
|
95
|
+
}),
|
|
96
|
+
placement: "topLeft",
|
|
97
|
+
children: _jsx("div", {
|
|
98
|
+
className: diffClassName,
|
|
99
|
+
style: style,
|
|
100
|
+
children: /*#__PURE__*/React.isValidElement(children) ? /*#__PURE__*/React.cloneElement(children, _objectSpread(_objectSpread(_objectSpread({}, children.props), rest), {}, {
|
|
101
|
+
otherProps: _objectSpread(_objectSpread({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
|
|
102
|
+
isDiffChange: isChanged
|
|
103
|
+
})
|
|
104
|
+
})) : undefined
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
export default ChangedWrapper;
|
|
@@ -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,
|
|
@@ -427,17 +426,17 @@ 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,
|
|
441
440
|
children: child
|
|
442
441
|
});
|
|
443
442
|
}
|
|
@@ -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;
|
|
@@ -201,7 +202,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
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;
|
package/es/ProForm/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import _Space from "antd/es/space";
|
|
|
11
11
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
12
12
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
13
13
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
14
|
-
var _excluded = ["mode", "span", "disabled", "isView", "columns", "footer", "onOk", "okText", "onCancel", "confirmLoading", "cancelText", "form", "children", "rowProps", "className", "expand", "expandOpen", "expandOpenChange", "viewEmpty", "labelAlign", "labelWidth", "onValuesChange", "onFinish", "
|
|
14
|
+
var _excluded = ["mode", "span", "disabled", "isView", "columns", "footer", "onOk", "okText", "onCancel", "confirmLoading", "cancelText", "form", "children", "rowProps", "className", "expand", "expandOpen", "expandOpenChange", "viewEmpty", "labelAlign", "labelWidth", "onValuesChange", "onFinish", "diffConfig", "submitOnEnter", "clearNotShow", "initialValues", "requiredOnView", "formId", "required", "formKey", "globalControl", "scrollToError", "optimize"];
|
|
15
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
import { DoubleLeftOutlined } from '@ant-design/icons';
|
|
17
17
|
import classnames from 'classnames';
|
|
@@ -53,7 +53,7 @@ var ProForm = function ProForm(props, ref) {
|
|
|
53
53
|
labelWidth = props.labelWidth,
|
|
54
54
|
onValuesChange = props.onValuesChange,
|
|
55
55
|
onFinish = props.onFinish,
|
|
56
|
-
|
|
56
|
+
diffConfig = props.diffConfig,
|
|
57
57
|
submitOnEnter = props.submitOnEnter,
|
|
58
58
|
_props$clearNotShow = props.clearNotShow,
|
|
59
59
|
clearNotShow = _props$clearNotShow === void 0 ? true : _props$clearNotShow,
|
|
@@ -62,8 +62,6 @@ var ProForm = function ProForm(props, ref) {
|
|
|
62
62
|
requiredOnView = _props$requiredOnView === void 0 ? true : _props$requiredOnView,
|
|
63
63
|
formId = props.formId,
|
|
64
64
|
required = props.required,
|
|
65
|
-
_props$originalDiffTi = props.originalDiffTip,
|
|
66
|
-
originalDiffTip = _props$originalDiffTi === void 0 ? true : _props$originalDiffTi,
|
|
67
65
|
formKey = props.formKey,
|
|
68
66
|
globalControl = props.globalControl,
|
|
69
67
|
_props$scrollToError = props.scrollToError,
|
|
@@ -261,11 +259,10 @@ var ProForm = function ProForm(props, ref) {
|
|
|
261
259
|
colProps: colProps,
|
|
262
260
|
viewEmpty: viewEmpty,
|
|
263
261
|
labelWidth: labelWidth,
|
|
264
|
-
|
|
262
|
+
diffConfig: diffConfig,
|
|
265
263
|
clearNotShow: clearNotShow,
|
|
266
264
|
requiredOnView: requiredOnView,
|
|
267
265
|
required: required,
|
|
268
|
-
originalDiffTip: originalDiffTip,
|
|
269
266
|
globalControl: globalControl
|
|
270
267
|
}), footerRender()]
|
|
271
268
|
})), children]
|
|
@@ -44,6 +44,17 @@ export interface ProFormOtherProps {
|
|
|
44
44
|
listName?: any[] | string | number;
|
|
45
45
|
globalControl?: boolean;
|
|
46
46
|
formDisabled?: boolean;
|
|
47
|
+
isDiffChange?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface DiffConfigProps<Values = any> {
|
|
50
|
+
/** 比对原始数据源 */
|
|
51
|
+
originalValues: Values;
|
|
52
|
+
/** 是否显示对比值气泡 */
|
|
53
|
+
toolTip?: boolean;
|
|
54
|
+
/** 变更提示颜色 */
|
|
55
|
+
changeTipColor?: string;
|
|
56
|
+
/** 新增提示颜色 */
|
|
57
|
+
addTipColor?: string;
|
|
47
58
|
}
|
|
48
59
|
export interface ProFormProps<Values = any> extends FormProps<Values> {
|
|
49
60
|
disabled?: boolean;
|
|
@@ -67,14 +78,14 @@ export interface ProFormProps<Values = any> extends FormProps<Values> {
|
|
|
67
78
|
viewEmpty?: React.ReactNode | string;
|
|
68
79
|
confirmLoading?: boolean;
|
|
69
80
|
labelWidth?: string | number;
|
|
70
|
-
originalValues?: Values;
|
|
71
81
|
/** 是否回车提交 */
|
|
72
82
|
submitOnEnter?: boolean;
|
|
73
83
|
clearNotShow?: boolean;
|
|
74
84
|
requiredOnView?: boolean;
|
|
75
85
|
formId?: string;
|
|
76
86
|
required?: boolean | boolean[];
|
|
77
|
-
|
|
87
|
+
/** 表单比对配置 */
|
|
88
|
+
diffConfig?: DiffConfigProps;
|
|
78
89
|
scrollToError?: boolean;
|
|
79
90
|
/** 性能模式,谨慎使用,默认不开启
|
|
80
91
|
* 1. 开启不过滤names的中间态值
|