@zat-design/sisyphus-react 3.4.9-beta.3 → 3.4.9-beta.5
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/es/ProForm/components/render/RenderFields.js +4 -1
- package/es/ProSelect/index.js +2 -1
- package/es/ProSelect/utils/index.d.ts +2 -1
- package/es/ProSelect/utils/index.js +7 -4
- package/lib/ProForm/components/render/RenderFields.js +4 -1
- package/lib/ProSelect/index.js +2 -1
- package/lib/ProSelect/utils/index.d.ts +2 -1
- package/lib/ProSelect/utils/index.js +7 -4
- package/package.json +1 -1
|
@@ -109,9 +109,12 @@ var RenderFields = function RenderFields(props) {
|
|
|
109
109
|
if (typeof _type === 'string') {
|
|
110
110
|
TargetComponent = _isView && viewRender ? viewRenderHandle : componentMap[_type];
|
|
111
111
|
}
|
|
112
|
+
// 自定义组件时 防止默认值影像后续判断
|
|
113
|
+
if ('component' in column) {
|
|
114
|
+
_type = null;
|
|
115
|
+
}
|
|
112
116
|
if (component && /*#__PURE__*/React.isValidElement(component)) {
|
|
113
117
|
var _newComponent$props;
|
|
114
|
-
_type = null;
|
|
115
118
|
var newComponent = component;
|
|
116
119
|
var isProEditTable = (newComponent === null || newComponent === void 0 ? void 0 : (_newComponent$props = newComponent.props) === null || _newComponent$props === void 0 ? void 0 : _newComponent$props.onlyOneLineMsg) === '请先保存数据';
|
|
117
120
|
TargetComponent = _isView ? viewRenderHandle || '' : component;
|
package/es/ProSelect/index.js
CHANGED
|
@@ -274,7 +274,8 @@ export var ProSelect = function ProSelect(props, ref) {
|
|
|
274
274
|
otherProps: otherProps,
|
|
275
275
|
value: props.value,
|
|
276
276
|
dataSource: selectList,
|
|
277
|
-
labelInValue: labelInValue
|
|
277
|
+
labelInValue: labelInValue,
|
|
278
|
+
fieldNames: fieldNames
|
|
278
279
|
});
|
|
279
280
|
}
|
|
280
281
|
return _jsx(_Select, _objectSpread(_objectSpread({
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 返回当前组件可以显示的数据源
|
|
3
3
|
*/
|
|
4
|
-
export declare const getSelectList: ({ otherProps, value, dataSource, labelInValue, }: {
|
|
4
|
+
export declare const getSelectList: ({ otherProps, value, dataSource, labelInValue, fieldNames, }: {
|
|
5
5
|
otherProps: any;
|
|
6
6
|
value: any;
|
|
7
7
|
dataSource: any;
|
|
8
8
|
labelInValue: any;
|
|
9
|
+
fieldNames: any;
|
|
9
10
|
}) => any;
|
|
@@ -6,7 +6,8 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
|
|
|
6
6
|
selectName = _ref.selectName,
|
|
7
7
|
value = _ref.value,
|
|
8
8
|
dataSource = _ref.dataSource,
|
|
9
|
-
labelInValue = _ref.labelInValue
|
|
9
|
+
labelInValue = _ref.labelInValue,
|
|
10
|
+
fieldNames = _ref.fieldNames;
|
|
10
11
|
var selectValues = [];
|
|
11
12
|
list.forEach(function (item) {
|
|
12
13
|
var result = item;
|
|
@@ -29,7 +30,7 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
|
|
|
29
30
|
});
|
|
30
31
|
var diffList = _.difference(selectValues, [value]);
|
|
31
32
|
return dataSource.filter(function (item) {
|
|
32
|
-
return !diffList.includes(labelInValue ? item : item.value);
|
|
33
|
+
return !diffList.includes(labelInValue ? item : item[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] || (item === null || item === void 0 ? void 0 : item.value));
|
|
33
34
|
});
|
|
34
35
|
};
|
|
35
36
|
/**
|
|
@@ -39,7 +40,8 @@ export var getSelectList = function getSelectList(_ref2) {
|
|
|
39
40
|
var otherProps = _ref2.otherProps,
|
|
40
41
|
value = _ref2.value,
|
|
41
42
|
dataSource = _ref2.dataSource,
|
|
42
|
-
labelInValue = _ref2.labelInValue
|
|
43
|
+
labelInValue = _ref2.labelInValue,
|
|
44
|
+
fieldNames = _ref2.fieldNames;
|
|
43
45
|
if (!otherProps) {
|
|
44
46
|
return null;
|
|
45
47
|
}
|
|
@@ -55,6 +57,7 @@ export var getSelectList = function getSelectList(_ref2) {
|
|
|
55
57
|
selectName: selectName,
|
|
56
58
|
value: value,
|
|
57
59
|
dataSource: dataSource,
|
|
58
|
-
labelInValue: labelInValue
|
|
60
|
+
labelInValue: labelInValue,
|
|
61
|
+
fieldNames: fieldNames
|
|
59
62
|
});
|
|
60
63
|
};
|
|
@@ -117,9 +117,12 @@ var RenderFields = function RenderFields(props) {
|
|
|
117
117
|
if (typeof _type === 'string') {
|
|
118
118
|
TargetComponent = _isView && viewRender ? viewRenderHandle : componentMap[_type];
|
|
119
119
|
}
|
|
120
|
+
// 自定义组件时 防止默认值影像后续判断
|
|
121
|
+
if ('component' in column) {
|
|
122
|
+
_type = null;
|
|
123
|
+
}
|
|
120
124
|
if (component && /*#__PURE__*/_react.default.isValidElement(component)) {
|
|
121
125
|
var _newComponent$props;
|
|
122
|
-
_type = null;
|
|
123
126
|
var newComponent = component;
|
|
124
127
|
var isProEditTable = (newComponent === null || newComponent === void 0 ? void 0 : (_newComponent$props = newComponent.props) === null || _newComponent$props === void 0 ? void 0 : _newComponent$props.onlyOneLineMsg) === '请先保存数据';
|
|
125
128
|
TargetComponent = _isView ? viewRenderHandle || '' : component;
|
package/lib/ProSelect/index.js
CHANGED
|
@@ -275,7 +275,8 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
|
275
275
|
otherProps: otherProps,
|
|
276
276
|
value: props.value,
|
|
277
277
|
dataSource: selectList,
|
|
278
|
-
labelInValue: labelInValue
|
|
278
|
+
labelInValue: labelInValue,
|
|
279
|
+
fieldNames: fieldNames
|
|
279
280
|
});
|
|
280
281
|
}
|
|
281
282
|
return (0, _jsxRuntime.jsx)(_antd.Select, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 返回当前组件可以显示的数据源
|
|
3
3
|
*/
|
|
4
|
-
export declare const getSelectList: ({ otherProps, value, dataSource, labelInValue, }: {
|
|
4
|
+
export declare const getSelectList: ({ otherProps, value, dataSource, labelInValue, fieldNames, }: {
|
|
5
5
|
otherProps: any;
|
|
6
6
|
value: any;
|
|
7
7
|
dataSource: any;
|
|
8
8
|
labelInValue: any;
|
|
9
|
+
fieldNames: any;
|
|
9
10
|
}) => any;
|
|
@@ -14,7 +14,8 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
|
|
|
14
14
|
selectName = _ref.selectName,
|
|
15
15
|
value = _ref.value,
|
|
16
16
|
dataSource = _ref.dataSource,
|
|
17
|
-
labelInValue = _ref.labelInValue
|
|
17
|
+
labelInValue = _ref.labelInValue,
|
|
18
|
+
fieldNames = _ref.fieldNames;
|
|
18
19
|
var selectValues = [];
|
|
19
20
|
list.forEach(function (item) {
|
|
20
21
|
var result = item;
|
|
@@ -37,7 +38,7 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
|
|
|
37
38
|
});
|
|
38
39
|
var diffList = _lodash.default.difference(selectValues, [value]);
|
|
39
40
|
return dataSource.filter(function (item) {
|
|
40
|
-
return !diffList.includes(labelInValue ? item : item.value);
|
|
41
|
+
return !diffList.includes(labelInValue ? item : item[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] || (item === null || item === void 0 ? void 0 : item.value));
|
|
41
42
|
});
|
|
42
43
|
};
|
|
43
44
|
/**
|
|
@@ -47,7 +48,8 @@ var getSelectList = exports.getSelectList = function getSelectList(_ref2) {
|
|
|
47
48
|
var otherProps = _ref2.otherProps,
|
|
48
49
|
value = _ref2.value,
|
|
49
50
|
dataSource = _ref2.dataSource,
|
|
50
|
-
labelInValue = _ref2.labelInValue
|
|
51
|
+
labelInValue = _ref2.labelInValue,
|
|
52
|
+
fieldNames = _ref2.fieldNames;
|
|
51
53
|
if (!otherProps) {
|
|
52
54
|
return null;
|
|
53
55
|
}
|
|
@@ -63,6 +65,7 @@ var getSelectList = exports.getSelectList = function getSelectList(_ref2) {
|
|
|
63
65
|
selectName: selectName,
|
|
64
66
|
value: value,
|
|
65
67
|
dataSource: dataSource,
|
|
66
|
-
labelInValue: labelInValue
|
|
68
|
+
labelInValue: labelInValue,
|
|
69
|
+
fieldNames: fieldNames
|
|
67
70
|
});
|
|
68
71
|
};
|