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,300 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
31
|
+
const antd_1 = require("antd");
|
|
32
|
+
const Select_1 = require("../../_adapt/Select");
|
|
33
|
+
const Button_1 = require("../../_adapt/Button");
|
|
34
|
+
const index_1 = require("../../index");
|
|
35
|
+
const utils_1 = require("../../../utils");
|
|
36
|
+
const Const_1 = require("../Const");
|
|
37
|
+
const hooks_1 = require("../../../hooks");
|
|
38
|
+
const REG_IP4 = new RegExp("^(\\d{1,3})\.(\\d{1,3})+\.(\\d{1,3})\.(\\d{1,3})$");
|
|
39
|
+
const TYPED_INPUT = [
|
|
40
|
+
{ type: 'ip', validate: utils_1.StringUtil.isIP, tip: Const_1.V.ERR_NOT_IP, maxLength: 39 },
|
|
41
|
+
{ type: 'ip4', validate: utils_1.StringUtil.isIP4, tip: Const_1.V.ERR_NOT_IP4, maxLength: 15 },
|
|
42
|
+
{ type: 'ip6', validate: utils_1.StringUtil.isIP6, tip: Const_1.V.ERR_NOT_IP6, maxLength: 39 },
|
|
43
|
+
{ type: 'email', validate: utils_1.StringUtil.isEmail, tip: Const_1.V.ERR_NOT_EMAIL, maxLength: 64 },
|
|
44
|
+
{ type: 'phone', validate: utils_1.StringUtil.isPhone, tip: Const_1.V.ERR_NOT_PHONE, maxLength: 13 },
|
|
45
|
+
{ type: 'telephone', validate: utils_1.StringUtil.isTelePhone, tip: Const_1.V.ERR_NOT_PHONE, maxLength: 11 },
|
|
46
|
+
{ type: 'mobilephone', validate: utils_1.StringUtil.isMobilePhone, tip: Const_1.V.ERR_NOT_PHONE, maxLength: 13 },
|
|
47
|
+
{ type: 'idcard', validate: utils_1.StringUtil.isId, tip: Const_1.V.ERR_NOT_IDCARD, maxLength: 18 },
|
|
48
|
+
{ type: 'url', validate: utils_1.StringUtil.isURL, tip: Const_1.V.ERR_NOT_URL, maxLength: 128 },
|
|
49
|
+
{ type: 'mac', validate: utils_1.StringUtil.isMAC, tip: Const_1.V.ERR_NOT_MAC, maxLength: 24 },
|
|
50
|
+
];
|
|
51
|
+
TYPED_INPUT.map(item => {
|
|
52
|
+
(0, index_1.registerFormField)(item.type, (props) => {
|
|
53
|
+
const { field, disabled, value, onChange } = props;
|
|
54
|
+
let params = { disabled, placeholder: (0, index_1.getPlaceholder)(field), autoComplete: 'off' };
|
|
55
|
+
if (item.maxLength)
|
|
56
|
+
params.maxLength = item.maxLength;
|
|
57
|
+
if (field.ignore)
|
|
58
|
+
params.maxLength = null;
|
|
59
|
+
return react_1.default.createElement(antd_1.Input, Object.assign({}, params, field.config, { value: value === null ? undefined : value, onChange: evt => utils_1.PageUtil.stopEvent(evt, () => onChange(evt.target.value)) }));
|
|
60
|
+
}, {
|
|
61
|
+
rules: {
|
|
62
|
+
validator: (rule, value, callback) => {
|
|
63
|
+
if (value == '' || value == null)
|
|
64
|
+
return callback();
|
|
65
|
+
if (item.validate(value)) {
|
|
66
|
+
callback();
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
callback(utils_1.i18n.txt(item.tip));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
(0, index_1.registerFormField)('port', (props) => {
|
|
76
|
+
const { field, disabled, value, onChange } = props;
|
|
77
|
+
let params = { placeholder: (0, index_1.getPlaceholder)(field), disabled, autoComplete: 'off', };
|
|
78
|
+
return react_1.default.createElement(antd_1.InputNumber, Object.assign({}, params, field.config, { max: 65535, min: 1, className: 'i-number', value: value === null ? undefined : value, onChange: onChange }));
|
|
79
|
+
});
|
|
80
|
+
(0, index_1.registerFormField)('_port', (props) => {
|
|
81
|
+
var _a;
|
|
82
|
+
const { field, disabled, value, onChange } = props;
|
|
83
|
+
let params = { disabled };
|
|
84
|
+
if (field.placeholder) {
|
|
85
|
+
params.placeholder = field.placeholder;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
params.placeholder = field.title;
|
|
89
|
+
}
|
|
90
|
+
let val = undefined;
|
|
91
|
+
if (value !== null) {
|
|
92
|
+
if (((_a = field.config) === null || _a === void 0 ? void 0 : _a.valueFormat) == 'string') {
|
|
93
|
+
try {
|
|
94
|
+
val = parseInt(value);
|
|
95
|
+
}
|
|
96
|
+
catch (_b) {
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
val = value;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return react_1.default.createElement(antd_1.Input.Group, { compact: true, className: 'i-port' },
|
|
104
|
+
react_1.default.createElement(antd_1.InputNumber, Object.assign({}, params, { autoComplete: "off", value: val, min: 1, max: 65535, step: 1, style: { width: 120 }, onChange: val => {
|
|
105
|
+
var _a;
|
|
106
|
+
if (((_a = field.config) === null || _a === void 0 ? void 0 : _a.valueFormat) == 'string') {
|
|
107
|
+
onChange(val + '');
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
onChange(val);
|
|
111
|
+
}
|
|
112
|
+
} })),
|
|
113
|
+
react_1.default.createElement(antd_1.Popover, { title: "\u5E38\u7528\u7AEF\u53E3", content: react_1.default.createElement("div", { className: "i-port-popup" },
|
|
114
|
+
react_1.default.createElement(antd_1.Tag, { color: "purple", onClick: () => onChange(80) },
|
|
115
|
+
"http ",
|
|
116
|
+
react_1.default.createElement("b", null, "80")),
|
|
117
|
+
react_1.default.createElement(antd_1.Tag, { color: "purple", onClick: () => onChange(443) },
|
|
118
|
+
"https ",
|
|
119
|
+
react_1.default.createElement("b", null, "443")),
|
|
120
|
+
react_1.default.createElement(antd_1.Tag, { color: "purple", onClick: () => onChange(8080) },
|
|
121
|
+
"\u5E38\u7528\u7528www\u4EE3\u7406 ",
|
|
122
|
+
react_1.default.createElement("b", null, "8080")),
|
|
123
|
+
react_1.default.createElement(antd_1.Tag, { color: "purple", onClick: () => onChange(1080) },
|
|
124
|
+
"\u5E38\u7528Socket\u4EE3\u7406 ",
|
|
125
|
+
react_1.default.createElement("b", null, "1080")),
|
|
126
|
+
react_1.default.createElement(antd_1.Tag, { color: "volcano", onClick: () => onChange(23) },
|
|
127
|
+
"SMTP ",
|
|
128
|
+
react_1.default.createElement("b", null, "23")),
|
|
129
|
+
react_1.default.createElement(antd_1.Tag, { color: "volcano", onClick: () => onChange(110) },
|
|
130
|
+
"POP3 ",
|
|
131
|
+
react_1.default.createElement("b", null, "110")),
|
|
132
|
+
react_1.default.createElement(antd_1.Tag, { color: "volcano", onClick: () => onChange(21) },
|
|
133
|
+
"FTP ",
|
|
134
|
+
react_1.default.createElement("b", null, "21")),
|
|
135
|
+
react_1.default.createElement(antd_1.Tag, { color: "volcano", onClick: () => onChange(22) },
|
|
136
|
+
"SSH/SFTP ",
|
|
137
|
+
react_1.default.createElement("b", null, "22")),
|
|
138
|
+
react_1.default.createElement(antd_1.Tag, { color: "volcano", onClick: () => onChange(23) },
|
|
139
|
+
"Telnet ",
|
|
140
|
+
react_1.default.createElement("b", null, "23")),
|
|
141
|
+
react_1.default.createElement(antd_1.Tag, { color: "geekblue", onClick: () => onChange(3306) },
|
|
142
|
+
"MySql ",
|
|
143
|
+
react_1.default.createElement("b", null, "3306")),
|
|
144
|
+
react_1.default.createElement(antd_1.Tag, { color: "geekblue", onClick: () => onChange(5432) },
|
|
145
|
+
"PostgreSql ",
|
|
146
|
+
react_1.default.createElement("b", null, "5432")),
|
|
147
|
+
react_1.default.createElement(antd_1.Tag, { color: "geekblue", onClick: () => onChange(1521) },
|
|
148
|
+
"Oracle ",
|
|
149
|
+
react_1.default.createElement("b", null, "1521")),
|
|
150
|
+
react_1.default.createElement(antd_1.Tag, { color: "geekblue", onClick: () => onChange(6379) },
|
|
151
|
+
"Redis ",
|
|
152
|
+
react_1.default.createElement("b", null, "6379")),
|
|
153
|
+
react_1.default.createElement(antd_1.Tag, { color: "geekblue", onClick: () => onChange(27017) },
|
|
154
|
+
"MongoDB ",
|
|
155
|
+
react_1.default.createElement("b", null, "27017"))) },
|
|
156
|
+
react_1.default.createElement(Button_1.Button, { icon: 'select' }, "\u5E38\u7528\u7AEF\u53E3")));
|
|
157
|
+
});
|
|
158
|
+
(0, index_1.registerFormField)('_ip4', (props) => {
|
|
159
|
+
const { value, onChange, disabled } = props;
|
|
160
|
+
const [state, setState] = (0, hooks_1.useSetState)({
|
|
161
|
+
one: undefined,
|
|
162
|
+
two: undefined,
|
|
163
|
+
three: undefined,
|
|
164
|
+
four: undefined,
|
|
165
|
+
});
|
|
166
|
+
const setValue = (value) => {
|
|
167
|
+
let match = REG_IP4.exec(value);
|
|
168
|
+
if (match) {
|
|
169
|
+
setState({
|
|
170
|
+
one: parseInt(RegExp.$1),
|
|
171
|
+
two: parseInt(RegExp.$2),
|
|
172
|
+
three: parseInt(RegExp.$3),
|
|
173
|
+
four: parseInt(RegExp.$4)
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
const elOne = (0, react_1.useRef)(null);
|
|
178
|
+
const elTwo = (0, react_1.useRef)(null);
|
|
179
|
+
const elThree = (0, react_1.useRef)(null);
|
|
180
|
+
const elFour = (0, react_1.useRef)(null);
|
|
181
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
182
|
+
if (value)
|
|
183
|
+
setValue(value);
|
|
184
|
+
}, []);
|
|
185
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
186
|
+
setValue(props.value);
|
|
187
|
+
}, [props.value]);
|
|
188
|
+
const update = () => {
|
|
189
|
+
const { one, two, three, four } = state;
|
|
190
|
+
if (one == null || two == null || three == null || four == null) {
|
|
191
|
+
if (props.value != '') {
|
|
192
|
+
onChange('');
|
|
193
|
+
}
|
|
194
|
+
;
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
onChange(`${one}.${two}.${three}.${four}`);
|
|
198
|
+
};
|
|
199
|
+
const one = (one) => {
|
|
200
|
+
if (typeof one == 'string' && lodash_1.default.endsWith(one, '.')) {
|
|
201
|
+
elTwo.current.focus();
|
|
202
|
+
//@ts-ignore
|
|
203
|
+
one = one.replace('.', '');
|
|
204
|
+
}
|
|
205
|
+
setState({ one }, () => {
|
|
206
|
+
update();
|
|
207
|
+
if (one > 100) {
|
|
208
|
+
elTwo.current.focus();
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
};
|
|
212
|
+
const two = (two) => {
|
|
213
|
+
if (typeof two == 'string' && lodash_1.default.endsWith(two, '.')) {
|
|
214
|
+
elThree.current.focus();
|
|
215
|
+
//@ts-ignore
|
|
216
|
+
two = two.replace('.', '');
|
|
217
|
+
}
|
|
218
|
+
setState({ two }, () => {
|
|
219
|
+
update();
|
|
220
|
+
if (two > 100) {
|
|
221
|
+
elThree.current.focus();
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
};
|
|
225
|
+
const three = (three) => {
|
|
226
|
+
if (typeof three == 'string' && lodash_1.default.endsWith(three, '.')) {
|
|
227
|
+
elFour.current.focus();
|
|
228
|
+
//@ts-ignore
|
|
229
|
+
three = three.replace('.', '');
|
|
230
|
+
}
|
|
231
|
+
setState({ three }, () => {
|
|
232
|
+
update();
|
|
233
|
+
if (three > 100) {
|
|
234
|
+
elFour.current.focus();
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
const four = (four) => {
|
|
239
|
+
if (typeof four == 'string' && lodash_1.default.endsWith(four, '.')) {
|
|
240
|
+
//@ts-ignore
|
|
241
|
+
four = four.replace('.', '');
|
|
242
|
+
elFour.current.blur();
|
|
243
|
+
}
|
|
244
|
+
setState({ four }, () => update());
|
|
245
|
+
};
|
|
246
|
+
const handle = (evt, number, el) => {
|
|
247
|
+
if (evt.key != 'Backspace') {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (number == null || number == '') {
|
|
251
|
+
el.focus();
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
const inputProps = { disabled, min: 0, max: 255 };
|
|
255
|
+
return react_1.default.createElement(antd_1.Input.Group, { className: 'i-ip' },
|
|
256
|
+
react_1.default.createElement(antd_1.InputNumber, Object.assign({}, inputProps, {
|
|
257
|
+
// ref={elOne}
|
|
258
|
+
value: state.one, style: { width: 60, borderRightColor: 'transparent', borderTopRightRadius: 0, borderBottomRightRadius: 0 }, onChange: num => one(num) })),
|
|
259
|
+
react_1.default.createElement(antd_1.InputNumber, Object.assign({}, inputProps, {
|
|
260
|
+
// ref={elTwo}
|
|
261
|
+
value: state.two, style: { width: 60, borderLeftColor: 'transparent', borderRightColor: 'transparent', borderRadius: 0 }, onChange: num => two(num), onKeyDown: evt => handle(evt, two, elOne.current) })),
|
|
262
|
+
react_1.default.createElement(antd_1.InputNumber, Object.assign({}, inputProps, {
|
|
263
|
+
// ref={elThree}
|
|
264
|
+
value: state.three, style: { width: 60, borderLeftColor: 'transparent', borderRightColor: 'transparent', borderRadius: 0 }, onChange: num => three(num), onKeyDown: evt => handle(evt, three, elTwo.current) })),
|
|
265
|
+
react_1.default.createElement(antd_1.InputNumber, Object.assign({}, inputProps, {
|
|
266
|
+
// ref={elFour}
|
|
267
|
+
value: state.four, style: { width: 60, borderLeftColor: 'transparent', borderTopLeftRadius: 0, borderBottomLeftRadius: 0 }, onChange: num => four(num), onKeyDown: evt => handle(evt, four, elThree.current) })));
|
|
268
|
+
});
|
|
269
|
+
(0, index_1.registerFormField)('_url', props => {
|
|
270
|
+
const { value, disabled, onChange } = props;
|
|
271
|
+
let path = '';
|
|
272
|
+
let prefix = 'http://';
|
|
273
|
+
if (value && lodash_1.default.startsWith(value, 'https://')) {
|
|
274
|
+
prefix = 'https://';
|
|
275
|
+
}
|
|
276
|
+
if (lodash_1.default.startsWith(value, prefix)) {
|
|
277
|
+
path = value.substring(prefix.length);
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
path = value || '';
|
|
281
|
+
}
|
|
282
|
+
return react_1.default.createElement(antd_1.Input, { disabled: disabled, value: path, onChange: evt => onChange(prefix + evt.target.value), addonBefore: react_1.default.createElement(Select_1.Select, { style: { width: 90 }, value: prefix, onChange: fix => onChange(fix + path) },
|
|
283
|
+
react_1.default.createElement(Select_1.Select.Option, { value: "http://" }, "http://"),
|
|
284
|
+
react_1.default.createElement(Select_1.Select.Option, { value: "https://" }, "https://")) });
|
|
285
|
+
}, {
|
|
286
|
+
rules: {
|
|
287
|
+
validator: (rule, value, callback) => {
|
|
288
|
+
if (value == '') {
|
|
289
|
+
callback();
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
if (utils_1.StringUtil.isURL(value)) {
|
|
293
|
+
callback();
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
callback(utils_1.i18n.txt(Const_1.V.ERR_NOT_URL));
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// registerInputType('transfer', class extends UFormInput {
|
|
2
|
+
// render() {
|
|
3
|
+
// const { field, disabled, value } = this.props;
|
|
4
|
+
// let selectKey = [];
|
|
5
|
+
// if (value) {
|
|
6
|
+
// selectKey = value.split(',').map(item => item.trim())
|
|
7
|
+
// }
|
|
8
|
+
// let params: any = { disabled }
|
|
9
|
+
// if (field.rule && _.find(field.rule, { required: true })) {
|
|
10
|
+
// params.allowClear = false;
|
|
11
|
+
// }
|
|
12
|
+
// return <Transfer
|
|
13
|
+
// showSearch
|
|
14
|
+
// {...params}
|
|
15
|
+
// {...field.config}
|
|
16
|
+
// dataSource={this.getOptions().map(item => ({ title: item.label, key: item.value, description: item.label }))}
|
|
17
|
+
// filterOption={(inputValue, option) => option.title.indexOf(inputValue) > -1}
|
|
18
|
+
// targetKeys={selectKey}
|
|
19
|
+
// render={item => item.title}
|
|
20
|
+
// onChange={(val: any) => this.onChange(val.join(','))}
|
|
21
|
+
// />
|
|
22
|
+
// }
|
|
23
|
+
// }, {
|
|
24
|
+
// breakCol: true,
|
|
25
|
+
// show: MULTI_CHOOSE_SHOW,
|
|
26
|
+
// })
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
31
|
+
const antd_1 = require("antd");
|
|
32
|
+
const UFormModal_1 = require("../../UForm/UFormModal");
|
|
33
|
+
const _register_1 = require("../../../components/UForm/_register");
|
|
34
|
+
const utils_1 = require("../../../utils");
|
|
35
|
+
const TXT = utils_1.i18n.fastRegister({
|
|
36
|
+
MON: '周一', TUE: '周二', WED: '周三', THU: '周四', FRI: '周五', SAT: '周六', SUN: '周日',
|
|
37
|
+
TITLE: '周期设置', YEAR: '年', MONTH: '月', WEEK: '周', DAY: '日', TIME: '时间',
|
|
38
|
+
EVERY: '每', EVERY_DAY: '每天', EVERY_MONTH: '每月', EVERY_WEEK: '每周', EVERY_YEAR: '每年',
|
|
39
|
+
}, {
|
|
40
|
+
MON: 'Monday', TUE: 'Tuesday', WED: 'Wednesday', THU: 'Thursday', FRI: 'Friday', SAT: 'Saturday', SUN: 'Sunday',
|
|
41
|
+
TITLE: 'Circye Setting', YEAR: 'Year', MONTH: 'Month', WEEK: 'Week', DAY: 'Day', TIME: 'Time',
|
|
42
|
+
EVERY: 'Every', EVERY_DAY: 'EveryDay', EVERY_MONTH: 'EveryMonth', EVERY_WEEK: 'EveryWeek', EVERY_YEAR: 'EveryYear',
|
|
43
|
+
});
|
|
44
|
+
const WEEK = [
|
|
45
|
+
{ ik: TXT.SUN, value: 'sun', idx: 0 },
|
|
46
|
+
{ ik: TXT.MON, value: 'mon', idx: 1 },
|
|
47
|
+
{ ik: TXT.TUE, value: 'tue', idx: 2 },
|
|
48
|
+
{ ik: TXT.WED, value: 'wed', idx: 3 },
|
|
49
|
+
{ ik: TXT.THU, value: 'thu', idx: 4 },
|
|
50
|
+
{ ik: TXT.FRI, value: 'fri', idx: 5 },
|
|
51
|
+
{ ik: TXT.SAT, value: 'sat', idx: 6 },
|
|
52
|
+
];
|
|
53
|
+
const WeekMap = new Map();
|
|
54
|
+
WEEK.map(item => {
|
|
55
|
+
WeekMap.set(item.idx, item);
|
|
56
|
+
WeekMap.set(item.value, item);
|
|
57
|
+
WeekMap.set(item.idx + '', item);
|
|
58
|
+
});
|
|
59
|
+
const getWeek = (str) => {
|
|
60
|
+
if (!WeekMap.has(str))
|
|
61
|
+
return 'sun';
|
|
62
|
+
return WeekMap.get(str).value;
|
|
63
|
+
};
|
|
64
|
+
const parseCrontab = (str) => {
|
|
65
|
+
var crontab = {
|
|
66
|
+
_type: 'day',
|
|
67
|
+
_month: undefined,
|
|
68
|
+
_week: undefined,
|
|
69
|
+
_day: undefined,
|
|
70
|
+
_time: undefined,
|
|
71
|
+
};
|
|
72
|
+
const arr = lodash_1.default.trim(str).split(/\s+/);
|
|
73
|
+
if (arr.length >= 6) {
|
|
74
|
+
crontab._time = `${arr[2].length == 1 ? ('0' + arr[2]) : arr[2]}:${arr[1].length == 1 ? ('0' + arr[1]) : arr[1]}:${arr[0].length == 1 ? ('0' + arr[0]) : arr[0]}`;
|
|
75
|
+
crontab._day = (arr[3] == '*' || arr[3] == '?') ? undefined : arr[3];
|
|
76
|
+
crontab._month = (arr[4] == '*' || arr[4] == '?') ? undefined : arr[4];
|
|
77
|
+
crontab._week = (arr[5] == '*' || arr[5] == '?') ? undefined : getWeek(arr[5]);
|
|
78
|
+
}
|
|
79
|
+
if (crontab._month) {
|
|
80
|
+
crontab._type = 'year';
|
|
81
|
+
}
|
|
82
|
+
else if (crontab._week) {
|
|
83
|
+
crontab._type = 'week';
|
|
84
|
+
}
|
|
85
|
+
else if (crontab._day) {
|
|
86
|
+
crontab._type = 'month';
|
|
87
|
+
}
|
|
88
|
+
return crontab;
|
|
89
|
+
};
|
|
90
|
+
const crontab = (data) => {
|
|
91
|
+
const { _month, _week, _day, _time, _type } = data;
|
|
92
|
+
var [day, month, week] = ['*', '*', '?'];
|
|
93
|
+
const times = lodash_1.default.trim(_time).split(':');
|
|
94
|
+
var [second, minute, hour] = [parseInt(times[2]), parseInt(times[1]), parseInt(times[0])];
|
|
95
|
+
switch (_type) {
|
|
96
|
+
case 'day':
|
|
97
|
+
break;
|
|
98
|
+
case 'month':
|
|
99
|
+
day = _day;
|
|
100
|
+
break;
|
|
101
|
+
case 'year':
|
|
102
|
+
day = _day;
|
|
103
|
+
month = _month;
|
|
104
|
+
break;
|
|
105
|
+
case 'week':
|
|
106
|
+
day = '?';
|
|
107
|
+
week = getWeek(_week);
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
return [second, minute, hour, day, month, week].join(' ');
|
|
111
|
+
};
|
|
112
|
+
const crontabStr = (data) => {
|
|
113
|
+
const { _month, _week, _day, _time, _type } = data;
|
|
114
|
+
switch (_type) {
|
|
115
|
+
case 'day':
|
|
116
|
+
return utils_1.i18n.txt(TXT.EVERY_DAY) + ' ' + _time;
|
|
117
|
+
case 'month':
|
|
118
|
+
return utils_1.i18n.txt(TXT.EVERY_MONTH) + ' ' + (parseInt(_day)) + utils_1.i18n.txt(TXT.DAY) + ' ' + _time;
|
|
119
|
+
case 'year':
|
|
120
|
+
return utils_1.i18n.txt(TXT.EVERY_YEAR) + ' ' + (parseInt(_month)) + utils_1.i18n.txt(TXT.MONTH) + (parseInt(_day)) + utils_1.i18n.txt(TXT.DAY) + ' ' + _time;
|
|
121
|
+
case 'week':
|
|
122
|
+
return utils_1.i18n.txt(TXT.EVERY) + utils_1.i18n.txt((WeekMap.get(_week).ik)) + ' ' + _time;
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
(0, _register_1.registerFormField)('crontab', (props) => {
|
|
126
|
+
const { value, field, form, disabled } = props;
|
|
127
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
128
|
+
const dayOptions = Array.from({ length: 31 }).map((d, i) => ({ label: `${(i + 1)}号`, value: `${(i + 1)}` }));
|
|
129
|
+
const weekOptions = WEEK.map(item => ({ label: utils_1.i18n.txt(item.ik), value: item.value }));
|
|
130
|
+
const monthOptions = Array.from({ length: 12 }).map((d, i) => ({ label: `${i + 1}月`, value: `${(i + 1)}` }));
|
|
131
|
+
var cron = {
|
|
132
|
+
_type: 'day',
|
|
133
|
+
_month: undefined,
|
|
134
|
+
_week: undefined,
|
|
135
|
+
_day: undefined,
|
|
136
|
+
_time: undefined,
|
|
137
|
+
};
|
|
138
|
+
let btn = utils_1.i18n.txt(TXT.TITLE);
|
|
139
|
+
if (value) {
|
|
140
|
+
cron = parseCrontab(value);
|
|
141
|
+
btn = crontabStr(cron);
|
|
142
|
+
}
|
|
143
|
+
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
144
|
+
react_1.default.createElement(antd_1.Button, { style: { marginRight: 10 }, disabled: disabled, onClick: () => setOpen(true) }, btn),
|
|
145
|
+
react_1.default.createElement(UFormModal_1.UFormModal, { title: utils_1.i18n.txt(TXT.TITLE), width: 560, open: open, data: cron, fields: [
|
|
146
|
+
{
|
|
147
|
+
title: '周期',
|
|
148
|
+
field: '_type',
|
|
149
|
+
type: 'radio',
|
|
150
|
+
rules: [{ required: true, }],
|
|
151
|
+
options: [
|
|
152
|
+
{ label: utils_1.i18n.txt(TXT.EVERY_DAY), value: 'day' },
|
|
153
|
+
{ label: utils_1.i18n.txt(TXT.EVERY_WEEK), value: 'week' },
|
|
154
|
+
{ label: utils_1.i18n.txt(TXT.EVERY_MONTH), value: 'month' },
|
|
155
|
+
{ label: utils_1.i18n.txt(TXT.EVERY_YEAR), value: 'year' }
|
|
156
|
+
],
|
|
157
|
+
link: [
|
|
158
|
+
{
|
|
159
|
+
field: '_month', call: (txt) => {
|
|
160
|
+
if (txt == 'year') {
|
|
161
|
+
return { show: true, required: true };
|
|
162
|
+
}
|
|
163
|
+
return { show: false, required: false };
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
field: '_week', call: (txt) => {
|
|
168
|
+
if (txt == 'week') {
|
|
169
|
+
return { show: true, required: true };
|
|
170
|
+
}
|
|
171
|
+
return { show: false, required: false };
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
field: '_day', call: (txt) => {
|
|
176
|
+
if (txt == 'year' || txt == 'month') {
|
|
177
|
+
return { show: true, required: true };
|
|
178
|
+
}
|
|
179
|
+
return { show: false, required: false };
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
{ title: '月', ik: TXT.MONTH, field: '_month', type: 'select', options: monthOptions, show: false },
|
|
185
|
+
{ title: '周', ik: TXT.WEEK, field: '_week', type: 'select', options: weekOptions, show: false },
|
|
186
|
+
{ title: '日', ik: TXT.DAY, field: '_day', type: 'select', options: dayOptions, show: false },
|
|
187
|
+
{ title: '时间', ik: TXT.TIME, field: '_time', type: 'time', rules: [{ required: true, message: '请填写时间', }] },
|
|
188
|
+
], onOk: (data) => {
|
|
189
|
+
var str = crontab(data);
|
|
190
|
+
setOpen(false);
|
|
191
|
+
props.onChange(str);
|
|
192
|
+
}, onCancel: () => setOpen(false) }));
|
|
193
|
+
}, {
|
|
194
|
+
render: (value) => {
|
|
195
|
+
if (value == null)
|
|
196
|
+
return '';
|
|
197
|
+
return crontabStr(parseCrontab(value));
|
|
198
|
+
}
|
|
199
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|