vap1 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/basetype.d.ts +62 -0
- package/basetype.js +2 -0
- package/components/Box/Box.d.ts +118 -0
- package/components/Box/Box.js +150 -0
- package/components/Box/SelectBar.d.ts +90 -0
- package/components/Box/SelectBar.js +93 -0
- package/components/Box/_register.d.ts +49 -0
- package/components/Box/_register.js +29 -0
- package/components/Box/index.d.ts +9 -0
- package/components/Box/index.js +6 -0
- package/components/Lists/SList.d.ts +58 -0
- package/components/Lists/SList.js +167 -0
- package/components/SearchBar/ActionButtons.d.ts +49 -0
- package/components/SearchBar/ActionButtons.js +96 -0
- package/components/SearchBar/ByField.d.ts +3 -0
- package/components/SearchBar/ByField.js +193 -0
- package/components/SearchBar/ByKeyword.d.ts +3 -0
- package/components/SearchBar/ByKeyword.js +34 -0
- package/components/SearchBar/SearchField.d.ts +15 -0
- package/components/SearchBar/SearchField.js +25 -0
- package/components/SearchBar/SearchTags.d.ts +2 -0
- package/components/SearchBar/SearchTags.js +18 -0
- package/components/SearchBar/_FieldType.d.ts +8 -0
- package/components/SearchBar/_FieldType.js +45 -0
- package/components/SearchBar/_register.d.ts +65 -0
- package/components/SearchBar/_register.js +29 -0
- package/components/SearchBar/index.d.ts +134 -0
- package/components/SearchBar/index.js +33 -0
- package/components/Tables/ApiTable.d.ts +18 -0
- package/components/Tables/ApiTable.js +48 -0
- package/components/Tables/ApiTableModal.d.ts +22 -0
- package/components/Tables/ApiTableModal.js +73 -0
- package/components/Tables/Components/ActionBar.d.ts +56 -0
- package/components/Tables/Components/ActionBar.js +100 -0
- package/components/Tables/Components/Actions.d.ts +47 -0
- package/components/Tables/Components/Actions.js +91 -0
- package/components/Tables/Components/Summary.d.ts +11 -0
- package/components/Tables/Components/Summary.js +11 -0
- package/components/Tables/Components/index.d.ts +17 -0
- package/components/Tables/Components/index.js +19 -0
- package/components/Tables/STable.d.ts +5 -0
- package/components/Tables/STable.js +37 -0
- package/components/Tables/TopTable.d.ts +24 -0
- package/components/Tables/TopTable.js +157 -0
- package/components/Tables/TopTableModal.d.ts +5 -0
- package/components/Tables/TopTableModal.js +20 -0
- package/components/Tables/Util.d.ts +3 -0
- package/components/Tables/Util.js +41 -0
- package/components/Tables/VTable.d.ts +11 -0
- package/components/Tables/VTable.js +237 -0
- package/components/Tables/index.d.ts +81 -0
- package/components/Tables/index.js +20 -0
- package/components/TreeSelect/BaseTreeSelect.d.ts +33 -0
- package/components/TreeSelect/BaseTreeSelect.js +190 -0
- package/components/TreeSelect/DTreeSelect.d.ts +24 -0
- package/components/TreeSelect/DTreeSelect.js +66 -0
- package/components/TreeSelect/FTreeSelect.d.ts +11 -0
- package/components/TreeSelect/FTreeSelect.js +39 -0
- package/components/TreeSelect/STreeSelect.d.ts +14 -0
- package/components/TreeSelect/STreeSelect.js +52 -0
- package/components/TreeSelect/index.d.ts +94 -0
- package/components/TreeSelect/index.js +9 -0
- package/components/Trees/ActionTree.d.ts +54 -0
- package/components/Trees/ActionTree.js +657 -0
- package/components/Trees/BaseTree.d.ts +31 -0
- package/components/Trees/BaseTree.js +185 -0
- package/components/Trees/DTree.d.ts +48 -0
- package/components/Trees/DTree.js +142 -0
- package/components/Trees/FTree.d.ts +33 -0
- package/components/Trees/FTree.js +79 -0
- package/components/Trees/STree.d.ts +21 -0
- package/components/Trees/STree.js +92 -0
- package/components/Trees/index.d.ts +134 -0
- package/components/Trees/index.js +9 -0
- package/components/UForm/FormWrapper.d.ts +22 -0
- package/components/UForm/FormWrapper.js +270 -0
- package/components/UForm/UDescriptions.d.ts +5 -0
- package/components/UForm/UDescriptions.js +134 -0
- package/components/UForm/UForm.d.ts +33 -0
- package/components/UForm/UForm.js +484 -0
- package/components/UForm/UFormModal.d.ts +3 -0
- package/components/UForm/UFormModal.js +149 -0
- package/components/UForm/UInfo.d.ts +10 -0
- package/components/UForm/UInfo.js +75 -0
- package/components/UForm/UInfoModal.d.ts +3 -0
- package/components/UForm/UInfoModal.js +50 -0
- package/components/UForm/UModal.d.ts +3 -0
- package/components/UForm/UModal.js +24 -0
- package/components/UForm/_FieldType.d.ts +8 -0
- package/components/UForm/_FieldType.js +100 -0
- package/components/UForm/_FormUtils.d.ts +5 -0
- package/components/UForm/_FormUtils.js +75 -0
- package/components/UForm/_input.d.ts +59 -0
- package/components/UForm/_input.js +147 -0
- package/components/UForm/_register.d.ts +87 -0
- package/components/UForm/_register.js +44 -0
- package/components/UForm/index.d.ts +387 -0
- package/components/UForm/index.js +15 -0
- package/components/Upload/UploadFile.d.ts +3 -0
- package/components/Upload/UploadFile.js +40 -0
- package/components/Upload/UploadImage.d.ts +24 -0
- package/components/Upload/UploadImage.js +93 -0
- package/components/Upload/UploadModal.d.ts +50 -0
- package/components/Upload/UploadModal.js +140 -0
- package/components/Upload/index.d.ts +77 -0
- package/components/Upload/index.js +9 -0
- package/components/Upload/useUpload.d.ts +15 -0
- package/components/Upload/useUpload.js +93 -0
- package/components/_RegisterUtil.d.ts +1 -0
- package/components/_RegisterUtil.js +25 -0
- package/components/_adapt/Alert.d.ts +11 -0
- package/components/_adapt/Alert.js +43 -0
- package/components/_adapt/Button.d.ts +20 -0
- package/components/_adapt/Button.js +26 -0
- package/components/_adapt/Col.d.ts +53 -0
- package/components/_adapt/Col.js +90 -0
- package/components/_adapt/Collapse.d.ts +30 -0
- package/components/_adapt/Collapse.js +33 -0
- package/components/_adapt/Drawer.d.ts +12 -0
- package/components/_adapt/Drawer.js +11 -0
- package/components/_adapt/Dropdown.d.ts +15 -0
- package/components/_adapt/Dropdown.js +38 -0
- package/components/_adapt/Icon.d.ts +14 -0
- package/components/_adapt/Icon.js +34 -0
- package/components/_adapt/Image.d.ts +4 -0
- package/components/_adapt/Image.js +11 -0
- package/components/_adapt/Menu.d.ts +32 -0
- package/components/_adapt/Menu.js +25 -0
- package/components/_adapt/Modal.d.ts +23 -0
- package/components/_adapt/Modal.js +69 -0
- package/components/_adapt/Popconfirm.d.ts +5 -0
- package/components/_adapt/Popconfirm.js +34 -0
- package/components/_adapt/Popover.d.ts +5 -0
- package/components/_adapt/Popover.js +34 -0
- package/components/_adapt/Progress.d.ts +14 -0
- package/components/_adapt/Progress.js +56 -0
- package/components/_adapt/Row.d.ts +10 -0
- package/components/_adapt/Row.js +23 -0
- package/components/_adapt/Select.d.ts +14 -0
- package/components/_adapt/Select.js +47 -0
- package/components/_adapt/Tag.d.ts +7 -0
- package/components/_adapt/Tag.js +12 -0
- package/components/_adapt/Tooltip.d.ts +5 -0
- package/components/_adapt/Tooltip.js +11 -0
- package/components/_adapt/todo/ColorPicker.d.ts +3 -0
- package/components/_adapt/todo/ColorPicker.js +42 -0
- package/components/_adapt/todo/FloatButton.d.ts +2 -0
- package/components/_adapt/todo/FloatButton.js +6 -0
- package/components/_adapt/todo/Image.d.ts +2 -0
- package/components/_adapt/todo/Image.js +6 -0
- package/components/_adapt/todo/Segmented.d.ts +2 -0
- package/components/_adapt/todo/Segmented.js +6 -0
- package/components/_adapt/todo/Space.d.ts +2 -0
- package/components/_adapt/todo/Space.js +6 -0
- package/components/_adapt/utils.d.ts +12 -0
- package/components/_adapt/utils.js +93 -0
- package/components/_common/AutoComplete.d.ts +32 -0
- package/components/_common/AutoComplete.js +87 -0
- package/components/_common/CountUp.d.ts +38 -0
- package/components/_common/CountUp.js +60 -0
- package/components/_common/DateRange.d.ts +52 -0
- package/components/_common/DateRange.js +108 -0
- package/components/_common/HighLight.d.ts +15 -0
- package/components/_common/HighLight.js +37 -0
- package/components/_common/I18N.d.ts +7 -0
- package/components/_common/I18N.js +6 -0
- package/components/_common/Loading.d.ts +9 -0
- package/components/_common/Loading.js +52 -0
- package/components/_common/MonthRange.d.ts +46 -0
- package/components/_common/MonthRange.js +130 -0
- package/components/_common/PromiseLabel.d.ts +11 -0
- package/components/_common/PromiseLabel.js +34 -0
- package/components/_common/Role.d.ts +5 -0
- package/components/_common/Role.js +11 -0
- package/components/_common/Upagination.d.ts +21 -0
- package/components/_common/Upagination.js +106 -0
- package/components/_setup/Const.d.ts +205 -0
- package/components/_setup/Const.js +112 -0
- package/components/_setup/I18N/enUS.d.ts +1 -0
- package/components/_setup/I18N/enUS.js +106 -0
- package/components/_setup/I18N/index.d.ts +3 -0
- package/components/_setup/I18N/index.js +5 -0
- package/components/_setup/I18N/zhCN.d.ts +3 -0
- package/components/_setup/I18N/zhCN.js +109 -0
- package/components/_setup/I18N/zhHK.d.ts +1 -0
- package/components/_setup/I18N/zhHK.js +107 -0
- package/components/_setup/ICON/IconTypes.d.ts +1 -0
- package/components/_setup/ICON/IconTypes.js +10 -0
- package/components/_setup/SearchField/SearchFieldAdvance.d.ts +1 -0
- package/components/_setup/SearchField/SearchFieldAdvance.js +57 -0
- package/components/_setup/SearchField/SearchFieldDate.d.ts +1 -0
- package/components/_setup/SearchField/SearchFieldDate.js +186 -0
- package/components/_setup/SearchField/SearchFieldInput.d.ts +3 -0
- package/components/_setup/SearchField/SearchFieldInput.js +20 -0
- package/components/_setup/SearchField/SearchFieldSelect.d.ts +1 -0
- package/components/_setup/SearchField/SearchFieldSelect.js +106 -0
- package/components/_setup/SearchField/SearchFieldTree.d.ts +1 -0
- package/components/_setup/SearchField/SearchFieldTree.js +191 -0
- package/components/_setup/SelectBar/SelectList.d.ts +1 -0
- package/components/_setup/SelectBar/SelectList.js +21 -0
- package/components/_setup/SelectBar/SelectTree.d.ts +1 -0
- package/components/_setup/SelectBar/SelectTree.js +11 -0
- package/components/_setup/UForm/UFormAdvanceInput.d.ts +1 -0
- package/components/_setup/UForm/UFormAdvanceInput.js +300 -0
- package/components/_setup/UForm/UFormAdvanceSelect.d.ts +0 -0
- package/components/_setup/UForm/UFormAdvanceSelect.js +26 -0
- package/components/_setup/UForm/UFormCrontab.d.ts +1 -0
- package/components/_setup/UForm/UFormCrontab.js +199 -0
- package/components/_setup/UForm/UFormDate.d.ts +1 -0
- package/components/_setup/UForm/UFormDate.js +313 -0
- package/components/_setup/UForm/UFormInput.d.ts +1 -0
- package/components/_setup/UForm/UFormInput.js +159 -0
- package/components/_setup/UForm/UFormJSON.d.ts +1 -0
- package/components/_setup/UForm/UFormJSON.js +219 -0
- package/components/_setup/UForm/UFormOrg.d.ts +1 -0
- package/components/_setup/UForm/UFormOrg.js +121 -0
- package/components/_setup/UForm/UFormRole.d.ts +1 -0
- package/components/_setup/UForm/UFormRole.js +47 -0
- package/components/_setup/UForm/UFormSearch.d.ts +0 -0
- package/components/_setup/UForm/UFormSearch.js +35 -0
- package/components/_setup/UForm/UFormSelect.d.ts +1 -0
- package/components/_setup/UForm/UFormSelect.js +179 -0
- package/components/_setup/UForm/UFormTree.d.ts +0 -0
- package/components/_setup/UForm/UFormTree.js +134 -0
- package/components/_setup/UForm/UFormUpload.d.ts +1 -0
- package/components/_setup/UForm/UFormUpload.js +173 -0
- package/components/_setup/UForm/_utils.d.ts +11 -0
- package/components/_setup/UForm/_utils.js +41 -0
- package/components/_setup/index.d.ts +21 -0
- package/components/_setup/index.js +25 -0
- package/components/index.d.ts +7 -0
- package/components/index.js +16 -0
- package/deps/JsonView.d.ts +6 -0
- package/deps/JsonView.js +57 -0
- package/deps/SpringBoot.d.ts +4 -0
- package/deps/SpringBoot.js +18 -0
- package/deps/SpringCloud.d.ts +14 -0
- package/deps/SpringCloud.js +29 -0
- package/deps/_editor/advance/_Audio.d.ts +0 -0
- package/deps/_editor/advance/_Audio.js +1 -0
- package/deps/_editor/advance/_Image.d.ts +2 -0
- package/deps/_editor/advance/_Image.js +89 -0
- package/deps/_editor/advance/_Table.d.ts +0 -0
- package/deps/_editor/advance/_Table.js +1 -0
- package/deps/_editor/advance/_Video.d.ts +0 -0
- package/deps/_editor/advance/_Video.js +1 -0
- package/deps/_editor/base/Element.d.ts +5 -0
- package/deps/_editor/base/Element.js +43 -0
- package/deps/_editor/base/Leaf.d.ts +3 -0
- package/deps/_editor/base/Leaf.js +36 -0
- package/deps/_editor/base/Support.d.ts +2 -0
- package/deps/_editor/base/Support.js +78 -0
- package/deps/_editor/base/types.d.ts +156 -0
- package/deps/_editor/base/types.js +10 -0
- package/deps/_editor/i18n.d.ts +1 -0
- package/deps/_editor/i18n.js +31 -0
- package/deps/_editor/tools/Button.d.ts +6 -0
- package/deps/_editor/tools/Button.js +86 -0
- package/deps/_editor/tools/ToolBar.d.ts +8 -0
- package/deps/_editor/tools/ToolBar.js +10 -0
- package/deps/_editor/tools/_BlockButton.d.ts +4 -0
- package/deps/_editor/tools/_BlockButton.js +77 -0
- package/deps/_editor/tools/_InsertButton.d.ts +6 -0
- package/deps/_editor/tools/_InsertButton.js +65 -0
- package/deps/_editor/tools/_MarkButton.d.ts +6 -0
- package/deps/_editor/tools/_MarkButton.js +45 -0
- package/deps/_editor/tools/_TxtButton.d.ts +7 -0
- package/deps/_editor/tools/_TxtButton.js +187 -0
- package/deps/_editor/utils/ParseHtml.d.ts +0 -0
- package/deps/_editor/utils/ParseHtml.js +220 -0
- package/deps/api-audit.d.ts +1 -0
- package/deps/api-audit.js +6 -0
- package/deps/api-data.d.ts +0 -0
- package/deps/api-data.js +1 -0
- package/deps/apis/useSource.d.ts +0 -0
- package/deps/apis/useSource.js +152 -0
- package/deps/echarts.d.ts +26 -0
- package/deps/echarts.js +71 -0
- package/deps/editor.d.ts +34 -0
- package/deps/editor.js +111 -0
- package/deps/registerEditor.d.ts +1 -0
- package/deps/registerEditor.js +15 -0
- package/hooks/_list.d.ts +87 -0
- package/hooks/_list.js +13 -0
- package/hooks/index.d.ts +14 -0
- package/hooks/index.js +49 -0
- package/hooks/useAjax.d.ts +14 -0
- package/hooks/useAjax.js +43 -0
- package/hooks/useAjaxAction.d.ts +13 -0
- package/hooks/useAjaxAction.js +42 -0
- package/hooks/useAjaxQuery.d.ts +40 -0
- package/hooks/useAjaxQuery.js +81 -0
- package/hooks/useApi.d.ts +69 -0
- package/hooks/useApi.js +352 -0
- package/hooks/useApiGlobal.d.ts +0 -0
- package/hooks/useApiGlobal.js +5 -0
- package/hooks/useApp.d.ts +243 -0
- package/hooks/useApp.js +17 -0
- package/hooks/useArray.d.ts +21 -0
- package/hooks/useArray.js +182 -0
- package/hooks/useCounter.d.ts +0 -0
- package/hooks/useCounter.js +82 -0
- package/hooks/useDefault.d.ts +6 -0
- package/hooks/useDefault.js +16 -0
- package/hooks/useDoLoad.d.ts +17 -0
- package/hooks/useDoLoad.js +44 -0
- package/hooks/useEffectFunction.d.ts +8 -0
- package/hooks/useEffectFunction.js +16 -0
- package/hooks/useEffectOnce.d.ts +5 -0
- package/hooks/useEffectOnce.js +23 -0
- package/hooks/useError.d.ts +5 -0
- package/hooks/useError.js +21 -0
- package/hooks/useFirstMountState.d.ts +6 -0
- package/hooks/useFirstMountState.js +18 -0
- package/hooks/useGenkey.d.ts +2 -0
- package/hooks/useGenkey.js +16 -0
- package/hooks/useGetSet.d.ts +11 -0
- package/hooks/useGetSet.js +27 -0
- package/hooks/useGlobal.d.ts +19 -0
- package/hooks/useGlobal.js +62 -0
- package/hooks/useGlobal_back.d.ts +1 -0
- package/hooks/useGlobal_back.js +11 -0
- package/hooks/useHover.d.ts +8 -0
- package/hooks/useHover.js +49 -0
- package/hooks/useMemoPromise.d.ts +6 -0
- package/hooks/useMemoPromise.js +42 -0
- package/hooks/useModals.d.ts +40 -0
- package/hooks/useModals.js +98 -0
- package/hooks/useMountedState.d.ts +5 -0
- package/hooks/useMountedState.js +20 -0
- package/hooks/useOpenState.d.ts +28 -0
- package/hooks/useOpenState.js +23 -0
- package/hooks/usePromise.d.ts +7 -0
- package/hooks/usePromise.js +22 -0
- package/hooks/useQueue.d.ts +12 -0
- package/hooks/useQueue.js +34 -0
- package/hooks/useSetState.d.ts +9 -0
- package/hooks/useSetState.js +26 -0
- package/hooks/useStateList.d.ts +13 -0
- package/hooks/useStateList.js +59 -0
- package/hooks/useToggle.d.ts +6 -0
- package/hooks/useToggle.js +12 -0
- package/hooks/useUnmountPromise.d.ts +6 -0
- package/hooks/useUnmountPromise.js +36 -0
- package/hooks/useUpdate.d.ts +7 -0
- package/hooks/useUpdate.js +15 -0
- package/hooks/useUpdateEffect.d.ts +6 -0
- package/hooks/useUpdateEffect.js +18 -0
- package/index.d.ts +139 -0
- package/index.js +161 -0
- package/login/Base65.d.ts +8 -0
- package/login/Base65.js +65 -0
- package/login/Password.d.ts +61 -0
- package/login/Password.js +124 -0
- package/login/SM4.d.ts +20 -0
- package/login/SM4.js +193 -0
- package/login/cems/index.d.ts +10 -0
- package/login/cems/index.js +17 -0
- package/login/jit/index.d.ts +32 -0
- package/login/jit/index.js +180 -0
- package/login/jit/pnxclient.d.ts +54 -0
- package/login/jit/pnxclient.js +575 -0
- package/login/sso/index.d.ts +0 -0
- package/login/sso/index.js +0 -0
- package/login/vap/index.d.ts +1 -0
- package/login/vap/index.js +6 -0
- package/login/xrtx/index.d.ts +2 -0
- package/login/xrtx/index.js +33 -0
- package/package.json +1 -0
- package/screen/Comment.d.ts +31 -0
- package/screen/Comment.js +29 -0
- package/screen/EchartContent.d.ts +0 -0
- package/screen/EchartContent.js +63 -0
- package/screen/Page.d.ts +13 -0
- package/screen/Page.js +74 -0
- package/screen/index.d.ts +3 -0
- package/screen/index.js +9 -0
- package/screen/render.d.ts +5 -0
- package/screen/render.js +10 -0
- package/utils/Ajax.d.ts +85 -0
- package/utils/Ajax.js +147 -0
- package/utils/ArrayUtil.d.ts +22 -0
- package/utils/ArrayUtil.js +51 -0
- package/utils/CacheUtil.d.ts +20 -0
- package/utils/CacheUtil.js +86 -0
- package/utils/Const.d.ts +14 -0
- package/utils/Const.js +37 -0
- package/utils/CustomApp.d.ts +242 -0
- package/utils/CustomApp.js +18 -0
- package/utils/EventUtil.d.ts +22 -0
- package/utils/EventUtil.js +63 -0
- package/utils/Format.d.ts +28 -0
- package/utils/Format.js +206 -0
- package/utils/Global.d.ts +276 -0
- package/utils/Global.js +125 -0
- package/utils/Logger.d.ts +5 -0
- package/utils/Logger.js +32 -0
- package/utils/PageUtil.d.ts +24 -0
- package/utils/PageUtil.js +87 -0
- package/utils/Renders/ApiGetRender.d.ts +23 -0
- package/utils/Renders/ApiGetRender.js +192 -0
- package/utils/Renders/ApiPostRender.d.ts +17 -0
- package/utils/Renders/ApiPostRender.js +161 -0
- package/utils/Renders/DateRender.d.ts +8 -0
- package/utils/Renders/DateRender.js +35 -0
- package/utils/Renders/DictRender.d.ts +23 -0
- package/utils/Renders/DictRender.js +258 -0
- package/utils/Renders/FileRender.d.ts +3 -0
- package/utils/Renders/FileRender.js +46 -0
- package/utils/Renders/ListRender.d.ts +23 -0
- package/utils/Renders/ListRender.js +111 -0
- package/utils/Renders/NumberRender.d.ts +19 -0
- package/utils/Renders/NumberRender.js +65 -0
- package/utils/Renders/StatusRender.d.ts +12 -0
- package/utils/Renders/StatusRender.js +68 -0
- package/utils/Renders/StringRender.d.ts +14 -0
- package/utils/Renders/StringRender.js +194 -0
- package/utils/Renders/_define.d.ts +26 -0
- package/utils/Renders/_define.js +64 -0
- package/utils/Renders/index.d.ts +9 -0
- package/utils/Renders/index.js +42 -0
- package/utils/StringUtil.d.ts +124 -0
- package/utils/StringUtil.js +352 -0
- package/utils/TreeUtil.d.ts +42 -0
- package/utils/TreeUtil.js +69 -0
- package/utils/VAP.d.ts +16 -0
- package/utils/VAP.js +78 -0
- package/utils/XHR.d.ts +9 -0
- package/utils/XHR.js +53 -0
- package/utils/_AjaxUtil.d.ts +11 -0
- package/utils/_AjaxUtil.js +45 -0
- package/utils/_Support.d.ts +22 -0
- package/utils/_Support.js +106 -0
- package/utils/i18n.d.ts +60 -0
- package/utils/i18n.js +184 -0
- package/utils/index.d.ts +19 -0
- package/utils/index.js +54 -0
- package/utils/screenful.d.ts +15 -0
- package/utils/screenful.js +64 -0
- package/widget/index.d.ts +39 -0
- package/widget/index.js +21 -0
package/utils/Format.js
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.maskEmail = exports.maskPhone = exports.maskIdCard = exports.formatDateTime = exports.formatDate = exports.getFormater = exports.formatChinese = exports.formatIntFixed = exports.formatInt = exports.formatNumber = exports.formatSize = exports.formatPercent = exports.formatUSD = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const StringUtil_1 = require("./StringUtil");
|
|
9
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
10
|
+
const MAX_FIX = [
|
|
11
|
+
0,
|
|
12
|
+
9,
|
|
13
|
+
99,
|
|
14
|
+
999,
|
|
15
|
+
9999,
|
|
16
|
+
99999,
|
|
17
|
+
999999,
|
|
18
|
+
9999999,
|
|
19
|
+
99999999,
|
|
20
|
+
999999999,
|
|
21
|
+
9999999999,
|
|
22
|
+
99999999999,
|
|
23
|
+
999999999999,
|
|
24
|
+
9999999999999,
|
|
25
|
+
99999999999999,
|
|
26
|
+
999999999999999
|
|
27
|
+
];
|
|
28
|
+
/**
|
|
29
|
+
* 123456 -> '123,456'
|
|
30
|
+
* 1234567 -> '1,234,567'
|
|
31
|
+
*/
|
|
32
|
+
const formatUSD = (num, digital = false) => {
|
|
33
|
+
if (digital == false || digital == 0)
|
|
34
|
+
return Math.floor(num).toLocaleString();
|
|
35
|
+
let fixed = lodash_1.default.isNumber(digital) ? digital : 2;
|
|
36
|
+
return num.toLocaleString('en-US', { minimumFractionDigits: fixed, maximumFractionDigits: fixed });
|
|
37
|
+
};
|
|
38
|
+
exports.formatUSD = formatUSD;
|
|
39
|
+
const formatPercent = (num, basic = 1) => {
|
|
40
|
+
return (0, exports.formatNumber)(num / basic) + '%';
|
|
41
|
+
};
|
|
42
|
+
exports.formatPercent = formatPercent;
|
|
43
|
+
const formatSize = (byteSize) => {
|
|
44
|
+
if (byteSize < 1024) {
|
|
45
|
+
return (0, exports.formatNumber)(byteSize) + 'b';
|
|
46
|
+
}
|
|
47
|
+
var kbSize = (byteSize / 1024);
|
|
48
|
+
if (kbSize < 1024) {
|
|
49
|
+
return (0, exports.formatNumber)(kbSize) + 'KB';
|
|
50
|
+
}
|
|
51
|
+
var mbSize = (kbSize / 1024);
|
|
52
|
+
if (mbSize < 1024) {
|
|
53
|
+
return (0, exports.formatNumber)(mbSize) + 'MB';
|
|
54
|
+
}
|
|
55
|
+
var gbSize = (mbSize / 1024);
|
|
56
|
+
if (gbSize < 1024) {
|
|
57
|
+
return (0, exports.formatNumber)(gbSize) + 'GB';
|
|
58
|
+
}
|
|
59
|
+
var tbSize = (gbSize / 1024);
|
|
60
|
+
if (tbSize < 1024) {
|
|
61
|
+
return (0, exports.formatNumber)(tbSize) + 'TB';
|
|
62
|
+
}
|
|
63
|
+
var pbSize = (tbSize / 1024);
|
|
64
|
+
return (0, exports.formatNumber)(pbSize) + 'PB';
|
|
65
|
+
};
|
|
66
|
+
exports.formatSize = formatSize;
|
|
67
|
+
/**
|
|
68
|
+
* pos : 小数点后面位数,最多20
|
|
69
|
+
*/
|
|
70
|
+
const formatNumber = (num, fractionDigits = 2) => {
|
|
71
|
+
if (fractionDigits == false || fractionDigits == 0)
|
|
72
|
+
return Math.floor(num).toString();
|
|
73
|
+
let digital = lodash_1.default.isNumber(fractionDigits) ? fractionDigits : 2;
|
|
74
|
+
return num.toFixed(digital);
|
|
75
|
+
};
|
|
76
|
+
exports.formatNumber = formatNumber;
|
|
77
|
+
function formatInt(num, returnString) {
|
|
78
|
+
const result = Math.round(num);
|
|
79
|
+
if (returnString) {
|
|
80
|
+
return result.toString();
|
|
81
|
+
}
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
exports.formatInt = formatInt;
|
|
85
|
+
const formatIntFixed = (num, fractionDigits = 5) => {
|
|
86
|
+
const pos = lodash_1.default.isNumber(fractionDigits) ? fractionDigits : 5;
|
|
87
|
+
let idx = (pos <= 0 || pos > 15) ? 5 : pos;
|
|
88
|
+
if (num > MAX_FIX[idx])
|
|
89
|
+
return MAX_FIX[idx].toString();
|
|
90
|
+
let val = Math.round(num).toString();
|
|
91
|
+
let zeroCount = idx - val.length;
|
|
92
|
+
let prefix = '';
|
|
93
|
+
for (let i = 0; i < zeroCount; i++) {
|
|
94
|
+
prefix += '0';
|
|
95
|
+
}
|
|
96
|
+
return prefix + val;
|
|
97
|
+
};
|
|
98
|
+
exports.formatIntFixed = formatIntFixed;
|
|
99
|
+
const formatChinese = (num, digital = 2) => {
|
|
100
|
+
let result;
|
|
101
|
+
let unit;
|
|
102
|
+
if (num >= 100000000) {
|
|
103
|
+
result = (0, exports.formatNumber)(num / 100000000, digital);
|
|
104
|
+
unit = '亿';
|
|
105
|
+
}
|
|
106
|
+
else if (num >= 10000) {
|
|
107
|
+
result = (0, exports.formatNumber)(num / 10000, digital);
|
|
108
|
+
unit = '万';
|
|
109
|
+
}
|
|
110
|
+
else if (num <= -100000000) {
|
|
111
|
+
result = (0, exports.formatNumber)(-(Math.abs(num) / 100000000), digital);
|
|
112
|
+
unit = '亿';
|
|
113
|
+
}
|
|
114
|
+
else if (num <= -10000) {
|
|
115
|
+
result = (0, exports.formatNumber)(-(Math.abs(num) / 10000), digital);
|
|
116
|
+
unit = '万';
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
result = (0, exports.formatNumber)(num, digital);
|
|
120
|
+
unit = '';
|
|
121
|
+
}
|
|
122
|
+
return result + unit;
|
|
123
|
+
};
|
|
124
|
+
exports.formatChinese = formatChinese;
|
|
125
|
+
const getFormater = (type, fix) => {
|
|
126
|
+
switch (type) {
|
|
127
|
+
case 'number':
|
|
128
|
+
if (fix)
|
|
129
|
+
return (num) => (0, exports.formatNumber)(num, fix);
|
|
130
|
+
return exports.formatNumber;
|
|
131
|
+
case 'int':
|
|
132
|
+
return (num) => formatInt(num, true);
|
|
133
|
+
case 'int-fixed':
|
|
134
|
+
let pos = fix === undefined ? 5 : fix;
|
|
135
|
+
return (num) => (0, exports.formatIntFixed)(num, pos);
|
|
136
|
+
case 'usd':
|
|
137
|
+
return exports.formatUSD;
|
|
138
|
+
case 'size':
|
|
139
|
+
return exports.formatSize;
|
|
140
|
+
case 'chinese':
|
|
141
|
+
return exports.formatChinese;
|
|
142
|
+
case 'percent':
|
|
143
|
+
return exports.formatPercent;
|
|
144
|
+
default:
|
|
145
|
+
if (fix)
|
|
146
|
+
return (num) => (0, exports.formatNumber)(num, fix);
|
|
147
|
+
return exports.formatNumber;
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
exports.getFormater = getFormater;
|
|
151
|
+
const formatDate = (str) => {
|
|
152
|
+
let date = (0, dayjs_1.default)(str);
|
|
153
|
+
if (date.isValid())
|
|
154
|
+
return date.format('YYYY-MM-DD');
|
|
155
|
+
return '';
|
|
156
|
+
};
|
|
157
|
+
exports.formatDate = formatDate;
|
|
158
|
+
const formatDateTime = (str) => {
|
|
159
|
+
let date = (0, dayjs_1.default)(str);
|
|
160
|
+
if (date.isValid())
|
|
161
|
+
return date.format('YYYY-MM-DD HH:mm:ss');
|
|
162
|
+
return '';
|
|
163
|
+
};
|
|
164
|
+
exports.formatDateTime = formatDateTime;
|
|
165
|
+
const maskIdCard = (str) => {
|
|
166
|
+
if (!lodash_1.default.isString(str) || str == null)
|
|
167
|
+
return '';
|
|
168
|
+
if (str.length < 15)
|
|
169
|
+
return str;
|
|
170
|
+
return str.substring(0, 5) + '*******' + str.substring(str.length - 3);
|
|
171
|
+
};
|
|
172
|
+
exports.maskIdCard = maskIdCard;
|
|
173
|
+
const maskPhone = (str) => {
|
|
174
|
+
if (!lodash_1.default.isString(str) || str == null)
|
|
175
|
+
return '';
|
|
176
|
+
if (str.length < 10)
|
|
177
|
+
return str;
|
|
178
|
+
let fixIdx = str.indexOf('-');
|
|
179
|
+
if (fixIdx > 0)
|
|
180
|
+
return str.substring(0, fixIdx) + '***' + str.substring(str.length - 3);
|
|
181
|
+
return str.substring(0, 3) + '****' + str.substring(str.length - 4);
|
|
182
|
+
};
|
|
183
|
+
exports.maskPhone = maskPhone;
|
|
184
|
+
const maskEmail = (str) => {
|
|
185
|
+
if (!lodash_1.default.isString(str) || str == null)
|
|
186
|
+
return '';
|
|
187
|
+
if (!(0, StringUtil_1.isEmail)(str))
|
|
188
|
+
return str;
|
|
189
|
+
let email = [];
|
|
190
|
+
let [account, domain] = str.split('@');
|
|
191
|
+
if (account.length <= 2) {
|
|
192
|
+
email.push(account);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
email.push(account.substring(0, 2));
|
|
196
|
+
email.push('*'.repeat(account.length - 2));
|
|
197
|
+
}
|
|
198
|
+
email.push('@');
|
|
199
|
+
let idx = lodash_1.default.lastIndexOf(domain, '.');
|
|
200
|
+
if (idx >= 0) {
|
|
201
|
+
email.push('*'.repeat(idx));
|
|
202
|
+
email.push(domain.substring(idx));
|
|
203
|
+
}
|
|
204
|
+
return email.join('');
|
|
205
|
+
};
|
|
206
|
+
exports.maskEmail = maskEmail;
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { Language } from './_Support';
|
|
2
|
+
import type { PlainObject } from '../basetype';
|
|
3
|
+
import type { TableSize } from 'antd/es/table';
|
|
4
|
+
/**
|
|
5
|
+
* 全局定义
|
|
6
|
+
*/
|
|
7
|
+
export declare enum LOG_LEVEL {
|
|
8
|
+
DEBUG = 0,
|
|
9
|
+
LOG = 1,
|
|
10
|
+
INFO = 2,
|
|
11
|
+
WARN = 3,
|
|
12
|
+
ERROR = 4
|
|
13
|
+
}
|
|
14
|
+
export type GlobalSetting = {
|
|
15
|
+
/**
|
|
16
|
+
* 应用相关参数:
|
|
17
|
+
*/
|
|
18
|
+
APP: {
|
|
19
|
+
LANG: Language;
|
|
20
|
+
};
|
|
21
|
+
BASIC: {
|
|
22
|
+
PREFIX: string;
|
|
23
|
+
SYSTEM: string;
|
|
24
|
+
MENU: string;
|
|
25
|
+
RULES: string;
|
|
26
|
+
DICT: string;
|
|
27
|
+
MESSAGE: string;
|
|
28
|
+
USER_INFO: string;
|
|
29
|
+
USER_MODULE: string;
|
|
30
|
+
USER_LOGOUT: string;
|
|
31
|
+
APP: string;
|
|
32
|
+
APP_SSO: string;
|
|
33
|
+
ORG_ROOT: string;
|
|
34
|
+
ORG_ROOT_INFO: string;
|
|
35
|
+
ORG_CHILDREN: string;
|
|
36
|
+
ORG_API: string;
|
|
37
|
+
ORG_FIELDS: [string, string, string, string];
|
|
38
|
+
};
|
|
39
|
+
ADMIN: {
|
|
40
|
+
USER: string;
|
|
41
|
+
USER_UNLOCK: string;
|
|
42
|
+
ROLE: string;
|
|
43
|
+
RESOURCE: string;
|
|
44
|
+
APP: string;
|
|
45
|
+
MESSAGE: string;
|
|
46
|
+
DICT: string;
|
|
47
|
+
SYSTEM: string;
|
|
48
|
+
LICENSE: string;
|
|
49
|
+
};
|
|
50
|
+
RESULT: {
|
|
51
|
+
code: string;
|
|
52
|
+
message: string;
|
|
53
|
+
success: string | number;
|
|
54
|
+
};
|
|
55
|
+
VLIST: {
|
|
56
|
+
list: string;
|
|
57
|
+
total: string;
|
|
58
|
+
totalAcc: string;
|
|
59
|
+
start: string;
|
|
60
|
+
count: string;
|
|
61
|
+
order: string;
|
|
62
|
+
by: string;
|
|
63
|
+
};
|
|
64
|
+
VDATA: {
|
|
65
|
+
data: string;
|
|
66
|
+
};
|
|
67
|
+
AJAX: {
|
|
68
|
+
timeout: number;
|
|
69
|
+
beforeSend: (url: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH', headers: HeadersInit, query: PlainObject) => [string, 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH', HeadersInit, PlainObject];
|
|
70
|
+
beforeReceive: () => [];
|
|
71
|
+
headers: Record<string, string>;
|
|
72
|
+
};
|
|
73
|
+
DATE: {
|
|
74
|
+
DATE_FORMAT: string;
|
|
75
|
+
DATE_TIME_FORMAT: string;
|
|
76
|
+
WEEK_FORMAT: string;
|
|
77
|
+
MONTH_FORMAT: string;
|
|
78
|
+
TIME_FORMAT: string;
|
|
79
|
+
};
|
|
80
|
+
BOX: {
|
|
81
|
+
SELECT_CLOSE: 1 | 2;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* 通用上传服务,默认为微服务版的配置,单机版需要在 portal 里面定制一下
|
|
85
|
+
*/
|
|
86
|
+
UPLOAD: {
|
|
87
|
+
/**
|
|
88
|
+
* 通用上传接口:
|
|
89
|
+
* 微服务版: /api-common/file/upload
|
|
90
|
+
* 单机版: /api/fs/upload
|
|
91
|
+
*/
|
|
92
|
+
API: string;
|
|
93
|
+
/**
|
|
94
|
+
* 通用预览接口:
|
|
95
|
+
* 微服务版: /api-common/file/show/
|
|
96
|
+
* 单机版: /api/fs/view/
|
|
97
|
+
*/
|
|
98
|
+
PREVIEW: string;
|
|
99
|
+
/**
|
|
100
|
+
* 携带通用应用namespace scope 参数
|
|
101
|
+
* 微服务版: true
|
|
102
|
+
* 单机版: fasle
|
|
103
|
+
*/
|
|
104
|
+
UPLOAD_PARAM: boolean;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* 搜索框设定
|
|
108
|
+
*/
|
|
109
|
+
SEARCHBAR: {
|
|
110
|
+
/**
|
|
111
|
+
* 左输入右操作,设置为 true 后,变成左操作右输入
|
|
112
|
+
* 默认为 false
|
|
113
|
+
*/
|
|
114
|
+
REVERSE: boolean;
|
|
115
|
+
/**
|
|
116
|
+
*
|
|
117
|
+
* 点击更多过滤条件时,使用弹框弹出更多条件,
|
|
118
|
+
* 默认为 false , 使用展开的方式
|
|
119
|
+
*/
|
|
120
|
+
USE_MODAL: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* 总是展开,默认为false
|
|
123
|
+
* 设为true后,search bar 总是显示全部,不可收缩
|
|
124
|
+
*/
|
|
125
|
+
AWAYS_EXPAND: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* 全局禁用 keyword, 默认为 false
|
|
128
|
+
*/
|
|
129
|
+
DISABLE_KEYWORD: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* 自动判断是否为 outside 模式,如果遇到 radio,checkbox 等无法内置时会进行转换。
|
|
132
|
+
* 设置 FIELD_AWAYS_OUTSIDE = true 后 ,默认为 false
|
|
133
|
+
* 所有 searchbar 都将使用outside 模式
|
|
134
|
+
*/
|
|
135
|
+
FIELD_AWAYS_OUTSIDE: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* inside 模式时,一个字段的宽度
|
|
138
|
+
*/
|
|
139
|
+
FIELD_INSIDE_WIDTH: number;
|
|
140
|
+
/**
|
|
141
|
+
* outside 模式时, label 区域的默认宽度
|
|
142
|
+
*/
|
|
143
|
+
FIELD_LABEL_WIDTH: number;
|
|
144
|
+
/**
|
|
145
|
+
* outside 模式时, input 区域的默认宽度
|
|
146
|
+
*/
|
|
147
|
+
FIELD_IPNUT_WIDTH: number;
|
|
148
|
+
/**
|
|
149
|
+
* keyword 模式时, 关键字搜索框的宽度
|
|
150
|
+
* 说明: 非 outside 模式时 ,宽度 = label+input
|
|
151
|
+
*/
|
|
152
|
+
FIELD_KEYWORD_WIDTH: number;
|
|
153
|
+
};
|
|
154
|
+
GRID: {
|
|
155
|
+
GUTTER: [number, number];
|
|
156
|
+
};
|
|
157
|
+
FORM: {
|
|
158
|
+
/**
|
|
159
|
+
* 表单大小 ,说明: 1.5 版本无效
|
|
160
|
+
* @deprecated
|
|
161
|
+
*/
|
|
162
|
+
SIZE: any;
|
|
163
|
+
/**
|
|
164
|
+
* UFormModal 点击弹框外蒙层区域时,允许自动关闭
|
|
165
|
+
* 默认是 true
|
|
166
|
+
*/
|
|
167
|
+
maskClosable: boolean;
|
|
168
|
+
/**
|
|
169
|
+
* 所有 Input=Text 开启非法字符检查验证
|
|
170
|
+
* 默认不开启
|
|
171
|
+
* 开启后,可通过 config: { ignore:true } 取消单个输入框的验证
|
|
172
|
+
*/
|
|
173
|
+
ILLEGAL_CHAR_VALIDATE: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* 非法字符正则表达式
|
|
176
|
+
*/
|
|
177
|
+
ILLEGAL_CHAR_REGEXP: RegExp;
|
|
178
|
+
/**
|
|
179
|
+
* 所有 Input=Text 最大长度,默认是 36
|
|
180
|
+
* 可通过 config: { maxLength:9999 } 重写单个输入框的最大长度
|
|
181
|
+
*/
|
|
182
|
+
INPUT_MAX_LENGTH: number;
|
|
183
|
+
/**
|
|
184
|
+
* number 输入,默认最小值为 0 ,可全局性防止输入负数
|
|
185
|
+
* 默认为true
|
|
186
|
+
*/
|
|
187
|
+
NUMBER_MIN_ZERO: boolean;
|
|
188
|
+
/**
|
|
189
|
+
* Switch 组件,选中定义为第一项还是第二项,默认为 0(第一项)
|
|
190
|
+
*/
|
|
191
|
+
SWITCH_DEFAULT_CHECKED: 0 | 1;
|
|
192
|
+
/**
|
|
193
|
+
* 使用内置高阶输入,类型自动转成更好的交互方式
|
|
194
|
+
* 目前支持高阶输入的类型有 ip, url , email, phone, ip, mac, idcard, multi-ip ]
|
|
195
|
+
*/
|
|
196
|
+
USE_POWER_INPUT: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* 说明: 'ip' 默认支持IP4 和 IP6 验证。
|
|
199
|
+
* 设置 VALIDATE_IP_4 = true ,可以将所有 'ip' 类型改为只支持IP4 验证,不支持IP6
|
|
200
|
+
*/
|
|
201
|
+
VALIDATE_IP_4: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* 说明: 'idcard' 默认支持 15位身份证 和 18位身份证 验证。
|
|
204
|
+
* 设置 VALIDATE_ID_18 = true ,可以将所有 'idcard' 类型改为只支持 18位身份证号验证
|
|
205
|
+
*/
|
|
206
|
+
VALIDATE_ID_18: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* 说明: 'phone' 默认支持 11位手机号 与 固话号 验证
|
|
209
|
+
* 设置 VALIDATE_PHONE_MOBILE = true ,可以将所有 'phone' 类型改为只支持 11位手机号 验证
|
|
210
|
+
*
|
|
211
|
+
*/
|
|
212
|
+
VALIDATE_PHONE_MOBILE: boolean;
|
|
213
|
+
};
|
|
214
|
+
TABLE: {
|
|
215
|
+
SIZE: TableSize;
|
|
216
|
+
/**
|
|
217
|
+
* 当列表的项目被删除时,重新查询列表数据
|
|
218
|
+
* 默认为false
|
|
219
|
+
*/
|
|
220
|
+
RE_QUERY_AT_DELETE: boolean;
|
|
221
|
+
};
|
|
222
|
+
PAGINATION: {
|
|
223
|
+
SIZE: 'default' | 'small';
|
|
224
|
+
/**
|
|
225
|
+
* 分页样式,目前支持3种,传1 2 3
|
|
226
|
+
* 示例
|
|
227
|
+
* 0 : (不显示)
|
|
228
|
+
* 默认 1: 共 100条,当前 15-30条 - 显示总数和当前页信息
|
|
229
|
+
* 2 : 为你搜索到100条, 耗时0.1秒 - 显示总数和耗时信息
|
|
230
|
+
* 3 : 共 100 条 - 只显示总数
|
|
231
|
+
*/
|
|
232
|
+
THEME: 0 | 1 | 2 | 3;
|
|
233
|
+
/**
|
|
234
|
+
* 可供分页选项 - 每页条目数
|
|
235
|
+
* 数字数组,默认为 [10, 15, 30]
|
|
236
|
+
*/
|
|
237
|
+
OPTIONS: number[];
|
|
238
|
+
/**
|
|
239
|
+
* 默认每页条数
|
|
240
|
+
* 在 OPTIONS 中取一个
|
|
241
|
+
* 默认为 15,
|
|
242
|
+
*/
|
|
243
|
+
SIZE_DEFAULT: number;
|
|
244
|
+
/**
|
|
245
|
+
* 在 弹框\INNER模式中,默认每页条数
|
|
246
|
+
* 在 OPTIONS 中取一个
|
|
247
|
+
* 默认为 10
|
|
248
|
+
*/
|
|
249
|
+
SIZE_SMALL: number;
|
|
250
|
+
};
|
|
251
|
+
ICONS: {
|
|
252
|
+
CLAZZ: string[];
|
|
253
|
+
MAP: Map<string, string>;
|
|
254
|
+
};
|
|
255
|
+
LOG: {
|
|
256
|
+
LEVEL: LOG_LEVEL;
|
|
257
|
+
TRACK: boolean;
|
|
258
|
+
TIME: boolean;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* 权限相关
|
|
262
|
+
*/
|
|
263
|
+
PROMISSION: {
|
|
264
|
+
ROLE: Set<string>;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
export declare const CONFIG: GlobalSetting;
|
|
268
|
+
/**
|
|
269
|
+
* 设置全局参数,是一个选填的
|
|
270
|
+
* @see GlobalSetting
|
|
271
|
+
*/
|
|
272
|
+
type SetParams = {
|
|
273
|
+
[K in keyof GlobalSetting]?: Partial<GlobalSetting[K]>;
|
|
274
|
+
};
|
|
275
|
+
export declare const SET: (config: SetParams) => void;
|
|
276
|
+
export {};
|
package/utils/Global.js
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SET = exports.CONFIG = exports.LOG_LEVEL = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const _Support_1 = require("./_Support");
|
|
9
|
+
/**
|
|
10
|
+
* 全局定义
|
|
11
|
+
*/
|
|
12
|
+
var LOG_LEVEL;
|
|
13
|
+
(function (LOG_LEVEL) {
|
|
14
|
+
LOG_LEVEL[LOG_LEVEL["DEBUG"] = 0] = "DEBUG";
|
|
15
|
+
LOG_LEVEL[LOG_LEVEL["LOG"] = 1] = "LOG";
|
|
16
|
+
LOG_LEVEL[LOG_LEVEL["INFO"] = 2] = "INFO";
|
|
17
|
+
LOG_LEVEL[LOG_LEVEL["WARN"] = 3] = "WARN";
|
|
18
|
+
LOG_LEVEL[LOG_LEVEL["ERROR"] = 4] = "ERROR";
|
|
19
|
+
})(LOG_LEVEL || (exports.LOG_LEVEL = LOG_LEVEL = {}));
|
|
20
|
+
const DEFAULT = {
|
|
21
|
+
APP: {
|
|
22
|
+
LANG: _Support_1.Language.ZH_CN,
|
|
23
|
+
},
|
|
24
|
+
BASIC: {
|
|
25
|
+
PREFIX: '/api-common',
|
|
26
|
+
SYSTEM: '/api-common/system/config',
|
|
27
|
+
MENU: '/api-common/resource/menus/',
|
|
28
|
+
RULES: '/api-common/role/rules',
|
|
29
|
+
DICT: '/api-common/dictionary',
|
|
30
|
+
MESSAGE: '/api-common/message',
|
|
31
|
+
USER_INFO: '/api-common/user/info',
|
|
32
|
+
USER_MODULE: '/api-common/preference',
|
|
33
|
+
USER_LOGOUT: '/api-common/user/logout',
|
|
34
|
+
APP: '/api-common/app',
|
|
35
|
+
APP_SSO: '/api-common/user/redirect/',
|
|
36
|
+
ORG_ROOT: '/api-common/organization/root',
|
|
37
|
+
ORG_ROOT_INFO: '/api-common/organization/rootinfo',
|
|
38
|
+
ORG_CHILDREN: '/api-common/organization/tree/',
|
|
39
|
+
ORG_API: '/api-common/organization',
|
|
40
|
+
ORG_FIELDS: ['code', 'name', 'parentCode', 'hasChildren'],
|
|
41
|
+
},
|
|
42
|
+
ADMIN: {
|
|
43
|
+
USER: '/api-common/user',
|
|
44
|
+
USER_UNLOCK: '/api-common/user/session/unlock',
|
|
45
|
+
ROLE: '/api-common/role',
|
|
46
|
+
RESOURCE: '/api-common/resource',
|
|
47
|
+
APP: '/api-common/app',
|
|
48
|
+
MESSAGE: '/api-common/message',
|
|
49
|
+
DICT: '/api-common/dictionary',
|
|
50
|
+
SYSTEM: '/api-common/system/config',
|
|
51
|
+
LICENSE: '/api-common/'
|
|
52
|
+
},
|
|
53
|
+
GRID: {
|
|
54
|
+
GUTTER: [0, 0],
|
|
55
|
+
},
|
|
56
|
+
RESULT: { code: 'code', message: 'message', success: '0' },
|
|
57
|
+
VLIST: { list: 'list', total: 'total', totalAcc: 'totalAcc', start: 'start_', count: 'count_', order: 'order_', by: 'by_' },
|
|
58
|
+
VDATA: { data: 'data' },
|
|
59
|
+
BOX: { SELECT_CLOSE: 2 },
|
|
60
|
+
AJAX: { timeout: 30000, beforeSend: null, beforeReceive: null, headers: { 'Content-Type': 'application/json' } },
|
|
61
|
+
UPLOAD: {
|
|
62
|
+
API: '/api-common/file/upload',
|
|
63
|
+
PREVIEW: '/api-common/file/show/',
|
|
64
|
+
UPLOAD_PARAM: true,
|
|
65
|
+
},
|
|
66
|
+
SEARCHBAR: {
|
|
67
|
+
REVERSE: false, USE_MODAL: false, DISABLE_KEYWORD: false,
|
|
68
|
+
FIELD_AWAYS_OUTSIDE: false,
|
|
69
|
+
AWAYS_EXPAND: false,
|
|
70
|
+
FIELD_IPNUT_WIDTH: 150,
|
|
71
|
+
FIELD_LABEL_WIDTH: 80,
|
|
72
|
+
FIELD_INSIDE_WIDTH: 200,
|
|
73
|
+
FIELD_KEYWORD_WIDTH: 240,
|
|
74
|
+
},
|
|
75
|
+
TABLE: {
|
|
76
|
+
SIZE: 'small',
|
|
77
|
+
RE_QUERY_AT_DELETE: false
|
|
78
|
+
},
|
|
79
|
+
DATE: {
|
|
80
|
+
DATE_FORMAT: 'YYYY-MM-DD',
|
|
81
|
+
DATE_TIME_FORMAT: 'YYYY-MM-DD HH:mm:ss',
|
|
82
|
+
WEEK_FORMAT: 'YYYY-MM-DD',
|
|
83
|
+
MONTH_FORMAT: 'YYYY-MM',
|
|
84
|
+
TIME_FORMAT: 'HH:mm:ss',
|
|
85
|
+
},
|
|
86
|
+
FORM: {
|
|
87
|
+
SIZE: 'small',
|
|
88
|
+
maskClosable: false,
|
|
89
|
+
ILLEGAL_CHAR_VALIDATE: true,
|
|
90
|
+
ILLEGAL_CHAR_REGEXP: /[\'"#$?:!!?%¥&^*]/im,
|
|
91
|
+
NUMBER_MIN_ZERO: true,
|
|
92
|
+
INPUT_MAX_LENGTH: 36,
|
|
93
|
+
SWITCH_DEFAULT_CHECKED: 0,
|
|
94
|
+
USE_POWER_INPUT: true,
|
|
95
|
+
VALIDATE_IP_4: false,
|
|
96
|
+
VALIDATE_ID_18: false,
|
|
97
|
+
VALIDATE_PHONE_MOBILE: false,
|
|
98
|
+
},
|
|
99
|
+
PAGINATION: { SIZE: 'small', THEME: 1, OPTIONS: [10, 15, 30], SIZE_DEFAULT: 15, SIZE_SMALL: 10, },
|
|
100
|
+
ICONS: {
|
|
101
|
+
CLAZZ: [],
|
|
102
|
+
MAP: new Map(),
|
|
103
|
+
},
|
|
104
|
+
LOG: {
|
|
105
|
+
LEVEL: LOG_LEVEL.ERROR,
|
|
106
|
+
TRACK: false,
|
|
107
|
+
TIME: true
|
|
108
|
+
},
|
|
109
|
+
PROMISSION: {
|
|
110
|
+
ROLE: new Set(),
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
exports.CONFIG = (0, _Support_1.globalDefault)('_V_GLOBAL', DEFAULT);
|
|
114
|
+
const SET = (config) => {
|
|
115
|
+
// CONFIG = _.merge(CONFIG, config);
|
|
116
|
+
for (let key in config) {
|
|
117
|
+
// if(_.isPlainObject(CONFIG[key])){
|
|
118
|
+
// // _.extend(CONFIG[key], config[key])
|
|
119
|
+
// }else{
|
|
120
|
+
// }
|
|
121
|
+
exports.CONFIG[key] = lodash_1.default.merge(exports.CONFIG[key], config[key]);
|
|
122
|
+
// _.merge(CONFIG[key], config[key])
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
exports.SET = SET;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const debug: (...args: any[]) => void;
|
|
2
|
+
export declare const log: (...args: any[]) => void;
|
|
3
|
+
export declare const info: (...args: any[]) => void;
|
|
4
|
+
export declare const warn: (...args: any[]) => void;
|
|
5
|
+
export declare const error: (...args: any[]) => void;
|
package/utils/Logger.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.error = exports.warn = exports.info = exports.log = exports.debug = void 0;
|
|
4
|
+
const Global_1 = require("./Global");
|
|
5
|
+
const debug = (...args) => {
|
|
6
|
+
if (Global_1.CONFIG.LOG.LEVEL <= Global_1.LOG_LEVEL.DEBUG) {
|
|
7
|
+
console.debug('debug : ', ...args);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
exports.debug = debug;
|
|
11
|
+
const log = (...args) => {
|
|
12
|
+
if (Global_1.CONFIG.LOG.LEVEL <= Global_1.LOG_LEVEL.LOG) {
|
|
13
|
+
console.log(' log : ', ...args);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
exports.log = log;
|
|
17
|
+
const info = (...args) => {
|
|
18
|
+
if (Global_1.CONFIG.LOG.LEVEL <= Global_1.LOG_LEVEL.INFO) {
|
|
19
|
+
console.info(' info : ', ...args);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.info = info;
|
|
23
|
+
const warn = (...args) => {
|
|
24
|
+
if (Global_1.CONFIG.LOG.LEVEL <= Global_1.LOG_LEVEL.WARN) {
|
|
25
|
+
console.warn(' warn : ', ...args);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.warn = warn;
|
|
29
|
+
const error = (...args) => {
|
|
30
|
+
console.error('error : ', ...args);
|
|
31
|
+
};
|
|
32
|
+
exports.error = error;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BaseOption } from '../basetype';
|
|
2
|
+
/**
|
|
3
|
+
* 阻止事件简单封装
|
|
4
|
+
*/
|
|
5
|
+
export declare const stopEvent: (evt: any, callback?: any) => void;
|
|
6
|
+
/**
|
|
7
|
+
* 将一个ip4地址转换成数字
|
|
8
|
+
*/
|
|
9
|
+
export declare const IpToInt: (ip: string) => number;
|
|
10
|
+
/**
|
|
11
|
+
* 判断是否有权限
|
|
12
|
+
*/
|
|
13
|
+
export declare const hasRole: (roleCode: string) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 获取当前 APP 名称
|
|
16
|
+
*/
|
|
17
|
+
export declare const currentApp: (root?: string) => string;
|
|
18
|
+
/**
|
|
19
|
+
* 通过一组 option 获取到一组 option 用于 select/checkbox/radio/treeselect 等选项
|
|
20
|
+
* 通过 getOptions 方法可以:
|
|
21
|
+
* 1. 过滤掉 没有roleCode的项目
|
|
22
|
+
* 2. 将label 转换为 国际化后的 label
|
|
23
|
+
*/
|
|
24
|
+
export declare const getOptions: (items: BaseOption[]) => BaseOption[];
|