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
|
@@ -0,0 +1,86 @@
|
|
|
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.getInteger = exports.getBoolean = exports.getString = exports.getData = exports.set = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const _Support_1 = require("./_Support");
|
|
9
|
+
const SESSION = (0, _Support_1.getGlobal)().sessionStorage;
|
|
10
|
+
const get = (key) => {
|
|
11
|
+
return SESSION.getItem(key);
|
|
12
|
+
};
|
|
13
|
+
const set = (key, value) => {
|
|
14
|
+
if (value === null) {
|
|
15
|
+
SESSION.removeItem(key);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (lodash_1.default.isString(value)) {
|
|
19
|
+
SESSION.setItem(key, value);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (lodash_1.default.isNumber(value) || lodash_1.default.isBoolean(value)) {
|
|
23
|
+
SESSION.setItem(key, value + '');
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (lodash_1.default.isArray(value) || lodash_1.default.isPlainObject(value)) {
|
|
27
|
+
SESSION.setItem(key, JSON.stringify(value));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
console.error('Not support');
|
|
31
|
+
};
|
|
32
|
+
exports.set = set;
|
|
33
|
+
/**
|
|
34
|
+
* 获取 Session 缓存, 并以 Object 返回 (JSON)
|
|
35
|
+
*/
|
|
36
|
+
const getData = (key, def = null) => {
|
|
37
|
+
const value = SESSION.getItem(key);
|
|
38
|
+
if (value === null)
|
|
39
|
+
return def;
|
|
40
|
+
try {
|
|
41
|
+
return JSON.parse(value);
|
|
42
|
+
}
|
|
43
|
+
catch (_a) {
|
|
44
|
+
console.error('Invalidate JSON : ' + value);
|
|
45
|
+
return def;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
exports.getData = getData;
|
|
49
|
+
/**
|
|
50
|
+
* 获取 Session 缓存, 并以 String 返回
|
|
51
|
+
*/
|
|
52
|
+
const getString = (key, def = '') => get(key) || def;
|
|
53
|
+
exports.getString = getString;
|
|
54
|
+
/**
|
|
55
|
+
* 获取 Session 缓存,并以 Boolean 值返回
|
|
56
|
+
*
|
|
57
|
+
* - false / 0 / no = false
|
|
58
|
+
* - true / 1 / yes = true
|
|
59
|
+
*/
|
|
60
|
+
const getBoolean = (key, def = false) => {
|
|
61
|
+
const value = SESSION.getItem(key);
|
|
62
|
+
if (value === null)
|
|
63
|
+
return def;
|
|
64
|
+
let txt = lodash_1.default.toLower(lodash_1.default.trim(value));
|
|
65
|
+
if (_Support_1.TRUE_SET.has(txt))
|
|
66
|
+
return true;
|
|
67
|
+
if (_Support_1.FALSE_SET.has(txt))
|
|
68
|
+
return false;
|
|
69
|
+
return def;
|
|
70
|
+
};
|
|
71
|
+
exports.getBoolean = getBoolean;
|
|
72
|
+
/**
|
|
73
|
+
* 获取 Session 缓存, 并以 Integer 返回
|
|
74
|
+
*/
|
|
75
|
+
const getInteger = (key, def = 0) => {
|
|
76
|
+
const value = SESSION.getItem(key);
|
|
77
|
+
if (value === null)
|
|
78
|
+
return def;
|
|
79
|
+
try {
|
|
80
|
+
return parseInt(value);
|
|
81
|
+
}
|
|
82
|
+
catch (_a) {
|
|
83
|
+
return def;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
exports.getInteger = getInteger;
|
package/utils/Const.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Moment as Dayjs } from 'dayjs';
|
|
3
|
+
export declare const NONE: React.JSX.Element;
|
|
4
|
+
type RangeOption = {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
range: [Dayjs, Dayjs] | (() => [Dayjs, Dayjs]);
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* 全局默认时间编码
|
|
11
|
+
*/
|
|
12
|
+
export declare const DEFAULT_TIME_RANGE = "1011";
|
|
13
|
+
export declare const TIME_OPTION: RangeOption[];
|
|
14
|
+
export {};
|
package/utils/Const.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
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.TIME_OPTION = exports.DEFAULT_TIME_RANGE = exports.NONE = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
|
+
exports.NONE = react_1.default.createElement(react_1.default.Fragment, null);
|
|
10
|
+
const _toStart = mnt => mnt.millisecond(0).second(0).minute(0).hour(0);
|
|
11
|
+
const _toEnd = mnt => mnt.millisecond(999).second(59).minute(59).hour(23);
|
|
12
|
+
const _TODAY = _toEnd((0, dayjs_1.default)());
|
|
13
|
+
/**
|
|
14
|
+
* 全局默认时间编码
|
|
15
|
+
*/
|
|
16
|
+
exports.DEFAULT_TIME_RANGE = '1011';
|
|
17
|
+
exports.TIME_OPTION = [
|
|
18
|
+
{ id: "1001", name: "今天", range: [_toStart((0, dayjs_1.default)()), _TODAY] },
|
|
19
|
+
{ id: "1002", name: "本周", range: [_toStart((0, dayjs_1.default)().startOf('week')), _TODAY] },
|
|
20
|
+
{ id: "1003", name: "本月", range: [_toStart((0, dayjs_1.default)().startOf('month')), _TODAY] },
|
|
21
|
+
{ id: "1004", name: "本年", range: [_toStart((0, dayjs_1.default)().startOf('year')), _TODAY] },
|
|
22
|
+
{ id: "1005", name: "最近15分钟", range: () => [(0, dayjs_1.default)().subtract(15, 'minutes'), (0, dayjs_1.default)()] },
|
|
23
|
+
{ id: "1006", name: "最近30分钟", range: () => [(0, dayjs_1.default)().subtract(30, 'minutes'), (0, dayjs_1.default)()] },
|
|
24
|
+
{ id: "1007", name: "最近1小时", range: () => [(0, dayjs_1.default)().subtract(1, 'hours'), (0, dayjs_1.default)()] },
|
|
25
|
+
{ id: "1008", name: "最近4小时", range: () => [(0, dayjs_1.default)().subtract(4, 'hours'), (0, dayjs_1.default)()] },
|
|
26
|
+
{ id: "1009", name: "最近12小时", range: () => [(0, dayjs_1.default)().subtract(12, 'hours'), (0, dayjs_1.default)()] },
|
|
27
|
+
{ id: "1010", name: "最近24小时", range: () => [(0, dayjs_1.default)().subtract(24, 'hours'), (0, dayjs_1.default)()] },
|
|
28
|
+
{ id: "1013", name: "最近3天", range: [_toStart((0, dayjs_1.default)().subtract(3, 'days')), _TODAY] },
|
|
29
|
+
{ id: "1011", name: "最近7天", range: [_toStart((0, dayjs_1.default)().subtract(7, 'days')), _TODAY] },
|
|
30
|
+
{ id: "1012", name: "最近30天", range: [_toStart((0, dayjs_1.default)().subtract(30, 'days')), _TODAY] },
|
|
31
|
+
{ id: "1014", name: "最近60天", range: [_toStart((0, dayjs_1.default)().subtract(60, 'days')), _TODAY] },
|
|
32
|
+
{ id: "1015", name: "最近90天", range: [_toStart((0, dayjs_1.default)().subtract(90, 'days')), _TODAY] },
|
|
33
|
+
{ id: "1016", name: "最近6月", range: [_toStart((0, dayjs_1.default)().subtract(6, 'months')), _TODAY] },
|
|
34
|
+
{ id: "1017", name: "最近1年", range: [_toStart((0, dayjs_1.default)().subtract(1, 'years')), _TODAY] }
|
|
35
|
+
];
|
|
36
|
+
const TIME_MAP = new Map();
|
|
37
|
+
exports.TIME_OPTION.map(item => TIME_MAP.set(item.id, item));
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { OPopoverProps as PopoverProps } from '../components/_adapt/Popover';
|
|
3
|
+
import type { ODropdownProps as DropDownprops } from '../components/_adapt/dropdown';
|
|
4
|
+
import type { PlainObject } from '../basetype';
|
|
5
|
+
import type { App } from '../hooks/useApp';
|
|
6
|
+
/**
|
|
7
|
+
* 注册路由信息
|
|
8
|
+
*/
|
|
9
|
+
export type Route = {
|
|
10
|
+
/**
|
|
11
|
+
* 路径
|
|
12
|
+
*/
|
|
13
|
+
path: string;
|
|
14
|
+
/**
|
|
15
|
+
* 是否为前辍匹配,默认为 false
|
|
16
|
+
* 当 like:true 时,可以通过 props.pattern 获取 Hash 参数
|
|
17
|
+
*/
|
|
18
|
+
like?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* React 组件:
|
|
21
|
+
* 说明:对于依赖多的大组件,可使用 () => import('xxx') 进行代码分割
|
|
22
|
+
*/
|
|
23
|
+
component: any;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* 菜单,由 Resource 转换而来
|
|
27
|
+
*/
|
|
28
|
+
export type Menu = {
|
|
29
|
+
/**
|
|
30
|
+
* 菜单的 Resource Id
|
|
31
|
+
*/
|
|
32
|
+
id: number | string;
|
|
33
|
+
/**
|
|
34
|
+
* 名称
|
|
35
|
+
*/
|
|
36
|
+
name: string;
|
|
37
|
+
/**
|
|
38
|
+
* 菜单类型,在此只可能存在 1 | 2
|
|
39
|
+
*
|
|
40
|
+
* 1 :菜单组
|
|
41
|
+
* 2 : 链接
|
|
42
|
+
* 3 : 权限码
|
|
43
|
+
* 4 : 小组件
|
|
44
|
+
*/
|
|
45
|
+
type: 1 | 2 | 3 | 4;
|
|
46
|
+
/**
|
|
47
|
+
* 图标
|
|
48
|
+
*/
|
|
49
|
+
icon?: string;
|
|
50
|
+
/**
|
|
51
|
+
* 路径:
|
|
52
|
+
* type = 1 时,为可选
|
|
53
|
+
* type = 2 时,为必填,URL地址,同时包含 root 与 route
|
|
54
|
+
* type = 3 时,为权限编码
|
|
55
|
+
* type = 4 时,为小组件脚本路径
|
|
56
|
+
*/
|
|
57
|
+
path?: string;
|
|
58
|
+
/**
|
|
59
|
+
* 通过 path 解析得到的根
|
|
60
|
+
*/
|
|
61
|
+
root?: string;
|
|
62
|
+
/**
|
|
63
|
+
* 通过 path 解析得到的路由
|
|
64
|
+
*/
|
|
65
|
+
route?: string;
|
|
66
|
+
/**
|
|
67
|
+
* 排序顺序
|
|
68
|
+
*/
|
|
69
|
+
sort?: number;
|
|
70
|
+
/**
|
|
71
|
+
* 子菜单:
|
|
72
|
+
* type = 1 时存在
|
|
73
|
+
* 其它 type 也可存在,但只能放置权限码
|
|
74
|
+
*/
|
|
75
|
+
children?: Menu[];
|
|
76
|
+
};
|
|
77
|
+
export type CustomAppOptions = {
|
|
78
|
+
menu?: {
|
|
79
|
+
/**
|
|
80
|
+
* 菜单模式
|
|
81
|
+
* none : 无菜单,无菜单时, theme.mode 不会起效,只需要注册一个 / 路由
|
|
82
|
+
* parent : 向上找一个菜单, 必须指定,parent
|
|
83
|
+
* list : 自定义菜单,必须 指定 list
|
|
84
|
+
*/
|
|
85
|
+
mode?: 'none' | 'parent' | 'list';
|
|
86
|
+
/**
|
|
87
|
+
* 可以为 id 或 url ,
|
|
88
|
+
*/
|
|
89
|
+
parent?: string;
|
|
90
|
+
/**
|
|
91
|
+
* list 自定义菜单
|
|
92
|
+
*/
|
|
93
|
+
list?: Menu[];
|
|
94
|
+
};
|
|
95
|
+
theme?: {
|
|
96
|
+
/**
|
|
97
|
+
* 使用系统默认配置
|
|
98
|
+
*/
|
|
99
|
+
useSystem?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* 标题
|
|
102
|
+
*/
|
|
103
|
+
title?: string;
|
|
104
|
+
/**
|
|
105
|
+
* logo图片路径
|
|
106
|
+
*/
|
|
107
|
+
logo?: string;
|
|
108
|
+
/**
|
|
109
|
+
* 指定一个皮肤代码,
|
|
110
|
+
* 当指定时,先找皮肤代码,没有找到时,使用系统配置
|
|
111
|
+
* 当设定为 null 时,不加载样式
|
|
112
|
+
*/
|
|
113
|
+
code?: string;
|
|
114
|
+
/**
|
|
115
|
+
* 自定义页面只支持 tb / lr
|
|
116
|
+
* 默认为 tb
|
|
117
|
+
*/
|
|
118
|
+
mode?: 'tb' | 'lr';
|
|
119
|
+
/**
|
|
120
|
+
* lr 模式时,不显示 crumb
|
|
121
|
+
*/
|
|
122
|
+
showTop?: boolean;
|
|
123
|
+
/**
|
|
124
|
+
* true: 使用系统/用户自定义语言
|
|
125
|
+
* string: 指定应用语言, 支持 zhCN,zhHK,enUS
|
|
126
|
+
* 默认 : zhCN
|
|
127
|
+
*/
|
|
128
|
+
lang?: true | string;
|
|
129
|
+
/**
|
|
130
|
+
* 限制宽度, tb模式时
|
|
131
|
+
*/
|
|
132
|
+
limitWidth?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* 宽度, 默认220
|
|
135
|
+
*/
|
|
136
|
+
bannerWidth?: number;
|
|
137
|
+
/**
|
|
138
|
+
* 高度,默认 64
|
|
139
|
+
*/
|
|
140
|
+
bannerHeight?: number;
|
|
141
|
+
/**
|
|
142
|
+
* 是否开启Tab,默认 false
|
|
143
|
+
*/
|
|
144
|
+
enableTab?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* 是否开启FullScreen,默认 false
|
|
147
|
+
*/
|
|
148
|
+
enableFullScreen?: boolean;
|
|
149
|
+
/**
|
|
150
|
+
* 是否开启消息,默认 false
|
|
151
|
+
*/
|
|
152
|
+
enableMessage?: boolean;
|
|
153
|
+
};
|
|
154
|
+
system?: {
|
|
155
|
+
/**
|
|
156
|
+
* 是否开启权限检测, 默认true
|
|
157
|
+
* 开启后可正常使用 roleCode 等属性, (PageUtil.hasRole , Role组件等)
|
|
158
|
+
*/
|
|
159
|
+
enableRule?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* 是否初始化字典,默认 true
|
|
162
|
+
* 开启后可正常使用 Renders.DictRender
|
|
163
|
+
*/
|
|
164
|
+
enableDict?: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* 是否初始化系统参数
|
|
167
|
+
* 开启后可正常使用 VAP.getXXX
|
|
168
|
+
*/
|
|
169
|
+
enableConfig?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* 是否提示浏览器版本过低
|
|
172
|
+
*/
|
|
173
|
+
checkBrowser?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* 新版本浏览器下载地址,默认 /static/browsers/ChromeStandaloneSetup64.exe
|
|
176
|
+
*/
|
|
177
|
+
browserDownloadUrl?: string;
|
|
178
|
+
/**
|
|
179
|
+
* 返回首页链接地址,设置为 null 没有这个功能
|
|
180
|
+
*/
|
|
181
|
+
homePage?: string;
|
|
182
|
+
};
|
|
183
|
+
user?: {
|
|
184
|
+
/**
|
|
185
|
+
* 使用系统默认配置
|
|
186
|
+
* 默认 true
|
|
187
|
+
*/
|
|
188
|
+
useSystem?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* 不使用系统配置时,需要自己写入一个 info 信息
|
|
191
|
+
*/
|
|
192
|
+
info?: PlainObject;
|
|
193
|
+
/**
|
|
194
|
+
* 加载 config 默认为 false
|
|
195
|
+
*/
|
|
196
|
+
enableConfig?: boolean;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
type MenuDefine = {
|
|
200
|
+
icon?: string;
|
|
201
|
+
roleCode?: string;
|
|
202
|
+
title: string;
|
|
203
|
+
};
|
|
204
|
+
type MenuContentOption = {
|
|
205
|
+
link: string;
|
|
206
|
+
} | {
|
|
207
|
+
modal: React.FC<{
|
|
208
|
+
open: boolean;
|
|
209
|
+
onCancel: () => void;
|
|
210
|
+
}>;
|
|
211
|
+
} | {
|
|
212
|
+
popover: Omit<PopoverProps, 'children'>;
|
|
213
|
+
} | {
|
|
214
|
+
dropdown: Omit<DropDownprops, 'children'>;
|
|
215
|
+
};
|
|
216
|
+
export type MenuOptions = MenuDefine & MenuContentOption;
|
|
217
|
+
type ActionDefine = {
|
|
218
|
+
icon: string;
|
|
219
|
+
roleCode?: string;
|
|
220
|
+
title?: string;
|
|
221
|
+
};
|
|
222
|
+
type ActionContentOption = {
|
|
223
|
+
link: string;
|
|
224
|
+
} | {
|
|
225
|
+
modal: React.FC<{
|
|
226
|
+
open: boolean;
|
|
227
|
+
onCancel: () => void;
|
|
228
|
+
}>;
|
|
229
|
+
} | {
|
|
230
|
+
popover: Omit<PopoverProps, 'children'>;
|
|
231
|
+
} | {
|
|
232
|
+
call: (app?: App) => void;
|
|
233
|
+
};
|
|
234
|
+
export type ActionOptions = ActionDefine & ActionContentOption;
|
|
235
|
+
declare class CustomApp {
|
|
236
|
+
constructor(param: CustomAppOptions);
|
|
237
|
+
registerRoute(...routes: Route[]): void;
|
|
238
|
+
registerMenu(option: MenuOptions): void;
|
|
239
|
+
registerAction(option: ActionOptions): void;
|
|
240
|
+
}
|
|
241
|
+
declare const _default: typeof CustomApp;
|
|
242
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const _Support_1 = require("./_Support");
|
|
4
|
+
class CustomApp {
|
|
5
|
+
constructor(param) {
|
|
6
|
+
console.error('must use app-custom');
|
|
7
|
+
}
|
|
8
|
+
registerRoute(...routes) {
|
|
9
|
+
console.error('must use app-custom');
|
|
10
|
+
}
|
|
11
|
+
registerMenu(option) {
|
|
12
|
+
console.error('must use app-custom');
|
|
13
|
+
}
|
|
14
|
+
registerAction(option) {
|
|
15
|
+
console.error('must use app-custom');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = (0, _Support_1.globalDefault)('CustomApp', CustomApp);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 自定义事件
|
|
3
|
+
* @param typename 自定义事件名称
|
|
4
|
+
* @param listener 自定义事件处理方法
|
|
5
|
+
* @param once 是否只执行一次,默认为false
|
|
6
|
+
*/
|
|
7
|
+
export declare const on: (typename: string, listener: Function, once?: boolean) => void;
|
|
8
|
+
/**
|
|
9
|
+
* 自定义事件,只监听一次,等同于 @see on(typename,listener,true)
|
|
10
|
+
*/
|
|
11
|
+
export declare const once: (typename: string, listener: Function) => void;
|
|
12
|
+
/**
|
|
13
|
+
* 停止监听自定义事件
|
|
14
|
+
* @param typename 自定义事件名称
|
|
15
|
+
*/
|
|
16
|
+
export declare const off: (typename: string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* 触发自定义事件
|
|
19
|
+
* @param typename 自定义事件名称
|
|
20
|
+
* ...args 参数 按顺序传
|
|
21
|
+
*/
|
|
22
|
+
export declare const call: (typename: string, ...args: any[]) => void;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.call = exports.off = exports.once = exports.on = void 0;
|
|
4
|
+
const _Support_1 = require("./_Support");
|
|
5
|
+
var EVTS = (0, _Support_1.globalDefault)('_INNER_EVENTS', []);
|
|
6
|
+
const set = (name, listener, once = false) => {
|
|
7
|
+
if (listener === null) {
|
|
8
|
+
for (var i = 0, n = EVTS.length; i < n; ++i) {
|
|
9
|
+
if (EVTS[i].name === name) {
|
|
10
|
+
EVTS = EVTS.slice(0, i).concat(EVTS.slice(i + 1));
|
|
11
|
+
break;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
for (var i = 0, n = EVTS.length; i < n; ++i) {
|
|
17
|
+
if (EVTS[i].name === name) {
|
|
18
|
+
EVTS[i].value.push(listener);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
EVTS.push({ name: name, value: [listener], once });
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* 自定义事件
|
|
26
|
+
* @param typename 自定义事件名称
|
|
27
|
+
* @param listener 自定义事件处理方法
|
|
28
|
+
* @param once 是否只执行一次,默认为false
|
|
29
|
+
*/
|
|
30
|
+
const on = (typename, listener, once = false) => {
|
|
31
|
+
if (listener != null && typeof listener !== "function")
|
|
32
|
+
throw new Error("invalid callback: " + listener);
|
|
33
|
+
set(typename, listener, once);
|
|
34
|
+
};
|
|
35
|
+
exports.on = on;
|
|
36
|
+
/**
|
|
37
|
+
* 自定义事件,只监听一次,等同于 @see on(typename,listener,true)
|
|
38
|
+
*/
|
|
39
|
+
const once = (typename, listener) => (0, exports.on)(typename, listener, true);
|
|
40
|
+
exports.once = once;
|
|
41
|
+
/**
|
|
42
|
+
* 停止监听自定义事件
|
|
43
|
+
* @param typename 自定义事件名称
|
|
44
|
+
*/
|
|
45
|
+
const off = (typename) => set(typename, null);
|
|
46
|
+
exports.off = off;
|
|
47
|
+
/**
|
|
48
|
+
* 触发自定义事件
|
|
49
|
+
* @param typename 自定义事件名称
|
|
50
|
+
* ...args 参数 按顺序传
|
|
51
|
+
*/
|
|
52
|
+
const call = (typename, ...args) => {
|
|
53
|
+
for (let e of EVTS) {
|
|
54
|
+
if (e.name == typename) {
|
|
55
|
+
for (let fn of e.value)
|
|
56
|
+
fn.call(null, ...args);
|
|
57
|
+
if (e.once)
|
|
58
|
+
set(typename, null);
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.call = call;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* string representing a number in fixed-point notation.
|
|
3
|
+
* Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.
|
|
4
|
+
*/
|
|
5
|
+
export type FractionDigits = boolean | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19;
|
|
6
|
+
export type NumberFormat = 'int' | 'int-fixed' | 'number' | 'size' | 'usd' | 'chinese' | 'percent';
|
|
7
|
+
/**
|
|
8
|
+
* 123456 -> '123,456'
|
|
9
|
+
* 1234567 -> '1,234,567'
|
|
10
|
+
*/
|
|
11
|
+
export declare const formatUSD: (num: number, digital?: FractionDigits) => string;
|
|
12
|
+
export declare const formatPercent: (num: number, basic?: number) => string;
|
|
13
|
+
export declare const formatSize: (byteSize: number) => string;
|
|
14
|
+
/**
|
|
15
|
+
* pos : 小数点后面位数,最多20
|
|
16
|
+
*/
|
|
17
|
+
export declare const formatNumber: (num: number, fractionDigits?: FractionDigits) => string;
|
|
18
|
+
export declare function formatInt(num: number): number;
|
|
19
|
+
export declare function formatInt(num: number, returnString: false): number;
|
|
20
|
+
export declare function formatInt(num: number, returnString: true): string;
|
|
21
|
+
export declare const formatIntFixed: (num: number, fractionDigits?: FractionDigits) => string;
|
|
22
|
+
export declare const formatChinese: (num: number, digital?: boolean | FractionDigits) => string;
|
|
23
|
+
export declare const getFormater: (type: NumberFormat, fix?: FractionDigits) => (num: number) => string;
|
|
24
|
+
export declare const formatDate: (str: string | number) => string;
|
|
25
|
+
export declare const formatDateTime: (str: string | number) => string;
|
|
26
|
+
export declare const maskIdCard: (str: string) => string;
|
|
27
|
+
export declare const maskPhone: (str: string) => string;
|
|
28
|
+
export declare const maskEmail: (str: string) => string;
|