antd-management-fast-framework 1.1.63 → 1.1.67
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/es/customComponents/AMap/UIPoiPicker.d.ts +7 -0
- package/es/customComponents/AMap/UIPoiPicker.js +78 -0
- package/es/customComponents/AMap/UIPositionPicker.d.ts +7 -0
- package/es/customComponents/AMap/UIPositionPicker.js +87 -0
- package/es/customComponents/ActiveChart/index.d.ts +8 -0
- package/es/customComponents/ActiveChart/index.js +168 -0
- package/{src → es}/customComponents/ActiveChart/index.less +0 -0
- package/es/customComponents/AnimalBox/FadeBox/index.d.ts +13 -0
- package/es/customComponents/AnimalBox/FadeBox/index.js +82 -0
- package/{src → es}/customComponents/AnimalBox/FadeBox/index.less +0 -0
- package/es/customComponents/AnimalBox/QueueBox/index.d.ts +14 -0
- package/es/customComponents/AnimalBox/QueueBox/index.js +117 -0
- package/{src → es}/customComponents/AnimalBox/QueueBox/index.less +0 -0
- package/es/customComponents/ArticleListContent/index.d.ts +10 -0
- package/es/customComponents/ArticleListContent/index.js +46 -0
- package/{src → es}/customComponents/ArticleListContent/index.less +0 -0
- package/es/customComponents/Authorized/Authorized.d.ts +6 -0
- package/es/customComponents/Authorized/Authorized.js +33 -0
- package/es/customComponents/Authorized/AuthorizedRoute.d.ts +8 -0
- package/es/customComponents/Authorized/AuthorizedRoute.js +50 -0
- package/es/customComponents/Authorized/CheckPermissions.d.ts +11 -0
- package/es/customComponents/Authorized/CheckPermissions.js +106 -0
- package/es/customComponents/Authorized/PromiseRender.d.ts +7 -0
- package/es/customComponents/Authorized/PromiseRender.js +159 -0
- package/es/customComponents/Authorized/Secured.d.ts +18 -0
- package/{src/customComponents/Authorized/Secured.jsx → es/customComponents/Authorized/Secured.js} +41 -22
- package/es/customComponents/Authorized/index.d.ts +2 -0
- package/es/customComponents/Authorized/index.js +22 -0
- package/es/customComponents/Authorized/renderAuthorize.d.ts +3 -0
- package/es/customComponents/Authorized/renderAuthorize.js +37 -0
- package/es/customComponents/AvatarList/index.d.ts +17 -0
- package/es/customComponents/AvatarList/index.js +99 -0
- package/{src → es}/customComponents/AvatarList/index.less +0 -0
- package/es/customComponents/AvatarList/index.test.d.ts +1 -0
- package/es/customComponents/Canvas/Bubbly/index.d.ts +20 -0
- package/es/customComponents/Canvas/Bubbly/index.js +178 -0
- package/es/customComponents/Canvas/Core/index.d.ts +24 -0
- package/es/customComponents/Canvas/Core/index.js +163 -0
- package/es/customComponents/Canvas/RadarScanning/index.d.ts +20 -0
- package/es/customComponents/Canvas/RadarScanning/index.js +247 -0
- package/{src → es}/customComponents/Canvas/Ribbon.7z +0 -0
- package/es/customComponents/Canvas/Spirit/index.d.ts +19 -0
- package/es/customComponents/Canvas/Spirit/index.js +115 -0
- package/es/customComponents/Canvas/index.d.ts +12 -0
- package/es/customComponents/Canvas/index.js +27 -0
- package/es/customComponents/CenterBox/index.d.ts +6 -0
- package/es/customComponents/CenterBox/index.js +70 -0
- package/es/customComponents/Charts/Bar/index.d.ts +6 -0
- package/es/customComponents/Charts/Bar/index.js +129 -0
- package/es/customComponents/Charts/ChartCard/index.d.ts +7 -0
- package/es/customComponents/Charts/ChartCard/index.js +167 -0
- package/{src → es}/customComponents/Charts/ChartCard/index.less +0 -0
- package/es/customComponents/Charts/Field/index.d.ts +6 -0
- package/es/customComponents/Charts/Field/index.js +37 -0
- package/{src → es}/customComponents/Charts/Field/index.less +0 -0
- package/es/customComponents/Charts/Gauge/index.d.ts +2 -0
- package/es/customComponents/Charts/Gauge/index.js +185 -0
- package/es/customComponents/Charts/MiniArea/index.d.ts +2 -0
- package/es/customComponents/Charts/MiniArea/index.js +107 -0
- package/es/customComponents/Charts/MiniBar/index.d.ts +2 -0
- package/es/customComponents/Charts/MiniBar/index.js +62 -0
- package/es/customComponents/Charts/MiniProgress/index.d.ts +8 -0
- package/es/customComponents/Charts/MiniProgress/index.js +55 -0
- package/{src → es}/customComponents/Charts/MiniProgress/index.less +0 -0
- package/es/customComponents/Charts/Pie/index.d.ts +8 -0
- package/es/customComponents/Charts/Pie/index.js +195 -0
- package/{src → es}/customComponents/Charts/Pie/index.less +0 -0
- package/es/customComponents/Charts/TagCloud/index.d.ts +14 -0
- package/es/customComponents/Charts/TagCloud/index.js +279 -0
- package/{src → es}/customComponents/Charts/TagCloud/index.less +0 -0
- package/es/customComponents/Charts/TimelineChart/index.d.ts +2 -0
- package/es/customComponents/Charts/TimelineChart/index.js +173 -0
- package/{src → es}/customComponents/Charts/TimelineChart/index.less +0 -0
- package/es/customComponents/Charts/WaterWave/index.d.ts +11 -0
- package/es/customComponents/Charts/WaterWave/index.js +319 -0
- package/{src → es}/customComponents/Charts/WaterWave/index.less +0 -0
- package/es/customComponents/Charts/autoHeight.d.ts +8 -0
- package/es/customComponents/Charts/autoHeight.js +123 -0
- package/es/customComponents/Charts/bizcharts.d.ts +2 -0
- package/es/customComponents/Charts/bizcharts.js +17 -0
- package/es/customComponents/Charts/index.d.ts +27 -0
- package/es/customComponents/Charts/index.js +119 -0
- package/{src → es}/customComponents/Charts/index.less +0 -0
- package/es/customComponents/ColorText/index.d.ts +18 -0
- package/es/customComponents/ColorText/index.js +127 -0
- package/es/customComponents/Countdown/index.d.ts +12 -0
- package/es/customComponents/Countdown/index.js +158 -0
- package/{src → es}/customComponents/Countdown/index.less +0 -0
- package/es/customComponents/DataPreviewDrawer/index.d.ts +13 -0
- package/es/customComponents/DataPreviewDrawer/index.js +176 -0
- package/{src → es}/customComponents/DataPreviewDrawer/index.less +0 -0
- package/es/customComponents/DecorateAvatar/index.d.ts +33 -0
- package/es/customComponents/DecorateAvatar/index.js +198 -0
- package/es/customComponents/DisplayCopyData/index.d.ts +9 -0
- package/es/customComponents/DisplayCopyData/index.js +88 -0
- package/es/customComponents/EditableItem/index.d.ts +7 -0
- package/es/customComponents/EditableItem/index.js +121 -0
- package/{src → es}/customComponents/EditableItem/index.less +0 -0
- package/es/customComponents/EditableLinkGroup/index.d.ts +22 -0
- package/es/customComponents/EditableLinkGroup/index.js +99 -0
- package/{src → es}/customComponents/EditableLinkGroup/index.less +0 -0
- package/es/customComponents/Ellipsis/index.d.ts +19 -0
- package/es/customComponents/Ellipsis/index.js +380 -0
- package/{src → es}/customComponents/Ellipsis/index.less +0 -0
- package/es/customComponents/Ellipsis/index.test.d.ts +1 -0
- package/es/customComponents/EllipsisCustom/index.d.ts +19 -0
- package/es/customComponents/EllipsisCustom/index.js +355 -0
- package/{src → es}/customComponents/EllipsisCustom/index.less +0 -0
- package/es/customComponents/EverySpace/index.d.ts +15 -0
- package/es/customComponents/EverySpace/index.js +105 -0
- package/es/customComponents/Exception/index.d.ts +6 -0
- package/es/customComponents/Exception/index.js +121 -0
- package/{src → es}/customComponents/Exception/index.less +0 -0
- package/es/customComponents/Exception/typeConfig.d.ts +18 -0
- package/{src → es}/customComponents/Exception/typeConfig.js +13 -7
- package/es/customComponents/FigureRange/index.d.ts +126 -0
- package/es/customComponents/FigureRange/index.js +335 -0
- package/{src → es}/customComponents/FigureRange/index.less +0 -0
- package/es/customComponents/FileBase64Upload/index.d.ts +22 -0
- package/es/customComponents/FileBase64Upload/index.js +205 -0
- package/es/customComponents/FlexBox/index.d.ts +22 -0
- package/es/customComponents/FlexBox/index.js +152 -0
- package/es/customComponents/FlexText/index.d.ts +17 -0
- package/es/customComponents/FlexText/index.js +96 -0
- package/{src → es}/customComponents/FlexText/index.less +0 -0
- package/es/customComponents/FooterToolbar/index.d.ts +10 -0
- package/es/customComponents/FooterToolbar/index.js +132 -0
- package/{src → es}/customComponents/FooterToolbar/index.less +0 -0
- package/es/customComponents/FromDisplayItem/index.d.ts +13 -0
- package/es/customComponents/FromDisplayItem/index.js +73 -0
- package/{src → es}/customComponents/FromDisplayItem/index.less +0 -0
- package/es/customComponents/FunctionComponent/index.d.ts +353 -0
- package/es/customComponents/FunctionComponent/index.js +2443 -0
- package/{src → es}/customComponents/FunctionComponent/index.less +0 -0
- package/es/customComponents/FunctionSupplement/Whether/index.d.ts +46 -0
- package/es/customComponents/FunctionSupplement/Whether/index.js +181 -0
- package/es/customComponents/GlobalFooter/index.d.ts +6 -0
- package/es/customComponents/GlobalFooter/index.js +39 -0
- package/{src → es}/customComponents/GlobalFooter/index.less +0 -0
- package/es/customComponents/HelpBox/index.d.ts +16 -0
- package/es/customComponents/HelpBox/index.js +166 -0
- package/{src → es}/customComponents/HelpBox/index.less +0 -0
- package/es/customComponents/HelpCard/index.d.ts +17 -0
- package/es/customComponents/HelpCard/index.js +91 -0
- package/es/customComponents/HtmlBox/index.d.ts +11 -0
- package/es/customComponents/HtmlBox/index.js +98 -0
- package/{src → es}/customComponents/HtmlBox/index.less +0 -0
- package/es/customComponents/IconInfo/index.d.ts +27 -0
- package/es/customComponents/IconInfo/index.js +281 -0
- package/{src → es}/customComponents/IconInfo/index.less +0 -0
- package/es/customComponents/ImageBox/index.d.ts +39 -0
- package/es/customComponents/ImageBox/index.js +376 -0
- package/{src → es}/customComponents/ImageBox/index.less +0 -0
- package/es/customComponents/ImageContentPreview/index.d.ts +13 -0
- package/es/customComponents/ImageContentPreview/index.js +173 -0
- package/{src → es}/customComponents/ImageContentPreview/index.less +0 -0
- package/es/customComponents/ImageUpload/index.d.ts +33 -0
- package/es/customComponents/ImageUpload/index.js +367 -0
- package/{src → es}/customComponents/ImageUpload/index.less +0 -0
- package/es/customComponents/Login/LoginItem.d.ts +2 -0
- package/es/customComponents/Login/LoginItem.js +237 -0
- package/es/customComponents/Login/LoginSubmit.d.ts +5 -0
- package/es/customComponents/Login/LoginSubmit.js +48 -0
- package/es/customComponents/Login/LoginTab.d.ts +5 -0
- package/es/customComponents/Login/LoginTab.js +100 -0
- package/es/customComponents/Login/index.d.ts +38 -0
- package/es/customComponents/Login/index.js +222 -0
- package/{src → es}/customComponents/Login/index.less +0 -0
- package/es/customComponents/Login/loginContext.d.ts +2 -0
- package/es/customComponents/Login/loginContext.js +12 -0
- package/es/customComponents/Login/map.d.ts +71 -0
- package/es/customComponents/Login/map.js +76 -0
- package/es/customComponents/MobileContainor/index.d.ts +6 -0
- package/es/customComponents/MobileContainor/index.js +77 -0
- package/{src → es}/customComponents/MobileContainor/index.less +0 -0
- package/es/customComponents/NoticeIconCustom/NoticeList.d.ts +10 -0
- package/es/customComponents/NoticeIconCustom/NoticeList.js +83 -0
- package/{src → es}/customComponents/NoticeIconCustom/NoticeList.less +0 -0
- package/es/customComponents/NoticeIconCustom/index.d.ts +24 -0
- package/es/customComponents/NoticeIconCustom/index.js +201 -0
- package/{src → es}/customComponents/NoticeIconCustom/index.less +0 -0
- package/es/customComponents/NumberInfo/index.d.ts +12 -0
- package/es/customComponents/NumberInfo/index.js +60 -0
- package/{src → es}/customComponents/NumberInfo/index.less +0 -0
- package/es/customComponents/PercentageBox/index.d.ts +11 -0
- package/es/customComponents/PercentageBox/index.js +70 -0
- package/es/customComponents/PriceBox/index.d.ts +17 -0
- package/es/customComponents/PriceBox/index.js +115 -0
- package/es/customComponents/Result/index.d.ts +9 -0
- package/es/customComponents/Result/index.js +57 -0
- package/{src → es}/customComponents/Result/index.less +0 -0
- package/es/customComponents/StandardFormRow/index.d.ts +9 -0
- package/es/customComponents/StandardFormRow/index.js +47 -0
- package/{src → es}/customComponents/StandardFormRow/index.less +0 -0
- package/es/customComponents/StandardTable/index.d.ts +12 -0
- package/es/customComponents/StandardTable/index.js +217 -0
- package/{src → es}/customComponents/StandardTable/index.less +0 -0
- package/es/customComponents/StandardTableCustom/index.d.ts +17 -0
- package/es/customComponents/StandardTableCustom/index.js +236 -0
- package/{src → es}/customComponents/StandardTableCustom/index.less +0 -0
- package/es/customComponents/StatusBar/index.d.ts +12 -0
- package/es/customComponents/StatusBar/index.js +128 -0
- package/es/customComponents/TagSelect/index.d.ts +29 -0
- package/es/customComponents/TagSelect/index.js +226 -0
- package/{src → es}/customComponents/TagSelect/index.less +0 -0
- package/es/customComponents/TimeLineCustom/index.d.ts +32 -0
- package/es/customComponents/TimeLineCustom/index.js +263 -0
- package/{src → es}/customComponents/TimeLineCustom/index.less +0 -0
- package/es/customComponents/Trend/index.d.ts +10 -0
- package/es/customComponents/Trend/index.js +49 -0
- package/{src → es}/customComponents/Trend/index.less +0 -0
- package/es/customComponents/VerticalBox/index.d.ts +14 -0
- package/es/customComponents/VerticalBox/index.js +138 -0
- package/{src → es}/customComponents/VerticalBox/index.less +0 -0
- package/es/customComponents/VideoUpload/index.d.ts +30 -0
- package/es/customComponents/VideoUpload/index.js +472 -0
- package/es/customComponents/_utils/pathTools.d.ts +1 -0
- package/es/customComponents/_utils/pathTools.js +15 -0
- package/es/customComponents/_utils/pathTools.test.d.ts +1 -0
- package/es/customComponents/index.d.ts +7 -0
- package/{src → es}/customComponents/index.js +9 -2
- package/es/framework/AuthorizationWrapper/index.d.ts +9 -0
- package/es/framework/AuthorizationWrapper/index.js +120 -0
- package/es/framework/Base/index.d.ts +17 -0
- package/es/framework/Base/index.js +141 -0
- package/es/framework/ButtonExtension/SelectButton/Base/index.d.ts +15 -0
- package/es/framework/ButtonExtension/SelectButton/Base/index.js +116 -0
- package/es/framework/ButtonExtension/SelectButton/InteractiveBase/index.d.ts +19 -0
- package/es/framework/ButtonExtension/SelectButton/InteractiveBase/index.js +177 -0
- package/es/framework/Common/index.d.ts +151 -0
- package/es/framework/Common/index.js +1867 -0
- package/{src → es}/framework/Common/index.less +0 -0
- package/es/framework/Core/index.d.ts +9 -0
- package/es/framework/Core/index.js +79 -0
- package/es/framework/CustomBase/index.d.ts +6 -0
- package/es/framework/CustomBase/index.js +77 -0
- package/es/framework/CustomWrapper/Supplement/index.d.ts +10 -0
- package/es/framework/CustomWrapper/Supplement/index.js +64 -0
- package/es/framework/CustomWrapper/SupplementCore/index.d.ts +4 -0
- package/es/framework/CustomWrapper/SupplementCore/index.js +112 -0
- package/es/framework/CustomWrapper/SupplementWrapper/index.d.ts +4 -0
- package/es/framework/CustomWrapper/SupplementWrapper/index.js +58 -0
- package/es/framework/DataDrawer/Base/index.d.ts +54 -0
- package/es/framework/DataDrawer/Base/index.js +385 -0
- package/{src → es}/framework/DataDrawer/Base/index.less +0 -0
- package/es/framework/DataDrawer/BaseAddDrawer/index.d.ts +5 -0
- package/es/framework/DataDrawer/BaseAddDrawer/index.js +102 -0
- package/es/framework/DataDrawer/BaseLoadDrawer/index.d.ts +4 -0
- package/es/framework/DataDrawer/BaseLoadDrawer/index.js +81 -0
- package/es/framework/DataDrawer/BaseNeedlessLoadDrawer/index.d.ts +5 -0
- package/es/framework/DataDrawer/BaseNeedlessLoadDrawer/index.js +86 -0
- package/es/framework/DataDrawer/BaseSaveDrawer/index.d.ts +5 -0
- package/es/framework/DataDrawer/BaseSaveDrawer/index.js +85 -0
- package/es/framework/DataDrawer/BaseUpdateDrawer/index.d.ts +4 -0
- package/es/framework/DataDrawer/BaseUpdateDrawer/index.js +83 -0
- package/es/framework/DataForm/BaseAddForm/index.d.ts +34 -0
- package/es/framework/DataForm/BaseAddForm/index.js +274 -0
- package/es/framework/DataForm/BaseUpdateForm/index.d.ts +10 -0
- package/es/framework/DataForm/BaseUpdateForm/index.js +189 -0
- package/es/framework/DataForm/BaseUpdateFormContent/index.d.ts +4 -0
- package/es/framework/DataForm/BaseUpdateFormContent/index.js +62 -0
- package/es/framework/DataForm/BaseUpdateFormTab/index.d.ts +4 -0
- package/es/framework/DataForm/BaseUpdateFormTab/index.js +45 -0
- package/es/framework/DataListView/Base/index.d.ts +141 -0
- package/es/framework/DataListView/Base/index.js +1391 -0
- package/{src → es}/framework/DataListView/Base/index.less +0 -0
- package/es/framework/DataListView/BatchAction/index.d.ts +21 -0
- package/es/framework/DataListView/BatchAction/index.js +97 -0
- package/{src → es}/framework/DataListView/BatchAction/index.less +0 -0
- package/es/framework/DataListView/ColumnSetting/DndItem.d.ts +8 -0
- package/es/framework/DataListView/ColumnSetting/DndItem.js +155 -0
- package/es/framework/DataListView/ColumnSetting/index.d.ts +3 -0
- package/es/framework/DataListView/ColumnSetting/index.js +366 -0
- package/{src → es}/framework/DataListView/ColumnSetting/index.less +0 -0
- package/es/framework/DataListView/DensityAction/index.d.ts +6 -0
- package/es/framework/DataListView/DensityAction/index.js +112 -0
- package/es/framework/DataMenuContainer/index.d.ts +30 -0
- package/es/framework/DataMenuContainer/index.js +341 -0
- package/es/framework/DataMenuContainer/index.less +107 -0
- package/es/framework/DataModal/Base/index.d.ts +67 -0
- package/es/framework/DataModal/Base/index.js +292 -0
- package/{src → es}/framework/DataModal/Base/index.less +0 -0
- package/es/framework/DataModal/BaseAddModal/index.d.ts +4 -0
- package/es/framework/DataModal/BaseAddModal/index.js +70 -0
- package/es/framework/DataModal/BaseLoadModal/index.d.ts +4 -0
- package/es/framework/DataModal/BaseLoadModal/index.js +81 -0
- package/es/framework/DataModal/BaseNeedlessLoadModal/index.d.ts +10 -0
- package/es/framework/DataModal/BaseNeedlessLoadModal/index.js +135 -0
- package/es/framework/DataModal/BaseSelectModal/index.d.ts +4 -0
- package/es/framework/DataModal/BaseSelectModal/index.js +69 -0
- package/es/framework/DataModal/BaseUpdateModal/index.d.ts +4 -0
- package/es/framework/DataModal/BaseUpdateModal/index.js +45 -0
- package/es/framework/DataModal/BaseUpdateTransferModal/index.d.ts +10 -0
- package/es/framework/DataModal/BaseUpdateTransferModal/index.js +164 -0
- package/es/framework/DataMultiPageView/InnerMultiPage/index.d.ts +4 -0
- package/es/framework/DataMultiPageView/InnerMultiPage/index.js +58 -0
- package/{src → es}/framework/DataMultiPageView/InnerMultiPage/index.less +0 -0
- package/es/framework/DataMultiPageView/MultiPage/index.d.ts +24 -0
- package/es/framework/DataMultiPageView/MultiPage/index.js +480 -0
- package/{src → es}/framework/DataMultiPageView/MultiPage/index.less +0 -0
- package/es/framework/DataMultiPageView/MultiPageDrawer/index.d.ts +32 -0
- package/es/framework/DataMultiPageView/MultiPageDrawer/index.js +535 -0
- package/{src → es}/framework/DataMultiPageView/MultiPageDrawer/index.less +0 -0
- package/es/framework/DataMultiPageView/MultiPageSelectDrawer/index.d.ts +11 -0
- package/es/framework/DataMultiPageView/MultiPageSelectDrawer/index.js +121 -0
- package/es/framework/DataOperation/Base/index.d.ts +76 -0
- package/es/framework/DataOperation/Base/index.js +369 -0
- package/es/framework/DataOperation/BaseView/index.d.ts +11 -0
- package/es/framework/DataOperation/BaseView/index.js +74 -0
- package/es/framework/DataOperation/BaseWindow/index.d.ts +53 -0
- package/es/framework/DataOperation/BaseWindow/index.js +342 -0
- package/es/framework/DataSinglePageView/InnerSinglePage/index.d.ts +5 -0
- package/es/framework/DataSinglePageView/InnerSinglePage/index.js +58 -0
- package/{src → es}/framework/DataSinglePageView/InnerSinglePage/index.less +0 -0
- package/es/framework/DataSinglePageView/SinglePage/index.d.ts +13 -0
- package/es/framework/DataSinglePageView/SinglePage/index.js +282 -0
- package/es/framework/DataSinglePageView/SinglePageDrawer/index.d.ts +25 -0
- package/es/framework/DataSinglePageView/SinglePageDrawer/index.js +454 -0
- package/{src → es}/framework/DataSinglePageView/SinglePageDrawer/index.less +0 -0
- package/es/framework/DataSingleView/DataCore/index.d.ts +29 -0
- package/es/framework/DataSingleView/DataCore/index.js +269 -0
- package/{src → es}/framework/DataSingleView/DataCore/index.less +0 -0
- package/es/framework/DataSingleView/DataLoad/index.d.ts +52 -0
- package/es/framework/DataSingleView/DataLoad/index.js +169 -0
- package/es/framework/DataTabContainer/index.d.ts +46 -0
- package/es/framework/DataTabContainer/index.js +315 -0
- package/{src → es}/framework/DataTabContainer/index.less +0 -0
- package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldBase/index.d.ts +24 -0
- package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldBase/index.js +184 -0
- package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldDrawerBase/index.d.ts +20 -0
- package/es/framework/FieldExtension/SelectFieldDrawer/SelectFieldDrawerBase/index.js +191 -0
- package/es/framework/Wrapper/index.d.ts +4 -0
- package/es/framework/Wrapper/index.js +58 -0
- package/es/framework/index.d.ts +7 -0
- package/{src → es}/framework/index.js +9 -2
- package/es/index.d.ts +1 -0
- package/es/index.js +8 -0
- package/es/utils/Authorized.d.ts +4 -0
- package/es/utils/Authorized.js +49 -0
- package/es/utils/Yuan.d.ts +10 -0
- package/es/utils/Yuan.js +92 -0
- package/es/utils/actionAssist.d.ts +39 -0
- package/es/utils/actionAssist.js +286 -0
- package/es/utils/authority.d.ts +4 -0
- package/es/utils/authority.js +89 -0
- package/es/utils/constants.d.ts +329 -0
- package/{src → es}/utils/constants.js +140 -115
- package/es/utils/defaultSettingsSpecial.d.ts +33 -0
- package/es/utils/defaultSettingsSpecial.js +276 -0
- package/es/utils/globalModel.d.ts +17 -0
- package/es/utils/globalModel.js +40 -0
- package/es/utils/globalStorageAssist.d.ts +74 -0
- package/es/utils/globalStorageAssist.js +210 -0
- package/es/utils/proLayoutCollection.d.ts +11 -0
- package/es/utils/proLayoutCollection.js +37 -0
- package/es/utils/request.d.ts +5 -0
- package/es/utils/request.js +202 -0
- package/es/utils/requestAssistor.d.ts +63 -0
- package/es/utils/requestAssistor.js +538 -0
- package/es/utils/tools.d.ts +736 -0
- package/es/utils/tools.js +2176 -0
- package/es/utils/utils.d.ts +5 -0
- package/es/utils/utils.js +70 -0
- package/{src → es}/utils/utils.less +0 -0
- package/es/utils/utils.test.d.ts +1 -0
- package/es/utils/virtualRequest.d.ts +50 -0
- package/es/utils/virtualRequest.js +325 -0
- package/lib/customComponents/FileBase64Upload/index.js +3 -1
- package/lib/customComponents/FunctionComponent/index.d.ts +8 -0
- package/lib/customComponents/FunctionComponent/index.js +106 -77
- package/lib/customComponents/ImageUpload/index.js +3 -1
- package/lib/customComponents/VideoUpload/index.js +3 -1
- package/lib/framework/Base/index.d.ts +2 -0
- package/lib/framework/Base/index.js +6 -0
- package/lib/framework/Common/index.d.ts +14 -1
- package/lib/framework/Common/index.js +143 -85
- package/lib/framework/DataForm/BaseUpdateFormContent/index.d.ts +4 -0
- package/lib/framework/DataForm/BaseUpdateFormContent/index.js +62 -0
- package/lib/framework/DataForm/BaseUpdateFormTab/index.d.ts +2 -2
- package/lib/framework/DataForm/BaseUpdateFormTab/index.js +4 -21
- package/lib/framework/DataMenuContainer/index.d.ts +30 -0
- package/lib/framework/DataMenuContainer/index.js +341 -0
- package/lib/framework/DataMenuContainer/index.less +107 -0
- package/lib/utils/constants.d.ts +8 -0
- package/lib/utils/constants.js +7 -1
- package/lib/utils/defaultSettingsSpecial.d.ts +3 -0
- package/lib/utils/defaultSettingsSpecial.js +30 -0
- package/lib/utils/tools.d.ts +15 -0
- package/lib/utils/tools.js +72 -2
- package/package.json +15 -11
- package/LICENSE.md +0 -21
- package/lib/framework/DataForm/BaseUpdateForm/index.less +0 -3
- package/lib/framework/DataForm/BaseUpdateFormTab/index.less +0 -3
- package/src/customComponents/AMap/UIPoiPicker.js +0 -32
- package/src/customComponents/AMap/UIPositionPicker.js +0 -42
- package/src/customComponents/ActiveChart/index.jsx +0 -106
- package/src/customComponents/AnimalBox/FadeBox/index.jsx +0 -26
- package/src/customComponents/AnimalBox/QueueBox/index.jsx +0 -72
- package/src/customComponents/ArticleListContent/index.jsx +0 -22
- package/src/customComponents/Authorized/Authorized.jsx +0 -22
- package/src/customComponents/Authorized/AuthorizedRoute.jsx +0 -35
- package/src/customComponents/Authorized/CheckPermissions.jsx +0 -80
- package/src/customComponents/Authorized/PromiseRender.jsx +0 -79
- package/src/customComponents/Authorized/index.jsx +0 -9
- package/src/customComponents/Authorized/renderAuthorize.js +0 -27
- package/src/customComponents/AvatarList/demo/maxLength.md +0 -46
- package/src/customComponents/AvatarList/demo/simple.md +0 -30
- package/src/customComponents/AvatarList/index.en-US.md +0 -24
- package/src/customComponents/AvatarList/index.jsx +0 -69
- package/src/customComponents/AvatarList/index.test.js +0 -31
- package/src/customComponents/AvatarList/index.zh-CN.md +0 -25
- package/src/customComponents/Canvas/Bubbly/index.jsx +0 -117
- package/src/customComponents/Canvas/Core/index.jsx +0 -120
- package/src/customComponents/Canvas/RadarScanning/index.jsx +0 -188
- package/src/customComponents/Canvas/Spirit/index.jsx +0 -75
- package/src/customComponents/Canvas/index.jsx +0 -13
- package/src/customComponents/CenterBox/index.jsx +0 -24
- package/src/customComponents/Charts/Bar/index.jsx +0 -67
- package/src/customComponents/Charts/ChartCard/index.jsx +0 -112
- package/src/customComponents/Charts/Field/index.jsx +0 -11
- package/src/customComponents/Charts/Gauge/index.jsx +0 -184
- package/src/customComponents/Charts/MiniArea/index.jsx +0 -99
- package/src/customComponents/Charts/MiniBar/index.jsx +0 -49
- package/src/customComponents/Charts/MiniProgress/index.jsx +0 -45
- package/src/customComponents/Charts/Pie/index.jsx +0 -129
- package/src/customComponents/Charts/TagCloud/index.jsx +0 -200
- package/src/customComponents/Charts/TimelineChart/index.jsx +0 -151
- package/src/customComponents/Charts/WaterWave/index.jsx +0 -258
- package/src/customComponents/Charts/autoHeight.jsx +0 -71
- package/src/customComponents/Charts/bizcharts.jsx +0 -3
- package/src/customComponents/Charts/index.jsx +0 -44
- package/src/customComponents/ColorText/index.jsx +0 -73
- package/src/customComponents/Countdown/demo/simple.md +0 -25
- package/src/customComponents/Countdown/index.en-US.md +0 -15
- package/src/customComponents/Countdown/index.jsx +0 -122
- package/src/customComponents/Countdown/index.zh-CN.md +0 -16
- package/src/customComponents/DataPreviewDrawer/index.jsx +0 -139
- package/src/customComponents/DecorateAvatar/index.jsx +0 -149
- package/src/customComponents/DisplayCopyData/index.js +0 -50
- package/src/customComponents/EditableItem/index.jsx +0 -56
- package/src/customComponents/EditableLinkGroup/index.jsx +0 -52
- package/src/customComponents/Ellipsis/demo/line.md +0 -40
- package/src/customComponents/Ellipsis/demo/number.md +0 -32
- package/src/customComponents/Ellipsis/index.en-US.md +0 -16
- package/src/customComponents/Ellipsis/index.jsx +0 -286
- package/src/customComponents/Ellipsis/index.test.js +0 -13
- package/src/customComponents/Ellipsis/index.zh-CN.md +0 -17
- package/src/customComponents/EllipsisCustom/index.jsx +0 -293
- package/src/customComponents/EverySpace/index.jsx +0 -64
- package/src/customComponents/Exception/demo/403.md +0 -27
- package/src/customComponents/Exception/demo/404.md +0 -20
- package/src/customComponents/Exception/demo/500.md +0 -20
- package/src/customComponents/Exception/index.en-US.md +0 -20
- package/src/customComponents/Exception/index.jsx +0 -53
- package/src/customComponents/Exception/index.zh-CN.md +0 -21
- package/src/customComponents/FigureRange/index.jsx +0 -290
- package/src/customComponents/FileBase64Upload/index.jsx +0 -139
- package/src/customComponents/FlexBox/index.jsx +0 -104
- package/src/customComponents/FlexText/index.jsx +0 -59
- package/src/customComponents/FooterToolbar/demo/basic.md +0 -45
- package/src/customComponents/FooterToolbar/index.en-US.md +0 -18
- package/src/customComponents/FooterToolbar/index.jsx +0 -51
- package/src/customComponents/FooterToolbar/index.zh-CN.md +0 -19
- package/src/customComponents/FromDisplayItem/index.jsx +0 -23
- package/src/customComponents/FunctionComponent/index.jsx +0 -2613
- package/src/customComponents/FunctionSupplement/Whether/index.jsx +0 -139
- package/src/customComponents/GlobalFooter/index.jsx +0 -29
- package/src/customComponents/GlobalFooter/index.md +0 -17
- package/src/customComponents/HelpBox/index.jsx +0 -146
- package/src/customComponents/HelpCard/index.jsx +0 -48
- package/src/customComponents/HtmlBox/index.jsx +0 -36
- package/src/customComponents/IconInfo/index.jsx +0 -302
- package/src/customComponents/ImageBox/index.jsx +0 -402
- package/src/customComponents/ImageContentPreview/index.jsx +0 -146
- package/src/customComponents/ImageUpload/index.jsx +0 -340
- package/src/customComponents/Login/LoginItem.js +0 -144
- package/src/customComponents/Login/LoginSubmit.js +0 -23
- package/src/customComponents/Login/LoginTab.js +0 -41
- package/src/customComponents/Login/demo/basic.md +0 -142
- package/src/customComponents/Login/index.en-US.md +0 -49
- package/src/customComponents/Login/index.jsx +0 -138
- package/src/customComponents/Login/index.zh-CN.md +0 -50
- package/src/customComponents/Login/loginContext.js +0 -4
- package/src/customComponents/Login/map.js +0 -71
- package/src/customComponents/MobileContainor/index.jsx +0 -29
- package/src/customComponents/NoticeIconCustom/NoticeList.js +0 -78
- package/src/customComponents/NoticeIconCustom/demo/basic.md +0 -12
- package/src/customComponents/NoticeIconCustom/demo/popover.md +0 -202
- package/src/customComponents/NoticeIconCustom/index.jsx +0 -117
- package/src/customComponents/NumberInfo/demo/basic.md +0 -31
- package/src/customComponents/NumberInfo/index.en-US.md +0 -19
- package/src/customComponents/NumberInfo/index.jsx +0 -59
- package/src/customComponents/NumberInfo/index.zh-CN.md +0 -20
- package/src/customComponents/PercentageBox/index.jsx +0 -23
- package/src/customComponents/PriceBox/index.jsx +0 -73
- package/src/customComponents/Result/index.jsx +0 -30
- package/src/customComponents/Result/index.md +0 -20
- package/src/customComponents/StandardFormRow/index.jsx +0 -24
- package/src/customComponents/StandardTable/index.jsx +0 -126
- package/src/customComponents/StandardTableCustom/index.jsx +0 -156
- package/src/customComponents/StatusBar/index.jsx +0 -74
- package/src/customComponents/TagSelect/demo/controlled.md +0 -54
- package/src/customComponents/TagSelect/demo/expandable.md +0 -32
- package/src/customComponents/TagSelect/demo/simple.md +0 -26
- package/src/customComponents/TagSelect/index.jsx +0 -141
- package/src/customComponents/TagSelect/index.md +0 -29
- package/src/customComponents/TimeLineCustom/index.jsx +0 -225
- package/src/customComponents/Trend/demo/basic.md +0 -20
- package/src/customComponents/Trend/demo/reverse.md +0 -22
- package/src/customComponents/Trend/index.jsx +0 -35
- package/src/customComponents/Trend/index.md +0 -22
- package/src/customComponents/VerticalBox/index.jsx +0 -81
- package/src/customComponents/VideoUpload/index.jsx +0 -422
- package/src/customComponents/_utils/pathTools.js +0 -7
- package/src/customComponents/_utils/pathTools.test.js +0 -20
- package/src/framework/AuthorizationWrapper/index.jsx +0 -68
- package/src/framework/Base/index.jsx +0 -93
- package/src/framework/ButtonExtension/SelectButton/Base/index.jsx +0 -67
- package/src/framework/ButtonExtension/SelectButton/InteractiveBase/index.jsx +0 -130
- package/src/framework/Common/index.jsx +0 -2235
- package/src/framework/Core/index.jsx +0 -34
- package/src/framework/CustomBase/index.jsx +0 -33
- package/src/framework/CustomWrapper/Supplement/index.jsx +0 -17
- package/src/framework/CustomWrapper/SupplementCore/index.jsx +0 -65
- package/src/framework/CustomWrapper/SupplementWrapper/index.jsx +0 -11
- package/src/framework/DataDrawer/Base/index.jsx +0 -314
- package/src/framework/DataDrawer/BaseAddDrawer/index.jsx +0 -50
- package/src/framework/DataDrawer/BaseLoadDrawer/index.jsx +0 -20
- package/src/framework/DataDrawer/BaseNeedlessLoadDrawer/index.jsx +0 -37
- package/src/framework/DataDrawer/BaseSaveDrawer/index.jsx +0 -35
- package/src/framework/DataDrawer/BaseUpdateDrawer/index.jsx +0 -33
- package/src/framework/DataForm/BaseAddForm/index.jsx +0 -231
- package/src/framework/DataForm/BaseUpdateForm/index.jsx +0 -145
- package/src/framework/DataForm/BaseUpdateForm/index.less +0 -3
- package/src/framework/DataForm/BaseUpdateFormTab/index.jsx +0 -18
- package/src/framework/DataForm/BaseUpdateFormTab/index.less +0 -3
- package/src/framework/DataListView/Base/index.jsx +0 -1583
- package/src/framework/DataListView/BatchAction/index.jsx +0 -78
- package/src/framework/DataListView/ColumnSetting/DndItem.jsx +0 -105
- package/src/framework/DataListView/ColumnSetting/index.jsx +0 -346
- package/src/framework/DataListView/DensityAction/index.jsx +0 -46
- package/src/framework/DataModal/Base/index.jsx +0 -238
- package/src/framework/DataModal/BaseAddModal/index.jsx +0 -17
- package/src/framework/DataModal/BaseLoadModal/index.jsx +0 -30
- package/src/framework/DataModal/BaseNeedlessLoadModal/index.jsx +0 -83
- package/src/framework/DataModal/BaseSelectModal/index.jsx +0 -28
- package/src/framework/DataModal/BaseUpdateModal/index.jsx +0 -5
- package/src/framework/DataModal/BaseUpdateTransferModal/index.jsx +0 -103
- package/src/framework/DataMultiPageView/InnerMultiPage/index.jsx +0 -18
- package/src/framework/DataMultiPageView/MultiPage/index.jsx +0 -461
- package/src/framework/DataMultiPageView/MultiPageDrawer/index.jsx +0 -549
- package/src/framework/DataMultiPageView/MultiPageSelectDrawer/index.jsx +0 -50
- package/src/framework/DataOperation/Base/index.jsx +0 -323
- package/src/framework/DataOperation/BaseView/index.jsx +0 -26
- package/src/framework/DataOperation/BaseWindow/index.jsx +0 -291
- package/src/framework/DataSinglePageView/InnerSinglePage/index.jsx +0 -18
- package/src/framework/DataSinglePageView/SinglePage/index.jsx +0 -245
- package/src/framework/DataSinglePageView/SinglePageDrawer/index.jsx +0 -474
- package/src/framework/DataSingleView/DataCore/index.jsx +0 -216
- package/src/framework/DataSingleView/DataLoad/index.jsx +0 -127
- package/src/framework/DataTabContainer/index.jsx +0 -304
- package/src/framework/FieldExtension/SelectFieldDrawer/SelectFieldBase/index.jsx +0 -149
- package/src/framework/FieldExtension/SelectFieldDrawer/SelectFieldDrawerBase/index.jsx +0 -140
- package/src/framework/Wrapper/index.jsx +0 -10
- package/src/utils/Authorized.js +0 -42
- package/src/utils/Yuan.js +0 -31
- package/src/utils/actionAssist.js +0 -231
- package/src/utils/authority.js +0 -85
- package/src/utils/defaultSettingsSpecial.js +0 -235
- package/src/utils/globalModel.js +0 -33
- package/src/utils/globalStorageAssist.js +0 -193
- package/src/utils/proLayoutCollection.js +0 -25
- package/src/utils/request.js +0 -160
- package/src/utils/requestAssistor.js +0 -485
- package/src/utils/tools.js +0 -1947
- package/src/utils/utils.js +0 -45
- package/src/utils/utils.test.js +0 -35
- package/src/utils/virtualRequest.js +0 -216
package/src/utils/tools.js
DELETED
|
@@ -1,1947 +0,0 @@
|
|
|
1
|
-
import { message, notification } from 'antd';
|
|
2
|
-
import moment from 'moment';
|
|
3
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
4
|
-
import copy from 'copy-to-clipboard';
|
|
5
|
-
import queue from 'queue';
|
|
6
|
-
import numeral from 'numeral';
|
|
7
|
-
import { arrayMoveImmutable, arrayMoveMutable } from 'array-move';
|
|
8
|
-
import {
|
|
9
|
-
isEqual as isEqualLodash,
|
|
10
|
-
isFunction as isFunctionLodash,
|
|
11
|
-
filter as filterLodash,
|
|
12
|
-
sortBy as sortByLodash,
|
|
13
|
-
findIndex as findIndexLodash,
|
|
14
|
-
find as findLodash,
|
|
15
|
-
reverse as reverseLodash,
|
|
16
|
-
replace as replaceLodash,
|
|
17
|
-
trim as trimLodash,
|
|
18
|
-
isEmpty as isEmptyLodash,
|
|
19
|
-
isBoolean as isBooleanLodash,
|
|
20
|
-
isUndefined as isUndefinedLodash,
|
|
21
|
-
isNull as isNullLodash,
|
|
22
|
-
isDate as isDateLodash,
|
|
23
|
-
isArray as isArrayLodash,
|
|
24
|
-
isString as isStringLodash,
|
|
25
|
-
remove as removeLodash,
|
|
26
|
-
isObject as isObjectLodash,
|
|
27
|
-
difference as differenceLodash,
|
|
28
|
-
toNumber as toNumberLodash,
|
|
29
|
-
split as splitLodash,
|
|
30
|
-
toString as toStringLodash,
|
|
31
|
-
get as getLodash,
|
|
32
|
-
toLower,
|
|
33
|
-
} from 'lodash';
|
|
34
|
-
|
|
35
|
-
import {
|
|
36
|
-
listViewModeCollection,
|
|
37
|
-
emptyDatetime,
|
|
38
|
-
notificationTypeCollection,
|
|
39
|
-
messageTypeCollection,
|
|
40
|
-
logLevel,
|
|
41
|
-
logShowMode,
|
|
42
|
-
appInitDefault,
|
|
43
|
-
convertCollection,
|
|
44
|
-
formatCollection,
|
|
45
|
-
datetimeFormat,
|
|
46
|
-
} from './constants';
|
|
47
|
-
|
|
48
|
-
const storageKeyCollection = {
|
|
49
|
-
nearestLocalhostNotify: 'nearestLocalhostNotify',
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
function isBrowser() {
|
|
53
|
-
return (
|
|
54
|
-
typeof window !== 'undefined' &&
|
|
55
|
-
typeof window.document !== 'undefined' &&
|
|
56
|
-
typeof window.document.createElement !== 'undefined'
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function getAppInitConfigData() {
|
|
61
|
-
let appInitConfig = appInitDefault;
|
|
62
|
-
|
|
63
|
-
if (isBrowser()) {
|
|
64
|
-
if ((window.appInitCustom || null) != null) {
|
|
65
|
-
appInitConfig = { ...appInitConfig, ...window.appInitCustom };
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return appInitConfig;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function defaultBaseState() {
|
|
73
|
-
return {
|
|
74
|
-
dataLoading: false,
|
|
75
|
-
processing: false,
|
|
76
|
-
reloading: false,
|
|
77
|
-
searching: false,
|
|
78
|
-
refreshing: false,
|
|
79
|
-
paging: false,
|
|
80
|
-
firstLoadSuccess: false,
|
|
81
|
-
loadSuccess: false,
|
|
82
|
-
|
|
83
|
-
urlParams: null,
|
|
84
|
-
externalData: null,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export function defaultCoreState() {
|
|
89
|
-
const data = { ...defaultBaseState(), ...{ dataLoading: true } };
|
|
90
|
-
|
|
91
|
-
return data;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export function defaultCommonState() {
|
|
95
|
-
const data = {
|
|
96
|
-
...defaultCoreState(),
|
|
97
|
-
...{
|
|
98
|
-
loadApiPath: '',
|
|
99
|
-
pageName: '',
|
|
100
|
-
metaData: null,
|
|
101
|
-
metaExtra: null,
|
|
102
|
-
metaListData: [],
|
|
103
|
-
metaOriginalData: null,
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
return data;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export function defaultListState() {
|
|
111
|
-
const data = {
|
|
112
|
-
...defaultCommonState(),
|
|
113
|
-
...{
|
|
114
|
-
dateRangeFieldName: '发生时间',
|
|
115
|
-
tableScroll: { x: 1520 },
|
|
116
|
-
formValues: {},
|
|
117
|
-
startTimeAlias: '',
|
|
118
|
-
endTimeAlias: '',
|
|
119
|
-
startTime: '',
|
|
120
|
-
endTime: '',
|
|
121
|
-
listViewMode: listViewModeCollection.table,
|
|
122
|
-
showSelect: false,
|
|
123
|
-
selectedDataTableDataRows: [],
|
|
124
|
-
},
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
return data;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export function defaultPageListState() {
|
|
131
|
-
const data = {
|
|
132
|
-
...defaultCommonState(),
|
|
133
|
-
...{
|
|
134
|
-
paramsKey: '',
|
|
135
|
-
loadApiPath: '',
|
|
136
|
-
dateRangeFieldName: '发生时间',
|
|
137
|
-
tableScroll: { x: 1520 },
|
|
138
|
-
formValues: {},
|
|
139
|
-
pageNo: 1,
|
|
140
|
-
pageSize: 10,
|
|
141
|
-
startTime: '',
|
|
142
|
-
endTime: '',
|
|
143
|
-
listViewMode: listViewModeCollection.table,
|
|
144
|
-
showSelect: false,
|
|
145
|
-
selectedDataTableDataRows: [],
|
|
146
|
-
},
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
return data;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export function defaultFormState() {
|
|
153
|
-
const data = {
|
|
154
|
-
...defaultCommonState(),
|
|
155
|
-
...{ errorFieldName: '', submitApiPath: '' },
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
return data;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export function getValue(obj) {
|
|
162
|
-
return Object.keys(obj)
|
|
163
|
-
.map((key) => obj[key])
|
|
164
|
-
.join(',');
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* 复制到剪贴板
|
|
169
|
-
* @param {*} text
|
|
170
|
-
* @param {*} showText
|
|
171
|
-
*/
|
|
172
|
-
export function copyToClipboard(text, showCopyText = true, otherShowText = '') {
|
|
173
|
-
copy(text);
|
|
174
|
-
|
|
175
|
-
if (showCopyText) {
|
|
176
|
-
message.success(`已经将 ${text} 复制到剪贴板!`);
|
|
177
|
-
} else if (stringIsNullOrWhiteSpace(otherShowText)) {
|
|
178
|
-
message.success('已经复制到剪贴板!');
|
|
179
|
-
} else {
|
|
180
|
-
message.success(`已经将${otherShowText}复制到剪贴板!`);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* 复制到剪贴板
|
|
186
|
-
* @param {*} text
|
|
187
|
-
*/
|
|
188
|
-
export function stringIsEmpty(text) {
|
|
189
|
-
return isEmptyLodash(toString(text || '').replace(' ', ''));
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
*替换指定字符串
|
|
194
|
-
*
|
|
195
|
-
* @export
|
|
196
|
-
* @param {*} text
|
|
197
|
-
* @param {*} replaceText
|
|
198
|
-
* @param {*} beforeKeepNumber
|
|
199
|
-
* @param {*} afterKeepNumber
|
|
200
|
-
* @returns
|
|
201
|
-
*/
|
|
202
|
-
export function replaceTargetText(
|
|
203
|
-
text,
|
|
204
|
-
replaceText,
|
|
205
|
-
beforeKeepNumber,
|
|
206
|
-
afterKeepNumber,
|
|
207
|
-
) {
|
|
208
|
-
let result = toString(text);
|
|
209
|
-
|
|
210
|
-
const textLength = (text || '').length;
|
|
211
|
-
if (textLength > 0 && (beforeKeepNumber >= 0 || afterKeepNumber >= 0)) {
|
|
212
|
-
if (
|
|
213
|
-
beforeKeepNumber >= textLength ||
|
|
214
|
-
afterKeepNumber >= textLength ||
|
|
215
|
-
(beforeKeepNumber || 0) + (afterKeepNumber || 0) >= textLength
|
|
216
|
-
) {
|
|
217
|
-
result = text;
|
|
218
|
-
} else {
|
|
219
|
-
const beforeKeep = text.substr(0, beforeKeepNumber);
|
|
220
|
-
|
|
221
|
-
const afterKeep = text.substr(
|
|
222
|
-
textLength - afterKeepNumber,
|
|
223
|
-
afterKeepNumber,
|
|
224
|
-
);
|
|
225
|
-
|
|
226
|
-
// const replaceTargetLength = textLength - (beforeKeepNumber || 0) - (afterKeepNumber || 0);
|
|
227
|
-
|
|
228
|
-
// const replaceTarget = text.substring(
|
|
229
|
-
// (beforeKeepNumber || 0) <= 0 ? 0 : beforeKeepNumber - 1,
|
|
230
|
-
// textLength - (beforeKeepNumber || 0) - (afterKeepNumber || 0)
|
|
231
|
-
// );
|
|
232
|
-
|
|
233
|
-
// const replaced = [];
|
|
234
|
-
|
|
235
|
-
// let i = 1;
|
|
236
|
-
// while (i <= replaceTargetLength) {
|
|
237
|
-
// replaced.push(replaceText);
|
|
238
|
-
// i += 1;
|
|
239
|
-
// }
|
|
240
|
-
|
|
241
|
-
result = beforeKeep + replaceText + afterKeep;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
return result || '';
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
export function checkDevelopment() {
|
|
249
|
-
return process.env.NODE_ENV === 'development';
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* corsTarget
|
|
254
|
-
* 跨域域名配置
|
|
255
|
-
* @export
|
|
256
|
-
* @param {*} v
|
|
257
|
-
* @returns
|
|
258
|
-
*/
|
|
259
|
-
export function corsTarget() {
|
|
260
|
-
const appInit = getAppInitConfigData();
|
|
261
|
-
let corsTargetDomain = '';
|
|
262
|
-
|
|
263
|
-
if (appInit.apiPrefix != null) {
|
|
264
|
-
if (appInit.apiPrefix.corsTargetDomain != null) {
|
|
265
|
-
const {
|
|
266
|
-
apiPrefix: { corsTargetDomain: corsTargetDomainRemote },
|
|
267
|
-
} = appInit;
|
|
268
|
-
|
|
269
|
-
corsTargetDomain = corsTargetDomainRemote;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return corsTargetDomain;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
export function showError(text) {
|
|
277
|
-
showErrorMessage({
|
|
278
|
-
message: text,
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
export function showRuntimeError({ message: messageText, showStack = true }) {
|
|
283
|
-
try {
|
|
284
|
-
if (!stringIsNullOrWhiteSpace(messageText || '')) {
|
|
285
|
-
showErrorMessage({
|
|
286
|
-
message: messageText,
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
if (showStack) {
|
|
291
|
-
throw new Error(
|
|
292
|
-
`${
|
|
293
|
-
stringIsNullOrWhiteSpace(messageText || '')
|
|
294
|
-
? ''
|
|
295
|
-
: `${toString(messageText)},`
|
|
296
|
-
}调用堆栈:`,
|
|
297
|
-
);
|
|
298
|
-
}
|
|
299
|
-
} catch (e) {
|
|
300
|
-
// eslint-disable-next-line no-console
|
|
301
|
-
console.log(e.stack);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
export function showSuccessMessage({
|
|
306
|
-
duration = 3,
|
|
307
|
-
message: messageText,
|
|
308
|
-
onClose = () => {},
|
|
309
|
-
}) {
|
|
310
|
-
showMessage({
|
|
311
|
-
type: messageTypeCollection.success,
|
|
312
|
-
message: messageText,
|
|
313
|
-
duration,
|
|
314
|
-
onClose,
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
export function showErrorMessage({
|
|
319
|
-
duration = 3,
|
|
320
|
-
message: messageText,
|
|
321
|
-
onClose = () => {},
|
|
322
|
-
}) {
|
|
323
|
-
showMessage({
|
|
324
|
-
type: messageTypeCollection.error,
|
|
325
|
-
message: messageText,
|
|
326
|
-
duration,
|
|
327
|
-
onClose,
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
export function showWarnMessage({
|
|
332
|
-
duration = 3,
|
|
333
|
-
message: messageText,
|
|
334
|
-
onClose = () => {},
|
|
335
|
-
}) {
|
|
336
|
-
showMessage({
|
|
337
|
-
type: messageTypeCollection.warn,
|
|
338
|
-
message: messageText,
|
|
339
|
-
duration,
|
|
340
|
-
onClose,
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
export function showWarningMessage({
|
|
345
|
-
duration = 3,
|
|
346
|
-
message: messageText,
|
|
347
|
-
onClose = () => {},
|
|
348
|
-
}) {
|
|
349
|
-
showMessage({
|
|
350
|
-
type: messageTypeCollection.warning,
|
|
351
|
-
message: messageText,
|
|
352
|
-
duration,
|
|
353
|
-
onClose,
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* 显示消息信息
|
|
359
|
-
*/
|
|
360
|
-
export function showInfoMessage({
|
|
361
|
-
duration = 3,
|
|
362
|
-
message: messageText,
|
|
363
|
-
onClose = () => {},
|
|
364
|
-
}) {
|
|
365
|
-
showMessage({
|
|
366
|
-
type: messageTypeCollection.info,
|
|
367
|
-
message: messageText,
|
|
368
|
-
duration,
|
|
369
|
-
onClose,
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
export function showLoadingMessage({
|
|
374
|
-
duration = 3,
|
|
375
|
-
message: messageText,
|
|
376
|
-
onClose = () => {},
|
|
377
|
-
}) {
|
|
378
|
-
showMessage({
|
|
379
|
-
type: messageTypeCollection.loading,
|
|
380
|
-
message: messageText,
|
|
381
|
-
duration,
|
|
382
|
-
onClose,
|
|
383
|
-
});
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
export function showOpenMessage({
|
|
387
|
-
duration = 3,
|
|
388
|
-
message: messageText,
|
|
389
|
-
onClose = () => {},
|
|
390
|
-
}) {
|
|
391
|
-
showMessage({
|
|
392
|
-
type: messageTypeCollection.open,
|
|
393
|
-
message: messageText,
|
|
394
|
-
duration,
|
|
395
|
-
onClose,
|
|
396
|
-
});
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
export function showMessage({
|
|
400
|
-
type,
|
|
401
|
-
duration = 3,
|
|
402
|
-
message: messageText,
|
|
403
|
-
onClose = () => {},
|
|
404
|
-
}) {
|
|
405
|
-
requestAnimationFrame(() => {
|
|
406
|
-
switch (type) {
|
|
407
|
-
case messageTypeCollection.success:
|
|
408
|
-
message.success(messageText, duration, onClose);
|
|
409
|
-
|
|
410
|
-
break;
|
|
411
|
-
|
|
412
|
-
case messageTypeCollection.error:
|
|
413
|
-
message.warn(messageText, duration, onClose);
|
|
414
|
-
|
|
415
|
-
break;
|
|
416
|
-
|
|
417
|
-
case messageTypeCollection.info:
|
|
418
|
-
message.info(messageText, duration, onClose);
|
|
419
|
-
|
|
420
|
-
break;
|
|
421
|
-
|
|
422
|
-
case messageTypeCollection.warning:
|
|
423
|
-
message.warning(messageText, duration, onClose);
|
|
424
|
-
|
|
425
|
-
break;
|
|
426
|
-
|
|
427
|
-
case messageTypeCollection.warn:
|
|
428
|
-
message.warn(messageText, duration, onClose);
|
|
429
|
-
|
|
430
|
-
break;
|
|
431
|
-
|
|
432
|
-
case messageTypeCollection.loading:
|
|
433
|
-
message.loading(messageText, duration, onClose);
|
|
434
|
-
|
|
435
|
-
break;
|
|
436
|
-
|
|
437
|
-
default:
|
|
438
|
-
message.open(messageText, duration, onClose);
|
|
439
|
-
|
|
440
|
-
break;
|
|
441
|
-
}
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* 记录日志
|
|
447
|
-
*
|
|
448
|
-
* @export
|
|
449
|
-
* @param {*} str
|
|
450
|
-
* @returns
|
|
451
|
-
*/
|
|
452
|
-
export function recordLog(record, showMode, level = logLevel.debug) {
|
|
453
|
-
let showModeModified =
|
|
454
|
-
(showMode || null) == null || stringIsNullOrWhiteSpace(showMode)
|
|
455
|
-
? logShowMode.unknown
|
|
456
|
-
: showMode;
|
|
457
|
-
|
|
458
|
-
if (
|
|
459
|
-
!inCollection(
|
|
460
|
-
[logShowMode.unknown, logShowMode.text, logShowMode.object],
|
|
461
|
-
showModeModified,
|
|
462
|
-
)
|
|
463
|
-
) {
|
|
464
|
-
throw new Error(`无效的日志显示模式:${showModeModified}`);
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
if (showModeModified === logShowMode.unknown) {
|
|
468
|
-
if (isString(record)) {
|
|
469
|
-
showModeModified = logShowMode.text;
|
|
470
|
-
} else {
|
|
471
|
-
showModeModified = logShowMode.object;
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
if (logShowInConsole() && level === logLevel.debug) {
|
|
476
|
-
if (showModeModified === logShowMode.text) {
|
|
477
|
-
const data = { level, record };
|
|
478
|
-
|
|
479
|
-
// eslint-disable-next-line no-console
|
|
480
|
-
console.log(JSON.stringify(data));
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
if (showModeModified === logShowMode.object) {
|
|
484
|
-
// eslint-disable-next-line no-console
|
|
485
|
-
console.log({ level, record });
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
if (level === logLevel.error) {
|
|
490
|
-
if (showModeModified === logShowMode.text) {
|
|
491
|
-
const data = { level, record };
|
|
492
|
-
|
|
493
|
-
// eslint-disable-next-line no-console
|
|
494
|
-
console.log(JSON.stringify(data));
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
if (showModeModified === logShowMode.object) {
|
|
498
|
-
// eslint-disable-next-line no-console
|
|
499
|
-
console.log({ level, record });
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* 记录错误信息
|
|
506
|
-
*/
|
|
507
|
-
export function recordError(record) {
|
|
508
|
-
if (isString(record)) {
|
|
509
|
-
recordText(record, logLevel.error);
|
|
510
|
-
} else {
|
|
511
|
-
recordObject(record, logLevel.error);
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* 记录日志
|
|
517
|
-
*
|
|
518
|
-
* @export
|
|
519
|
-
* @param {*} str
|
|
520
|
-
* @returns
|
|
521
|
-
*/
|
|
522
|
-
export function recordText(record, level = logLevel.debug) {
|
|
523
|
-
recordLog(record, logShowMode.text, level);
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
/**
|
|
527
|
-
* 记录日志
|
|
528
|
-
*
|
|
529
|
-
* @export
|
|
530
|
-
* @param {*} str
|
|
531
|
-
* @returns
|
|
532
|
-
*/
|
|
533
|
-
export function recordObject(record, level = logLevel.debug) {
|
|
534
|
-
recordLog(record, logShowMode.object, level);
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
function logShowInConsole() {
|
|
538
|
-
const appInit = getAppInitConfigData();
|
|
539
|
-
const result = !!(appInit.showLogInConsole || false);
|
|
540
|
-
|
|
541
|
-
return result;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* 获取Guid
|
|
546
|
-
*
|
|
547
|
-
* @export
|
|
548
|
-
* @param {*} v
|
|
549
|
-
* @returns
|
|
550
|
-
*/
|
|
551
|
-
export function getGuid() {
|
|
552
|
-
return uuidv4();
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
/**
|
|
556
|
-
* 检测目标是否在数组址之中
|
|
557
|
-
*/
|
|
558
|
-
export function inCollection(collection, value) {
|
|
559
|
-
let result = false;
|
|
560
|
-
|
|
561
|
-
if (!isArray(collection)) {
|
|
562
|
-
return result;
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
collection.some((o) => {
|
|
566
|
-
if (o === value) {
|
|
567
|
-
result = true;
|
|
568
|
-
|
|
569
|
-
return true;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
return false;
|
|
573
|
-
});
|
|
574
|
-
|
|
575
|
-
return result;
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
/**
|
|
579
|
-
* 格式化时间
|
|
580
|
-
*
|
|
581
|
-
* @export
|
|
582
|
-
* @param {*} v
|
|
583
|
-
* @returns
|
|
584
|
-
*/
|
|
585
|
-
export function isInvalid(v) {
|
|
586
|
-
return typeof v === 'undefined';
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
export function toDatetime(v) {
|
|
590
|
-
if ((v || null) == null) {
|
|
591
|
-
return null;
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
if (isDate(v)) {
|
|
595
|
-
return v;
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
if (isString(v)) {
|
|
599
|
-
const i = v.indexOf('T');
|
|
600
|
-
|
|
601
|
-
if (i < 0) {
|
|
602
|
-
// eslint-disable-next-line no-useless-escape
|
|
603
|
-
const value = v.replace(/\-/g, '/');
|
|
604
|
-
const result = new Date(value);
|
|
605
|
-
|
|
606
|
-
return result;
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
return new Date(v);
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
/**
|
|
614
|
-
* 格式化时间
|
|
615
|
-
*
|
|
616
|
-
* @export
|
|
617
|
-
* @param {*} v
|
|
618
|
-
* @returns
|
|
619
|
-
*/
|
|
620
|
-
export function formatDatetime(
|
|
621
|
-
v,
|
|
622
|
-
formatString = datetimeFormat.yearMonthDayHourMinuteSecond,
|
|
623
|
-
defaultValue = '',
|
|
624
|
-
) {
|
|
625
|
-
if ((v || '') === '') {
|
|
626
|
-
return defaultValue;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
const m = moment(typeof v === 'object' ? v : new Date(v.replace('/', '-')));
|
|
630
|
-
|
|
631
|
-
if (m.isSame(emptyDatetime)) {
|
|
632
|
-
return defaultValue;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
return m.format(formatString);
|
|
636
|
-
}
|
|
637
|
-
|
|
638
|
-
export function numeralFormat(v, formatString) {
|
|
639
|
-
return numeral(v).format(formatString);
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
/**
|
|
643
|
-
* 转化为Moment时间
|
|
644
|
-
*
|
|
645
|
-
* @export
|
|
646
|
-
* @param {*} v
|
|
647
|
-
* @returns
|
|
648
|
-
*/
|
|
649
|
-
export function stringToMoment(v) {
|
|
650
|
-
if (moment.isMoment(v)) return v;
|
|
651
|
-
|
|
652
|
-
const d = (v || '').toString();
|
|
653
|
-
|
|
654
|
-
if (stringIsNullOrWhiteSpace(d)) {
|
|
655
|
-
return null;
|
|
656
|
-
}
|
|
657
|
-
|
|
658
|
-
return moment(new Date(d.replace('/', '-')));
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
/**
|
|
662
|
-
* 当前Moment时间
|
|
663
|
-
*
|
|
664
|
-
* @export
|
|
665
|
-
* @param {*} v
|
|
666
|
-
* @returns
|
|
667
|
-
*/
|
|
668
|
-
export function getMomentNow() {
|
|
669
|
-
return moment();
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* 转化为Moment时间
|
|
674
|
-
*
|
|
675
|
-
* @export
|
|
676
|
-
* @param {*} v
|
|
677
|
-
* @returns
|
|
678
|
-
*/
|
|
679
|
-
export function dateToMoment(v) {
|
|
680
|
-
const m = moment(v);
|
|
681
|
-
|
|
682
|
-
if (m.isSame(emptyDatetime)) {
|
|
683
|
-
return null;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
return m;
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
/**
|
|
690
|
-
* 判断是否是时间字符串
|
|
691
|
-
*
|
|
692
|
-
* @export
|
|
693
|
-
* @param {*} v
|
|
694
|
-
* @returns
|
|
695
|
-
*/
|
|
696
|
-
export function isDatetime(v) {
|
|
697
|
-
const date = `${typeof v === 'undefined' ? null : v}`;
|
|
698
|
-
const result = date.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
|
|
699
|
-
|
|
700
|
-
if (result == null) {
|
|
701
|
-
return false;
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
const d = new Date(result[1], result[3] - 1, result[4]);
|
|
705
|
-
return (
|
|
706
|
-
d.getFullYear() === parseInt(result[1], 10) &&
|
|
707
|
-
d.getMonth() + 1 === parseInt(result[3], 10) &&
|
|
708
|
-
d.getDate() === parseInt(result[4], 10)
|
|
709
|
-
);
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
/**
|
|
713
|
-
* 判断是否是数字字符串
|
|
714
|
-
*
|
|
715
|
-
* @export
|
|
716
|
-
* @param {*} str
|
|
717
|
-
* @returns
|
|
718
|
-
*/
|
|
719
|
-
export function isNumber(v) {
|
|
720
|
-
const str = `${typeof v === 'undefined' ? null : v}`;
|
|
721
|
-
|
|
722
|
-
if (str === '') {
|
|
723
|
-
return false;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
const regular = /^[0-9]*$/;
|
|
727
|
-
const re = new RegExp(regular);
|
|
728
|
-
return re.test(str);
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
/**
|
|
732
|
-
* 转换为数字
|
|
733
|
-
*
|
|
734
|
-
* @export
|
|
735
|
-
* @param {*} str
|
|
736
|
-
* @returns
|
|
737
|
-
*/
|
|
738
|
-
export function toNumber(v) {
|
|
739
|
-
const value = toNumberLodash(v);
|
|
740
|
-
|
|
741
|
-
return Number.isNaN(value) ? 0 : value;
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
/**
|
|
745
|
-
* 转换为数字
|
|
746
|
-
*
|
|
747
|
-
* @export
|
|
748
|
-
* @param {*} str
|
|
749
|
-
* @returns
|
|
750
|
-
*/
|
|
751
|
-
export function split(source, separator, limit = 1000) {
|
|
752
|
-
return splitLodash(source, separator, limit);
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
/**
|
|
756
|
-
* 转换为文本
|
|
757
|
-
*
|
|
758
|
-
* @export
|
|
759
|
-
* @param {*} str
|
|
760
|
-
* @returns
|
|
761
|
-
*/
|
|
762
|
-
export function toString(value) {
|
|
763
|
-
return toStringLodash(value);
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
*
|
|
768
|
-
*@param val 值 len保留小数位数
|
|
769
|
-
*
|
|
770
|
-
*/
|
|
771
|
-
export function roundToTarget(v, len) {
|
|
772
|
-
const temp = 10 ** len;
|
|
773
|
-
|
|
774
|
-
return Math.round(v * temp) / temp;
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
/**
|
|
778
|
-
* 判断是否是数字字符串
|
|
779
|
-
*
|
|
780
|
-
* @export
|
|
781
|
-
* @param {*} str
|
|
782
|
-
* @returns
|
|
783
|
-
*/
|
|
784
|
-
export function isMoney(v) {
|
|
785
|
-
const str = `${typeof v === 'undefined' ? null : v}`;
|
|
786
|
-
|
|
787
|
-
if (str === '') {
|
|
788
|
-
return false;
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
const regular = /^([1-9][\d]{0,15}|0)(\.[\d]{1,2})?$/;
|
|
792
|
-
const re = new RegExp(regular);
|
|
793
|
-
return re.test(str);
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
/**
|
|
797
|
-
* 转换为数字
|
|
798
|
-
*
|
|
799
|
-
* @export
|
|
800
|
-
* @param {*} str
|
|
801
|
-
* @returns
|
|
802
|
-
*/
|
|
803
|
-
export function toMoney(v) {
|
|
804
|
-
if (isMoney(v)) {
|
|
805
|
-
return parseFloat(v, 10);
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
return 0;
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
/**
|
|
812
|
-
* 通过 key 获取对应得值
|
|
813
|
-
*/
|
|
814
|
-
export function getValueByKey({
|
|
815
|
-
data,
|
|
816
|
-
key,
|
|
817
|
-
defaultValue = null,
|
|
818
|
-
convert = null,
|
|
819
|
-
convertBuilder = null,
|
|
820
|
-
format = null,
|
|
821
|
-
formatBuilder = null,
|
|
822
|
-
}) {
|
|
823
|
-
const v = getPathValue(data, key, defaultValue);
|
|
824
|
-
|
|
825
|
-
let result = v;
|
|
826
|
-
|
|
827
|
-
if (isFunction(convertBuilder)) {
|
|
828
|
-
result = convertBuilder(v);
|
|
829
|
-
} else if ((convert || null) != null) {
|
|
830
|
-
switch (convert) {
|
|
831
|
-
case convertCollection.number:
|
|
832
|
-
result = toNumber(v);
|
|
833
|
-
break;
|
|
834
|
-
|
|
835
|
-
case convertCollection.datetime:
|
|
836
|
-
result = toDatetime(v);
|
|
837
|
-
break;
|
|
838
|
-
|
|
839
|
-
case convertCollection.string:
|
|
840
|
-
result = toString(v);
|
|
841
|
-
break;
|
|
842
|
-
|
|
843
|
-
case convertCollection.moment:
|
|
844
|
-
result = stringToMoment(toString(v));
|
|
845
|
-
break;
|
|
846
|
-
|
|
847
|
-
case convertCollection.money:
|
|
848
|
-
result = toMoney(v);
|
|
849
|
-
break;
|
|
850
|
-
|
|
851
|
-
default:
|
|
852
|
-
result = v;
|
|
853
|
-
break;
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
if (isFunction(formatBuilder)) {
|
|
858
|
-
result = formatBuilder(v);
|
|
859
|
-
} else if ((format || null) != null) {
|
|
860
|
-
switch (format) {
|
|
861
|
-
case formatCollection.money:
|
|
862
|
-
result = formatMoney(v);
|
|
863
|
-
break;
|
|
864
|
-
|
|
865
|
-
case formatCollection.datetime:
|
|
866
|
-
result = formatDatetime(v);
|
|
867
|
-
break;
|
|
868
|
-
|
|
869
|
-
case formatCollection.chineseMoney:
|
|
870
|
-
result = formatMoneyToChinese(v);
|
|
871
|
-
break;
|
|
872
|
-
|
|
873
|
-
default:
|
|
874
|
-
result = v;
|
|
875
|
-
break;
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
return result;
|
|
880
|
-
}
|
|
881
|
-
|
|
882
|
-
/**
|
|
883
|
-
* 通过 path 获取对应得值
|
|
884
|
-
*/
|
|
885
|
-
export function getPathValue(o, path, defaultValue = null) {
|
|
886
|
-
if (isUndefined(o)) {
|
|
887
|
-
return null || defaultValue;
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
if (o == null) {
|
|
891
|
-
return null || defaultValue;
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
if (!isString(path)) {
|
|
895
|
-
const text = 'getPathValue Function param path must be string';
|
|
896
|
-
|
|
897
|
-
showRuntimeError({
|
|
898
|
-
message: text,
|
|
899
|
-
});
|
|
900
|
-
|
|
901
|
-
return null;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
const v = getLodash(o, path, defaultValue);
|
|
905
|
-
|
|
906
|
-
if (isUndefined(defaultValue) || isNull(defaultValue)) {
|
|
907
|
-
return v;
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
return v || defaultValue;
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
/**
|
|
914
|
-
* 格式化货币
|
|
915
|
-
*
|
|
916
|
-
* @export
|
|
917
|
-
* @param {*} str
|
|
918
|
-
* @returns
|
|
919
|
-
*/
|
|
920
|
-
export function formatDecimal(
|
|
921
|
-
numberSource,
|
|
922
|
-
placesSource = 2,
|
|
923
|
-
thousandSource = ',',
|
|
924
|
-
decimalSource = '.',
|
|
925
|
-
) {
|
|
926
|
-
return formatMoney(
|
|
927
|
-
numberSource,
|
|
928
|
-
placesSource,
|
|
929
|
-
'',
|
|
930
|
-
thousandSource,
|
|
931
|
-
decimalSource,
|
|
932
|
-
);
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
/**
|
|
936
|
-
* 格式化货币
|
|
937
|
-
*
|
|
938
|
-
* @export
|
|
939
|
-
* @param {*} str
|
|
940
|
-
* @returns
|
|
941
|
-
*/
|
|
942
|
-
export function formatMoney(
|
|
943
|
-
numberSource,
|
|
944
|
-
symbolSource = '¥',
|
|
945
|
-
format = '0,0.00',
|
|
946
|
-
) {
|
|
947
|
-
return `${symbolSource}${numeral(numberSource).format(format)}`;
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
export function toPercentage(val, format = '0,0.00') {
|
|
951
|
-
numeral(val);
|
|
952
|
-
return `${numeral(toNumber(val * 1000) / 10).format(format)}%`;
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
/**
|
|
956
|
-
* 转换金额为人民币大写
|
|
957
|
-
*
|
|
958
|
-
* @export
|
|
959
|
-
* @param {*} v
|
|
960
|
-
* @returns
|
|
961
|
-
*/
|
|
962
|
-
export function formatMoneyToChinese(v) {
|
|
963
|
-
let money = v;
|
|
964
|
-
|
|
965
|
-
const cnNumber = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']; // 汉字的数字
|
|
966
|
-
const cnIntBasic = ['', '拾', '佰', '仟']; // 基本单位
|
|
967
|
-
const cnIntUnits = ['', '万', '亿', '兆']; // 对应整数部分扩展单位
|
|
968
|
-
const cnDecUnits = ['角', '分', '毫', '厘']; // 对应小数部分单位
|
|
969
|
-
// var cnInteger = "整"; // 整数金额时后面跟的字符
|
|
970
|
-
const cnIntLast = '元'; // 整型完以后的单位
|
|
971
|
-
const maxNum = 999999999999999.9999; // 最大处理的数字
|
|
972
|
-
|
|
973
|
-
let IntegerNum; // 金额整数部分
|
|
974
|
-
let DecimalNum; // 金额小数部分
|
|
975
|
-
let ChineseString = ''; // 输出的中文金额字符串
|
|
976
|
-
let parts; // 分离金额后用的数组,预定义
|
|
977
|
-
if (money === '') {
|
|
978
|
-
return '';
|
|
979
|
-
}
|
|
980
|
-
money = parseFloat(money);
|
|
981
|
-
if (money >= maxNum) {
|
|
982
|
-
return '超出最大处理数字';
|
|
983
|
-
}
|
|
984
|
-
if (money === 0) {
|
|
985
|
-
ChineseString = cnNumber[0] + cnIntLast;
|
|
986
|
-
|
|
987
|
-
return ChineseString;
|
|
988
|
-
}
|
|
989
|
-
money = money.toString(); // 转换为字符串
|
|
990
|
-
if (money.indexOf('.') === -1) {
|
|
991
|
-
IntegerNum = money;
|
|
992
|
-
DecimalNum = '';
|
|
993
|
-
} else {
|
|
994
|
-
parts = money.split('.');
|
|
995
|
-
|
|
996
|
-
[IntegerNum, DecimalNum] = parts;
|
|
997
|
-
DecimalNum = parts[1].substr(0, 4);
|
|
998
|
-
}
|
|
999
|
-
if (parseInt(IntegerNum, 10) > 0) {
|
|
1000
|
-
// 获取整型部分转换
|
|
1001
|
-
let zeroCount = 0;
|
|
1002
|
-
const IntLen = IntegerNum.length;
|
|
1003
|
-
for (let i = 0; i < IntLen; i += 1) {
|
|
1004
|
-
const n = IntegerNum.substr(i, 1);
|
|
1005
|
-
const p = IntLen - i - 1;
|
|
1006
|
-
const q = p / 4;
|
|
1007
|
-
const m = p % 4;
|
|
1008
|
-
if (n === '0') {
|
|
1009
|
-
zeroCount += 1;
|
|
1010
|
-
} else {
|
|
1011
|
-
if (zeroCount > 0) {
|
|
1012
|
-
ChineseString += cnNumber[0];
|
|
1013
|
-
}
|
|
1014
|
-
zeroCount = 0; // 归零
|
|
1015
|
-
ChineseString += cnNumber[parseInt(n, 10)] + cnIntBasic[m];
|
|
1016
|
-
}
|
|
1017
|
-
if (m === 0 && zeroCount < 4) {
|
|
1018
|
-
ChineseString += cnIntUnits[q];
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
ChineseString += cnIntLast;
|
|
1022
|
-
// 整型部分处理完毕
|
|
1023
|
-
}
|
|
1024
|
-
if (DecimalNum !== '') {
|
|
1025
|
-
// 小数部分
|
|
1026
|
-
const decLen = DecimalNum.length;
|
|
1027
|
-
for (let i = 0; i < decLen; i += 1) {
|
|
1028
|
-
const n = DecimalNum.substr(i, 1);
|
|
1029
|
-
if (n !== '0') {
|
|
1030
|
-
ChineseString += cnNumber[Number(n)] + cnDecUnits[i];
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
if (ChineseString === '') {
|
|
1035
|
-
ChineseString += cnNumber[0] + cnIntLast;
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
return ChineseString;
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
function seededRandom(seed, min, max) {
|
|
1042
|
-
const maxValue = max || 1;
|
|
1043
|
-
const minValue = min || 0;
|
|
1044
|
-
const seedValue = (seed * 9301 + 49297) % 233280;
|
|
1045
|
-
const rnd = seedValue / 233280.0;
|
|
1046
|
-
return minValue + rnd * (maxValue - minValue);
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
/**
|
|
1050
|
-
* 通过种子返回随机颜色值
|
|
1051
|
-
*
|
|
1052
|
-
* @export
|
|
1053
|
-
* @param {*} seed
|
|
1054
|
-
* @returns
|
|
1055
|
-
*/
|
|
1056
|
-
export function getRandomColor(seed) {
|
|
1057
|
-
// eslint-disable-next-line
|
|
1058
|
-
return `#${`00000${((seededRandom(seed) * 0x1000000) << 0).toString(
|
|
1059
|
-
16,
|
|
1060
|
-
)}`.substr(-6)}`;
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
function getBrowserInfoCore() {
|
|
1064
|
-
const getBrowserVersion = () => {
|
|
1065
|
-
const u = navigator.userAgent;
|
|
1066
|
-
return {
|
|
1067
|
-
// 移动终端浏览器版本信息
|
|
1068
|
-
trident: u.indexOf('Trident') > -1, // IE内核
|
|
1069
|
-
presto: u.indexOf('Presto') > -1, // opera内核
|
|
1070
|
-
webKit: u.indexOf('AppleWebKit') > -1, // 苹果、谷歌内核
|
|
1071
|
-
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') === -1, // 火狐内核
|
|
1072
|
-
mobile: !!u.match(/AppleWebKit.*Mobile.*/), // 是否为移动终端
|
|
1073
|
-
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), // ios终端
|
|
1074
|
-
android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, // android 终端或uc浏览器
|
|
1075
|
-
iPhone: u.indexOf('iPhone') > -1, // 是否为 iPhone 或者 QQHD 浏览器
|
|
1076
|
-
iPad: u.indexOf('iPad') > -1, // 是否iPad
|
|
1077
|
-
webApp: u.indexOf('Safari') === -1, // 是否web应该程序,没有头部与底部
|
|
1078
|
-
};
|
|
1079
|
-
};
|
|
1080
|
-
|
|
1081
|
-
return {
|
|
1082
|
-
versions: getBrowserVersion(),
|
|
1083
|
-
language: (navigator.browserLanguage || navigator.language).toLowerCase(),
|
|
1084
|
-
};
|
|
1085
|
-
}
|
|
1086
|
-
|
|
1087
|
-
/**
|
|
1088
|
-
* 获取浏览器信息
|
|
1089
|
-
*
|
|
1090
|
-
* @export
|
|
1091
|
-
* @returns
|
|
1092
|
-
*/
|
|
1093
|
-
export function getBrowserInfo() {
|
|
1094
|
-
return getBrowserInfoCore();
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
/**
|
|
1098
|
-
* 封装表单项配置
|
|
1099
|
-
*
|
|
1100
|
-
* @export
|
|
1101
|
-
* @param {*} v
|
|
1102
|
-
* @param {*} justice
|
|
1103
|
-
* @param {*} defaultValue
|
|
1104
|
-
* @param {*} originalOption
|
|
1105
|
-
* @param {*} convertCallback
|
|
1106
|
-
*/
|
|
1107
|
-
export function refitFieldDecoratorOption(
|
|
1108
|
-
v,
|
|
1109
|
-
justice,
|
|
1110
|
-
defaultValue,
|
|
1111
|
-
originalOption,
|
|
1112
|
-
convertCallback,
|
|
1113
|
-
) {
|
|
1114
|
-
const result = originalOption;
|
|
1115
|
-
const justiceV = typeof justice !== 'undefined' && justice !== null;
|
|
1116
|
-
const defaultV = typeof defaultValue === 'undefined' ? null : defaultValue;
|
|
1117
|
-
|
|
1118
|
-
if (justiceV) {
|
|
1119
|
-
if (typeof convertValue === 'function') {
|
|
1120
|
-
result.initialValue = convertCallback(v) || defaultV;
|
|
1121
|
-
} else {
|
|
1122
|
-
result.initialValue = v || defaultV;
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
return result;
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
/**
|
|
1130
|
-
* 封装公共数据
|
|
1131
|
-
*
|
|
1132
|
-
* @export 数据集合
|
|
1133
|
-
* @param {*} listData 源数据集合
|
|
1134
|
-
* @param {*} empty 要添加的首个数据
|
|
1135
|
-
* @param {*} otherListData 要添加的其他数据集合
|
|
1136
|
-
* @returns 封装后的数据集合
|
|
1137
|
-
*/
|
|
1138
|
-
export function refitCommonData(listData, empty, otherListData) {
|
|
1139
|
-
let result = [];
|
|
1140
|
-
|
|
1141
|
-
if (typeof listData !== 'undefined') {
|
|
1142
|
-
if (listData !== null) {
|
|
1143
|
-
result = [...listData];
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
if (typeof otherListData !== 'undefined') {
|
|
1148
|
-
if (otherListData !== null) {
|
|
1149
|
-
result = [...result, ...otherListData];
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
|
|
1153
|
-
if (typeof empty !== 'undefined') {
|
|
1154
|
-
if (empty !== null) {
|
|
1155
|
-
result = [empty, ...result];
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
|
-
return result;
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
/**
|
|
1163
|
-
* 计算表达式的值
|
|
1164
|
-
*
|
|
1165
|
-
* @export
|
|
1166
|
-
* @param {*} fn
|
|
1167
|
-
* @returns
|
|
1168
|
-
*/
|
|
1169
|
-
export function evil(fn) {
|
|
1170
|
-
// 一个变量指向Function,防止有些前端编译工具报错
|
|
1171
|
-
const Fn = Function;
|
|
1172
|
-
return new Fn(`return ${fn}`)();
|
|
1173
|
-
}
|
|
1174
|
-
|
|
1175
|
-
/**
|
|
1176
|
-
* 搜索集合中的匹配项
|
|
1177
|
-
*
|
|
1178
|
-
* @export
|
|
1179
|
-
* @param {*} itemKey
|
|
1180
|
-
* @param {*} itemValue
|
|
1181
|
-
* @param {*} sourceData
|
|
1182
|
-
* @returns
|
|
1183
|
-
*/
|
|
1184
|
-
export function searchFromList(itemKey, itemValue, sourceData) {
|
|
1185
|
-
const d = sourceData || [];
|
|
1186
|
-
let result = null;
|
|
1187
|
-
|
|
1188
|
-
if (itemValue == null) {
|
|
1189
|
-
return result;
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
d.forEach((o) => {
|
|
1193
|
-
if (o[itemKey] === itemValue) {
|
|
1194
|
-
result = o;
|
|
1195
|
-
}
|
|
1196
|
-
});
|
|
1197
|
-
|
|
1198
|
-
return result;
|
|
1199
|
-
}
|
|
1200
|
-
|
|
1201
|
-
/**
|
|
1202
|
-
* 构建描述文本
|
|
1203
|
-
* @param {*} v
|
|
1204
|
-
* @param {*} op
|
|
1205
|
-
* @param {*} other
|
|
1206
|
-
*/
|
|
1207
|
-
export function buildFieldDescription(v, op, other) {
|
|
1208
|
-
const o = (other || '') === '' ? '' : `,${other}`;
|
|
1209
|
-
return `请${op || '输入'}${v}${o}`;
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
/**
|
|
1213
|
-
* 获取SessionStorage数据
|
|
1214
|
-
* @export
|
|
1215
|
-
* @param {*} key
|
|
1216
|
-
* @param {*} value
|
|
1217
|
-
*/
|
|
1218
|
-
export function getStringFromSessionStorage(key) {
|
|
1219
|
-
const storage = window.sessionStorage;
|
|
1220
|
-
const value = storage.getItem(key);
|
|
1221
|
-
|
|
1222
|
-
if (process.env.NODE_ENV === 'development') {
|
|
1223
|
-
return value;
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
const decode = decodeBase64(value);
|
|
1227
|
-
const v = encodeBase64(decode);
|
|
1228
|
-
|
|
1229
|
-
if (value !== v) {
|
|
1230
|
-
return null;
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
return decode;
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
|
-
/**
|
|
1237
|
-
* 获取LocalStorage数据
|
|
1238
|
-
* @export
|
|
1239
|
-
* @param {*} key
|
|
1240
|
-
* @param {*} value
|
|
1241
|
-
*/
|
|
1242
|
-
export function getStringFromLocalStorage(key) {
|
|
1243
|
-
const storage = window.localStorage;
|
|
1244
|
-
const value = storage.getItem(key);
|
|
1245
|
-
|
|
1246
|
-
if (process.env.NODE_ENV === 'development') {
|
|
1247
|
-
return value;
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
const decode = decodeBase64(value);
|
|
1251
|
-
const v = encodeBase64(decode);
|
|
1252
|
-
|
|
1253
|
-
if (value !== v) {
|
|
1254
|
-
return null;
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
|
-
return decode;
|
|
1258
|
-
}
|
|
1259
|
-
|
|
1260
|
-
/**
|
|
1261
|
-
* 获取SessionStorage数据
|
|
1262
|
-
* @export
|
|
1263
|
-
* @param {*} key
|
|
1264
|
-
* @param {*} value
|
|
1265
|
-
*/
|
|
1266
|
-
export function getJsonFromSessionStorage(key) {
|
|
1267
|
-
const jsonString = getStringFromSessionStorage(key);
|
|
1268
|
-
|
|
1269
|
-
if (jsonString) {
|
|
1270
|
-
return JSON.parse(jsonString || '{}');
|
|
1271
|
-
}
|
|
1272
|
-
|
|
1273
|
-
return null;
|
|
1274
|
-
}
|
|
1275
|
-
|
|
1276
|
-
/**
|
|
1277
|
-
* 获取LocalStorage数据
|
|
1278
|
-
* @export
|
|
1279
|
-
* @param {*} key
|
|
1280
|
-
* @param {*} value
|
|
1281
|
-
*/
|
|
1282
|
-
export function getJsonFromLocalStorage(key) {
|
|
1283
|
-
const jsonString = getStringFromLocalStorage(key);
|
|
1284
|
-
|
|
1285
|
-
if (jsonString) {
|
|
1286
|
-
return JSON.parse(jsonString || '{}');
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
return null;
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
/**
|
|
1293
|
-
* 存储SessionStorage数据
|
|
1294
|
-
* @export
|
|
1295
|
-
* @param {*} key
|
|
1296
|
-
* @param {*} value
|
|
1297
|
-
*/
|
|
1298
|
-
export function saveStringToSessionStorage(key, value) {
|
|
1299
|
-
const storage = window.sessionStorage;
|
|
1300
|
-
|
|
1301
|
-
if (process.env.NODE_ENV === 'development') {
|
|
1302
|
-
storage.setItem(key, value);
|
|
1303
|
-
} else {
|
|
1304
|
-
storage.setItem(key, encodeBase64(value));
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
/**
|
|
1309
|
-
* 存储本地数据
|
|
1310
|
-
* @export
|
|
1311
|
-
* @param {*} key
|
|
1312
|
-
* @param {*} value
|
|
1313
|
-
*/
|
|
1314
|
-
export function saveStringToLocalStorage(key, value) {
|
|
1315
|
-
const storage = window.localStorage;
|
|
1316
|
-
|
|
1317
|
-
if (process.env.NODE_ENV === 'development') {
|
|
1318
|
-
storage.setItem(key, value);
|
|
1319
|
-
} else {
|
|
1320
|
-
storage.setItem(key, encodeBase64(value));
|
|
1321
|
-
}
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
/**
|
|
1325
|
-
* 存储SessionStorage数据
|
|
1326
|
-
* @export
|
|
1327
|
-
* @param {*} key
|
|
1328
|
-
* @param {*} value
|
|
1329
|
-
*/
|
|
1330
|
-
export function saveJsonToSessionStorage(key, json) {
|
|
1331
|
-
saveStringToSessionStorage(key, JSON.stringify(json || {}));
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
/**
|
|
1335
|
-
* 存储本地数据
|
|
1336
|
-
* @export
|
|
1337
|
-
* @param {*} key
|
|
1338
|
-
* @param {*} value
|
|
1339
|
-
*/
|
|
1340
|
-
export function saveJsonToLocalStorage(key, json) {
|
|
1341
|
-
saveStringToLocalStorage(key, JSON.stringify(json || {}));
|
|
1342
|
-
}
|
|
1343
|
-
|
|
1344
|
-
/**
|
|
1345
|
-
* 移除SessionStorage数据
|
|
1346
|
-
* @export
|
|
1347
|
-
* @param {*} key
|
|
1348
|
-
*/
|
|
1349
|
-
export function removeSessionStorage(key) {
|
|
1350
|
-
const storage = window.sessionStorage;
|
|
1351
|
-
storage.removeItem(key);
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
/**
|
|
1355
|
-
* 移除LocalStorage数据
|
|
1356
|
-
* @export
|
|
1357
|
-
* @param {*} key
|
|
1358
|
-
*/
|
|
1359
|
-
export function removeLocalStorage(key) {
|
|
1360
|
-
const storage = window.localStorage;
|
|
1361
|
-
storage.removeItem(key);
|
|
1362
|
-
}
|
|
1363
|
-
|
|
1364
|
-
/**
|
|
1365
|
-
* 清空SessionStorage数据
|
|
1366
|
-
* @export
|
|
1367
|
-
* @param {*} key
|
|
1368
|
-
*/
|
|
1369
|
-
export function clearSessionStorage() {
|
|
1370
|
-
const storage = window.sessionStorage;
|
|
1371
|
-
storage.clear();
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
/**
|
|
1375
|
-
* 清空LocalStorage数据
|
|
1376
|
-
* @export
|
|
1377
|
-
* @param {*} key
|
|
1378
|
-
*/
|
|
1379
|
-
export function clearLocalStorage() {
|
|
1380
|
-
const storage = window.localStorage;
|
|
1381
|
-
storage.clear();
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
/**
|
|
1385
|
-
* 获取工作队列
|
|
1386
|
-
* @export
|
|
1387
|
-
*/
|
|
1388
|
-
export function getQueue() {
|
|
1389
|
-
if (typeof window.queue === 'undefined') {
|
|
1390
|
-
window.queueCustom = queue({ concurrency: 3 });
|
|
1391
|
-
window.queueCustom.start();
|
|
1392
|
-
}
|
|
1393
|
-
|
|
1394
|
-
return window.queueCustom;
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
/**
|
|
1398
|
-
* Reacts生命周期getDerivedStateFromProps 辅助函数用于将url参数解析到返回值中用于设定state,
|
|
1399
|
-
* @export
|
|
1400
|
-
*/
|
|
1401
|
-
export function getDerivedStateFromPropsForUrlParamsCore(nextProps) {
|
|
1402
|
-
const { match } = nextProps;
|
|
1403
|
-
|
|
1404
|
-
if ((match || null) != null) {
|
|
1405
|
-
const { params } = match;
|
|
1406
|
-
|
|
1407
|
-
if ((params || null) != null) {
|
|
1408
|
-
return { urlParams: params };
|
|
1409
|
-
}
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
return null;
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
/**
|
|
1416
|
-
* Reacts生命周期getDerivedStateFromProps 辅助函数用于将url参数解析到返回值中用于设定state,如果值重复,则返回null,
|
|
1417
|
-
* @export
|
|
1418
|
-
*/
|
|
1419
|
-
export function getDerivedStateFromPropsForUrlParams(
|
|
1420
|
-
nextProps,
|
|
1421
|
-
prevState,
|
|
1422
|
-
defaultUrlParams = { id: '' },
|
|
1423
|
-
parseUrlParamsForSetState = null,
|
|
1424
|
-
) {
|
|
1425
|
-
let stateUrlParams = getDerivedStateFromPropsForUrlParamsCore(
|
|
1426
|
-
nextProps,
|
|
1427
|
-
prevState,
|
|
1428
|
-
);
|
|
1429
|
-
|
|
1430
|
-
stateUrlParams = stateUrlParams || { urlParams: defaultUrlParams };
|
|
1431
|
-
|
|
1432
|
-
const { urlParams: urlParamsPrev } = prevState;
|
|
1433
|
-
|
|
1434
|
-
const { urlParams } = stateUrlParams;
|
|
1435
|
-
|
|
1436
|
-
if (
|
|
1437
|
-
isEqualBySerialize(
|
|
1438
|
-
{ ...(urlParamsPrev || {}), ...{} },
|
|
1439
|
-
{ ...(urlParams || {}), ...{} },
|
|
1440
|
-
)
|
|
1441
|
-
) {
|
|
1442
|
-
return prevState;
|
|
1443
|
-
}
|
|
1444
|
-
|
|
1445
|
-
if (isFunction(parseUrlParamsForSetState)) {
|
|
1446
|
-
const data = parseUrlParamsForSetState(stateUrlParams);
|
|
1447
|
-
|
|
1448
|
-
return { ...prevState, ...stateUrlParams, ...data };
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
|
-
return { ...prevState, ...stateUrlParams };
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
export function arrayMove(array, from, to) {
|
|
1455
|
-
return arrayMoveImmutable(array, from, to);
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
|
-
export function arrayMoveMutate(array, from, to) {
|
|
1459
|
-
return arrayMoveMutable(array, from, to);
|
|
1460
|
-
}
|
|
1461
|
-
|
|
1462
|
-
/**
|
|
1463
|
-
* 获取本地数据
|
|
1464
|
-
* @export
|
|
1465
|
-
* @param {value} 对比源
|
|
1466
|
-
* @param {other} 对比对象
|
|
1467
|
-
* 执行深比较来确定两者的值是否相等。
|
|
1468
|
-
* 这个方法支持比较 arrays, array buffers, booleans, date objects, error objects, maps, numbers, Object objects, regexes, sets, strings, symbols, 以及 typed arrays. Object 对象值比较自身的属性,不包括继承的和可枚举的属性。 不支持函数和DOM节点比较。
|
|
1469
|
-
*/
|
|
1470
|
-
export function isEqual(value, other) {
|
|
1471
|
-
return isEqualLodash(value, other);
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
|
-
export function isEqualBySerialize(value, other) {
|
|
1475
|
-
const d1 = JSON.stringify(value || {});
|
|
1476
|
-
const d2 = JSON.stringify(other || {});
|
|
1477
|
-
|
|
1478
|
-
return d1 === d2;
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
|
-
export function cloneWithoutMethod(value) {
|
|
1482
|
-
if (value == null) {
|
|
1483
|
-
return null;
|
|
1484
|
-
}
|
|
1485
|
-
|
|
1486
|
-
return JSON.parse(JSON.stringify(value));
|
|
1487
|
-
}
|
|
1488
|
-
|
|
1489
|
-
export function isFunction(value) {
|
|
1490
|
-
return isFunctionLodash(value);
|
|
1491
|
-
}
|
|
1492
|
-
|
|
1493
|
-
export function isArray(value) {
|
|
1494
|
-
return isArrayLodash(value);
|
|
1495
|
-
}
|
|
1496
|
-
|
|
1497
|
-
export function isObject(o) {
|
|
1498
|
-
return isObjectLodash(o);
|
|
1499
|
-
}
|
|
1500
|
-
|
|
1501
|
-
export function difference(array, values) {
|
|
1502
|
-
return differenceLodash(array, values);
|
|
1503
|
-
}
|
|
1504
|
-
|
|
1505
|
-
/**
|
|
1506
|
-
* 筛选需要的集合
|
|
1507
|
-
* @param {collection} 可筛选的对象,例如数组
|
|
1508
|
-
* @param {predicateFunction} 每次迭代调用的筛选函数
|
|
1509
|
-
*/
|
|
1510
|
-
export function filter(collection, predicateFunction) {
|
|
1511
|
-
return filterLodash(collection, predicateFunction);
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
/**
|
|
1515
|
-
* 创建一个元素数组。 以 iteratee 处理的结果升序排序。 这个方法执行稳定排序,也就是说相同元素会保持原始排序。 iteratees 调用1个参数: (value)。
|
|
1516
|
-
* @param {collection} (Array|Object), 用来迭代的集合。
|
|
1517
|
-
* @param {predicateFunction} 这个函数决定排序
|
|
1518
|
-
*/
|
|
1519
|
-
export function sortBy(collection, predicateFunction) {
|
|
1520
|
-
return sortByLodash(collection, predicateFunction);
|
|
1521
|
-
}
|
|
1522
|
-
|
|
1523
|
-
/**
|
|
1524
|
-
* 该方法返回第一个通过 predicateFunction 判断为真值的元素的索引值(index),而不是元素本身。
|
|
1525
|
-
* @param {array} (Array): 要搜索的数组。
|
|
1526
|
-
* @param {predicateFunction} 这个函数会在每一次迭代调用
|
|
1527
|
-
* @param {fromIndex} (number): The index to search from.
|
|
1528
|
-
*/
|
|
1529
|
-
export function findIndex(array, predicateFunction, fromIndex = 0) {
|
|
1530
|
-
return findIndexLodash(array, predicateFunction, fromIndex);
|
|
1531
|
-
}
|
|
1532
|
-
|
|
1533
|
-
/**
|
|
1534
|
-
* 该方法返回第一个通过 predicateFunction 判断为真值的元素的索引值(index),而不是元素本身,返回匹配元素,否则返回 undefined。。
|
|
1535
|
-
* @param {array} (Array): 要搜索的数组。
|
|
1536
|
-
* @param {predicateFunction} 这个函数会在每一次迭代调用
|
|
1537
|
-
* @param {fromIndex} (number): The index to search from.
|
|
1538
|
-
*/
|
|
1539
|
-
export function find(array, predicateFunction, fromIndex = 0) {
|
|
1540
|
-
return findLodash(array, predicateFunction, fromIndex);
|
|
1541
|
-
}
|
|
1542
|
-
|
|
1543
|
-
export function checkExist(array, predicateFunction, fromIndex = 0) {
|
|
1544
|
-
const result = find(array, predicateFunction, fromIndex);
|
|
1545
|
-
|
|
1546
|
-
return !isUndefined(result);
|
|
1547
|
-
}
|
|
1548
|
-
|
|
1549
|
-
export function reverse(array) {
|
|
1550
|
-
return reverseLodash(array);
|
|
1551
|
-
}
|
|
1552
|
-
|
|
1553
|
-
export function trim(source) {
|
|
1554
|
-
return trimLodash(source);
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
|
-
export function replace(source, pattern, replacement) {
|
|
1558
|
-
return replaceLodash(source, pattern, replacement);
|
|
1559
|
-
}
|
|
1560
|
-
|
|
1561
|
-
export function isBoolean(value) {
|
|
1562
|
-
return isBooleanLodash(value);
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
/**
|
|
1566
|
-
* check value is undefined
|
|
1567
|
-
*/
|
|
1568
|
-
export function isUndefined(value) {
|
|
1569
|
-
return isUndefinedLodash(value);
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
/**
|
|
1573
|
-
* check value is null
|
|
1574
|
-
*/
|
|
1575
|
-
export function isNull(value) {
|
|
1576
|
-
return isNullLodash(value);
|
|
1577
|
-
}
|
|
1578
|
-
|
|
1579
|
-
/**
|
|
1580
|
-
* check value is date
|
|
1581
|
-
*/
|
|
1582
|
-
export function isDate(value) {
|
|
1583
|
-
return isDateLodash(value);
|
|
1584
|
-
}
|
|
1585
|
-
|
|
1586
|
-
/**
|
|
1587
|
-
* check value is string
|
|
1588
|
-
*/
|
|
1589
|
-
export function isString(value) {
|
|
1590
|
-
return isStringLodash(value);
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
/**
|
|
1594
|
-
* 移除数组中predicate(断言)返回为真值的所有元素,并返回移除元素组成的数组。predicate(断言) 会传入3个参数: (value, index, array)。
|
|
1595
|
-
* @param {*} array
|
|
1596
|
-
* @param {*} predicate (Array|Function|Object|string): 每次迭代调用的函数
|
|
1597
|
-
*/
|
|
1598
|
-
export function removeFromArray(array, predicate) {
|
|
1599
|
-
return removeLodash(array, predicate);
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
|
-
export function stringIsNullOrWhiteSpace(value) {
|
|
1603
|
-
return trim(replace(value || '', ' ', '')) === '';
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
/**
|
|
1607
|
-
* base64解码
|
|
1608
|
-
*/
|
|
1609
|
-
export function decodeBase64(target) {
|
|
1610
|
-
let commonContent = (target || '').replace(/\s/g, '+');
|
|
1611
|
-
commonContent = Buffer.from(commonContent, 'base64').toString();
|
|
1612
|
-
return commonContent;
|
|
1613
|
-
}
|
|
1614
|
-
|
|
1615
|
-
/**
|
|
1616
|
-
* base64编码
|
|
1617
|
-
*/
|
|
1618
|
-
export function encodeBase64(target) {
|
|
1619
|
-
const base64Content = Buffer.from(target).toString('base64');
|
|
1620
|
-
return base64Content;
|
|
1621
|
-
}
|
|
1622
|
-
|
|
1623
|
-
export function fixedZero(val) {
|
|
1624
|
-
return val * 1 < 10 ? `0${val}` : val;
|
|
1625
|
-
}
|
|
1626
|
-
|
|
1627
|
-
/**
|
|
1628
|
-
* getTimeDistance
|
|
1629
|
-
*/
|
|
1630
|
-
export function getTimeDistance(type) {
|
|
1631
|
-
const now = new Date();
|
|
1632
|
-
const oneDay = 1000 * 60 * 60 * 24;
|
|
1633
|
-
|
|
1634
|
-
if (type === 'today') {
|
|
1635
|
-
now.setHours(0);
|
|
1636
|
-
now.setMinutes(0);
|
|
1637
|
-
now.setSeconds(0);
|
|
1638
|
-
return [moment(now), moment(now.getTime() + (oneDay - 1000))];
|
|
1639
|
-
}
|
|
1640
|
-
|
|
1641
|
-
if (type === 'week') {
|
|
1642
|
-
let day = now.getDay();
|
|
1643
|
-
now.setHours(0);
|
|
1644
|
-
now.setMinutes(0);
|
|
1645
|
-
now.setSeconds(0);
|
|
1646
|
-
|
|
1647
|
-
if (day === 0) {
|
|
1648
|
-
day = 6;
|
|
1649
|
-
} else {
|
|
1650
|
-
day -= 1;
|
|
1651
|
-
}
|
|
1652
|
-
|
|
1653
|
-
const beginTime = now.getTime() - day * oneDay;
|
|
1654
|
-
|
|
1655
|
-
return [moment(beginTime), moment(beginTime + (7 * oneDay - 1000))];
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
if (type === 'month') {
|
|
1659
|
-
const year = now.getFullYear();
|
|
1660
|
-
const month = now.getMonth();
|
|
1661
|
-
const nextDate = moment(now).add(1, 'months');
|
|
1662
|
-
const nextYear = nextDate.year();
|
|
1663
|
-
const nextMonth = nextDate.month();
|
|
1664
|
-
|
|
1665
|
-
return [
|
|
1666
|
-
moment(`${year}-${fixedZero(month + 1)}-01 00:00:00`),
|
|
1667
|
-
moment(
|
|
1668
|
-
moment(
|
|
1669
|
-
`${nextYear}-${fixedZero(nextMonth + 1)}-01 00:00:00`,
|
|
1670
|
-
).valueOf() - 1000,
|
|
1671
|
-
),
|
|
1672
|
-
];
|
|
1673
|
-
}
|
|
1674
|
-
|
|
1675
|
-
const year = now.getFullYear();
|
|
1676
|
-
return [moment(`${year}-01-01 00:00:00`), moment(`${year}-12-31 23:59:59`)];
|
|
1677
|
-
}
|
|
1678
|
-
|
|
1679
|
-
/**
|
|
1680
|
-
* 构建描述文本
|
|
1681
|
-
* @param {*} v
|
|
1682
|
-
* @param {*} op
|
|
1683
|
-
* @param {*} other
|
|
1684
|
-
*/
|
|
1685
|
-
export function buildFieldHelper(v, prefix = '注:') {
|
|
1686
|
-
return `${prefix}${v}。`;
|
|
1687
|
-
}
|
|
1688
|
-
|
|
1689
|
-
export function checkLocalhost() {
|
|
1690
|
-
const hostname = toLower(window.location.hostname);
|
|
1691
|
-
|
|
1692
|
-
return hostname === '127.0.0.1' || hostname === 'localhost';
|
|
1693
|
-
}
|
|
1694
|
-
|
|
1695
|
-
export function getNearestLocalhostNotifyCache() {
|
|
1696
|
-
const key = storageKeyCollection.nearestLocalhostNotify;
|
|
1697
|
-
|
|
1698
|
-
const d = getJsonFromLocalStorage(key);
|
|
1699
|
-
|
|
1700
|
-
if ((d || null) == null) {
|
|
1701
|
-
return null;
|
|
1702
|
-
}
|
|
1703
|
-
|
|
1704
|
-
if ((d.nearestTime || null) == null) {
|
|
1705
|
-
return null;
|
|
1706
|
-
}
|
|
1707
|
-
|
|
1708
|
-
return d || null;
|
|
1709
|
-
}
|
|
1710
|
-
|
|
1711
|
-
export function setNearestLocalhostNotifyCache() {
|
|
1712
|
-
const key = storageKeyCollection.nearestLocalhostNotify;
|
|
1713
|
-
|
|
1714
|
-
const now = parseInt(new Date().getTime() / 1000, 10);
|
|
1715
|
-
|
|
1716
|
-
const d = {
|
|
1717
|
-
nearestTime: now,
|
|
1718
|
-
};
|
|
1719
|
-
|
|
1720
|
-
return saveJsonToLocalStorage(key, d);
|
|
1721
|
-
}
|
|
1722
|
-
|
|
1723
|
-
export function removeNearestLocalhostNotifyCache() {
|
|
1724
|
-
const key = storageKeyCollection.nearestLocalhostNotify;
|
|
1725
|
-
removeLocalStorage(key);
|
|
1726
|
-
}
|
|
1727
|
-
|
|
1728
|
-
/**
|
|
1729
|
-
* 尝试发送最近一次本地调用通知(一般用于开发阶段,提示调用的接口域)
|
|
1730
|
-
*/
|
|
1731
|
-
export function trySendNearestLocalhostNotify({ text }) {
|
|
1732
|
-
let needSend = false;
|
|
1733
|
-
let nearestTime = 0;
|
|
1734
|
-
|
|
1735
|
-
if (checkLocalhost()) {
|
|
1736
|
-
const nearestLocalhostNotify = getNearestLocalhostNotifyCache() || null;
|
|
1737
|
-
|
|
1738
|
-
if (nearestLocalhostNotify == null) {
|
|
1739
|
-
needSend = true;
|
|
1740
|
-
} else {
|
|
1741
|
-
nearestTime = nearestLocalhostNotify.nearestTime || 0;
|
|
1742
|
-
}
|
|
1743
|
-
|
|
1744
|
-
const now = parseInt(new Date().getTime() / 1000, 10);
|
|
1745
|
-
|
|
1746
|
-
try {
|
|
1747
|
-
if (nearestTime + 30 < now) {
|
|
1748
|
-
needSend = true;
|
|
1749
|
-
}
|
|
1750
|
-
|
|
1751
|
-
if (needSend) {
|
|
1752
|
-
notification.open({
|
|
1753
|
-
placement: 'bottomLeft',
|
|
1754
|
-
message: '开发提示',
|
|
1755
|
-
description: `当前接口域名:${text}。`,
|
|
1756
|
-
});
|
|
1757
|
-
|
|
1758
|
-
setNearestLocalhostNotifyCache();
|
|
1759
|
-
}
|
|
1760
|
-
} catch (error) {
|
|
1761
|
-
recordLog(error);
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
}
|
|
1765
|
-
|
|
1766
|
-
/**
|
|
1767
|
-
* 文本缩略
|
|
1768
|
-
*/
|
|
1769
|
-
export function ellipsis(value, length) {
|
|
1770
|
-
if (value && value.length > length) {
|
|
1771
|
-
return `${toString(value).substr(0, length)}...`;
|
|
1772
|
-
}
|
|
1773
|
-
return toString(value);
|
|
1774
|
-
}
|
|
1775
|
-
|
|
1776
|
-
export function notifySuccess(text) {
|
|
1777
|
-
const description = text || '数据已经操作成功,请进行后续操作。';
|
|
1778
|
-
|
|
1779
|
-
notify({
|
|
1780
|
-
type: notificationTypeCollection.success,
|
|
1781
|
-
placement: 'bottomRight',
|
|
1782
|
-
message: '操作结果',
|
|
1783
|
-
description,
|
|
1784
|
-
});
|
|
1785
|
-
}
|
|
1786
|
-
|
|
1787
|
-
/**
|
|
1788
|
-
* 发送页面通知
|
|
1789
|
-
*/
|
|
1790
|
-
export function notify({
|
|
1791
|
-
type,
|
|
1792
|
-
placement: placementValue,
|
|
1793
|
-
message: messageValue,
|
|
1794
|
-
description: descriptionValue,
|
|
1795
|
-
}) {
|
|
1796
|
-
const {
|
|
1797
|
-
placement,
|
|
1798
|
-
message: messageText,
|
|
1799
|
-
description,
|
|
1800
|
-
} = {
|
|
1801
|
-
...{
|
|
1802
|
-
placement: 'bottomRight',
|
|
1803
|
-
message: '操作结果',
|
|
1804
|
-
description: '操作结果描述',
|
|
1805
|
-
},
|
|
1806
|
-
...{
|
|
1807
|
-
placement: placementValue,
|
|
1808
|
-
message: messageValue,
|
|
1809
|
-
description: descriptionValue,
|
|
1810
|
-
},
|
|
1811
|
-
};
|
|
1812
|
-
|
|
1813
|
-
requestAnimationFrame(() => {
|
|
1814
|
-
switch (type) {
|
|
1815
|
-
case notificationTypeCollection.success:
|
|
1816
|
-
notification.success({
|
|
1817
|
-
placement,
|
|
1818
|
-
message: messageText,
|
|
1819
|
-
description,
|
|
1820
|
-
});
|
|
1821
|
-
|
|
1822
|
-
break;
|
|
1823
|
-
|
|
1824
|
-
case notificationTypeCollection.warning:
|
|
1825
|
-
notification.warning({
|
|
1826
|
-
placement,
|
|
1827
|
-
message: messageText,
|
|
1828
|
-
description,
|
|
1829
|
-
});
|
|
1830
|
-
|
|
1831
|
-
break;
|
|
1832
|
-
|
|
1833
|
-
case notificationTypeCollection.error:
|
|
1834
|
-
notification.error({
|
|
1835
|
-
placement,
|
|
1836
|
-
message: messageText,
|
|
1837
|
-
description,
|
|
1838
|
-
});
|
|
1839
|
-
|
|
1840
|
-
break;
|
|
1841
|
-
|
|
1842
|
-
case notificationTypeCollection.info:
|
|
1843
|
-
notification.info({
|
|
1844
|
-
placement,
|
|
1845
|
-
message: messageText,
|
|
1846
|
-
description,
|
|
1847
|
-
});
|
|
1848
|
-
|
|
1849
|
-
break;
|
|
1850
|
-
|
|
1851
|
-
case notificationTypeCollection.warn:
|
|
1852
|
-
notification.warn({
|
|
1853
|
-
placement,
|
|
1854
|
-
message: messageText,
|
|
1855
|
-
description,
|
|
1856
|
-
});
|
|
1857
|
-
|
|
1858
|
-
break;
|
|
1859
|
-
|
|
1860
|
-
default:
|
|
1861
|
-
notification.open({
|
|
1862
|
-
placement,
|
|
1863
|
-
message: messageText,
|
|
1864
|
-
description,
|
|
1865
|
-
});
|
|
1866
|
-
|
|
1867
|
-
break;
|
|
1868
|
-
}
|
|
1869
|
-
});
|
|
1870
|
-
}
|
|
1871
|
-
|
|
1872
|
-
export function checkFromConfig({ label, name, helper }) {
|
|
1873
|
-
let labelText = 'object';
|
|
1874
|
-
let nameText = 'object';
|
|
1875
|
-
let helperText = 'object';
|
|
1876
|
-
|
|
1877
|
-
if (isObject(label)) {
|
|
1878
|
-
const text = 'label必须为文本';
|
|
1879
|
-
|
|
1880
|
-
showRuntimeError({
|
|
1881
|
-
message: text,
|
|
1882
|
-
});
|
|
1883
|
-
|
|
1884
|
-
recordObject(label);
|
|
1885
|
-
} else {
|
|
1886
|
-
labelText = label;
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
if (isObject(name)) {
|
|
1890
|
-
const text = 'name必须为文本';
|
|
1891
|
-
|
|
1892
|
-
showRuntimeError({
|
|
1893
|
-
message: text,
|
|
1894
|
-
});
|
|
1895
|
-
|
|
1896
|
-
recordObject(name);
|
|
1897
|
-
} else {
|
|
1898
|
-
nameText = name;
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
|
-
if (isObject(helper)) {
|
|
1902
|
-
const text = 'helper必须为文本';
|
|
1903
|
-
|
|
1904
|
-
showRuntimeError({
|
|
1905
|
-
message: text,
|
|
1906
|
-
});
|
|
1907
|
-
|
|
1908
|
-
recordObject(helper);
|
|
1909
|
-
} else {
|
|
1910
|
-
helperText = helper;
|
|
1911
|
-
}
|
|
1912
|
-
|
|
1913
|
-
return {
|
|
1914
|
-
label: labelText,
|
|
1915
|
-
name: nameText,
|
|
1916
|
-
helper: helperText,
|
|
1917
|
-
};
|
|
1918
|
-
}
|
|
1919
|
-
|
|
1920
|
-
const requestAnimFrameCustom = (() => {
|
|
1921
|
-
if (isBrowser()) {
|
|
1922
|
-
return (
|
|
1923
|
-
window.requestAnimationFrame ||
|
|
1924
|
-
window.webkitRequestAnimationFrame ||
|
|
1925
|
-
window.mozRequestAnimationFrame ||
|
|
1926
|
-
window.oRequestAnimationFrame ||
|
|
1927
|
-
window.msRequestAnimationFrame ||
|
|
1928
|
-
((a) => {
|
|
1929
|
-
window.setTimeout(a, 1e3 / 60);
|
|
1930
|
-
})
|
|
1931
|
-
);
|
|
1932
|
-
}
|
|
1933
|
-
|
|
1934
|
-
return () => {};
|
|
1935
|
-
})();
|
|
1936
|
-
|
|
1937
|
-
export const requestAnimFrame = requestAnimFrameCustom;
|
|
1938
|
-
|
|
1939
|
-
/**
|
|
1940
|
-
* 占位函数
|
|
1941
|
-
*
|
|
1942
|
-
* @export
|
|
1943
|
-
* @returns
|
|
1944
|
-
*/
|
|
1945
|
-
export function emptyExport() {
|
|
1946
|
-
return {};
|
|
1947
|
-
}
|