fan-standard-comp 4.0.8 → 4.0.9
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/fan-standard-comp.min.css +1 -1
- package/dist/fan-standard-comp.min.js +1 -1
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +24 -5
- package/es/FormComp/FieldComponent/index.d.ts +1 -1
- package/es/FormComp/FieldComponent/index.js +9 -11
- package/es/FormComp/FieldComponent/style/TreeSelect.js +2 -1
- package/es/FormComp/FieldComponent/style/index.less +1 -1
- package/es/FormComp/RenderItemGroup/index.js +4 -4
- package/es/StandardContent/ContentHeader.d.ts +2 -0
- package/es/StandardContent/ContentHeader.js +26 -4
- package/es/StandardContent/styles/Header.js +8 -0
- package/es/StandardForm/index.js +9 -4
- package/es/StandardForm/style/index.js +5 -0
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +24 -5
- package/lib/FormComp/FieldComponent/index.d.ts +1 -1
- package/lib/FormComp/FieldComponent/index.js +9 -11
- package/lib/FormComp/FieldComponent/style/TreeSelect.js +2 -1
- package/lib/FormComp/FieldComponent/style/index.less +1 -1
- package/lib/FormComp/RenderItemGroup/index.js +4 -4
- package/lib/StandardContent/ContentHeader.d.ts +2 -0
- package/lib/StandardContent/ContentHeader.js +25 -3
- package/lib/StandardContent/styles/Header.js +8 -0
- package/lib/StandardForm/index.js +9 -4
- package/lib/StandardForm/style/index.js +5 -0
- package/package.json +1 -1
|
@@ -54,6 +54,10 @@ var RefactorTreeSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
54
54
|
_useState2 = _slicedToArray(_useState, 2),
|
|
55
55
|
fullLevelName = _useState2[0],
|
|
56
56
|
setFullLevelName = _useState2[1];
|
|
57
|
+
var _useState3 = useState({}),
|
|
58
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
59
|
+
fullLevelStyle = _useState4[0],
|
|
60
|
+
setFullLevelStyle = _useState4[1];
|
|
57
61
|
var renderTreeNode = function renderTreeNode(data, dataOptionName) {
|
|
58
62
|
var nodeProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
59
63
|
return data.map(function (dataItem) {
|
|
@@ -151,13 +155,27 @@ var RefactorTreeSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
151
155
|
});
|
|
152
156
|
setFullLevelName(renderParenName(newNodeInfo));
|
|
153
157
|
if (_onSelect) _onSelect(value, _objectSpread(_objectSpread({}, node), newNodeInfo.matchNode[0]), extra, newNodeInfo.nodeParent);
|
|
158
|
+
},
|
|
159
|
+
onDropdownVisibleChange: function onDropdownVisibleChange(open) {
|
|
160
|
+
var _otherProps$onDropdow;
|
|
161
|
+
setFullLevelStyle({
|
|
162
|
+
opacity: open ? 0.3 : ''
|
|
163
|
+
});
|
|
164
|
+
otherProps === null || otherProps === void 0 || (_otherProps$onDropdow = otherProps.onDropdownVisibleChange) === null || _otherProps$onDropdow === void 0 || _otherProps$onDropdow.call(otherProps, open);
|
|
165
|
+
},
|
|
166
|
+
onSearch: function onSearch(value) {
|
|
167
|
+
var _otherProps$onSearch;
|
|
168
|
+
setFullLevelStyle({
|
|
169
|
+
opacity: value ? 0 : ''
|
|
170
|
+
});
|
|
171
|
+
otherProps === null || otherProps === void 0 || (_otherProps$onSearch = otherProps.onSearch) === null || _otherProps$onSearch === void 0 || _otherProps$onSearch.call(otherProps, value);
|
|
154
172
|
}
|
|
155
173
|
}), renderTreeNode(treeData, treeOptionName, protoTreeNode || {}));
|
|
156
174
|
};
|
|
157
|
-
var
|
|
158
|
-
|
|
159
|
-
showAllPath =
|
|
160
|
-
setShowAllPath =
|
|
175
|
+
var _useState5 = useState(false),
|
|
176
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
177
|
+
showAllPath = _useState6[0],
|
|
178
|
+
setShowAllPath = _useState6[1]; // 显示所有树选择路径
|
|
161
179
|
var renderTreeSelectNodePath = function renderTreeSelectNodePath() {
|
|
162
180
|
//获取节点路径
|
|
163
181
|
var pathNodes = getNodePaths(treeData, value, {
|
|
@@ -216,7 +234,8 @@ var RefactorTreeSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
216
234
|
className: "".concat(componentName, " ").concat(hashId, " ").concat(disabled ? 'refactor-disabled' : '').concat(otherProps.size === 'small' ? ' refactor-tree-select-sm' : ''),
|
|
217
235
|
title: fullLevelName || ''
|
|
218
236
|
}, renderTreeSelectNode(), /*#__PURE__*/React.createElement("span", {
|
|
219
|
-
className: "refactor-tree-select-extra"
|
|
237
|
+
className: "refactor-tree-select-extra",
|
|
238
|
+
style: fullLevelStyle
|
|
220
239
|
}, fullLevelName)) : renderTreeSelectNode()));
|
|
221
240
|
});
|
|
222
241
|
export default RefactorTreeSelect;
|
|
@@ -25,7 +25,7 @@ export interface FieldComponentProps {
|
|
|
25
25
|
size?: 'large' | 'middle' | 'small' | string;
|
|
26
26
|
showFullLevel?: boolean;
|
|
27
27
|
separator?: string;
|
|
28
|
-
selectOptionRender?: (data: any) => void;
|
|
28
|
+
selectOptionRender?: (data: any, info?: any) => void;
|
|
29
29
|
style?: React.CSSProperties;
|
|
30
30
|
render?: (props?: any) => React.ReactNode | string;
|
|
31
31
|
disabledFields?: {
|
|
@@ -144,23 +144,21 @@ var FieldComponent = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
144
144
|
allowClear: true,
|
|
145
145
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || "".concat(defaultProps.showSearch ? '请输入选择' : '请选择'),
|
|
146
146
|
filterOption: function filterOption(inputValue, option) {
|
|
147
|
-
|
|
147
|
+
var _defaultProps$fieldNa;
|
|
148
|
+
return defaultProps.showSearch ? ((option === null || option === void 0 ? void 0 : option[(defaultProps === null || defaultProps === void 0 || (_defaultProps$fieldNa = defaultProps.fieldNames) === null || _defaultProps$fieldNa === void 0 ? void 0 : _defaultProps$fieldNa.label) || (selectOptionName === null || selectOptionName === void 0 ? void 0 : selectOptionName.label) || 'label']) || '').toLowerCase().includes(inputValue.toLowerCase()) : false;
|
|
148
149
|
},
|
|
149
|
-
value: value
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
value: value,
|
|
151
|
+
fieldNames: (defaultProps === null || defaultProps === void 0 ? void 0 : defaultProps.fieldNames) || selectOptionName,
|
|
152
|
+
options: selectOptions,
|
|
153
|
+
optionRender: function optionRender(option, info) {
|
|
154
|
+
var _defaultProps$optionR;
|
|
155
|
+
return (defaultProps === null || defaultProps === void 0 || (_defaultProps$optionR = defaultProps.optionRender) === null || _defaultProps$optionR === void 0 ? void 0 : _defaultProps$optionR.call(defaultProps, option, info)) || (selectOptionRender === null || selectOptionRender === void 0 ? void 0 : selectOptionRender(option, info)) || option.label;
|
|
156
|
+
}
|
|
152
157
|
}, defaultProps, {
|
|
153
158
|
// onChange返回参数:累加当前选中包括其他字段值的数据
|
|
154
159
|
onChange: function onChange(value, Option) {
|
|
155
160
|
return _onChange && _onChange(value, resetResultOption(Option));
|
|
156
161
|
} // 数据为对象
|
|
157
|
-
}), defaultProps !== null && defaultProps !== void 0 && defaultProps.fieldNames ? null : (selectOptions || []).map(function (val, index) {
|
|
158
|
-
return /*#__PURE__*/React.createElement(Option, {
|
|
159
|
-
value: val.value,
|
|
160
|
-
key: val.value || index,
|
|
161
|
-
title: selectOptionRender ? selectOptionRender(val) : val.title || val.label,
|
|
162
|
-
disabled: val.disabled
|
|
163
|
-
}, selectOptionRender ? selectOptionRender(val) : val.label);
|
|
164
162
|
}));
|
|
165
163
|
break;
|
|
166
164
|
case 'tree-select':
|
|
@@ -19,7 +19,8 @@ var RefactorTreeSelectStyleFunc = function RefactorTreeSelectStyleFunc(prefix) {
|
|
|
19
19
|
},
|
|
20
20
|
'.refactor-tree-select-extra': {
|
|
21
21
|
background: token.colorBgContainer,
|
|
22
|
-
height: token.controlHeight
|
|
22
|
+
height: token.controlHeight,
|
|
23
|
+
padding: "1px 22px 1px ".concat(token.paddingXS + 3, "px")
|
|
23
24
|
}
|
|
24
25
|
}), '.tree-select-viewonly-list', {
|
|
25
26
|
border: "1px solid ".concat(new TinyColor(token.colorSplit).setAlpha(0.6).toRgbString()),
|
|
@@ -201,11 +201,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
201
201
|
customRender = item.customRender,
|
|
202
202
|
filedName = item.filedName; // 当前可传参的配置值
|
|
203
203
|
if (layout === "horizontal" || layout === "vertical") {
|
|
204
|
-
return /*#__PURE__*/React.createElement(Col, {
|
|
204
|
+
return /*#__PURE__*/React.createElement(Col, _extends({
|
|
205
205
|
key: index,
|
|
206
206
|
span: item.colSpan || setColSpan(item.display, size, columnCount),
|
|
207
207
|
style: item.style
|
|
208
|
-
}, /*#__PURE__*/React.createElement(FormItem, _extends({
|
|
208
|
+
}, item.protoCol), /*#__PURE__*/React.createElement(FormItem, _extends({
|
|
209
209
|
name: type !== 'custom' && filedName,
|
|
210
210
|
className: classNames(fieldStatus === 'viewOnly' ? 'form-item-view-only' : '', 'spec-item-group-form-item'),
|
|
211
211
|
label: description ? /*#__PURE__*/React.createElement("span", null, label, /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -251,10 +251,10 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
251
251
|
}, function (FormInstance) {
|
|
252
252
|
var _item$protoConfig;
|
|
253
253
|
// isHide 返回为true则隐藏当前控件
|
|
254
|
-
return !itemIsHide(isHide, FormInstance.getFieldValue(), FormInstance) ? /*#__PURE__*/React.createElement(Col, {
|
|
254
|
+
return !itemIsHide(isHide, FormInstance.getFieldValue(), FormInstance) ? /*#__PURE__*/React.createElement(Col, _extends({
|
|
255
255
|
span: item.colSpan || 24,
|
|
256
256
|
style: item.style
|
|
257
|
-
}, type === 'title' ? /*#__PURE__*/React.createElement("h3", _extends({}, item.protoConfig, {
|
|
257
|
+
}, item.protoCol), type === 'title' ? /*#__PURE__*/React.createElement("h3", _extends({}, item.protoConfig, {
|
|
258
258
|
className: "modalPanelTitle ".concat((item === null || item === void 0 || (_item$protoConfig = item.protoConfig) === null || _item$protoConfig === void 0 ? void 0 : _item$protoConfig.className) || '')
|
|
259
259
|
}), label) : label) : /*#__PURE__*/React.createElement(React.Fragment, null, null);
|
|
260
260
|
});
|
|
@@ -3,7 +3,9 @@ export interface ContentHeaderProps {
|
|
|
3
3
|
title?: string | React.ReactNode;
|
|
4
4
|
breadcrumb?: object | any;
|
|
5
5
|
componentName?: string;
|
|
6
|
+
prefix?: React.ReactNode;
|
|
6
7
|
extra?: React.ReactNode;
|
|
8
|
+
goBack?: (breadcrumbItems?: any, breadcrumb?: any) => void;
|
|
7
9
|
fixed?: Boolean;
|
|
8
10
|
[key: string]: any;
|
|
9
11
|
}
|
|
@@ -11,9 +11,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import React, { forwardRef, useImperativeHandle, useRef, useEffect, useState } from 'react';
|
|
14
|
-
import { Breadcrumb } from "antd";
|
|
14
|
+
import { Breadcrumb, Button } from "antd";
|
|
15
15
|
import classNames from 'classnames';
|
|
16
16
|
import useStyle from "./styles/Header";
|
|
17
|
+
import SpecIcon from "../SpecIcon/index";
|
|
17
18
|
var Child = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
18
19
|
var _useState = useState(0),
|
|
19
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -34,7 +35,9 @@ var ContentHeader = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
34
35
|
className = props.className,
|
|
35
36
|
title = props.title,
|
|
36
37
|
getClientHeight = props.getClientHeight,
|
|
37
|
-
extra = props.extra
|
|
38
|
+
extra = props.extra,
|
|
39
|
+
prefix = props.prefix,
|
|
40
|
+
goBack = props.goBack;
|
|
38
41
|
var componentName = 'spec-content-header';
|
|
39
42
|
var _useStyle = useStyle(componentName),
|
|
40
43
|
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
@@ -49,6 +52,11 @@ var ContentHeader = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
49
52
|
clientHeight = _useState6[0],
|
|
50
53
|
setClientHeight = _useState6[1];
|
|
51
54
|
var headerRef = useRef(null);
|
|
55
|
+
var handleGoBack = function handleGoBack() {
|
|
56
|
+
if (goBack) {
|
|
57
|
+
goBack(breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.items, breadcrumb);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
52
60
|
useEffect(function () {
|
|
53
61
|
if (title || breadcrumb) {
|
|
54
62
|
setVisible(true);
|
|
@@ -90,9 +98,23 @@ var ContentHeader = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
90
98
|
ref: headerRef
|
|
91
99
|
}, breadcrumb && breadcrumb !== null && breadcrumb !== void 0 && (_breadcrumb$items = breadcrumb.items) !== null && _breadcrumb$items !== void 0 && _breadcrumb$items.length ? /*#__PURE__*/React.createElement("div", {
|
|
92
100
|
className: componentName + '-breadcrumb'
|
|
93
|
-
}, /*#__PURE__*/React.createElement(Breadcrumb, breadcrumb || {})) : null, title || extra ? /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
}, /*#__PURE__*/React.createElement(Breadcrumb, breadcrumb || {})) : null, title || extra || prefix || goBack ? /*#__PURE__*/React.createElement("div", {
|
|
94
102
|
className: componentName + '-title'
|
|
95
|
-
},
|
|
103
|
+
}, goBack && /*#__PURE__*/React.createElement("div", {
|
|
104
|
+
className: componentName + '-title-goBack',
|
|
105
|
+
onClick: function onClick() {
|
|
106
|
+
return handleGoBack();
|
|
107
|
+
}
|
|
108
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
109
|
+
size: 'small',
|
|
110
|
+
type: 'default',
|
|
111
|
+
icon: /*#__PURE__*/React.createElement(SpecIcon, {
|
|
112
|
+
noPrefix: true,
|
|
113
|
+
name: 'speci-redo'
|
|
114
|
+
})
|
|
115
|
+
})), prefix && /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
className: componentName + '-title-prefix'
|
|
117
|
+
}, " ", prefix), title && /*#__PURE__*/React.createElement("div", {
|
|
96
118
|
className: componentName + '-title-name'
|
|
97
119
|
}, " ", title), extra && /*#__PURE__*/React.createElement("div", {
|
|
98
120
|
className: componentName + '-title-extra'
|
|
@@ -31,6 +31,14 @@ var SubfieldContentStyleFunc = function SubfieldContentStyleFunc(prefix) {
|
|
|
31
31
|
display: 'flex',
|
|
32
32
|
alignItems: 'center'
|
|
33
33
|
},
|
|
34
|
+
'.spec-content-header-title-goBack + .spec-content-header-title-prefix ': {
|
|
35
|
+
marginLeft: token.marginXS
|
|
36
|
+
},
|
|
37
|
+
'.spec-content-header-title-prefix, .spec-content-header-title-goBack': {
|
|
38
|
+
'& + .spec-content-header-title-name': {
|
|
39
|
+
marginLeft: token.marginXS
|
|
40
|
+
}
|
|
41
|
+
},
|
|
34
42
|
'.spec-content-header-title-name': {
|
|
35
43
|
fontSize: token.fontSizeLG,
|
|
36
44
|
fontWeight: 'bold',
|
package/es/StandardForm/index.js
CHANGED
|
@@ -137,6 +137,9 @@ var StandardForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
137
137
|
};
|
|
138
138
|
if (Array.isArray(actionGroup) && actionGroup.length === 0) return null;
|
|
139
139
|
if (actionGroup) return groupNode();
|
|
140
|
+
if (fieldStatus === 'disabled' || fieldStatus === 'viewOnly') {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
140
143
|
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
141
144
|
className: "standardForm-actions",
|
|
142
145
|
style: {
|
|
@@ -167,12 +170,14 @@ var StandardForm = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
167
170
|
}), prefix, children, /*#__PURE__*/React.createElement(React.Fragment, null, formItemGroup.length > 0 ? /*#__PURE__*/React.createElement(RenderItemGroup, _extends({
|
|
168
171
|
itemGroup: formItemGroup,
|
|
169
172
|
fieldSize: fieldSize,
|
|
170
|
-
displayLayout: displayLayout
|
|
171
|
-
|
|
172
|
-
|
|
173
|
+
displayLayout: displayLayout,
|
|
174
|
+
doUpdateFormFields: function doUpdateFormFields() {
|
|
175
|
+
return forceUpdateForm();
|
|
176
|
+
},
|
|
173
177
|
size: gridSize,
|
|
174
178
|
layout: layout,
|
|
175
|
-
fieldStatus: fieldStatus
|
|
179
|
+
fieldStatus: fieldStatus,
|
|
180
|
+
form: initForm
|
|
176
181
|
}, itemGroupConfig)) : null, renderActionGroup()), postfix));
|
|
177
182
|
});
|
|
178
183
|
export default StandardForm;
|
|
@@ -39,6 +39,11 @@ var StandardFormStyleFunc = function StandardFormStyleFunc(prefix) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
}), '.spec-standard-form', {
|
|
42
|
+
'&.standard-form-vertical': {
|
|
43
|
+
'.standardForm-actions': {
|
|
44
|
+
marginTop: "".concat(token.margin, "px")
|
|
45
|
+
}
|
|
46
|
+
},
|
|
42
47
|
'.stepForm-content': {
|
|
43
48
|
margin: "".concat(token.margin, "px 0px"),
|
|
44
49
|
'&.stepForm-content-vertical': {
|
|
@@ -63,6 +63,10 @@ var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props,
|
|
|
63
63
|
_useState2 = _slicedToArray(_useState, 2),
|
|
64
64
|
fullLevelName = _useState2[0],
|
|
65
65
|
setFullLevelName = _useState2[1];
|
|
66
|
+
var _useState3 = (0, _react.useState)({}),
|
|
67
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
68
|
+
fullLevelStyle = _useState4[0],
|
|
69
|
+
setFullLevelStyle = _useState4[1];
|
|
66
70
|
var renderTreeNode = function renderTreeNode(data, dataOptionName) {
|
|
67
71
|
var nodeProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
68
72
|
return data.map(function (dataItem) {
|
|
@@ -160,13 +164,27 @@ var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props,
|
|
|
160
164
|
});
|
|
161
165
|
setFullLevelName(renderParenName(newNodeInfo));
|
|
162
166
|
if (_onSelect) _onSelect(value, _objectSpread(_objectSpread({}, node), newNodeInfo.matchNode[0]), extra, newNodeInfo.nodeParent);
|
|
167
|
+
},
|
|
168
|
+
onDropdownVisibleChange: function onDropdownVisibleChange(open) {
|
|
169
|
+
var _otherProps$onDropdow;
|
|
170
|
+
setFullLevelStyle({
|
|
171
|
+
opacity: open ? 0.3 : ''
|
|
172
|
+
});
|
|
173
|
+
otherProps === null || otherProps === void 0 || (_otherProps$onDropdow = otherProps.onDropdownVisibleChange) === null || _otherProps$onDropdow === void 0 || _otherProps$onDropdow.call(otherProps, open);
|
|
174
|
+
},
|
|
175
|
+
onSearch: function onSearch(value) {
|
|
176
|
+
var _otherProps$onSearch;
|
|
177
|
+
setFullLevelStyle({
|
|
178
|
+
opacity: value ? 0 : ''
|
|
179
|
+
});
|
|
180
|
+
otherProps === null || otherProps === void 0 || (_otherProps$onSearch = otherProps.onSearch) === null || _otherProps$onSearch === void 0 || _otherProps$onSearch.call(otherProps, value);
|
|
163
181
|
}
|
|
164
182
|
}), renderTreeNode(treeData, treeOptionName, protoTreeNode || {}));
|
|
165
183
|
};
|
|
166
|
-
var
|
|
167
|
-
|
|
168
|
-
showAllPath =
|
|
169
|
-
setShowAllPath =
|
|
184
|
+
var _useState5 = (0, _react.useState)(false),
|
|
185
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
186
|
+
showAllPath = _useState6[0],
|
|
187
|
+
setShowAllPath = _useState6[1]; // 显示所有树选择路径
|
|
170
188
|
var renderTreeSelectNodePath = function renderTreeSelectNodePath() {
|
|
171
189
|
//获取节点路径
|
|
172
190
|
var pathNodes = (0, _utils.getNodePaths)(treeData, value, {
|
|
@@ -225,7 +243,8 @@ var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props,
|
|
|
225
243
|
className: "".concat(componentName, " ").concat(hashId, " ").concat(disabled ? 'refactor-disabled' : '').concat(otherProps.size === 'small' ? ' refactor-tree-select-sm' : ''),
|
|
226
244
|
title: fullLevelName || ''
|
|
227
245
|
}, renderTreeSelectNode(), /*#__PURE__*/_react.default.createElement("span", {
|
|
228
|
-
className: "refactor-tree-select-extra"
|
|
246
|
+
className: "refactor-tree-select-extra",
|
|
247
|
+
style: fullLevelStyle
|
|
229
248
|
}, fullLevelName)) : renderTreeSelectNode()));
|
|
230
249
|
});
|
|
231
250
|
var _default = exports.default = RefactorTreeSelect;
|
|
@@ -25,7 +25,7 @@ export interface FieldComponentProps {
|
|
|
25
25
|
size?: 'large' | 'middle' | 'small' | string;
|
|
26
26
|
showFullLevel?: boolean;
|
|
27
27
|
separator?: string;
|
|
28
|
-
selectOptionRender?: (data: any) => void;
|
|
28
|
+
selectOptionRender?: (data: any, info?: any) => void;
|
|
29
29
|
style?: React.CSSProperties;
|
|
30
30
|
render?: (props?: any) => React.ReactNode | string;
|
|
31
31
|
disabledFields?: {
|
|
@@ -149,23 +149,21 @@ var FieldComponent = /*#__PURE__*/_react.default.forwardRef(function (props, ref
|
|
|
149
149
|
allowClear: true,
|
|
150
150
|
placeholder: fieldStatus === 'disabled' || defaultProps.disabled ? '' : defaultProps.placeholder || placeholder || "".concat(defaultProps.showSearch ? '请输入选择' : '请选择'),
|
|
151
151
|
filterOption: function filterOption(inputValue, option) {
|
|
152
|
-
|
|
152
|
+
var _defaultProps$fieldNa;
|
|
153
|
+
return defaultProps.showSearch ? ((option === null || option === void 0 ? void 0 : option[(defaultProps === null || defaultProps === void 0 || (_defaultProps$fieldNa = defaultProps.fieldNames) === null || _defaultProps$fieldNa === void 0 ? void 0 : _defaultProps$fieldNa.label) || (selectOptionName === null || selectOptionName === void 0 ? void 0 : selectOptionName.label) || 'label']) || '').toLowerCase().includes(inputValue.toLowerCase()) : false;
|
|
153
154
|
},
|
|
154
|
-
value: value
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
value: value,
|
|
156
|
+
fieldNames: (defaultProps === null || defaultProps === void 0 ? void 0 : defaultProps.fieldNames) || selectOptionName,
|
|
157
|
+
options: selectOptions,
|
|
158
|
+
optionRender: function optionRender(option, info) {
|
|
159
|
+
var _defaultProps$optionR;
|
|
160
|
+
return (defaultProps === null || defaultProps === void 0 || (_defaultProps$optionR = defaultProps.optionRender) === null || _defaultProps$optionR === void 0 ? void 0 : _defaultProps$optionR.call(defaultProps, option, info)) || (selectOptionRender === null || selectOptionRender === void 0 ? void 0 : selectOptionRender(option, info)) || option.label;
|
|
161
|
+
}
|
|
157
162
|
}, defaultProps, {
|
|
158
163
|
// onChange返回参数:累加当前选中包括其他字段值的数据
|
|
159
164
|
onChange: function onChange(value, Option) {
|
|
160
165
|
return _onChange && _onChange(value, resetResultOption(Option));
|
|
161
166
|
} // 数据为对象
|
|
162
|
-
}), defaultProps !== null && defaultProps !== void 0 && defaultProps.fieldNames ? null : (selectOptions || []).map(function (val, index) {
|
|
163
|
-
return /*#__PURE__*/_react.default.createElement(Option, {
|
|
164
|
-
value: val.value,
|
|
165
|
-
key: val.value || index,
|
|
166
|
-
title: selectOptionRender ? selectOptionRender(val) : val.title || val.label,
|
|
167
|
-
disabled: val.disabled
|
|
168
|
-
}, selectOptionRender ? selectOptionRender(val) : val.label);
|
|
169
167
|
}));
|
|
170
168
|
break;
|
|
171
169
|
case 'tree-select':
|
|
@@ -25,7 +25,8 @@ var RefactorTreeSelectStyleFunc = function RefactorTreeSelectStyleFunc(prefix) {
|
|
|
25
25
|
},
|
|
26
26
|
'.refactor-tree-select-extra': {
|
|
27
27
|
background: token.colorBgContainer,
|
|
28
|
-
height: token.controlHeight
|
|
28
|
+
height: token.controlHeight,
|
|
29
|
+
padding: "1px 22px 1px ".concat(token.paddingXS + 3, "px")
|
|
29
30
|
}
|
|
30
31
|
}), '.tree-select-viewonly-list', {
|
|
31
32
|
border: "1px solid ".concat(new _tinycolor.TinyColor(token.colorSplit).setAlpha(0.6).toRgbString()),
|
|
@@ -209,11 +209,11 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
209
209
|
customRender = item.customRender,
|
|
210
210
|
filedName = item.filedName; // 当前可传参的配置值
|
|
211
211
|
if (layout === "horizontal" || layout === "vertical") {
|
|
212
|
-
return /*#__PURE__*/_react.default.createElement(_antd.Col, {
|
|
212
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Col, _extends({
|
|
213
213
|
key: index,
|
|
214
214
|
span: item.colSpan || setColSpan(item.display, size, columnCount),
|
|
215
215
|
style: item.style
|
|
216
|
-
}, /*#__PURE__*/_react.default.createElement(FormItem, _extends({
|
|
216
|
+
}, item.protoCol), /*#__PURE__*/_react.default.createElement(FormItem, _extends({
|
|
217
217
|
name: type !== 'custom' && filedName,
|
|
218
218
|
className: (0, _classnames.default)(fieldStatus === 'viewOnly' ? 'form-item-view-only' : '', 'spec-item-group-form-item'),
|
|
219
219
|
label: description ? /*#__PURE__*/_react.default.createElement("span", null, label, /*#__PURE__*/_react.default.createElement(_antd.Tooltip, {
|
|
@@ -259,10 +259,10 @@ var RenderItemGroup = function RenderItemGroup(props) {
|
|
|
259
259
|
}, function (FormInstance) {
|
|
260
260
|
var _item$protoConfig;
|
|
261
261
|
// isHide 返回为true则隐藏当前控件
|
|
262
|
-
return !itemIsHide(isHide, FormInstance.getFieldValue(), FormInstance) ? /*#__PURE__*/_react.default.createElement(_antd.Col, {
|
|
262
|
+
return !itemIsHide(isHide, FormInstance.getFieldValue(), FormInstance) ? /*#__PURE__*/_react.default.createElement(_antd.Col, _extends({
|
|
263
263
|
span: item.colSpan || 24,
|
|
264
264
|
style: item.style
|
|
265
|
-
}, type === 'title' ? /*#__PURE__*/_react.default.createElement("h3", _extends({}, item.protoConfig, {
|
|
265
|
+
}, item.protoCol), type === 'title' ? /*#__PURE__*/_react.default.createElement("h3", _extends({}, item.protoConfig, {
|
|
266
266
|
className: "modalPanelTitle ".concat((item === null || item === void 0 || (_item$protoConfig = item.protoConfig) === null || _item$protoConfig === void 0 ? void 0 : _item$protoConfig.className) || '')
|
|
267
267
|
}), label) : label) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, null);
|
|
268
268
|
});
|
|
@@ -3,7 +3,9 @@ export interface ContentHeaderProps {
|
|
|
3
3
|
title?: string | React.ReactNode;
|
|
4
4
|
breadcrumb?: object | any;
|
|
5
5
|
componentName?: string;
|
|
6
|
+
prefix?: React.ReactNode;
|
|
6
7
|
extra?: React.ReactNode;
|
|
8
|
+
goBack?: (breadcrumbItems?: any, breadcrumb?: any) => void;
|
|
7
9
|
fixed?: Boolean;
|
|
8
10
|
[key: string]: any;
|
|
9
11
|
}
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _antd = require("antd");
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _Header = _interopRequireDefault(require("./styles/Header"));
|
|
12
|
+
var _index = _interopRequireDefault(require("../SpecIcon/index"));
|
|
12
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -43,7 +44,9 @@ var ContentHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
43
44
|
className = props.className,
|
|
44
45
|
title = props.title,
|
|
45
46
|
getClientHeight = props.getClientHeight,
|
|
46
|
-
extra = props.extra
|
|
47
|
+
extra = props.extra,
|
|
48
|
+
prefix = props.prefix,
|
|
49
|
+
goBack = props.goBack;
|
|
47
50
|
var componentName = 'spec-content-header';
|
|
48
51
|
var _useStyle = (0, _Header.default)(componentName),
|
|
49
52
|
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
@@ -58,6 +61,11 @@ var ContentHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
58
61
|
clientHeight = _useState6[0],
|
|
59
62
|
setClientHeight = _useState6[1];
|
|
60
63
|
var headerRef = (0, _react.useRef)(null);
|
|
64
|
+
var handleGoBack = function handleGoBack() {
|
|
65
|
+
if (goBack) {
|
|
66
|
+
goBack(breadcrumb === null || breadcrumb === void 0 ? void 0 : breadcrumb.items, breadcrumb);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
61
69
|
(0, _react.useEffect)(function () {
|
|
62
70
|
if (title || breadcrumb) {
|
|
63
71
|
setVisible(true);
|
|
@@ -99,9 +107,23 @@ var ContentHeader = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
|
99
107
|
ref: headerRef
|
|
100
108
|
}, breadcrumb && breadcrumb !== null && breadcrumb !== void 0 && (_breadcrumb$items = breadcrumb.items) !== null && _breadcrumb$items !== void 0 && _breadcrumb$items.length ? /*#__PURE__*/_react.default.createElement("div", {
|
|
101
109
|
className: componentName + '-breadcrumb'
|
|
102
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.Breadcrumb, breadcrumb || {})) : null, title || extra ? /*#__PURE__*/_react.default.createElement("div", {
|
|
110
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Breadcrumb, breadcrumb || {})) : null, title || extra || prefix || goBack ? /*#__PURE__*/_react.default.createElement("div", {
|
|
103
111
|
className: componentName + '-title'
|
|
104
|
-
},
|
|
112
|
+
}, goBack && /*#__PURE__*/_react.default.createElement("div", {
|
|
113
|
+
className: componentName + '-title-goBack',
|
|
114
|
+
onClick: function onClick() {
|
|
115
|
+
return handleGoBack();
|
|
116
|
+
}
|
|
117
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
118
|
+
size: 'small',
|
|
119
|
+
type: 'default',
|
|
120
|
+
icon: /*#__PURE__*/_react.default.createElement(_index.default, {
|
|
121
|
+
noPrefix: true,
|
|
122
|
+
name: 'speci-redo'
|
|
123
|
+
})
|
|
124
|
+
})), prefix && /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
+
className: componentName + '-title-prefix'
|
|
126
|
+
}, " ", prefix), title && /*#__PURE__*/_react.default.createElement("div", {
|
|
105
127
|
className: componentName + '-title-name'
|
|
106
128
|
}, " ", title), extra && /*#__PURE__*/_react.default.createElement("div", {
|
|
107
129
|
className: componentName + '-title-extra'
|
|
@@ -37,6 +37,14 @@ var SubfieldContentStyleFunc = function SubfieldContentStyleFunc(prefix) {
|
|
|
37
37
|
display: 'flex',
|
|
38
38
|
alignItems: 'center'
|
|
39
39
|
},
|
|
40
|
+
'.spec-content-header-title-goBack + .spec-content-header-title-prefix ': {
|
|
41
|
+
marginLeft: token.marginXS
|
|
42
|
+
},
|
|
43
|
+
'.spec-content-header-title-prefix, .spec-content-header-title-goBack': {
|
|
44
|
+
'& + .spec-content-header-title-name': {
|
|
45
|
+
marginLeft: token.marginXS
|
|
46
|
+
}
|
|
47
|
+
},
|
|
40
48
|
'.spec-content-header-title-name': {
|
|
41
49
|
fontSize: token.fontSizeLG,
|
|
42
50
|
fontWeight: 'bold',
|
|
@@ -146,6 +146,9 @@ var StandardForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
146
146
|
};
|
|
147
147
|
if (Array.isArray(actionGroup) && actionGroup.length === 0) return null;
|
|
148
148
|
if (actionGroup) return groupNode();
|
|
149
|
+
if (fieldStatus === 'disabled' || fieldStatus === 'viewOnly') {
|
|
150
|
+
return null;
|
|
151
|
+
}
|
|
149
152
|
return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
150
153
|
className: "standardForm-actions",
|
|
151
154
|
style: {
|
|
@@ -176,12 +179,14 @@ var StandardForm = /*#__PURE__*/_react.default.forwardRef(function (props, ref)
|
|
|
176
179
|
}), prefix, children, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, formItemGroup.length > 0 ? /*#__PURE__*/_react.default.createElement(_RenderItemGroup.default, _extends({
|
|
177
180
|
itemGroup: formItemGroup,
|
|
178
181
|
fieldSize: fieldSize,
|
|
179
|
-
displayLayout: displayLayout
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
displayLayout: displayLayout,
|
|
183
|
+
doUpdateFormFields: function doUpdateFormFields() {
|
|
184
|
+
return forceUpdateForm();
|
|
185
|
+
},
|
|
182
186
|
size: gridSize,
|
|
183
187
|
layout: layout,
|
|
184
|
-
fieldStatus: fieldStatus
|
|
188
|
+
fieldStatus: fieldStatus,
|
|
189
|
+
form: initForm
|
|
185
190
|
}, itemGroupConfig)) : null, renderActionGroup()), postfix));
|
|
186
191
|
});
|
|
187
192
|
var _default = exports.default = StandardForm;
|
|
@@ -45,6 +45,11 @@ var StandardFormStyleFunc = function StandardFormStyleFunc(prefix) {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
}), '.spec-standard-form', {
|
|
48
|
+
'&.standard-form-vertical': {
|
|
49
|
+
'.standardForm-actions': {
|
|
50
|
+
marginTop: "".concat(token.margin, "px")
|
|
51
|
+
}
|
|
52
|
+
},
|
|
48
53
|
'.stepForm-content': {
|
|
49
54
|
margin: "".concat(token.margin, "px 0px"),
|
|
50
55
|
'&.stepForm-content-vertical': {
|