@zat-design/sisyphus-react 3.9.0 → 3.9.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +36 -16
- package/dist/less.esm.css +32 -14
- package/es/ProDrawerForm/components/ProDrawer/index.js +3 -1
- package/es/ProDrawerForm/components/ProModal/index.js +5 -3
- package/es/ProDrawerForm/propsType.d.ts +1 -0
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +7 -3
- package/es/ProEditTable/components/RenderField/index.js +3 -2
- package/es/ProEditTable/index.js +23 -16
- package/es/ProEditTable/style/index.less +14 -2
- package/es/ProEnum/index.js +6 -4
- package/es/ProEnum/propsType.d.ts +1 -0
- package/es/ProForm/components/base/SwitchCheckbox/index.js +9 -2
- package/es/ProForm/components/combination/FormList/index.js +1 -1
- package/es/ProForm/components/combination/Group/component/ComRender.d.ts +1 -0
- package/es/ProForm/components/combination/Group/component/ComRender.js +12 -1
- package/es/ProForm/components/combination/Group/index.js +4 -3
- package/es/ProForm/components/combination/ProModalSelect/index.js +30 -29
- package/es/ProForm/components/render/ChangedWrapper.js +3 -3
- package/es/ProForm/components/render/RenderFields.js +3 -2
- package/es/ProForm/components/render/propsType.d.ts +1 -0
- package/es/ProForm/style/index.less +10 -6
- package/es/ProForm/utils/diffOriginal.js +18 -12
- package/es/ProTable/components/FormatColumn/index.d.ts +5 -3
- package/es/ProTable/components/FormatColumn/index.js +93 -72
- package/es/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/es/ProTable/components/RenderColumn/index.js +41 -23
- package/es/ProTable/components/TableResizable/index.js +1 -5
- package/es/ProTable/index.d.ts +6 -5
- package/es/ProTable/index.js +4 -6
- package/es/ProTable/propsType.d.ts +2 -1
- package/es/ProTable/style/index.less +10 -1
- package/es/ProTable/utils/index.d.ts +5 -2
- package/es/ProTable/utils/index.js +13 -4
- package/es/ProTree/components/ProTreeSelect/index.js +32 -13
- package/es/style/theme/antd.less +4 -2
- package/es/utils/index.d.ts +1 -1
- package/es/utils/index.js +4 -1
- package/lib/ProDrawerForm/components/ProDrawer/index.js +3 -1
- package/lib/ProDrawerForm/components/ProModal/index.js +5 -3
- package/lib/ProDrawerForm/propsType.d.ts +1 -0
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +5 -1
- package/lib/ProEditTable/components/RenderField/index.js +3 -2
- package/lib/ProEditTable/index.js +23 -16
- package/lib/ProEditTable/style/index.less +14 -2
- package/lib/ProEnum/index.js +6 -4
- package/lib/ProEnum/propsType.d.ts +1 -0
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +9 -2
- package/lib/ProForm/components/combination/FormList/index.js +1 -1
- package/lib/ProForm/components/combination/Group/component/ComRender.d.ts +1 -0
- package/lib/ProForm/components/combination/Group/component/ComRender.js +12 -1
- package/lib/ProForm/components/combination/Group/index.js +4 -3
- package/lib/ProForm/components/combination/ProModalSelect/index.js +29 -28
- package/lib/ProForm/components/render/ChangedWrapper.js +3 -3
- package/lib/ProForm/components/render/RenderFields.js +3 -2
- package/lib/ProForm/components/render/propsType.d.ts +1 -0
- package/lib/ProForm/style/index.less +10 -6
- package/lib/ProForm/utils/diffOriginal.js +18 -12
- package/lib/ProTable/components/FormatColumn/index.d.ts +5 -3
- package/lib/ProTable/components/FormatColumn/index.js +92 -71
- package/lib/ProTable/components/RenderColumn/index.d.ts +1 -1
- package/lib/ProTable/components/RenderColumn/index.js +41 -23
- package/lib/ProTable/components/TableResizable/index.js +0 -4
- package/lib/ProTable/index.d.ts +6 -5
- package/lib/ProTable/index.js +4 -6
- package/lib/ProTable/propsType.d.ts +2 -1
- package/lib/ProTable/style/index.less +10 -1
- package/lib/ProTable/utils/index.d.ts +5 -2
- package/lib/ProTable/utils/index.js +13 -4
- package/lib/ProTree/components/ProTreeSelect/index.js +31 -12
- package/lib/style/theme/antd.less +4 -2
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +4 -1
- package/package.json +1 -1
- package/.vscode/extensions.json +0 -5
@@ -24,7 +24,7 @@ var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames",
|
|
24
24
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
25
25
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
26
26
|
import { SearchOutlined } from '@ant-design/icons';
|
27
|
-
import { useDeepCompareEffect, useMount, useSetState } from 'ahooks';
|
27
|
+
import { useDebounceEffect, useDeepCompareEffect, useMount, useSetState } from 'ahooks';
|
28
28
|
import { debounce, isArray, isEqual, isFunction, omit } from 'lodash';
|
29
29
|
import { ReactSVG } from 'react-svg';
|
30
30
|
import React, { forwardRef, useImperativeHandle, useMemo } from 'react';
|
@@ -34,7 +34,7 @@ import viewSvg from '../../../../assets/view.svg';
|
|
34
34
|
import useRequestList from './hooks/useRequestList';
|
35
35
|
import locale from '../../../../locale';
|
36
36
|
var ProModalSelect = function ProModalSelect(props, ref) {
|
37
|
-
var _formColumns$;
|
37
|
+
var _useRequest$options9, _formColumns$;
|
38
38
|
var value = props.value,
|
39
39
|
onChange = props.onChange,
|
40
40
|
disabled = props.disabled,
|
@@ -147,13 +147,21 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
147
147
|
})),
|
148
148
|
run = _useRequestList.run,
|
149
149
|
selectLoading = _useRequestList.loading;
|
150
|
+
var initParams = useMemo(function () {
|
151
|
+
var nextInitParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
152
|
+
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
153
|
+
var _contentForm$getField;
|
154
|
+
nextInitParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams(value, contentForm === null || contentForm === void 0 ? void 0 : (_contentForm$getField = contentForm.getFieldsValue) === null || _contentForm$getField === void 0 ? void 0 : _contentForm$getField.call(contentForm));
|
155
|
+
}
|
156
|
+
return nextInitParams;
|
157
|
+
}, [value]);
|
150
158
|
var _useRequestList2 = useRequestList(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, {
|
151
159
|
withPagination: withPagination,
|
152
160
|
transformParams: transformParams,
|
153
161
|
transformResponse: transformResponse
|
154
162
|
}, _objectSpread({
|
155
163
|
manual: true,
|
156
|
-
ready: (
|
164
|
+
ready: (initParams || defaultOne) && !readOnly || visible
|
157
165
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options)),
|
158
166
|
data = _useRequestList2.data,
|
159
167
|
loading = _useRequestList2.loading,
|
@@ -458,18 +466,15 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
458
466
|
// 初始化回显,当传入initParams时,前端用来回险
|
459
467
|
var getInitValues = /*#__PURE__*/function () {
|
460
468
|
var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
461
|
-
var
|
469
|
+
var _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _res$data2, _list, list, _data, nextSelectRowKeys;
|
462
470
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
463
471
|
while (1) switch (_context4.prev = _context4.next) {
|
464
472
|
case 0:
|
465
|
-
if (
|
466
|
-
|
467
|
-
}
|
468
|
-
if (!((useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) || defaultOne)) {
|
469
|
-
_context4.next = 10;
|
473
|
+
if (!(initParams || defaultOne)) {
|
474
|
+
_context4.next = 9;
|
470
475
|
break;
|
471
476
|
}
|
472
|
-
queryBean = _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.defaultParams),
|
477
|
+
queryBean = _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options2 = useRequest.options) === null || _useRequest$options2 === void 0 ? void 0 : _useRequest$options2.defaultParams), initParams || {});
|
473
478
|
page = _objectSpread({
|
474
479
|
pageNum: 1,
|
475
480
|
pageSize: 10
|
@@ -478,9 +483,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
478
483
|
queryBean: queryBean !== null && queryBean !== void 0 ? queryBean : {}
|
479
484
|
}) : queryBean;
|
480
485
|
params = transformParams ? transformParams(params) : params;
|
481
|
-
_context4.next =
|
486
|
+
_context4.next = 7;
|
482
487
|
return runAsync(params);
|
483
|
-
case
|
488
|
+
case 7:
|
484
489
|
res = _context4.sent;
|
485
490
|
if (res === null || res === void 0 ? void 0 : res.data) {
|
486
491
|
list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list : res === null || res === void 0 ? void 0 : res.data;
|
@@ -508,7 +513,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
508
513
|
});
|
509
514
|
}
|
510
515
|
}
|
511
|
-
case
|
516
|
+
case 9:
|
512
517
|
case "end":
|
513
518
|
return _context4.stop();
|
514
519
|
}
|
@@ -599,7 +604,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
599
604
|
});
|
600
605
|
}
|
601
606
|
});
|
602
|
-
|
607
|
+
useDebounceEffect(function () {
|
603
608
|
if (onOff && !visible) {
|
604
609
|
var _useRequest$options6;
|
605
610
|
if ((useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options6 = useRequest.options) === null || _useRequest$options6 === void 0 ? void 0 : _useRequest$options6.manual) !== true) {
|
@@ -634,13 +639,13 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
634
639
|
}
|
635
640
|
setState(nextState);
|
636
641
|
}
|
637
|
-
}, [onOff, visible, value]);
|
642
|
+
}, [onOff, visible, JSON.stringify(value)]);
|
638
643
|
useDeepCompareEffect(function () {
|
639
644
|
if (value && !visible && isInit && !readOnly) {
|
640
645
|
getInitValues();
|
641
646
|
}
|
642
|
-
}, [value, visible, isInit]);
|
643
|
-
|
647
|
+
}, [JSON.stringify(value), visible, isInit]);
|
648
|
+
useDebounceEffect(function () {
|
644
649
|
if (value && !visible && readOnly) {
|
645
650
|
var _options$some;
|
646
651
|
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) {
|
@@ -652,11 +657,6 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
652
657
|
// 加定时器 修复依赖数据同步更新未取到问题
|
653
658
|
setTimeout(function () {
|
654
659
|
var _useRequest$options7, _useRequest$options8;
|
655
|
-
var initParams = useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams;
|
656
|
-
if (typeof (useRequest === null || useRequest === void 0 ? void 0 : useRequest.initParams) === 'function') {
|
657
|
-
var _contentForm$getField2;
|
658
|
-
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));
|
659
|
-
}
|
660
660
|
var params = withPagination ? {
|
661
661
|
pageNum: 1,
|
662
662
|
pageSize: 50,
|
@@ -666,8 +666,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
666
666
|
run(nextParams);
|
667
667
|
}, 300);
|
668
668
|
}
|
669
|
-
}, [value, options, visible, useRequest]);
|
670
|
-
|
669
|
+
}, [JSON.stringify(value), JSON.stringify(options), visible, JSON.stringify(useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options9 = useRequest.options) === null || _useRequest$options9 === void 0 ? void 0 : _useRequest$options9.defaultParams), JSON.stringify(initParams)]);
|
670
|
+
useDebounceEffect(function () {
|
671
671
|
if (!value) {
|
672
672
|
if (defaultOne) {
|
673
673
|
getDefaultOneValues();
|
@@ -718,8 +718,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
718
718
|
}) : null,
|
719
719
|
onFocus: function onFocus() {
|
720
720
|
if (useRequest) {
|
721
|
-
var _useRequest$
|
722
|
-
var queryBean = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$
|
721
|
+
var _useRequest$options10;
|
722
|
+
var queryBean = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options10 = useRequest.options) === null || _useRequest$options10 === void 0 ? void 0 : _useRequest$options10.defaultParams) || {};
|
723
723
|
var params = withPagination ? {
|
724
724
|
pageNum: 1,
|
725
725
|
pageSize: 50,
|
@@ -733,8 +733,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
733
733
|
}
|
734
734
|
},
|
735
735
|
onSearch: debounce(function (val) {
|
736
|
-
var _useRequest$
|
737
|
-
var queryBean = _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$
|
736
|
+
var _useRequest$options11;
|
737
|
+
var queryBean = _objectSpread(_objectSpread({}, useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options11 = useRequest.options) === null || _useRequest$options11 === void 0 ? void 0 : _useRequest$options11.defaultParams), {}, _defineProperty({}, searchKey !== null && searchKey !== void 0 ? searchKey : labelKey, val));
|
738
738
|
var params = withPagination ? {
|
739
739
|
pageNum: 1,
|
740
740
|
pageSize: 50,
|
@@ -845,7 +845,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
845
845
|
onOk: handleFinish,
|
846
846
|
// @ts-ignore
|
847
847
|
onCancel: handleClose,
|
848
|
-
visible: visible
|
848
|
+
visible: visible,
|
849
|
+
zIndex: 1071
|
849
850
|
}, restModalProps), {}, {
|
850
851
|
children: [_jsx(ProForm, {
|
851
852
|
submitOnEnter: true,
|
@@ -29,7 +29,6 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
29
29
|
getValueProps = props.getValueProps,
|
30
30
|
viewRender = props.viewRender,
|
31
31
|
rest = _objectWithoutProperties(props, _excluded);
|
32
|
-
// const contentRef = useRef(null);
|
33
32
|
var _useProConfig = useProConfig('ProForm'),
|
34
33
|
isDiffAll = _useProConfig.isDiffAll;
|
35
34
|
var originalValues = diffConfig.originalValues,
|
@@ -103,7 +102,9 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
103
102
|
getPopupContainer: function getPopupContainer(trigger) {
|
104
103
|
return scrollFollowParent ? trigger.parentElement : document.body;
|
105
104
|
},
|
106
|
-
overlayClassName: "original-value-
|
105
|
+
overlayClassName: "original-value-tooltip",
|
106
|
+
placement: "topLeft",
|
107
|
+
autoAdjustOverflow: false,
|
107
108
|
title: _jsxs(_Space, {
|
108
109
|
direction: "vertical",
|
109
110
|
className: "changed-tooltip",
|
@@ -119,7 +120,6 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
119
120
|
})) : undefined]
|
120
121
|
})]
|
121
122
|
}),
|
122
|
-
placement: "topLeft",
|
123
123
|
children: _jsx("div", {
|
124
124
|
className: diffClassName,
|
125
125
|
style: style,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
3
|
-
var _excluded = ["show", "type", "viewRender", "viewType", "valueType", "formItemProps", "colProps", "formItemChildProps", "fieldProps", "equalWith", "clearNotShow", "required", "confirm"];
|
3
|
+
var _excluded = ["show", "type", "viewRender", "viewType", "valueType", "formItemProps", "colProps", "formItemChildProps", "fieldProps", "equalWith", "onDiff", "clearNotShow", "required", "confirm"];
|
4
4
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
5
5
|
import React from 'react';
|
6
6
|
import { isBoolean, isFunction, union, isString } from 'lodash';
|
@@ -69,6 +69,7 @@ var RenderFields = function RenderFields(props) {
|
|
69
69
|
_column$fieldProps = column.fieldProps,
|
70
70
|
fieldProps = _column$fieldProps === void 0 ? {} : _column$fieldProps,
|
71
71
|
equalWith = column.equalWith,
|
72
|
+
onDiff = column.onDiff,
|
72
73
|
_column$clearNotShow = column.clearNotShow,
|
73
74
|
clearNotShow = _column$clearNotShow === void 0 ? outerClearNotShow : _column$clearNotShow,
|
74
75
|
columnRequired = column.required,
|
@@ -208,7 +209,7 @@ var RenderFields = function RenderFields(props) {
|
|
208
209
|
fieldProps: isFunction(fieldProps) ? fieldProps : null,
|
209
210
|
isSelect: _isSelect,
|
210
211
|
diffConfig: diffConfig,
|
211
|
-
equalWith: equalWith,
|
212
|
+
equalWith: onDiff || equalWith,
|
212
213
|
requiredOnView: requiredOnView,
|
213
214
|
globalControl: globalControl,
|
214
215
|
viewRender: viewRender
|
@@ -207,6 +207,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
207
207
|
hiddenNames?: string[] | any[];
|
208
208
|
rules?: ProRule[] | ReactiveFunction<Values, ProRule[]>;
|
209
209
|
equalWith?: DiffOriginalParams['equalWith'];
|
210
|
+
onDiff?: DiffOriginalParams['equalWith'];
|
210
211
|
required?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
|
211
212
|
labelRequired?: boolean;
|
212
213
|
toISOString?: boolean;
|
@@ -385,7 +385,7 @@
|
|
385
385
|
}
|
386
386
|
|
387
387
|
// checkbox
|
388
|
-
.@{ant-prefix}-checkbox-group {
|
388
|
+
.@{ant-prefix}-checkbox-group,.pro-switch-checkbox {
|
389
389
|
padding: 5px 0
|
390
390
|
}
|
391
391
|
// switch
|
@@ -412,7 +412,7 @@
|
|
412
412
|
background: @zaui-contract-bg-add !important;
|
413
413
|
|
414
414
|
.@{ant-prefix}-input {
|
415
|
-
background: @zaui-contract-bg !important;
|
415
|
+
background: @zaui-contract-bg-add !important;
|
416
416
|
}
|
417
417
|
|
418
418
|
.@{ant-prefix}-select.@{ant-prefix}-select-disabled .@{ant-prefix}-select-selector{
|
@@ -463,7 +463,7 @@
|
|
463
463
|
}
|
464
464
|
|
465
465
|
// checkbox
|
466
|
-
.@{ant-prefix}-checkbox-group {
|
466
|
+
.@{ant-prefix}-checkbox-group,.pro-switch-checkbox {
|
467
467
|
padding: 5px 0
|
468
468
|
}
|
469
469
|
// switch
|
@@ -485,10 +485,8 @@
|
|
485
485
|
}
|
486
486
|
}
|
487
487
|
|
488
|
-
.original-value-
|
489
|
-
max-width: 100%;
|
488
|
+
.original-value-tooltip{
|
490
489
|
width: max-content;
|
491
|
-
z-index: 99;
|
492
490
|
.changed-tooltip {
|
493
491
|
.original-value-container {
|
494
492
|
.ant-space-item:nth-child(1) {
|
@@ -511,3 +509,9 @@
|
|
511
509
|
}
|
512
510
|
}
|
513
511
|
|
512
|
+
.original-value-tooltip-fixed {
|
513
|
+
position: fixed;
|
514
|
+
}
|
515
|
+
|
516
|
+
|
517
|
+
|
@@ -1,15 +1,17 @@
|
|
1
1
|
import { isEqual, isFunction, isObject } from 'lodash';
|
2
2
|
import { isEmpty } from '../../utils';
|
3
3
|
// 过滤对象中undefined字段
|
4
|
-
// 防止{a: '1'} {a: '1', b: undefined}被认为不相等
|
5
|
-
var
|
4
|
+
// 防止{a: '1'} {a: '1', b: undefined | null}被认为不相等
|
5
|
+
var filterObject = function filterObject(data) {
|
6
6
|
if (!isObject(data) || Array.isArray(data) || data === null) return data;
|
7
7
|
var resData = {};
|
8
8
|
Object.keys(data).forEach(function (key) {
|
9
|
-
if (data[key]
|
9
|
+
if (!isEmpty(data[key])) {
|
10
10
|
resData[key] = data[key];
|
11
11
|
}
|
12
12
|
});
|
13
|
+
// 空对象视为null 比较时 null undefined {} [] '' 视为相等
|
14
|
+
if (!Object.keys(resData).length) return null;
|
13
15
|
return resData;
|
14
16
|
};
|
15
17
|
var nullValue = [null, undefined, '']; // 输入框空值时可能存在的三种值 视为相等
|
@@ -20,18 +22,22 @@ export var diffOriginal = function diffOriginal(params) {
|
|
20
22
|
// 支持传入自定义比较事件
|
21
23
|
if (isFunction(equalWith)) {
|
22
24
|
var diffRes = equalWith(originalValue, value);
|
23
|
-
|
24
|
-
if (
|
25
|
-
|
25
|
+
// 如果返回undefined走内置比较逻辑
|
26
|
+
if (diffRes !== undefined) {
|
27
|
+
if (typeof diffRes === 'boolean') {
|
28
|
+
return diffRes ? 'same' : 'changed';
|
29
|
+
}
|
30
|
+
return diffRes;
|
26
31
|
}
|
27
|
-
return diffRes;
|
28
32
|
}
|
33
|
+
var _value = filterObject(value);
|
34
|
+
var _originalValue = filterObject(originalValue);
|
29
35
|
// 如果原始值为空 且当前有值的话 认为变更类型是新增
|
30
|
-
if (isEmpty(
|
36
|
+
if (isEmpty(_originalValue) && !isEmpty(_value)) {
|
31
37
|
return 'add';
|
32
38
|
}
|
33
|
-
if (Array.isArray(
|
34
|
-
var isSame =
|
39
|
+
if (Array.isArray(_originalValue)) {
|
40
|
+
var isSame = _originalValue.every(function (valueItem, index) {
|
35
41
|
// 如果两个值有一个不是空值, 则进行深比较
|
36
42
|
if (!isEmpty(value === null || value === void 0 ? void 0 : value[index]) || !isEmpty(valueItem)) {
|
37
43
|
return isEqual(value === null || value === void 0 ? void 0 : value[index], valueItem);
|
@@ -40,8 +46,8 @@ export var diffOriginal = function diffOriginal(params) {
|
|
40
46
|
});
|
41
47
|
return isSame ? 'same' : 'changed';
|
42
48
|
}
|
43
|
-
if (!
|
44
|
-
return isEqual(
|
49
|
+
if (!isEmpty(_originalValue) || !isEmpty(_value)) {
|
50
|
+
return isEqual(_value, _originalValue) ? 'same' : 'changed';
|
45
51
|
}
|
46
52
|
return 'same';
|
47
53
|
};
|
@@ -1,15 +1,17 @@
|
|
1
|
+
/**
|
2
|
+
* 调整点:
|
3
|
+
*/
|
1
4
|
import React from 'react';
|
2
5
|
import { ProTableColumn } from '../../propsType';
|
3
|
-
export declare const formatColumn: ({ column, originalObj,
|
6
|
+
export declare const formatColumn: ({ column, originalObj, rowKey, wrapToolTipProps, scroll, onUpdateMinWidth, isInNewRow, diffConfig, }: {
|
4
7
|
column: ProTableColumn;
|
5
8
|
originalObj: any;
|
6
|
-
dataSourceObj: any;
|
7
9
|
rowKey: any;
|
8
|
-
diffToolTip?: boolean;
|
9
10
|
wrapToolTipProps?: any;
|
10
11
|
scroll?: any;
|
11
12
|
onUpdateMinWidth?: any;
|
12
13
|
isInNewRow?: any;
|
14
|
+
diffConfig: any;
|
13
15
|
}) => void;
|
14
16
|
/**
|
15
17
|
* 查找最近的父级className
|