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,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._FieldType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
| 类型 | 说明 |
|
|
7
|
+
| --- | --- |
|
|
8
|
+
| text ||
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
exports._FieldType = [
|
|
12
|
+
'text',
|
|
13
|
+
'number',
|
|
14
|
+
'select',
|
|
15
|
+
'multi-select',
|
|
16
|
+
'radio',
|
|
17
|
+
'radio-button',
|
|
18
|
+
'checkbox',
|
|
19
|
+
'switch',
|
|
20
|
+
'date',
|
|
21
|
+
'daterange',
|
|
22
|
+
'daterange-single',
|
|
23
|
+
'datetime',
|
|
24
|
+
'timerange',
|
|
25
|
+
'timerange-single',
|
|
26
|
+
'month',
|
|
27
|
+
'monthrange',
|
|
28
|
+
'autocomplete',
|
|
29
|
+
];
|
|
30
|
+
// * text 文本输入(默认)
|
|
31
|
+
// * number 文本输入(数字)
|
|
32
|
+
// * autocomplete 文本输入(自动完成)
|
|
33
|
+
// * select 普通选择器
|
|
34
|
+
// * multiselect 多项选择器
|
|
35
|
+
// * dictselect 字典选择器(必须指定字典ID)
|
|
36
|
+
// * treeselect 静态树选择器(暂不支持动态树)
|
|
37
|
+
// * inputselect 输入框,但有辅助选项
|
|
38
|
+
// * radio 单选框(强㓡使用外置Label)
|
|
39
|
+
// * checkbox 复选框(强制使用外围Label)
|
|
40
|
+
// * datetime 时间(如 2010-06-25 12:00:00)
|
|
41
|
+
// * date 日期 (如 2010-06-25)
|
|
42
|
+
// * month 月份 (如 2010-06-01) 返回选择月份的首日
|
|
43
|
+
// * timerange 时间区间
|
|
44
|
+
// * daterange 日期区间
|
|
45
|
+
// *
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { Field } from './index';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
3
|
+
export type SearchFieldProps = {
|
|
4
|
+
/**
|
|
5
|
+
* 宽度
|
|
6
|
+
*/
|
|
7
|
+
width: string | number;
|
|
8
|
+
/**
|
|
9
|
+
* field
|
|
10
|
+
*/
|
|
11
|
+
field: Field;
|
|
12
|
+
/**
|
|
13
|
+
* 选中一个项目后的回调方法
|
|
14
|
+
*/
|
|
15
|
+
onChange: (value: any) => void;
|
|
16
|
+
/**
|
|
17
|
+
* 触发搜索
|
|
18
|
+
*/
|
|
19
|
+
triggerSearch: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* 是否禁用状态
|
|
22
|
+
*/
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* 初始数据
|
|
26
|
+
*/
|
|
27
|
+
data: any;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* 通用 SearchBar 搜索字段定义
|
|
31
|
+
*/
|
|
32
|
+
export type SearchFieldComponent = ComponentType<SearchFieldProps>;
|
|
33
|
+
/**
|
|
34
|
+
* 组件特性
|
|
35
|
+
*/
|
|
36
|
+
export type SearchFieldOptions = {
|
|
37
|
+
/**
|
|
38
|
+
* 是只支持外置模式,默认为 false
|
|
39
|
+
*/
|
|
40
|
+
outside?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 字段个数, 默认为 1
|
|
43
|
+
*/
|
|
44
|
+
filedNum?: number;
|
|
45
|
+
/**
|
|
46
|
+
* 默认占格 , 默认为 1
|
|
47
|
+
*/
|
|
48
|
+
defaultSpan?: number;
|
|
49
|
+
};
|
|
50
|
+
type SearchField = SearchFieldOptions & {
|
|
51
|
+
component: SearchFieldComponent;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* @param type
|
|
55
|
+
* 类型名称, 支持: VTable,STable,ApiTalbe,DataTable,SearchBar
|
|
56
|
+
* @param component
|
|
57
|
+
* 输入组件,为一个React 类型,自动注入 props @see SearchFieldComponent
|
|
58
|
+
* @param options
|
|
59
|
+
* 注册选项 @see SearchBarFieldOptions
|
|
60
|
+
* @param forceOverWrite
|
|
61
|
+
* 强制覆盖掉已注册的组件,默认重复注册相同的类型时,后注册的不能生效,使用 true 后,强㓡覆盖掉之前注册的组件
|
|
62
|
+
*/
|
|
63
|
+
export declare const registerSearchField: (type: string, component: SearchFieldComponent, options?: SearchFieldOptions, forceOverWrite?: boolean) => void;
|
|
64
|
+
export declare const getSearchField: (type: string) => SearchField;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSearchField = exports.registerSearchField = void 0;
|
|
4
|
+
const _Support_1 = require("../../utils/_Support");
|
|
5
|
+
const StringUtil_1 = require("../../utils/StringUtil");
|
|
6
|
+
const _RegisterUtil_1 = require("../_RegisterUtil");
|
|
7
|
+
const DEFAULT = { outside: false, filedNum: 1, defaultSpan: 1, };
|
|
8
|
+
const _C_SEARCH_FIELD = (0, _Support_1.globalDefault)('_C_SEARCH_FIELD', new Map());
|
|
9
|
+
/**
|
|
10
|
+
* @param type
|
|
11
|
+
* 类型名称, 支持: VTable,STable,ApiTalbe,DataTable,SearchBar
|
|
12
|
+
* @param component
|
|
13
|
+
* 输入组件,为一个React 类型,自动注入 props @see SearchFieldComponent
|
|
14
|
+
* @param options
|
|
15
|
+
* 注册选项 @see SearchBarFieldOptions
|
|
16
|
+
* @param forceOverWrite
|
|
17
|
+
* 强制覆盖掉已注册的组件,默认重复注册相同的类型时,后注册的不能生效,使用 true 后,强㓡覆盖掉之前注册的组件
|
|
18
|
+
*/
|
|
19
|
+
const registerSearchField = (type, component, options, forceOverWrite = false) => {
|
|
20
|
+
(0, _RegisterUtil_1.register)(_C_SEARCH_FIELD, type, DEFAULT, component, options, forceOverWrite);
|
|
21
|
+
};
|
|
22
|
+
exports.registerSearchField = registerSearchField;
|
|
23
|
+
const getSearchField = (type) => {
|
|
24
|
+
let key = (0, StringUtil_1.trimLower)(type);
|
|
25
|
+
if (_C_SEARCH_FIELD.has(key))
|
|
26
|
+
return _C_SEARCH_FIELD.get(key);
|
|
27
|
+
return _C_SEARCH_FIELD.get('text');
|
|
28
|
+
};
|
|
29
|
+
exports.getSearchField = getSearchField;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { ActionButtons } from './ActionButtons';
|
|
2
|
+
import type { PropsWithChildren, ExoticComponent } from 'react';
|
|
3
|
+
import type { BaseOption, PlainObject, BaseItem } from '../../basetype';
|
|
4
|
+
import type { _FieldType } from './_FieldType';
|
|
5
|
+
/**
|
|
6
|
+
* 搜索条件字段
|
|
7
|
+
*/
|
|
8
|
+
export type Field = BaseItem & {
|
|
9
|
+
/**
|
|
10
|
+
* api通信对应条件的字段
|
|
11
|
+
*/
|
|
12
|
+
field: string;
|
|
13
|
+
/**
|
|
14
|
+
* 字段标签
|
|
15
|
+
*/
|
|
16
|
+
label: string;
|
|
17
|
+
/**
|
|
18
|
+
* 默认为1,最多为3,超过3按3算,小于1 按1算,
|
|
19
|
+
* 可以参考 antd Descriptions / DescriptionItem 里面文档里面的 span 的用法
|
|
20
|
+
* */
|
|
21
|
+
span?: number;
|
|
22
|
+
/**
|
|
23
|
+
* 字段类型,目前支持
|
|
24
|
+
* text 文本输入(默认)
|
|
25
|
+
* number 文本输入(数字)
|
|
26
|
+
* autocomplete 文本输入(自动完成)
|
|
27
|
+
* select 普通选择器
|
|
28
|
+
* multiselect 多项选择器
|
|
29
|
+
* dictselect 字典选择器(必须指定字典ID)
|
|
30
|
+
* treeselect 静态树选择器(暂不支持动态树)
|
|
31
|
+
* inputselect 输入框,但有辅助选项
|
|
32
|
+
* radio 单选框(强㓡使用外置Label)
|
|
33
|
+
* checkbox 复选框(强制使用外围Label)
|
|
34
|
+
* datetime 时间(如 2010-06-25 12:00:00)
|
|
35
|
+
* date 日期 (如 2010-06-25)
|
|
36
|
+
* month 月份 (如 2010-06-01) 返回选择月份的首日
|
|
37
|
+
* timerange 时间区间
|
|
38
|
+
* daterange 日期区间
|
|
39
|
+
*
|
|
40
|
+
*
|
|
41
|
+
* 支持中:
|
|
42
|
+
* radiomore 单选,可自定义更多
|
|
43
|
+
* switch 双状态切换
|
|
44
|
+
* sider 区间划动
|
|
45
|
+
*/
|
|
46
|
+
type?: typeof _FieldType[number] | (string & {});
|
|
47
|
+
/**
|
|
48
|
+
* 输入框里面的提示
|
|
49
|
+
*/
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
/**
|
|
52
|
+
* 是否可以清除 支持 text
|
|
53
|
+
* */
|
|
54
|
+
allowClear?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* select / multiselect / radio / checkbox 时,需要带的选项
|
|
57
|
+
* 使用方法1: 传入一个数组 ,以 {name:string,value:string|number} 的结构传入
|
|
58
|
+
* 使用方法2: 传入一个对象, 以 data: any[] 传入选项数据,再指定 name : stirng, value : string 来指定需要显示在页面的名称和选中后的取值
|
|
59
|
+
*/
|
|
60
|
+
options?: BaseOption[];
|
|
61
|
+
/**
|
|
62
|
+
* 扩展属性,具体使用方法后续说明
|
|
63
|
+
* */
|
|
64
|
+
config?: any;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
* 说明,内部两个属性,暂不开放,如需使用,自行处理编译问题
|
|
69
|
+
* __innerExpand
|
|
70
|
+
* __innerOutside
|
|
71
|
+
*/
|
|
72
|
+
export type SearchBarByFieldProps = {
|
|
73
|
+
/**
|
|
74
|
+
* 禁用
|
|
75
|
+
*/
|
|
76
|
+
disabled?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* searchBar扩展类名称
|
|
79
|
+
*/
|
|
80
|
+
className?: string;
|
|
81
|
+
/**
|
|
82
|
+
* 1. 传一个字,代表 inside 模式宽度
|
|
83
|
+
* 2. 传一个数字数组,
|
|
84
|
+
* 代表 outside 模式 [label宽度,input宽度]
|
|
85
|
+
* 或是 inside 模式加各的结果
|
|
86
|
+
*/
|
|
87
|
+
fieldWidth?: number | [number, number];
|
|
88
|
+
/**
|
|
89
|
+
* 搜索参数
|
|
90
|
+
*/
|
|
91
|
+
fields?: Field[];
|
|
92
|
+
/**
|
|
93
|
+
* 搜索参数支持的列,最多支持4,默认为3
|
|
94
|
+
*/
|
|
95
|
+
cols?: 1 | 2 | 3 | 4;
|
|
96
|
+
/**
|
|
97
|
+
* 变量有变动时使用
|
|
98
|
+
*/
|
|
99
|
+
onChange?: (param: PlainObject) => void;
|
|
100
|
+
/**
|
|
101
|
+
* 搜索被触发时
|
|
102
|
+
*/
|
|
103
|
+
onSearch: (param: PlainObject) => void;
|
|
104
|
+
/**
|
|
105
|
+
* 显示更多时触发
|
|
106
|
+
*/
|
|
107
|
+
onExpand?: (isShowMore: boolean) => void;
|
|
108
|
+
/**
|
|
109
|
+
* 默认参数
|
|
110
|
+
*/
|
|
111
|
+
default?: any;
|
|
112
|
+
/**
|
|
113
|
+
* 用于单独使用时,不需要按钮的情况
|
|
114
|
+
*/
|
|
115
|
+
hideAction?: boolean;
|
|
116
|
+
};
|
|
117
|
+
export type KeyWord = true | {
|
|
118
|
+
/**
|
|
119
|
+
* 提示,默认为 "请填写关键字"
|
|
120
|
+
*/
|
|
121
|
+
placeholder?: string;
|
|
122
|
+
/**
|
|
123
|
+
* 需要高亮的字段
|
|
124
|
+
* 高亮设定: 说明:高亮设定后, column 指定的 render 会失效
|
|
125
|
+
*/
|
|
126
|
+
highlight?: string[];
|
|
127
|
+
};
|
|
128
|
+
export type SearchBarProps = SearchBarByFieldProps & {
|
|
129
|
+
keyword?: KeyWord;
|
|
130
|
+
};
|
|
131
|
+
export interface SearchBar extends ExoticComponent<PropsWithChildren<SearchBarProps>> {
|
|
132
|
+
ActionButtons: typeof ActionButtons;
|
|
133
|
+
}
|
|
134
|
+
export declare const SearchBar: SearchBar;
|
|
@@ -0,0 +1,33 @@
|
|
|
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.SearchBar = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const ByField_1 = require("./ByField");
|
|
11
|
+
const ByKeyword_1 = require("./ByKeyword");
|
|
12
|
+
const ActionButtons_1 = require("./ActionButtons");
|
|
13
|
+
const _SearchBar = props => {
|
|
14
|
+
let clazz = ['c-searchbar'];
|
|
15
|
+
if (utils_1.GLOBAL.CONFIG.SEARCHBAR.REVERSE)
|
|
16
|
+
clazz.push('c-searchbar-reverse');
|
|
17
|
+
if (!lodash_1.default.isArray(props.fields) || props.fields.length == 0) {
|
|
18
|
+
if (!lodash_1.default.has(props, 'children'))
|
|
19
|
+
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
20
|
+
return react_1.default.createElement("div", { className: utils_1.StringUtil.className(clazz, props.className) },
|
|
21
|
+
react_1.default.createElement("div", { className: 'c-searchbar-fields' }),
|
|
22
|
+
react_1.default.createElement("div", { className: 'c-searchbar-actions' }, props.children));
|
|
23
|
+
}
|
|
24
|
+
return react_1.default.createElement("div", { className: utils_1.StringUtil.className(clazz, props.className) },
|
|
25
|
+
(utils_1.GLOBAL.CONFIG.SEARCHBAR.DISABLE_KEYWORD
|
|
26
|
+
|| !lodash_1.default.has(props, 'keyword') ||
|
|
27
|
+
props.keyword == undefined) ? react_1.default.createElement(ByField_1.SearchBarByField, Object.assign({}, props)) :
|
|
28
|
+
react_1.default.createElement(ByKeyword_1.SearchBarByKeyword, Object.assign({}, props)),
|
|
29
|
+
react_1.default.createElement("div", { className: 'c-searchbar-actions' }, props.children));
|
|
30
|
+
};
|
|
31
|
+
;
|
|
32
|
+
exports.SearchBar = _SearchBar;
|
|
33
|
+
exports.SearchBar.ActionButtons = ActionButtons_1.ActionButtons;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { BaseTableProps } from './index';
|
|
3
|
+
import type { ApiModel } from '../../hooks/_list';
|
|
4
|
+
import type { ApiOption } from '../../hooks/useApi';
|
|
5
|
+
export type ApiTableProps = BaseTableProps & Pick<ApiOption, 'api' | 'aop' | 'tipDisabled' | 'tipField'>;
|
|
6
|
+
export declare const ApiTable: React.ForwardRefExoticComponent<import("./index").TableDefine & {
|
|
7
|
+
mode?: import("../Box/Box").BoxMode;
|
|
8
|
+
columns: import("./index").TableColumn[];
|
|
9
|
+
showIndex?: string | false;
|
|
10
|
+
rowKey?: string;
|
|
11
|
+
select?: true | "DEFAULT" | "QUERY";
|
|
12
|
+
selectDisabled?: (record: any) => boolean;
|
|
13
|
+
actionBar?: React.ReactNode | import("./Components/ActionBar").TableActionButton[];
|
|
14
|
+
selectBar?: import("../Box/SelectBar").SelectBarProps;
|
|
15
|
+
searchBar?: Omit<import("../SearchBar").SearchBarProps, "onChange" | "onSearch">;
|
|
16
|
+
default?: import("../..").PlainObject;
|
|
17
|
+
autoLoad?: false;
|
|
18
|
+
} & Pick<ApiOption, "api" | "aop" | "tipDisabled" | "tipField"> & React.RefAttributes<ApiModel>>;
|
|
@@ -0,0 +1,48 @@
|
|
|
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.ApiTable = void 0;
|
|
27
|
+
const react_1 = __importStar(require("react"));
|
|
28
|
+
const useApi_1 = require("../../hooks/useApi");
|
|
29
|
+
const VTable_1 = require("./VTable");
|
|
30
|
+
exports.ApiTable = react_1.default.forwardRef((props, ref) => {
|
|
31
|
+
const option = {
|
|
32
|
+
api: props.api,
|
|
33
|
+
rowKey: props.rowKey,
|
|
34
|
+
param: props.default,
|
|
35
|
+
aop: props.aop,
|
|
36
|
+
tipDisabled: props.tipDisabled,
|
|
37
|
+
tipField: props.tipField,
|
|
38
|
+
};
|
|
39
|
+
if (props.pagination && props.pagination.pageSize)
|
|
40
|
+
option.pageSize = props.pagination.pageSize;
|
|
41
|
+
const model = (0, useApi_1.useApi)(option);
|
|
42
|
+
(0, react_1.useEffect)(() => {
|
|
43
|
+
if (ref) {
|
|
44
|
+
ref.current = model;
|
|
45
|
+
}
|
|
46
|
+
}, [ref]);
|
|
47
|
+
return react_1.default.createElement(VTable_1.VTable, Object.assign({}, props, { model: model }));
|
|
48
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { VModalProps } from '../_adapt/Modal';
|
|
3
|
+
import type { ApiTableProps } from './ApiTable';
|
|
4
|
+
import type { ApiModel } from '../../hooks/_list';
|
|
5
|
+
export type ApiTableModalProps = ApiTableProps & VModalProps;
|
|
6
|
+
export declare const ApiTableModal: React.ForwardRefExoticComponent<import(".").TableDefine & {
|
|
7
|
+
mode?: import("../Box/Box").BoxMode;
|
|
8
|
+
columns: import(".").TableColumn[];
|
|
9
|
+
showIndex?: string | false;
|
|
10
|
+
rowKey?: string;
|
|
11
|
+
select?: true | "DEFAULT" | "QUERY";
|
|
12
|
+
selectDisabled?: (record: any) => boolean;
|
|
13
|
+
actionBar?: React.ReactNode | import("./Components/ActionBar").TableActionButton[];
|
|
14
|
+
selectBar?: import("../Box/SelectBar").SelectBarProps;
|
|
15
|
+
searchBar?: Omit<import("../SearchBar").SearchBarProps, "onChange" | "onSearch">;
|
|
16
|
+
default?: import("../..").PlainObject;
|
|
17
|
+
autoLoad?: false;
|
|
18
|
+
} & Pick<import("../../hooks/useApi").ApiOption, "api" | "aop" | "tipDisabled" | "tipField"> & Omit<import("antd/es/modal").ModalProps, "visible" | "onCancel" | "onOk"> & {
|
|
19
|
+
open?: boolean;
|
|
20
|
+
onOk?: (data?: import("../..").PlainObject) => void;
|
|
21
|
+
onCancel?: () => void;
|
|
22
|
+
} & React.RefAttributes<ApiModel>>;
|
|
@@ -0,0 +1,73 @@
|
|
|
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.ApiTableModal = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
32
|
+
const Modal_1 = require("../_adapt/Modal");
|
|
33
|
+
const ApiTable_1 = require("./ApiTable");
|
|
34
|
+
const utils_1 = require("../../utils");
|
|
35
|
+
const API_TABLE_PROPERTIES = [
|
|
36
|
+
'api', 'aop', 'tipDisabled', 'tipField',
|
|
37
|
+
'mode', 'columns', 'showIndex', 'rowKey', 'select', 'selectDisabled', 'actionBar', 'selectBar', 'searchBar', 'default', 'autoLoad'
|
|
38
|
+
];
|
|
39
|
+
exports.ApiTableModal = react_1.default.forwardRef((props, ref) => {
|
|
40
|
+
const modalProps = lodash_1.default.omit(props, API_TABLE_PROPERTIES);
|
|
41
|
+
const tableProps = lodash_1.default.pick(props, API_TABLE_PROPERTIES);
|
|
42
|
+
const [tableKey, updateKey] = (0, react_1.useState)(utils_1.StringUtil.genKey());
|
|
43
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
44
|
+
if (props.open)
|
|
45
|
+
updateKey(utils_1.StringUtil.genKey());
|
|
46
|
+
}, [props.open]);
|
|
47
|
+
if (modalProps.className) {
|
|
48
|
+
modalProps.className += ' v-tablemodal';
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
modalProps.className = 'v-tablemodal';
|
|
52
|
+
}
|
|
53
|
+
if (tableProps.pagination) {
|
|
54
|
+
if (!lodash_1.default.has(tableProps.pagination, 'pageSize')) {
|
|
55
|
+
tableProps.pagination.pageSize = utils_1.GLOBAL.CONFIG.PAGINATION.SIZE_SMALL;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
tableProps.pagination = { pageSize: utils_1.GLOBAL.CONFIG.PAGINATION.SIZE_SMALL };
|
|
60
|
+
}
|
|
61
|
+
// if (props.height) {
|
|
62
|
+
// if (modalProps.bodyStyle) {
|
|
63
|
+
// modalProps.bodyStyle.height = props.height;
|
|
64
|
+
// } else {
|
|
65
|
+
// modalProps.bodyStyle = { height: props.height };
|
|
66
|
+
// }
|
|
67
|
+
// tableProps.mode = "inner";
|
|
68
|
+
// }
|
|
69
|
+
// if (props.width && ) {
|
|
70
|
+
// }
|
|
71
|
+
return react_1.default.createElement(Modal_1.Modal, Object.assign({ footer: null }, modalProps),
|
|
72
|
+
react_1.default.createElement(ApiTable_1.ApiTable, Object.assign({ key: tableKey }, tableProps, { ref: ref })));
|
|
73
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Key, PlainObject } from '../../../basetype';
|
|
3
|
+
import type { ActButton } from '../../SearchBar/ActionButtons';
|
|
4
|
+
import type { MutableRefObject } from 'react';
|
|
5
|
+
export type TableAction = (ids?: Key[], objs?: PlainObject[], param?: PlainObject) => void;
|
|
6
|
+
/**
|
|
7
|
+
* VTable Button 区域点击后的方法,支持三个参数
|
|
8
|
+
* @param ids 如果当前有选条目,则为选中条目的ID列表
|
|
9
|
+
* @param objs 如果当前有选条目,则为选中条目的对象信息
|
|
10
|
+
* @param param 当前表格的查询参数
|
|
11
|
+
*/
|
|
12
|
+
export type TableActionButton = Omit<ActButton, 'onClick' | 'children'> & {
|
|
13
|
+
/**
|
|
14
|
+
* 点击事件
|
|
15
|
+
*/
|
|
16
|
+
onClick: TableAction;
|
|
17
|
+
/**
|
|
18
|
+
* 必须要选中才能点
|
|
19
|
+
*/
|
|
20
|
+
mustSelected?: true;
|
|
21
|
+
/**
|
|
22
|
+
* 说明 : 最多支持2级子菜单,不能递归
|
|
23
|
+
*/
|
|
24
|
+
children?: TableActionButton[];
|
|
25
|
+
};
|
|
26
|
+
export type SelectFunction = {
|
|
27
|
+
selected: [Key[], PlainObject[]];
|
|
28
|
+
onSelected: () => void;
|
|
29
|
+
};
|
|
30
|
+
type TableActionBar = {
|
|
31
|
+
buttons: (TableActionButton | null | false)[];
|
|
32
|
+
queryParam: PlainObject;
|
|
33
|
+
selectedRef: MutableRefObject<SelectFunction>;
|
|
34
|
+
};
|
|
35
|
+
export declare const ActionBar: React.FC<TableActionBar>;
|
|
36
|
+
/**
|
|
37
|
+
* 通用添加按钮
|
|
38
|
+
*/
|
|
39
|
+
export declare const BUTTON_ADD: (onClick: TableAction, props?: Partial<TableActionButton>) => TableActionButton;
|
|
40
|
+
/**
|
|
41
|
+
* 通用删除按钮
|
|
42
|
+
*/
|
|
43
|
+
export declare const BUTTON_DELETE: (onClick: TableAction, props?: Partial<TableActionButton>) => TableActionButton;
|
|
44
|
+
/**
|
|
45
|
+
* 通用更多按钮,需要传子菜单
|
|
46
|
+
*/
|
|
47
|
+
export declare const BUTTON_MORE: (children: TableActionButton[]) => TableActionButton;
|
|
48
|
+
/**
|
|
49
|
+
* 通用导入按钮
|
|
50
|
+
*/
|
|
51
|
+
export declare const BUTTON_IMPORT: (onClick: TableAction, props?: Partial<TableActionButton>) => ActButton;
|
|
52
|
+
/**
|
|
53
|
+
* 通用导出按钮
|
|
54
|
+
*/
|
|
55
|
+
export declare const BUTTON_EXPORT: (onClick: TableAction, props?: Partial<TableActionButton>) => ActButton;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,100 @@
|
|
|
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.BUTTON_EXPORT = exports.BUTTON_IMPORT = exports.BUTTON_MORE = exports.BUTTON_DELETE = exports.BUTTON_ADD = exports.ActionBar = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
32
|
+
const ActionButtons_1 = require("../../SearchBar/ActionButtons");
|
|
33
|
+
const Const_1 = require("../../_setup/Const");
|
|
34
|
+
const i18n_1 = require("../../../utils/i18n");
|
|
35
|
+
const hooks_1 = require("../../../hooks");
|
|
36
|
+
const convertButton = (item, selectedRowKeys, selectedObjects, queryParam) => {
|
|
37
|
+
let btn = Object.assign({}, item);
|
|
38
|
+
if (item.mustSelected)
|
|
39
|
+
btn.disabled = selectedRowKeys.length <= 0;
|
|
40
|
+
if (item.onClick)
|
|
41
|
+
btn.onClick = () => item.onClick(selectedRowKeys, selectedObjects, queryParam);
|
|
42
|
+
return btn;
|
|
43
|
+
};
|
|
44
|
+
const ActionBar = props => {
|
|
45
|
+
const update = (0, hooks_1.useUpdate)();
|
|
46
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
47
|
+
props.selectedRef.current.onSelected = () => {
|
|
48
|
+
update();
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
let buttons = [];
|
|
52
|
+
const [selectedRowKeys, selectedObjects] = props.selectedRef.current.selected;
|
|
53
|
+
(props.buttons || []).map(btn => {
|
|
54
|
+
if (btn === false)
|
|
55
|
+
return;
|
|
56
|
+
if (btn === null) {
|
|
57
|
+
buttons.push(null);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
let sub = convertButton(btn, selectedRowKeys, selectedObjects, props.queryParam);
|
|
61
|
+
if (lodash_1.default.isArray(btn.children) && btn.children.length > 0) {
|
|
62
|
+
sub.children = [];
|
|
63
|
+
btn.children.map(item => {
|
|
64
|
+
sub.children.push(convertButton(item, selectedRowKeys, selectedObjects, props.queryParam));
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
buttons.push(sub);
|
|
68
|
+
});
|
|
69
|
+
return react_1.default.createElement(ActionButtons_1.ActionButtons, { buttons: buttons });
|
|
70
|
+
};
|
|
71
|
+
exports.ActionBar = ActionBar;
|
|
72
|
+
/**
|
|
73
|
+
* 通用添加按钮
|
|
74
|
+
*/
|
|
75
|
+
const BUTTON_ADD = (onClick, props) => (Object.assign(Object.assign({ label: (0, i18n_1.txt)(Const_1.V.ACT_ADD), icon: 'plus', type: 'primary' }, props), { onClick }));
|
|
76
|
+
exports.BUTTON_ADD = BUTTON_ADD;
|
|
77
|
+
/**
|
|
78
|
+
* 通用删除按钮
|
|
79
|
+
*/
|
|
80
|
+
const BUTTON_DELETE = (onClick, props) => (Object.assign(Object.assign({ label: (0, i18n_1.txt)(Const_1.V.ACT_DELETE), icon: 'delete', danger: true, mustSelected: true, confirm: (0, i18n_1.txt)(Const_1.V.ACT_DELETE_BATCH) }, props), { onClick }));
|
|
81
|
+
exports.BUTTON_DELETE = BUTTON_DELETE;
|
|
82
|
+
/**
|
|
83
|
+
* 通用更多按钮,需要传子菜单
|
|
84
|
+
*/
|
|
85
|
+
const BUTTON_MORE = (children) => ({
|
|
86
|
+
label: (0, i18n_1.txt)(Const_1.V.BTN_MORE),
|
|
87
|
+
onClick: null,
|
|
88
|
+
children
|
|
89
|
+
});
|
|
90
|
+
exports.BUTTON_MORE = BUTTON_MORE;
|
|
91
|
+
/**
|
|
92
|
+
* 通用导入按钮
|
|
93
|
+
*/
|
|
94
|
+
const BUTTON_IMPORT = (onClick, props) => (Object.assign(Object.assign({ label: (0, i18n_1.txt)(Const_1.V.BTN_IMPORT), icon: 'import' }, props), { onClick }));
|
|
95
|
+
exports.BUTTON_IMPORT = BUTTON_IMPORT;
|
|
96
|
+
/**
|
|
97
|
+
* 通用导出按钮
|
|
98
|
+
*/
|
|
99
|
+
const BUTTON_EXPORT = (onClick, props) => (Object.assign(Object.assign({ label: (0, i18n_1.txt)(Const_1.V.BTN_EXPORT), icon: 'export' }, props), { onClick }));
|
|
100
|
+
exports.BUTTON_EXPORT = BUTTON_EXPORT;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TableColumn } from '../index';
|
|
3
|
+
import type { BaseItem } from '../../../basetype';
|
|
4
|
+
/**
|
|
5
|
+
* 表格通用操作,目前支持查看,编辑,删除
|
|
6
|
+
*/
|
|
7
|
+
export type ActionPorps = BaseItem & {
|
|
8
|
+
/**
|
|
9
|
+
* 对象名称
|
|
10
|
+
*/
|
|
11
|
+
name?: string;
|
|
12
|
+
/**
|
|
13
|
+
* 标题文字,默认
|
|
14
|
+
*/
|
|
15
|
+
title?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 点击方法
|
|
18
|
+
*/
|
|
19
|
+
onClick: () => void;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* 自定义操作
|
|
23
|
+
*/
|
|
24
|
+
export type CustomAcitonProps = ActionPorps & {
|
|
25
|
+
/**
|
|
26
|
+
* 在自定义操作中,title 为必填项
|
|
27
|
+
*/
|
|
28
|
+
title: string;
|
|
29
|
+
/**
|
|
30
|
+
* 图标ICON,
|
|
31
|
+
*/
|
|
32
|
+
icon?: string;
|
|
33
|
+
/**
|
|
34
|
+
* 自定义操作的样式,可以为 'INFO' | 'EDIT' | 'DELETE'
|
|
35
|
+
* 仅改变操作的颜色,如果是DELETE 样式,建议再传入 confrim
|
|
36
|
+
*/
|
|
37
|
+
type?: 'INFO' | 'EDIT' | 'DELETE';
|
|
38
|
+
/**
|
|
39
|
+
* 自定义操作的二次确认提示
|
|
40
|
+
*/
|
|
41
|
+
confrim?: React.ReactNode;
|
|
42
|
+
};
|
|
43
|
+
export declare const INFO: React.FC<ActionPorps>;
|
|
44
|
+
export declare const EDIT: React.FC<ActionPorps>;
|
|
45
|
+
export declare const DELETE: React.FC<ActionPorps>;
|
|
46
|
+
export declare const ACTION: React.FC<CustomAcitonProps>;
|
|
47
|
+
export declare const COL_OPERACTION: (props: TableColumn | ((value: any, record: any, index: number) => React.ReactNode)) => TableColumn;
|