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,152 @@
|
|
|
1
|
+
// import React, { useEffect ,useCallback} from 'react';
|
|
2
|
+
// import _ from 'lodash';
|
|
3
|
+
// import { Ajax, CacheUtil, } from "../../utils";
|
|
4
|
+
// // import { message, Icon } from '../../components'
|
|
5
|
+
// import { useApi, useSetState } from '../../hooks';
|
|
6
|
+
// // import { API_PREFIX, SOURCE_TYPE } from '../../utils/Global'
|
|
7
|
+
// // import { } from 'react';
|
|
8
|
+
// // import { sourceTypeRender } from '../utils/Renders';
|
|
9
|
+
// const SOURCE_API = API_PREFIX + '/source'
|
|
10
|
+
// Ajax.SESSION(SOURCE_API);
|
|
11
|
+
// type UseDataSource = {
|
|
12
|
+
// sourceLoading: boolean;
|
|
13
|
+
// all: Source[],
|
|
14
|
+
// sourceMap: Map<number, Source>,
|
|
15
|
+
// // kafka: Source[],
|
|
16
|
+
// es: Source[],
|
|
17
|
+
// mysql: Source[],
|
|
18
|
+
// sourceOptions: BaseOption[],
|
|
19
|
+
// esOptions: BaseOption[],
|
|
20
|
+
// mysqlOptions: BaseOption[],
|
|
21
|
+
// status: Map<number, any>,
|
|
22
|
+
// sourceIdRender: (id: number) => React.ReactNode,
|
|
23
|
+
// query: (param) => void;
|
|
24
|
+
// add: (param) => void;
|
|
25
|
+
// update: (data) => void
|
|
26
|
+
// del: (data) => void;
|
|
27
|
+
// sync: (data) => void;
|
|
28
|
+
// }
|
|
29
|
+
// const DEFAULT = {
|
|
30
|
+
// sourceLoading: true,
|
|
31
|
+
// all: [],
|
|
32
|
+
// es: [],
|
|
33
|
+
// // kafka: [], // 输出 Kafka
|
|
34
|
+
// mysql: [],
|
|
35
|
+
// sourceOptions: [],
|
|
36
|
+
// esOptions: [],
|
|
37
|
+
// mysqlOptions: [],
|
|
38
|
+
// sourceMap: new Map(),
|
|
39
|
+
// status: new Map()
|
|
40
|
+
// }
|
|
41
|
+
// export const useSource = (): UseDataSource => {
|
|
42
|
+
// const model = useApi({
|
|
43
|
+
// api: SOURCE_API, aop: {
|
|
44
|
+
// afterAll: (action, isSuccess) => {
|
|
45
|
+
// if (isSuccess) {
|
|
46
|
+
// Ajax.CLEAR(SOURCE_API);
|
|
47
|
+
// }
|
|
48
|
+
// }
|
|
49
|
+
// }
|
|
50
|
+
// });
|
|
51
|
+
// const [{ sourceLoading, all, es, mysql, status, sourceOptions, esOptions, mysqlOptions, sourceMap }, setState] = useSetState(DEFAULT);
|
|
52
|
+
// const reflush = async () => {
|
|
53
|
+
// const resp = await Ajax.GET(SOURCE_API);
|
|
54
|
+
// const es = [];
|
|
55
|
+
// const mysql = [];
|
|
56
|
+
// const all = [];
|
|
57
|
+
// const sourceMap = new Map();
|
|
58
|
+
// if (resp.code == '0') {
|
|
59
|
+
// resp.data.map(item => {
|
|
60
|
+
// all.push(item);
|
|
61
|
+
// sourceMap.set(item.id, item);
|
|
62
|
+
// // console.log(item.topicName, item.topicAlias)
|
|
63
|
+
// // if (item.topicName) kafka.push(item)
|
|
64
|
+
// if (item.type == 1) {
|
|
65
|
+
// es.push(item);
|
|
66
|
+
// } else if (item.type == 2) {
|
|
67
|
+
// mysql.push(item);
|
|
68
|
+
// }
|
|
69
|
+
// })
|
|
70
|
+
// }
|
|
71
|
+
// const sourceOptions = [], esOptions = [], mysqlOptions = [];
|
|
72
|
+
// all.map(item => {
|
|
73
|
+
// let option: BaseOption = {
|
|
74
|
+
// value: item.id,
|
|
75
|
+
// label: <span className='source-select-option'>
|
|
76
|
+
// <span>{sourceTypeRender(item.type)} <b>{item.title}</b></span>
|
|
77
|
+
// <i>{item.name}</i>
|
|
78
|
+
// </span>
|
|
79
|
+
// }
|
|
80
|
+
// sourceOptions.push(option);
|
|
81
|
+
// if (item.type == SOURCE_TYPE.ELASTIC) {
|
|
82
|
+
// esOptions.push(option)
|
|
83
|
+
// } else if (item.type == SOURCE_TYPE.MYSQL) {
|
|
84
|
+
// mysqlOptions.push(option)
|
|
85
|
+
// }
|
|
86
|
+
// });
|
|
87
|
+
// setState({ sourceLoading: false, all, es, mysql, sourceOptions, sourceMap, esOptions, mysqlOptions });
|
|
88
|
+
// const status = new Map<number, any>();
|
|
89
|
+
// for (let item of all) {
|
|
90
|
+
// let url = API_PREFIX + '/source/monitor/' + item.id;
|
|
91
|
+
// Ajax.SESSION(url);
|
|
92
|
+
// const resp = await Ajax.GET(url);
|
|
93
|
+
// if (resp.code == '0' && resp.data != null) {
|
|
94
|
+
// status.set(item.id, resp.data);
|
|
95
|
+
// } else {
|
|
96
|
+
// // else if (resp.code == '999') {
|
|
97
|
+
// CacheUtil.set(url, { code: '0', data: null })
|
|
98
|
+
// // }
|
|
99
|
+
// status.set(item.id, null);
|
|
100
|
+
// }
|
|
101
|
+
// }
|
|
102
|
+
// setState({ status });
|
|
103
|
+
// }
|
|
104
|
+
// useEffect(() => { reflush(); }, [])
|
|
105
|
+
// const query = useCallback((param: any) => {
|
|
106
|
+
// let list = _.concat([], all);
|
|
107
|
+
// if (param.source_type) {
|
|
108
|
+
// list = _.filter(list, item => item.type == param.source_type);
|
|
109
|
+
// }
|
|
110
|
+
// if (param.title) {
|
|
111
|
+
// list = _.filter(list, item => item.title.indexOf(param.title) >= 0)
|
|
112
|
+
// }
|
|
113
|
+
// if (param.name) {
|
|
114
|
+
// list = _.filter(list, item => item.name.indexOf(param.name) >= 0)
|
|
115
|
+
// }
|
|
116
|
+
// setState({
|
|
117
|
+
// es: _.filter(list, item => item.type == SOURCE_TYPE.ELASTIC),
|
|
118
|
+
// mysql: _.filter(list, item => item.type == SOURCE_TYPE.MYSQL),
|
|
119
|
+
// })
|
|
120
|
+
// }, [all])
|
|
121
|
+
// const sourceIdRender = useCallback((idStr) => {
|
|
122
|
+
// try {
|
|
123
|
+
// let id = parseInt(idStr);
|
|
124
|
+
// if (!sourceMap.has(id)) {
|
|
125
|
+
// return '';
|
|
126
|
+
// }
|
|
127
|
+
// let source = sourceMap.get(id);
|
|
128
|
+
// let txt = source.title || source.name;
|
|
129
|
+
// if (source.icon) {
|
|
130
|
+
// return <span><Icon type={source.icon} style={{ marginRight: 8 }} /> {txt}</span >
|
|
131
|
+
// }
|
|
132
|
+
// return txt;
|
|
133
|
+
// } catch {
|
|
134
|
+
// return ''
|
|
135
|
+
// }
|
|
136
|
+
// }, [sourceMap])
|
|
137
|
+
// return {
|
|
138
|
+
// sourceLoading, all, es, mysql, sourceOptions, sourceMap, status, esOptions, mysqlOptions,
|
|
139
|
+
// add: model.add, query, update: model.update, del: model.del,
|
|
140
|
+
// sourceIdRender,
|
|
141
|
+
// sync: async (data) => {
|
|
142
|
+
// const { id, name, title } = data;
|
|
143
|
+
// const resp = await Ajax.GET(`${API_PREFIX}/source/field/sync/${id}`);
|
|
144
|
+
// if (resp.code != '0') {
|
|
145
|
+
// message.error(<span>数据源 <strong>{title}</strong>(<i>{name}</i>) 同步失败</span>)
|
|
146
|
+
// return;
|
|
147
|
+
// }
|
|
148
|
+
// message.success(<span>数据源 <strong>{title}</strong>(<i>{name}</i>) 同步成功 , 添加字段 <b>{resp.data}</b>个</span>)
|
|
149
|
+
// Ajax.CLEAR(`${API_PREFIX}/source/field/${id}`);
|
|
150
|
+
// }
|
|
151
|
+
// }
|
|
152
|
+
// }
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { EChartsOption } from 'echarts';
|
|
3
|
+
interface EchartProps {
|
|
4
|
+
/**
|
|
5
|
+
* class 属性
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Echart数据
|
|
10
|
+
*/
|
|
11
|
+
data: EChartsOption;
|
|
12
|
+
/**
|
|
13
|
+
* Echart点击事件 参考 https://echarts.apache.org/zh/api.html#events.%E9%BC%A0%E6%A0%87%E4%BA%8B%E4%BB%B6.click
|
|
14
|
+
*/
|
|
15
|
+
onClick?: Function;
|
|
16
|
+
/**
|
|
17
|
+
* Echart点击事件 参考 https://echarts.apache.org/zh/api.html#echartsInstance.on
|
|
18
|
+
*/
|
|
19
|
+
onClickType?: string | object;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 说明,echart 模块需要依赖 /js/echarts.min.js
|
|
23
|
+
* Echarts组件属性
|
|
24
|
+
*/
|
|
25
|
+
export declare const EChart: React.FC<EchartProps>;
|
|
26
|
+
export {};
|
package/deps/echarts.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.EChart = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const utils_1 = require("../utils");
|
|
29
|
+
const _Support_1 = require("../utils/_Support");
|
|
30
|
+
const echarts = (0, _Support_1.globalDefault)('echarts', { init: (...args) => ({}) });
|
|
31
|
+
/**
|
|
32
|
+
* 说明,echart 模块需要依赖 /js/echarts.min.js
|
|
33
|
+
* Echarts组件属性
|
|
34
|
+
*/
|
|
35
|
+
const EChart = props => {
|
|
36
|
+
const rootRef = (0, react_1.useRef)(null);
|
|
37
|
+
const graphRef = (0, react_1.useRef)(null);
|
|
38
|
+
const resizePid = (0, react_1.useRef)(null);
|
|
39
|
+
const resize = () => {
|
|
40
|
+
window.clearTimeout(resizePid.current);
|
|
41
|
+
resizePid.current = setTimeout(() => {
|
|
42
|
+
graphRef.current.resize();
|
|
43
|
+
}, 66);
|
|
44
|
+
};
|
|
45
|
+
(0, react_1.useEffect)(() => {
|
|
46
|
+
graphRef.current = echarts.init(rootRef.current);
|
|
47
|
+
if (props.onClick) {
|
|
48
|
+
if (props.onClickType) {
|
|
49
|
+
graphRef.current.on('click', props.onClickType, function (...args) {
|
|
50
|
+
props.onClick.call(this, ...args);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
graphRef.current.on('click', function (...args) {
|
|
55
|
+
props.onClick.call(this, ...args);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
window.addEventListener('resize', resize, false);
|
|
60
|
+
return () => {
|
|
61
|
+
window.removeEventListener('resize', resize);
|
|
62
|
+
};
|
|
63
|
+
}, []);
|
|
64
|
+
(0, react_1.useEffect)(() => {
|
|
65
|
+
if (graphRef.current == null)
|
|
66
|
+
return;
|
|
67
|
+
graphRef.current.setOption(props.data);
|
|
68
|
+
}, [props.data]);
|
|
69
|
+
return react_1.default.createElement("div", { ref: rootRef, className: utils_1.StringUtil.className(['_ev'], props.className) });
|
|
70
|
+
};
|
|
71
|
+
exports.EChart = EChart;
|
package/deps/editor.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CommandType } from './_editor/base/types';
|
|
3
|
+
/**
|
|
4
|
+
* 富文本框
|
|
5
|
+
*/
|
|
6
|
+
export type RichTextProps = {
|
|
7
|
+
/**
|
|
8
|
+
* 值,传JSON串
|
|
9
|
+
*/
|
|
10
|
+
value?: string;
|
|
11
|
+
/**
|
|
12
|
+
* 样式名称
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 指定高度
|
|
17
|
+
*/
|
|
18
|
+
height?: number;
|
|
19
|
+
};
|
|
20
|
+
export type EditorProps = RichTextProps & {
|
|
21
|
+
/**
|
|
22
|
+
* 微服务版本专用,用于声明图片/文件上传的 namespace 空间
|
|
23
|
+
*/
|
|
24
|
+
namespace?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 是否禁用
|
|
27
|
+
*/
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
toolbar?: 'full' | 'simple' | CommandType[][];
|
|
31
|
+
onChange: (string: any) => void;
|
|
32
|
+
};
|
|
33
|
+
export declare const Editor: React.FC<EditorProps>;
|
|
34
|
+
export declare const Article: React.FC<RichTextProps>;
|
package/deps/editor.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
exports.Article = exports.Editor = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
32
|
+
const slate_1 = require("slate");
|
|
33
|
+
const slate_react_1 = require("slate-react");
|
|
34
|
+
const slate_history_1 = require("slate-history");
|
|
35
|
+
const ToolBar_1 = require("./_editor/tools/ToolBar");
|
|
36
|
+
const Element_1 = require("./_editor/base/Element");
|
|
37
|
+
const Leaf_1 = require("./_editor/base/Leaf");
|
|
38
|
+
const Support_1 = require("./_editor/base/Support");
|
|
39
|
+
const utils_1 = require("../utils");
|
|
40
|
+
const FULL_TOOLS = [
|
|
41
|
+
[
|
|
42
|
+
'bold', 'italic', 'underline', 'strikethrough', null,
|
|
43
|
+
'color', 'bgColor', null,
|
|
44
|
+
'h1', 'h2', 'h3', 'h4', 'fontFamily', 'fontSize', null,
|
|
45
|
+
'link', 'code',
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
'left', 'center', 'right', 'justify', null,
|
|
49
|
+
'blockQuote', 'numberedList', 'bulletedList', null,
|
|
50
|
+
'hr', 'image', 'video', 'audio'
|
|
51
|
+
]
|
|
52
|
+
];
|
|
53
|
+
const SIMPLE_TOOLS = [
|
|
54
|
+
[
|
|
55
|
+
'left', 'center', 'right', 'justify', null,
|
|
56
|
+
'bold', 'italic', 'underline', 'strikethrough', 'color', 'bgColor', null,
|
|
57
|
+
'h1', 'h2', null,
|
|
58
|
+
'link', 'fontSize', null,
|
|
59
|
+
'hr', 'image'
|
|
60
|
+
],
|
|
61
|
+
];
|
|
62
|
+
let pid = null;
|
|
63
|
+
const Editor = props => {
|
|
64
|
+
const renderElement = props => react_1.default.createElement(Element_1.Element, Object.assign({}, props, { isEditor: true }));
|
|
65
|
+
const renderLeaf = props => react_1.default.createElement(Leaf_1.Leaf, Object.assign({}, props));
|
|
66
|
+
const editor = (0, react_1.useMemo)(() => (0, slate_history_1.withHistory)((0, slate_react_1.withReact)((0, slate_1.createEditor)())), []);
|
|
67
|
+
var value = [];
|
|
68
|
+
if (props.value) {
|
|
69
|
+
try {
|
|
70
|
+
value = JSON.parse(props.value);
|
|
71
|
+
}
|
|
72
|
+
catch (_a) { }
|
|
73
|
+
}
|
|
74
|
+
let toolbar = SIMPLE_TOOLS;
|
|
75
|
+
if (props.toolbar) {
|
|
76
|
+
if (lodash_1.default.isArray(props.toolbar)) {
|
|
77
|
+
toolbar = props.toolbar;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
if (props.toolbar == 'full') {
|
|
81
|
+
toolbar = FULL_TOOLS;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return react_1.default.createElement("div", { className: utils_1.StringUtil.className(['v-richtext v-richtext-editor', props.className]), style: { height: props.height } },
|
|
86
|
+
react_1.default.createElement(slate_react_1.Slate, { editor: editor, initialValue: value, onChange: value => {
|
|
87
|
+
const isAstChange = editor.operations.some(op => 'set_selection' !== op.type);
|
|
88
|
+
if (isAstChange) {
|
|
89
|
+
clearTimeout(pid);
|
|
90
|
+
// 性能优化
|
|
91
|
+
pid = setTimeout(() => props.onChange(JSON.stringify(value)), 250);
|
|
92
|
+
}
|
|
93
|
+
} },
|
|
94
|
+
react_1.default.createElement(ToolBar_1.Toolbar, { buttons: toolbar, disabled: props.disabled }),
|
|
95
|
+
react_1.default.createElement(slate_react_1.Editable, { readOnly: props.disabled, renderElement: renderElement, renderLeaf: renderLeaf, placeholder: props.placeholder, disabled: props.disabled, className: 'editor-content' })));
|
|
96
|
+
};
|
|
97
|
+
exports.Editor = Editor;
|
|
98
|
+
const Article = props => {
|
|
99
|
+
const renderElement = props => react_1.default.createElement(Element_1.Element, Object.assign({}, props, { isEditor: false }));
|
|
100
|
+
const renderLeaf = props => react_1.default.createElement(Leaf_1.Leaf, Object.assign({}, props));
|
|
101
|
+
const editor = (0, Support_1.supportVoid)((0, slate_react_1.withReact)((0, slate_1.createEditor)()));
|
|
102
|
+
var value = [];
|
|
103
|
+
try {
|
|
104
|
+
value = JSON.parse(props.value || '[]');
|
|
105
|
+
}
|
|
106
|
+
catch (_a) { }
|
|
107
|
+
return react_1.default.createElement("div", { className: utils_1.StringUtil.className(['v-richtext v-richtext-viewer', props.className]), style: { height: props.height } },
|
|
108
|
+
react_1.default.createElement(slate_react_1.Slate, { editor: editor, initialValue: value },
|
|
109
|
+
react_1.default.createElement(slate_react_1.Editable, { readOnly: true, disabled: true, renderElement: renderElement, renderLeaf: renderLeaf, className: 'editor-content' })));
|
|
110
|
+
};
|
|
111
|
+
exports.Article = Article;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const components_1 = require("../components");
|
|
8
|
+
const editor_1 = require("./editor");
|
|
9
|
+
(0, components_1.registerFormField)('editor', props => {
|
|
10
|
+
const { disabled, value, onChange, field } = props;
|
|
11
|
+
return react_1.default.createElement(editor_1.Editor, Object.assign({ placeholder: (0, components_1.getPlaceholder)(field) }, field.config, { value: value, disabled: disabled, onChange: (val) => onChange(val) }));
|
|
12
|
+
}, {
|
|
13
|
+
breakCol: true,
|
|
14
|
+
render: (value) => react_1.default.createElement(editor_1.Article, { value: value })
|
|
15
|
+
});
|
package/hooks/_list.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { Key, PlainObject } from '../basetype';
|
|
2
|
+
/**
|
|
3
|
+
* 列表通用模型
|
|
4
|
+
*/
|
|
5
|
+
type ListBase = {
|
|
6
|
+
/**
|
|
7
|
+
* rowkey
|
|
8
|
+
*/
|
|
9
|
+
rowKey: string;
|
|
10
|
+
/**
|
|
11
|
+
* 列表
|
|
12
|
+
*/
|
|
13
|
+
list: PlainObject[];
|
|
14
|
+
};
|
|
15
|
+
type ListQuery = {
|
|
16
|
+
isQuerying: boolean;
|
|
17
|
+
cost?: number;
|
|
18
|
+
pageNo: number;
|
|
19
|
+
pageSize: number;
|
|
20
|
+
total: number;
|
|
21
|
+
totalAcc: number;
|
|
22
|
+
param: PlainObject;
|
|
23
|
+
query: (param: PlainObject, clean?: boolean) => void;
|
|
24
|
+
pageTo: (pageNo: number, pageSize: number) => void;
|
|
25
|
+
orderBy: (order: string, by: 'asc' | 'desc') => void;
|
|
26
|
+
};
|
|
27
|
+
export type ListAction = {
|
|
28
|
+
effect: Key;
|
|
29
|
+
add: (obj: PlainObject) => Promise<PlainObject>;
|
|
30
|
+
update: (obj: PlainObject) => Promise<PlainObject>;
|
|
31
|
+
del: (obj: PlainObject | PlainObject[] | Key | Key[]) => Promise<PlainObject>;
|
|
32
|
+
doLoad: (obj: any) => void;
|
|
33
|
+
doAdd: (obj: PlainObject) => void;
|
|
34
|
+
doUpdate: (obj: PlainObject) => void;
|
|
35
|
+
doDelete: (obj: PlainObject | PlainObject[] | Key | Key[]) => void;
|
|
36
|
+
};
|
|
37
|
+
type WithRequired<T, K extends keyof T> = T & {
|
|
38
|
+
[P in K]-?: T[P];
|
|
39
|
+
};
|
|
40
|
+
type _ListInit = {
|
|
41
|
+
/**
|
|
42
|
+
* rowkey,默认为ID
|
|
43
|
+
*/
|
|
44
|
+
rowKey?: string;
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* 通过一个API,初始化列表模型
|
|
48
|
+
*
|
|
49
|
+
* api 与 list 必传一项
|
|
50
|
+
*
|
|
51
|
+
* 说明:
|
|
52
|
+
* 1. 在不传 param 时:
|
|
53
|
+
* 模型初始化时会调用 GET({api})
|
|
54
|
+
* 2. 在传了 param 时 即便 param 为空的 如 {} :
|
|
55
|
+
* 模型初始化时会调用 POST({api},{param} )
|
|
56
|
+
* 3. 自动解析返回体里面的 list/data参数,优先取到数组结构则返回
|
|
57
|
+
*/
|
|
58
|
+
api?: string;
|
|
59
|
+
/**
|
|
60
|
+
* 调用API的参数,传此参数后,请求API方法变为 POST
|
|
61
|
+
*/
|
|
62
|
+
param?: PlainObject;
|
|
63
|
+
/**
|
|
64
|
+
* 通过一个数组,初始化列表模型
|
|
65
|
+
* api 与 list 必传一项
|
|
66
|
+
*/
|
|
67
|
+
list?: PlainObject[];
|
|
68
|
+
};
|
|
69
|
+
export type ListInit = WithRequired<_ListInit, 'api'> | WithRequired<_ListInit, 'list'>;
|
|
70
|
+
export type ListModel = ListBase & ListQuery;
|
|
71
|
+
export type ApiModel = ListModel & ListAction;
|
|
72
|
+
export type StaticListState = ListModel & {
|
|
73
|
+
mode: 'static';
|
|
74
|
+
setList: (list: any[]) => void;
|
|
75
|
+
};
|
|
76
|
+
export type ApiListState = ApiModel & {
|
|
77
|
+
mode: 'api';
|
|
78
|
+
/**
|
|
79
|
+
* ALL 方法需要有满足规范的 GET API 才可以调用
|
|
80
|
+
*/
|
|
81
|
+
all?: (status?: boolean) => Promise<PlainObject[]>;
|
|
82
|
+
};
|
|
83
|
+
export type SouteListState = ListModel & {
|
|
84
|
+
mode: 'source';
|
|
85
|
+
};
|
|
86
|
+
export declare const DEFAULT_STATE: ListBase & Partial<ListQuery>;
|
|
87
|
+
export {};
|
package/hooks/_list.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_STATE = void 0;
|
|
4
|
+
exports.DEFAULT_STATE = {
|
|
5
|
+
rowKey: 'id',
|
|
6
|
+
list: [],
|
|
7
|
+
isQuerying: false,
|
|
8
|
+
pageNo: 1,
|
|
9
|
+
pageSize: 15,
|
|
10
|
+
total: 0,
|
|
11
|
+
totalAcc: 0,
|
|
12
|
+
param: {},
|
|
13
|
+
};
|
package/hooks/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { useApp } from './useApp';
|
|
2
|
+
export { useApi } from './useApi';
|
|
3
|
+
export { useArray } from './useArray';
|
|
4
|
+
export { useSetState } from './useSetState';
|
|
5
|
+
export { useDoLoad } from './useDoLoad';
|
|
6
|
+
export { useGlobal } from './useGlobal';
|
|
7
|
+
export { useModals } from './useModals';
|
|
8
|
+
export { useEffectFunction } from './useEffectFunction';
|
|
9
|
+
export { useAjaxQuery } from './useAjaxQuery';
|
|
10
|
+
export { useAjaxAction } from './useAjaxAction';
|
|
11
|
+
export { useOpenState } from './useOpenState';
|
|
12
|
+
export { useFirstMountState } from './useFirstMountState';
|
|
13
|
+
export { useToggle } from './useToggle';
|
|
14
|
+
export { useUpdate } from './useUpdate';
|
package/hooks/index.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useUpdate = exports.useToggle = exports.useFirstMountState = exports.useOpenState = exports.useAjaxAction = exports.useAjaxQuery = exports.useEffectFunction = exports.useModals = exports.useGlobal = exports.useDoLoad = exports.useSetState = exports.useArray = exports.useApi = exports.useApp = void 0;
|
|
4
|
+
// export type { GlobalApp } from './useApp';
|
|
5
|
+
var useApp_1 = require("./useApp");
|
|
6
|
+
Object.defineProperty(exports, "useApp", { enumerable: true, get: function () { return useApp_1.useApp; } });
|
|
7
|
+
var useApi_1 = require("./useApi");
|
|
8
|
+
Object.defineProperty(exports, "useApi", { enumerable: true, get: function () { return useApi_1.useApi; } });
|
|
9
|
+
var useArray_1 = require("./useArray");
|
|
10
|
+
Object.defineProperty(exports, "useArray", { enumerable: true, get: function () { return useArray_1.useArray; } });
|
|
11
|
+
var useSetState_1 = require("./useSetState");
|
|
12
|
+
Object.defineProperty(exports, "useSetState", { enumerable: true, get: function () { return useSetState_1.useSetState; } });
|
|
13
|
+
var useDoLoad_1 = require("./useDoLoad");
|
|
14
|
+
Object.defineProperty(exports, "useDoLoad", { enumerable: true, get: function () { return useDoLoad_1.useDoLoad; } });
|
|
15
|
+
var useGlobal_1 = require("./useGlobal");
|
|
16
|
+
Object.defineProperty(exports, "useGlobal", { enumerable: true, get: function () { return useGlobal_1.useGlobal; } });
|
|
17
|
+
var useModals_1 = require("./useModals");
|
|
18
|
+
Object.defineProperty(exports, "useModals", { enumerable: true, get: function () { return useModals_1.useModals; } });
|
|
19
|
+
var useEffectFunction_1 = require("./useEffectFunction");
|
|
20
|
+
Object.defineProperty(exports, "useEffectFunction", { enumerable: true, get: function () { return useEffectFunction_1.useEffectFunction; } });
|
|
21
|
+
// export { useMemoPromise } from './useMemoPromise';
|
|
22
|
+
var useAjaxQuery_1 = require("./useAjaxQuery");
|
|
23
|
+
Object.defineProperty(exports, "useAjaxQuery", { enumerable: true, get: function () { return useAjaxQuery_1.useAjaxQuery; } });
|
|
24
|
+
var useAjaxAction_1 = require("./useAjaxAction");
|
|
25
|
+
Object.defineProperty(exports, "useAjaxAction", { enumerable: true, get: function () { return useAjaxAction_1.useAjaxAction; } });
|
|
26
|
+
var useOpenState_1 = require("./useOpenState");
|
|
27
|
+
Object.defineProperty(exports, "useOpenState", { enumerable: true, get: function () { return useOpenState_1.useOpenState; } });
|
|
28
|
+
// 说明,没有什么实际作用的HOOK
|
|
29
|
+
// export { useCounter } from './useCounter';
|
|
30
|
+
// export { useDefault } from './useDefault'
|
|
31
|
+
// export { useEffectOnce } from './useEffectOnce';
|
|
32
|
+
// export { useError } from './useError';
|
|
33
|
+
var useFirstMountState_1 = require("./useFirstMountState");
|
|
34
|
+
Object.defineProperty(exports, "useFirstMountState", { enumerable: true, get: function () { return useFirstMountState_1.useFirstMountState; } });
|
|
35
|
+
// export { useGetSet } from './useGetSet';
|
|
36
|
+
// export { useHover } from './useHover';
|
|
37
|
+
// export { useMountedState } from './useMountedState';
|
|
38
|
+
// export { usePromise } from './usePromise';
|
|
39
|
+
// export { useQueue } from './useQueue';
|
|
40
|
+
// export { useStateList } from './useStateList';
|
|
41
|
+
var useToggle_1 = require("./useToggle");
|
|
42
|
+
Object.defineProperty(exports, "useToggle", { enumerable: true, get: function () { return useToggle_1.useToggle; } });
|
|
43
|
+
// export { useUnmountPromise } from './useUnmountPromise'
|
|
44
|
+
var useUpdate_1 = require("./useUpdate");
|
|
45
|
+
Object.defineProperty(exports, "useUpdate", { enumerable: true, get: function () { return useUpdate_1.useUpdate; } });
|
|
46
|
+
// export { useUpdateEffect } from './useUpdateEffect';
|
|
47
|
+
// 说明: 主要从以下两个库中提取常用hooks 集成至VAP
|
|
48
|
+
// https://github.com/streamich/react-use
|
|
49
|
+
// https://ahooks.js.org/hooks/use-request/index
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { PlainObject } from '../basetype';
|
|
2
|
+
import type { AjaxOptions } from '../utils/Ajax';
|
|
3
|
+
export type AjaxHookOptions = AjaxOptions & {
|
|
4
|
+
autoFecth?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const usePromise: (...promises: Promise<PlainObject>[]) => void;
|
|
7
|
+
export declare const useFetch: (...promises: Promise<PlainObject>[]) => void;
|
|
8
|
+
export declare const useGet: (url: string, options?: AjaxOptions) => {
|
|
9
|
+
loading: boolean;
|
|
10
|
+
result: any;
|
|
11
|
+
};
|
|
12
|
+
export declare const usePost: (url: string, param: PlainObject, options?: AjaxOptions) => void;
|
|
13
|
+
export declare const usePatch: (url: string, param: PlainObject, options?: AjaxOptions) => void;
|
|
14
|
+
export declare const useDelete: (url: string, param: PlainObject, options?: AjaxOptions) => void;
|
package/hooks/useAjax.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDelete = exports.usePatch = exports.usePost = exports.useGet = exports.useFetch = exports.usePromise = void 0;
|
|
4
|
+
const Ajax_1 = require("../utils/Ajax");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const usePromise = (...promises) => {
|
|
7
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
8
|
+
Promise.all(promises).then(response => {
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
exports.usePromise = usePromise;
|
|
12
|
+
const useFetch = (...promises) => {
|
|
13
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
14
|
+
Promise.all(promises).then(response => {
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
exports.useFetch = useFetch;
|
|
18
|
+
const useGet = (url, options) => {
|
|
19
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
20
|
+
const [result, setResult] = (0, react_1.useState)(null);
|
|
21
|
+
const reflush = () => {
|
|
22
|
+
(0, Ajax_1.GET)(url).then(response => {
|
|
23
|
+
setResult(response);
|
|
24
|
+
setLoading(false);
|
|
25
|
+
}).catch(err => {
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
// reflush();
|
|
29
|
+
return {
|
|
30
|
+
loading,
|
|
31
|
+
result,
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
exports.useGet = useGet;
|
|
35
|
+
const usePost = (url, param, options) => {
|
|
36
|
+
};
|
|
37
|
+
exports.usePost = usePost;
|
|
38
|
+
const usePatch = (url, param, options) => {
|
|
39
|
+
};
|
|
40
|
+
exports.usePatch = usePatch;
|
|
41
|
+
const useDelete = (url, param, options) => {
|
|
42
|
+
};
|
|
43
|
+
exports.useDelete = useDelete;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PlainObject } from '../basetype';
|
|
2
|
+
type HanderAction = (data: PlainObject) => Promise<any>;
|
|
3
|
+
type UseAjaxActionOptions = {
|
|
4
|
+
fn: (data: PlainObject) => Promise<any>;
|
|
5
|
+
hander?: (response: any, param?: any) => any;
|
|
6
|
+
defaultParam?: PlainObject;
|
|
7
|
+
};
|
|
8
|
+
type UseAjaxAction = (options: HanderAction | UseAjaxActionOptions) => ((data: any) => void);
|
|
9
|
+
/**
|
|
10
|
+
* 封装一个Ajax接口调用操作
|
|
11
|
+
*/
|
|
12
|
+
export declare const useAjaxAction: UseAjaxAction;
|
|
13
|
+
export {};
|