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,186 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
|
+
const _register_1 = require("../../SearchBar/_register");
|
|
10
|
+
const antd_1 = require("antd");
|
|
11
|
+
const SearchFieldInput_1 = require("./SearchFieldInput");
|
|
12
|
+
const DateRange_1 = require("../../_common/DateRange");
|
|
13
|
+
const MonthRange_1 = require("../../_common/MonthRange");
|
|
14
|
+
const utils_1 = require("../../../utils");
|
|
15
|
+
(0, _register_1.registerSearchField)('datetime', (props) => {
|
|
16
|
+
const { field: { field, config, placeholder, allowClear, }, disabled, onChange, data, width } = props;
|
|
17
|
+
let param = {
|
|
18
|
+
allowClear: allowClear,
|
|
19
|
+
placeholder,
|
|
20
|
+
disabled,
|
|
21
|
+
format: lodash_1.default.has(config, 'format') ? config.format : utils_1.GLOBAL.CONFIG.DATE.DATE_TIME_FORMAT,
|
|
22
|
+
};
|
|
23
|
+
if (data[field])
|
|
24
|
+
param.value = (0, dayjs_1.default)(data[field]);
|
|
25
|
+
return react_1.default.createElement(antd_1.DatePicker, Object.assign({}, config, param, { style: { width }, showTime: true, onChange: date => onChange(date ? date.format(param.format) : '') }));
|
|
26
|
+
});
|
|
27
|
+
(0, _register_1.registerSearchField)('date', (props) => {
|
|
28
|
+
const { field: { field, config, placeholder, allowClear, }, disabled, onChange, data, width } = props;
|
|
29
|
+
let param = {
|
|
30
|
+
allowClear: allowClear,
|
|
31
|
+
placeholder,
|
|
32
|
+
disabled,
|
|
33
|
+
format: lodash_1.default.has(config, 'format') ? config.format : utils_1.GLOBAL.CONFIG.DATE.DATE_FORMAT,
|
|
34
|
+
};
|
|
35
|
+
if (data[field])
|
|
36
|
+
param.value = (0, dayjs_1.default)(data[field]);
|
|
37
|
+
return react_1.default.createElement(antd_1.DatePicker, Object.assign({}, config, param, { style: { width }, showTime: false, onChange: date => onChange(date ? date.format(param.format) : '') }));
|
|
38
|
+
});
|
|
39
|
+
(0, _register_1.registerSearchField)('month', (props) => {
|
|
40
|
+
const { field: { field, config, placeholder, allowClear, }, disabled, onChange, data, width } = props;
|
|
41
|
+
let param = {
|
|
42
|
+
allowClear,
|
|
43
|
+
placeholder,
|
|
44
|
+
disabled,
|
|
45
|
+
// showTime: false,
|
|
46
|
+
// format: _.has(config, 'format') ? config.format : GLOBAL.CONFIG.DATE.MONTH_FORMAT,
|
|
47
|
+
};
|
|
48
|
+
// param.showTime
|
|
49
|
+
// props.show
|
|
50
|
+
if (data[field])
|
|
51
|
+
param.value = (0, dayjs_1.default)(data[field]);
|
|
52
|
+
return react_1.default.createElement(antd_1.DatePicker.MonthPicker, Object.assign({}, config, param, { style: { width }, onChange: date => {
|
|
53
|
+
if (data == null) {
|
|
54
|
+
onChange('');
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (config == null) {
|
|
58
|
+
onChange(date.format(utils_1.GLOBAL.CONFIG.DATE.MONTH_FORMAT));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (config.showTime) {
|
|
62
|
+
onChange(date.format('YYYY-MM-01 00:00:00'));
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (config.showDate) {
|
|
66
|
+
onChange(date.format('YYYY-MM-01'));
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
onChange(date.format(utils_1.GLOBAL.CONFIG.DATE.MONTH_FORMAT));
|
|
70
|
+
} }));
|
|
71
|
+
});
|
|
72
|
+
const Range = (props) => {
|
|
73
|
+
const { field: { field, allowClear, }, disabled, onChange, data, width } = props;
|
|
74
|
+
let ptn = field.split(',');
|
|
75
|
+
if (ptn.length != 2) {
|
|
76
|
+
console.error('timerange field must hava a start and end, eg: field:"startTime,endTime"');
|
|
77
|
+
return react_1.default.createElement(SearchFieldInput_1.TEXT, Object.assign({}, props));
|
|
78
|
+
}
|
|
79
|
+
const [startField, endField] = ptn;
|
|
80
|
+
const params = {
|
|
81
|
+
showTime: props.showTime,
|
|
82
|
+
allowClear: allowClear !== false,
|
|
83
|
+
disabled,
|
|
84
|
+
onChange: ([start, end]) => onChange({
|
|
85
|
+
[startField]: start,
|
|
86
|
+
[endField]: end,
|
|
87
|
+
})
|
|
88
|
+
};
|
|
89
|
+
if (data[startField])
|
|
90
|
+
params.defaultStart = data[startField];
|
|
91
|
+
if (data[endField])
|
|
92
|
+
params.defaultEnd = data[endField];
|
|
93
|
+
return react_1.default.createElement(DateRange_1.DateRange, Object.assign({}, params));
|
|
94
|
+
};
|
|
95
|
+
const AntdRnage = (props) => {
|
|
96
|
+
const { field: { field, config, placeholder, allowClear, }, disabled, onChange, data, width } = props;
|
|
97
|
+
let ptn = field.split(',');
|
|
98
|
+
if (ptn.length != 2) {
|
|
99
|
+
console.error('timerange field must hava a start and end, eg: field:"startTime,endTime"');
|
|
100
|
+
return react_1.default.createElement(SearchFieldInput_1.TEXT, Object.assign({}, props));
|
|
101
|
+
}
|
|
102
|
+
const [startField, endField] = ptn;
|
|
103
|
+
const params = {
|
|
104
|
+
value: [undefined, undefined],
|
|
105
|
+
allowClear,
|
|
106
|
+
disabled,
|
|
107
|
+
};
|
|
108
|
+
if (data[startField])
|
|
109
|
+
params.value[0] = (0, dayjs_1.default)(data[startField]);
|
|
110
|
+
if (data[endField])
|
|
111
|
+
params.value[1] = (0, dayjs_1.default)(data[endField]);
|
|
112
|
+
let format = props.isDate ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss';
|
|
113
|
+
let showTime = !props.isDate;
|
|
114
|
+
if (props.isDate) {
|
|
115
|
+
if (config && config.showTime) {
|
|
116
|
+
showTime = true;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return react_1.default.createElement(antd_1.DatePicker.RangePicker, Object.assign({}, params, { style: { width }, showTime: !props.isDate && showTime, format: format, onChange: ([start, end]) => {
|
|
120
|
+
if (start && end) {
|
|
121
|
+
let startFormat, endFormat;
|
|
122
|
+
if (props.isDate) {
|
|
123
|
+
if (showTime) {
|
|
124
|
+
startFormat = 'YYYY-MM-DD 00:00:00';
|
|
125
|
+
endFormat = 'YYYY-MM-DD 23:59:59';
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
startFormat = 'YYYY-MM-DD';
|
|
129
|
+
endFormat = 'YYYY-MM-DD';
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
if (showTime === false) {
|
|
134
|
+
startFormat = 'YYYY-MM-DD 00:00:00';
|
|
135
|
+
endFormat = 'YYYY-MM-DD 23:59:59';
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
startFormat = 'YYYY-MM-DD HH:mm:ss';
|
|
139
|
+
endFormat = 'YYYY-MM-DD HH:mm:ss';
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
onChange({
|
|
143
|
+
[startField]: start.format(startFormat),
|
|
144
|
+
[endField]: end.format(endFormat),
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
onChange({
|
|
149
|
+
[startField]: undefined,
|
|
150
|
+
[endField]: undefined,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
} }));
|
|
154
|
+
// return <DatePicker.RangePicker
|
|
155
|
+
// style={{ width: '80%' }}
|
|
156
|
+
// {...params}
|
|
157
|
+
// {...field.config}
|
|
158
|
+
// />
|
|
159
|
+
};
|
|
160
|
+
const MonthRangePicker = (props) => {
|
|
161
|
+
const { field: { field, allowClear, config }, disabled, onChange, data, width } = props;
|
|
162
|
+
let ptn = field.split(',');
|
|
163
|
+
if (ptn.length != 2) {
|
|
164
|
+
console.error('timerange field must hava a start and end, eg: field:"startTime,endTime"');
|
|
165
|
+
return react_1.default.createElement(SearchFieldInput_1.TEXT, Object.assign({}, props));
|
|
166
|
+
}
|
|
167
|
+
const [startField, endField] = ptn;
|
|
168
|
+
const params = {
|
|
169
|
+
allowClear: allowClear !== false,
|
|
170
|
+
disabled,
|
|
171
|
+
onChange: ([start, end]) => onChange({
|
|
172
|
+
[startField]: start,
|
|
173
|
+
[endField]: end,
|
|
174
|
+
})
|
|
175
|
+
};
|
|
176
|
+
if (data[startField])
|
|
177
|
+
params.defaultStart = data[startField];
|
|
178
|
+
if (data[endField])
|
|
179
|
+
params.defaultEnd = data[endField];
|
|
180
|
+
return react_1.default.createElement(MonthRange_1.MonthRange, Object.assign({}, config, { width: width }, params));
|
|
181
|
+
};
|
|
182
|
+
(0, _register_1.registerSearchField)('daterange', (props) => react_1.default.createElement(AntdRnage, Object.assign({}, props, { isDate: true })), { defaultSpan: 2 });
|
|
183
|
+
(0, _register_1.registerSearchField)('daterange-single', (props) => react_1.default.createElement(Range, Object.assign({}, props, { showTime: false })), { defaultSpan: 2 });
|
|
184
|
+
(0, _register_1.registerSearchField)('timerange', (props) => react_1.default.createElement(AntdRnage, Object.assign({}, props, { isDate: false })), { defaultSpan: 2 });
|
|
185
|
+
(0, _register_1.registerSearchField)('timerange-single', (props) => react_1.default.createElement(Range, Object.assign({}, props, { showTime: true })), { defaultSpan: 2 });
|
|
186
|
+
(0, _register_1.registerSearchField)('monthrange', (props) => react_1.default.createElement(MonthRangePicker, Object.assign({}, props)), { defaultSpan: 2 });
|
|
@@ -0,0 +1,20 @@
|
|
|
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.TEXT = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const _register_1 = require("../../SearchBar/_register");
|
|
10
|
+
const antd_1 = require("antd");
|
|
11
|
+
const TEXT = (props) => {
|
|
12
|
+
const { field: { field, config, placeholder, allowClear, }, disabled, onChange, triggerSearch, data, width } = props;
|
|
13
|
+
return react_1.default.createElement(antd_1.Input, Object.assign({ allowClear: allowClear !== false, placeholder: placeholder, disabled: disabled }, config, { style: { width }, value: data[field], onChange: (evt) => onChange(evt.target.value), onPressEnter: () => triggerSearch() }));
|
|
14
|
+
};
|
|
15
|
+
exports.TEXT = TEXT;
|
|
16
|
+
(0, _register_1.registerSearchField)('text', exports.TEXT);
|
|
17
|
+
(0, _register_1.registerSearchField)('number', (props) => {
|
|
18
|
+
const { field: { field, config, placeholder }, onChange, triggerSearch, data, width, disabled } = props;
|
|
19
|
+
return react_1.default.createElement(antd_1.InputNumber, Object.assign({ disabled: disabled, placeholder: lodash_1.default.has(config, 'placeholder') ? config.placeholder : placeholder }, config, { style: { width }, value: data[field], onChange: onChange, onPressEnter: () => triggerSearch() }));
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const utils_1 = require("../../../utils");
|
|
9
|
+
const _register_1 = require("../../SearchBar/_register");
|
|
10
|
+
const antd_1 = require("antd");
|
|
11
|
+
const SearchFieldInput_1 = require("./SearchFieldInput");
|
|
12
|
+
(0, _register_1.registerSearchField)('select', (props) => {
|
|
13
|
+
const { field: { field, config, placeholder, allowClear, }, disabled, onChange, data, width } = props;
|
|
14
|
+
if (!lodash_1.default.isArray(props.field.options)) {
|
|
15
|
+
console.error('field type : select must have a options field');
|
|
16
|
+
return react_1.default.createElement(SearchFieldInput_1.TEXT, Object.assign({}, props));
|
|
17
|
+
}
|
|
18
|
+
let options = utils_1.PageUtil.getOptions(props.field.options);
|
|
19
|
+
let param = {
|
|
20
|
+
disabled: disabled,
|
|
21
|
+
allowClear: typeof allowClear == 'boolean' ? allowClear : true,
|
|
22
|
+
placeholder: lodash_1.default.has(config, 'placeholder') ? config.placeholder : placeholder,
|
|
23
|
+
value: (lodash_1.default.has(data, field) && data[field] !== null) ? data[field] : undefined,
|
|
24
|
+
style: { width },
|
|
25
|
+
};
|
|
26
|
+
return react_1.default.createElement(antd_1.Select, Object.assign({}, param, config, { onChange: value => onChange(value) }), options.map(option => react_1.default.createElement(antd_1.Select.Option, { value: option.value }, option.label)));
|
|
27
|
+
});
|
|
28
|
+
(0, _register_1.registerSearchField)('multi-select', (props) => {
|
|
29
|
+
const { field: { field, config, placeholder, allowClear, }, disabled, onChange, data, width } = props;
|
|
30
|
+
if (!lodash_1.default.isArray(props.field.options)) {
|
|
31
|
+
console.error('field type : select must have a options field');
|
|
32
|
+
return react_1.default.createElement(SearchFieldInput_1.TEXT, Object.assign({}, props));
|
|
33
|
+
}
|
|
34
|
+
let options = utils_1.PageUtil.getOptions(props.field.options);
|
|
35
|
+
let param = {
|
|
36
|
+
disabled: disabled,
|
|
37
|
+
allowClear: typeof allowClear == 'boolean' ? allowClear : true,
|
|
38
|
+
placeholder: lodash_1.default.has(config, 'placeholder') ? config.placeholder : placeholder,
|
|
39
|
+
value: (lodash_1.default.has(data, field) && data[field] !== null) ? data[field].split(',') : [],
|
|
40
|
+
style: { width },
|
|
41
|
+
};
|
|
42
|
+
return react_1.default.createElement(antd_1.Select, Object.assign({}, param, config, { mode: "multiple", onChange: (value) => onChange(value.join(',')) }), options.map(option => react_1.default.createElement(antd_1.Select.Option, { value: option.value + '' }, option.label)));
|
|
43
|
+
});
|
|
44
|
+
(0, _register_1.registerSearchField)('radio', (props) => {
|
|
45
|
+
const { field: { field, config, }, disabled, onChange, data } = props;
|
|
46
|
+
if (!lodash_1.default.isArray(props.field.options)) {
|
|
47
|
+
console.error('field type : select must have a options field');
|
|
48
|
+
return react_1.default.createElement(SearchFieldInput_1.TEXT, Object.assign({}, props));
|
|
49
|
+
}
|
|
50
|
+
let options = utils_1.PageUtil.getOptions(props.field.options);
|
|
51
|
+
return react_1.default.createElement(antd_1.Radio.Group, Object.assign({}, config, { disabled: disabled, onChange: evt => onChange(evt.target.value), value: (lodash_1.default.has(data, field) && data[field] !== null) ? data[field] : undefined, optionType: "default", options: options }));
|
|
52
|
+
}, { outside: true });
|
|
53
|
+
(0, _register_1.registerSearchField)('radio-button', (props) => {
|
|
54
|
+
const { field: { field, config, placeholder, allowClear, }, disabled, onChange, data, width } = props;
|
|
55
|
+
if (!lodash_1.default.isArray(props.field.options)) {
|
|
56
|
+
console.error('field type : select must have a options field');
|
|
57
|
+
return react_1.default.createElement(SearchFieldInput_1.TEXT, Object.assign({}, props));
|
|
58
|
+
}
|
|
59
|
+
let options = utils_1.PageUtil.getOptions(props.field.options);
|
|
60
|
+
return react_1.default.createElement(antd_1.Radio.Group, Object.assign({}, config, { style: { width }, disabled: disabled, onChange: evt => onChange(evt.target.value), value: (lodash_1.default.has(data, field) && data[field] !== null) ? data[field] : undefined, optionType: "button", buttonStyle: "solid", options: options }));
|
|
61
|
+
});
|
|
62
|
+
(0, _register_1.registerSearchField)('checkbox', (props) => {
|
|
63
|
+
const { field: { field, config, }, disabled, onChange, data, width } = props;
|
|
64
|
+
if (!lodash_1.default.isArray(props.field.options)) {
|
|
65
|
+
console.error('field type : select must have a options field');
|
|
66
|
+
return react_1.default.createElement(SearchFieldInput_1.TEXT, Object.assign({}, props));
|
|
67
|
+
}
|
|
68
|
+
let options = utils_1.PageUtil.getOptions(props.field.options);
|
|
69
|
+
return react_1.default.createElement(antd_1.Checkbox.Group, Object.assign({}, config, { className: "i-checkbox", disabled: disabled, onChange: val => onChange(val.join(',')), value: (lodash_1.default.has(data, field) && data[field]) ? data[field].split(',') : [] }), options.map(option => react_1.default.createElement(antd_1.Checkbox, { value: option.value + '' }, option.label)));
|
|
70
|
+
}, { outside: true });
|
|
71
|
+
// registerSearchField('checkbox-button', (props: SearchFieldProps) => {
|
|
72
|
+
// const { field: { field, config, placeholder, allowClear, }, disabled, onChange, data, width } = props;
|
|
73
|
+
// if (!_.isArray(props.field.options)) {
|
|
74
|
+
// console.error('field type : select must have a options field')
|
|
75
|
+
// return <TEXT {...props} />
|
|
76
|
+
// }
|
|
77
|
+
// let options = PageUtil.getOptions(props.field.options);
|
|
78
|
+
// return <Checkbox.Group
|
|
79
|
+
// {...config}
|
|
80
|
+
// style={{ width }}
|
|
81
|
+
// optionType="button"
|
|
82
|
+
// buttonStyle="solid"
|
|
83
|
+
// disabled={disabled}
|
|
84
|
+
// onChange={val => onChange(val.join(','))}
|
|
85
|
+
// value={(_.has(data, field) && data[field].split(',')) ? data[field] : undefined}
|
|
86
|
+
// options={options}
|
|
87
|
+
// >
|
|
88
|
+
// {/* {options.map(option => <Checkbox value={option.value + ''}>{option.label}</Checkbox>)} */}
|
|
89
|
+
// </Checkbox.Group>
|
|
90
|
+
// });
|
|
91
|
+
(0, _register_1.registerSearchField)('switch', (props) => {
|
|
92
|
+
const { field: { field, config, placeholder, allowClear, }, disabled, onChange, data, width } = props;
|
|
93
|
+
if (!lodash_1.default.isArray(props.field.options) || (props.field.options.length <= 1)) {
|
|
94
|
+
console.error('Type Switch Must have 2 Options');
|
|
95
|
+
return react_1.default.createElement(SearchFieldInput_1.TEXT, Object.assign({}, props));
|
|
96
|
+
}
|
|
97
|
+
let options = utils_1.PageUtil.getOptions(props.field.options);
|
|
98
|
+
let CHECKED = utils_1.GLOBAL.CONFIG.FORM.SWITCH_DEFAULT_CHECKED;
|
|
99
|
+
if (lodash_1.default.has(config, 'reverse') && config.reverse)
|
|
100
|
+
CHECKED = 1 - CHECKED;
|
|
101
|
+
let UNCHECKED = 1 - CHECKED;
|
|
102
|
+
return react_1.default.createElement(antd_1.Switch, Object.assign({ checkedChildren: options[CHECKED].label, unCheckedChildren: options[UNCHECKED].label }, config, { disabled: disabled, checked: (lodash_1.default.has(data, field) && data[field] == options[CHECKED].value), onChange: (isCheck, evt) => {
|
|
103
|
+
utils_1.PageUtil.stopEvent(evt);
|
|
104
|
+
onChange(isCheck ? options[CHECKED].value : options[UNCHECKED].value);
|
|
105
|
+
} }));
|
|
106
|
+
}, { outside: true });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// registerSearchField('treeselect', (props: TableSelectFieldProps) => {
|
|
4
|
+
// const { field, onChange, width, data } = props;
|
|
5
|
+
// if (!_.has(field.config, 'treeData')) {
|
|
6
|
+
// console.error('field type : dictselect must have a treeData field')
|
|
7
|
+
// return <TEXT {...props} style={width ? { width } : {}} />
|
|
8
|
+
// }
|
|
9
|
+
// let param: any = {
|
|
10
|
+
// allowClear: true,
|
|
11
|
+
// placeholder: _.has(field.config, 'placeholder') ? field.config.placeholder : null || field.placeholder || `请选择${field.label}`,
|
|
12
|
+
// };
|
|
13
|
+
// if (field.allowClear === false) {
|
|
14
|
+
// param.allowClear = false;
|
|
15
|
+
// }
|
|
16
|
+
// if (_.has(data, field.field)) {
|
|
17
|
+
// param.value = data[field.field] || undefined;
|
|
18
|
+
// }
|
|
19
|
+
// if (_.has(props, 'width')) {
|
|
20
|
+
// param.style = { width: props.width }
|
|
21
|
+
// }
|
|
22
|
+
// return <TreeSelect
|
|
23
|
+
// treeDefaultExpandAll
|
|
24
|
+
// {...field.config}
|
|
25
|
+
// {...param}
|
|
26
|
+
// dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
|
|
27
|
+
// onChange={value => onChange(value)}
|
|
28
|
+
// />
|
|
29
|
+
// });
|
|
30
|
+
// 动态树
|
|
31
|
+
// type TreeNodeData = {
|
|
32
|
+
// children?: TreeNodeData[];
|
|
33
|
+
// [props: string]: any
|
|
34
|
+
// }
|
|
35
|
+
// export type BaseTreeOpts = {
|
|
36
|
+
// /**
|
|
37
|
+
// * 树取值的字段,默认为 `id`
|
|
38
|
+
// */
|
|
39
|
+
// keyField?: string,
|
|
40
|
+
// /**
|
|
41
|
+
// * 树显示名称的字段 ,默认为 `name`
|
|
42
|
+
// */
|
|
43
|
+
// titleField?: string,
|
|
44
|
+
// /**
|
|
45
|
+
// * 排序字段,默认为空,传入后,以此字段做为排序依据
|
|
46
|
+
// */
|
|
47
|
+
// sortField?: string;
|
|
48
|
+
// /**
|
|
49
|
+
// * 根节点 Code 标识
|
|
50
|
+
// */
|
|
51
|
+
// rootCode?: string;
|
|
52
|
+
// /**
|
|
53
|
+
// * 根节点API 与rootCode 二选一
|
|
54
|
+
// */
|
|
55
|
+
// rootApi?: string;
|
|
56
|
+
// /**
|
|
57
|
+
// * 是否存在子节点,如果有些属性,则根据此值不必多点一次加号
|
|
58
|
+
// */
|
|
59
|
+
// checkField?: string;
|
|
60
|
+
// /**
|
|
61
|
+
// * 展开子节点:
|
|
62
|
+
// *
|
|
63
|
+
// * 方式一:传一个 api 接口地址,必须返回 VData<Array<Object>> 格式
|
|
64
|
+
// *
|
|
65
|
+
// * 方式二:传一个方法 ,接收一个父节点参数,必须返回 Promise<TreeNodeData[]> (不要返回 children, 仅返回一级)
|
|
66
|
+
// */
|
|
67
|
+
// childApi?: string | ((parentId: string) => Promise<TreeNodeData[]>);
|
|
68
|
+
// }
|
|
69
|
+
// class DynamicTreeSelect extends React.PureComponent<TableSelectFieldProps> {
|
|
70
|
+
// fields: BaseTreeOpts = {
|
|
71
|
+
// keyField: 'id',
|
|
72
|
+
// titleField: 'title',
|
|
73
|
+
// }
|
|
74
|
+
// state = {
|
|
75
|
+
// treeData: [],
|
|
76
|
+
// }
|
|
77
|
+
// async getChildren(parentCode) {
|
|
78
|
+
// if (typeof this.props.field.config.childApi == 'string') {
|
|
79
|
+
// const resp = await Ajax.GET(`${this.props.field.config.childApi}${parentCode}`);
|
|
80
|
+
// if (resp.code == '0') {
|
|
81
|
+
// return resp.data;
|
|
82
|
+
// }
|
|
83
|
+
// return []
|
|
84
|
+
// }
|
|
85
|
+
// let children = await this.props.field.config.childApi(parentCode);
|
|
86
|
+
// return children;
|
|
87
|
+
// }
|
|
88
|
+
// async componentDidMount() {
|
|
89
|
+
// const { field } = this.props;
|
|
90
|
+
// if (!_.has(field, 'config.childApi')) {
|
|
91
|
+
// return;
|
|
92
|
+
// }
|
|
93
|
+
// const config: BaseTreeOpts = field.config;
|
|
94
|
+
// if (config.keyField) {
|
|
95
|
+
// this.fields.keyField = config.keyField;
|
|
96
|
+
// }
|
|
97
|
+
// if (config.titleField) {
|
|
98
|
+
// this.fields.titleField = config.titleField;
|
|
99
|
+
// }
|
|
100
|
+
// if (config.sortField) {
|
|
101
|
+
// this.fields.sortField = config.sortField;
|
|
102
|
+
// }
|
|
103
|
+
// if (config.checkField) {
|
|
104
|
+
// this.fields.checkField = config.checkField;
|
|
105
|
+
// }
|
|
106
|
+
// let treeData = [];
|
|
107
|
+
// if (config.rootCode) {
|
|
108
|
+
// treeData = await this.getChildren(config.rootCode);
|
|
109
|
+
// } else if (config.rootApi) {
|
|
110
|
+
// const resp = await Ajax.GET(config.rootApi);
|
|
111
|
+
// if (resp.code == '0') {
|
|
112
|
+
// if (_.isArray(resp.data)) {
|
|
113
|
+
// treeData = resp.data;
|
|
114
|
+
// } else {
|
|
115
|
+
// treeData = [resp.data];
|
|
116
|
+
// }
|
|
117
|
+
// }
|
|
118
|
+
// }
|
|
119
|
+
// this.setState({ treeData });
|
|
120
|
+
// };
|
|
121
|
+
// setChidren(treeData: any[], key: string, children: any[]) {
|
|
122
|
+
// for (let node of treeData) {
|
|
123
|
+
// if (node[this.fields.keyField] == key) {
|
|
124
|
+
// node.children = children;
|
|
125
|
+
// return true;
|
|
126
|
+
// } else if (_.isArray(node.children) && node.children.length) {
|
|
127
|
+
// return this.setChidren(node.children, key, children);
|
|
128
|
+
// }
|
|
129
|
+
// }
|
|
130
|
+
// return false;
|
|
131
|
+
// }
|
|
132
|
+
// async onLoadData(node) {
|
|
133
|
+
// const children = await this.getChildren(node.props.eventKey);
|
|
134
|
+
// if (children.length == 0) {
|
|
135
|
+
// return;
|
|
136
|
+
// }
|
|
137
|
+
// const treeData = _.concat([], this.state.treeData);
|
|
138
|
+
// this.setChidren(treeData, node.props.eventKey, children)
|
|
139
|
+
// this.setState({ treeData })
|
|
140
|
+
// };
|
|
141
|
+
// renderNode(data: any) {
|
|
142
|
+
// let isLeaf = false;
|
|
143
|
+
// if (_.has(data, 'children') && _.isArray(data.children)) {
|
|
144
|
+
// if (data.children.length) {
|
|
145
|
+
// isLeaf = false;
|
|
146
|
+
// } else {
|
|
147
|
+
// isLeaf = true;
|
|
148
|
+
// }
|
|
149
|
+
// } else if (this.fields.checkField) {
|
|
150
|
+
// if (!data[this.fields.checkField]) {
|
|
151
|
+
// isLeaf = true;
|
|
152
|
+
// }
|
|
153
|
+
// }
|
|
154
|
+
// if (isLeaf) {
|
|
155
|
+
// return <TreeSelect.TreeNode value={data[this.fields.keyField]} key={data[this.fields.keyField]} title={data[this.fields.titleField]} isLeaf> </TreeSelect.TreeNode>
|
|
156
|
+
// }
|
|
157
|
+
// if (_.isArray(data.children) && data.children.length) {
|
|
158
|
+
// return <TreeSelect.TreeNode value={data[this.fields.keyField]} key={data[this.fields.keyField]} title={data[this.fields.titleField]}>
|
|
159
|
+
// {data.children.map(item => this.renderNode(item))}
|
|
160
|
+
// </TreeSelect.TreeNode>
|
|
161
|
+
// }
|
|
162
|
+
// return <TreeSelect.TreeNode value={data[this.fields.keyField]} key={data[this.fields.keyField]} title={data[this.fields.titleField]}> </TreeSelect.TreeNode>
|
|
163
|
+
// }
|
|
164
|
+
// render() {
|
|
165
|
+
// const { field, onChange, data } = this.props;
|
|
166
|
+
// const { treeData } = this.state;
|
|
167
|
+
// let param: any = {
|
|
168
|
+
// allowClear: true,
|
|
169
|
+
// placeholder: _.has(field.config, 'placeholder') ? field.config.placeholder : null || field.placeholder || `请选择 ${field.label}`,
|
|
170
|
+
// }
|
|
171
|
+
// if (field.allowClear === false) {
|
|
172
|
+
// param.allowClear = false;
|
|
173
|
+
// }
|
|
174
|
+
// if (_.has(data, field.field)) {
|
|
175
|
+
// param.value = data[field.field];
|
|
176
|
+
// }
|
|
177
|
+
// if (_.has(this.props, 'width')) {
|
|
178
|
+
// param.style = { width: this.props.width }
|
|
179
|
+
// }
|
|
180
|
+
// return <TreeSelect
|
|
181
|
+
// {...param}
|
|
182
|
+
// onChange={(value, label, extra) => {
|
|
183
|
+
// onChange(value)
|
|
184
|
+
// }}
|
|
185
|
+
// loadData={(node) => this.onLoadData(node)}
|
|
186
|
+
// >
|
|
187
|
+
// {treeData.map(item => this.renderNode(item))}
|
|
188
|
+
// </TreeSelect>
|
|
189
|
+
// }
|
|
190
|
+
// }
|
|
191
|
+
// registerSearchField('dynamic-tree-select', DynamicTreeSelect);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const _register_1 = require("../../Box/_register");
|
|
9
|
+
const Const_1 = require("../../../utils/Const");
|
|
10
|
+
const SList_1 = require("../../Lists/SList");
|
|
11
|
+
(0, _register_1.registerSelectBar)('slist', props => {
|
|
12
|
+
const { searchValue, onSelect, config } = props;
|
|
13
|
+
const listProps = {
|
|
14
|
+
keyField: lodash_1.default.has(config, 'keyField') ? config['keyField'] : 'id',
|
|
15
|
+
titleField: lodash_1.default.has(config, 'titleField') ? config['titleField'] : 'name',
|
|
16
|
+
list: (lodash_1.default.has(config, 'list') && lodash_1.default.isArray(config.list)) ? config.list : []
|
|
17
|
+
};
|
|
18
|
+
return react_1.default.createElement(SList_1.SList, Object.assign({}, props.config, listProps, { onSelect: onSelect, searchValue: searchValue }));
|
|
19
|
+
});
|
|
20
|
+
// 自定义时,不接收任何参数
|
|
21
|
+
(0, _register_1.registerSelectBar)('custom', (props) => Const_1.NONE);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const _register_1 = require("../../Box/_register");
|
|
8
|
+
const Trees_1 = require("../../Trees");
|
|
9
|
+
(0, _register_1.registerSelectBar)('stree', (props) => react_1.default.createElement(Trees_1.STree, Object.assign({}, props.config, { onSelect: props.onSelect, searchValue: props.searchValue })));
|
|
10
|
+
(0, _register_1.registerSelectBar)('ftree', react_1.default.forwardRef((props, ref) => react_1.default.createElement(Trees_1.FTree, Object.assign({}, props.config, { onSelect: props.onSelect, searchValue: props.searchValue, ref: ref }))));
|
|
11
|
+
(0, _register_1.registerSelectBar)('dtree', react_1.default.forwardRef((props, ref) => react_1.default.createElement(Trees_1.DTree, Object.assign({}, props.config, { onSelect: props.onSelect, searchValue: props.searchValue, ref: ref }))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|