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,140 @@
|
|
|
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.UploadModal = void 0;
|
|
39
|
+
const react_1 = __importStar(require("react"));
|
|
40
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
41
|
+
const Modal_1 = require("../../components/_adapt/Modal");
|
|
42
|
+
const utils_1 = require("../../utils");
|
|
43
|
+
const antd_1 = require("antd");
|
|
44
|
+
const Alert_1 = require("../_adapt/Alert");
|
|
45
|
+
const Button_1 = require("../_adapt/Button");
|
|
46
|
+
const useUpload_1 = require("./useUpload");
|
|
47
|
+
const Const_1 = require("../../components/_setup/Const");
|
|
48
|
+
const DEFAULT = { uploading: false, uploaded: false, percent: 0, error: false, };
|
|
49
|
+
const UploadModal = props => {
|
|
50
|
+
const [state, setState] = (0, react_1.useState)(DEFAULT);
|
|
51
|
+
const onChange = (info) => __awaiter(void 0, void 0, void 0, function* () {
|
|
52
|
+
if (lodash_1.default.isEmpty(info.file))
|
|
53
|
+
return;
|
|
54
|
+
if (info.file.status === 'uploading') {
|
|
55
|
+
setState({ uploading: true, uploaded: false, error: false, name: info.file.name, percent: Math.floor(info.file.percent), });
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (info.file.status === 'error') {
|
|
59
|
+
let errMsg;
|
|
60
|
+
if (info.file.response && info.file.response.message)
|
|
61
|
+
errMsg = info.file.response.message;
|
|
62
|
+
else
|
|
63
|
+
errMsg = utils_1.i18n.txt(Const_1.V.UPLOAD_ERROR);
|
|
64
|
+
setState({ uploading: false, uploaded: false, error: true, percent: 0, errMsg, });
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (info.file.status == 'removed')
|
|
68
|
+
return;
|
|
69
|
+
const uploadResponse = info.file.response;
|
|
70
|
+
let success = false;
|
|
71
|
+
let errMsg = null;
|
|
72
|
+
if (props.onChange) {
|
|
73
|
+
let uploadResult = props.onChange(uploadResponse);
|
|
74
|
+
if (lodash_1.default.isBoolean(uploadResult)) {
|
|
75
|
+
success = uploadResult;
|
|
76
|
+
if (!success)
|
|
77
|
+
errMsg = utils_1.i18n.txt(Const_1.V.UPLOAD_ERROR_FILE, info.file.name);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
success = uploadResult.ok;
|
|
81
|
+
errMsg = uploadResult.message;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
success = info.file.response.code == '0';
|
|
86
|
+
if (!success)
|
|
87
|
+
if (!success)
|
|
88
|
+
errMsg = info.file.response.message || utils_1.i18n.txt(Const_1.V.UPLOAD_ERROR_FILE, info.file.name);
|
|
89
|
+
}
|
|
90
|
+
if (!success) {
|
|
91
|
+
setState({ uploading: false, uploaded: false, error: true, percent: 0, errMsg, });
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
let resp = props.onResult(info.file.response);
|
|
95
|
+
let importResult = null;
|
|
96
|
+
if (resp && resp instanceof Promise)
|
|
97
|
+
importResult = yield resp;
|
|
98
|
+
else
|
|
99
|
+
importResult = resp;
|
|
100
|
+
if (lodash_1.default.isBoolean(importResult)) {
|
|
101
|
+
if (importResult) {
|
|
102
|
+
setState({ uploading: false, uploaded: true, error: false, name: info.file.name, percent: 0, sucMsg: utils_1.i18n.txt(Const_1.V.UPLOAD_SUCCESS_IMPORT) });
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
setState({ uploading: false, uploaded: false, error: true, name: info.file.name, percent: 0, errMsg: utils_1.i18n.txt(Const_1.V.UPLOAD_ERROR_IMPORT) });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
if (importResult.ok) {
|
|
110
|
+
setState({ uploading: false, uploaded: true, error: false, name: info.file.name, percent: 0, sucMsg: importResult.message });
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
setState({ uploading: false, uploaded: false, error: true, name: info.file.name, percent: 0, errMsg: importResult.message });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
const { error, uploaded } = state;
|
|
118
|
+
const footer = () => {
|
|
119
|
+
const uploadProps = (0, useUpload_1.getBaseOptions)(props);
|
|
120
|
+
if (uploadProps.accept == null)
|
|
121
|
+
uploadProps.accept = 'application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
|
122
|
+
if (state.uploading) {
|
|
123
|
+
uploadProps.disabled = true;
|
|
124
|
+
uploadProps.className = 'c-upload-file c-upload-file-p' + state.percent;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
uploadProps.className = 'c-upload-file';
|
|
128
|
+
}
|
|
129
|
+
;
|
|
130
|
+
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
131
|
+
react_1.default.createElement(antd_1.Upload, Object.assign({}, uploadProps, { onChange: onChange }),
|
|
132
|
+
react_1.default.createElement(Button_1.Button, { loading: state.uploading, disabled: state.uploading, icon: "upload" }, utils_1.i18n.txt(Const_1.V.UPLOAD_FILE))),
|
|
133
|
+
react_1.default.createElement(Button_1.Button, { onClick: () => props.onCancel() }, utils_1.i18n.ant('Modal.cancelText')));
|
|
134
|
+
};
|
|
135
|
+
return react_1.default.createElement(Modal_1.Modal, Object.assign({ width: 640 }, props, { title: utils_1.i18n.getText(props.ik, props.title, Const_1.V.UPLOAD_MODAL_TITLE), className: "c-upload-modal", afterClose: () => setState(DEFAULT), footer: uploaded ? react_1.default.createElement(Button_1.Button, { type: 'primary', onClick: () => props.onOk ? props.onOk(null) : props.onCancel() }, utils_1.i18n.ant('Modal.okText')) : footer() }),
|
|
136
|
+
props.tip ? props.tip : react_1.default.createElement(Alert_1.Alert, { message: react_1.default.createElement("p", null, utils_1.i18n.txt(Const_1.V.UPLOAD_MODAL_TIP)), type: "info" }),
|
|
137
|
+
error && react_1.default.createElement(Alert_1.Alert, { type: "error", message: state.errMsg }),
|
|
138
|
+
uploaded && react_1.default.createElement(Alert_1.Alert, { type: "success", message: state.sucMsg }));
|
|
139
|
+
};
|
|
140
|
+
exports.UploadModal = UploadModal;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { PlainObject } from "../../basetype";
|
|
2
|
+
import type { UploadFile } from 'antd/es/upload/interface';
|
|
3
|
+
export type BaseUploadProps = {
|
|
4
|
+
/**
|
|
5
|
+
* 是否禁用
|
|
6
|
+
*/
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* 上传接口,上传接口地址,默认是标准接口,即 '/api-common/file/upload'
|
|
10
|
+
*/
|
|
11
|
+
api?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 最大大小,单位为 byte
|
|
14
|
+
* 如 1 = 1b
|
|
15
|
+
* 1024 = 1kb
|
|
16
|
+
* 1024x1024 = 1mb
|
|
17
|
+
* 1024x1024x1024 = 1gb
|
|
18
|
+
* 说明:默认:文件100mb , 图片 10mb
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
maxSize?: number;
|
|
22
|
+
/**
|
|
23
|
+
* 接受上传文件类型, http://www.iana.org/assignments/media-types/media-types.xhtml
|
|
24
|
+
*
|
|
25
|
+
* 常用参考
|
|
26
|
+
* accept="application/zip"
|
|
27
|
+
* accept="application/x-zip-compressed"
|
|
28
|
+
* accept="application/vnd.ms-excel,applicat ion/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
29
|
+
* accept=".json"
|
|
30
|
+
* accept=".csv"
|
|
31
|
+
* accept=".pdf,.zip"
|
|
32
|
+
* accept="audio/*"
|
|
33
|
+
* accept="video/*"
|
|
34
|
+
* accept="image/*"
|
|
35
|
+
*
|
|
36
|
+
*
|
|
37
|
+
* 说明: VAP内置了默认值,如果与默认值不同,或不限制类型可自己传 ,如 accept="*"
|
|
38
|
+
*
|
|
39
|
+
* UploadFile : "application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
40
|
+
* UploadImage : "image/*"
|
|
41
|
+
*/
|
|
42
|
+
accept?: string;
|
|
43
|
+
/**
|
|
44
|
+
* 上传文件的字段名称,默认为 "file"
|
|
45
|
+
*/
|
|
46
|
+
name?: string;
|
|
47
|
+
/**
|
|
48
|
+
* 文件是否用于临时使用,默认为false, 如果是解析类可以传true
|
|
49
|
+
*/
|
|
50
|
+
isTemp?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* 上传按钮文字, 等效于 placeholder
|
|
53
|
+
*/
|
|
54
|
+
label?: string;
|
|
55
|
+
/**
|
|
56
|
+
* 上传按钮文字ik
|
|
57
|
+
*/
|
|
58
|
+
ik?: string;
|
|
59
|
+
/**
|
|
60
|
+
* 上传数据
|
|
61
|
+
*/
|
|
62
|
+
data?: PlainObject;
|
|
63
|
+
/**
|
|
64
|
+
* 结果
|
|
65
|
+
*/
|
|
66
|
+
onChange: (result: any, fileInfo: UploadFile) => void;
|
|
67
|
+
/**
|
|
68
|
+
* 初始数据
|
|
69
|
+
*/
|
|
70
|
+
value?: {
|
|
71
|
+
fileId: string;
|
|
72
|
+
fileName?: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export { UploadFile } from './UploadFile';
|
|
76
|
+
export { UploadImage } from './UploadImage';
|
|
77
|
+
export { UploadModal } from './UploadModal';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UploadModal = exports.UploadImage = exports.UploadFile = void 0;
|
|
4
|
+
var UploadFile_1 = require("./UploadFile");
|
|
5
|
+
Object.defineProperty(exports, "UploadFile", { enumerable: true, get: function () { return UploadFile_1.UploadFile; } });
|
|
6
|
+
var UploadImage_1 = require("./UploadImage");
|
|
7
|
+
Object.defineProperty(exports, "UploadImage", { enumerable: true, get: function () { return UploadImage_1.UploadImage; } });
|
|
8
|
+
var UploadModal_1 = require("./UploadModal");
|
|
9
|
+
Object.defineProperty(exports, "UploadModal", { enumerable: true, get: function () { return UploadModal_1.UploadModal; } });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { UploadProps } from 'antd/es/upload';
|
|
3
|
+
import type { BaseUploadProps } from './index';
|
|
4
|
+
import type { UploadChangeParam, UploadFile } from 'antd/es/upload/interface';
|
|
5
|
+
export type UploadState = {
|
|
6
|
+
uploading: boolean;
|
|
7
|
+
uploaded: boolean;
|
|
8
|
+
error: boolean;
|
|
9
|
+
percent: number;
|
|
10
|
+
errMsg?: React.ReactNode;
|
|
11
|
+
name?: string;
|
|
12
|
+
info?: any;
|
|
13
|
+
};
|
|
14
|
+
export declare const getBaseOptions: (props: BaseUploadProps) => UploadProps;
|
|
15
|
+
export declare const useUpload: (props: BaseUploadProps) => [UploadState, (info: UploadChangeParam<UploadFile<any>>) => void];
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.useUpload = exports.getBaseOptions = void 0;
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const antd_1 = require("antd");
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
const Const_1 = require("../../components/_setup/Const");
|
|
12
|
+
const getBaseOptions = (props) => {
|
|
13
|
+
const uploadProps = {
|
|
14
|
+
showUploadList: false,
|
|
15
|
+
withCredentials: true,
|
|
16
|
+
method: 'POST',
|
|
17
|
+
directory: false,
|
|
18
|
+
multiple: false,
|
|
19
|
+
name: "file",
|
|
20
|
+
action: utils_1.GLOBAL.CONFIG.UPLOAD.API,
|
|
21
|
+
};
|
|
22
|
+
if (props.api)
|
|
23
|
+
uploadProps.action = props.api;
|
|
24
|
+
if (props.name)
|
|
25
|
+
uploadProps.name = props.name;
|
|
26
|
+
if (props.accept)
|
|
27
|
+
uploadProps.accept = props.accept;
|
|
28
|
+
if (props.disabled)
|
|
29
|
+
uploadProps.disabled = true;
|
|
30
|
+
let baseData = undefined;
|
|
31
|
+
if (utils_1.GLOBAL.CONFIG.UPLOAD.UPLOAD_PARAM)
|
|
32
|
+
baseData = { namespace: utils_1.PageUtil.currentApp(), userId: '', userName: '', };
|
|
33
|
+
if (props.data)
|
|
34
|
+
baseData = lodash_1.default.merge(baseData, props.data);
|
|
35
|
+
if (baseData)
|
|
36
|
+
uploadProps.data = baseData;
|
|
37
|
+
if (props.maxSize) {
|
|
38
|
+
uploadProps.beforeUpload = (file) => {
|
|
39
|
+
if (file.size > props.maxSize) {
|
|
40
|
+
antd_1.message.error(utils_1.i18n.txt(Const_1.V.ERR_UPLOAD_TOO_LARGE, utils_1.Format.formatSize(props.maxSize)));
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return uploadProps;
|
|
47
|
+
};
|
|
48
|
+
exports.getBaseOptions = getBaseOptions;
|
|
49
|
+
const useUpload = (props) => {
|
|
50
|
+
const DEF = (props.value && props.value.fileId) ? {
|
|
51
|
+
uploading: false, uploaded: true, percent: 0, error: false,
|
|
52
|
+
name: props.value.fileName || props.value.fileId,
|
|
53
|
+
info: { fileId: props.value.fileId, guid: props.value.fileId }
|
|
54
|
+
} : {
|
|
55
|
+
uploading: false, uploaded: false, percent: 0, error: false,
|
|
56
|
+
};
|
|
57
|
+
const [state, setState] = (0, react_1.useState)(DEF);
|
|
58
|
+
const onChange = (info) => {
|
|
59
|
+
if (lodash_1.default.isEmpty(info.file))
|
|
60
|
+
return;
|
|
61
|
+
if (info.file.status === 'uploading') {
|
|
62
|
+
setState({ uploading: true, uploaded: false, error: false, name: info.file.name, percent: Math.floor(info.file.percent), });
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (info.file.status === 'error') {
|
|
66
|
+
let errMsg;
|
|
67
|
+
if (info.file.response && info.file.response.message)
|
|
68
|
+
errMsg = info.file.response.message;
|
|
69
|
+
else
|
|
70
|
+
errMsg = utils_1.i18n.txt(Const_1.V.UPLOAD_ERROR);
|
|
71
|
+
setState({ uploading: false, uploaded: false, error: true, percent: 0, errMsg, });
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (info.file.status == 'removed')
|
|
75
|
+
return;
|
|
76
|
+
let errMsg;
|
|
77
|
+
if (info.file.response.code != '0') {
|
|
78
|
+
if (info.file.response && info.file.response.message)
|
|
79
|
+
errMsg = info.file.response.message;
|
|
80
|
+
else
|
|
81
|
+
errMsg = utils_1.i18n.txt(Const_1.V.UPLOAD_ERROR);
|
|
82
|
+
setState({ uploading: false, uploaded: false, error: true, percent: 0, errMsg, });
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
setState({ uploading: false, uploaded: true, info: info.file.response.data, error: false, name: info.file.name, percent: 0, });
|
|
86
|
+
onChange(info.file.response.data);
|
|
87
|
+
if (lodash_1.default.isFunction(props.onChange)) {
|
|
88
|
+
props.onChange(info.file.response.data, info.file);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
return [state, onChange];
|
|
92
|
+
};
|
|
93
|
+
exports.useUpload = useUpload;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const register: (map: Map<string, any>, type: string, def: object, component: any, options?: object, forceOverWrite?: boolean) => void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.register = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const StringUtil_1 = require("../utils/StringUtil");
|
|
9
|
+
const register = (map, type, def, component, options, forceOverWrite = false) => {
|
|
10
|
+
let key = (0, StringUtil_1.trimLower)(type);
|
|
11
|
+
if (map.has(key)) {
|
|
12
|
+
if (!forceOverWrite) {
|
|
13
|
+
console.warn(`${type} is aready registered`);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
map.delete(type);
|
|
18
|
+
console.warn(`${type} is overwite by new component`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
let element = Object.assign({ component }, def);
|
|
22
|
+
lodash_1.default.keys(options).map(key => element[key] = options[key]);
|
|
23
|
+
map.set(key, element);
|
|
24
|
+
};
|
|
25
|
+
exports.register = register;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import type { AlertProps } from 'antd/es/alert';
|
|
4
|
+
/**
|
|
5
|
+
* 说明: 排除 Alert 组件已被 antd 标记为 deprecated 的属性:
|
|
6
|
+
* closeText : 使用 closeIcon替代
|
|
7
|
+
*/
|
|
8
|
+
export type OAlertProps = Omit<AlertProps, 'closeText'> & {
|
|
9
|
+
closeIcon?: boolean | React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare const Alert: FC<OAlertProps>;
|
|
@@ -0,0 +1,43 @@
|
|
|
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.Alert = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const Icon_1 = require("./Icon");
|
|
29
|
+
const utils_1 = require("./utils");
|
|
30
|
+
const antd_1 = require("antd");
|
|
31
|
+
const Alert = props => {
|
|
32
|
+
const alertProps = (0, react_1.useMemo)(() => (0, utils_1.convertProps)(props, [
|
|
33
|
+
'closeText', 'closeIcon', (props) => {
|
|
34
|
+
if (props.closeIcon == null || props.closeIcon == false)
|
|
35
|
+
return undefined;
|
|
36
|
+
if (props.closeIcon === true)
|
|
37
|
+
return react_1.default.createElement(Icon_1.Icon, { evt: true, type: 'close' });
|
|
38
|
+
return props.closeIcon;
|
|
39
|
+
}
|
|
40
|
+
]), []);
|
|
41
|
+
return react_1.default.createElement(antd_1.Alert, Object.assign({}, alertProps));
|
|
42
|
+
};
|
|
43
|
+
exports.Alert = Alert;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button as AntdButton } from "antd";
|
|
3
|
+
import type { ButtonProps } from 'antd/es/button';
|
|
4
|
+
import type { ExoticComponent } from 'react';
|
|
5
|
+
import type { BaseItem } from '../../basetype';
|
|
6
|
+
declare const ButtonTypes: readonly ["default", "primary", "dashed", "link", "text"];
|
|
7
|
+
export type ButtonType = typeof ButtonTypes[number];
|
|
8
|
+
export type OButtonProps = Omit<ButtonProps, 'type' | 'icon'> & BaseItem & {
|
|
9
|
+
danger?: boolean;
|
|
10
|
+
type?: ButtonType;
|
|
11
|
+
icon?: string | React.ReactNode;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* 扩展 Button 支持 roleCode 和 ik
|
|
15
|
+
*/
|
|
16
|
+
type Button = ExoticComponent<OButtonProps> & {
|
|
17
|
+
Group: typeof AntdButton.Group;
|
|
18
|
+
};
|
|
19
|
+
export declare const Button: Button;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Button = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const antd_1 = require("antd");
|
|
10
|
+
// import { Icon } from './Icon';
|
|
11
|
+
const utils_1 = require("../../utils");
|
|
12
|
+
const _Button = props => {
|
|
13
|
+
if (props.roleCode && !utils_1.PageUtil.hasRole(props.roleCode))
|
|
14
|
+
return utils_1.Const.NONE;
|
|
15
|
+
let btnProps = Object.assign({}, props);
|
|
16
|
+
if (props.danger)
|
|
17
|
+
btnProps.type = 'danger';
|
|
18
|
+
if (props.icon) {
|
|
19
|
+
lodash_1.default.unset(btnProps, 'icon');
|
|
20
|
+
}
|
|
21
|
+
if (props.ik)
|
|
22
|
+
return react_1.default.createElement(antd_1.Button, Object.assign({}, btnProps), utils_1.i18n.txt(props.ik));
|
|
23
|
+
return react_1.default.createElement(antd_1.Button, Object.assign({}, btnProps));
|
|
24
|
+
};
|
|
25
|
+
exports.Button = _Button;
|
|
26
|
+
exports.Button.Group = antd_1.Button.Group;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ColProps as AntdColprops } from 'antd/es/grid/col';
|
|
3
|
+
import type { ActButton } from '../SearchBar/ActionButtons';
|
|
4
|
+
export interface ColProps extends Omit<AntdColprops, 'title'> {
|
|
5
|
+
/**
|
|
6
|
+
* 面板标题前的 ICON
|
|
7
|
+
*/
|
|
8
|
+
icon?: string;
|
|
9
|
+
/**
|
|
10
|
+
* 面板标题
|
|
11
|
+
*/
|
|
12
|
+
title?: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* 标题下标额外内容(以 small小一号)展示
|
|
15
|
+
*/
|
|
16
|
+
titleSub?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* 标题后面的帮助文案
|
|
19
|
+
*/
|
|
20
|
+
help?: React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* 皮肤样式,测试中
|
|
23
|
+
* grid : 网格
|
|
24
|
+
* borderless : 无边框
|
|
25
|
+
* yellow : 黄
|
|
26
|
+
* blue : 蓝
|
|
27
|
+
* pink : 粉
|
|
28
|
+
* green : 绿
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* noBg模式,用于某些皮肤子容器排版
|
|
32
|
+
*/
|
|
33
|
+
nobg?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* 是否正在 loading 状态,推荐使用 loading_effect
|
|
36
|
+
*/
|
|
37
|
+
loading?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 右上角按钮
|
|
40
|
+
*/
|
|
41
|
+
actions?: ActButton[] | React.ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* 空数据判断
|
|
44
|
+
* 传 true = 数据为空
|
|
45
|
+
* 传 false = 数据不为空 (默认)
|
|
46
|
+
* 传 数组时 = ((数组 == null) 或者 (数组长度 == 0 )) 为空
|
|
47
|
+
*/
|
|
48
|
+
empty?: boolean | any[];
|
|
49
|
+
width?: number;
|
|
50
|
+
height?: number;
|
|
51
|
+
bodySytle?: React.CSSProperties;
|
|
52
|
+
}
|
|
53
|
+
export declare const Col: React.FC<ColProps>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Col = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const antd_1 = require("antd");
|
|
10
|
+
const Loading_1 = require("../_common/Loading");
|
|
11
|
+
const Icon_1 = require("./Icon");
|
|
12
|
+
const utils_1 = require("../../utils");
|
|
13
|
+
const ActionButtons_1 = require("../SearchBar/ActionButtons");
|
|
14
|
+
const PANEL_PROPERTIES = ['icon', 'title', 'titleSub', 'noBg', 'loading', 'actions', 'empty', 'width', 'height', 'bodySytle'];
|
|
15
|
+
const ColHead = (props) => {
|
|
16
|
+
let elAction = '';
|
|
17
|
+
const actions = [];
|
|
18
|
+
if ((lodash_1.default.isArray(props.actions) && props.actions.length)) {
|
|
19
|
+
props.actions.map(item => {
|
|
20
|
+
if (item.roleCode == null || utils_1.PageUtil.hasRole(item.roleCode)) {
|
|
21
|
+
actions.push(item);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
elAction = react_1.default.createElement(ActionButtons_1.ActionButtons, { size: 'small', buttons: actions });
|
|
25
|
+
}
|
|
26
|
+
else if (lodash_1.default.isObject(props.actions) && react_1.default.isValidElement(props.actions)) {
|
|
27
|
+
elAction = props.actions;
|
|
28
|
+
}
|
|
29
|
+
if (props.title == null && actions.length == 0)
|
|
30
|
+
return utils_1.Const.NONE;
|
|
31
|
+
return react_1.default.createElement("div", { className: 'v-col-head' },
|
|
32
|
+
react_1.default.createElement("div", { className: 'c-col-title' },
|
|
33
|
+
props.icon && react_1.default.createElement(Icon_1.Icon, { type: props.icon, className: 'c-col-title-icon' }),
|
|
34
|
+
react_1.default.createElement("span", { className: 'c-col-title-text' }, props.title),
|
|
35
|
+
props.titleSub && react_1.default.createElement("span", { className: 'c-col-title-sub' }, props.titleSub)),
|
|
36
|
+
react_1.default.createElement("div", { className: 'c-col-actions' }, elAction));
|
|
37
|
+
};
|
|
38
|
+
const Col = (props) => {
|
|
39
|
+
let clazz = ['v-col'];
|
|
40
|
+
if (props.className) {
|
|
41
|
+
clazz.push(props.className);
|
|
42
|
+
}
|
|
43
|
+
if (lodash_1.default.has(props, 'span') || lodash_1.default.has(props, 'width') || lodash_1.default.has(props, 'height') || lodash_1.default.has(props.style, 'width') || lodash_1.default.has(props.style, 'height')) {
|
|
44
|
+
clazz.push('v-col-fix');
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
clazz.push('v-col-auto');
|
|
48
|
+
}
|
|
49
|
+
let style = props.style || {};
|
|
50
|
+
if (props.width) {
|
|
51
|
+
style.width = props.width;
|
|
52
|
+
style.minWidth = props.width;
|
|
53
|
+
style.maxWidth = props.width;
|
|
54
|
+
}
|
|
55
|
+
if (props.height) {
|
|
56
|
+
style.height = props.height;
|
|
57
|
+
style.minHeight = props.height;
|
|
58
|
+
style.maxHeight = props.height;
|
|
59
|
+
clazz.push('v-col-fix');
|
|
60
|
+
}
|
|
61
|
+
if (props.nobg) {
|
|
62
|
+
clazz.push('v-col-nobg');
|
|
63
|
+
return react_1.default.createElement(antd_1.Col, Object.assign({}, lodash_1.default.omit(props, PANEL_PROPERTIES), { style: style, className: clazz.join(' ') }));
|
|
64
|
+
}
|
|
65
|
+
const panelProps = lodash_1.default.pick(props, PANEL_PROPERTIES);
|
|
66
|
+
if (props.className)
|
|
67
|
+
clazz.push(props.className);
|
|
68
|
+
if (lodash_1.default.keys(panelProps).length == 0)
|
|
69
|
+
return react_1.default.createElement(antd_1.Col, Object.assign({}, lodash_1.default.omit(props, ['children']), { className: clazz.join(' '), style: style }),
|
|
70
|
+
react_1.default.createElement("div", { className: 'v-col-content' }, props.children));
|
|
71
|
+
const colProps = lodash_1.default.omit(props, PANEL_PROPERTIES);
|
|
72
|
+
let isLoading = false;
|
|
73
|
+
let isEmpty = false;
|
|
74
|
+
if (props.loading) {
|
|
75
|
+
isLoading = true;
|
|
76
|
+
}
|
|
77
|
+
else if (lodash_1.default.has(props, 'empty')) {
|
|
78
|
+
if (lodash_1.default.isArray(props.empty)) {
|
|
79
|
+
isEmpty = props.empty.length == 0;
|
|
80
|
+
}
|
|
81
|
+
else if (props.empty) {
|
|
82
|
+
isEmpty = true;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return react_1.default.createElement(antd_1.Col, Object.assign({}, colProps, { className: clazz.join(' '), style: style }),
|
|
86
|
+
react_1.default.createElement("div", { className: 'v-col-content' },
|
|
87
|
+
react_1.default.createElement(ColHead, Object.assign({}, props)),
|
|
88
|
+
react_1.default.createElement("div", { className: 'v-col-body', style: props.bodySytle }, isLoading ? react_1.default.createElement(Loading_1.Loading, null) : (isEmpty ? react_1.default.createElement(antd_1.Empty, null) : props.children))));
|
|
89
|
+
};
|
|
90
|
+
exports.Col = Col;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* -------------------------------
|
|
3
|
+
* 手风琴组件兼容模块 : Collapse
|
|
4
|
+
* -------------------------------
|
|
5
|
+
*/
|
|
6
|
+
import type { CollapseProps } from 'antd/es/collapse';
|
|
7
|
+
import type { CollapsePanelProps } from 'antd/es/collapse/CollapsePanel';
|
|
8
|
+
import type { FC, PropsWithChildren, ExoticComponent } from 'react';
|
|
9
|
+
/**
|
|
10
|
+
* 说明: 排除 Collapse 组件已被 antd 标记为 deprecated 的属性:
|
|
11
|
+
* expandIconPosition : 不支持 'left'/'right' 使用 'start'/'end' 替代
|
|
12
|
+
*/
|
|
13
|
+
export declare type ExpandIconPosition = 'start' | 'end' | undefined;
|
|
14
|
+
export type OCollapseProps = Omit<CollapseProps, 'expandIconPosition'> & {
|
|
15
|
+
expandIconPosition?: ExpandIconPosition;
|
|
16
|
+
};
|
|
17
|
+
type CollapsibleType = 'disabled';
|
|
18
|
+
/**
|
|
19
|
+
* 说明:排除 Collapse.Panel 已被 antd 标记为 deprecated 的属性:
|
|
20
|
+
* disabled:1. 不再被支持 , 使用 `collapsible="disabled"` 替代
|
|
21
|
+
* 2. 本版本不支持 header,icon ,只能使用 collapsible="disabled"
|
|
22
|
+
*/
|
|
23
|
+
export type OCollapsePanelProps = Omit<CollapsePanelProps, 'disabled'> & {
|
|
24
|
+
collapsible?: CollapsibleType;
|
|
25
|
+
};
|
|
26
|
+
type CollapseComponent = ExoticComponent<PropsWithChildren<OCollapseProps>> & {
|
|
27
|
+
Panel: FC<PropsWithChildren<OCollapsePanelProps>>;
|
|
28
|
+
};
|
|
29
|
+
export declare const Collapse: CollapseComponent;
|
|
30
|
+
export {};
|