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,167 @@
|
|
|
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.SList = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
32
|
+
const utils_1 = require("../../utils");
|
|
33
|
+
const Icon_1 = require("../_adapt/Icon");
|
|
34
|
+
const HighLight_1 = require("../_common/HighLight");
|
|
35
|
+
const antd_1 = require("antd");
|
|
36
|
+
const Item = props => react_1.default.createElement("div", { className: 'v-select-list-item', title: props.title }, props.children);
|
|
37
|
+
const ItemIcon = props => {
|
|
38
|
+
const { value } = props;
|
|
39
|
+
if (lodash_1.default.isString(value)) {
|
|
40
|
+
return react_1.default.createElement(Icon_1.Icon, { className: 'v-select-list-item-icon', type: value });
|
|
41
|
+
}
|
|
42
|
+
if (lodash_1.default.isPlainObject(value)) {
|
|
43
|
+
let props = Object.assign({}, value);
|
|
44
|
+
if (!lodash_1.default.isString(props.type) || props.type == null || props.type == '')
|
|
45
|
+
return utils_1.Const.NONE;
|
|
46
|
+
if (props.className) {
|
|
47
|
+
props.className = props.className + ' v-select-list-item-icon';
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
props.className = 'v-select-list-item-icon';
|
|
51
|
+
}
|
|
52
|
+
return react_1.default.createElement(Icon_1.Icon, Object.assign({}, props));
|
|
53
|
+
}
|
|
54
|
+
if (react_1.default.isValidElement(value)) {
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
return utils_1.Const.NONE;
|
|
58
|
+
//
|
|
59
|
+
};
|
|
60
|
+
const buildRenderByRender = (props) => {
|
|
61
|
+
let { titleField, renders } = props;
|
|
62
|
+
const hasIcon = lodash_1.default.isFunction(renders.icon);
|
|
63
|
+
const hasAction = lodash_1.default.isFunction(renders.action);
|
|
64
|
+
const hasValue = !hasAction && lodash_1.default.isFunction(renders.value);
|
|
65
|
+
return (item, searchValue) => react_1.default.createElement(Item, { title: item[titleField] },
|
|
66
|
+
hasIcon && react_1.default.createElement(ItemIcon, { value: renders.icon(item, searchValue) }),
|
|
67
|
+
react_1.default.createElement("span", { className: 'v-select-list-item-title' }, renders.title(item, searchValue)),
|
|
68
|
+
hasAction && react_1.default.createElement("span", { className: 'v-select-list-item-action' }, renders.action(item, searchValue)),
|
|
69
|
+
hasValue && react_1.default.createElement("span", { className: 'v-select-list-item-value' }, renders.value(item, searchValue)));
|
|
70
|
+
};
|
|
71
|
+
const buildRenderByField = (props) => {
|
|
72
|
+
let iconField = props.iconField || null;
|
|
73
|
+
let valueField = props.valueField || null;
|
|
74
|
+
let titleField = props.titleField;
|
|
75
|
+
return (item, searchValue) => {
|
|
76
|
+
if (searchValue) {
|
|
77
|
+
return react_1.default.createElement(Item, { title: item[titleField] },
|
|
78
|
+
(iconField && item[iconField]) && react_1.default.createElement(Icon_1.Icon, { className: 'v-select-list-item-icon', type: item[iconField] }),
|
|
79
|
+
react_1.default.createElement("span", { className: 'v-select-list-item-title' },
|
|
80
|
+
react_1.default.createElement(HighLight_1.HighLight, { text: item[titleField], keyword: searchValue })),
|
|
81
|
+
valueField && react_1.default.createElement("span", { className: 'v-select-list-item-value' }, item[valueField]));
|
|
82
|
+
}
|
|
83
|
+
return react_1.default.createElement(Item, { title: item[titleField] },
|
|
84
|
+
(iconField && item[iconField]) && react_1.default.createElement(Icon_1.Icon, { className: 'v-select-list-item-icon', type: item[iconField] }),
|
|
85
|
+
react_1.default.createElement("span", { className: 'v-select-list-item-title' }, item[titleField]),
|
|
86
|
+
valueField && react_1.default.createElement("span", { className: 'v-select-list-item-value' }, item[valueField]));
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
// export const SList: React.FC<SListPorps> = memo((props) => {
|
|
90
|
+
exports.SList = (0, react_1.memo)((props) => {
|
|
91
|
+
const { searchValue, onSelect, keyField } = props;
|
|
92
|
+
const [list, setList] = (0, react_1.useState)((lodash_1.default.has(props, 'list') && lodash_1.default.isArray(props.list)) ? props.list : []);
|
|
93
|
+
const [selected, setSelected] = (0, react_1.useState)(null);
|
|
94
|
+
const render = (0, react_1.useMemo)(() => {
|
|
95
|
+
if (lodash_1.default.isFunction(props.itemRender))
|
|
96
|
+
return props.itemRender;
|
|
97
|
+
if (lodash_1.default.has(props, 'renders') && lodash_1.default.isFunction(props.renders.title))
|
|
98
|
+
return buildRenderByRender(props);
|
|
99
|
+
return buildRenderByField(props);
|
|
100
|
+
}, []);
|
|
101
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
102
|
+
const all = (lodash_1.default.has(props, 'list') && lodash_1.default.isArray(props.list)) ? props.list : [];
|
|
103
|
+
if (searchValue == null || searchValue == '') {
|
|
104
|
+
setList(all);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
setList(lodash_1.default.filter(all, item => {
|
|
108
|
+
let title = lodash_1.default.toLower(item[props.titleField]);
|
|
109
|
+
return title.indexOf(searchValue) >= 0;
|
|
110
|
+
}));
|
|
111
|
+
}, [searchValue, props.list]);
|
|
112
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
113
|
+
if (list == null || list.length == 0) {
|
|
114
|
+
if (selected != null)
|
|
115
|
+
setSelected(null);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (!props.mustSelect)
|
|
119
|
+
return;
|
|
120
|
+
if (selected != null) {
|
|
121
|
+
let find = lodash_1.default.find(list, { [keyField]: selected });
|
|
122
|
+
if (find != null) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
let item = list[0];
|
|
127
|
+
if (lodash_1.default.isFunction(props.mustSelect)) {
|
|
128
|
+
item = props.mustSelect(list);
|
|
129
|
+
}
|
|
130
|
+
;
|
|
131
|
+
if (item == null || item[keyField] == null) {
|
|
132
|
+
item = list[0];
|
|
133
|
+
}
|
|
134
|
+
setSelected(item[keyField]);
|
|
135
|
+
onSelect(item[keyField], item);
|
|
136
|
+
}, [list]);
|
|
137
|
+
const listProps = {
|
|
138
|
+
className: 'c-selectbar-list',
|
|
139
|
+
size: "small",
|
|
140
|
+
dataSource: list,
|
|
141
|
+
};
|
|
142
|
+
if (lodash_1.default.isFunction(props.onSelect)) {
|
|
143
|
+
listProps.className += ' c-selectbar-list-canselect';
|
|
144
|
+
listProps.renderItem = (item) => react_1.default.createElement(antd_1.List.Item, { className: item[keyField] == selected ? 'c-selectbar-list-selected' : '', onClick: evt => {
|
|
145
|
+
utils_1.PageUtil.stopEvent(evt);
|
|
146
|
+
setSelected(item[keyField]);
|
|
147
|
+
onSelect(item[keyField], item);
|
|
148
|
+
} }, render(item, searchValue));
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
listProps.renderItem = (item) => react_1.default.createElement(antd_1.List.Item, null, render(item, searchValue));
|
|
152
|
+
}
|
|
153
|
+
return react_1.default.createElement(antd_1.List, Object.assign({}, listProps));
|
|
154
|
+
}, (prev, next) => {
|
|
155
|
+
if (prev.searchValue != next.searchValue)
|
|
156
|
+
return false;
|
|
157
|
+
let plist = (lodash_1.default.has(prev, 'list') && lodash_1.default.isArray(prev.list)) ? prev.list : [];
|
|
158
|
+
let nlist = (lodash_1.default.has(next, 'list') && lodash_1.default.isArray(next.list)) ? next.list : [];
|
|
159
|
+
if (plist.length != nlist.length)
|
|
160
|
+
return false;
|
|
161
|
+
return plist == nlist;
|
|
162
|
+
// const keyField = _.has(prev, 'keyField') ? prev['keyField'] : 'id';
|
|
163
|
+
// let pk = plist.map(item => item[keyField]).join('-');
|
|
164
|
+
// let nk = nlist.map(item => item[keyField]).join('-');
|
|
165
|
+
// if (pk != nk) return false;
|
|
166
|
+
// return true;
|
|
167
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ButtonType, OButtonProps as ButtonProps } from '../_adapt/Button';
|
|
3
|
+
import type { ButtonSize } from 'antd/es/button';
|
|
4
|
+
export type ActButton = {
|
|
5
|
+
/**
|
|
6
|
+
* Icon 图标
|
|
7
|
+
*/
|
|
8
|
+
icon?: string | React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* 按钮样式类型
|
|
11
|
+
*/
|
|
12
|
+
type?: ButtonType;
|
|
13
|
+
/**
|
|
14
|
+
* 是否危险操作
|
|
15
|
+
*/
|
|
16
|
+
danger?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 按钮标签
|
|
19
|
+
*/
|
|
20
|
+
label: string;
|
|
21
|
+
/**
|
|
22
|
+
* 按钮权限码
|
|
23
|
+
*/
|
|
24
|
+
roleCode?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 提示信息
|
|
27
|
+
*/
|
|
28
|
+
confirm?: string | ((props?: any) => string | React.ReactNode);
|
|
29
|
+
/**
|
|
30
|
+
* 自定义的按钮属性
|
|
31
|
+
*/
|
|
32
|
+
config?: ButtonProps;
|
|
33
|
+
/**
|
|
34
|
+
* 点击事件
|
|
35
|
+
*/
|
|
36
|
+
onClick: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* 是否禁用
|
|
39
|
+
*/
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 说明 : 最多支持2级子菜单,不能递归
|
|
43
|
+
*/
|
|
44
|
+
children?: ActButton[];
|
|
45
|
+
};
|
|
46
|
+
export declare const ActionButtons: React.FC<{
|
|
47
|
+
buttons: (ActButton | null | false)[];
|
|
48
|
+
size?: ButtonSize;
|
|
49
|
+
}>;
|
|
@@ -0,0 +1,96 @@
|
|
|
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.ActionButtons = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const antd_1 = require("antd");
|
|
10
|
+
const Icon_1 = require("../_adapt/Icon");
|
|
11
|
+
const Button_1 = require("../_adapt/Button");
|
|
12
|
+
const Dropdown_1 = require("../_adapt/Dropdown");
|
|
13
|
+
const utils_1 = require("../../utils");
|
|
14
|
+
const getIcon = (icon) => {
|
|
15
|
+
if (lodash_1.default.isString(icon)) {
|
|
16
|
+
return react_1.default.createElement(Icon_1.Icon, { type: icon });
|
|
17
|
+
}
|
|
18
|
+
return icon;
|
|
19
|
+
};
|
|
20
|
+
const ActionButton = (props) => {
|
|
21
|
+
if (props.children && props.children.length > 0) {
|
|
22
|
+
let btnParam = {};
|
|
23
|
+
if (lodash_1.default.has(props, 'type'))
|
|
24
|
+
btnParam.type = props.type;
|
|
25
|
+
if (props.danger)
|
|
26
|
+
btnParam.danger = true;
|
|
27
|
+
if (props.disabled)
|
|
28
|
+
btnParam.disabled = true;
|
|
29
|
+
if (lodash_1.default.isFunction(props.onClick))
|
|
30
|
+
btnParam.onClick = evt => utils_1.PageUtil.stopEvent(evt, props.onClick);
|
|
31
|
+
let menus = [];
|
|
32
|
+
props.children.map((item, key) => {
|
|
33
|
+
if (item.roleCode && !utils_1.PageUtil.hasRole(item.roleCode))
|
|
34
|
+
return;
|
|
35
|
+
let menu = {
|
|
36
|
+
key,
|
|
37
|
+
title: item.label,
|
|
38
|
+
label: item.label,
|
|
39
|
+
};
|
|
40
|
+
if (item.icon)
|
|
41
|
+
menu.icon = getIcon(item.icon);
|
|
42
|
+
if (item.onClick)
|
|
43
|
+
menu.onClick = evt => {
|
|
44
|
+
utils_1.PageUtil.stopEvent(evt);
|
|
45
|
+
item.onClick();
|
|
46
|
+
};
|
|
47
|
+
menus.push(menu);
|
|
48
|
+
});
|
|
49
|
+
if (menus.length == 0)
|
|
50
|
+
return utils_1.Const.NONE;
|
|
51
|
+
return react_1.default.createElement(Dropdown_1.Dropdown, { menu: { items: menus } },
|
|
52
|
+
react_1.default.createElement(Button_1.Button, Object.assign({}, btnParam),
|
|
53
|
+
props.label,
|
|
54
|
+
" ",
|
|
55
|
+
react_1.default.createElement(Icon_1.Icon, { type: "down" })));
|
|
56
|
+
}
|
|
57
|
+
let btnParam = {};
|
|
58
|
+
if (props.icon)
|
|
59
|
+
btnParam.icon = getIcon(props.icon);
|
|
60
|
+
if (lodash_1.default.has(props, 'type'))
|
|
61
|
+
btnParam.type = props.type;
|
|
62
|
+
if (props.disabled)
|
|
63
|
+
btnParam.disabled = true;
|
|
64
|
+
if (props.danger)
|
|
65
|
+
btnParam.danger = true;
|
|
66
|
+
if (props.confirm && props.disabled !== true) {
|
|
67
|
+
return react_1.default.createElement(antd_1.Popconfirm, { trigger: "click", placement: "bottomLeft", onConfirm: props.onClick, title: lodash_1.default.isString(props.confirm) ? props.confirm : props.confirm() },
|
|
68
|
+
react_1.default.createElement(Button_1.Button, Object.assign({}, props.config, btnParam), props.label));
|
|
69
|
+
}
|
|
70
|
+
btnParam.onClick = (evt) => utils_1.PageUtil.stopEvent(evt, props.onClick);
|
|
71
|
+
return react_1.default.createElement(Button_1.Button, Object.assign({}, props.config, btnParam), props.label);
|
|
72
|
+
};
|
|
73
|
+
const ActionButtons = (props) => {
|
|
74
|
+
var _a;
|
|
75
|
+
if (((_a = props.buttons) === null || _a === void 0 ? void 0 : _a.length) <= 0)
|
|
76
|
+
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
77
|
+
var groups = [[]];
|
|
78
|
+
for (let btn of props.buttons) {
|
|
79
|
+
if (btn === false) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (btn == null) {
|
|
83
|
+
groups.push([]);
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (btn.roleCode && !utils_1.PageUtil.hasRole(btn.roleCode)) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
groups[groups.length - 1].push(btn);
|
|
90
|
+
}
|
|
91
|
+
let groupProps = {};
|
|
92
|
+
if (props.size)
|
|
93
|
+
groupProps.size = props.size;
|
|
94
|
+
return react_1.default.createElement(react_1.default.Fragment, null, groups.map((group, gi) => react_1.default.createElement(Button_1.Button.Group, Object.assign({ key: gi }, groupProps), group.map((btn, bi) => react_1.default.createElement(ActionButton, Object.assign({ key: bi }, btn))))));
|
|
95
|
+
};
|
|
96
|
+
exports.ActionButtons = ActionButtons;
|
|
@@ -0,0 +1,193 @@
|
|
|
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.SearchBarByField = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
32
|
+
const antd_1 = require("antd");
|
|
33
|
+
const Button_1 = require("../_adapt/Button");
|
|
34
|
+
const Popover_1 = require("../_adapt/Popover");
|
|
35
|
+
// import { Icon, } from '../_adapt/Icon';
|
|
36
|
+
const utils_1 = require("../../utils");
|
|
37
|
+
const Const_1 = require("../_setup/Const");
|
|
38
|
+
const SearchField_1 = require("./SearchField");
|
|
39
|
+
const _register_1 = require("./_register");
|
|
40
|
+
const { txt } = utils_1.i18n;
|
|
41
|
+
const SearchBarByField = (props) => {
|
|
42
|
+
// @ts-ignore
|
|
43
|
+
const isAwaysExpand = utils_1.GLOBAL.CONFIG.SEARCHBAR.AWAYS_EXPAND || props.__innerExpand;
|
|
44
|
+
const [data, setData] = (0, react_1.useState)(props.default || {});
|
|
45
|
+
const [isExpand, _setIsExpand] = (0, react_1.useState)(isAwaysExpand);
|
|
46
|
+
const [layout, setLayout] = (0, react_1.useState)(null);
|
|
47
|
+
// const warpData = (data) => {
|
|
48
|
+
// let result: any = {};
|
|
49
|
+
// _.keys(data).map(key => {
|
|
50
|
+
// if (data[key] === null || data[key] === undefined) {
|
|
51
|
+
// result[key] = ''
|
|
52
|
+
// } else {
|
|
53
|
+
// result[key] = data[key];
|
|
54
|
+
// }
|
|
55
|
+
// })
|
|
56
|
+
// return result;
|
|
57
|
+
// }
|
|
58
|
+
const clear = () => setData({});
|
|
59
|
+
const search = () => props.onSearch(data);
|
|
60
|
+
const setIsExpand = (isExpand) => {
|
|
61
|
+
if (isAwaysExpand)
|
|
62
|
+
return;
|
|
63
|
+
_setIsExpand(isExpand);
|
|
64
|
+
if (lodash_1.default.isFunction(props.onExpand)) {
|
|
65
|
+
setTimeout(() => props.onExpand(isExpand), 3);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
69
|
+
const layout = {
|
|
70
|
+
rows: [],
|
|
71
|
+
cols: 3,
|
|
72
|
+
minWidth: 0,
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
isOutSide: utils_1.GLOBAL.CONFIG.SEARCHBAR.FIELD_AWAYS_OUTSIDE || props.__innerOutside,
|
|
75
|
+
labelWidth: 0,
|
|
76
|
+
inputWidth: 0,
|
|
77
|
+
};
|
|
78
|
+
if (props.fields == undefined || props.fields.length == 0) {
|
|
79
|
+
setLayout(layout);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
;
|
|
83
|
+
if (lodash_1.default.has(props, 'cols'))
|
|
84
|
+
layout.cols = props.cols;
|
|
85
|
+
layout.rows.push([]);
|
|
86
|
+
let rowUse = 0;
|
|
87
|
+
props.fields.map((field) => {
|
|
88
|
+
if (field.roleCode && !utils_1.PageUtil.hasRole(field.roleCode))
|
|
89
|
+
return;
|
|
90
|
+
const SearchField = (0, _register_1.getSearchField)(field.type);
|
|
91
|
+
if (SearchField.outside)
|
|
92
|
+
layout.isOutSide = true;
|
|
93
|
+
field.span = field.span || SearchField.defaultSpan || 1;
|
|
94
|
+
let tryfill = rowUse + field.span;
|
|
95
|
+
if (tryfill > layout.cols) {
|
|
96
|
+
layout.rows.push([{ field, SearchField: SearchField.component }]);
|
|
97
|
+
rowUse = field.span;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
layout.rows[layout.rows.length - 1].push({ field, SearchField: SearchField.component });
|
|
101
|
+
rowUse += field.span;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
if (layout.isOutSide) {
|
|
105
|
+
if (lodash_1.default.isArray(props.fieldWidth)) {
|
|
106
|
+
layout.labelWidth = props.fieldWidth[0];
|
|
107
|
+
layout.inputWidth = props.fieldWidth[1];
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
layout.labelWidth = utils_1.GLOBAL.CONFIG.SEARCHBAR.FIELD_LABEL_WIDTH;
|
|
111
|
+
layout.inputWidth = utils_1.GLOBAL.CONFIG.SEARCHBAR.FIELD_IPNUT_WIDTH;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
else if (lodash_1.default.has(props, 'fieldWidth')) {
|
|
115
|
+
if (lodash_1.default.isNumber(props.fieldWidth)) {
|
|
116
|
+
layout.inputWidth = props.fieldWidth;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
layout.inputWidth = props.fieldWidth[0] + props.fieldWidth[1];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
layout.inputWidth = utils_1.GLOBAL.CONFIG.SEARCHBAR.FIELD_INSIDE_WIDTH;
|
|
124
|
+
}
|
|
125
|
+
layout.minWidth = layout.rows[0].length * (layout.labelWidth + layout.inputWidth) + 90;
|
|
126
|
+
setLayout(layout);
|
|
127
|
+
}, [props.fields]);
|
|
128
|
+
const rowRender = (0, react_1.useCallback)((rows, layout) => rows.map(item => {
|
|
129
|
+
let field = Object.assign({}, item.field);
|
|
130
|
+
let txt;
|
|
131
|
+
txt = (item.field.ik && utils_1.i18n.hasKey(item.field.ik)) ? utils_1.i18n.txt(item.field.ik) : item.field.label;
|
|
132
|
+
field.label = txt;
|
|
133
|
+
if (!lodash_1.default.has(field, 'placeholder')) {
|
|
134
|
+
let key = lodash_1.default.isArray(item.field.options) ? Const_1.V.INPUT_SELECT : Const_1.V.INPUT_TEXT;
|
|
135
|
+
field.placeholder = utils_1.i18n.txt(key) + txt;
|
|
136
|
+
}
|
|
137
|
+
const SearchInput = layout.isOutSide ? SearchField_1.InputOutSide : SearchField_1.InputInSide;
|
|
138
|
+
return react_1.default.createElement(SearchInput, { key: item.field.field, disabled: props.disabled, labelWidth: layout.labelWidth, inputWidth: layout.inputWidth, field: field, SearchField: item.SearchField, onChange: (value) => {
|
|
139
|
+
let formData;
|
|
140
|
+
if (lodash_1.default.isObject(value)) {
|
|
141
|
+
formData = Object.assign(Object.assign({}, data), value);
|
|
142
|
+
}
|
|
143
|
+
else if (lodash_1.default.isString(value)) {
|
|
144
|
+
// let val = _.trim(value);
|
|
145
|
+
// if (val.length == 0) {
|
|
146
|
+
// formData = _.omit(data, item.field.field);
|
|
147
|
+
// } else {
|
|
148
|
+
formData = Object.assign(Object.assign({}, data), { [item.field.field]: value });
|
|
149
|
+
// }
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
formData = Object.assign(Object.assign({}, data), { [item.field.field]: value });
|
|
153
|
+
}
|
|
154
|
+
// _.keys(formData).map(key => {
|
|
155
|
+
// if (formData[key] === null || formData[key] === undefined) {
|
|
156
|
+
// // _.unset(formData, key)
|
|
157
|
+
// // formData[key] = undefined;
|
|
158
|
+
// }
|
|
159
|
+
// })
|
|
160
|
+
setData(formData);
|
|
161
|
+
if (lodash_1.default.isFunction(props.onChange)) {
|
|
162
|
+
props.onChange(formData);
|
|
163
|
+
}
|
|
164
|
+
}, triggerSearch: () => props.onSearch(data), data: data });
|
|
165
|
+
}), [data]);
|
|
166
|
+
const btnRender = (rowSize, isExpand) => {
|
|
167
|
+
if (props.hideAction || isExpand || isAwaysExpand)
|
|
168
|
+
return utils_1.Const.NONE;
|
|
169
|
+
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
170
|
+
react_1.default.createElement(Button_1.Button, { disabled: props.disabled, icon: 'search', type: "primary", onClick: e => utils_1.PageUtil.stopEvent(e, search) }),
|
|
171
|
+
react_1.default.createElement(Button_1.Button, { disabled: props.disabled, icon: 'redo', onClick: e => utils_1.PageUtil.stopEvent(e, clear) }),
|
|
172
|
+
rowSize > 1 && !utils_1.GLOBAL.CONFIG.SEARCHBAR.USE_MODAL && react_1.default.createElement(Button_1.Button, { disabled: props.disabled, icon: 'filter', onClick: e => utils_1.PageUtil.stopEvent(e, () => setIsExpand(true)) }),
|
|
173
|
+
rowSize > 1 && utils_1.GLOBAL.CONFIG.SEARCHBAR.USE_MODAL && react_1.default.createElement(Popover_1.Popover, { content: "更多条件" },
|
|
174
|
+
react_1.default.createElement(Button_1.Button, { disabled: props.disabled, icon: 'filter' })));
|
|
175
|
+
};
|
|
176
|
+
const moreRender = (layout) => [
|
|
177
|
+
lodash_1.default.tail(layout.rows).map(row => layout.isOutSide ? react_1.default.createElement("div", { className: 'c-searchbar-outgroup' }, rowRender(row, layout)) : react_1.default.createElement(antd_1.Input.Group, { compact: true }, rowRender(row, layout))),
|
|
178
|
+
props.hideAction ? utils_1.Const.NONE : react_1.default.createElement("div", { className: 'c-searchbar-btns' },
|
|
179
|
+
react_1.default.createElement(Button_1.Button, { disabled: props.disabled, style: { marginLeft: layout.isOutSide ? layout.labelWidth : 0 }, icon: 'search', type: "primary", onClick: e => utils_1.PageUtil.stopEvent(e, search) }, txt(Const_1.V.BTN_SEARCH)),
|
|
180
|
+
react_1.default.createElement(Button_1.Button, { disabled: props.disabled, icon: 'redo', onClick: e => utils_1.PageUtil.stopEvent(e, clear) }, txt(Const_1.V.BTN_RESET)),
|
|
181
|
+
!isAwaysExpand && react_1.default.createElement(Button_1.Button, { disabled: props.disabled, icon: 'filter', onClick: e => utils_1.PageUtil.stopEvent(e, () => setIsExpand(false)) }, txt(Const_1.V.BTN_LESS)))
|
|
182
|
+
];
|
|
183
|
+
if (layout == null)
|
|
184
|
+
return react_1.default.createElement("div", { className: 'c-searchbar-fields' });
|
|
185
|
+
return react_1.default.createElement("div", { className: 'c-searchbar-fields', style: { minWidth: layout.minWidth } }, layout.rows.length && react_1.default.createElement(react_1.default.Fragment, null,
|
|
186
|
+
layout.isOutSide ? react_1.default.createElement("div", { className: "c-searchbar-outgroup c-searchbar-fixgroup" },
|
|
187
|
+
rowRender(layout.rows[0], layout),
|
|
188
|
+
btnRender(layout.rows.length, isExpand)) : react_1.default.createElement(antd_1.Input.Group, { compact: true, className: "c-searchbar-fixgroup" },
|
|
189
|
+
rowRender(layout.rows[0], layout),
|
|
190
|
+
btnRender(layout.rows.length, isExpand)),
|
|
191
|
+
isExpand && moreRender(layout)));
|
|
192
|
+
};
|
|
193
|
+
exports.SearchBarByField = SearchBarByField;
|
|
@@ -0,0 +1,34 @@
|
|
|
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.SearchBarByKeyword = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const antd_1 = require("antd");
|
|
9
|
+
const ByField_1 = require("./ByField");
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
const Const_1 = require("../_setup/Const");
|
|
12
|
+
const SearchBarByKeyword = (props) => {
|
|
13
|
+
const inputProps = {
|
|
14
|
+
className: "c-searchbar-keyword",
|
|
15
|
+
placeholder: utils_1.i18n.txt(Const_1.V.INPUT_SEARCH_KEYWORD),
|
|
16
|
+
allowClear: true,
|
|
17
|
+
};
|
|
18
|
+
if (props.keyword !== true) {
|
|
19
|
+
if (props.keyword.placeholder) {
|
|
20
|
+
inputProps.placeholder = props.keyword.placeholder;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (props.fields && props.fields.length) {
|
|
24
|
+
inputProps.suffix = react_1.default.createElement(antd_1.Popover, { trigger: "click", placement: "bottom", content: react_1.default.createElement(react_1.default.Fragment, null,
|
|
25
|
+
react_1.default.createElement("h3", null, utils_1.i18n.txt(Const_1.V.INPUT_SEARCH_ADVANCE)),
|
|
26
|
+
react_1.default.createElement("div", { className: 'c-searchbar' },
|
|
27
|
+
react_1.default.createElement(ByField_1.SearchBarByField, Object.assign({}, props, {
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
__innerExpand: true, __innerOutside: true })))), overlayClassName: 'c-searchbar-keyword-more', getPopupContainer: () => document.getElementById('vap-app-content') },
|
|
30
|
+
react_1.default.createElement("span", { className: 'vicon vicon-menu', title: utils_1.i18n.txt(Const_1.V.INPUT_SEARCH_ADVANCE) }));
|
|
31
|
+
}
|
|
32
|
+
return react_1.default.createElement(antd_1.Input.Search, Object.assign({}, inputProps, { onSearch: keyword => props.onSearch({ keyword_: keyword }), enterButton: utils_1.i18n.txt(Const_1.V.BTN_SEARCH) }));
|
|
33
|
+
};
|
|
34
|
+
exports.SearchBarByKeyword = SearchBarByKeyword;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SearchFieldComponent } from './_register';
|
|
3
|
+
import type { Field } from './index';
|
|
4
|
+
export type FieldInput = React.FC<{
|
|
5
|
+
SearchField: SearchFieldComponent;
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
field: Field;
|
|
8
|
+
labelWidth: number;
|
|
9
|
+
inputWidth: number;
|
|
10
|
+
data: any;
|
|
11
|
+
onChange: Function;
|
|
12
|
+
triggerSearch: Function;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const InputInSide: FieldInput;
|
|
15
|
+
export declare const InputOutSide: FieldInput;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InputOutSide = exports.InputInSide = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const InputInSide = (props) => {
|
|
9
|
+
const { SearchField, field, inputWidth, data, disabled } = props;
|
|
10
|
+
let width = inputWidth;
|
|
11
|
+
if (field.span)
|
|
12
|
+
width *= field.span;
|
|
13
|
+
return react_1.default.createElement(SearchField, { width: width, field: field, disabled: disabled, onChange: props.onChange, triggerSearch: props.triggerSearch, data: data });
|
|
14
|
+
};
|
|
15
|
+
exports.InputInSide = InputInSide;
|
|
16
|
+
const InputOutSide = (props) => {
|
|
17
|
+
const { SearchField, field, labelWidth, inputWidth, data, disabled } = props;
|
|
18
|
+
let width = labelWidth + inputWidth;
|
|
19
|
+
if (field.span)
|
|
20
|
+
width *= field.span;
|
|
21
|
+
return react_1.default.createElement("div", { style: { width }, className: 'c-searchbar-field' },
|
|
22
|
+
react_1.default.createElement("label", { style: { width: labelWidth }, title: field.label }, field.label),
|
|
23
|
+
react_1.default.createElement(SearchField, { width: width - labelWidth, field: field, disabled: disabled, onChange: props.onChange, triggerSearch: props.triggerSearch, data: data }));
|
|
24
|
+
};
|
|
25
|
+
exports.InputOutSide = InputOutSide;
|
|
@@ -0,0 +1,18 @@
|
|
|
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.SearchTags = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const antd_1 = require("antd");
|
|
9
|
+
const SearchTags = () => {
|
|
10
|
+
return react_1.default.createElement("div", null,
|
|
11
|
+
react_1.default.createElement("h1", null,
|
|
12
|
+
"\u5168\u90E8\u7ED3\u679C > ",
|
|
13
|
+
react_1.default.createElement(antd_1.Tag, { closable: true, onClose: () => { } }, "aa")),
|
|
14
|
+
react_1.default.createElement("div", null,
|
|
15
|
+
react_1.default.createElement("label", { htmlFor: 'p' }),
|
|
16
|
+
react_1.default.createElement("p", null)));
|
|
17
|
+
};
|
|
18
|
+
exports.SearchTags = SearchTags;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
| 类型 | 说明 |
|
|
4
|
+
| --- | --- |
|
|
5
|
+
| text ||
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare const _FieldType: readonly ["text", "number", "select", "multi-select", "radio", "radio-button", "checkbox", "switch", "date", "daterange", "daterange-single", "datetime", "timerange", "timerange-single", "month", "monthrange", "autocomplete"];
|