@zat-design/sisyphus-react 3.7.3-beta.16 → 3.7.3-beta.17
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/coverage/lcov-report/src/.umi/core/devScripts.ts.html +241 -0
- package/coverage/lcov-report/src/.umi/core/history.ts.html +148 -0
- package/coverage/lcov-report/src/.umi/core/index.html +206 -0
- package/coverage/lcov-report/src/.umi/core/plugin.ts.html +109 -0
- package/coverage/lcov-report/src/.umi/core/pluginRegister.ts.html +160 -0
- package/coverage/lcov-report/src/.umi/core/polyfill.ts.html +97 -0
- package/coverage/lcov-report/src/.umi/core/routes.ts.html +26050 -0
- package/coverage/lcov-report/src/.umi/core/umiExports.ts.html +112 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/demos/index.ts.html +6340 -0
- package/coverage/lcov-report/src/.umi/dumi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/dumi/layout.tsx.html +109 -0
- package/coverage/lcov-report/src/.umi/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-antd/runtime.tsx.html +172 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/exports.ts.html +94 -0
- package/coverage/lcov-report/src/.umi/plugin-helmet/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/Provider.tsx.html +196 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/exports.ts.html +106 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/models/initialState.ts.html +88 -0
- package/coverage/lcov-report/src/.umi/plugin-initial-state/runtime.tsx.html +124 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/SelectLang.tsx.html +1246 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/index.html +161 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/locale.tsx.html +268 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/localeExports.ts.html +778 -0
- package/coverage/lcov-report/src/.umi/plugin-locale/runtime.tsx.html +115 -0
- package/coverage/lcov-report/src/.umi/plugin-model/Provider.tsx.html +202 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/constant.tsx.html +97 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/dispatcher.tsx.html +142 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/executor.tsx.html +334 -0
- package/coverage/lcov-report/src/.umi/plugin-model/helpers/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/index.html +146 -0
- package/coverage/lcov-report/src/.umi/plugin-model/runtime.tsx.html +121 -0
- package/coverage/lcov-report/src/.umi/plugin-model/useModel.tsx.html +298 -0
- package/coverage/lcov-report/src/.umi/plugin-request/index.html +116 -0
- package/coverage/lcov-report/src/.umi/plugin-request/request.ts.html +919 -0
- package/coverage/lcov-report/src/.umi/umi.ts.html +268 -0
- package/es/ProForm/components/render/ChangedWrapper.js +7 -3
- package/es/ProForm/propsType.d.ts +1 -0
- package/es/ProSelect/index.js +4 -3
- package/es/ProTree/components/ProTreeSelect/index.js +8 -8
- package/es/ProTree/components/SearchTitle.d.ts +2 -1
- package/es/ProTree/components/SearchTitle.js +12 -2
- package/es/ProTreeModal/components/Tree.js +15 -17
- package/es/ProTreeModal/index.js +62 -7
- package/es/ProTreeModal/utils.d.ts +1 -0
- package/es/ProTreeModal/utils.js +21 -1
- package/lib/ProForm/components/render/ChangedWrapper.js +7 -3
- package/lib/ProForm/propsType.d.ts +1 -0
- package/lib/ProSelect/index.js +4 -3
- package/lib/ProTree/components/ProTreeSelect/index.js +8 -8
- package/lib/ProTree/components/SearchTitle.d.ts +2 -1
- package/lib/ProTree/components/SearchTitle.js +13 -2
- package/lib/ProTreeModal/components/Tree.js +15 -17
- package/lib/ProTreeModal/index.js +61 -6
- package/lib/ProTreeModal/utils.d.ts +1 -0
- package/lib/ProTreeModal/utils.js +20 -0
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
|
19
19
|
var _utils = require("../../../utils");
|
|
20
20
|
var _excluded = ["name", "names", "namesStr", "form", "equalWith", "children", "type", "diffConfig", "valuePropName"];
|
|
21
21
|
var ChangedWrapper = function ChangedWrapper(props) {
|
|
22
|
-
var _diffConfig$toolTip, _children$props;
|
|
22
|
+
var _diffConfig$toolTip, _children$props, _children$props2, _children$props3;
|
|
23
23
|
var name = props.name,
|
|
24
24
|
names = props.names,
|
|
25
25
|
namesStr = props.namesStr,
|
|
@@ -77,6 +77,8 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
77
77
|
'pro-form-item-changed': isChanged,
|
|
78
78
|
'pro-form-item-add': isAdd
|
|
79
79
|
});
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
var _showEllipse = ((_children$props = children.props) === null || _children$props === void 0 ? void 0 : _children$props.showEllipse) || ((_children$props2 = children.props) === null || _children$props2 === void 0 ? void 0 : _children$props2.tooltip);
|
|
80
82
|
return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
81
83
|
open: tipOpenCalc(),
|
|
82
84
|
mouseEnterDelay: 1,
|
|
@@ -87,7 +89,7 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
87
89
|
direction: "vertical",
|
|
88
90
|
children: [(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
89
91
|
children: ["\u521D\u59CB\u503C\uFF1A", tipContent]
|
|
90
|
-
}),
|
|
92
|
+
}), _showEllipse && (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
91
93
|
children: ["\u5F53\u524D\u503C\uFF1A", /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest), {}, {
|
|
92
94
|
isView: true
|
|
93
95
|
})) : undefined]
|
|
@@ -98,7 +100,9 @@ var ChangedWrapper = function ChangedWrapper(props) {
|
|
|
98
100
|
className: diffClassName,
|
|
99
101
|
style: style,
|
|
100
102
|
children: /*#__PURE__*/_react.default.isValidElement(children) ? /*#__PURE__*/_react.default.cloneElement(children, (0, _objectSpread3.default)((0, _objectSpread3.default)((0, _objectSpread3.default)({}, children.props), rest), {}, {
|
|
101
|
-
|
|
103
|
+
otherProps: (0, _objectSpread3.default)((0, _objectSpread3.default)({}, (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.otherProps), {}, {
|
|
104
|
+
isDiffChange: isChanged
|
|
105
|
+
})
|
|
102
106
|
})) : undefined
|
|
103
107
|
})
|
|
104
108
|
});
|
package/lib/ProSelect/index.js
CHANGED
|
@@ -25,6 +25,7 @@ var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames"
|
|
|
25
25
|
var Option = _antd.Select.Option;
|
|
26
26
|
var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
27
27
|
var _selectProps$showCode, _locale$ProSelect;
|
|
28
|
+
console.log('props11: ', props);
|
|
28
29
|
var _ref = (0, _ProConfigProvider.useProConfig)('ProSelect') || {},
|
|
29
30
|
_ref$fieldNames = _ref.fieldNames,
|
|
30
31
|
proSelectFieldNames = _ref$fieldNames === void 0 ? {} : _ref$fieldNames,
|
|
@@ -297,7 +298,8 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
|
297
298
|
showArrow: true,
|
|
298
299
|
loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
|
|
299
300
|
onChange: handleChange,
|
|
300
|
-
optionLabelProp
|
|
301
|
+
// optionLabelProp={otherProps?.isDiffChange ? "label" : 'children'} // 解决warning报错,添加默认值
|
|
302
|
+
optionLabelProp: "label" // 解决warning报错,添加默认值
|
|
301
303
|
,
|
|
302
304
|
showSearch: true,
|
|
303
305
|
filterOption: (0, _lodash.isFunction)(_onSearch) ? false : function (input, option) {
|
|
@@ -315,16 +317,15 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
|
315
317
|
value: transformValue(),
|
|
316
318
|
children: Array.isArray(newSelectList) && newSelectList.map(function (item) {
|
|
317
319
|
return (0, _jsxRuntime.jsx)(Option, {
|
|
320
|
+
label: item[label],
|
|
318
321
|
value: item[code],
|
|
319
322
|
record: item,
|
|
320
323
|
disabled: !!item.disabled,
|
|
321
324
|
children: (0, _jsxRuntime.jsx)(TooltipOption, {
|
|
322
325
|
title: OptionRender ? OptionRender(item) : selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
|
|
323
326
|
children: OptionRender ? (0, _jsxRuntime.jsx)("span", {
|
|
324
|
-
title: OptionRender(item),
|
|
325
327
|
children: OptionRender(item)
|
|
326
328
|
}) : (0, _jsxRuntime.jsx)("span", {
|
|
327
|
-
title: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label],
|
|
328
329
|
children: selectProps.showCodeName ? "".concat(item[code], "-").concat(item[label]) : item[label]
|
|
329
330
|
})
|
|
330
331
|
}, item[code])
|
|
@@ -76,13 +76,13 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
76
76
|
var _props$value = props.value,
|
|
77
77
|
value = _props$value === void 0 ? undefined : _props$value;
|
|
78
78
|
var _props$showEllipse = props.showEllipse,
|
|
79
|
-
showEllipse = _props$showEllipse === void 0 ? true : _props$showEllipse
|
|
80
|
-
|
|
81
|
-
isDiffChange =
|
|
79
|
+
showEllipse = _props$showEllipse === void 0 ? true : _props$showEllipse;
|
|
80
|
+
var _ref2 = otherProps !== null && otherProps !== void 0 ? otherProps : {},
|
|
81
|
+
isDiffChange = _ref2.isDiffChange;
|
|
82
82
|
var _showEllipse = showEllipse && !isDiffChange;
|
|
83
|
-
var
|
|
84
|
-
isView =
|
|
85
|
-
viewEmpty =
|
|
83
|
+
var _ref3 = otherProps || {},
|
|
84
|
+
isView = _ref3.isView,
|
|
85
|
+
viewEmpty = _ref3.viewEmpty;
|
|
86
86
|
if (fieldNames && Object.keys(fieldNames).length) {
|
|
87
87
|
code = fieldNames.value || 'value';
|
|
88
88
|
label = fieldNames.label || 'label';
|
|
@@ -215,8 +215,8 @@ var ProTreeSelect = exports.ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
215
215
|
return undefined;
|
|
216
216
|
}
|
|
217
217
|
// 如果配置手动加载,不执行请求
|
|
218
|
-
var
|
|
219
|
-
defaultParams =
|
|
218
|
+
var _ref4 = (useRequest === null || useRequest === void 0 ? void 0 : useRequest.options) || {},
|
|
219
|
+
defaultParams = _ref4.defaultParams;
|
|
220
220
|
// 执行用户配置的枚举服务,拉取枚举数据进行更新
|
|
221
221
|
fetchFunction.run(defaultParams);
|
|
222
222
|
}, [useRequest === null || useRequest === void 0 ? void 0 : useRequest.service, defaultDisableValue]);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ProFormOtherProps } from '../../ProForm/propsType';
|
|
2
3
|
declare function SearchTitle(props: {
|
|
3
4
|
searchStr?: string;
|
|
4
5
|
label?: string;
|
|
5
6
|
showEllipse?: boolean;
|
|
6
7
|
ellipseWidth?: string;
|
|
7
|
-
|
|
8
|
+
otherProps?: ProFormOtherProps;
|
|
8
9
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
declare const _default: import("react").MemoExoticComponent<typeof SearchTitle>;
|
|
10
11
|
export default _default;
|
|
@@ -8,14 +8,25 @@ exports.default = void 0;
|
|
|
8
8
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _AdaptiveTooltip = _interopRequireDefault(require("./AdaptiveTooltip"));
|
|
11
|
+
/*
|
|
12
|
+
* @Author: za-xuwenli xuwenli@zhongan.io
|
|
13
|
+
* @Date: 2024-09-26 14:37:00
|
|
14
|
+
* @LastEditors: za-xuwenli xuwenli@zhongan.io
|
|
15
|
+
* @LastEditTime: 2024-09-26 17:50:59
|
|
16
|
+
* @FilePath: /za-material-warehouse/src/ProTree/components/SearchTitle.tsx
|
|
17
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
18
|
+
*/
|
|
19
|
+
|
|
11
20
|
function SearchTitle(props) {
|
|
12
21
|
var label = props.label,
|
|
13
22
|
_props$searchStr = props.searchStr,
|
|
14
23
|
searchStr = _props$searchStr === void 0 ? '' : _props$searchStr,
|
|
15
24
|
showEllipse = props.showEllipse,
|
|
16
25
|
ellipseWidth = props.ellipseWidth,
|
|
17
|
-
|
|
18
|
-
|
|
26
|
+
otherProps = props.otherProps;
|
|
27
|
+
var _ref = otherProps !== null && otherProps !== void 0 ? otherProps : {},
|
|
28
|
+
_ref$isDiffChange = _ref.isDiffChange,
|
|
29
|
+
isDiffChange = _ref$isDiffChange === void 0 ? false : _ref$isDiffChange;
|
|
19
30
|
var strTitle = label;
|
|
20
31
|
var index = strTitle === null || strTitle === void 0 ? void 0 : strTitle.indexOf(searchStr);
|
|
21
32
|
var beforeStr = strTitle === null || strTitle === void 0 ? void 0 : strTitle.substring(0, index);
|
|
@@ -183,23 +183,21 @@ function List(props, ref) {
|
|
|
183
183
|
setAutoExpandParent(false);
|
|
184
184
|
};
|
|
185
185
|
if (mode === 'render') {
|
|
186
|
-
return (0, _jsxRuntime.jsx)(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
height: 432
|
|
202
|
-
})
|
|
186
|
+
return (0, _jsxRuntime.jsx)(_antd.Tree, {
|
|
187
|
+
disabled: disabled,
|
|
188
|
+
style: {
|
|
189
|
+
width: '100%'
|
|
190
|
+
},
|
|
191
|
+
checkable: true,
|
|
192
|
+
treeData: _treeData,
|
|
193
|
+
onExpand: onExpand,
|
|
194
|
+
expandedKeys: expandedKeys,
|
|
195
|
+
autoExpandParent: autoExpandParent,
|
|
196
|
+
selectable: false,
|
|
197
|
+
onCheck: onCheck,
|
|
198
|
+
checkedKeys: checkedValues,
|
|
199
|
+
checkStrictly: searchStr ? true : checkStrictly,
|
|
200
|
+
height: 432
|
|
203
201
|
});
|
|
204
202
|
}
|
|
205
203
|
return (0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
@@ -20,6 +20,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
20
20
|
var _index = require("../index");
|
|
21
21
|
var _components = require("./components");
|
|
22
22
|
var _utils = require("./utils");
|
|
23
|
+
var _index2 = require("../ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index");
|
|
23
24
|
var _inputSearch = _interopRequireDefault(require("../assets/input-search.svg"));
|
|
24
25
|
var _locale = _interopRequireWildcard(require("../locale"));
|
|
25
26
|
require("./style/index.less");
|
|
@@ -27,7 +28,7 @@ require("./style/index.less");
|
|
|
27
28
|
* @Author: za-xuwenli xuwenli@zhongan.io
|
|
28
29
|
* @Date: 2024-06-04 10:01:18
|
|
29
30
|
* @LastEditors: za-xuwenli xuwenli@zhongan.io
|
|
30
|
-
* @LastEditTime: 2024-
|
|
31
|
+
* @LastEditTime: 2024-09-27 11:49:28
|
|
31
32
|
* @FilePath: /za-material-warehouse/src/ProTreeModal/index.tsx
|
|
32
33
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
33
34
|
*/
|
|
@@ -100,7 +101,8 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
100
101
|
flatTreeData: [],
|
|
101
102
|
searchStr: '',
|
|
102
103
|
checkAll: false,
|
|
103
|
-
allKeys: []
|
|
104
|
+
allKeys: [],
|
|
105
|
+
transformedTree: []
|
|
104
106
|
}),
|
|
105
107
|
_useSetState2 = (0, _slicedToArray2.default)(_useSetState, 2),
|
|
106
108
|
state = _useSetState2[0],
|
|
@@ -222,6 +224,12 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
222
224
|
});
|
|
223
225
|
}
|
|
224
226
|
}, [value, state.allKeys, state.open]);
|
|
227
|
+
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
228
|
+
var transformedTree = (0, _utils.addLevelAndParentId)(state.treeData, fieldNames);
|
|
229
|
+
setState({
|
|
230
|
+
transformedTree: transformedTree
|
|
231
|
+
});
|
|
232
|
+
}, [state.treeData]);
|
|
225
233
|
var handleClick = function handleClick() {
|
|
226
234
|
setState({
|
|
227
235
|
open: true
|
|
@@ -362,8 +370,55 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
362
370
|
var onCheck = function onCheck(checkedKeys, info) {
|
|
363
371
|
var checkedValues = (0, _toConsumableArray2.default)(state.checkedValues);
|
|
364
372
|
var originalTreeData = state.originalTreeData;
|
|
373
|
+
// 如果有检索则自管理
|
|
374
|
+
if (state.searchStr) {
|
|
375
|
+
var _transformTreeToArray;
|
|
376
|
+
var node = info.node;
|
|
377
|
+
// 从完整树中找到当前节点
|
|
378
|
+
var activeNode = (0, _index2.treeNodeFind)(state.transformedTree, function (t) {
|
|
379
|
+
return t[fieldNameValue] === node[fieldNameValue];
|
|
380
|
+
}, {
|
|
381
|
+
childrenKey: fieldNames.children
|
|
382
|
+
});
|
|
383
|
+
var allChildren = (_transformTreeToArray = (0, _index2.transformTreeToArray)([activeNode], {
|
|
384
|
+
childrenKey: fieldNames.children
|
|
385
|
+
})) === null || _transformTreeToArray === void 0 ? void 0 : _transformTreeToArray.map(function (item) {
|
|
386
|
+
return item[fieldNameValue];
|
|
387
|
+
});
|
|
388
|
+
// 子项合并勾选
|
|
389
|
+
checkedValues = checkedValues.concat(allChildren);
|
|
390
|
+
// 从完整树中拿到父节点 只要存在父节点,那么就判断当前children是否全被勾选 若全被勾选就合并当前key到勾选队列
|
|
391
|
+
var _recourse2 = function _recourse(findNode) {
|
|
392
|
+
if (findNode.parentId) {
|
|
393
|
+
var _transformTreeToArray2;
|
|
394
|
+
var parentNode = (0, _index2.treeNodeFind)(state.transformedTree, function (t) {
|
|
395
|
+
return t[fieldNameValue] === findNode.parentId;
|
|
396
|
+
}, {
|
|
397
|
+
childrenKey: fieldNames.children
|
|
398
|
+
});
|
|
399
|
+
var parentChildrenKeys = (_transformTreeToArray2 = (0, _index2.transformTreeToArray)([parentNode], {
|
|
400
|
+
childrenKey: fieldNames.children
|
|
401
|
+
})) === null || _transformTreeToArray2 === void 0 ? void 0 : _transformTreeToArray2.map(function (item) {
|
|
402
|
+
return item[fieldNameValue];
|
|
403
|
+
});
|
|
404
|
+
var parentChildrenAllChecked = parentChildrenKeys.every(function (key) {
|
|
405
|
+
return checkedValues.includes(key);
|
|
406
|
+
});
|
|
407
|
+
if (parentChildrenAllChecked) {
|
|
408
|
+
// 把当前父节点追加进来
|
|
409
|
+
checkedValues = checkedValues.concat([parentNode[fieldNameValue]]);
|
|
410
|
+
// 继续向上查找
|
|
411
|
+
if (parentNode.parentId) {
|
|
412
|
+
_recourse2(parentNode);
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
_recourse2(activeNode);
|
|
418
|
+
}
|
|
419
|
+
var _checkStrictly = state.searchStr ? true : checkStrictly;
|
|
365
420
|
// 此时应该取消掉自身并包含它所有的子集
|
|
366
|
-
if (!info.checked && !
|
|
421
|
+
if (!info.checked && !_checkStrictly) {
|
|
367
422
|
// 1. 取消自身
|
|
368
423
|
// 2. 把所有的子节点也要取消
|
|
369
424
|
var childrenkeys = [];
|
|
@@ -380,8 +435,8 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
380
435
|
return !parentKeys.includes(key);
|
|
381
436
|
});
|
|
382
437
|
} else {
|
|
383
|
-
//
|
|
384
|
-
if (
|
|
438
|
+
// _checkStrictly 模式下取 checkedKeys.checked 或者自身的 key
|
|
439
|
+
if (_checkStrictly) {
|
|
385
440
|
if (!info.checked) {
|
|
386
441
|
checkedValues = checkedValues.filter(function (key) {
|
|
387
442
|
return key !== info.node.key;
|
|
@@ -620,7 +675,7 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
620
675
|
});
|
|
621
676
|
case TREE:
|
|
622
677
|
return (0, _jsxRuntime.jsx)(_components.TreeView, {
|
|
623
|
-
treeData: state.
|
|
678
|
+
treeData: state.transformedTree,
|
|
624
679
|
originalTreeData: state.originalTreeData,
|
|
625
680
|
flatTreeData: state.flatTreeData,
|
|
626
681
|
checkedValues: state.checkedValues,
|
|
@@ -36,3 +36,4 @@ export declare function filterCheckedNodes(data: any, checkedKeys: any, searchSt
|
|
|
36
36
|
*/
|
|
37
37
|
export declare function getChildrenKeys(node: TreeDataProps, childrenKeys: string[], fieldNames: FieldNamesType, type: 'treeClose' | 'treeCheck'): void;
|
|
38
38
|
export declare const transformMessage: (obj: any, message: string) => string;
|
|
39
|
+
export declare const addLevelAndParentId: (tree: any[], fieldNames: any, currentLevel?: number, currentParentId?: any) => any[];
|
|
@@ -4,6 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
exports.addLevelAndParentId = void 0;
|
|
7
8
|
exports.filterCheckedNodes = filterCheckedNodes;
|
|
8
9
|
exports.findTreeNodeByKey = findTreeNodeByKey;
|
|
9
10
|
exports.getAllKeys = getAllKeys;
|
|
@@ -209,4 +210,23 @@ var transformMessage = exports.transformMessage = function transformMessage(obj,
|
|
|
209
210
|
_message = message.replaceAll("{".concat(key, "}"), obj[key]);
|
|
210
211
|
});
|
|
211
212
|
return _message;
|
|
213
|
+
};
|
|
214
|
+
var _addLevelAndParentId = exports.addLevelAndParentId = function addLevelAndParentId() {
|
|
215
|
+
var tree = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
216
|
+
var fieldNames = arguments.length > 1 ? arguments[1] : undefined;
|
|
217
|
+
var currentLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
218
|
+
var currentParentId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
219
|
+
var _fieldNames$children = fieldNames.children,
|
|
220
|
+
children = _fieldNames$children === void 0 ? 'children' : _fieldNames$children,
|
|
221
|
+
_fieldNames$value = fieldNames.value,
|
|
222
|
+
value = _fieldNames$value === void 0 ? 'value' : _fieldNames$value;
|
|
223
|
+
return tree.map(function (node) {
|
|
224
|
+
var newNode = (0, _objectSpread4.default)({}, node);
|
|
225
|
+
newNode.level = currentLevel;
|
|
226
|
+
newNode.parentId = currentParentId;
|
|
227
|
+
if (node[children]) {
|
|
228
|
+
newNode[children] = _addLevelAndParentId(node[children], fieldNames, currentLevel + 1, newNode[value]);
|
|
229
|
+
}
|
|
230
|
+
return newNode;
|
|
231
|
+
});
|
|
212
232
|
};
|