fan-standard-comp 3.2.1 → 4.0.1
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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/fan-standard-comp.min.css +1 -0
- package/dist/fan-standard-comp.min.js +1 -0
- package/es/ButtonGroup/PopConfirmTitle.d.ts +1 -1
- package/es/ButtonGroup/PopConfirmTitle.js +2 -2
- package/es/ButtonGroup/index.d.ts +5 -3
- package/es/ButtonGroup/index.js +259 -189
- package/es/ButtonGroup/styles/index.d.ts +8 -0
- package/es/ButtonGroup/styles/index.js +61 -0
- package/es/ButtonGroup/testStyles/index(antd-style).d.ts +11 -0
- package/es/ButtonGroup/testStyles/index(antd-style).js +28 -0
- package/es/ButtonGroup/testStyles/index(cssinjs).js +133 -0
- package/es/ButtonGroup/testStyles/index.d.ts +11 -0
- package/es/ButtonGroup/testStyles/index.js +23 -0
- package/es/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
- package/es/CalendarCoordPicker/CalendarMonthPicker.js +32 -0
- package/es/CalendarCoordPicker/index.d.ts +7 -0
- package/es/CalendarCoordPicker/index.js +314 -0
- package/es/CalendarCoordPicker/styles/index.d.ts +6 -0
- package/es/CalendarCoordPicker/styles/index.js +28 -0
- package/es/CalendarCoordPicker/styles/index.less +37 -0
- package/es/ConfigContext/index.d.ts +7 -0
- package/es/ConfigContext/index.js +20 -0
- package/es/DragContent/DragBar.d.ts +3 -0
- package/es/DragContent/DragBar.js +0 -1
- package/es/DragContent/index.d.ts +1 -1
- package/es/DragContent/index.js +20 -6
- package/es/DragContent/styles/index.d.ts +6 -0
- package/es/DragContent/styles/index.js +52 -0
- package/es/FormComp/ChunkUploader/api.js +11 -11
- package/es/FormComp/ChunkUploader/index.js +125 -132
- package/es/FormComp/ChunkUploader/lib.js +19 -19
- package/es/FormComp/ChunkUploader/upload-queue.class.js +51 -51
- package/es/FormComp/EditButton/index.d.ts +1 -1
- package/es/FormComp/EditButton/index.js +18 -17
- package/es/FormComp/FieldComponent/ReUpload.d.ts +1 -1
- package/es/FormComp/FieldComponent/ReUpload.js +45 -37
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +28 -19
- package/es/FormComp/FieldComponent/TitleNode.d.ts +2 -1
- package/es/FormComp/FieldComponent/UploaderViewer.d.ts +2 -0
- package/es/FormComp/FieldComponent/UploaderViewer.js +92 -0
- package/es/FormComp/FieldComponent/index.d.ts +1 -1
- package/es/FormComp/FieldComponent/index.js +88 -109
- package/es/FormComp/FieldComponent/setReadonlyValues.js +21 -15
- package/es/FormComp/FieldComponent/style/TreeSelect.d.ts +6 -0
- package/es/FormComp/FieldComponent/style/TreeSelect.js +42 -0
- package/es/FormComp/FieldComponent/style/UploaderStyle.d.ts +6 -0
- package/es/FormComp/FieldComponent/style/UploaderStyle.js +25 -0
- package/es/FormComp/FieldComponent/style/index.less +26 -21
- package/es/FormComp/RenderItemGroup/index.d.ts +4 -0
- package/es/FormComp/RenderItemGroup/index.js +183 -66
- package/es/FormComp/RenderItemGroup/style/index.d.ts +6 -0
- package/es/FormComp/RenderItemGroup/style/index.js +40 -0
- package/es/FormComp/Uploader/index.js +94 -75
- package/es/FormComp/Uploader/style/index.less +14 -14
- package/es/FormComp/Uploader/util.d.ts +2 -2
- package/es/FormComp/VarTemplate/index.js +32 -40
- package/es/FormComp/index.js +1 -1
- package/es/NavLeafScroll/Main.js +443 -0
- package/es/NavLeafScroll/index.d.ts +2 -0
- package/es/NavLeafScroll/index.js +21 -395
- package/es/NavLeafScroll/style/index.d.ts +6 -0
- package/es/NavLeafScroll/style/index.js +56 -0
- package/es/NavLeafScroll/style/index.less +22 -22
- package/es/RefactorTree/index.d.ts +1 -1
- package/es/RefactorTree/index.js +21 -19
- package/es/RefactorTree/style/index.js +1 -1
- package/es/RefactorTree/style/index.less +22 -22
- package/es/RefactorTree/util.d.ts +2 -2
- package/es/RefactorTree/util.js +30 -15
- 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/index.d.ts +0 -1
- package/es/SpecIcon/index.js +33 -12
- package/es/SpecIcon/styles/index(antd-style).d.ts +6 -0
- package/es/SpecIcon/styles/index(antd-style).js +13 -0
- package/es/SpecIcon/styles/index.d.ts +6 -0
- package/es/SpecIcon/styles/index.js +93 -0
- package/es/StandardContent/SplitterLayout/Pane.js +3 -3
- package/es/StandardContent/SplitterLayout/index.js +7 -6
- package/es/StandardContent/SplitterLayout/index.less +0 -1
- package/es/StandardContent/SubfieldContent.d.ts +3 -2
- package/es/StandardContent/SubfieldContent.js +24 -12
- package/es/StandardContent/WrapperContent.d.ts +2 -2
- package/es/StandardContent/WrapperContent.js +22 -11
- package/es/StandardContent/styles/Subfield.d.ts +6 -0
- package/es/StandardContent/styles/Subfield.js +30 -0
- package/es/StandardContent/styles/Wrapper.d.ts +6 -0
- package/es/StandardContent/styles/Wrapper.js +28 -0
- package/es/StandardContent/styles/index.less +67 -0
- package/es/StandardDragModal/ChangeStandardModal.d.ts +2 -2
- package/es/StandardDragModal/ChangeStandardModal.js +84 -71
- package/es/StandardDragModal/DraggableModal.js +7 -4
- package/es/StandardDragModal/DraggableModalContext.d.ts +1 -1
- package/es/StandardDragModal/DraggableModalInner.d.ts +2 -2
- package/es/StandardDragModal/DraggableModalInner.js +31 -21
- package/es/StandardDragModal/DraggableModalProvider.js +5 -5
- package/es/StandardDragModal/Modal.d.ts +1 -1
- package/es/StandardDragModal/Modal.js +8 -5
- package/es/StandardDragModal/ResizeHandle.js +2 -1
- package/es/StandardDragModal/draggableModalReducer.d.ts +4 -4
- package/es/StandardDragModal/draggableModalReducer.js +31 -22
- package/es/StandardDragModal/index.js +3 -3
- package/es/StandardDragModal/useDrag.js +2 -2
- package/es/StandardDragModal/useResize.js +2 -2
- package/es/StandardFilter/index.d.ts +8 -17
- package/es/StandardFilter/index.js +279 -206
- package/es/StandardFilter/style/FilterStyle.d.ts +6 -0
- package/es/StandardFilter/style/FilterStyle.js +50 -0
- package/es/StandardFilter/style/index.less +85 -36
- package/es/StandardForm/ActionList.d.ts +9 -0
- package/es/StandardForm/ActionList.js +5 -5
- package/es/StandardForm/StepForm.d.ts +1 -1
- package/es/StandardForm/StepForm.js +47 -40
- package/es/StandardForm/TabForm.d.ts +2 -1
- package/es/StandardForm/TabForm.js +50 -41
- package/es/StandardForm/index.d.ts +2 -1
- package/es/StandardForm/index.js +40 -22
- package/es/StandardForm/style/index.d.ts +6 -0
- package/es/StandardForm/style/index.js +49 -0
- package/es/StandardForm/style/index.less +23 -12
- package/es/StandardModal/UpdateFormRef.js +0 -1
- package/es/StandardModal/index.d.ts +4 -3
- package/es/StandardModal/index.js +153 -133
- package/es/StandardModal/style/index.d.ts +6 -0
- package/es/StandardModal/style/index.js +46 -0
- package/es/StandardModal/style/index.less +29 -29
- package/es/StandardPanel/index.d.ts +1 -1
- package/es/StandardPanel/index.js +28 -17
- package/es/StandardPanel/style/index.d.ts +6 -0
- package/es/StandardPanel/style/index.js +87 -0
- package/es/StandardPanel/style/index.less +30 -32
- package/es/StandardTable/index.d.ts +6 -1
- package/es/StandardTable/index.js +92 -40
- package/es/StandardTable/style/index.d.ts +6 -1
- package/es/StandardTable/style/index.js +113 -1
- package/es/StandardTable/style/index.less +89 -80
- package/es/components/IconNode/index.d.ts +1 -1
- package/es/components/IconNode/index.js +12 -1
- package/es/components/index.js +1 -1
- package/es/data/func.code.d.ts +16 -0
- package/es/data/general.config.d.ts +191 -0
- package/es/data/general.config.js +32 -1
- package/es/data/index.d.ts +3 -0
- package/es/data/index.js +2 -2
- package/es/index.d.ts +7 -6
- package/es/index.js +32 -26
- package/es/theme/index.d.ts +27 -0
- package/es/theme/index.js +29 -0
- package/es/theme/utils/genStyleHook.d.ts +1 -0
- package/es/theme/utils/genStyleHook.js +32 -0
- package/es/utils/ValueFormat.d.ts +3 -0
- package/es/utils/ValueFormat.js +17 -4
- package/es/utils/dictSelectUtil.d.ts +36 -0
- package/es/utils/dictSelectUtil.js +3 -3
- package/es/utils/filterPermission.d.ts +5 -0
- package/es/utils/filterPermission.js +4 -6
- package/es/utils/getParentNodes.d.ts +79 -0
- package/es/utils/getParentNodes.js +89 -13
- package/es/utils/index.d.ts +5 -0
- package/es/utils/index.js +5 -4
- package/es/utils/transferFile.d.ts +4 -0
- package/es/utils/transferFile.js +56 -0
- package/es/utils/urlUtils.d.ts +14 -0
- package/es/utils/urlUtils.js +77 -0
- package/lib/ButtonGroup/PopConfirmTitle.d.ts +1 -1
- package/lib/ButtonGroup/PopConfirmTitle.js +3 -4
- package/lib/ButtonGroup/index.d.ts +5 -3
- package/lib/ButtonGroup/index.js +261 -194
- package/lib/ButtonGroup/styles/index.d.ts +8 -0
- package/lib/ButtonGroup/styles/index.js +68 -0
- package/lib/ButtonGroup/testStyles/index(antd-style).d.ts +11 -0
- package/lib/ButtonGroup/testStyles/index(antd-style).js +34 -0
- package/lib/ButtonGroup/testStyles/index(cssinjs).js +134 -0
- package/lib/ButtonGroup/testStyles/index.d.ts +11 -0
- package/lib/ButtonGroup/testStyles/index.js +29 -0
- package/lib/CalendarCoordPicker/CalendarMonthPicker.d.ts +5 -0
- package/lib/CalendarCoordPicker/CalendarMonthPicker.js +41 -0
- package/lib/CalendarCoordPicker/index.d.ts +7 -0
- package/lib/CalendarCoordPicker/index.js +323 -0
- package/lib/CalendarCoordPicker/styles/index.d.ts +6 -0
- package/lib/CalendarCoordPicker/styles/index.js +34 -0
- package/lib/CalendarCoordPicker/styles/index.less +37 -0
- package/lib/ConfigContext/index.d.ts +7 -0
- package/lib/ConfigContext/index.js +25 -0
- package/lib/DragContent/DragBar.d.ts +3 -0
- package/lib/DragContent/DragBar.js +1 -3
- package/lib/DragContent/index.d.ts +1 -1
- package/lib/DragContent/index.js +22 -9
- package/lib/DragContent/styles/index.d.ts +6 -0
- package/lib/DragContent/styles/index.js +58 -0
- package/lib/FormComp/ChunkUploader/api.js +11 -11
- package/lib/FormComp/ChunkUploader/index.js +123 -130
- package/lib/FormComp/ChunkUploader/lib.js +19 -19
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +52 -53
- package/lib/FormComp/EditButton/index.d.ts +1 -1
- package/lib/FormComp/EditButton/index.js +22 -22
- package/lib/FormComp/FieldComponent/ReUpload.d.ts +1 -1
- package/lib/FormComp/FieldComponent/ReUpload.js +47 -41
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +29 -21
- package/lib/FormComp/FieldComponent/TitleNode.d.ts +2 -1
- package/lib/FormComp/FieldComponent/TitleNode.js +1 -2
- package/lib/FormComp/FieldComponent/UploaderViewer.d.ts +2 -0
- package/lib/FormComp/FieldComponent/UploaderViewer.js +102 -0
- package/lib/FormComp/FieldComponent/index.d.ts +1 -1
- package/lib/FormComp/FieldComponent/index.js +83 -107
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +29 -28
- package/lib/FormComp/FieldComponent/style/TreeSelect.d.ts +6 -0
- package/lib/FormComp/FieldComponent/style/TreeSelect.js +48 -0
- package/lib/FormComp/FieldComponent/style/UploaderStyle.d.ts +6 -0
- package/lib/FormComp/FieldComponent/style/UploaderStyle.js +31 -0
- package/lib/FormComp/FieldComponent/style/index.less +26 -21
- package/lib/FormComp/RenderItemGroup/index.d.ts +4 -0
- package/lib/FormComp/RenderItemGroup/index.js +182 -65
- package/lib/FormComp/RenderItemGroup/style/index.d.ts +6 -0
- package/lib/FormComp/RenderItemGroup/style/index.js +46 -0
- package/lib/FormComp/Uploader/index.js +95 -80
- package/lib/FormComp/Uploader/style/index.less +14 -14
- package/lib/FormComp/Uploader/util.d.ts +2 -2
- package/lib/FormComp/VarTemplate/index.js +38 -48
- package/lib/NavLeafScroll/Main.js +451 -0
- package/lib/NavLeafScroll/index.d.ts +2 -0
- package/lib/NavLeafScroll/index.js +21 -398
- package/lib/NavLeafScroll/style/index.d.ts +6 -0
- package/lib/NavLeafScroll/style/index.js +62 -0
- package/lib/NavLeafScroll/style/index.less +22 -22
- package/lib/RefactorTree/index.d.ts +1 -1
- package/lib/RefactorTree/index.js +21 -21
- package/lib/RefactorTree/style/index.less +22 -22
- package/lib/RefactorTree/util.d.ts +2 -2
- package/lib/RefactorTree/util.js +30 -15
- 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.d.ts +0 -1
- package/lib/SpecIcon/index.js +34 -14
- package/lib/SpecIcon/styles/index(antd-style).d.ts +6 -0
- package/lib/SpecIcon/styles/index(antd-style).js +19 -0
- package/lib/SpecIcon/styles/index.d.ts +6 -0
- package/lib/SpecIcon/styles/index.js +100 -0
- package/lib/StandardContent/SplitterLayout/Pane.js +3 -4
- package/lib/StandardContent/SplitterLayout/index.js +6 -6
- package/lib/StandardContent/SplitterLayout/index.less +0 -1
- package/lib/StandardContent/SubfieldContent.d.ts +3 -2
- package/lib/StandardContent/SubfieldContent.js +24 -13
- package/lib/StandardContent/WrapperContent.d.ts +2 -2
- package/lib/StandardContent/WrapperContent.js +23 -13
- package/lib/StandardContent/styles/Subfield.d.ts +6 -0
- package/lib/StandardContent/styles/Subfield.js +36 -0
- package/lib/StandardContent/styles/Wrapper.d.ts +6 -0
- package/lib/StandardContent/styles/Wrapper.js +34 -0
- package/lib/StandardContent/styles/index.less +67 -0
- package/lib/StandardDragModal/ChangeStandardModal.d.ts +2 -2
- package/lib/StandardDragModal/ChangeStandardModal.js +85 -72
- package/lib/StandardDragModal/DraggableModal.js +11 -8
- package/lib/StandardDragModal/DraggableModalContext.d.ts +1 -1
- package/lib/StandardDragModal/DraggableModalContext.js +3 -4
- package/lib/StandardDragModal/DraggableModalInner.d.ts +2 -2
- package/lib/StandardDragModal/DraggableModalInner.js +38 -30
- package/lib/StandardDragModal/DraggableModalProvider.js +10 -10
- package/lib/StandardDragModal/Modal.d.ts +1 -1
- package/lib/StandardDragModal/Modal.js +7 -5
- package/lib/StandardDragModal/ResizeHandle.js +6 -6
- package/lib/StandardDragModal/clamp.js +2 -3
- package/lib/StandardDragModal/draggableModalReducer.d.ts +4 -4
- package/lib/StandardDragModal/draggableModalReducer.js +34 -29
- package/lib/StandardDragModal/getWindowSize.js +2 -3
- package/lib/StandardDragModal/useDrag.js +4 -5
- package/lib/StandardDragModal/usePrevious.js +2 -3
- package/lib/StandardDragModal/useResize.js +4 -5
- package/lib/StandardFilter/index.d.ts +8 -17
- package/lib/StandardFilter/index.js +281 -207
- package/lib/StandardFilter/style/FilterStyle.d.ts +6 -0
- package/lib/StandardFilter/style/FilterStyle.js +56 -0
- package/lib/StandardFilter/style/index.less +85 -36
- package/lib/StandardForm/ActionList.d.ts +9 -0
- package/lib/StandardForm/ActionList.js +6 -7
- package/lib/StandardForm/StepForm.d.ts +1 -1
- package/lib/StandardForm/StepForm.js +46 -41
- package/lib/StandardForm/TabForm.d.ts +2 -1
- package/lib/StandardForm/TabForm.js +48 -41
- package/lib/StandardForm/index.d.ts +2 -1
- package/lib/StandardForm/index.js +39 -23
- package/lib/StandardForm/style/index.d.ts +6 -0
- package/lib/StandardForm/style/index.js +55 -0
- package/lib/StandardForm/style/index.less +23 -12
- package/lib/StandardModal/UpdateFormRef.js +3 -4
- package/lib/StandardModal/index.d.ts +4 -3
- package/lib/StandardModal/index.js +152 -133
- package/lib/StandardModal/style/index.d.ts +6 -0
- package/lib/StandardModal/style/index.js +52 -0
- package/lib/StandardModal/style/index.less +29 -29
- package/lib/StandardPanel/index.d.ts +1 -1
- package/lib/StandardPanel/index.js +29 -20
- package/lib/StandardPanel/style/index.d.ts +6 -0
- package/lib/StandardPanel/style/index.js +93 -0
- package/lib/StandardPanel/style/index.less +30 -32
- package/lib/StandardTable/index.d.ts +6 -1
- package/lib/StandardTable/index.js +93 -40
- package/lib/StandardTable/style/index.d.ts +6 -1
- package/lib/StandardTable/style/index.js +117 -1
- package/lib/StandardTable/style/index.less +89 -80
- package/lib/components/IconNode/index.d.ts +1 -1
- package/lib/components/IconNode/index.js +13 -3
- package/lib/data/func.code.d.ts +16 -0
- package/lib/data/func.code.js +2 -3
- package/lib/data/general.config.d.ts +191 -0
- package/lib/data/general.config.js +34 -4
- package/lib/data/index.d.ts +3 -0
- package/lib/index.d.ts +7 -6
- package/lib/index.js +24 -12
- package/lib/theme/index.d.ts +27 -0
- package/lib/theme/index.js +35 -0
- package/lib/theme/utils/genStyleHook.d.ts +1 -0
- package/lib/theme/utils/genStyleHook.js +38 -0
- package/lib/utils/ValueFormat.d.ts +3 -0
- package/lib/utils/ValueFormat.js +20 -6
- package/lib/utils/dictSelectUtil.d.ts +36 -0
- package/lib/utils/dictSelectUtil.js +3 -3
- package/lib/utils/filterPermission.d.ts +5 -0
- package/lib/utils/filterPermission.js +9 -16
- package/lib/utils/getParentNodes.d.ts +79 -0
- package/lib/utils/getParentNodes.js +91 -16
- package/lib/utils/index.d.ts +5 -0
- package/lib/utils/index.js +42 -32
- package/lib/utils/transferFile.d.ts +4 -0
- package/lib/utils/transferFile.js +63 -0
- package/lib/utils/urlUtils.d.ts +14 -0
- package/lib/utils/urlUtils.js +84 -0
- package/package.json +80 -33
- package/Readme.md +0 -49
- package/dist/f26952c118ab6cdcd23dc0028ee98c11.svg +0 -173
- package/dist/fan-standard-comp.umd.js +0 -602
- package/dist/fonts/iconfont.eot +0 -0
- package/dist/fonts/iconfont.ttf +0 -0
- package/dist/fonts/iconfont.woff +0 -0
- package/es/ButtonGroup/ButtonList.d.ts +0 -2
- package/es/ButtonGroup/ButtonList.js +0 -34
- package/es/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/es/ButtonGroup/ButtonMenu.js +0 -35
- package/es/ButtonGroup/style/index.less +0 -36
- package/es/RefactorTree/indexTreeNode.d.ts +0 -39
- package/es/RefactorTree/indexTreeNode.js +0 -204
- package/es/SpecIcon/style/iconfont.less +0 -213
- package/es/SpecIcon/style/index.less +0 -98
- package/es/SplitterLayout/Pane.d.ts +0 -13
- package/es/SplitterLayout/Pane.js +0 -33
- package/es/SplitterLayout/index.js +0 -325
- package/es/SplitterLayout/index.less +0 -58
- package/es/StandardContent/style/index.less +0 -80
- package/es/theme/spec-variable.less +0 -48
- package/lib/ButtonGroup/ButtonList.d.ts +0 -2
- package/lib/ButtonGroup/ButtonList.js +0 -43
- package/lib/ButtonGroup/ButtonMenu.d.ts +0 -2
- package/lib/ButtonGroup/ButtonMenu.js +0 -44
- package/lib/ButtonGroup/style/index.less +0 -36
- package/lib/RefactorTree/indexTreeNode.d.ts +0 -39
- package/lib/RefactorTree/indexTreeNode.js +0 -214
- package/lib/SpecIcon/style/iconfont.less +0 -213
- package/lib/SpecIcon/style/index.less +0 -98
- package/lib/SplitterLayout/Pane.d.ts +0 -13
- package/lib/SplitterLayout/Pane.js +0 -41
- package/lib/SplitterLayout/index.js +0 -332
- package/lib/SplitterLayout/index.less +0 -58
- package/lib/StandardContent/style/index.less +0 -80
- package/lib/theme/spec-variable.less +0 -48
- /package/es/{styles/index.less → ButtonGroup/testStyles/index(cssinjs).d.ts} +0 -0
- /package/lib/{styles/index.less → ButtonGroup/testStyles/index(cssinjs).d.ts} +0 -0
|
@@ -9,11 +9,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
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
11
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
function _toPropertyKey(
|
|
13
|
-
function _toPrimitive(
|
|
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); }
|
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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
|
+
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); } // @ts-nocheck
|
|
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,12 +55,10 @@ 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
64
|
item.children = removeNoPermission(item.children, permissionCodes, codes, params);
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 递归查看父级节点数据集合及当前节点数据
|
|
3
|
+
* @params {Array} list 当前需要过滤查看的数据集合、
|
|
4
|
+
* @params {String/Array} nodeKey 当前用于查找匹配数据的标识值
|
|
5
|
+
* @params {Object} params 指定当前数据中,筛选对应子集合字段名及匹配标识值字段名
|
|
6
|
+
* (childrenParam:指当前子集合数据字段名(字符串表示单个,数组表示当前多个子集合字段名),keyParam: 指当前匹配标识值字段名)
|
|
7
|
+
* @params {Object} extra
|
|
8
|
+
*
|
|
9
|
+
* @result {Array} nodeParent 当前传入nodeKey值所有上级别父级数据对象数组集合(倒序排列,根节点在最后一条)
|
|
10
|
+
* @result {Array} parentKeys 当前传入nodeKey值所有上级别父级数据关键字数据集合(keyParam)(倒序排列,根节点在最后一条)
|
|
11
|
+
* @result {Array} matchNode 当前传入nodeKey值所在的数据对象集合
|
|
12
|
+
* */
|
|
13
|
+
export declare const getParentNodes: (list: any[], nodeKey: string | number, params: {
|
|
14
|
+
childrenParam: string;
|
|
15
|
+
keyParam: string;
|
|
16
|
+
} | undefined, extraProps: any) => {
|
|
17
|
+
nodeParent: any[];
|
|
18
|
+
parentKeys: any[];
|
|
19
|
+
matchNode: any[];
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* @description 递归查找指定ID所有的子菜单与子功能集合
|
|
23
|
+
* @params {Array} childNode 当前需要过滤查看的数据集合、
|
|
24
|
+
* @params {Object} params 指定当前数据中,筛选对应子集合字段名及匹配标识值字段名
|
|
25
|
+
* (childrenParam:指当前子集合数据字段名(字符串表示单个,数组表示当前多个子集合字段名),keyParam: 指当前匹配标识值字段名)
|
|
26
|
+
* @params {Object} extra
|
|
27
|
+
*
|
|
28
|
+
* @result {Array} childKeys 所有子项的id
|
|
29
|
+
* @result {Array} nodeChildren 当前传入nodeKey值所在的数据对象集合
|
|
30
|
+
* */
|
|
31
|
+
export declare const getChildrenNodes: (childNode: any, params?: {
|
|
32
|
+
childrenParam: string;
|
|
33
|
+
keyParam: string;
|
|
34
|
+
}) => {
|
|
35
|
+
childKeys: any[];
|
|
36
|
+
nodeChildren: any[];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* @description 查找节点路径
|
|
40
|
+
* @params {Array} list 查询的数据源
|
|
41
|
+
* @params {Array} nodeKey 需要查询的key集合
|
|
42
|
+
* @params {Object} params 指定当前数据中,筛选对应子集合字段名及匹配标识值字段名
|
|
43
|
+
* (childrenParam:指当前子集合数据字段名(字符串表示单个,数组表示当前多个子集合字段名),keyParam: 指当前匹配标识值字段名)
|
|
44
|
+
*
|
|
45
|
+
* @result {Array} 所有匹配到的层级数据
|
|
46
|
+
* */
|
|
47
|
+
export declare const getNodePaths: (list: any, nodeKey: any, params: {
|
|
48
|
+
childrenParam: string;
|
|
49
|
+
keyParam: string;
|
|
50
|
+
} | undefined, extraProps: any) => any[];
|
|
51
|
+
/**
|
|
52
|
+
* 数组转树形结构
|
|
53
|
+
* @param {array} list 被转换的数组
|
|
54
|
+
* @param {number|string} root 根节点(最外层节点)的 id
|
|
55
|
+
* @param {object} params 字段值(默认 { keyParam: 'id', parentParam: 'parentId' })
|
|
56
|
+
* @return array
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* 数组转树形结构
|
|
60
|
+
* @param {array} list 被转换的数组
|
|
61
|
+
* @param {number|string} root 根节点(最外层节点)的 id
|
|
62
|
+
* @param {object} params 字段值(默认 { keyParam: 'id', parentParam: 'parentId' })
|
|
63
|
+
* @return array
|
|
64
|
+
*/
|
|
65
|
+
export declare const arrayToTree: (list: any, rootId: any, { keyParam, parentParam, childrenParam }?: {
|
|
66
|
+
keyParam?: string | undefined;
|
|
67
|
+
parentParam?: string | undefined;
|
|
68
|
+
childrenParam?: string | undefined;
|
|
69
|
+
}) => any[];
|
|
70
|
+
/**
|
|
71
|
+
* 多根树转换成数组
|
|
72
|
+
* @param {array} tree 被转换的树(仅限于只有一个根的树
|
|
73
|
+
* @return array
|
|
74
|
+
*/
|
|
75
|
+
export declare const convertToArray: (tree: any, { keyParam, parentParam, childrenParam }?: {
|
|
76
|
+
keyParam?: string | undefined;
|
|
77
|
+
parentParam?: string | undefined;
|
|
78
|
+
childrenParam?: string | undefined;
|
|
79
|
+
}) => any[];
|
|
@@ -3,7 +3,14 @@
|
|
|
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(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(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); }
|
|
13
|
+
// @ts-nocheck
|
|
7
14
|
/**
|
|
8
15
|
* @description 递归查看父级节点数据集合及当前节点数据
|
|
9
16
|
* @params {Array} list 当前需要过滤查看的数据集合、
|
|
@@ -16,7 +23,7 @@ exports.getParentNodes = exports.getNodePaths = exports.getChildrenNodes = void
|
|
|
16
23
|
* @result {Array} parentKeys 当前传入nodeKey值所有上级别父级数据关键字数据集合(keyParam)(倒序排列,根节点在最后一条)
|
|
17
24
|
* @result {Array} matchNode 当前传入nodeKey值所在的数据对象集合
|
|
18
25
|
* */
|
|
19
|
-
var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
26
|
+
var getParentNodes = exports.getParentNodes = function getParentNodes(list, nodeKey) {
|
|
20
27
|
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
21
28
|
childrenParam: 'children',
|
|
22
29
|
keyParam: 'value'
|
|
@@ -82,7 +89,6 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
82
89
|
}
|
|
83
90
|
}*/
|
|
84
91
|
}
|
|
85
|
-
|
|
86
92
|
return matchNode; // 返回查找到的节点数据(格式为数组)
|
|
87
93
|
};
|
|
88
94
|
|
|
@@ -123,20 +129,17 @@ var getParentNodes = function getParentNodes(list, nodeKey) {
|
|
|
123
129
|
};
|
|
124
130
|
|
|
125
131
|
/**
|
|
126
|
-
* @description
|
|
132
|
+
* @description 递归查找指定ID所有的子菜单与子功能集合
|
|
127
133
|
* @params {Array} childNode 当前需要过滤查看的数据集合、
|
|
128
134
|
* @params {Object} params 指定当前数据中,筛选对应子集合字段名及匹配标识值字段名
|
|
129
|
-
*
|
|
130
|
-
*
|
|
135
|
+
* (childrenParam:指当前子集合数据字段名(字符串表示单个,数组表示当前多个子集合字段名),keyParam: 指当前匹配标识值字段名)
|
|
136
|
+
* @params {Object} extra
|
|
131
137
|
*
|
|
132
138
|
* @result {Array} childKeys 所有子项的id
|
|
133
|
-
* @result {Array} nodeChildren
|
|
134
|
-
*
|
|
135
|
-
* @usage:
|
|
136
|
-
* getChildrenNodes(childNode, params)
|
|
139
|
+
* @result {Array} nodeChildren 当前传入nodeKey值所在的数据对象集合
|
|
137
140
|
* */
|
|
138
|
-
|
|
139
|
-
var getChildrenNodes = function getChildrenNodes(childNode) {
|
|
141
|
+
|
|
142
|
+
var getChildrenNodes = exports.getChildrenNodes = function getChildrenNodes(childNode) {
|
|
140
143
|
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
141
144
|
childrenParam: 'children',
|
|
142
145
|
keyParam: 'value'
|
|
@@ -157,9 +160,16 @@ var getChildrenNodes = function getChildrenNodes(childNode) {
|
|
|
157
160
|
};
|
|
158
161
|
};
|
|
159
162
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
/**
|
|
164
|
+
* @description 查找节点路径
|
|
165
|
+
* @params {Array} list 查询的数据源
|
|
166
|
+
* @params {Array} nodeKey 需要查询的key集合
|
|
167
|
+
* @params {Object} params 指定当前数据中,筛选对应子集合字段名及匹配标识值字段名
|
|
168
|
+
* (childrenParam:指当前子集合数据字段名(字符串表示单个,数组表示当前多个子集合字段名),keyParam: 指当前匹配标识值字段名)
|
|
169
|
+
*
|
|
170
|
+
* @result {Array} 所有匹配到的层级数据
|
|
171
|
+
* */
|
|
172
|
+
var getNodePaths = exports.getNodePaths = function getNodePaths(list, nodeKey) {
|
|
163
173
|
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
164
174
|
childrenParam: 'children',
|
|
165
175
|
keyParam: 'value'
|
|
@@ -206,4 +216,69 @@ var getNodePaths = function getNodePaths(list, nodeKey) {
|
|
|
206
216
|
}
|
|
207
217
|
return pathNode;
|
|
208
218
|
};
|
|
209
|
-
|
|
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
|
+
/**
|
|
228
|
+
* 数组转树形结构
|
|
229
|
+
* @param {array} list 被转换的数组
|
|
230
|
+
* @param {number|string} root 根节点(最外层节点)的 id
|
|
231
|
+
* @param {object} params 字段值(默认 { keyParam: 'id', parentParam: 'parentId' })
|
|
232
|
+
* @return array
|
|
233
|
+
*/
|
|
234
|
+
var arrayToTree = exports.arrayToTree = function arrayToTree(list, rootId) {
|
|
235
|
+
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
|
|
236
|
+
_ref$keyParam = _ref.keyParam,
|
|
237
|
+
keyParam = _ref$keyParam === void 0 ? "id" : _ref$keyParam,
|
|
238
|
+
_ref$parentParam = _ref.parentParam,
|
|
239
|
+
parentParam = _ref$parentParam === void 0 ? "parentId" : _ref$parentParam,
|
|
240
|
+
_ref$childrenParam = _ref.childrenParam,
|
|
241
|
+
childrenParam = _ref$childrenParam === void 0 ? "children" : _ref$childrenParam;
|
|
242
|
+
var res = [];
|
|
243
|
+
list.forEach(function (item) {
|
|
244
|
+
if (item[parentParam] === rootId) {
|
|
245
|
+
var itemChildren = arrayToTree(list, item[keyParam]);
|
|
246
|
+
if (itemChildren.length) item[childrenParam] = itemChildren;
|
|
247
|
+
res.push(item);
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
return res;
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* 多根树转换成数组
|
|
254
|
+
* @param {array} tree 被转换的树(仅限于只有一个根的树
|
|
255
|
+
* @return array
|
|
256
|
+
*/
|
|
257
|
+
|
|
258
|
+
var convertToArray = exports.convertToArray = function convertToArray(tree) {
|
|
259
|
+
var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
260
|
+
_ref2$keyParam = _ref2.keyParam,
|
|
261
|
+
keyParam = _ref2$keyParam === void 0 ? "id" : _ref2$keyParam,
|
|
262
|
+
_ref2$parentParam = _ref2.parentParam,
|
|
263
|
+
parentParam = _ref2$parentParam === void 0 ? "parentId" : _ref2$parentParam,
|
|
264
|
+
_ref2$childrenParam = _ref2.childrenParam,
|
|
265
|
+
childrenParam = _ref2$childrenParam === void 0 ? "children" : _ref2$childrenParam;
|
|
266
|
+
var result = []; // 存放结果的数组
|
|
267
|
+
var sortCount = 0;
|
|
268
|
+
tree.forEach(function (item) {
|
|
269
|
+
var loop = function loop(data) {
|
|
270
|
+
sortCount++;
|
|
271
|
+
result.push(_objectSpread(_objectSpread({}, data), {}, {
|
|
272
|
+
sort: sortCount
|
|
273
|
+
}));
|
|
274
|
+
var child = data[childrenParam];
|
|
275
|
+
if (child) {
|
|
276
|
+
for (var i = 0; i < child.length; i++) {
|
|
277
|
+
loop(child[i]);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
loop(item);
|
|
282
|
+
});
|
|
283
|
+
return result;
|
|
284
|
+
};
|
package/lib/utils/index.js
CHANGED
|
@@ -3,42 +3,31 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
});
|
|
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
|
-
}
|
|
6
|
+
var _getParentNodes = require("./getParentNodes");
|
|
7
|
+
Object.keys(_getParentNodes).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _getParentNodes[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _getParentNodes[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
29
16
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
var _ValueFormat = require("./ValueFormat");
|
|
18
|
+
Object.keys(_ValueFormat).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _ValueFormat[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _ValueFormat[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
35
27
|
});
|
|
36
|
-
var _ValueFormat = _interopRequireDefault(require("./ValueFormat"));
|
|
37
|
-
var _getParentNodes = require("./getParentNodes");
|
|
38
28
|
var _dictSelectUtil = require("./dictSelectUtil");
|
|
39
29
|
Object.keys(_dictSelectUtil).forEach(function (key) {
|
|
40
30
|
if (key === "default" || key === "__esModule") return;
|
|
41
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
42
31
|
if (key in exports && exports[key] === _dictSelectUtil[key]) return;
|
|
43
32
|
Object.defineProperty(exports, key, {
|
|
44
33
|
enumerable: true,
|
|
@@ -47,4 +36,25 @@ Object.keys(_dictSelectUtil).forEach(function (key) {
|
|
|
47
36
|
}
|
|
48
37
|
});
|
|
49
38
|
});
|
|
50
|
-
|
|
39
|
+
var _transferFile = require("./transferFile");
|
|
40
|
+
Object.keys(_transferFile).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _transferFile[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function get() {
|
|
46
|
+
return _transferFile[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
var _urlUtils = require("./urlUtils");
|
|
51
|
+
Object.keys(_urlUtils).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _urlUtils[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function get() {
|
|
57
|
+
return _urlUtils[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.dataURLtoFile = dataURLtoFile;
|
|
7
|
+
exports.setInitImg = setInitImg;
|
|
8
|
+
exports.urlToBase64 = urlToBase64;
|
|
9
|
+
function setInitImg(url) {
|
|
10
|
+
var img = url; //这里是淘宝上随便找的一张图片
|
|
11
|
+
var imgRes;
|
|
12
|
+
// getBase64(img, (dataURL) => {
|
|
13
|
+
// imgRes = dataURLtoFile(dataURL,img);
|
|
14
|
+
// console.log(imgRes)
|
|
15
|
+
// callback(imgRes)
|
|
16
|
+
// });
|
|
17
|
+
return urlToBase64(img).then(function (dataURL) {
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
imgRes = dataURLtoFile(dataURL, img);
|
|
20
|
+
console.log('imgRes', imgRes);
|
|
21
|
+
return imgRes;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function urlToBase64(url) {
|
|
25
|
+
return new Promise(function (resolve, reject) {
|
|
26
|
+
var image = new Image();
|
|
27
|
+
image.onload = function () {
|
|
28
|
+
var canvas = document.createElement('canvas');
|
|
29
|
+
canvas.width = image.width; // this.naturalWidth;
|
|
30
|
+
canvas.height = image.height; // this.naturalHeight;
|
|
31
|
+
// 将图片插入画布并开始绘制
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
canvas.getContext('2d').drawImage(image, 0, 0);
|
|
34
|
+
// result
|
|
35
|
+
var result = canvas.toDataURL('image/png');
|
|
36
|
+
// console.log('result', result)
|
|
37
|
+
resolve(result);
|
|
38
|
+
};
|
|
39
|
+
// CORS 策略,会存在跨域问题https://stackoverflow.com/questions/20424279/canvas-todataurl-securityerror
|
|
40
|
+
image.setAttribute("crossOrigin", 'Anonymous');
|
|
41
|
+
image.src = url;
|
|
42
|
+
// 图片加载失败的错误处理
|
|
43
|
+
image.onerror = function () {
|
|
44
|
+
reject(new Error('转换失败'));
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function dataURLtoFile(dataurl, filename) {
|
|
49
|
+
if (!dataurl) return undefined;
|
|
50
|
+
//将base64转换为文件,dataurl为base64字符串,filename为文件名(必须带后缀名,如.jpg,.png)
|
|
51
|
+
var arr = dataurl.split(","),
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
mime = arr[0].match(/:(.*?);/)[1],
|
|
54
|
+
bstr = atob(arr[1]),
|
|
55
|
+
n = bstr.length,
|
|
56
|
+
u8arr = new Uint8Array(n);
|
|
57
|
+
while (n--) {
|
|
58
|
+
u8arr[n] = bstr.charCodeAt(n);
|
|
59
|
+
}
|
|
60
|
+
return new File([u8arr], filename, {
|
|
61
|
+
type: mime
|
|
62
|
+
});
|
|
63
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 获取url的search,并有条件:`^{变量名}`的条件取本地存储的数据 // 参数格式:^{变量名} 变量名支持数字、字母、下划线
|
|
3
|
+
* */
|
|
4
|
+
export declare const getUrlSearch: (href: any) => {};
|
|
5
|
+
/**
|
|
6
|
+
* 获取url的search,并有条件:`^{变量名}`的条件取本地存储的数据 // 参数格式:^{变量名} 变量名支持数字、字母、下划线
|
|
7
|
+
* 根据url上的参数变量,重新调整跳转链接
|
|
8
|
+
* */
|
|
9
|
+
export declare const getJumpUrlBySearch: (href: any) => any;
|
|
10
|
+
/**
|
|
11
|
+
* 是否是完整的URL
|
|
12
|
+
*
|
|
13
|
+
* */
|
|
14
|
+
export declare const isUrl: (path: any) => boolean;
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
// @ts-nocheck
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 获取url的search,并有条件:`^{变量名}`的条件取本地存储的数据 // 参数格式:^{变量名} 变量名支持数字、字母、下划线
|
|
12
|
+
* */
|
|
13
|
+
var getUrlSearch = exports.getUrlSearch = function getUrlSearch(href) {
|
|
14
|
+
var searchKeys = {};
|
|
15
|
+
if (isUrl(href)) {
|
|
16
|
+
var url = new URL(href);
|
|
17
|
+
searchKeys = (0, _qs.parse)(url.search, {
|
|
18
|
+
ignoreQueryPrefix: true // 去除第一个字符'?'
|
|
19
|
+
});
|
|
20
|
+
} else {
|
|
21
|
+
searchKeys = (0, _qs.parse)(href.split('?')[1], {
|
|
22
|
+
ignoreQueryPrefix: true // 去除第一个字符'?'
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
// 有带参数,取本地的数据
|
|
26
|
+
Object.keys(searchKeys).forEach(function (item) {
|
|
27
|
+
var _searchKeys$item;
|
|
28
|
+
// 取变量名对应本地的值
|
|
29
|
+
if (((_searchKeys$item = searchKeys[item]) === null || _searchKeys$item === void 0 ? void 0 : _searchKeys$item.indexOf('^{')) !== -1) {
|
|
30
|
+
// 清除"^{"与"}"取当前的
|
|
31
|
+
var keyParam = searchKeys[item].replace('^{', '').substring(0, searchKeys[item].replace('^{', '').lastIndexOf('}'));
|
|
32
|
+
searchKeys[item] = localStorage.getItem(keyParam) || undefined;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return searchKeys;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 获取url的search,并有条件:`^{变量名}`的条件取本地存储的数据 // 参数格式:^{变量名} 变量名支持数字、字母、下划线
|
|
40
|
+
* 根据url上的参数变量,重新调整跳转链接
|
|
41
|
+
* */
|
|
42
|
+
var getJumpUrlBySearch = exports.getJumpUrlBySearch = function getJumpUrlBySearch(href) {
|
|
43
|
+
var searchKeys = {};
|
|
44
|
+
var getPath;
|
|
45
|
+
if (isUrl(href)) {
|
|
46
|
+
var url = new URL(href);
|
|
47
|
+
searchKeys = (0, _qs.parse)(url.search, {
|
|
48
|
+
ignoreQueryPrefix: true // 去除第一个字符'?'
|
|
49
|
+
});
|
|
50
|
+
getPath = url.origin + url.pathname; // 取条件参数外的地址
|
|
51
|
+
} else {
|
|
52
|
+
searchKeys = (0, _qs.parse)(href.split('?')[1], {
|
|
53
|
+
ignoreQueryPrefix: true // 去除第一个字符'?'
|
|
54
|
+
});
|
|
55
|
+
getPath = href.split('?').length > 0 ? href.split('?')[0] : ''; // 取条件参数外的地址
|
|
56
|
+
}
|
|
57
|
+
// 有带参数,取本地的数据,然后拼接给地址
|
|
58
|
+
Object.keys(searchKeys).forEach(function (item, index) {
|
|
59
|
+
var _searchKeys$item2;
|
|
60
|
+
// 取变量名
|
|
61
|
+
if (((_searchKeys$item2 = searchKeys[item]) === null || _searchKeys$item2 === void 0 ? void 0 : _searchKeys$item2.indexOf('^{')) !== -1) {
|
|
62
|
+
// 清除"^{"与"}"取当前的
|
|
63
|
+
var keyParam = searchKeys[item].replace('^{', '').substring(0, searchKeys[item].replace('^{', '').lastIndexOf('}'));
|
|
64
|
+
searchKeys[item] = localStorage.getItem(keyParam) || '';
|
|
65
|
+
}
|
|
66
|
+
getPath += (index === 0 ? "?" : '&') + item + "=" + searchKeys[item];
|
|
67
|
+
});
|
|
68
|
+
return getPath;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* 是否是完整的URL
|
|
72
|
+
*
|
|
73
|
+
* */
|
|
74
|
+
var isUrl = exports.isUrl = function isUrl(path) {
|
|
75
|
+
if (!path.startsWith('http')) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
var url = new URL(path);
|
|
80
|
+
return !!url;
|
|
81
|
+
} catch (error) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
};
|