@zat-design/sisyphus-react 3.8.0-beta.15 → 3.8.0-beta.16
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 +8 -46
- package/dist/less.esm.css +8 -46
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +8 -4
- package/es/ProEditTable/components/RenderField/index.js +4 -2
- package/es/ProForm/components/FormFooter/index.js +6 -4
- package/es/ProForm/components/combination/Group/utils.js +8 -1
- package/es/ProForm/components/combination/ProCascader/index.js +5 -2
- package/es/ProForm/components/combination/ProModalSelect/index.js +7 -1
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProNumberRange/index.js +54 -43
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +51 -52
- package/es/ProForm/components/render/ChangedWrapper.js +5 -3
- package/es/ProForm/components/render/Render.js +1 -0
- package/es/ProForm/components/render/propsType.d.ts +1 -1
- package/es/ProForm/style/index.less +1 -1
- package/es/ProForm/utils/useShouldUpdate.d.ts +2 -2
- package/es/ProForm/utils/useShouldUpdate.js +1 -1
- package/es/ProSelect/index.js +2 -3
- package/es/ProSelect/utils/index.js +5 -4
- package/es/ProTable/components/FormatColumn/index.d.ts +2 -1
- package/es/ProTable/components/FormatColumn/index.js +12 -9
- package/es/ProTable/index.js +11 -1
- package/es/ProTable/propsType.d.ts +4 -0
- package/es/ProTree/components/ProTreeSelect/index.js +10 -0
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +8 -4
- package/lib/ProEditTable/components/RenderField/index.js +4 -2
- package/lib/ProForm/components/FormFooter/index.js +5 -3
- package/lib/ProForm/components/combination/Group/utils.js +8 -1
- package/lib/ProForm/components/combination/ProCascader/index.js +5 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.js +7 -1
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProNumberRange/index.js +48 -41
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +51 -52
- package/lib/ProForm/components/render/ChangedWrapper.js +5 -3
- package/lib/ProForm/components/render/Render.js +1 -0
- package/lib/ProForm/components/render/propsType.d.ts +1 -1
- package/lib/ProForm/style/index.less +1 -1
- package/lib/ProForm/utils/useShouldUpdate.d.ts +2 -2
- package/lib/ProForm/utils/useShouldUpdate.js +1 -1
- package/lib/ProSelect/index.js +2 -3
- package/lib/ProSelect/utils/index.js +5 -4
- package/lib/ProTable/components/FormatColumn/index.d.ts +2 -1
- package/lib/ProTable/components/FormatColumn/index.js +12 -9
- package/lib/ProTable/index.js +11 -1
- package/lib/ProTable/propsType.d.ts +4 -0
- package/lib/ProTree/components/ProTreeSelect/index.js +10 -0
- package/package.json +1 -1
|
@@ -197,7 +197,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
197
197
|
* @default -
|
|
198
198
|
*/
|
|
199
199
|
labelWidth?: string | number;
|
|
200
|
-
disabled?: boolean | ReactiveFunction<Values, boolean>;
|
|
200
|
+
disabled?: boolean | boolean[] | ReactiveFunction<Values, boolean | boolean[]>;
|
|
201
201
|
trim?: boolean;
|
|
202
202
|
upperCase?: boolean;
|
|
203
203
|
hiddenNames?: string[] | any[];
|
|
@@ -3,7 +3,7 @@ import { ProColumnProps, ProRule } from '../components/render/propsType';
|
|
|
3
3
|
interface Result<Values> {
|
|
4
4
|
shouldUpdate?: FormItemProps<Values>['shouldUpdate'];
|
|
5
5
|
show?: boolean;
|
|
6
|
-
disabled?: boolean;
|
|
6
|
+
disabled?: boolean | boolean[];
|
|
7
7
|
rules?: ProRule[];
|
|
8
8
|
required?: boolean;
|
|
9
9
|
[key: string]: any;
|
|
@@ -15,7 +15,7 @@ interface UseShouldUpdateProps<Values> {
|
|
|
15
15
|
names?: any[];
|
|
16
16
|
};
|
|
17
17
|
form?: FormInstance<Values>;
|
|
18
|
-
disabled?:
|
|
18
|
+
disabled?: boolean;
|
|
19
19
|
rules?: ProRule[];
|
|
20
20
|
required?: boolean;
|
|
21
21
|
type: string;
|
|
@@ -63,7 +63,7 @@ var useShouldUpdate = function useShouldUpdate(props) {
|
|
|
63
63
|
}
|
|
64
64
|
if (isFunction(disabled)) {
|
|
65
65
|
// RangePicker返回数组时,特殊处理
|
|
66
|
-
if (
|
|
66
|
+
if (['Group', 'RangePicker'].includes(type) && Array.isArray(disabled(values, {
|
|
67
67
|
form: form,
|
|
68
68
|
index: index,
|
|
69
69
|
namePath: namePath
|
package/es/ProSelect/index.js
CHANGED
|
@@ -296,9 +296,8 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
|
296
296
|
showArrow: true,
|
|
297
297
|
loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
|
|
298
298
|
onChange: handleChange,
|
|
299
|
-
|
|
300
|
-
optionLabelProp
|
|
301
|
-
,
|
|
299
|
+
optionLabelProp: (otherProps === null || otherProps === void 0 ? void 0 : otherProps.isDiffChange) ? 'label' : 'children',
|
|
300
|
+
// optionLabelProp="label" // 解决warning报错,添加默认值
|
|
302
301
|
showSearch: true,
|
|
303
302
|
filterOption: isFunction(_onSearch) ? false : function (input, option) {
|
|
304
303
|
var _option$children, _option$children$prop;
|
|
@@ -30,7 +30,7 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
|
|
|
30
30
|
_iterator.f();
|
|
31
31
|
}
|
|
32
32
|
if (mode === 'multiple') {
|
|
33
|
-
selectValues = [].concat(_toConsumableArray(selectValues), _toConsumableArray(result));
|
|
33
|
+
selectValues = [].concat(_toConsumableArray(selectValues), _toConsumableArray(result || []));
|
|
34
34
|
} else {
|
|
35
35
|
selectValues.push(result);
|
|
36
36
|
}
|
|
@@ -53,13 +53,14 @@ export var getSelectList = function getSelectList(_ref2) {
|
|
|
53
53
|
if (!otherProps) {
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
|
-
var
|
|
56
|
+
var name = otherProps.name,
|
|
57
|
+
listName = otherProps.listName,
|
|
57
58
|
form = otherProps.form;
|
|
58
59
|
var firstNumberIndex = listName.lastIndexOf(listName.findLast(function (item) {
|
|
59
60
|
return typeof item === 'number';
|
|
60
61
|
}));
|
|
61
|
-
var fatherName = listName.slice(0, firstNumberIndex);
|
|
62
|
-
var selectName = listName.slice(firstNumberIndex + 1);
|
|
62
|
+
var fatherName = (name || listName).slice(0, firstNumberIndex);
|
|
63
|
+
var selectName = (name || listName).slice(firstNumberIndex + 1);
|
|
63
64
|
return findSelectNameValues({
|
|
64
65
|
list: form.getFieldValue(fatherName) || [],
|
|
65
66
|
selectName: selectName,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ProTableColumn } from '../../propsType';
|
|
3
|
-
export declare const formatColumn: ({ column, originalObj, dataSourceObj, rowKey, diffToolTip, }: {
|
|
3
|
+
export declare const formatColumn: ({ column, originalObj, dataSourceObj, rowKey, diffToolTip, wrapToolTipProps, }: {
|
|
4
4
|
column: ProTableColumn;
|
|
5
5
|
originalObj: any;
|
|
6
6
|
dataSourceObj: any;
|
|
7
7
|
rowKey: any;
|
|
8
8
|
diffToolTip?: boolean;
|
|
9
|
+
wrapToolTipProps?: any;
|
|
9
10
|
}) => void;
|
|
10
11
|
/**
|
|
11
12
|
* 查找最近的父级className
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "antd/es/space/style";
|
|
2
2
|
import _Space from "antd/es/space";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
4
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
4
5
|
import { isValidElement } from 'react';
|
|
5
6
|
import moment from 'moment';
|
|
@@ -16,7 +17,8 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
16
17
|
originalObj = _ref.originalObj,
|
|
17
18
|
dataSourceObj = _ref.dataSourceObj,
|
|
18
19
|
rowKey = _ref.rowKey,
|
|
19
|
-
diffToolTip = _ref.diffToolTip
|
|
20
|
+
diffToolTip = _ref.diffToolTip,
|
|
21
|
+
wrapToolTipProps = _ref.wrapToolTipProps;
|
|
20
22
|
var title = column.title,
|
|
21
23
|
valueType = column.valueType,
|
|
22
24
|
_column$format = column.format,
|
|
@@ -36,6 +38,7 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
36
38
|
originalDiffTip = _column$originalDiffT === void 0 ? true : _column$originalDiffT,
|
|
37
39
|
_column$toolTipProps = column.toolTipProps,
|
|
38
40
|
toolTipProps = _column$toolTipProps === void 0 ? {} : _column$toolTipProps;
|
|
41
|
+
var _toolTipProps = _objectSpread(_objectSpread({}, toolTipProps), wrapToolTipProps);
|
|
39
42
|
var _originalDiffTip = diffToolTip !== null && diffToolTip !== void 0 ? diffToolTip : originalDiffTip;
|
|
40
43
|
// 前缀处理
|
|
41
44
|
var prefixNode = function prefixNode(value, record, index) {
|
|
@@ -105,7 +108,7 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
105
108
|
value: value,
|
|
106
109
|
currentValue: renderValue,
|
|
107
110
|
originalDiffTip: _originalDiffTip,
|
|
108
|
-
toolTipProps:
|
|
111
|
+
toolTipProps: _toolTipProps
|
|
109
112
|
});
|
|
110
113
|
};
|
|
111
114
|
// 千分位, 千分位带CNY前缀
|
|
@@ -135,7 +138,7 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
135
138
|
value: value,
|
|
136
139
|
currentValue: renderValue,
|
|
137
140
|
originalDiffTip: _originalDiffTip,
|
|
138
|
-
toolTipProps:
|
|
141
|
+
toolTipProps: _toolTipProps
|
|
139
142
|
});
|
|
140
143
|
};
|
|
141
144
|
} else if (['datePicker', 'date', 'dateTime', 'dateStartTime', 'dateEndTime', 'dateStartEndTime'].includes(valueType)) {
|
|
@@ -188,7 +191,7 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
188
191
|
value: value,
|
|
189
192
|
currentValue: renderValue,
|
|
190
193
|
originalDiffTip: _originalDiffTip,
|
|
191
|
-
toolTipProps:
|
|
194
|
+
toolTipProps: _toolTipProps
|
|
192
195
|
});
|
|
193
196
|
};
|
|
194
197
|
} else if (['enumName', 'enumCodeName'].includes(valueType)) {
|
|
@@ -226,7 +229,7 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
226
229
|
value: value,
|
|
227
230
|
currentValue: renderValue,
|
|
228
231
|
originalDiffTip: _originalDiffTip,
|
|
229
|
-
toolTipProps:
|
|
232
|
+
toolTipProps: _toolTipProps
|
|
230
233
|
});
|
|
231
234
|
};
|
|
232
235
|
} else if (precision || prefix || suffix) {
|
|
@@ -253,7 +256,7 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
253
256
|
value: value,
|
|
254
257
|
currentValue: renderValue,
|
|
255
258
|
originalDiffTip: _originalDiffTip,
|
|
256
|
-
toolTipProps:
|
|
259
|
+
toolTipProps: _toolTipProps
|
|
257
260
|
});
|
|
258
261
|
};
|
|
259
262
|
} else if (valueType === 'address') {
|
|
@@ -309,7 +312,7 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
309
312
|
node: value,
|
|
310
313
|
value: value,
|
|
311
314
|
currentValue: value,
|
|
312
|
-
toolTipProps:
|
|
315
|
+
toolTipProps: _toolTipProps
|
|
313
316
|
}), suffixNode(value, record, index)]
|
|
314
317
|
});
|
|
315
318
|
};
|
|
@@ -330,7 +333,7 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
330
333
|
value: value,
|
|
331
334
|
currentValue: value || '-',
|
|
332
335
|
originalDiffTip: _originalDiffTip,
|
|
333
|
-
toolTipProps:
|
|
336
|
+
toolTipProps: _toolTipProps
|
|
334
337
|
}), suffixNode(value, record, index)]
|
|
335
338
|
});
|
|
336
339
|
};
|
|
@@ -353,7 +356,7 @@ export var formatColumn = function formatColumn(_ref) {
|
|
|
353
356
|
value: value,
|
|
354
357
|
currentValue: value || '-',
|
|
355
358
|
originalDiffTip: _originalDiffTip,
|
|
356
|
-
toolTipProps:
|
|
359
|
+
toolTipProps: _toolTipProps
|
|
357
360
|
});
|
|
358
361
|
};
|
|
359
362
|
}
|
package/es/ProTable/index.js
CHANGED
|
@@ -56,6 +56,15 @@ function ProTable(props) {
|
|
|
56
56
|
onDragStartGuard = props.onDragStart,
|
|
57
57
|
onDragEndGuard = props.onDragEnd,
|
|
58
58
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
59
|
+
var _props$scrollFollowPa = props.scrollFollowParent,
|
|
60
|
+
scrollFollowParent = _props$scrollFollowPa === void 0 ? true : _props$scrollFollowPa;
|
|
61
|
+
var wrapToolTipProps = {
|
|
62
|
+
getPopupContainer: scrollFollowParent ? function (triggerNode) {
|
|
63
|
+
return triggerNode.parentNode;
|
|
64
|
+
} : function () {
|
|
65
|
+
return document.body;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
59
68
|
var _ref3 = diffConfig || {},
|
|
60
69
|
originalDataSource = _ref3.originalDataSource,
|
|
61
70
|
changeTipColor = _ref3.changeTipColor,
|
|
@@ -198,7 +207,8 @@ function ProTable(props) {
|
|
|
198
207
|
originalObj: originalObj,
|
|
199
208
|
dataSourceObj: dataSourceObj,
|
|
200
209
|
rowKey: 'rowKey',
|
|
201
|
-
diffToolTip: toolTip
|
|
210
|
+
diffToolTip: toolTip,
|
|
211
|
+
wrapToolTipProps: wrapToolTipProps
|
|
202
212
|
});
|
|
203
213
|
});
|
|
204
214
|
return newColumns;
|
|
@@ -103,6 +103,10 @@ export interface ProTableProps<T = any> extends Omit<TableProps<any>, 'summary'
|
|
|
103
103
|
*/
|
|
104
104
|
onDragStart?: DragStartGuardProps;
|
|
105
105
|
onDragEnd?: DragEndGuardProps;
|
|
106
|
+
/**
|
|
107
|
+
* 滚动额外配置
|
|
108
|
+
*/
|
|
109
|
+
scrollFollowParent?: boolean;
|
|
106
110
|
}
|
|
107
111
|
export type ProTableValueType = 'percentage' | 'permillage' | 'thousandth' | 'datePicker' | 'enumName' | 'enumCodeName' | 'address' | 'thousandthCNY' | 'date' | 'dateTime' | 'dateStartTime' | 'dateEndTime' | 'dateStartEndTime';
|
|
108
112
|
export interface Response<T = any> {
|
|
@@ -297,6 +297,16 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
297
297
|
var labelText = node[label];
|
|
298
298
|
var value = node[code];
|
|
299
299
|
var key = node[uuidKey];
|
|
300
|
+
// 三无走默认
|
|
301
|
+
if (['undefined-undefined', 'undefined'].includes(labelText) && !value && !key) {
|
|
302
|
+
if (showCodeName) {
|
|
303
|
+
labelText = "".concat(node === null || node === void 0 ? void 0 : node.value, "-").concat(node === null || node === void 0 ? void 0 : node.label);
|
|
304
|
+
} else {
|
|
305
|
+
labelText = node === null || node === void 0 ? void 0 : node.label;
|
|
306
|
+
}
|
|
307
|
+
value = node === null || node === void 0 ? void 0 : node.value;
|
|
308
|
+
key = node === null || node === void 0 ? void 0 : node.value;
|
|
309
|
+
}
|
|
300
310
|
var titleHtml = _jsx("span", {
|
|
301
311
|
dangerouslySetInnerHTML: {
|
|
302
312
|
__html: labelText
|
|
@@ -16,7 +16,7 @@ var _lodash = require("lodash");
|
|
|
16
16
|
var _diffOriginal = require("../../../ProForm/utils/diffOriginal");
|
|
17
17
|
var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
18
18
|
var _utils = require("../../../utils");
|
|
19
|
-
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type"];
|
|
19
|
+
var _excluded = ["name", "names", "namesStr", "originalName", "originalNames", "originalValues", "form", "equalWith", "rowKeyPath", "children", "type", "normalize", "valuePropName"];
|
|
20
20
|
var toNamePath = function toNamePath(name) {
|
|
21
21
|
if (Array.isArray(name)) {
|
|
22
22
|
return name;
|
|
@@ -46,7 +46,7 @@ var getOriginalValue = function getOriginalValue(_ref) {
|
|
|
46
46
|
var keyValue = rowValue[rowKeyName]; // 获取表单中rowKey值
|
|
47
47
|
if (!keyValue) return undefined;
|
|
48
48
|
var originalValueList = (0, _lodash.get)(originalValues, originalName.slice(0, rowKeyPath.length - 2));
|
|
49
|
-
var originalValueRow = originalValueList.find(function (item) {
|
|
49
|
+
var originalValueRow = originalValueList === null || originalValueList === void 0 ? void 0 : originalValueList.find(function (item) {
|
|
50
50
|
return item[rowKeyPath[rowKeyPath.length - 1]] === keyValue;
|
|
51
51
|
});
|
|
52
52
|
var originalValue;
|
|
@@ -83,6 +83,9 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
83
83
|
rowKeyPath = props.rowKeyPath,
|
|
84
84
|
children = props.children,
|
|
85
85
|
type = props.type,
|
|
86
|
+
normalize = props.normalize,
|
|
87
|
+
_props$valuePropName = props.valuePropName,
|
|
88
|
+
valuePropName = _props$valuePropName === void 0 ? 'value' : _props$valuePropName,
|
|
86
89
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
87
90
|
var _ref2 = (0, _ProConfigProvider.useProConfig)('ProEditTable') || {},
|
|
88
91
|
isDiffAll = _ref2.isDiffAll;
|
|
@@ -101,14 +104,15 @@ var ListChangedWrapper = function ListChangedWrapper(props) {
|
|
|
101
104
|
var noChange = !equalWith && (!originalValues || isDiffAll ? false : (0, _utils.isEmpty)(originalValue));
|
|
102
105
|
var diffType = (0, _react.useMemo)(function () {
|
|
103
106
|
if (!isWatch || noChange) return 'same';
|
|
107
|
+
var _value = normalize ? normalize(props[valuePropName]) : props[valuePropName];
|
|
104
108
|
return (0, _diffOriginal.diffOriginal)({
|
|
105
|
-
value:
|
|
109
|
+
value: _value,
|
|
106
110
|
originalValue: originalValue,
|
|
107
111
|
form: form,
|
|
108
112
|
equalWith: equalWith
|
|
109
113
|
// name: isString(namesStr) ? namesStr : originalName || name,
|
|
110
114
|
});
|
|
111
|
-
}, [props
|
|
115
|
+
}, [props[valuePropName], originalValue]);
|
|
112
116
|
var isAdd = diffType === 'add';
|
|
113
117
|
var isChanged = diffType === 'changed';
|
|
114
118
|
if (!isWatch || noChange) {
|
|
@@ -223,10 +223,10 @@ var RenderField = function RenderField(_ref) {
|
|
|
223
223
|
var originalNames = names;
|
|
224
224
|
if (virtualKey) {
|
|
225
225
|
var _cellName$slice, _names2, _names2$map;
|
|
226
|
-
originalName = [].concat((0, _toConsumableArray2.default)(name), (0, _toConsumableArray2.default)(cellName === null || cellName === void 0 ? void 0 : (_cellName$slice = cellName.slice) === null || _cellName$slice === void 0 ? void 0 : _cellName$slice.call(cellName,
|
|
226
|
+
originalName = [].concat((0, _toConsumableArray2.default)(name), (0, _toConsumableArray2.default)(cellName === null || cellName === void 0 ? void 0 : (_cellName$slice = cellName.slice) === null || _cellName$slice === void 0 ? void 0 : _cellName$slice.call(cellName, name.length)));
|
|
227
227
|
originalNames = (_names2 = names) === null || _names2 === void 0 ? void 0 : (_names2$map = _names2.map) === null || _names2$map === void 0 ? void 0 : _names2$map.call(_names2, function (item) {
|
|
228
228
|
var _item$slice;
|
|
229
|
-
return [].concat((0, _toConsumableArray2.default)(name), (0, _toConsumableArray2.default)(item === null || item === void 0 ? void 0 : (_item$slice = item.slice) === null || _item$slice === void 0 ? void 0 : _item$slice.call(item,
|
|
229
|
+
return [].concat((0, _toConsumableArray2.default)(name), (0, _toConsumableArray2.default)(item === null || item === void 0 ? void 0 : (_item$slice = item.slice) === null || _item$slice === void 0 ? void 0 : _item$slice.call(item, name.length)));
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
/**
|
|
@@ -566,6 +566,8 @@ var RenderField = function RenderField(_ref) {
|
|
|
566
566
|
equalWith: equalWith,
|
|
567
567
|
type: type,
|
|
568
568
|
onChange: _onChange,
|
|
569
|
+
valuePropName: _formItemProps.valuePropName,
|
|
570
|
+
normalize: _formItemProps.normalize,
|
|
569
571
|
children: FieldComponent
|
|
570
572
|
});
|
|
571
573
|
}
|
|
@@ -34,11 +34,13 @@ var FormFooter = function FormFooter(props) {
|
|
|
34
34
|
var searchCache = (0, _react.useMemo)(function () {
|
|
35
35
|
var cacheStr = window.sessionStorage.getItem(PRO_FORM_CACHE);
|
|
36
36
|
var cache = JSON.parse(cacheStr || '{}');
|
|
37
|
-
if (formId && cache[formId]) {
|
|
38
|
-
form.setFieldsValue(cache[formId]);
|
|
39
|
-
}
|
|
40
37
|
return cache;
|
|
41
38
|
}, [formId]);
|
|
39
|
+
(0, _react.useEffect)(function () {
|
|
40
|
+
if (formId && searchCache[formId]) {
|
|
41
|
+
form.setFieldsValue(searchCache[formId]);
|
|
42
|
+
}
|
|
43
|
+
}, [formId]);
|
|
42
44
|
var _onOk = function _onOk() {
|
|
43
45
|
if (formId) {
|
|
44
46
|
var values = form.getFieldsValue();
|
|
@@ -290,10 +290,17 @@ var useTransformColumns = exports.useTransformColumns = function useTransformCol
|
|
|
290
290
|
option: args === null || args === void 0 ? void 0 : args[1]
|
|
291
291
|
});
|
|
292
292
|
};
|
|
293
|
+
// 内外一个为true则为true
|
|
294
|
+
var getLastDisabled = function getLastDisabled() {
|
|
295
|
+
if (Array.isArray(groupProps.disabled)) {
|
|
296
|
+
return reactiveProps.disabled || groupProps.disabled[index];
|
|
297
|
+
}
|
|
298
|
+
return reactiveProps.disabled || groupProps.disabled;
|
|
299
|
+
};
|
|
293
300
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, column), {}, {
|
|
294
301
|
name: columnName
|
|
295
302
|
}, reactiveProps), {}, {
|
|
296
|
-
disabled:
|
|
303
|
+
disabled: getLastDisabled(),
|
|
297
304
|
getValueProps: transform === null || transform === void 0 ? void 0 : transform.getValueProps,
|
|
298
305
|
fieldProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, column === null || column === void 0 ? void 0 : column.fieldProps), {}, {
|
|
299
306
|
onChange: handleChange,
|
|
@@ -96,8 +96,11 @@ var ProCascader = function ProCascader(props) {
|
|
|
96
96
|
enumDataSource = _ref5$ === void 0 ? [] : _ref5$;
|
|
97
97
|
var realDataSource = (0, _react.useMemo)(function () {
|
|
98
98
|
var innerDataSource = dataSource || (addressCode ? enumDataSource : []);
|
|
99
|
-
var result = isAddressMode && realLevel === 2 ? filterDataSource(innerDataSource, level, fieldNames) : innerDataSource;
|
|
100
|
-
|
|
99
|
+
var result = (0, _index.transformDataName)(isAddressMode && realLevel === 2 ? filterDataSource(innerDataSource, level, fieldNames) : innerDataSource, fieldNames);
|
|
100
|
+
if (transformResponse) {
|
|
101
|
+
return transformResponse(result);
|
|
102
|
+
}
|
|
103
|
+
return result;
|
|
101
104
|
}, [isAddressMode, addressCode, realLevel, dataSource, enumDataSource === null || enumDataSource === void 0 ? void 0 : enumDataSource.length]);
|
|
102
105
|
var _useRequest = (0, _objectSpread3.default)({}, useRequest),
|
|
103
106
|
service = _useRequest.service,
|
|
@@ -25,7 +25,7 @@ var _Container = _interopRequireDefault(require("../../Container"));
|
|
|
25
25
|
var _view = _interopRequireDefault(require("../../../../assets/view.svg"));
|
|
26
26
|
var _useRequestList3 = _interopRequireDefault(require("./hooks/useRequestList"));
|
|
27
27
|
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
28
|
-
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "isTooltip", "searchForm", "searchKey", "defaultOne"],
|
|
28
|
+
var _excluded = ["value", "onChange", "disabled", "labelInValue", "fieldNames", "readOnly", "addonAfter", "configOption", "title", "onFormat", "showCodeName", "optionRender", "customRender", "style", "className", "beforeOpen", "afterOpen", "isTooltip", "searchForm", "searchKey", "defaultOne"],
|
|
29
29
|
_excluded2 = ["onOk"],
|
|
30
30
|
_excluded3 = ["rowKey", "columns", "rowSelection"];
|
|
31
31
|
var ProModalSelect = function ProModalSelect(props, ref) {
|
|
@@ -48,6 +48,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
48
48
|
style = props.style,
|
|
49
49
|
className = props.className,
|
|
50
50
|
beforeOpen = props.beforeOpen,
|
|
51
|
+
afterOpen = props.afterOpen,
|
|
51
52
|
isTooltip = props.isTooltip,
|
|
52
53
|
searchForm = props.searchForm,
|
|
53
54
|
searchKey = props.searchKey,
|
|
@@ -267,6 +268,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
267
268
|
setState({
|
|
268
269
|
onOff: true
|
|
269
270
|
});
|
|
271
|
+
setTimeout(function () {
|
|
272
|
+
afterOpen === null || afterOpen === void 0 ? void 0 : afterOpen({
|
|
273
|
+
setInnerState: setState
|
|
274
|
+
});
|
|
275
|
+
}, 100);
|
|
270
276
|
}
|
|
271
277
|
case 14:
|
|
272
278
|
case "end":
|
|
@@ -17,11 +17,9 @@ var _utils = require("@zat-design/utils");
|
|
|
17
17
|
var _Container = _interopRequireDefault(require("../../Container"));
|
|
18
18
|
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
19
19
|
var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
|
|
20
|
-
var formatAmount = _utils.tools.formatAmount
|
|
21
|
-
formatPercent = _utils.tools.formatPercent,
|
|
22
|
-
formatPerMill = _utils.tools.formatPerMill;
|
|
20
|
+
var formatAmount = _utils.tools.formatAmount;
|
|
23
21
|
var ProNumberRange = function ProNumberRange(props) {
|
|
24
|
-
var _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
|
22
|
+
var _document$querySelect, _valueProps, _ref2, _ref3, _value$, _valueProps2, _ref4, _ref5, _value$2, _valueProps3, _valueProps4;
|
|
25
23
|
var _props$value = props.value,
|
|
26
24
|
value = _props$value === void 0 ? [] : _props$value,
|
|
27
25
|
_props$onChange = props.onChange,
|
|
@@ -46,6 +44,7 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
46
44
|
viewEmpty = _ref.viewEmpty,
|
|
47
45
|
valueType = _ref.valueType;
|
|
48
46
|
var isView = typeof props.isView === 'boolean' ? props.isView : isViewCon; // 组件可直接接收isView参数, 优先级高
|
|
47
|
+
var addonAfterDomWidth = (_document$querySelect = document.querySelector('.ant-input-number-group-addon')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.clientWidth;
|
|
49
48
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
50
49
|
range: value || []
|
|
51
50
|
}),
|
|
@@ -91,6 +90,7 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
91
90
|
};
|
|
92
91
|
var cls = (0, _classnames.default)({
|
|
93
92
|
'pro-number-range': true,
|
|
93
|
+
'pro-number-range-disabled': disabled,
|
|
94
94
|
className: className
|
|
95
95
|
});
|
|
96
96
|
// 查看模式
|
|
@@ -179,44 +179,51 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
179
179
|
}
|
|
180
180
|
return result;
|
|
181
181
|
};
|
|
182
|
-
return (0, _jsxRuntime.
|
|
183
|
-
compact: true,
|
|
182
|
+
return (0, _jsxRuntime.jsx)(_antd.Space, {
|
|
184
183
|
className: cls,
|
|
185
|
-
children:
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}),
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
184
|
+
children: (0, _jsxRuntime.jsxs)(_antd.Space.Compact, {
|
|
185
|
+
children: [(0, _jsxRuntime.jsx)(_antd.InputNumber, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
186
|
+
id: id,
|
|
187
|
+
className: "range-left",
|
|
188
|
+
value: (value === null || value === void 0 ? void 0 : value[0]) || range[0],
|
|
189
|
+
placeholder: "".concat(_locale.default.ProForm.inputPlaceholder),
|
|
190
|
+
precision: precision,
|
|
191
|
+
disabled: getDisabled(disabled, 0),
|
|
192
|
+
onChange: function onChange(e) {
|
|
193
|
+
firstHandleChange(e);
|
|
194
|
+
}
|
|
195
|
+
}, valueProps), {}, {
|
|
196
|
+
min: min !== null && min !== void 0 ? min : (_valueProps = valueProps) === null || _valueProps === void 0 ? void 0 : _valueProps.min,
|
|
197
|
+
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
|
|
198
|
+
}, childProps === null || childProps === void 0 ? void 0 : childProps[0])), addonBefore ? (0, _jsxRuntime.jsx)(_antd.Button, {
|
|
199
|
+
disabled: true,
|
|
200
|
+
className: "range-addon-before",
|
|
201
|
+
children: addonBefore
|
|
202
|
+
}) : null, (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
203
|
+
className: (0, _classnames.default)({
|
|
204
|
+
'range-split': true,
|
|
205
|
+
'range-split-disabled': !!disabled
|
|
206
|
+
}),
|
|
207
|
+
placeholder: "~",
|
|
208
|
+
disabled: true
|
|
209
|
+
}), (0, _jsxRuntime.jsx)(_antd.InputNumber, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
210
|
+
className: "range-right",
|
|
211
|
+
value: (value === null || value === void 0 ? void 0 : value[1]) || range[1],
|
|
212
|
+
placeholder: "".concat(_locale.default.ProForm.inputPlaceholder),
|
|
213
|
+
precision: precision,
|
|
214
|
+
disabled: getDisabled(disabled, 1),
|
|
215
|
+
onChange: function onChange(e) {
|
|
216
|
+
lastHandleChange(e);
|
|
217
|
+
}
|
|
218
|
+
}, valueProps), {}, {
|
|
219
|
+
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,
|
|
220
|
+
max: max !== null && max !== void 0 ? max : (_valueProps4 = valueProps) === null || _valueProps4 === void 0 ? void 0 : _valueProps4.max
|
|
221
|
+
}, childProps === null || childProps === void 0 ? void 0 : childProps[1])), addonAfter ? (0, _jsxRuntime.jsx)(_antd.Button, {
|
|
222
|
+
disabled: true,
|
|
223
|
+
className: "range-addon-after",
|
|
224
|
+
children: addonAfter
|
|
225
|
+
}) : null]
|
|
226
|
+
})
|
|
220
227
|
});
|
|
221
228
|
};
|
|
222
229
|
var _default = exports.default = ProNumberRange;
|