fan-standard-comp 4.1.21 → 4.1.23
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.d.ts +4 -0
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +82 -156
- package/es/FormComp/FieldComponent/style/TreeSelect.js +7 -5
- package/es/RefactorTree/index.js +13 -8
- package/es/RefactorTree/style/index.js +29 -1
- package/es/RefactorTree/util.d.ts +3 -2
- package/es/RefactorTree/util.js +51 -9
- package/es/StandardContent/SideCard.d.ts +15 -0
- package/es/StandardContent/SideCard.js +67 -0
- package/es/StandardContent/SubfieldContent.js +10 -5
- package/es/StandardContent/styles/SideCard.d.ts +6 -0
- package/es/StandardContent/styles/SideCard.js +98 -0
- package/es/StandardPanel/index.d.ts +10 -0
- package/es/StandardPanel/index.js +61 -18
- package/es/StandardPanel/style/index.js +24 -5
- package/es/StandardPanel/style/index.less +26 -26
- package/es/StandardTitle/index.d.ts +16 -0
- package/es/StandardTitle/index.js +59 -0
- package/es/StandardTitle/styles/index.d.ts +6 -0
- package/es/StandardTitle/styles/index.js +57 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -0
- package/es/utils/getParentNodes.d.ts +10 -0
- package/es/utils/getParentNodes.js +41 -0
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.d.ts +4 -0
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +81 -155
- package/lib/FormComp/FieldComponent/style/TreeSelect.js +7 -5
- package/lib/RefactorTree/index.js +13 -8
- package/lib/RefactorTree/style/index.js +29 -1
- package/lib/RefactorTree/util.d.ts +3 -2
- package/lib/RefactorTree/util.js +52 -12
- package/lib/StandardContent/SideCard.d.ts +15 -0
- package/lib/StandardContent/SideCard.js +76 -0
- package/lib/StandardContent/SubfieldContent.js +10 -5
- package/lib/StandardContent/styles/SideCard.d.ts +6 -0
- package/lib/StandardContent/styles/SideCard.js +104 -0
- package/lib/StandardPanel/index.d.ts +10 -0
- package/lib/StandardPanel/index.js +61 -18
- package/lib/StandardPanel/style/index.js +24 -5
- package/lib/StandardPanel/style/index.less +26 -26
- package/lib/StandardTitle/index.d.ts +16 -0
- package/lib/StandardTitle/index.js +68 -0
- package/lib/StandardTitle/styles/index.d.ts +6 -0
- package/lib/StandardTitle/styles/index.js +63 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +16 -0
- package/lib/utils/getParentNodes.d.ts +10 -0
- package/lib/utils/getParentNodes.js +42 -1
- package/package.json +1 -1
package/es/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export { default as Field } from './FormComp/FieldComponent';
|
|
|
23
23
|
export { default as RenderItemGroup } from './FormComp/RenderItemGroup';
|
|
24
24
|
export { default as ItemGroup } from './FormComp/RenderItemGroup';
|
|
25
25
|
export { default as StandardDrawer } from './StandardDrawer';
|
|
26
|
+
export { default as SideCard } from './StandardContent/SideCard';
|
|
27
|
+
export { default as StandardTitle } from './StandardTitle';
|
|
26
28
|
export * from './components';
|
|
27
29
|
export * from './utils';
|
|
28
30
|
export * from './data';
|
package/es/index.js
CHANGED
|
@@ -31,6 +31,8 @@ export { default as Field } from "./FormComp/FieldComponent";
|
|
|
31
31
|
export { default as RenderItemGroup } from "./FormComp/RenderItemGroup";
|
|
32
32
|
export { default as ItemGroup } from "./FormComp/RenderItemGroup";
|
|
33
33
|
export { default as StandardDrawer } from "./StandardDrawer";
|
|
34
|
+
export { default as SideCard } from "./StandardContent/SideCard";
|
|
35
|
+
export { default as StandardTitle } from "./StandardTitle";
|
|
34
36
|
// 页面内容结构
|
|
35
37
|
// 其他
|
|
36
38
|
export * from "./components";
|
|
@@ -97,3 +97,13 @@ export declare const filterTreeNodes: (list: any[], nodeKey: string | number, pa
|
|
|
97
97
|
childrenParam: string;
|
|
98
98
|
keyParam: string;
|
|
99
99
|
}) => any;
|
|
100
|
+
/**
|
|
101
|
+
* @param {Array} data 树数组数据
|
|
102
|
+
* @param {Number} level 起始层级序号
|
|
103
|
+
* @param {Number} level 起始层级序号
|
|
104
|
+
* @param {Array} parentIndexPath 父级序号集合
|
|
105
|
+
* @param {Array} parentNamePath 父级名称集合
|
|
106
|
+
* @param {Object} optionName 指定字段名 {children: '', label: '', title: '', name: ''}
|
|
107
|
+
* @param {Object} extra 扩展配置 {separator: '/'}
|
|
108
|
+
* */
|
|
109
|
+
export declare const addTreeLevels: (data: any, level: number | undefined, parentIndexPath: never[] | undefined, parentNamePath: never[] | undefined, optionName: any, extra: any) => any[];
|
|
@@ -343,4 +343,45 @@ export var filterTreeNodes = function filterTreeNodes(list, nodeKey) {
|
|
|
343
343
|
}
|
|
344
344
|
});
|
|
345
345
|
return result;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
// 给节点每个层级加上level,并且将当前节点完整的路径序号值拼接起来
|
|
349
|
+
/**
|
|
350
|
+
* @param {Array} data 树数组数据
|
|
351
|
+
* @param {Number} level 起始层级序号
|
|
352
|
+
* @param {Number} level 起始层级序号
|
|
353
|
+
* @param {Array} parentIndexPath 父级序号集合
|
|
354
|
+
* @param {Array} parentNamePath 父级名称集合
|
|
355
|
+
* @param {Object} optionName 指定字段名 {children: '', label: '', title: '', name: ''}
|
|
356
|
+
* @param {Object} extra 扩展配置 {separator: '/'}
|
|
357
|
+
* */
|
|
358
|
+
export var addTreeLevels = function addTreeLevels(data) {
|
|
359
|
+
var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
360
|
+
var parentIndexPath = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
361
|
+
var parentNamePath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
362
|
+
var optionName = arguments.length > 4 ? arguments[4] : undefined;
|
|
363
|
+
var extra = arguments.length > 5 ? arguments[5] : undefined;
|
|
364
|
+
if (!Array.isArray(data)) return [];
|
|
365
|
+
return data.map(function (item, index) {
|
|
366
|
+
// 创建当前节点副本
|
|
367
|
+
// 完整的名称路径
|
|
368
|
+
var fullNamePath = _toConsumableArray(parentNamePath).concat(item[(optionName === null || optionName === void 0 ? void 0 : optionName.title) || (optionName === null || optionName === void 0 ? void 0 : optionName.label) || 'label' || 'title'] ? [item[(optionName === null || optionName === void 0 ? void 0 : optionName.title) || (optionName === null || optionName === void 0 ? void 0 : optionName.label) || 'label' || 'title']] : []);
|
|
369
|
+
var node = _objectSpread(_objectSpread({}, item), {}, {
|
|
370
|
+
treeNodeLevel: level,
|
|
371
|
+
treeParentIndexPath: _toConsumableArray(parentIndexPath),
|
|
372
|
+
// 存储父级索引路径
|
|
373
|
+
treeParentNamePath: _toConsumableArray(parentNamePath),
|
|
374
|
+
treeFullLevelNamePath: fullNamePath,
|
|
375
|
+
treeFullLevelName: fullNamePath.join((extra === null || extra === void 0 ? void 0 : extra.separator) || '/')
|
|
376
|
+
});
|
|
377
|
+
// 当前节点的完整路径(用于构建子节点的父级路径)
|
|
378
|
+
var currentIndexPath = [].concat(_toConsumableArray(parentIndexPath), [index]);
|
|
379
|
+
var currentNamePath = [].concat(_toConsumableArray(parentNamePath), [item[(optionName === null || optionName === void 0 ? void 0 : optionName.title) || (optionName === null || optionName === void 0 ? void 0 : optionName.label) || 'label' || 'title']]);
|
|
380
|
+
|
|
381
|
+
// 递归处理子节点
|
|
382
|
+
if (Array.isArray(node[(optionName === null || optionName === void 0 ? void 0 : optionName.children) || 'children']) && node[(optionName === null || optionName === void 0 ? void 0 : optionName.children) || 'children'].length > 0) {
|
|
383
|
+
node[(optionName === null || optionName === void 0 ? void 0 : optionName.children) || 'children'] = addTreeLevels(node[(optionName === null || optionName === void 0 ? void 0 : optionName.children) || 'children'], level + 1, currentIndexPath, currentNamePath, optionName, extra);
|
|
384
|
+
}
|
|
385
|
+
return node;
|
|
386
|
+
});
|
|
346
387
|
};
|
|
@@ -12,13 +12,14 @@ var _utils = require("../../utils");
|
|
|
12
12
|
var _icons = require("@ant-design/icons");
|
|
13
13
|
var _TreeSelect = _interopRequireDefault(require("./style/TreeSelect"));
|
|
14
14
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
var _util = require("../../RefactorTree/util");
|
|
15
16
|
var _useLanguage = require("../../hooks/use-language");
|
|
17
|
+
var _lodash = _interopRequireDefault(require("lodash"));
|
|
16
18
|
var _excluded = ["treeData", "value", "showFullLevel", "separator", "disabled", "disabledFields", "fieldStatus", "treeOptionName", "placeholder", "protoTreeNode", "onSelect", "labelInValue"];
|
|
17
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
20
|
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); }
|
|
19
21
|
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; }
|
|
20
22
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
-
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
22
23
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
24
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
25
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -32,7 +33,6 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
32
33
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
34
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
34
35
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
35
|
-
var TreeNode = _antd.TreeSelect.TreeNode;
|
|
36
36
|
var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
37
37
|
var _props$treeData = props.treeData,
|
|
38
38
|
treeData = _props$treeData === void 0 ? [] : _props$treeData,
|
|
@@ -46,6 +46,7 @@ var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props,
|
|
|
46
46
|
_props$treeOptionName = props.treeOptionName,
|
|
47
47
|
treeOptionName = _props$treeOptionName === void 0 ? {
|
|
48
48
|
title: 'title',
|
|
49
|
+
label: 'label',
|
|
49
50
|
value: 'value',
|
|
50
51
|
children: 'children',
|
|
51
52
|
disabled: 'disabled'
|
|
@@ -61,136 +62,30 @@ var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props,
|
|
|
61
62
|
_useStyle2 = _slicedToArray(_useStyle, 2),
|
|
62
63
|
wrapSSR = _useStyle2[0],
|
|
63
64
|
hashId = _useStyle2[1];
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
var item = Object.assign({}, (_objectDestructuringEmpty(prevDataItem), prevDataItem));
|
|
77
|
-
// 筛选与禁用字段内值相同的节点进行禁用
|
|
78
|
-
var resetByDisabledFields = function resetByDisabledFields(initItem) {
|
|
79
|
-
var oldItem = _objectSpread({}, initItem);
|
|
80
|
-
var nodeItem = Object.assign({}, (_objectDestructuringEmpty(oldItem), oldItem));
|
|
81
|
-
Object.keys(nodeItem).forEach(function (itemKeyName) {
|
|
82
|
-
var isMatch = disabledFields.find(function (fItem) {
|
|
83
|
-
return fItem.key === itemKeyName;
|
|
84
|
-
});
|
|
85
|
-
if (isMatch) {
|
|
86
|
-
var _isMatch$value$split;
|
|
87
|
-
// 确认是否匹配数据,进行设置 disabled
|
|
88
|
-
if ((_isMatch$value$split = isMatch.value.split(',')) !== null && _isMatch$value$split !== void 0 && _isMatch$value$split.includes(nodeItem[itemKeyName])) {
|
|
89
|
-
nodeItem.disabled = true;
|
|
90
|
-
} else if (nodeItem.hasOwnProperty(dataOptionName.disabled || 'disabled')) {
|
|
91
|
-
nodeItem.disabled = nodeItem[dataOptionName.disabled || 'disabled'];
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
return nodeItem;
|
|
96
|
-
};
|
|
97
|
-
if (disabledFields && Array.isArray(disabledFields)) {
|
|
98
|
-
item = resetByDisabledFields(item);
|
|
99
|
-
}
|
|
100
|
-
if (item[dataOptionName.children] && item[dataOptionName.children].length > 0) {
|
|
101
|
-
return /*#__PURE__*/_react.default.createElement(TreeNode, _extends({
|
|
102
|
-
title: item[dataOptionName.title],
|
|
103
|
-
key: item[dataOptionName.value],
|
|
104
|
-
value: item[dataOptionName.value],
|
|
105
|
-
selectable: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.selectable) || 'selectable'],
|
|
106
|
-
checkable: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.checkable) || 'checkable'],
|
|
107
|
-
disableCheckbox: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.disableCheckbox) || 'disableCheckbox'],
|
|
108
|
-
disabled: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.disabled) || 'disabled']
|
|
109
|
-
}, nodeProps), renderTreeNode(item[dataOptionName.children], dataOptionName));
|
|
110
|
-
}
|
|
111
|
-
return /*#__PURE__*/_react.default.createElement(TreeNode, _extends({
|
|
112
|
-
title: item[dataOptionName.title],
|
|
113
|
-
key: item[dataOptionName.value],
|
|
114
|
-
value: item[dataOptionName.value],
|
|
115
|
-
selectable: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.selectable) || 'selectable'],
|
|
116
|
-
checkable: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.checkable) || 'checkable'],
|
|
117
|
-
disableCheckbox: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.disableCheckbox) || 'disableCheckbox'],
|
|
118
|
-
disabled: item[(dataOptionName === null || dataOptionName === void 0 ? void 0 : dataOptionName.disabled) || 'disabled']
|
|
119
|
-
}, nodeProps));
|
|
120
|
-
});
|
|
121
|
-
};
|
|
122
|
-
(0, _react.useEffect)(function () {
|
|
123
|
-
if (value) {
|
|
124
|
-
// 获取选中节点相关数据:包括当前完整数据值、当前父节点以上层层级节点数据集合及id集合
|
|
125
|
-
var nodeInfo = (0, _utils.getParentNodes)(treeData, labelInValue ? value.value : value, {
|
|
126
|
-
childrenParam: treeOptionName.children,
|
|
127
|
-
keyParam: treeOptionName.value
|
|
128
|
-
}, _objectSpread({}, otherProps));
|
|
129
|
-
setFullLevelName(renderParenName(nodeInfo));
|
|
130
|
-
} else {
|
|
131
|
-
// value,无值时
|
|
132
|
-
setFullLevelName(null);
|
|
133
|
-
}
|
|
134
|
-
}, [value, treeData, fieldStatus]);
|
|
135
|
-
var renderParenName = function renderParenName(selectNodeInfo) {
|
|
136
|
-
// 有父级节点,及当前模式是showFullLevel时,渲染名称为完整层级名称,否则为当前节点名称
|
|
137
|
-
var parentItems = selectNodeInfo.nodeParent;
|
|
138
|
-
if (parentItems.length > 0 && showFullLevel && !otherProps.showCheckedStrategy) {
|
|
139
|
-
// 当前查找到的父级节点拼合当前节点的标题字段值进行显示
|
|
140
|
-
return parentItems.reverse().map(function (item) {
|
|
141
|
-
return item[treeOptionName.title];
|
|
142
|
-
}).concat(selectNodeInfo.matchNode[0][treeOptionName.title]).join(separator);
|
|
143
|
-
}
|
|
144
|
-
if (Array.isArray(value)) {
|
|
145
|
-
return selectNodeInfo.matchNode.length > 0 ? selectNodeInfo.matchNode.map(function (item) {
|
|
146
|
-
return item[treeOptionName.title] || item[treeOptionName.value];
|
|
147
|
-
}).join(',') : null;
|
|
148
|
-
}
|
|
149
|
-
return selectNodeInfo.matchNode.length > 0 ? selectNodeInfo.matchNode[0][treeOptionName.title] : null;
|
|
150
|
-
};
|
|
151
|
-
var renderTreeSelectNode = function renderTreeSelectNode() {
|
|
152
|
-
return /*#__PURE__*/_react.default.createElement(_antd.TreeSelect, _extends({
|
|
153
|
-
placeholder: placeholder,
|
|
154
|
-
value: value,
|
|
155
|
-
ref: ref
|
|
156
|
-
}, otherProps, {
|
|
157
|
-
className: (0, _classnames.default)(componentName, hashId, otherProps === null || otherProps === void 0 ? void 0 : otherProps.className),
|
|
158
|
-
labelInValue: labelInValue,
|
|
159
|
-
title: otherProps.title || ((disabled || fieldStatus === 'disabled') && !otherProps.treeCheckable ? fullLevelName : null),
|
|
160
|
-
showCheckedStrategy: otherProps.showCheckedStrategy,
|
|
161
|
-
disabled: disabled,
|
|
162
|
-
onSelect: function onSelect(value, node, extra) {
|
|
163
|
-
var newNodeInfo = (0, _utils.getParentNodes)(treeData, value, {
|
|
164
|
-
childrenParam: treeOptionName.children,
|
|
165
|
-
keyParam: treeOptionName.value
|
|
166
|
-
});
|
|
167
|
-
setFullLevelName(renderParenName(newNodeInfo));
|
|
168
|
-
if (_onSelect) _onSelect(value, _objectSpread(_objectSpread({}, node), newNodeInfo.matchNode[0]), extra, newNodeInfo.nodeParent);
|
|
169
|
-
},
|
|
170
|
-
onOpenChange: function onOpenChange(open) {
|
|
171
|
-
var _otherProps$onOpenCha;
|
|
172
|
-
setFullLevelStyle({
|
|
173
|
-
opacity: open ? 0.3 : ''
|
|
174
|
-
});
|
|
175
|
-
// otherProps?.onDropdownVisibleChange?.(open)
|
|
176
|
-
otherProps === null || otherProps === void 0 || (_otherProps$onOpenCha = otherProps.onOpenChange) === null || _otherProps$onOpenCha === void 0 || _otherProps$onOpenCha.call(otherProps, open);
|
|
177
|
-
},
|
|
178
|
-
onSearch: function onSearch(value) {
|
|
179
|
-
var _otherProps$onSearch;
|
|
180
|
-
setFullLevelStyle({
|
|
181
|
-
opacity: value ? 0 : ''
|
|
182
|
-
});
|
|
183
|
-
otherProps === null || otherProps === void 0 || (_otherProps$onSearch = otherProps.onSearch) === null || _otherProps$onSearch === void 0 || _otherProps$onSearch.call(otherProps, value);
|
|
184
|
-
}
|
|
185
|
-
}), renderTreeNode(treeData, treeOptionName, protoTreeNode || {}));
|
|
65
|
+
// 重组数据
|
|
66
|
+
var transTreeData = (0, _react.useMemo)(function () {
|
|
67
|
+
var newTree = _lodash.default.cloneDeep(treeData || []);
|
|
68
|
+
return (0, _util.transDataParam)(newTree, (otherProps === null || otherProps === void 0 ? void 0 : otherProps.fieldNames) || treeOptionName, {
|
|
69
|
+
separator: separator,
|
|
70
|
+
disabledFields: disabledFields
|
|
71
|
+
}); // 通过转换后的数据
|
|
72
|
+
}, [treeData, treeOptionName, otherProps.fieldNames, separator, disabledFields]);
|
|
73
|
+
// 设置名称字段值
|
|
74
|
+
var setLabelKeyName = function setLabelKeyName() {
|
|
75
|
+
var _otherProps$fieldName;
|
|
76
|
+
return showFullLevelKeyName || ((_otherProps$fieldName = otherProps.fieldNames) === null || _otherProps$fieldName === void 0 ? void 0 : _otherProps$fieldName.label) || treeOptionName.title || treeOptionName.label;
|
|
186
77
|
};
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
78
|
+
// 判断是否指定显示完整名称
|
|
79
|
+
var showFullLevelKeyName = (0, _react.useMemo)(function () {
|
|
80
|
+
return showFullLevel ? 'treeFullLevelName' : otherProps === null || otherProps === void 0 ? void 0 : otherProps.treeNodeLabelProp;
|
|
81
|
+
}, [showFullLevel, otherProps === null || otherProps === void 0 ? void 0 : otherProps.treeNodeLabelProp]);
|
|
82
|
+
var _useState = (0, _react.useState)(false),
|
|
83
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
84
|
+
showAllPath = _useState2[0],
|
|
85
|
+
setShowAllPath = _useState2[1]; // 显示所有树选择路径
|
|
191
86
|
var renderTreeSelectNodePath = function renderTreeSelectNodePath() {
|
|
192
87
|
//获取节点路径
|
|
193
|
-
var pathNodes = (0, _utils.getNodePaths)(
|
|
88
|
+
var pathNodes = (0, _utils.getNodePaths)(transTreeData, value, {
|
|
194
89
|
childrenParam: treeOptionName.children,
|
|
195
90
|
keyParam: treeOptionName.value
|
|
196
91
|
}, _objectSpread({}, otherProps));
|
|
@@ -199,16 +94,16 @@ var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props,
|
|
|
199
94
|
};
|
|
200
95
|
if (pathNodes.length > 0) {
|
|
201
96
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
202
|
-
className: "tree-select-viewonly-list ".concat(
|
|
97
|
+
className: "tree-select-viewonly-list ".concat(showAllPath ? 'collapsed' : '')
|
|
203
98
|
}, pathNodes.map(function (item, index) {
|
|
204
99
|
if (item.length > 0) {
|
|
205
100
|
// 超过2个且不显示所有
|
|
206
|
-
if (index > 1 && !showAllPath) return;
|
|
101
|
+
if (index > 1 && !showAllPath) return '';
|
|
207
102
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
208
103
|
className: 'tree-select-viewonly-item',
|
|
209
104
|
key: index
|
|
210
105
|
}, /*#__PURE__*/_react.default.createElement("b", null, "\xB7 "), item.map(function (i) {
|
|
211
|
-
return i[
|
|
106
|
+
return i[setLabelKeyName()];
|
|
212
107
|
}).join(separator));
|
|
213
108
|
}
|
|
214
109
|
}), pathNodes.length > 2 ? /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -220,34 +115,65 @@ var RefactorTreeSelect = /*#__PURE__*/_react.default.forwardRef(function (props,
|
|
|
220
115
|
}
|
|
221
116
|
};
|
|
222
117
|
if (fieldStatus === 'viewOnly') {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
118
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
119
|
+
className: (0, _classnames.default)(componentName, hashId, otherProps === null || otherProps === void 0 ? void 0 : otherProps.className, componentName + '-viewOnly')
|
|
120
|
+
}, function (_nodeInfo$matchNode$) {
|
|
121
|
+
//多选下拉框 详情展示 showCheckedStrategy 有值且显示完整路径时
|
|
122
|
+
if (otherProps.showCheckedStrategy && showFullLevelKeyName) {
|
|
123
|
+
return renderTreeSelectNodePath();
|
|
124
|
+
}
|
|
125
|
+
// 多选状态
|
|
126
|
+
if (otherProps.multiple) {
|
|
127
|
+
if (labelInValue) {
|
|
128
|
+
return value && value.length > 0 ? value.map(function (item) {
|
|
129
|
+
return item[setLabelKeyName()] || item['title'] || item['label'];
|
|
130
|
+
}).join(',') : '-';
|
|
131
|
+
}
|
|
132
|
+
var pathNodes = (0, _utils.getNodePaths)(transTreeData, value, {
|
|
133
|
+
childrenParam: treeOptionName.children,
|
|
134
|
+
keyParam: treeOptionName.value
|
|
135
|
+
}, _objectSpread({}, otherProps));
|
|
136
|
+
return pathNodes.length > 0 ? pathNodes.map(function (nItem) {
|
|
137
|
+
var _nItem;
|
|
138
|
+
return (_nItem = nItem[nItem.length - 1]) === null || _nItem === void 0 ? void 0 : _nItem[setLabelKeyName()];
|
|
232
139
|
}).join(',') : '-';
|
|
233
140
|
}
|
|
234
|
-
var
|
|
141
|
+
var nodeInfo = (0, _utils.getParentNodes)(transTreeData, labelInValue ? value.value : value, {
|
|
235
142
|
childrenParam: treeOptionName.children,
|
|
236
143
|
keyParam: treeOptionName.value
|
|
237
144
|
}, _objectSpread({}, otherProps));
|
|
238
|
-
return
|
|
239
|
-
|
|
240
|
-
return (_nItem = nItem[nItem.length - 1]) === null || _nItem === void 0 ? void 0 : _nItem[treeOptionName.title];
|
|
241
|
-
}).join(',') : '-';
|
|
242
|
-
}
|
|
243
|
-
return fullLevelName || '-'; // 只读显示时,只返回文本
|
|
145
|
+
return (nodeInfo === null || nodeInfo === void 0 || (_nodeInfo$matchNode$ = nodeInfo.matchNode[0]) === null || _nodeInfo$matchNode$ === void 0 ? void 0 : _nodeInfo$matchNode$[setLabelKeyName()]) || '-'; // 只读显示时,只返回文本
|
|
146
|
+
}());
|
|
244
147
|
}
|
|
245
|
-
return wrapSSR( /*#__PURE__*/_react.default.createElement(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
148
|
+
return wrapSSR( /*#__PURE__*/_react.default.createElement(_antd.TreeSelect, _extends({
|
|
149
|
+
placeholder: placeholder,
|
|
150
|
+
value: value,
|
|
151
|
+
ref: ref
|
|
152
|
+
}, otherProps, {
|
|
153
|
+
treeNodeLabelProp: showFullLevel ? 'treeFullLevelName' : otherProps === null || otherProps === void 0 ? void 0 : otherProps.treeNodeLabelProp,
|
|
154
|
+
className: (0, _classnames.default)(componentName, hashId, otherProps === null || otherProps === void 0 ? void 0 : otherProps.className),
|
|
155
|
+
labelInValue: labelInValue,
|
|
156
|
+
showCheckedStrategy: otherProps.showCheckedStrategy,
|
|
157
|
+
disabled: disabled,
|
|
158
|
+
onSelect: function onSelect(value, node, extra) {
|
|
159
|
+
var newNodeInfo = (0, _utils.getParentNodes)(transTreeData, value, {
|
|
160
|
+
childrenParam: treeOptionName.children,
|
|
161
|
+
keyParam: treeOptionName.value
|
|
162
|
+
});
|
|
163
|
+
if (_onSelect) _onSelect(value, _objectSpread(_objectSpread({}, node), newNodeInfo.matchNode[0]), extra, newNodeInfo.nodeParent);
|
|
164
|
+
},
|
|
165
|
+
onOpenChange: function onOpenChange(open) {
|
|
166
|
+
var _otherProps$onOpenCha;
|
|
167
|
+
otherProps === null || otherProps === void 0 || (_otherProps$onOpenCha = otherProps.onOpenChange) === null || _otherProps$onOpenCha === void 0 || _otherProps$onOpenCha.call(otherProps, open);
|
|
168
|
+
},
|
|
169
|
+
onSearch: function onSearch(value) {
|
|
170
|
+
var _otherProps$onSearch;
|
|
171
|
+
otherProps === null || otherProps === void 0 || (_otherProps$onSearch = otherProps.onSearch) === null || _otherProps$onSearch === void 0 || _otherProps$onSearch.call(otherProps, value);
|
|
172
|
+
},
|
|
173
|
+
treeData: transTreeData,
|
|
174
|
+
fieldNames: _objectSpread(_objectSpread({}, treeOptionName), {}, {
|
|
175
|
+
label: (treeOptionName === null || treeOptionName === void 0 ? void 0 : treeOptionName.title) || (treeOptionName === null || treeOptionName === void 0 ? void 0 : treeOptionName.label)
|
|
176
|
+
}, (otherProps === null || otherProps === void 0 ? void 0 : otherProps.fieldNames) || {})
|
|
177
|
+
})));
|
|
252
178
|
});
|
|
253
179
|
var _default = exports.default = RefactorTreeSelect;
|
|
@@ -18,7 +18,7 @@ var RefactorTreeSelectStyleFunc = function RefactorTreeSelectStyleFunc(prefix) {
|
|
|
18
18
|
};
|
|
19
19
|
return (0, _genStyleHook.createStyleHook)(prefix, function (token) {
|
|
20
20
|
var prefixCls = ".".concat(prefix);
|
|
21
|
-
return [_defineProperty(
|
|
21
|
+
return [_defineProperty({}, prefixCls, _defineProperty({
|
|
22
22
|
'&.refactor-disabled .refactor-tree-select-extra ': {
|
|
23
23
|
color: token.colorTextDisabled,
|
|
24
24
|
background: token.colorBgContainerDisabled
|
|
@@ -28,13 +28,15 @@ var RefactorTreeSelectStyleFunc = function RefactorTreeSelectStyleFunc(prefix) {
|
|
|
28
28
|
height: token.controlHeight,
|
|
29
29
|
padding: "1px 22px 1px ".concat(token.paddingXS + 3, "px")
|
|
30
30
|
}
|
|
31
|
-
}
|
|
32
|
-
border: "1px solid ".concat(
|
|
33
|
-
borderRadius: token.
|
|
31
|
+
}, '.tree-select-viewonly-list', {
|
|
32
|
+
border: "1px solid ".concat(token.colorBorder),
|
|
33
|
+
borderRadius: token.borderRadius,
|
|
34
34
|
padding: "".concat(token.paddingXS, "px ").concat(token.paddingSM, "px"),
|
|
35
35
|
'& .toggle-icon': {
|
|
36
36
|
fontSize: token.fontSizeSM,
|
|
37
37
|
color: token.colorTextSecondary,
|
|
38
|
+
borderBottomLeftRadius: token.borderRadius,
|
|
39
|
+
borderBottomRightRadius: token.borderRadius,
|
|
38
40
|
// backgroundImage: `-webkit-gradient(linear, left top, left bottom, from(fade(@component-background, 0)), to(@component-background))`,
|
|
39
41
|
// backgroundImage: `-webkit-linear-gradient(top, fade(@component-background, 0), @component-background)`,
|
|
40
42
|
backgroundImage: "linear-gradient(-180deg, ".concat(new _tinycolor.TinyColor(token.colorBgContainer).setAlpha(0.).toRgbString(), ", ").concat(token.colorBgContainer, ")"),
|
|
@@ -42,7 +44,7 @@ var RefactorTreeSelectStyleFunc = function RefactorTreeSelectStyleFunc(prefix) {
|
|
|
42
44
|
color: token.colorPrimary
|
|
43
45
|
}
|
|
44
46
|
}
|
|
45
|
-
})];
|
|
47
|
+
}))];
|
|
46
48
|
}, prepareComponentToken // 当前组件扩展的变量
|
|
47
49
|
);
|
|
48
50
|
};
|
|
@@ -15,7 +15,7 @@ var _useLanguage = require("../hooks/use-language");
|
|
|
15
15
|
var _style = _interopRequireDefault(require("./style"));
|
|
16
16
|
var _ConfigContext = require("../ConfigContext");
|
|
17
17
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
18
|
-
var _excluded = ["treeData", "rootName", "rootKey", "emptyDescription", "optionName", "searchOptionName", "defaultSelectedKeys", "nodeExtra", "selectable", "nodeControl", "limitKey", "checkedKeys", "checkStrictly", "onSelect", "onCheck", "titleRender", "disabledFields", "showSearch", "searchText", "searchConfig", "searchTrigger", "searchAuto", "children", "footer", "wrapperStyle", "wrapperClassname"];
|
|
18
|
+
var _excluded = ["treeData", "rootName", "rootKey", "emptyDescription", "optionName", "searchOptionName", "defaultSelectedKeys", "nodeExtra", "selectable", "nodeControl", "limitKey", "checkedKeys", "checkStrictly", "onSelect", "onCheck", "titleRender", "disabledFields", "showSearch", "searchText", "searchConfig", "searchTrigger", "searchAuto", "searchExtra", "children", "footer", "wrapperStyle", "wrapperClassname", "fullHeight"];
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
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); }
|
|
21
21
|
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; }
|
|
@@ -78,10 +78,12 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
78
78
|
searchTrigger = _ConcatTreeProps$sear === void 0 ? 'search' : _ConcatTreeProps$sear,
|
|
79
79
|
_ConcatTreeProps$sear2 = ConcatTreeProps.searchAuto,
|
|
80
80
|
searchAuto = _ConcatTreeProps$sear2 === void 0 ? true : _ConcatTreeProps$sear2,
|
|
81
|
+
searchExtra = ConcatTreeProps.searchExtra,
|
|
81
82
|
children = ConcatTreeProps.children,
|
|
82
83
|
footer = ConcatTreeProps.footer,
|
|
83
84
|
wrapperStyle = ConcatTreeProps.wrapperStyle,
|
|
84
85
|
wrapperClassname = ConcatTreeProps.wrapperClassname,
|
|
86
|
+
fullHeight = ConcatTreeProps.fullHeight,
|
|
85
87
|
otherProps = _objectWithoutProperties(ConcatTreeProps, _excluded);
|
|
86
88
|
// const { title, value, children, disabled } = { value: 'value', title: 'title', children: 'children', disabled: 'disabled', ...optionName }
|
|
87
89
|
var _useState = (0, _react.useState)(''),
|
|
@@ -97,7 +99,7 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
97
99
|
var afterTransData = (0, _util.transDataParam)(treeData, optionName); // 通过转换后的数据
|
|
98
100
|
var resultData;
|
|
99
101
|
// 如果有配置根节点,则添加 一个根节点数据
|
|
100
|
-
resultData = rootName ? [_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, optionName.title || 'title', rootName), optionName.value || 'value', rootKey || '0'), optionName.key || 'key', rootKey || '0'), 'children', afterTransData)] : afterTransData;
|
|
102
|
+
resultData = rootName ? [_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, optionName.title || 'title', rootName), optionName.value || 'value', rootKey || '0'), optionName.key || 'key', rootKey || '0'), optionName.key || 'children', afterTransData)] : afterTransData;
|
|
101
103
|
// 有配置limitKey指定限制同级节点时,添加判断节点选择限制(在父子节点不相关联条件下使用checkStrictly=true)
|
|
102
104
|
if (checkStrictly && limitKey && checkedKeys) {
|
|
103
105
|
if (Array.isArray(checkedKeys) && checkedKeys.length > 0 || checkedKeys && Array.isArray(checkedKeys.checked) && checkedKeys.checked.length > 0) {
|
|
@@ -235,18 +237,21 @@ var RefactorTree = function RefactorTree(props) {
|
|
|
235
237
|
}
|
|
236
238
|
};
|
|
237
239
|
return wrapSSR( /*#__PURE__*/_react.default.createElement("div", {
|
|
238
|
-
className: (0, _classnames.default)(componentName, wrapperClassname),
|
|
240
|
+
className: (0, _classnames.default)(componentName, wrapperClassname, fullHeight ? 'spec-standard-refactor-tree-fullheight' : '', hashId),
|
|
239
241
|
style: wrapperStyle
|
|
240
|
-
}, children, showSearch && /*#__PURE__*/_react.default.createElement(
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
},
|
|
242
|
+
}, children, showSearch && /*#__PURE__*/_react.default.createElement("div", {
|
|
243
|
+
className: 'spec-standard-refactor-tree-searchbar'
|
|
244
|
+
}, /*#__PURE__*/_react.default.createElement(Search, _extends({
|
|
244
245
|
allowClear: true,
|
|
245
246
|
enterButton: searchTrigger === "search" ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_icons.SearchOutlined, null), " ", searchText || (lang === null || lang === void 0 ? void 0 : lang['filter.submit']) || '查询') : false,
|
|
246
247
|
placeholder: (lang === null || lang === void 0 ? void 0 : lang['field.input.placeholder']) || '请输入'
|
|
247
248
|
}, searchConfig, {
|
|
248
249
|
onSearch: onRefactorSearch,
|
|
249
250
|
onChange: onRefactorChange
|
|
250
|
-
})),
|
|
251
|
+
})), searchExtra && /*#__PURE__*/_react.default.createElement("div", {
|
|
252
|
+
className: 'spec-standard-refactor-tree-search-extra'
|
|
253
|
+
}, searchExtra)), RenderTree(), footer && /*#__PURE__*/_react.default.createElement("div", {
|
|
254
|
+
className: 'spec-standard-refactor-tree-footer'
|
|
255
|
+
}, footer)));
|
|
251
256
|
};
|
|
252
257
|
var _default = exports.default = RefactorTree;
|
|
@@ -5,7 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _genStyleHook = require("../../theme/utils/genStyleHook");
|
|
8
|
+
var _index = require("../../theme/index");
|
|
8
9
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
10
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
12
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
11
14
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -17,7 +20,32 @@ var RefactorTreeStyleFunc = function RefactorTreeStyleFunc(prefix) {
|
|
|
17
20
|
};
|
|
18
21
|
return (0, _genStyleHook.createStyleHook)(prefix, function (token) {
|
|
19
22
|
var prefixCls = ".".concat(prefix);
|
|
20
|
-
return [_defineProperty({}, prefixCls, {
|
|
23
|
+
return [_defineProperty({}, prefixCls, {
|
|
24
|
+
'&.spec-standard-refactor-tree-fullheight': {
|
|
25
|
+
height: '100%',
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column',
|
|
28
|
+
overflow: 'hidden',
|
|
29
|
+
'.ant-tree': _objectSpread({
|
|
30
|
+
flex: 1,
|
|
31
|
+
height: '100%',
|
|
32
|
+
overflow: 'auto',
|
|
33
|
+
padding: '0'
|
|
34
|
+
}, (0, _index.scrollBar)(token))
|
|
35
|
+
},
|
|
36
|
+
'.spec-standard-refactor-tree-searchbar': {
|
|
37
|
+
// backgroundColor: '#f0f'
|
|
38
|
+
marginBottom: "".concat(token.margin, "px"),
|
|
39
|
+
display: 'flex',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
'.ant-input-search': {
|
|
42
|
+
flex: 1
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
'.ant-tree + .spec-standard-refactor-tree-footer': {
|
|
46
|
+
marginTop: "".concat(token.margin, "px")
|
|
47
|
+
}
|
|
48
|
+
})];
|
|
21
49
|
}, prepareComponentToken // 当前组件扩展的变量
|
|
22
50
|
);
|
|
23
51
|
};
|
|
@@ -5,15 +5,16 @@ interface optionNameProps {
|
|
|
5
5
|
children?: string;
|
|
6
6
|
disabled?: string;
|
|
7
7
|
selectable?: string;
|
|
8
|
+
label?: string;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* transDataParam 根据指定选项字段名重组数据
|
|
11
12
|
*
|
|
12
13
|
* @params {array} array 树数据集合
|
|
13
|
-
* @params {object} optionName 选项字段值
|
|
14
|
+
* @params {object} optionName 选项字段值(tree-select的标题使用的是label字段)
|
|
14
15
|
*
|
|
15
16
|
* */
|
|
16
|
-
export declare function transDataParam(array: any[], optionName?: optionNameProps): any[]
|
|
17
|
+
export declare function transDataParam(array: any[], optionName?: optionNameProps, extra?: any): any[];
|
|
17
18
|
/**
|
|
18
19
|
* 根据限制字段limitKey进行重组数据
|
|
19
20
|
*
|