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,219 @@
|
|
|
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
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
31
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
32
|
+
const utils_1 = require("../../../utils");
|
|
33
|
+
const antd_1 = require("antd");
|
|
34
|
+
const Select_1 = require("../../_adapt/Select");
|
|
35
|
+
const Button_1 = require("../../_adapt/Button");
|
|
36
|
+
const Tables_1 = require("../../Tables");
|
|
37
|
+
const _register_1 = require("../../UForm/_register");
|
|
38
|
+
const hooks_1 = require("../../../hooks");
|
|
39
|
+
const renderColumn = (txt, column) => {
|
|
40
|
+
if (column.options) {
|
|
41
|
+
let find = lodash_1.default.find(column.options, { value: txt });
|
|
42
|
+
if (find) {
|
|
43
|
+
return find.name;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return txt;
|
|
47
|
+
};
|
|
48
|
+
// 基础组件 JSON 数组
|
|
49
|
+
(0, _register_1.registerFormField)('json-array', props => {
|
|
50
|
+
const { field, disabled, value, onChange } = props;
|
|
51
|
+
const stateRef = (0, react_1.useRef)({ loaded: false, _id: null, item: {}, arr: [], columns: [], isAdd: false, isEdit: false, });
|
|
52
|
+
const update = (0, hooks_1.useUpdate)();
|
|
53
|
+
const verfy = (data) => {
|
|
54
|
+
return true;
|
|
55
|
+
};
|
|
56
|
+
const showAdd = () => {
|
|
57
|
+
let _id = utils_1.StringUtil.genKey();
|
|
58
|
+
stateRef.current._id = _id;
|
|
59
|
+
stateRef.current.item = { _id };
|
|
60
|
+
stateRef.current.isAdd = true;
|
|
61
|
+
stateRef.current.isEdit = false;
|
|
62
|
+
stateRef.current.arr = [{ _id }, ...stateRef.current.arr];
|
|
63
|
+
update();
|
|
64
|
+
};
|
|
65
|
+
const showEdit = (editObj) => {
|
|
66
|
+
stateRef.current._id = editObj._id;
|
|
67
|
+
stateRef.current.item = Object.assign({}, editObj);
|
|
68
|
+
stateRef.current.isAdd = false;
|
|
69
|
+
stateRef.current.isEdit = true;
|
|
70
|
+
update();
|
|
71
|
+
};
|
|
72
|
+
const doAdd = (isExec = false) => {
|
|
73
|
+
stateRef.current.isAdd = false;
|
|
74
|
+
stateRef.current.arr = utils_1.ArrayUtil.del(stateRef.current.arr, stateRef.current._id, '_id');
|
|
75
|
+
if (!isExec) {
|
|
76
|
+
update();
|
|
77
|
+
// this.setState({ list, _id: null, isAdd: false, isEdit: false });
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
// if (!this.verfy(this.item)) {
|
|
81
|
+
// return;
|
|
82
|
+
// }
|
|
83
|
+
stateRef.current.arr = [stateRef.current.item, ...stateRef.current.arr];
|
|
84
|
+
onChange(JSON.stringify(stateRef.current.arr));
|
|
85
|
+
// this.setState({ list, _id: null, isAdd: false, isEdit: false });
|
|
86
|
+
// this.onChange(JSON.stringify(list));
|
|
87
|
+
};
|
|
88
|
+
const doEdit = (isExec = false) => {
|
|
89
|
+
stateRef.current.isEdit = false;
|
|
90
|
+
if (!isExec) {
|
|
91
|
+
// this.setState({ _id: null, isAdd: false, isEdit: false });
|
|
92
|
+
update();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
// if (!this.verfy(this.item)) {
|
|
96
|
+
// return;
|
|
97
|
+
// }
|
|
98
|
+
stateRef.current.arr = utils_1.ArrayUtil.update(stateRef.current.arr, stateRef.current.item, '_id');
|
|
99
|
+
// this.setState({ list, _id: null, isAdd: false, isEdit: false });
|
|
100
|
+
onChange(JSON.stringify(stateRef.current.arr));
|
|
101
|
+
};
|
|
102
|
+
const renderItem = (txt, data, column) => {
|
|
103
|
+
const { isAdd, isEdit, _id, item } = stateRef.current;
|
|
104
|
+
if ((isAdd === false && isEdit === false)) {
|
|
105
|
+
return renderColumn(txt, column);
|
|
106
|
+
}
|
|
107
|
+
if (_id != data._id) {
|
|
108
|
+
return renderColumn(txt, column);
|
|
109
|
+
}
|
|
110
|
+
let val = item[column.dataIndex] || undefined;
|
|
111
|
+
if (column.type == 'date') {
|
|
112
|
+
return react_1.default.createElement(antd_1.DatePicker, { size: "small", defaultValue: val ? (0, dayjs_1.default)(val) : undefined, onChange: mnt => stateRef.current.item[column.dataIndex] = mnt.format('YYYY-MM-DD') });
|
|
113
|
+
}
|
|
114
|
+
if (column.type == 'number') {
|
|
115
|
+
return react_1.default.createElement(antd_1.InputNumber, { size: "small", defaultValue: val, onChange: val => stateRef.current.item[column.dataIndex] = val });
|
|
116
|
+
}
|
|
117
|
+
if (column.type == 'select') {
|
|
118
|
+
return react_1.default.createElement(Select_1.Select, { size: "small", defaultValue: val, onChange: val => stateRef.current.item[column.dataIndex] = val }, column.options.map(item => react_1.default.createElement(Select_1.Select.Option, { value: item.value }, item.name)));
|
|
119
|
+
}
|
|
120
|
+
return react_1.default.createElement(antd_1.Input, { size: "small", defaultValue: val, onChange: evt => stateRef.current.item[column.dataIndex] = evt.target.value });
|
|
121
|
+
};
|
|
122
|
+
const doDelete = (data) => {
|
|
123
|
+
stateRef.current.arr = utils_1.ArrayUtil.del(stateRef.current.arr, data._id, '_id');
|
|
124
|
+
;
|
|
125
|
+
stateRef.current.isEdit = false;
|
|
126
|
+
stateRef.current.isAdd = false;
|
|
127
|
+
if (stateRef.current.arr.length == 0) {
|
|
128
|
+
onChange(null);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
onChange(JSON.stringify(stateRef.current.arr));
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
const renderAction = (data) => {
|
|
135
|
+
const { isAdd, isEdit, _id } = stateRef.current;
|
|
136
|
+
if (isAdd === false && isEdit == false) {
|
|
137
|
+
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
138
|
+
react_1.default.createElement(Tables_1.VTable.EDIT, { onClick: () => showEdit(data) }),
|
|
139
|
+
react_1.default.createElement(Tables_1.VTable.DELETE, { onClick: () => doDelete(data) }));
|
|
140
|
+
}
|
|
141
|
+
if (_id != data._id) {
|
|
142
|
+
return [];
|
|
143
|
+
}
|
|
144
|
+
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
145
|
+
react_1.default.createElement(Tables_1.VTable.ACTION, { icon: "check", title: "\u4FDD\u5B58", onClick: () => { isAdd ? doAdd(true) : doEdit(true); } }),
|
|
146
|
+
react_1.default.createElement(Tables_1.VTable.ACTION, { icon: "close", title: "\u53D6\u6D88", onClick: () => isAdd ? doAdd(false) : doEdit(false) }));
|
|
147
|
+
};
|
|
148
|
+
const columnConfig = (column) => {
|
|
149
|
+
let param = {
|
|
150
|
+
render: (text, obj) => renderItem(text, obj, column),
|
|
151
|
+
};
|
|
152
|
+
if (column.width) {
|
|
153
|
+
param.width = column.width;
|
|
154
|
+
}
|
|
155
|
+
else if (column.type == 'date') {
|
|
156
|
+
param.width = 150;
|
|
157
|
+
}
|
|
158
|
+
else if (column.type == 'number') {
|
|
159
|
+
param.width = 80;
|
|
160
|
+
}
|
|
161
|
+
return param;
|
|
162
|
+
};
|
|
163
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
164
|
+
let columns = [{ title: '序号', className: '_index', render: (d, j, i) => i + 1 }];
|
|
165
|
+
if (lodash_1.default.has(field.config, 'columns')) {
|
|
166
|
+
field.config.columns.map(item => columns.push(Object.assign(Object.assign({}, item), columnConfig(item))));
|
|
167
|
+
}
|
|
168
|
+
if (!disabled) {
|
|
169
|
+
columns.push({ title: '操作', className: 'table-actions', render: (data) => renderAction(data) });
|
|
170
|
+
}
|
|
171
|
+
stateRef.current.columns = columns;
|
|
172
|
+
stateRef.current.loaded = true;
|
|
173
|
+
update();
|
|
174
|
+
}, []);
|
|
175
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
176
|
+
let arr = [];
|
|
177
|
+
if (lodash_1.default.isArray(value)) {
|
|
178
|
+
arr = value;
|
|
179
|
+
}
|
|
180
|
+
else if (lodash_1.default.isString(value)) {
|
|
181
|
+
try {
|
|
182
|
+
arr = JSON.parse(value);
|
|
183
|
+
}
|
|
184
|
+
catch (_a) {
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
stateRef.current.arr = arr;
|
|
188
|
+
stateRef.current.isAdd = false;
|
|
189
|
+
stateRef.current.isEdit = false;
|
|
190
|
+
stateRef.current._id = null;
|
|
191
|
+
stateRef.current.item = {};
|
|
192
|
+
update();
|
|
193
|
+
}, [value]);
|
|
194
|
+
if (!stateRef.current.loaded)
|
|
195
|
+
return utils_1.Const.NONE;
|
|
196
|
+
return react_1.default.createElement(antd_1.Table, { className: "c-table json-array-table", size: "small", locale: { emptyText: react_1.default.createElement(antd_1.Empty, { description: react_1.default.createElement(Button_1.Button, { type: "primary", icon: 'plus', onClick: () => showAdd() },
|
|
197
|
+
"\u6DFB\u52A0",
|
|
198
|
+
field.title) }) }, dataSource: stateRef.current.arr, columns: stateRef.current.columns, pagination: false, footer: () => {
|
|
199
|
+
if (stateRef.current.arr.length == 0 || stateRef.current.isAdd || stateRef.current.isEdit || disabled) {
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
return react_1.default.createElement(Button_1.Button, { type: "primary", icon: 'plus', onClick: () => showAdd() },
|
|
203
|
+
"\u6DFB\u52A0",
|
|
204
|
+
field.title);
|
|
205
|
+
} });
|
|
206
|
+
}, {
|
|
207
|
+
breakCol: true,
|
|
208
|
+
breakTitle: true,
|
|
209
|
+
render: (value, data, field) => {
|
|
210
|
+
let list = [];
|
|
211
|
+
try {
|
|
212
|
+
list = JSON.parse(value);
|
|
213
|
+
}
|
|
214
|
+
catch (e) {
|
|
215
|
+
console.error(e);
|
|
216
|
+
}
|
|
217
|
+
return react_1.default.createElement(antd_1.Table, { className: "c-table json-array-table", size: "small", locale: { emptyText: react_1.default.createElement(antd_1.Empty, { description: "\u6682\u65E0\u6570\u636E" }) }, dataSource: list, columns: field.config.columns.map(item => (Object.assign(Object.assign({}, item), { render: (txt) => renderColumn(txt, item) }))), pagination: false });
|
|
218
|
+
}
|
|
219
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
40
|
+
const _input_1 = require("../../UForm/_input");
|
|
41
|
+
const Modal_1 = require("../../_adapt/Modal");
|
|
42
|
+
const _register_1 = require("../../UForm/_register");
|
|
43
|
+
const antd_1 = require("antd");
|
|
44
|
+
const Const_1 = require("../Const");
|
|
45
|
+
const DTree_1 = require("../../Trees/DTree");
|
|
46
|
+
const Icon_1 = require("../../_adapt/Icon");
|
|
47
|
+
const hooks_1 = require("../../../hooks");
|
|
48
|
+
const utils_1 = require("../../../utils");
|
|
49
|
+
var orgRender = null;
|
|
50
|
+
const getOrgCodeRender = () => {
|
|
51
|
+
if (orgRender == null) {
|
|
52
|
+
orgRender = utils_1.Renders.ApiPostRender({ api: utils_1.GLOBAL.CONFIG.BASIC.ORG_API, nameField: utils_1.GLOBAL.CONFIG.BASIC.ORG_FIELDS[1], valueFiled: utils_1.GLOBAL.CONFIG.BASIC.ORG_FIELDS[0] });
|
|
53
|
+
}
|
|
54
|
+
return orgRender;
|
|
55
|
+
};
|
|
56
|
+
(0, _register_1.registerFormField)('organization', props => {
|
|
57
|
+
const { field, value, disabled } = props;
|
|
58
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
59
|
+
const [fields, values] = (0, _input_1.getMultiFieldValues)(field, value);
|
|
60
|
+
const [title, setTitle] = (0, react_1.useState)(null);
|
|
61
|
+
const [[selectKey, selectOrg], setSelected] = (0, react_1.useState)([null, null]);
|
|
62
|
+
(0, hooks_1.useEffectFunction)(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
+
if (value == null || value == undefined)
|
|
64
|
+
return;
|
|
65
|
+
if (values.length >= 2 && values[1] != null) {
|
|
66
|
+
setTitle(values[1]);
|
|
67
|
+
let selected = {
|
|
68
|
+
[utils_1.GLOBAL.CONFIG.BASIC.ORG_FIELDS[0]]: value[0],
|
|
69
|
+
[utils_1.GLOBAL.CONFIG.BASIC.ORG_FIELDS[1]]: value[1],
|
|
70
|
+
};
|
|
71
|
+
if (values.length > 2) {
|
|
72
|
+
selected[utils_1.GLOBAL.CONFIG.BASIC.ORG_FIELDS[2]] = values[2];
|
|
73
|
+
}
|
|
74
|
+
setSelected([value[0], selected]);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (values[0]) {
|
|
78
|
+
const resp = yield utils_1.Ajax.POST(utils_1.GLOBAL.CONFIG.BASIC.ORG_API, { code: values[0] });
|
|
79
|
+
if (resp.code == '0' && lodash_1.default.isArray(resp.list) && resp.list.length > 0) {
|
|
80
|
+
setSelected([resp.list[0][utils_1.GLOBAL.CONFIG.BASIC.ORG_FIELDS[0]], resp.list[0]]);
|
|
81
|
+
setTitle(resp.list[0][utils_1.GLOBAL.CONFIG.BASIC.ORG_FIELDS[1]]);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
let params = { disabled };
|
|
86
|
+
var mustSelect = field.required || lodash_1.default.findIndex(field.rules, { required: true }) >= 0;
|
|
87
|
+
const onOk = (0, react_1.useCallback)(() => {
|
|
88
|
+
setOpen(false);
|
|
89
|
+
if (selectOrg != null) {
|
|
90
|
+
setTitle(selectOrg[utils_1.GLOBAL.CONFIG.BASIC.ORG_FIELDS[1]]);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
setTitle(null);
|
|
94
|
+
}
|
|
95
|
+
const result = (0, _input_1.copyMultiValue)(fields, selectOrg, utils_1.GLOBAL.CONFIG.BASIC.ORG_FIELDS);
|
|
96
|
+
props.onChange(result);
|
|
97
|
+
}, [selectOrg]);
|
|
98
|
+
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
99
|
+
react_1.default.createElement(antd_1.Button, Object.assign({}, params, { style: { width: '100%', textAlign: 'left' }, icon: react_1.default.createElement(Icon_1.Icon, { type: 'select', style: { marginRight: 4 } }), onClick: () => setOpen(true) }), title || (0, _input_1.getPlaceholder)(field, true)),
|
|
100
|
+
react_1.default.createElement(Modal_1.Modal, { open: open, onCancel: () => setOpen(false), onOk: onOk, title: utils_1.i18n.txt(Const_1.V.INPUT_ORG_SLECT) },
|
|
101
|
+
react_1.default.createElement(DTree_1.DTree, { rootApi: utils_1.GLOBAL.CONFIG.BASIC.ORG_ROOT, childApi: utils_1.GLOBAL.CONFIG.BASIC.ORG_CHILDREN, keyField: utils_1.GLOBAL.CONFIG.BASIC.ORG_FIELDS[0], mustSelect: mustSelect, titleField: utils_1.GLOBAL.CONFIG.BASIC.ORG_FIELDS[1], checkField: utils_1.GLOBAL.CONFIG.BASIC.ORG_FIELDS[3], parentField: utils_1.GLOBAL.CONFIG.BASIC.ORG_FIELDS[2], onSelect: (id, obj) => {
|
|
102
|
+
if (id) {
|
|
103
|
+
setSelected([id, obj]);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (mustSelect)
|
|
107
|
+
return;
|
|
108
|
+
setSelected([null, null]);
|
|
109
|
+
} })));
|
|
110
|
+
}, {
|
|
111
|
+
isMultiple: true,
|
|
112
|
+
render: (value, data, field) => {
|
|
113
|
+
const [fields, values] = (0, _input_1.getMultiFieldValues)(field, data);
|
|
114
|
+
if (values.length >= 2 && values[1])
|
|
115
|
+
return values[1];
|
|
116
|
+
if (values.length >= 1 && values[1]) {
|
|
117
|
+
return getOrgCodeRender()(values[0]);
|
|
118
|
+
}
|
|
119
|
+
return '';
|
|
120
|
+
}
|
|
121
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
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 antd_1 = require("antd");
|
|
9
|
+
const _register_1 = require("../../UForm/_register");
|
|
10
|
+
const _input_1 = require("../../UForm/_input");
|
|
11
|
+
const utils_1 = require("../../../utils");
|
|
12
|
+
let roleRender = null;
|
|
13
|
+
const getRoleRender = () => {
|
|
14
|
+
if (roleRender == null)
|
|
15
|
+
roleRender = utils_1.Renders.ApiGetRender({ api: utils_1.GLOBAL.CONFIG.ADMIN.ROLE, nameField: 'name', valueFiled: 'id', });
|
|
16
|
+
return roleRender;
|
|
17
|
+
};
|
|
18
|
+
// 下拉
|
|
19
|
+
(0, _register_1.registerFormField)('role', (props) => {
|
|
20
|
+
const { field, disabled, value, onChange, } = props;
|
|
21
|
+
let roleOption = null;
|
|
22
|
+
if (field.config && field.config.valueFormat == 'string') {
|
|
23
|
+
roleOption = { valueFormat: 'string' };
|
|
24
|
+
}
|
|
25
|
+
const options = getRoleRender().useOption();
|
|
26
|
+
let params = { placeholder: (0, _input_1.getPlaceholder)(field, true), disabled, allowClear: true };
|
|
27
|
+
if (field.required || field.rules && lodash_1.default.find(field.rules, { required: true }))
|
|
28
|
+
params.allowClear = false;
|
|
29
|
+
return react_1.default.createElement(antd_1.Select, Object.assign({}, params, field.config, { mode: "default", value: value === null ? undefined : value, onChange: onChange, options: options }));
|
|
30
|
+
}, {
|
|
31
|
+
render: getRoleRender(),
|
|
32
|
+
});
|
|
33
|
+
// 下拉
|
|
34
|
+
(0, _register_1.registerFormField)('roles', (props) => {
|
|
35
|
+
const { field, disabled, value, onChange } = props;
|
|
36
|
+
const options = getRoleRender().useOption({ valueFormat: 'string' });
|
|
37
|
+
let params = { placeholder: (0, _input_1.getPlaceholder)(field, true), disabled, allowClear: true };
|
|
38
|
+
if (field.required || field.rules && lodash_1.default.find(field.rules, { required: true }))
|
|
39
|
+
params.allowClear = false;
|
|
40
|
+
let selectKey = [];
|
|
41
|
+
if (value) {
|
|
42
|
+
selectKey = (value || '').split(',').map(lodash_1.default.trim);
|
|
43
|
+
}
|
|
44
|
+
return react_1.default.createElement(antd_1.Select, Object.assign({}, params, field.config, { value: selectKey, mode: "multiple", onChange: (val) => onChange(val.join(',')) }), options.map(item => react_1.default.createElement(antd_1.Select.Option, { value: item.value + '' }, item.label)));
|
|
45
|
+
}, {
|
|
46
|
+
render: getRoleRender()
|
|
47
|
+
});
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// // 支持搜索的选择器
|
|
2
|
+
// registerInputType('search-select', class extends UFormInput {
|
|
3
|
+
// render() {
|
|
4
|
+
// const { field, disabled, value } = this.props;
|
|
5
|
+
// let params = { disabled, allowClear: true }
|
|
6
|
+
// if (field.rule && _.find(field.rule, { required: true })) {
|
|
7
|
+
// params.allowClear = false;
|
|
8
|
+
// }
|
|
9
|
+
// let option = this.getOptions().map(item => ({ name: item.label, value: item.value + '%^&*' + item.label }));
|
|
10
|
+
// let tempValue = ''
|
|
11
|
+
// if (value){
|
|
12
|
+
// this.getOptions().map(item => {
|
|
13
|
+
// if(item.value == value){
|
|
14
|
+
// option.map(op => {
|
|
15
|
+
// if(opitem.label == item.label){
|
|
16
|
+
// tempValue = op.value
|
|
17
|
+
// }
|
|
18
|
+
// })
|
|
19
|
+
// }
|
|
20
|
+
// })
|
|
21
|
+
// }
|
|
22
|
+
// return <Select
|
|
23
|
+
// {...params}
|
|
24
|
+
// {...field.config}
|
|
25
|
+
// showSearch
|
|
26
|
+
// mode="default"
|
|
27
|
+
// placeholder={this.getSelectTip()}
|
|
28
|
+
// value={tempValue === null ? undefined : tempValue}
|
|
29
|
+
// onChange={(value: any) => this.onChange(value.split('%^&*')[0])}
|
|
30
|
+
// >
|
|
31
|
+
// {option.map(item => <Select.Option value={item.value as any}>{field.render ? (field.render(item.value, item)) : item.label}</Select.Option>)}
|
|
32
|
+
// </Select>
|
|
33
|
+
// }
|
|
34
|
+
// })
|
|
35
|
+
// registerInputType('autocompeane', class extends UFormInput {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,179 @@
|
|
|
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
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
31
|
+
const _register_1 = require("../../UForm/_register");
|
|
32
|
+
const antd_1 = require("antd");
|
|
33
|
+
const Icon_1 = require("../../_adapt/Icon");
|
|
34
|
+
const Select_1 = require("../../_adapt/Select");
|
|
35
|
+
const _input_1 = require("../../UForm/_input");
|
|
36
|
+
const utils_1 = require("../../../utils");
|
|
37
|
+
const _utils_1 = require("./_utils");
|
|
38
|
+
const Const_1 = require("../Const");
|
|
39
|
+
// 下拉
|
|
40
|
+
(0, _register_1.registerFormField)('select', (props) => {
|
|
41
|
+
const { field, disabled, value, onChange, options } = props;
|
|
42
|
+
let params = { placeholder: (0, _input_1.getPlaceholder)(field, true), disabled, allowClear: true, options };
|
|
43
|
+
if (field.required || field.rules && lodash_1.default.find(field.rules, { required: true }))
|
|
44
|
+
params.allowClear = false;
|
|
45
|
+
return react_1.default.createElement(Select_1.Select, Object.assign({}, params, field.config, { mode: "default", value: value === null ? undefined : value, onChange: onChange }));
|
|
46
|
+
});
|
|
47
|
+
// 下拉
|
|
48
|
+
(0, _register_1.registerFormField)('multi-select', (props) => {
|
|
49
|
+
const { field, disabled, value, onChange, options } = props;
|
|
50
|
+
let params = { placeholder: (0, _input_1.getPlaceholder)(field, true), disabled, allowClear: true };
|
|
51
|
+
if (field.required || field.rules && lodash_1.default.find(field.rules, { required: true }))
|
|
52
|
+
params.allowClear = false;
|
|
53
|
+
let selectKey = [];
|
|
54
|
+
if (value) {
|
|
55
|
+
if (lodash_1.default.isArray(value)) {
|
|
56
|
+
selectKey = value;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
selectKey = (value || '').split(',').map(lodash_1.default.trim);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return react_1.default.createElement(Select_1.Select, Object.assign({}, params, field.config, { value: selectKey, mode: "multiple", onChange: (val) => onChange(val.join(',')) }), options.map(item => react_1.default.createElement(Select_1.Select.Option, { value: item.value + '' }, item.label)));
|
|
63
|
+
}, {
|
|
64
|
+
render: _utils_1.MULTI_CHOOSE_SHOW
|
|
65
|
+
});
|
|
66
|
+
// 开关:支持使用 config :{reverse:true} 来倒置2个选项
|
|
67
|
+
(0, _register_1.registerFormField)('switch', (props) => {
|
|
68
|
+
const { field, disabled, value, onChange, options } = props;
|
|
69
|
+
if (options.length <= 1) {
|
|
70
|
+
console.warn('Type Switch Must have 2 Options');
|
|
71
|
+
return utils_1.Const.NONE;
|
|
72
|
+
}
|
|
73
|
+
let CHECKED = utils_1.GLOBAL.CONFIG.FORM.SWITCH_DEFAULT_CHECKED;
|
|
74
|
+
if (lodash_1.default.has(field.config, 'reverse') && field.config.reverse)
|
|
75
|
+
CHECKED = 1 - CHECKED;
|
|
76
|
+
let UNCHECKED = 1 - CHECKED;
|
|
77
|
+
return react_1.default.createElement(antd_1.Switch, Object.assign({ checkedChildren: field.options[CHECKED].label, unCheckedChildren: field.options[UNCHECKED].label }, field.config, { disabled: disabled, checked: value == field.options[CHECKED].value, onChange: (isCheck, evt) => {
|
|
78
|
+
utils_1.PageUtil.stopEvent(evt);
|
|
79
|
+
onChange(isCheck ? field.options[CHECKED].value : field.options[UNCHECKED].value);
|
|
80
|
+
} }));
|
|
81
|
+
});
|
|
82
|
+
// 单选
|
|
83
|
+
(0, _register_1.registerFormField)('radio', (props) => {
|
|
84
|
+
const { field, disabled, value, onChange, options } = props;
|
|
85
|
+
return react_1.default.createElement(antd_1.Radio.Group, Object.assign({}, field.config, { disabled: disabled, value: value === null ? undefined : value, onChange: evt => onChange(evt.target.value), optionType: "default", options: options }));
|
|
86
|
+
}, { breakCol: true });
|
|
87
|
+
// 单选按钮
|
|
88
|
+
(0, _register_1.registerFormField)('radio-button', (props) => {
|
|
89
|
+
const { field, disabled, value, onChange, options } = props;
|
|
90
|
+
return react_1.default.createElement(antd_1.Radio.Group, Object.assign({ buttonStyle: "solid" }, field.config, { disabled: disabled, value: value === null ? undefined : value, optionType: "button", options: options, onChange: evt => onChange(evt.target.value) }));
|
|
91
|
+
});
|
|
92
|
+
// 单选 - 带更多
|
|
93
|
+
(0, _register_1.registerFormField)('radio-with-more', (props) => {
|
|
94
|
+
const { field, disabled, value, options, onChange } = props;
|
|
95
|
+
const VALUES = new Set(options.map(item => item.value));
|
|
96
|
+
const morStatus = (txt) => {
|
|
97
|
+
if (VALUES.has(txt))
|
|
98
|
+
return { isMore: false, txt: '' };
|
|
99
|
+
if (txt && lodash_1.default.trim(txt).length > 0) {
|
|
100
|
+
return { isMore: true, txt };
|
|
101
|
+
}
|
|
102
|
+
return { isMore: false, txt: '' };
|
|
103
|
+
};
|
|
104
|
+
const [status, setStatus] = (0, react_1.useState)(morStatus(value));
|
|
105
|
+
return react_1.default.createElement(antd_1.Radio.Group, Object.assign({ disabled: disabled }, field.config),
|
|
106
|
+
options.map(item => react_1.default.createElement(antd_1.Radio, { checked: !status.isMore && item.value == value, value: item.value, onClick: evt => {
|
|
107
|
+
utils_1.PageUtil.stopEvent(evt);
|
|
108
|
+
if (status.isMore)
|
|
109
|
+
setStatus((stats) => (Object.assign(Object.assign({}, stats), { isMore: false })));
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
onChange(evt.target.value);
|
|
112
|
+
} }, field.render ? (field.render(item.value, item)) : item.label)),
|
|
113
|
+
react_1.default.createElement(antd_1.Radio, { value: "___MORE__", checked: status.isMore, onClick: (evt) => {
|
|
114
|
+
utils_1.PageUtil.stopEvent(evt);
|
|
115
|
+
if (status.isMore)
|
|
116
|
+
return;
|
|
117
|
+
setStatus((status) => (Object.assign(Object.assign({}, status), { isMore: true })));
|
|
118
|
+
onChange(status.txt);
|
|
119
|
+
} },
|
|
120
|
+
!status.isMore && react_1.default.createElement("span", null, utils_1.i18n.txt(Const_1.V.INPUT_MORE)),
|
|
121
|
+
status.isMore && react_1.default.createElement(antd_1.Input, { value: status.txt, onChange: evt => {
|
|
122
|
+
onChange(evt.target.value);
|
|
123
|
+
setStatus({ isMore: true, txt: evt.target.value });
|
|
124
|
+
} })));
|
|
125
|
+
}, { breakCol: true });
|
|
126
|
+
// 多选
|
|
127
|
+
(0, _register_1.registerFormField)('checkbox', (props) => {
|
|
128
|
+
const { field, disabled, value, options, onChange } = props;
|
|
129
|
+
let selectKey = [];
|
|
130
|
+
if (value)
|
|
131
|
+
selectKey = value.split(',').map(item => item.trim());
|
|
132
|
+
return react_1.default.createElement(antd_1.Checkbox.Group, Object.assign({ disabled: disabled }, field.config, { value: selectKey, className: 'i-checkbox-group', onChange: val => onChange(val.join(',')), options: options.map((item) => (Object.assign(Object.assign({}, item), { value: item.value + '' }))) }));
|
|
133
|
+
}, {
|
|
134
|
+
breakCol: true,
|
|
135
|
+
render: _utils_1.MULTI_CHOOSE_SHOW
|
|
136
|
+
});
|
|
137
|
+
// 多选 带全选
|
|
138
|
+
(0, _register_1.registerFormField)('checkbox-with-all', (props) => {
|
|
139
|
+
const { field, disabled, value, options, onChange } = props;
|
|
140
|
+
const OPTIONS = new Set(options.map(item => item.value + ''));
|
|
141
|
+
const SELECTED = new Set();
|
|
142
|
+
if (value)
|
|
143
|
+
value.split(',').map(item => SELECTED.add(item.trim()));
|
|
144
|
+
let allChecked = SELECTED.size == OPTIONS.size;
|
|
145
|
+
return react_1.default.createElement("div", Object.assign({ className: 'i-checkbox-group', disabled: disabled }, field.config),
|
|
146
|
+
react_1.default.createElement(antd_1.Checkbox, { checked: allChecked, onChange: evt => {
|
|
147
|
+
if (evt.target.checked) {
|
|
148
|
+
onChange(options.map(item => item.value).join(','));
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
onChange(null);
|
|
152
|
+
}
|
|
153
|
+
} }, utils_1.i18n.txt(Const_1.V.INPUT_CHECK_ALL)),
|
|
154
|
+
options.map(item => react_1.default.createElement(antd_1.Checkbox, { value: item.value + '', checked: SELECTED.has(item.value + ''), onChange: evt => {
|
|
155
|
+
utils_1.PageUtil.stopEvent(evt);
|
|
156
|
+
let values = Array.from(SELECTED);
|
|
157
|
+
if (evt.target.checked) {
|
|
158
|
+
values.push(item.value + '');
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
values = lodash_1.default.filter(values, val => val != (item.value + ''));
|
|
162
|
+
}
|
|
163
|
+
onChange(values.join(','));
|
|
164
|
+
} }, item.label)));
|
|
165
|
+
}, {
|
|
166
|
+
render: _utils_1.MULTI_CHOOSE_SHOW,
|
|
167
|
+
breakCol: true,
|
|
168
|
+
});
|
|
169
|
+
// 选择图标
|
|
170
|
+
(0, _register_1.registerFormField)('icon', (props) => {
|
|
171
|
+
const { field, disabled, value, onChange } = props;
|
|
172
|
+
let params = { placeholder: (0, _input_1.getPlaceholder)(field, true), disabled, allowClear: true };
|
|
173
|
+
if (field.required || field.rules && lodash_1.default.find(field.rules, { required: true }))
|
|
174
|
+
params.allowClear = false;
|
|
175
|
+
params.treeData = utils_1.GLOBAL.CONFIG.ICONS.CLAZZ.map(item => ({ label: react_1.default.createElement(Icon_1.Icon, { type: item }), value: item, key: item }));
|
|
176
|
+
return react_1.default.createElement(antd_1.TreeSelect, Object.assign({ showSearch: false, popupClassName: "i-iconselect", virtual: false }, params, field.config, { value: value, multiple: false, treeCheckable: false, onChange: value => onChange(value) }));
|
|
177
|
+
}, {
|
|
178
|
+
render: (value) => react_1.default.createElement(Icon_1.Icon, { type: value })
|
|
179
|
+
});
|
|
File without changes
|