@zat-design/sisyphus-react 3.9.0 → 3.9.1-beta.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 +71 -37
- package/dist/less.esm.css +67 -35
- 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/ProDrawerForm/style/index.less +3 -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 +22 -3
- package/es/ProEnum/index.js +10 -5
- 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/ProCascader/index.js +7 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +40 -38
- 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 +12 -8
- 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 +20 -6
- 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/ProDrawerForm/style/index.less +3 -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 +22 -3
- package/lib/ProEnum/index.js +10 -5
- 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/ProCascader/index.js +7 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +39 -37
- 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 +12 -8
- 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 +20 -6
- 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 +2 -2
@@ -5,6 +5,15 @@
|
|
5
5
|
td[rowspan]{
|
6
6
|
vertical-align: middle !important;
|
7
7
|
}
|
8
|
+
.@{ant-prefix}-table-content{
|
9
|
+
.@{ant-prefix}-table-tbody{
|
10
|
+
.pro-form-item-add .pro-form-view-container{
|
11
|
+
padding: 0;
|
12
|
+
border-radius: 0;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
8
17
|
|
9
18
|
.pro-edit-table-tooltip {
|
10
19
|
display : inline-flex;
|
@@ -281,9 +290,19 @@
|
|
281
290
|
}
|
282
291
|
}
|
283
292
|
|
284
|
-
|
285
|
-
|
286
|
-
|
293
|
+
.@{ant-prefix}-table table .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row td,
|
294
|
+
.@{ant-prefix}-table table .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row td.@{ant-prefix}-table-cell-fix-left,
|
295
|
+
.@{ant-prefix}-table table .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row td.@{ant-prefix}-table-cell-fix-right,
|
296
|
+
.@{ant-prefix}-table.@{ant-prefix}-table-scroll-horizontal table .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row td,
|
297
|
+
.@{ant-prefix}-table.@{ant-prefix}-table-scroll-horizontal table .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row td.@{ant-prefix}-table-cell-fix-left,
|
298
|
+
.@{ant-prefix}-table.@{ant-prefix}-table-scroll-horizontal table .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row td.@{ant-prefix}-table-cell-fix-right{
|
299
|
+
background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
|
300
|
+
border-bottom: 1px solid var(--zaui-form-control-line,#dcdcdc) ;
|
301
|
+
}
|
302
|
+
.@{ant-prefix}-table .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row:hover,
|
303
|
+
.@{ant-prefix}-table.@{ant-prefix}-table-scroll-horizontal table .@{ant-prefix}-table-tbody .is-new-row.@{ant-prefix}-table-row:hover{
|
304
|
+
td, .@{ant-prefix}-table-cell-row-hover {
|
305
|
+
background-color: var(--zaui-contract-bg-add, #d2fff4) !important;
|
287
306
|
}
|
288
307
|
}
|
289
308
|
}
|
package/es/ProEnum/index.js
CHANGED
@@ -27,8 +27,9 @@ import getEnumLabel from './utils/getEnumLabel';
|
|
27
27
|
import useEnum from './hooks/useEnum';
|
28
28
|
import locale from '../locale';
|
29
29
|
import './style/index.less';
|
30
|
+
import { useFieldProps } from '../ProForm/utils/useFieldProps';
|
30
31
|
var ProEnum = function ProEnum(props) {
|
31
|
-
var _enumProps$showCodeNa;
|
32
|
+
var _otherProps$isView, _enumProps$showCodeNa;
|
32
33
|
var code = props.code,
|
33
34
|
_props$type = props.type,
|
34
35
|
type = _props$type === void 0 ? 'ProSelect' : _props$type,
|
@@ -43,7 +44,9 @@ var ProEnum = function ProEnum(props) {
|
|
43
44
|
enumProps = _objectWithoutProperties(props, _excluded);
|
44
45
|
var _ref = otherProps || {},
|
45
46
|
viewEmpty = _ref.viewEmpty;
|
46
|
-
var
|
47
|
+
var _defalutValue = props === null || props === void 0 ? void 0 : props.defaultValue;
|
48
|
+
var _useFieldProps = useFieldProps(),
|
49
|
+
configIsView = _useFieldProps.isView;
|
47
50
|
var _ref2 = useProConfig('ProEnum') || {},
|
48
51
|
fieldNames = _ref2.fieldNames,
|
49
52
|
_ref2$clear = _ref2.clear,
|
@@ -52,6 +55,7 @@ var ProEnum = function ProEnum(props) {
|
|
52
55
|
cacheKey = _ref2$cacheKey === void 0 ? 'zat-design-pro-component-cacheKey' : _ref2$cacheKey,
|
53
56
|
showCodeName = _ref2.showCodeName,
|
54
57
|
resProps = _objectWithoutProperties(_ref2, _excluded2);
|
58
|
+
var _isView = isView !== undefined && isView !== null ? isView : (_otherProps$isView = otherProps === null || otherProps === void 0 ? void 0 : otherProps.isView) !== null && _otherProps$isView !== void 0 ? _otherProps$isView : configIsView;
|
55
59
|
enumProps.showCodeName = (_enumProps$showCodeNa = enumProps.showCodeName) !== null && _enumProps$showCodeNa !== void 0 ? _enumProps$showCodeNa : showCodeName;
|
56
60
|
var label = 'label';
|
57
61
|
var fieldValue = 'value';
|
@@ -273,16 +277,17 @@ var ProEnum = function ProEnum(props) {
|
|
273
277
|
return isFunction(props.optionRender) && record.length ? _optionRender() : labelList === null || labelList === void 0 ? void 0 : labelList.join(',');
|
274
278
|
};
|
275
279
|
if (_isView) {
|
276
|
-
|
280
|
+
var __value = value || _defalutValue;
|
281
|
+
if (Array.isArray(__value)) {
|
277
282
|
return _jsx(Container, {
|
278
283
|
tooltip: true,
|
279
284
|
viewEmpty: viewEmpty,
|
280
|
-
children: transToLabel(
|
285
|
+
children: transToLabel(__value)
|
281
286
|
});
|
282
287
|
}
|
283
288
|
return _jsx(Container, {
|
284
289
|
viewEmpty: viewEmpty,
|
285
|
-
children:
|
290
|
+
children: __value || isNumber(__value) ? transToLabel([__value]) : null
|
286
291
|
});
|
287
292
|
}
|
288
293
|
return _jsx(_Fragment, {
|
@@ -2,9 +2,10 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import "antd/es/checkbox/style";
|
3
3
|
import _Checkbox from "antd/es/checkbox";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
5
|
-
var _excluded = ["onChange", "disabled", "value", "otherProps"];
|
5
|
+
var _excluded = ["onChange", "disabled", "value", "otherProps", "className"];
|
6
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
7
7
|
import { isNull, isUndefined } from 'lodash';
|
8
|
+
import classnames from 'classnames';
|
8
9
|
import { useProConfig } from '../../../../ProConfigProvider';
|
9
10
|
import locale from '../../../../locale';
|
10
11
|
import ProForm from '../../../../ProForm';
|
@@ -13,6 +14,7 @@ var SwitchCheckbox = function SwitchCheckbox(props) {
|
|
13
14
|
disabled = props.disabled,
|
14
15
|
value = props.value,
|
15
16
|
otherProps = props.otherProps,
|
17
|
+
className = props.className,
|
16
18
|
restProps = _objectWithoutProperties(props, _excluded);
|
17
19
|
var _ref = ProForm.useFieldProps() || {},
|
18
20
|
isViewCon = _ref.isView,
|
@@ -47,9 +49,14 @@ var SwitchCheckbox = function SwitchCheckbox(props) {
|
|
47
49
|
})]
|
48
50
|
});
|
49
51
|
}
|
52
|
+
var classNames = classnames({
|
53
|
+
'pro-switch-checkbox': true,
|
54
|
+
className: className
|
55
|
+
});
|
50
56
|
return _jsx(_Checkbox, _objectSpread(_objectSpread(_objectSpread({
|
51
57
|
disabled: disabled,
|
52
|
-
onChange: changeVal
|
58
|
+
onChange: changeVal,
|
59
|
+
className: classNames
|
53
60
|
}, initialConfig), restProps), {}, {
|
54
61
|
children: restProps.label
|
55
62
|
}));
|
@@ -43,7 +43,7 @@ var FormList = function FormList(props, ref) {
|
|
43
43
|
var _namePath = toArray(name);
|
44
44
|
var orgValues = get(diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalValues, name);
|
45
45
|
var _diffConfig = _objectSpread(_objectSpread({}, diffConfig), {}, {
|
46
|
-
originalValues: isDiffAll ? orgValues || [] : orgValues
|
46
|
+
originalValues: (diffConfig === null || diffConfig === void 0 ? void 0 : diffConfig.originalValues) && isDiffAll ? orgValues || [] : orgValues
|
47
47
|
});
|
48
48
|
var processColumns = useCallback(function (fieldName, namePath) {
|
49
49
|
return columns.map(function (item) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
4
|
-
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView"];
|
4
|
+
var _excluded = ["type", "confirm", "component", "fieldProps", "contextProps", "before", "after", "getValueProps", "valuePropName", "valueType", "isView", "viewRender"];
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
6
|
import React from 'react';
|
7
7
|
import ConfirmWrapper from '../../../../components/render/ConfirmWrapper';
|
@@ -42,6 +42,7 @@ var ComRender = function ComRender(props) {
|
|
42
42
|
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
43
43
|
valueType = props.valueType,
|
44
44
|
isView = props.isView,
|
45
|
+
viewRender = props.viewRender,
|
45
46
|
rest = _objectWithoutProperties(props, _excluded);
|
46
47
|
var TypeComponent = componentMap[type];
|
47
48
|
var mergedGetValueProps = getValueProps || function (val) {
|
@@ -49,6 +50,16 @@ var ComRender = function ComRender(props) {
|
|
49
50
|
};
|
50
51
|
var _props = mergedGetValueProps(fieldProps.value);
|
51
52
|
var componentProps = _objectSpread(_objectSpread(_objectSpread({}, fieldProps), rest), _props);
|
53
|
+
if (viewRender && isView) {
|
54
|
+
return _jsx(FieldProvider, {
|
55
|
+
value: _objectSpread(_objectSpread({}, contextProps), {}, {
|
56
|
+
valueType: valueType,
|
57
|
+
type: type,
|
58
|
+
isView: isView
|
59
|
+
}),
|
60
|
+
children: viewRender(componentProps)
|
61
|
+
});
|
62
|
+
}
|
52
63
|
var Component = component ? (/*#__PURE__*/React.cloneElement(component, _objectSpread({}, componentProps))) : _jsx(TypeComponent, _objectSpread({}, componentProps));
|
53
64
|
var Com = getComRender(Component, props, componentProps);
|
54
65
|
return _jsx(FieldProvider, {
|
@@ -26,7 +26,8 @@ var Group = function Group(props) {
|
|
26
26
|
value = props.value,
|
27
27
|
onChange = props.onChange,
|
28
28
|
otherProps = props.otherProps,
|
29
|
-
id = props.id
|
29
|
+
id = props.id,
|
30
|
+
isParentView = props.isView;
|
30
31
|
var contextProps = ProForm.useFieldProps() || {};
|
31
32
|
var names = contextProps.names,
|
32
33
|
name = contextProps.name,
|
@@ -71,7 +72,7 @@ var Group = function Group(props) {
|
|
71
72
|
children: columns.map(function (column, index) {
|
72
73
|
return _jsx(ComRender, _objectSpread(_objectSpread({
|
73
74
|
contextProps: contextProps,
|
74
|
-
isView: isView
|
75
|
+
isView: isParentView || isView
|
75
76
|
}, column), {}, {
|
76
77
|
otherProps: otherProps
|
77
78
|
}), column.name);
|
@@ -82,7 +83,7 @@ var Group = function Group(props) {
|
|
82
83
|
children: columns.map(function (column, index) {
|
83
84
|
return _jsx(ComRender, _objectSpread(_objectSpread({
|
84
85
|
contextProps: contextProps,
|
85
|
-
isView: isView
|
86
|
+
isView: isParentView || isView
|
86
87
|
}, column), {}, {
|
87
88
|
otherProps: otherProps
|
88
89
|
}), column.name);
|
@@ -35,11 +35,17 @@ var _filterDataSource = function filterDataSource(dataSource, level, fieldNames)
|
|
35
35
|
});
|
36
36
|
};
|
37
37
|
var getViewLabel = function getViewLabel(_ref) {
|
38
|
+
var _value2;
|
38
39
|
var dataSource = _ref.dataSource,
|
39
40
|
value = _ref.value;
|
41
|
+
var _value = value;
|
40
42
|
var viewLabel = [];
|
43
|
+
// fix: value是string类型,需要转为数组
|
44
|
+
if (_value && !Array.isArray(_value)) {
|
45
|
+
_value = [value];
|
46
|
+
}
|
41
47
|
// 根据dataSource得到label数组,查看模式展示需要
|
42
|
-
|
48
|
+
(_value2 = _value) === null || _value2 === void 0 ? void 0 : _value2.forEach(function (value, index) {
|
43
49
|
var _dataSource;
|
44
50
|
var temp = (_dataSource = dataSource) === null || _dataSource === void 0 ? void 0 : _dataSource.find(function (item) {
|
45
51
|
return (item === null || item === void 0 ? void 0 : item.value) === value;
|
@@ -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,
|
670
|
-
|
669
|
+
}, [JSON.stringify(value), 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,
|
@@ -830,16 +830,18 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
830
830
|
children: "".concat(viewText)
|
831
831
|
});
|
832
832
|
}
|
833
|
-
return _jsxs(
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
833
|
+
return _jsxs(_Fragment, {
|
834
|
+
children: [_jsx("div", {
|
835
|
+
id: uuid,
|
836
|
+
className: "pro-modal-select ".concat(className !== null && className !== void 0 ? className : ''),
|
837
|
+
style: style,
|
838
|
+
children: isTooltip && viewText ? _jsx(_Tooltip, {
|
839
|
+
placement: "topLeft",
|
840
|
+
open: open,
|
841
|
+
title: viewText,
|
842
|
+
children: initRender
|
843
|
+
}) : initRender
|
844
|
+
}), _jsxs(ProDrawerForm, _objectSpread(_objectSpread({
|
843
845
|
showType: "Modal",
|
844
846
|
title: title,
|
845
847
|
onOk: handleFinish,
|
@@ -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;
|
@@ -351,7 +351,7 @@
|
|
351
351
|
background: transparent !important;
|
352
352
|
}
|
353
353
|
.@{ant-prefix}-select-selection-placeholder {
|
354
|
-
z-index: 9;
|
354
|
+
// z-index: 9;
|
355
355
|
}
|
356
356
|
}
|
357
357
|
|
@@ -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{
|
@@ -429,7 +429,7 @@
|
|
429
429
|
background: transparent !important;
|
430
430
|
}
|
431
431
|
.@{ant-prefix}-select-selection-placeholder {
|
432
|
-
z-index: 9;
|
432
|
+
// z-index: 9;
|
433
433
|
}
|
434
434
|
}
|
435
435
|
|
@@ -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
|