fan-standard-comp 3.2.1 → 3.2.3
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/Readme.md +2 -32
- package/dist/09cd8e9be7081f2166444cce393fe968.svg +54 -0
- package/dist/e3378c145b7db195ad068735e15fb28a.svg +165 -0
- package/dist/fan-standard-comp.umd.js +183 -439
- package/dist/fonts/iconfont.ttf +0 -0
- package/dist/fonts/iconfont.woff +0 -0
- package/dist/fonts/lg.ttf +0 -0
- package/dist/fonts/lg.woff +0 -0
- package/dist/fonts/lg.woff2 +0 -0
- package/es/ButtonGroup/ButtonList.d.ts +2 -1
- package/es/ButtonGroup/ButtonMenu.d.ts +2 -1
- package/es/ButtonGroup/PopConfirmTitle.js +5 -5
- package/es/ButtonGroup/index.d.ts +3 -1
- package/es/ButtonGroup/index.js +146 -180
- package/es/ButtonGroup/style/index.less +4 -1
- package/es/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
- package/es/CalendarCoordPicker/CalendarMonthPicker.js +26 -0
- package/es/CalendarCoordPicker/index.d.ts +8 -0
- package/es/CalendarCoordPicker/index.js +296 -0
- package/es/CalendarCoordPicker/index.less +31 -0
- package/es/ConfigContext/index.d.ts +7 -0
- package/es/ConfigContext/index.js +12 -0
- package/es/DragContent/index.d.ts +1 -1
- package/es/DragContent/index.js +5 -5
- package/es/FormComp/ChunkUploader/api.js +14 -14
- package/es/FormComp/ChunkUploader/index.js +132 -139
- package/es/FormComp/ChunkUploader/lib.js +21 -21
- package/es/FormComp/ChunkUploader/upload-queue.class.js +64 -66
- package/es/FormComp/EditButton/index.d.ts +1 -1
- package/es/FormComp/EditButton/index.js +15 -17
- package/es/FormComp/FieldComponent/ReUpload.d.ts +1 -1
- package/es/FormComp/FieldComponent/ReUpload.js +37 -23
- package/es/FormComp/FieldComponent/RefactorTextarea.js +32 -0
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +72 -19
- package/es/FormComp/FieldComponent/TitleNode.d.ts +2 -1
- package/es/FormComp/FieldComponent/index.d.ts +1 -1
- package/es/FormComp/FieldComponent/index.js +37 -26
- package/es/FormComp/FieldComponent/setReadonlyValues.js +6 -6
- package/es/FormComp/RenderItemGroup/index.js +24 -8
- package/es/FormComp/Uploader/index.d.ts +9 -2
- package/es/FormComp/Uploader/index.js +325 -156
- package/es/FormComp/VarTemplate/index.js +57 -64
- package/es/ImageGallery/ImagePreview.d.ts +13 -0
- package/es/ImageGallery/ImagePreview.js +168 -0
- package/es/ImageGallery/PreviewStyles/ImagePreview.less +730 -0
- package/es/ImageGallery/PreviewStyles/fonts/lg.svg +54 -0
- package/es/ImageGallery/PreviewStyles/fonts/lg.ttf +0 -0
- package/es/ImageGallery/PreviewStyles/fonts/lg.woff +0 -0
- package/es/ImageGallery/PreviewStyles/fonts/lg.woff2 +0 -0
- package/es/ImageGallery/PreviewStyles/lg-thumbnail.css +108 -0
- package/es/ImageGallery/PreviewStyles/lg-video.css +144 -0
- package/es/ImageGallery/PreviewStyles/lg-zoom.css +116 -0
- package/es/ImageGallery/PreviewStyles/lightgallery.css +728 -0
- package/es/ImageGallery/SliderContent.d.ts +7 -0
- package/es/ImageGallery/SliderContent.js +699 -0
- package/es/ImageGallery/Thumbnail.d.ts +3 -0
- package/es/ImageGallery/Thumbnail.js +296 -0
- package/es/ImageGallery/hook/uniqueId.d.ts +1 -0
- package/es/ImageGallery/hook/uniqueId.js +10 -0
- package/es/ImageGallery/index.d.ts +4 -0
- package/es/ImageGallery/index.js +29 -0
- package/es/ImageGallery/style/index.less +5 -0
- package/es/ImageGallery/types.d.ts +5 -0
- package/es/ImageGallery/types.js +1 -0
- package/es/NavLeafScroll/index.js +94 -50
- package/es/RefactorTree/index.d.ts +1 -1
- package/es/RefactorTree/index.js +6 -6
- package/es/RefactorTree/indexTreeNode.d.ts +1 -1
- package/es/RefactorTree/indexTreeNode.js +19 -17
- package/es/RefactorTree/util.js +18 -18
- package/es/SpecIcon/fonts/demo_index.html +559 -5
- package/es/SpecIcon/fonts/iconfont.css +101 -3
- package/es/SpecIcon/fonts/iconfont.js +34 -27
- package/es/SpecIcon/fonts/iconfont.json +168 -0
- package/es/SpecIcon/fonts/iconfont.svg +163 -171
- package/es/SpecIcon/fonts/iconfont.ttf +0 -0
- package/es/SpecIcon/fonts/iconfont.woff +0 -0
- package/es/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/es/SpecIcon/style/iconfont.less +106 -11
- package/es/SplitterLayout/Pane.d.ts +1 -1
- package/es/SplitterLayout/index.js +25 -26
- package/es/StandardContent/SplitterLayout/Pane.js +3 -3
- package/es/StandardContent/SplitterLayout/index.js +25 -26
- package/es/StandardContent/SubfieldContent.d.ts +1 -1
- package/es/StandardContent/WrapperContent.d.ts +1 -1
- package/es/StandardDragModal/index.d.ts +11 -3
- package/es/StandardDragModal/index.js +25 -3
- package/es/StandardFilter/index.d.ts +5 -16
- package/es/StandardFilter/index.js +212 -200
- package/es/StandardFilter/indexClass.d.ts +37 -0
- package/es/StandardFilter/indexClass.js +217 -0
- package/es/StandardFilter/style/index.less +82 -9
- package/es/StandardForm/StepForm.d.ts +1 -1
- package/es/StandardForm/StepForm.js +28 -22
- package/es/StandardForm/TabForm.d.ts +1 -1
- package/es/StandardForm/TabForm.js +41 -43
- package/es/StandardForm/index.d.ts +1 -1
- package/es/StandardForm/index.js +5 -5
- package/es/StandardModal/UpdateFormRef.js +0 -1
- package/es/StandardModal/index.d.ts +2 -1
- package/es/StandardModal/index.js +25 -39
- package/es/StandardPanel/index.d.ts +1 -1
- package/es/StandardPanel/index.js +7 -7
- package/es/StandardTable/index.d.ts +1 -0
- package/es/StandardTable/index.js +44 -26
- package/es/components/IconNode/index.d.ts +1 -1
- package/es/components/IconNode/index.js +0 -1
- package/es/data/general.config.js +31 -0
- package/es/index.d.ts +3 -1
- package/es/index.js +6 -2
- package/es/utils/filterPermission.js +7 -10
- package/es/utils/getParentNodes.js +101 -26
- package/es/utils/index.js +2 -3
- package/es/utils/urlUtils.js +76 -0
- package/lib/ButtonGroup/ButtonList.d.ts +2 -1
- package/lib/ButtonGroup/ButtonList.js +2 -3
- package/lib/ButtonGroup/ButtonMenu.d.ts +2 -1
- package/lib/ButtonGroup/ButtonMenu.js +2 -3
- package/lib/ButtonGroup/PopConfirmTitle.js +7 -8
- package/lib/ButtonGroup/index.d.ts +3 -1
- package/lib/ButtonGroup/index.js +150 -185
- package/lib/ButtonGroup/style/index.less +4 -1
- package/lib/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
- package/lib/CalendarCoordPicker/CalendarMonthPicker.js +36 -0
- package/lib/CalendarCoordPicker/index.d.ts +8 -0
- package/lib/CalendarCoordPicker/index.js +305 -0
- package/lib/CalendarCoordPicker/index.less +31 -0
- package/lib/ConfigContext/index.d.ts +7 -0
- package/lib/ConfigContext/index.js +17 -0
- package/lib/DragContent/DragBar.js +2 -3
- package/lib/DragContent/index.d.ts +1 -1
- package/lib/DragContent/index.js +9 -10
- package/lib/FormComp/ChunkUploader/api.js +15 -15
- package/lib/FormComp/ChunkUploader/index.js +135 -142
- package/lib/FormComp/ChunkUploader/lib.js +22 -22
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +66 -69
- package/lib/FormComp/ChunkUploader/worker.js +1 -1
- package/lib/FormComp/EditButton/index.d.ts +1 -1
- package/lib/FormComp/EditButton/index.js +19 -22
- package/lib/FormComp/FieldComponent/ReUpload.d.ts +1 -1
- package/lib/FormComp/FieldComponent/ReUpload.js +40 -28
- package/lib/FormComp/FieldComponent/RefactorTextarea.js +42 -0
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +75 -23
- package/lib/FormComp/FieldComponent/TitleNode.d.ts +2 -1
- package/lib/FormComp/FieldComponent/TitleNode.js +2 -3
- package/lib/FormComp/FieldComponent/index.d.ts +1 -1
- package/lib/FormComp/FieldComponent/index.js +41 -28
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +15 -20
- package/lib/FormComp/RenderItemGroup/index.js +26 -11
- package/lib/FormComp/Uploader/index.d.ts +9 -2
- package/lib/FormComp/Uploader/index.js +325 -159
- package/lib/FormComp/VarTemplate/index.js +63 -71
- package/lib/FormComp/index.js +1 -1
- package/lib/ImageGallery/ImagePreview.d.ts +13 -0
- package/lib/ImageGallery/ImagePreview.js +178 -0
- package/lib/ImageGallery/PreviewStyles/ImagePreview.less +730 -0
- package/lib/ImageGallery/PreviewStyles/fonts/lg.svg +54 -0
- package/lib/ImageGallery/PreviewStyles/fonts/lg.ttf +0 -0
- package/lib/ImageGallery/PreviewStyles/fonts/lg.woff +0 -0
- package/lib/ImageGallery/PreviewStyles/fonts/lg.woff2 +0 -0
- package/lib/ImageGallery/PreviewStyles/lg-thumbnail.css +108 -0
- package/lib/ImageGallery/PreviewStyles/lg-video.css +144 -0
- package/lib/ImageGallery/PreviewStyles/lg-zoom.css +116 -0
- package/lib/ImageGallery/PreviewStyles/lightgallery.css +728 -0
- package/lib/ImageGallery/SliderContent.d.ts +7 -0
- package/lib/ImageGallery/SliderContent.js +708 -0
- package/lib/ImageGallery/Thumbnail.d.ts +3 -0
- package/lib/ImageGallery/Thumbnail.js +306 -0
- package/lib/ImageGallery/hook/uniqueId.d.ts +1 -0
- package/lib/ImageGallery/hook/uniqueId.js +17 -0
- package/lib/ImageGallery/index.d.ts +4 -0
- package/lib/ImageGallery/index.js +36 -0
- package/lib/ImageGallery/style/index.less +5 -0
- package/lib/ImageGallery/types.d.ts +5 -0
- package/lib/ImageGallery/types.js +5 -0
- package/lib/NavLeafScroll/index.js +98 -55
- package/lib/RefactorTree/index.d.ts +1 -1
- package/lib/RefactorTree/index.js +10 -11
- package/lib/RefactorTree/indexTreeNode.d.ts +1 -1
- package/lib/RefactorTree/indexTreeNode.js +23 -22
- package/lib/RefactorTree/util.js +18 -18
- package/lib/SpecIcon/fonts/demo_index.html +559 -5
- package/lib/SpecIcon/fonts/iconfont.css +101 -3
- package/lib/SpecIcon/fonts/iconfont.js +34 -27
- package/lib/SpecIcon/fonts/iconfont.json +168 -0
- package/lib/SpecIcon/fonts/iconfont.svg +163 -171
- package/lib/SpecIcon/fonts/iconfont.ttf +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff +0 -0
- package/lib/SpecIcon/fonts/iconfont.woff2 +0 -0
- package/lib/SpecIcon/index.js +2 -3
- package/lib/SpecIcon/style/iconfont.less +106 -11
- package/lib/SplitterLayout/Pane.d.ts +1 -1
- package/lib/SplitterLayout/Pane.js +2 -3
- package/lib/SplitterLayout/index.js +27 -29
- package/lib/StandardContent/SplitterLayout/Pane.js +5 -6
- package/lib/StandardContent/SplitterLayout/index.js +27 -29
- package/lib/StandardContent/SubfieldContent.d.ts +1 -1
- package/lib/StandardContent/SubfieldContent.js +2 -3
- package/lib/StandardContent/WrapperContent.d.ts +1 -1
- package/lib/StandardContent/WrapperContent.js +2 -3
- package/lib/StandardDragModal/index.d.ts +11 -3
- package/lib/StandardDragModal/index.js +27 -33
- package/lib/StandardFilter/index.d.ts +5 -16
- package/lib/StandardFilter/index.js +215 -201
- package/lib/StandardFilter/indexClass.d.ts +37 -0
- package/lib/StandardFilter/indexClass.js +223 -0
- package/lib/StandardFilter/style/index.less +82 -9
- package/lib/StandardForm/ActionList.js +2 -3
- package/lib/StandardForm/StepForm.d.ts +1 -1
- package/lib/StandardForm/StepForm.js +32 -27
- package/lib/StandardForm/TabForm.d.ts +1 -1
- package/lib/StandardForm/TabForm.js +45 -48
- package/lib/StandardForm/index.d.ts +1 -1
- package/lib/StandardForm/index.js +9 -10
- package/lib/StandardModal/UpdateFormRef.js +3 -4
- package/lib/StandardModal/index.d.ts +2 -1
- package/lib/StandardModal/index.js +29 -43
- package/lib/StandardPanel/index.d.ts +1 -1
- package/lib/StandardPanel/index.js +11 -12
- package/lib/StandardTable/index.d.ts +1 -0
- package/lib/StandardTable/index.js +49 -29
- package/lib/components/IconNode/index.d.ts +1 -1
- package/lib/components/IconNode/index.js +2 -4
- package/lib/components/index.js +1 -1
- package/lib/data/func.code.js +2 -3
- package/lib/data/general.config.js +33 -3
- package/lib/data/index.js +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +30 -10
- package/lib/utils/ValueFormat.js +1 -2
- package/lib/utils/filterPermission.js +11 -18
- package/lib/utils/getParentNodes.js +103 -29
- package/lib/utils/index.js +5 -27
- package/lib/utils/urlUtils.js +82 -0
- package/package.json +15 -9
- package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
- package/dist/fonts/iconfont.eot +0 -0
- package/es/StandardDragModal/ChangeStandardModal.d.ts +0 -44
- package/es/StandardDragModal/ChangeStandardModal.js +0 -493
- package/es/StandardDragModal/DraggableModal.d.ts +0 -7
- package/es/StandardDragModal/DraggableModal.js +0 -31
- package/es/StandardDragModal/DraggableModalContext.d.ts +0 -9
- package/es/StandardDragModal/DraggableModalContext.js +0 -5
- package/es/StandardDragModal/DraggableModalInner.d.ts +0 -16
- package/es/StandardDragModal/DraggableModalInner.js +0 -114
- package/es/StandardDragModal/DraggableModalProvider.d.ts +0 -4
- package/es/StandardDragModal/DraggableModalProvider.js +0 -40
- package/es/StandardDragModal/Modal.d.ts +0 -11
- package/es/StandardDragModal/Modal.js +0 -24
- package/es/StandardDragModal/ResizeHandle.d.ts +0 -2
- package/es/StandardDragModal/ResizeHandle.js +0 -8
- package/es/StandardDragModal/clamp.d.ts +0 -1
- package/es/StandardDragModal/clamp.js +0 -3
- package/es/StandardDragModal/draggableModalReducer.d.ts +0 -66
- package/es/StandardDragModal/draggableModalReducer.js +0 -157
- package/es/StandardDragModal/getWindowSize.d.ts +0 -4
- package/es/StandardDragModal/getWindowSize.js +0 -6
- package/es/StandardDragModal/index.less +0 -65
- package/es/StandardDragModal/useDrag.d.ts +0 -5
- package/es/StandardDragModal/useDrag.js +0 -66
- package/es/StandardDragModal/usePrevious.d.ts +0 -1
- package/es/StandardDragModal/usePrevious.js +0 -8
- package/es/StandardDragModal/useResize.d.ts +0 -7
- package/es/StandardDragModal/useResize.js +0 -74
- package/es/utils/dictSelectUtil.js +0 -153
- package/lib/StandardDragModal/ChangeStandardModal.d.ts +0 -44
- package/lib/StandardDragModal/ChangeStandardModal.js +0 -502
- package/lib/StandardDragModal/DraggableModal.d.ts +0 -7
- package/lib/StandardDragModal/DraggableModal.js +0 -40
- package/lib/StandardDragModal/DraggableModalContext.d.ts +0 -9
- package/lib/StandardDragModal/DraggableModalContext.js +0 -15
- package/lib/StandardDragModal/DraggableModalInner.d.ts +0 -16
- package/lib/StandardDragModal/DraggableModalInner.js +0 -124
- package/lib/StandardDragModal/DraggableModalProvider.d.ts +0 -4
- package/lib/StandardDragModal/DraggableModalProvider.js +0 -48
- package/lib/StandardDragModal/Modal.d.ts +0 -11
- package/lib/StandardDragModal/Modal.js +0 -32
- package/lib/StandardDragModal/ResizeHandle.d.ts +0 -2
- package/lib/StandardDragModal/ResizeHandle.js +0 -18
- package/lib/StandardDragModal/clamp.d.ts +0 -1
- package/lib/StandardDragModal/clamp.js +0 -10
- package/lib/StandardDragModal/draggableModalReducer.d.ts +0 -66
- package/lib/StandardDragModal/draggableModalReducer.js +0 -167
- package/lib/StandardDragModal/getWindowSize.d.ts +0 -4
- package/lib/StandardDragModal/getWindowSize.js +0 -13
- package/lib/StandardDragModal/index.less +0 -65
- package/lib/StandardDragModal/useDrag.d.ts +0 -5
- package/lib/StandardDragModal/useDrag.js +0 -73
- package/lib/StandardDragModal/usePrevious.d.ts +0 -1
- package/lib/StandardDragModal/usePrevious.js +0 -15
- package/lib/StandardDragModal/useResize.d.ts +0 -7
- package/lib/StandardDragModal/useResize.js +0 -81
- package/lib/utils/dictSelectUtil.js +0 -161
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
+
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); }
|
|
1
7
|
/**
|
|
2
8
|
* @description 递归查看父级节点数据集合及当前节点数据
|
|
3
9
|
* @params {Array} list 当前需要过滤查看的数据集合、
|
|
@@ -10,7 +16,7 @@
|
|
|
10
16
|
* @result {Array} parentKeys 当前传入nodeKey值所有上级别父级数据关键字数据集合(keyParam)(倒序排列,根节点在最后一条)
|
|
11
17
|
* @result {Array} matchNode 当前传入nodeKey值所在的数据对象集合
|
|
12
18
|
* */
|
|
13
|
-
var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
19
|
+
export var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
14
20
|
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
15
21
|
childrenParam: 'children',
|
|
16
22
|
keyParam: 'value'
|
|
@@ -30,7 +36,7 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
30
36
|
}
|
|
31
37
|
return null;
|
|
32
38
|
};
|
|
33
|
-
var
|
|
39
|
+
var _deepFind = function deepFind(array, nodeId) {
|
|
34
40
|
for (var i = 0; i < array.length; i += 1) {
|
|
35
41
|
var node = array[i];
|
|
36
42
|
if (node[params.keyParam] === nodeId) {
|
|
@@ -39,7 +45,7 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
39
45
|
}
|
|
40
46
|
// 如果是单个
|
|
41
47
|
if (node[params.childrenParam] && node[params.childrenParam].length > 0) {
|
|
42
|
-
|
|
48
|
+
_deepFind(node[params.childrenParam] || node[params.childrenParam], nodeId);
|
|
43
49
|
nodeParent.push(node); // 将当前节点数据存储到父节点数据中
|
|
44
50
|
if (matchNode.length > 0) {
|
|
45
51
|
break; // 在子节点查找到了,需要跳出
|
|
@@ -76,12 +82,11 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
76
82
|
}
|
|
77
83
|
}*/
|
|
78
84
|
}
|
|
79
|
-
|
|
80
85
|
return matchNode; // 返回查找到的节点数据(格式为数组)
|
|
81
86
|
};
|
|
82
87
|
|
|
83
88
|
// 查找单个节点
|
|
84
|
-
var
|
|
89
|
+
var _findMatchItem = function findMatchItem(arrList, key) {
|
|
85
90
|
var matchItem;
|
|
86
91
|
for (var i = 0; i < arrList.length; i += 1) {
|
|
87
92
|
var node = arrList[i];
|
|
@@ -90,7 +95,7 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
90
95
|
break;
|
|
91
96
|
}
|
|
92
97
|
if (node[params.childrenParam]) {
|
|
93
|
-
matchItem =
|
|
98
|
+
matchItem = _findMatchItem(node[params.childrenParam], key);
|
|
94
99
|
}
|
|
95
100
|
}
|
|
96
101
|
return matchItem;
|
|
@@ -100,11 +105,11 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
100
105
|
// const {showCheckedStrategy} = extraProps;
|
|
101
106
|
// TODO 需要判断 showCheckedStrategy 值为 SHOW_PARENT、 SHOW_CHILD 、SHOW_ALL不同情况展示
|
|
102
107
|
nodeKey.map(function (key) {
|
|
103
|
-
var matchItem =
|
|
104
|
-
if (matchItem) matchNode.push(
|
|
108
|
+
var matchItem = _findMatchItem(list, key);
|
|
109
|
+
if (matchItem) matchNode.push(_findMatchItem(list, key));
|
|
105
110
|
});
|
|
106
111
|
} else {
|
|
107
|
-
|
|
112
|
+
_deepFind(list, nodeKey);
|
|
108
113
|
}
|
|
109
114
|
nodeParent.forEach(function (par) {
|
|
110
115
|
return parentKeys.push(par[params.keyParam]);
|
|
@@ -117,42 +122,47 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
117
122
|
};
|
|
118
123
|
|
|
119
124
|
/**
|
|
120
|
-
* @description
|
|
125
|
+
* @description 递归查找指定ID所有的子菜单与子功能集合
|
|
121
126
|
* @params {Array} childNode 当前需要过滤查看的数据集合、
|
|
122
127
|
* @params {Object} params 指定当前数据中,筛选对应子集合字段名及匹配标识值字段名
|
|
123
|
-
*
|
|
124
|
-
*
|
|
128
|
+
* (childrenParam:指当前子集合数据字段名(字符串表示单个,数组表示当前多个子集合字段名),keyParam: 指当前匹配标识值字段名)
|
|
129
|
+
* @params {Object} extra
|
|
125
130
|
*
|
|
126
131
|
* @result {Array} childKeys 所有子项的id
|
|
127
|
-
* @result {Array} nodeChildren
|
|
128
|
-
*
|
|
129
|
-
* @usage:
|
|
130
|
-
* getChildrenNodes(childNode, params)
|
|
132
|
+
* @result {Array} nodeChildren 当前传入nodeKey值所在的数据对象集合
|
|
131
133
|
* */
|
|
132
134
|
|
|
133
|
-
var getChildrenNodes = function getChildrenNodes(childNode) {
|
|
135
|
+
export var getChildrenNodes = function getChildrenNodes(childNode) {
|
|
134
136
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
135
137
|
childrenParam: 'children',
|
|
136
138
|
keyParam: 'value'
|
|
137
139
|
};
|
|
138
140
|
var childKeys = [];
|
|
139
141
|
var nodeChildren = []; // 存储:authId, types
|
|
140
|
-
var
|
|
142
|
+
var _deepFindChild = function deepFindChild(cList) {
|
|
141
143
|
Array.isArray(cList) && cList.forEach(function (item) {
|
|
142
144
|
childKeys.push(item[params.keyParam]);
|
|
143
145
|
nodeChildren.push(item);
|
|
144
|
-
if (item[params.childrenParam])
|
|
146
|
+
if (item[params.childrenParam]) _deepFindChild(item[params.childrenParam]);
|
|
145
147
|
});
|
|
146
148
|
};
|
|
147
|
-
|
|
149
|
+
_deepFindChild(childNode);
|
|
148
150
|
return {
|
|
149
151
|
childKeys: childKeys,
|
|
150
152
|
nodeChildren: nodeChildren
|
|
151
153
|
};
|
|
152
154
|
};
|
|
153
155
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
/**
|
|
157
|
+
* @description 查找节点路径
|
|
158
|
+
* @params {Array} list 查询的数据源
|
|
159
|
+
* @params {Array} nodeKey 需要查询的key集合
|
|
160
|
+
* @params {Object} params 指定当前数据中,筛选对应子集合字段名及匹配标识值字段名
|
|
161
|
+
* (childrenParam:指当前子集合数据字段名(字符串表示单个,数组表示当前多个子集合字段名),keyParam: 指当前匹配标识值字段名)
|
|
162
|
+
*
|
|
163
|
+
* @result {Array} 所有匹配到的层级数据
|
|
164
|
+
* */
|
|
165
|
+
export var getNodePaths = function getNodePaths(list, nodeKey) {
|
|
156
166
|
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
157
167
|
childrenParam: 'children',
|
|
158
168
|
keyParam: 'value'
|
|
@@ -160,7 +170,7 @@ var getNodePaths = function getNodePaths(list, nodeKey) {
|
|
|
160
170
|
var extraProps = arguments.length > 3 ? arguments[3] : undefined;
|
|
161
171
|
// 获取指定节点的路径数组
|
|
162
172
|
var getPathByKey = function getPathByKey(value, arr) {
|
|
163
|
-
var
|
|
173
|
+
var _findNodePath = function findNodePath(node, value, nodePathArray) {
|
|
164
174
|
// 这里可以自定义push的内容,而不是整个node,而且这里node也包含了children
|
|
165
175
|
nodePathArray.push(node);
|
|
166
176
|
// 找到符合条件的节点,通过throw终止掉递归
|
|
@@ -170,7 +180,7 @@ var getNodePaths = function getNodePaths(list, nodeKey) {
|
|
|
170
180
|
}
|
|
171
181
|
if (node[params.childrenParam] && node[params.childrenParam].length > 0) {
|
|
172
182
|
for (var i = 0; i < node[params.childrenParam].length; i++) {
|
|
173
|
-
|
|
183
|
+
_findNodePath(node[params.childrenParam][i], value, nodePathArray);
|
|
174
184
|
}
|
|
175
185
|
// 当前节点的子节点遍历完依旧没找到,则删除路径中的该节点
|
|
176
186
|
nodePathArray.pop();
|
|
@@ -184,7 +194,7 @@ var getNodePaths = function getNodePaths(list, nodeKey) {
|
|
|
184
194
|
var nodePathArray = [];
|
|
185
195
|
try {
|
|
186
196
|
for (var i = 0; i < arr.length; i++) {
|
|
187
|
-
|
|
197
|
+
_findNodePath(arr[i], value, nodePathArray);
|
|
188
198
|
}
|
|
189
199
|
} catch (e) {
|
|
190
200
|
return nodePathArray;
|
|
@@ -199,4 +209,69 @@ var getNodePaths = function getNodePaths(list, nodeKey) {
|
|
|
199
209
|
}
|
|
200
210
|
return pathNode;
|
|
201
211
|
};
|
|
202
|
-
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* 数组转树形结构
|
|
215
|
+
* @param {array} list 被转换的数组
|
|
216
|
+
* @param {number|string} root 根节点(最外层节点)的 id
|
|
217
|
+
* @param {object} params 字段值(默认 { keyParam: 'id', parentParam: 'parentId' })
|
|
218
|
+
* @return array
|
|
219
|
+
*/
|
|
220
|
+
/**
|
|
221
|
+
* 数组转树形结构
|
|
222
|
+
* @param {array} list 被转换的数组
|
|
223
|
+
* @param {number|string} root 根节点(最外层节点)的 id
|
|
224
|
+
* @param {object} params 字段值(默认 { keyParam: 'id', parentParam: 'parentId' })
|
|
225
|
+
* @return array
|
|
226
|
+
*/
|
|
227
|
+
var _arrayToTree = function arrayToTree(list, rootId) {
|
|
228
|
+
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
229
|
+
_ref$keyParam = _ref.keyParam,
|
|
230
|
+
keyParam = _ref$keyParam === void 0 ? "id" : _ref$keyParam,
|
|
231
|
+
_ref$parentParam = _ref.parentParam,
|
|
232
|
+
parentParam = _ref$parentParam === void 0 ? "parentId" : _ref$parentParam,
|
|
233
|
+
_ref$childrenParam = _ref.childrenParam,
|
|
234
|
+
childrenParam = _ref$childrenParam === void 0 ? "children" : _ref$childrenParam;
|
|
235
|
+
var res = [];
|
|
236
|
+
list.forEach(function (item) {
|
|
237
|
+
if (item[parentParam] === rootId) {
|
|
238
|
+
var itemChildren = _arrayToTree(list, item[keyParam]);
|
|
239
|
+
if (itemChildren.length) item[childrenParam] = itemChildren;
|
|
240
|
+
res.push(item);
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
return res;
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* 多根树转换成数组
|
|
247
|
+
* @param {array} tree 被转换的树(仅限于只有一个根的树
|
|
248
|
+
* @return array
|
|
249
|
+
*/
|
|
250
|
+
export { _arrayToTree as arrayToTree };
|
|
251
|
+
export var convertToArray = function convertToArray(tree) {
|
|
252
|
+
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
253
|
+
_ref2$keyParam = _ref2.keyParam,
|
|
254
|
+
keyParam = _ref2$keyParam === void 0 ? "id" : _ref2$keyParam,
|
|
255
|
+
_ref2$parentParam = _ref2.parentParam,
|
|
256
|
+
parentParam = _ref2$parentParam === void 0 ? "parentId" : _ref2$parentParam,
|
|
257
|
+
_ref2$childrenParam = _ref2.childrenParam,
|
|
258
|
+
childrenParam = _ref2$childrenParam === void 0 ? "children" : _ref2$childrenParam;
|
|
259
|
+
var result = []; // 存放结果的数组
|
|
260
|
+
var sortCount = 0;
|
|
261
|
+
tree.forEach(function (item) {
|
|
262
|
+
var _loop = function loop(data) {
|
|
263
|
+
sortCount++;
|
|
264
|
+
result.push(_objectSpread(_objectSpread({}, data), {}, {
|
|
265
|
+
sort: sortCount
|
|
266
|
+
}));
|
|
267
|
+
var child = data[childrenParam];
|
|
268
|
+
if (child) {
|
|
269
|
+
for (var i = 0; i < child.length; i++) {
|
|
270
|
+
_loop(child[i]);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
_loop(item);
|
|
275
|
+
});
|
|
276
|
+
return result;
|
|
277
|
+
};
|
package/es/utils/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import UtilValueFormat from './ValueFormat';
|
|
2
|
-
|
|
3
|
-
export { UtilValueFormat
|
|
4
|
-
export * from './dictSelectUtil';
|
|
2
|
+
export * from './getParentNodes';
|
|
3
|
+
export { UtilValueFormat };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { parse } from "qs";
|
|
2
|
+
/**
|
|
3
|
+
* 获取url的search,并有条件:`^{变量名}`的条件取本地存储的数据 // 参数格式:^{变量名} 变量名支持数字、字母、下划线
|
|
4
|
+
* */
|
|
5
|
+
export var getUrlSearch = function getUrlSearch(href) {
|
|
6
|
+
var searchKeys = {};
|
|
7
|
+
if (isUrl(href)) {
|
|
8
|
+
var url = new URL(href);
|
|
9
|
+
searchKeys = parse(url.search, {
|
|
10
|
+
ignoreQueryPrefix: true // 去除第一个字符'?'
|
|
11
|
+
});
|
|
12
|
+
} else {
|
|
13
|
+
searchKeys = parse(href.split('?')[1], {
|
|
14
|
+
ignoreQueryPrefix: true // 去除第一个字符'?'
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
// 有带参数,取本地的数据
|
|
18
|
+
Object.keys(searchKeys).forEach(function (item) {
|
|
19
|
+
var _searchKeys$item;
|
|
20
|
+
// 取变量名对应本地的值
|
|
21
|
+
if (((_searchKeys$item = searchKeys[item]) === null || _searchKeys$item === void 0 ? void 0 : _searchKeys$item.indexOf('^{')) !== -1) {
|
|
22
|
+
// 清除"^{"与"}"取当前的
|
|
23
|
+
var keyParam = searchKeys[item].replace('^{', '').substring(0, searchKeys[item].replace('^{', '').lastIndexOf('}'));
|
|
24
|
+
searchKeys[item] = localStorage.getItem(keyParam) || undefined;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return searchKeys;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 获取url的search,并有条件:`^{变量名}`的条件取本地存储的数据 // 参数格式:^{变量名} 变量名支持数字、字母、下划线
|
|
32
|
+
* 根据url上的参数变量,重新调整跳转链接
|
|
33
|
+
* */
|
|
34
|
+
export var getJumpUrlBySearch = function getJumpUrlBySearch(href) {
|
|
35
|
+
var searchKeys = {};
|
|
36
|
+
var getPath;
|
|
37
|
+
if (isUrl(href)) {
|
|
38
|
+
var url = new URL(href);
|
|
39
|
+
searchKeys = parse(url.search, {
|
|
40
|
+
ignoreQueryPrefix: true // 去除第一个字符'?'
|
|
41
|
+
});
|
|
42
|
+
getPath = url.origin + url.pathname; // 取条件参数外的地址
|
|
43
|
+
} else {
|
|
44
|
+
searchKeys = parse(href.split('?')[1], {
|
|
45
|
+
ignoreQueryPrefix: true // 去除第一个字符'?'
|
|
46
|
+
});
|
|
47
|
+
getPath = href.split('?').length > 0 ? href.split('?')[0] : ''; // 取条件参数外的地址
|
|
48
|
+
}
|
|
49
|
+
// 有带参数,取本地的数据,然后拼接给地址
|
|
50
|
+
Object.keys(searchKeys).forEach(function (item, index) {
|
|
51
|
+
var _searchKeys$item2;
|
|
52
|
+
// 取变量名
|
|
53
|
+
if (((_searchKeys$item2 = searchKeys[item]) === null || _searchKeys$item2 === void 0 ? void 0 : _searchKeys$item2.indexOf('^{')) !== -1) {
|
|
54
|
+
// 清除"^{"与"}"取当前的
|
|
55
|
+
var keyParam = searchKeys[item].replace('^{', '').substring(0, searchKeys[item].replace('^{', '').lastIndexOf('}'));
|
|
56
|
+
searchKeys[item] = localStorage.getItem(keyParam) || '';
|
|
57
|
+
}
|
|
58
|
+
getPath += (index === 0 ? "?" : '&') + item + "=" + searchKeys[item];
|
|
59
|
+
});
|
|
60
|
+
return getPath;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* 是否是完整的URL
|
|
64
|
+
*
|
|
65
|
+
* */
|
|
66
|
+
export var isUrl = function isUrl(path) {
|
|
67
|
+
if (!path.startsWith('http')) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
var url = new URL(path);
|
|
72
|
+
return !!url;
|
|
73
|
+
} catch (error) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
@@ -13,7 +13,7 @@ var _SpecIcon = _interopRequireDefault(require("@/SpecIcon"));
|
|
|
13
13
|
var _ButtonMenu = _interopRequireDefault(require("./ButtonMenu"));
|
|
14
14
|
var _IconNode = _interopRequireDefault(require("@/components/IconNode"));
|
|
15
15
|
var _filterPermission = require("@/utils/filterPermission");
|
|
16
|
-
function _interopRequireDefault(
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
// 渲染按钮形式 (用于筛选)
|
|
18
18
|
|
|
19
19
|
var RenderButtonList = function RenderButtonList(item) {
|
|
@@ -39,5 +39,4 @@ var RenderButtonList = function RenderButtonList(item) {
|
|
|
39
39
|
} : null
|
|
40
40
|
}, item.exName || item.name);
|
|
41
41
|
};
|
|
42
|
-
var _default = RenderButtonList;
|
|
43
|
-
exports.default = _default;
|
|
42
|
+
var _default = exports.default = RenderButtonList;
|
|
@@ -8,7 +8,7 @@ require("antd/es/menu/style");
|
|
|
8
8
|
var _menu = _interopRequireDefault(require("antd/es/menu"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _IconNode = _interopRequireDefault(require("@/components/IconNode"));
|
|
11
|
-
function _interopRequireDefault(
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
// 渲染按钮多层级形式 (用于筛选)
|
|
13
13
|
|
|
14
14
|
var RenderButtonList = function RenderButtonList(group) {
|
|
@@ -40,5 +40,4 @@ var RenderButtonList = function RenderButtonList(group) {
|
|
|
40
40
|
}), " ", item.exName || item.name));
|
|
41
41
|
}));
|
|
42
42
|
};
|
|
43
|
-
var _default = RenderButtonList;
|
|
44
|
-
exports.default = _default;
|
|
43
|
+
var _default = exports.default = RenderButtonList;
|
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
function _interopRequireDefault(
|
|
9
|
-
function _toConsumableArray(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
10
10
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
11
|
-
function _unsupportedIterableToArray(
|
|
12
|
-
function _iterableToArray(
|
|
13
|
-
function _arrayWithoutHoles(
|
|
14
|
-
function _arrayLikeToArray(
|
|
11
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
13
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
15
|
// 气泡确认框标题配置
|
|
16
16
|
var PopConfirmTitle = function PopConfirmTitle(propsData) {
|
|
17
17
|
var confirmConfig = propsData.confirmConfig,
|
|
@@ -31,5 +31,4 @@ var PopConfirmTitle = function PopConfirmTitle(propsData) {
|
|
|
31
31
|
}
|
|
32
32
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, null);
|
|
33
33
|
};
|
|
34
|
-
var _default = PopConfirmTitle;
|
|
35
|
-
exports.default = _default;
|
|
34
|
+
var _default = exports.default = PopConfirmTitle;
|
|
@@ -27,6 +27,8 @@ interface ButtonGroupProps {
|
|
|
27
27
|
options?: ButtonGroupOptionsProps[];
|
|
28
28
|
min?: number;
|
|
29
29
|
dropdownConfig?: Object;
|
|
30
|
+
moreText?: string;
|
|
31
|
+
moreIcon?: React.ReactNode | string | number;
|
|
30
32
|
}
|
|
31
|
-
declare const ButtonGroup: (props: ButtonGroupProps) => JSX.Element;
|
|
33
|
+
declare const ButtonGroup: (props: ButtonGroupProps) => React.JSX.Element;
|
|
32
34
|
export default ButtonGroup;
|