fan-standard-comp 3.2.0 → 3.2.2
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 +1 -33
- package/dist/09cd8e9be7081f2166444cce393fe968.svg +54 -0
- package/dist/e3378c145b7db195ad068735e15fb28a.svg +165 -0
- package/dist/fan-standard-comp.umd.js +166 -444
- 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 +147 -178
- 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 +33 -23
- package/es/FormComp/FieldComponent/setReadonlyValues.js +6 -6
- package/es/FormComp/RenderItemGroup/index.js +24 -8
- package/es/FormComp/Uploader/index.d.ts +3 -1
- package/es/FormComp/Uploader/index.js +243 -119
- 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 +151 -183
- 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 +38 -26
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +15 -20
- package/lib/FormComp/RenderItemGroup/index.js +26 -11
- package/lib/FormComp/Uploader/index.d.ts +3 -1
- package/lib/FormComp/Uploader/index.js +244 -123
- 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 +14 -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
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
// 一些排版等基本配置值项 (后期可参考是否放入 locales内)
|
|
8
|
-
var _default = {
|
|
8
|
+
var _default = exports.default = {
|
|
9
9
|
// 表单 响应式排版
|
|
10
10
|
formLayout: {
|
|
11
11
|
labelCol: {
|
|
@@ -78,6 +78,8 @@ var _default = {
|
|
|
78
78
|
// 弹窗梯度大小及对应的表单栅格
|
|
79
79
|
modalSize: {
|
|
80
80
|
xs: {
|
|
81
|
+
columnNumber: 1,
|
|
82
|
+
// 栅格列数量
|
|
81
83
|
width: 420,
|
|
82
84
|
formLayout: {
|
|
83
85
|
labelCol: {
|
|
@@ -97,6 +99,8 @@ var _default = {
|
|
|
97
99
|
}
|
|
98
100
|
},
|
|
99
101
|
sm: {
|
|
102
|
+
columnNumber: 1,
|
|
103
|
+
// 栅格列数量
|
|
100
104
|
width: 680,
|
|
101
105
|
formLayout: {
|
|
102
106
|
labelCol: {
|
|
@@ -116,6 +120,8 @@ var _default = {
|
|
|
116
120
|
}
|
|
117
121
|
},
|
|
118
122
|
md: {
|
|
123
|
+
columnNumber: 2,
|
|
124
|
+
// 栅格列数量
|
|
119
125
|
width: 780,
|
|
120
126
|
formLayout: {
|
|
121
127
|
labelCol: {
|
|
@@ -136,6 +142,8 @@ var _default = {
|
|
|
136
142
|
},
|
|
137
143
|
// 宽度大,1000px下
|
|
138
144
|
lg: {
|
|
145
|
+
columnNumber: 3,
|
|
146
|
+
// 栅格列数量
|
|
139
147
|
width: 1000,
|
|
140
148
|
formLayout: {
|
|
141
149
|
labelCol: {
|
|
@@ -156,6 +164,8 @@ var _default = {
|
|
|
156
164
|
},
|
|
157
165
|
// 超级宽度大,1200px下
|
|
158
166
|
xlg: {
|
|
167
|
+
columnNumber: 3,
|
|
168
|
+
// 栅格列数量
|
|
159
169
|
width: 1200,
|
|
160
170
|
formLayout: {
|
|
161
171
|
labelCol: {
|
|
@@ -173,7 +183,27 @@ var _default = {
|
|
|
173
183
|
span: 21
|
|
174
184
|
}
|
|
175
185
|
}
|
|
186
|
+
},
|
|
187
|
+
xxlg: {
|
|
188
|
+
columnNumber: 4,
|
|
189
|
+
// 栅格列数量
|
|
190
|
+
width: 1400,
|
|
191
|
+
formLayout: {
|
|
192
|
+
labelCol: {
|
|
193
|
+
span: 8
|
|
194
|
+
},
|
|
195
|
+
wrapperCol: {
|
|
196
|
+
span: 16
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
formBlockLayout: {
|
|
200
|
+
labelCol: {
|
|
201
|
+
span: 2
|
|
202
|
+
},
|
|
203
|
+
wrapperCol: {
|
|
204
|
+
span: 22
|
|
205
|
+
}
|
|
206
|
+
}
|
|
176
207
|
}
|
|
177
208
|
}
|
|
178
|
-
};
|
|
179
|
-
exports.default = _default;
|
|
209
|
+
};
|
package/lib/data/index.js
CHANGED
|
@@ -17,4 +17,4 @@ Object.defineProperty(exports, "general", {
|
|
|
17
17
|
});
|
|
18
18
|
var _general = _interopRequireDefault(require("./general.config"));
|
|
19
19
|
var _func = _interopRequireDefault(require("./func.code"));
|
|
20
|
-
function _interopRequireDefault(
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/lib/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export { default as StepForm } from './StandardForm/StepForm';
|
|
|
8
8
|
export { default as TabForm } from './StandardForm/TabForm';
|
|
9
9
|
export { default as StandardFilter } from './StandardFilter';
|
|
10
10
|
export { default as StandardModal } from './StandardModal';
|
|
11
|
-
export { default as StandardDragModal } from './StandardDragModal/Modal';
|
|
12
11
|
export { default as Uploader } from './FormComp/Uploader';
|
|
13
12
|
export { default as EditButton } from './FormComp/EditButton';
|
|
14
13
|
export { default as FieldComponent } from './FormComp/FieldComponent';
|
|
@@ -23,3 +22,6 @@ export { default as NavLeafScroll } from './NavLeafScroll';
|
|
|
23
22
|
export * from './components';
|
|
24
23
|
export * from './utils';
|
|
25
24
|
export * from './data';
|
|
25
|
+
export * from './ConfigContext';
|
|
26
|
+
export { default as ImageGallery } from './ImageGallery/index';
|
|
27
|
+
export { default as ImagePreview } from './ImageGallery/ImagePreview';
|
package/lib/index.js
CHANGED
|
@@ -14,7 +14,6 @@ var _exportNames = {
|
|
|
14
14
|
TabForm: true,
|
|
15
15
|
StandardFilter: true,
|
|
16
16
|
StandardModal: true,
|
|
17
|
-
StandardDragModal: true,
|
|
18
17
|
Uploader: true,
|
|
19
18
|
EditButton: true,
|
|
20
19
|
FieldComponent: true,
|
|
@@ -25,7 +24,9 @@ var _exportNames = {
|
|
|
25
24
|
WrapperContent: true,
|
|
26
25
|
DragContent: true,
|
|
27
26
|
SplitterLayout: true,
|
|
28
|
-
NavLeafScroll: true
|
|
27
|
+
NavLeafScroll: true,
|
|
28
|
+
ImageGallery: true,
|
|
29
|
+
ImagePreview: true
|
|
29
30
|
};
|
|
30
31
|
Object.defineProperty(exports, "ButtonGroup", {
|
|
31
32
|
enumerable: true,
|
|
@@ -57,6 +58,18 @@ Object.defineProperty(exports, "FieldComponent", {
|
|
|
57
58
|
return _FieldComponent.default;
|
|
58
59
|
}
|
|
59
60
|
});
|
|
61
|
+
Object.defineProperty(exports, "ImageGallery", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function get() {
|
|
64
|
+
return _index.default;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
Object.defineProperty(exports, "ImagePreview", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
get: function get() {
|
|
70
|
+
return _ImagePreview.default;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
60
73
|
Object.defineProperty(exports, "ItemGroup", {
|
|
61
74
|
enumerable: true,
|
|
62
75
|
get: function get() {
|
|
@@ -93,12 +106,6 @@ Object.defineProperty(exports, "SplitterLayout", {
|
|
|
93
106
|
return _SplitterLayout.default;
|
|
94
107
|
}
|
|
95
108
|
});
|
|
96
|
-
Object.defineProperty(exports, "StandardDragModal", {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function get() {
|
|
99
|
-
return _Modal.default;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
109
|
Object.defineProperty(exports, "StandardFilter", {
|
|
103
110
|
enumerable: true,
|
|
104
111
|
get: function get() {
|
|
@@ -169,7 +176,6 @@ var _StepForm = _interopRequireDefault(require("./StandardForm/StepForm"));
|
|
|
169
176
|
var _TabForm = _interopRequireDefault(require("./StandardForm/TabForm"));
|
|
170
177
|
var _StandardFilter = _interopRequireDefault(require("./StandardFilter"));
|
|
171
178
|
var _StandardModal = _interopRequireDefault(require("./StandardModal"));
|
|
172
|
-
var _Modal = _interopRequireDefault(require("./StandardDragModal/Modal"));
|
|
173
179
|
var _Uploader = _interopRequireDefault(require("./FormComp/Uploader"));
|
|
174
180
|
var _EditButton = _interopRequireDefault(require("./FormComp/EditButton"));
|
|
175
181
|
var _FieldComponent = _interopRequireDefault(require("./FormComp/FieldComponent"));
|
|
@@ -215,4 +221,18 @@ Object.keys(_data).forEach(function (key) {
|
|
|
215
221
|
}
|
|
216
222
|
});
|
|
217
223
|
});
|
|
218
|
-
|
|
224
|
+
var _ConfigContext = require("./ConfigContext");
|
|
225
|
+
Object.keys(_ConfigContext).forEach(function (key) {
|
|
226
|
+
if (key === "default" || key === "__esModule") return;
|
|
227
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
228
|
+
if (key in exports && exports[key] === _ConfigContext[key]) return;
|
|
229
|
+
Object.defineProperty(exports, key, {
|
|
230
|
+
enumerable: true,
|
|
231
|
+
get: function get() {
|
|
232
|
+
return _ConfigContext[key];
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
var _index = _interopRequireDefault(require("./ImageGallery/index"));
|
|
237
|
+
var _ImagePreview = _interopRequireDefault(require("./ImageGallery/ImagePreview"));
|
|
238
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/lib/utils/ValueFormat.js
CHANGED
|
@@ -5,15 +5,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.removeNoPermission = exports.btnIsHide = exports.btnIsDisabled = exports.btnClickFunc = void 0;
|
|
7
7
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
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; }
|
|
10
10
|
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; }
|
|
11
|
-
function _defineProperty(
|
|
12
|
-
function _toPropertyKey(
|
|
13
|
-
function _toPrimitive(
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
13
|
+
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); }
|
|
14
14
|
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); }
|
|
15
15
|
// 按钮方法
|
|
16
|
-
var btnClickFunc = function btnClickFunc(fn) {
|
|
16
|
+
var btnClickFunc = exports.btnClickFunc = function btnClickFunc(fn) {
|
|
17
17
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
18
18
|
if (!fn) return null;
|
|
19
19
|
var paramsArr = [];
|
|
@@ -25,12 +25,10 @@ var btnClickFunc = function btnClickFunc(fn) {
|
|
|
25
25
|
if (typeof fn === 'function') {
|
|
26
26
|
return fn.apply(void 0, paramsArr); // 表格列返回的是方法
|
|
27
27
|
}
|
|
28
|
-
|
|
29
28
|
return fn;
|
|
30
29
|
};
|
|
31
30
|
// 按钮是否禁用
|
|
32
|
-
exports.
|
|
33
|
-
var btnIsDisabled = function btnIsDisabled(isDisabled) {
|
|
31
|
+
var btnIsDisabled = exports.btnIsDisabled = function btnIsDisabled(isDisabled) {
|
|
34
32
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
35
33
|
if (!isDisabled) return false;
|
|
36
34
|
var paramsArr = [];
|
|
@@ -42,12 +40,10 @@ var btnIsDisabled = function btnIsDisabled(isDisabled) {
|
|
|
42
40
|
if (typeof isDisabled === 'function') {
|
|
43
41
|
return isDisabled.apply(void 0, paramsArr); // 表格列返回的是方法
|
|
44
42
|
}
|
|
45
|
-
|
|
46
43
|
return isDisabled;
|
|
47
44
|
};
|
|
48
45
|
// 按钮是否隐藏
|
|
49
|
-
exports.
|
|
50
|
-
var btnIsHide = function btnIsHide(isHide) {
|
|
46
|
+
var btnIsHide = exports.btnIsHide = function btnIsHide(isHide) {
|
|
51
47
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
52
48
|
if (!isHide) return false;
|
|
53
49
|
var paramsArr = [];
|
|
@@ -59,15 +55,13 @@ var btnIsHide = function btnIsHide(isHide) {
|
|
|
59
55
|
if (typeof isHide === 'function') {
|
|
60
56
|
return isHide.apply(void 0, paramsArr); // 表格列返回的是方法
|
|
61
57
|
}
|
|
62
|
-
|
|
63
58
|
return isHide;
|
|
64
59
|
};
|
|
65
60
|
// 重新组合数据(排除不包含在permissionCodes内及isHide数据
|
|
66
|
-
exports.
|
|
67
|
-
var removeNoPermission = function removeNoPermission(array, permissionCodes, codes, params) {
|
|
61
|
+
var _removeNoPermission = exports.removeNoPermission = function removeNoPermission(array, permissionCodes, codes, params) {
|
|
68
62
|
return Array.isArray(array) && array.filter(function (item) {
|
|
69
63
|
if (item.children) {
|
|
70
|
-
item.children =
|
|
64
|
+
item.children = _removeNoPermission(item.children, permissionCodes, codes, params);
|
|
71
65
|
if (item.children.length === 0) return false; // 如果子集合过滤为空时,不返当前数据
|
|
72
66
|
}
|
|
73
67
|
// permissionCodes未定义,则直接返回不进行过滤
|
|
@@ -93,11 +87,10 @@ var removeNoPermission = function removeNoPermission(array, permissionCodes, cod
|
|
|
93
87
|
var _codes$matchIndex;
|
|
94
88
|
// 如果有配置code,则使用func.code.js里面配置的名称
|
|
95
89
|
resultItem = _objectSpread(_objectSpread(_objectSpread({}, resultItem), codes[matchIndex]), {}, {
|
|
96
|
-
icon: resultItem.icon || ((_codes$matchIndex = codes[matchIndex]) === null || _codes$matchIndex === void 0 ? void 0 : _codes$matchIndex.icon)
|
|
90
|
+
icon: resultItem.icon === '' || resultItem.icon === null ? resultItem.icon : resultItem.icon || ((_codes$matchIndex = codes[matchIndex]) === null || _codes$matchIndex === void 0 ? void 0 : _codes$matchIndex.icon)
|
|
97
91
|
});
|
|
98
92
|
}
|
|
99
93
|
}
|
|
100
94
|
return resultItem;
|
|
101
95
|
});
|
|
102
|
-
};
|
|
103
|
-
exports.removeNoPermission = removeNoPermission;
|
|
96
|
+
};
|
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getParentNodes = exports.getNodePaths = exports.getChildrenNodes = void 0;
|
|
6
|
+
exports.getParentNodes = exports.getNodePaths = exports.getChildrenNodes = exports.convertToArray = exports.arrayToTree = void 0;
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
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); }
|
|
7
13
|
/**
|
|
8
14
|
* @description 递归查看父级节点数据集合及当前节点数据
|
|
9
15
|
* @params {Array} list 当前需要过滤查看的数据集合、
|
|
@@ -16,7 +22,7 @@ exports.getParentNodes = exports.getNodePaths = exports.getChildrenNodes = void
|
|
|
16
22
|
* @result {Array} parentKeys 当前传入nodeKey值所有上级别父级数据关键字数据集合(keyParam)(倒序排列,根节点在最后一条)
|
|
17
23
|
* @result {Array} matchNode 当前传入nodeKey值所在的数据对象集合
|
|
18
24
|
* */
|
|
19
|
-
var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
25
|
+
var getParentNodes = exports.getParentNodes = function getParentNodes(list, nodeKey) {
|
|
20
26
|
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
21
27
|
childrenParam: 'children',
|
|
22
28
|
keyParam: 'value'
|
|
@@ -36,7 +42,7 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
36
42
|
}
|
|
37
43
|
return null;
|
|
38
44
|
};
|
|
39
|
-
var
|
|
45
|
+
var _deepFind = function deepFind(array, nodeId) {
|
|
40
46
|
for (var i = 0; i < array.length; i += 1) {
|
|
41
47
|
var node = array[i];
|
|
42
48
|
if (node[params.keyParam] === nodeId) {
|
|
@@ -45,7 +51,7 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
45
51
|
}
|
|
46
52
|
// 如果是单个
|
|
47
53
|
if (node[params.childrenParam] && node[params.childrenParam].length > 0) {
|
|
48
|
-
|
|
54
|
+
_deepFind(node[params.childrenParam] || node[params.childrenParam], nodeId);
|
|
49
55
|
nodeParent.push(node); // 将当前节点数据存储到父节点数据中
|
|
50
56
|
if (matchNode.length > 0) {
|
|
51
57
|
break; // 在子节点查找到了,需要跳出
|
|
@@ -82,12 +88,11 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
82
88
|
}
|
|
83
89
|
}*/
|
|
84
90
|
}
|
|
85
|
-
|
|
86
91
|
return matchNode; // 返回查找到的节点数据(格式为数组)
|
|
87
92
|
};
|
|
88
93
|
|
|
89
94
|
// 查找单个节点
|
|
90
|
-
var
|
|
95
|
+
var _findMatchItem = function findMatchItem(arrList, key) {
|
|
91
96
|
var matchItem;
|
|
92
97
|
for (var i = 0; i < arrList.length; i += 1) {
|
|
93
98
|
var node = arrList[i];
|
|
@@ -96,7 +101,7 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
96
101
|
break;
|
|
97
102
|
}
|
|
98
103
|
if (node[params.childrenParam]) {
|
|
99
|
-
matchItem =
|
|
104
|
+
matchItem = _findMatchItem(node[params.childrenParam], key);
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
107
|
return matchItem;
|
|
@@ -106,11 +111,11 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
106
111
|
// const {showCheckedStrategy} = extraProps;
|
|
107
112
|
// TODO 需要判断 showCheckedStrategy 值为 SHOW_PARENT、 SHOW_CHILD 、SHOW_ALL不同情况展示
|
|
108
113
|
nodeKey.map(function (key) {
|
|
109
|
-
var matchItem =
|
|
110
|
-
if (matchItem) matchNode.push(
|
|
114
|
+
var matchItem = _findMatchItem(list, key);
|
|
115
|
+
if (matchItem) matchNode.push(_findMatchItem(list, key));
|
|
111
116
|
});
|
|
112
117
|
} else {
|
|
113
|
-
|
|
118
|
+
_deepFind(list, nodeKey);
|
|
114
119
|
}
|
|
115
120
|
nodeParent.forEach(function (par) {
|
|
116
121
|
return parentKeys.push(par[params.keyParam]);
|
|
@@ -123,43 +128,47 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
123
128
|
};
|
|
124
129
|
|
|
125
130
|
/**
|
|
126
|
-
* @description
|
|
131
|
+
* @description 递归查找指定ID所有的子菜单与子功能集合
|
|
127
132
|
* @params {Array} childNode 当前需要过滤查看的数据集合、
|
|
128
133
|
* @params {Object} params 指定当前数据中,筛选对应子集合字段名及匹配标识值字段名
|
|
129
|
-
*
|
|
130
|
-
*
|
|
134
|
+
* (childrenParam:指当前子集合数据字段名(字符串表示单个,数组表示当前多个子集合字段名),keyParam: 指当前匹配标识值字段名)
|
|
135
|
+
* @params {Object} extra
|
|
131
136
|
*
|
|
132
137
|
* @result {Array} childKeys 所有子项的id
|
|
133
|
-
* @result {Array} nodeChildren
|
|
134
|
-
*
|
|
135
|
-
* @usage:
|
|
136
|
-
* getChildrenNodes(childNode, params)
|
|
138
|
+
* @result {Array} nodeChildren 当前传入nodeKey值所在的数据对象集合
|
|
137
139
|
* */
|
|
138
|
-
|
|
139
|
-
var getChildrenNodes = function getChildrenNodes(childNode) {
|
|
140
|
+
|
|
141
|
+
var getChildrenNodes = exports.getChildrenNodes = function getChildrenNodes(childNode) {
|
|
140
142
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
141
143
|
childrenParam: 'children',
|
|
142
144
|
keyParam: 'value'
|
|
143
145
|
};
|
|
144
146
|
var childKeys = [];
|
|
145
147
|
var nodeChildren = []; // 存储:authId, types
|
|
146
|
-
var
|
|
148
|
+
var _deepFindChild = function deepFindChild(cList) {
|
|
147
149
|
Array.isArray(cList) && cList.forEach(function (item) {
|
|
148
150
|
childKeys.push(item[params.keyParam]);
|
|
149
151
|
nodeChildren.push(item);
|
|
150
|
-
if (item[params.childrenParam])
|
|
152
|
+
if (item[params.childrenParam]) _deepFindChild(item[params.childrenParam]);
|
|
151
153
|
});
|
|
152
154
|
};
|
|
153
|
-
|
|
155
|
+
_deepFindChild(childNode);
|
|
154
156
|
return {
|
|
155
157
|
childKeys: childKeys,
|
|
156
158
|
nodeChildren: nodeChildren
|
|
157
159
|
};
|
|
158
160
|
};
|
|
159
161
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
162
|
+
/**
|
|
163
|
+
* @description 查找节点路径
|
|
164
|
+
* @params {Array} list 查询的数据源
|
|
165
|
+
* @params {Array} nodeKey 需要查询的key集合
|
|
166
|
+
* @params {Object} params 指定当前数据中,筛选对应子集合字段名及匹配标识值字段名
|
|
167
|
+
* (childrenParam:指当前子集合数据字段名(字符串表示单个,数组表示当前多个子集合字段名),keyParam: 指当前匹配标识值字段名)
|
|
168
|
+
*
|
|
169
|
+
* @result {Array} 所有匹配到的层级数据
|
|
170
|
+
* */
|
|
171
|
+
var getNodePaths = exports.getNodePaths = function getNodePaths(list, nodeKey) {
|
|
163
172
|
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
164
173
|
childrenParam: 'children',
|
|
165
174
|
keyParam: 'value'
|
|
@@ -167,7 +176,7 @@ var getNodePaths = function getNodePaths(list, nodeKey) {
|
|
|
167
176
|
var extraProps = arguments.length > 3 ? arguments[3] : undefined;
|
|
168
177
|
// 获取指定节点的路径数组
|
|
169
178
|
var getPathByKey = function getPathByKey(value, arr) {
|
|
170
|
-
var
|
|
179
|
+
var _findNodePath = function findNodePath(node, value, nodePathArray) {
|
|
171
180
|
// 这里可以自定义push的内容,而不是整个node,而且这里node也包含了children
|
|
172
181
|
nodePathArray.push(node);
|
|
173
182
|
// 找到符合条件的节点,通过throw终止掉递归
|
|
@@ -177,7 +186,7 @@ var getNodePaths = function getNodePaths(list, nodeKey) {
|
|
|
177
186
|
}
|
|
178
187
|
if (node[params.childrenParam] && node[params.childrenParam].length > 0) {
|
|
179
188
|
for (var i = 0; i < node[params.childrenParam].length; i++) {
|
|
180
|
-
|
|
189
|
+
_findNodePath(node[params.childrenParam][i], value, nodePathArray);
|
|
181
190
|
}
|
|
182
191
|
// 当前节点的子节点遍历完依旧没找到,则删除路径中的该节点
|
|
183
192
|
nodePathArray.pop();
|
|
@@ -191,7 +200,7 @@ var getNodePaths = function getNodePaths(list, nodeKey) {
|
|
|
191
200
|
var nodePathArray = [];
|
|
192
201
|
try {
|
|
193
202
|
for (var i = 0; i < arr.length; i++) {
|
|
194
|
-
|
|
203
|
+
_findNodePath(arr[i], value, nodePathArray);
|
|
195
204
|
}
|
|
196
205
|
} catch (e) {
|
|
197
206
|
return nodePathArray;
|
|
@@ -206,4 +215,69 @@ var getNodePaths = function getNodePaths(list, nodeKey) {
|
|
|
206
215
|
}
|
|
207
216
|
return pathNode;
|
|
208
217
|
};
|
|
209
|
-
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* 数组转树形结构
|
|
221
|
+
* @param {array} list 被转换的数组
|
|
222
|
+
* @param {number|string} root 根节点(最外层节点)的 id
|
|
223
|
+
* @param {object} params 字段值(默认 { keyParam: 'id', parentParam: 'parentId' })
|
|
224
|
+
* @return array
|
|
225
|
+
*/
|
|
226
|
+
/**
|
|
227
|
+
* 数组转树形结构
|
|
228
|
+
* @param {array} list 被转换的数组
|
|
229
|
+
* @param {number|string} root 根节点(最外层节点)的 id
|
|
230
|
+
* @param {object} params 字段值(默认 { keyParam: 'id', parentParam: 'parentId' })
|
|
231
|
+
* @return array
|
|
232
|
+
*/
|
|
233
|
+
var _arrayToTree = exports.arrayToTree = function arrayToTree(list, rootId) {
|
|
234
|
+
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
235
|
+
_ref$keyParam = _ref.keyParam,
|
|
236
|
+
keyParam = _ref$keyParam === void 0 ? "id" : _ref$keyParam,
|
|
237
|
+
_ref$parentParam = _ref.parentParam,
|
|
238
|
+
parentParam = _ref$parentParam === void 0 ? "parentId" : _ref$parentParam,
|
|
239
|
+
_ref$childrenParam = _ref.childrenParam,
|
|
240
|
+
childrenParam = _ref$childrenParam === void 0 ? "children" : _ref$childrenParam;
|
|
241
|
+
var res = [];
|
|
242
|
+
list.forEach(function (item) {
|
|
243
|
+
if (item[parentParam] === rootId) {
|
|
244
|
+
var itemChildren = _arrayToTree(list, item[keyParam]);
|
|
245
|
+
if (itemChildren.length) item[childrenParam] = itemChildren;
|
|
246
|
+
res.push(item);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
return res;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* 多根树转换成数组
|
|
253
|
+
* @param {array} tree 被转换的树(仅限于只有一个根的树
|
|
254
|
+
* @return array
|
|
255
|
+
*/
|
|
256
|
+
|
|
257
|
+
var convertToArray = exports.convertToArray = function convertToArray(tree) {
|
|
258
|
+
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
259
|
+
_ref2$keyParam = _ref2.keyParam,
|
|
260
|
+
keyParam = _ref2$keyParam === void 0 ? "id" : _ref2$keyParam,
|
|
261
|
+
_ref2$parentParam = _ref2.parentParam,
|
|
262
|
+
parentParam = _ref2$parentParam === void 0 ? "parentId" : _ref2$parentParam,
|
|
263
|
+
_ref2$childrenParam = _ref2.childrenParam,
|
|
264
|
+
childrenParam = _ref2$childrenParam === void 0 ? "children" : _ref2$childrenParam;
|
|
265
|
+
var result = []; // 存放结果的数组
|
|
266
|
+
var sortCount = 0;
|
|
267
|
+
tree.forEach(function (item) {
|
|
268
|
+
var _loop = function loop(data) {
|
|
269
|
+
sortCount++;
|
|
270
|
+
result.push(_objectSpread(_objectSpread({}, data), {}, {
|
|
271
|
+
sort: sortCount
|
|
272
|
+
}));
|
|
273
|
+
var child = data[childrenParam];
|
|
274
|
+
if (child) {
|
|
275
|
+
for (var i = 0; i < child.length; i++) {
|
|
276
|
+
_loop(child[i]);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
_loop(item);
|
|
281
|
+
});
|
|
282
|
+
return result;
|
|
283
|
+
};
|
package/lib/utils/index.js
CHANGED
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
-
UtilValueFormat: true
|
|
8
|
-
getParentNodes: true,
|
|
9
|
-
getChildrenNodes: true,
|
|
10
|
-
getNodePaths: true
|
|
7
|
+
UtilValueFormat: true
|
|
11
8
|
};
|
|
12
9
|
Object.defineProperty(exports, "UtilValueFormat", {
|
|
13
10
|
enumerable: true,
|
|
@@ -15,36 +12,17 @@ Object.defineProperty(exports, "UtilValueFormat", {
|
|
|
15
12
|
return _ValueFormat.default;
|
|
16
13
|
}
|
|
17
14
|
});
|
|
18
|
-
Object.defineProperty(exports, "getChildrenNodes", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _getParentNodes.getChildrenNodes;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(exports, "getNodePaths", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _getParentNodes.getNodePaths;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "getParentNodes", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function get() {
|
|
33
|
-
return _getParentNodes.getParentNodes;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
15
|
var _ValueFormat = _interopRequireDefault(require("./ValueFormat"));
|
|
37
16
|
var _getParentNodes = require("./getParentNodes");
|
|
38
|
-
|
|
39
|
-
Object.keys(_dictSelectUtil).forEach(function (key) {
|
|
17
|
+
Object.keys(_getParentNodes).forEach(function (key) {
|
|
40
18
|
if (key === "default" || key === "__esModule") return;
|
|
41
19
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
42
|
-
if (key in exports && exports[key] ===
|
|
20
|
+
if (key in exports && exports[key] === _getParentNodes[key]) return;
|
|
43
21
|
Object.defineProperty(exports, key, {
|
|
44
22
|
enumerable: true,
|
|
45
23
|
get: function get() {
|
|
46
|
-
return
|
|
24
|
+
return _getParentNodes[key];
|
|
47
25
|
}
|
|
48
26
|
});
|
|
49
27
|
});
|
|
50
|
-
function _interopRequireDefault(
|
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isUrl = exports.getUrlSearch = exports.getJumpUrlBySearch = void 0;
|
|
7
|
+
var _qs = require("qs");
|
|
8
|
+
/**
|
|
9
|
+
* 获取url的search,并有条件:`^{变量名}`的条件取本地存储的数据 // 参数格式:^{变量名} 变量名支持数字、字母、下划线
|
|
10
|
+
* */
|
|
11
|
+
var getUrlSearch = exports.getUrlSearch = function getUrlSearch(href) {
|
|
12
|
+
var searchKeys = {};
|
|
13
|
+
if (isUrl(href)) {
|
|
14
|
+
var url = new URL(href);
|
|
15
|
+
searchKeys = (0, _qs.parse)(url.search, {
|
|
16
|
+
ignoreQueryPrefix: true // 去除第一个字符'?'
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
searchKeys = (0, _qs.parse)(href.split('?')[1], {
|
|
20
|
+
ignoreQueryPrefix: true // 去除第一个字符'?'
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
// 有带参数,取本地的数据
|
|
24
|
+
Object.keys(searchKeys).forEach(function (item) {
|
|
25
|
+
var _searchKeys$item;
|
|
26
|
+
// 取变量名对应本地的值
|
|
27
|
+
if (((_searchKeys$item = searchKeys[item]) === null || _searchKeys$item === void 0 ? void 0 : _searchKeys$item.indexOf('^{')) !== -1) {
|
|
28
|
+
// 清除"^{"与"}"取当前的
|
|
29
|
+
var keyParam = searchKeys[item].replace('^{', '').substring(0, searchKeys[item].replace('^{', '').lastIndexOf('}'));
|
|
30
|
+
searchKeys[item] = localStorage.getItem(keyParam) || undefined;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
return searchKeys;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 获取url的search,并有条件:`^{变量名}`的条件取本地存储的数据 // 参数格式:^{变量名} 变量名支持数字、字母、下划线
|
|
38
|
+
* 根据url上的参数变量,重新调整跳转链接
|
|
39
|
+
* */
|
|
40
|
+
var getJumpUrlBySearch = exports.getJumpUrlBySearch = function getJumpUrlBySearch(href) {
|
|
41
|
+
var searchKeys = {};
|
|
42
|
+
var getPath;
|
|
43
|
+
if (isUrl(href)) {
|
|
44
|
+
var url = new URL(href);
|
|
45
|
+
searchKeys = (0, _qs.parse)(url.search, {
|
|
46
|
+
ignoreQueryPrefix: true // 去除第一个字符'?'
|
|
47
|
+
});
|
|
48
|
+
getPath = url.origin + url.pathname; // 取条件参数外的地址
|
|
49
|
+
} else {
|
|
50
|
+
searchKeys = (0, _qs.parse)(href.split('?')[1], {
|
|
51
|
+
ignoreQueryPrefix: true // 去除第一个字符'?'
|
|
52
|
+
});
|
|
53
|
+
getPath = href.split('?').length > 0 ? href.split('?')[0] : ''; // 取条件参数外的地址
|
|
54
|
+
}
|
|
55
|
+
// 有带参数,取本地的数据,然后拼接给地址
|
|
56
|
+
Object.keys(searchKeys).forEach(function (item, index) {
|
|
57
|
+
var _searchKeys$item2;
|
|
58
|
+
// 取变量名
|
|
59
|
+
if (((_searchKeys$item2 = searchKeys[item]) === null || _searchKeys$item2 === void 0 ? void 0 : _searchKeys$item2.indexOf('^{')) !== -1) {
|
|
60
|
+
// 清除"^{"与"}"取当前的
|
|
61
|
+
var keyParam = searchKeys[item].replace('^{', '').substring(0, searchKeys[item].replace('^{', '').lastIndexOf('}'));
|
|
62
|
+
searchKeys[item] = localStorage.getItem(keyParam) || '';
|
|
63
|
+
}
|
|
64
|
+
getPath += (index === 0 ? "?" : '&') + item + "=" + searchKeys[item];
|
|
65
|
+
});
|
|
66
|
+
return getPath;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* 是否是完整的URL
|
|
70
|
+
*
|
|
71
|
+
* */
|
|
72
|
+
var isUrl = exports.isUrl = function isUrl(path) {
|
|
73
|
+
if (!path.startsWith('http')) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
var url = new URL(path);
|
|
78
|
+
return !!url;
|
|
79
|
+
} catch (error) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
};
|