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,258 @@
|
|
|
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.DICT = exports.initDict = exports.DictRender = 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("../../components/_adapt/Icon");
|
|
11
|
+
const index_1 = require("../index");
|
|
12
|
+
const Const_1 = require("../../components/_setup/Const");
|
|
13
|
+
const Const_2 = require("../Const");
|
|
14
|
+
const _Support_1 = require("../_Support");
|
|
15
|
+
const _V_DICT = (0, _Support_1.globalDefault)('_V_DICT', { DICTS: [], DICT_MAP: new Map() });
|
|
16
|
+
exports.DICT = _V_DICT;
|
|
17
|
+
const DICT = _V_DICT.DICT_MAP;
|
|
18
|
+
// var DICT = globalDefault('_V_DICT' as any, new Map<string, DictInfo>());
|
|
19
|
+
const VALIDATE_FORMAT = new Set(['tag', 'color', 'status', 'sup', 'sub', 'icon', 'progress', 'clazz']);
|
|
20
|
+
// const tagRender = (key: string | number, def: string | false = TEXT.RENDER_TEXT, map: Map<string, [string, string]>) => {
|
|
21
|
+
// if (!map.has(key)) {
|
|
22
|
+
// if (def) {
|
|
23
|
+
// return <Tag>{def}</Tag>
|
|
24
|
+
// }
|
|
25
|
+
// return '';
|
|
26
|
+
// }
|
|
27
|
+
// let [txt, format] = map.get(key);
|
|
28
|
+
// return <Tag className="c-dict-tag" color={format ? format : 'geekblue'}>{txt}</Tag>
|
|
29
|
+
// }
|
|
30
|
+
const STATUS = new Set(['success', 'processing', 'warning', 'error', 'default']);
|
|
31
|
+
const statusRender = (key, def, map) => {
|
|
32
|
+
if (!map.has(key)) {
|
|
33
|
+
if (def === false)
|
|
34
|
+
return key;
|
|
35
|
+
return react_1.default.createElement(antd_1.Badge, { className: "c-dict-status", status: "default", text: def });
|
|
36
|
+
}
|
|
37
|
+
let [txt, format] = map.get(key);
|
|
38
|
+
if (STATUS.has(format)) {
|
|
39
|
+
// return <Badge status={format as any} text={txt} />
|
|
40
|
+
}
|
|
41
|
+
return react_1.default.createElement(antd_1.Badge, { className: "c-dict-status", status: "default", text: txt });
|
|
42
|
+
};
|
|
43
|
+
const subRender = (key, def, map) => {
|
|
44
|
+
if (!map.has(key)) {
|
|
45
|
+
if (def === false)
|
|
46
|
+
return key;
|
|
47
|
+
return def;
|
|
48
|
+
}
|
|
49
|
+
let [txt, format] = map.get(key);
|
|
50
|
+
return react_1.default.createElement("span", { className: "c-dict-sub" },
|
|
51
|
+
txt,
|
|
52
|
+
format && react_1.default.createElement("sub", null, format));
|
|
53
|
+
};
|
|
54
|
+
const supRender = (key, def, map) => {
|
|
55
|
+
if (!map.has(key)) {
|
|
56
|
+
if (def === false)
|
|
57
|
+
return key;
|
|
58
|
+
return def;
|
|
59
|
+
}
|
|
60
|
+
let [txt, format] = map.get(key);
|
|
61
|
+
return react_1.default.createElement("span", { className: "c-dict-sup" },
|
|
62
|
+
txt,
|
|
63
|
+
format && react_1.default.createElement("sup", null, format));
|
|
64
|
+
};
|
|
65
|
+
const iconRender = (key, def, map) => {
|
|
66
|
+
if (!map.has(key)) {
|
|
67
|
+
if (def === false)
|
|
68
|
+
return key;
|
|
69
|
+
return def;
|
|
70
|
+
}
|
|
71
|
+
let [txt, format] = map.get(key);
|
|
72
|
+
if (format == null || format == '') {
|
|
73
|
+
return txt;
|
|
74
|
+
}
|
|
75
|
+
if (lodash_1.default.startsWith(format, '/')) {
|
|
76
|
+
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
77
|
+
react_1.default.createElement("img", { className: "c-dict-icon-img", src: format }),
|
|
78
|
+
txt);
|
|
79
|
+
}
|
|
80
|
+
return react_1.default.createElement(react_1.default.Fragment, null,
|
|
81
|
+
react_1.default.createElement(Icon_1.Icon, { className: "c-dict-icon", type: format }),
|
|
82
|
+
txt);
|
|
83
|
+
};
|
|
84
|
+
// const PROGRESS = new Set<string>(['prepare', 'ready', 'doing', 'finsh', 'error'])
|
|
85
|
+
const progressRender = (key, def, map) => {
|
|
86
|
+
if (!map.has(key)) {
|
|
87
|
+
if (def == false)
|
|
88
|
+
return key;
|
|
89
|
+
return def;
|
|
90
|
+
}
|
|
91
|
+
let [txt, format] = map.get(key);
|
|
92
|
+
switch (format) {
|
|
93
|
+
case 'prepare':
|
|
94
|
+
return react_1.default.createElement(antd_1.Badge, { className: "c-dict-progress c-dict-progress-" + format, count: react_1.default.createElement(Icon_1.Icon, { type: "plus-circle" }), text: txt });
|
|
95
|
+
case 'ready':
|
|
96
|
+
return react_1.default.createElement(antd_1.Badge, { className: "c-dict-progress c-dict-progress-" + format, count: react_1.default.createElement(Icon_1.Icon, { type: "clock-circle" }), text: txt });
|
|
97
|
+
case 'doing':
|
|
98
|
+
return react_1.default.createElement(antd_1.Badge, { className: "c-dict-progress c-dict-progress-" + format, count: react_1.default.createElement(Icon_1.Icon, { type: "play-circle" }), text: txt });
|
|
99
|
+
case 'finsh':
|
|
100
|
+
return react_1.default.createElement(antd_1.Badge, { className: "c-dict-progress c-dict-progress-" + format, count: react_1.default.createElement(Icon_1.Icon, { type: "check-circle" }), text: txt });
|
|
101
|
+
case 'error':
|
|
102
|
+
return react_1.default.createElement(antd_1.Badge, { className: "c-dict-progress c-dict-progress-" + format, count: react_1.default.createElement(Icon_1.Icon, { type: "close-circle" }), text: txt });
|
|
103
|
+
}
|
|
104
|
+
return txt;
|
|
105
|
+
};
|
|
106
|
+
const borderRender = (key, def, map) => {
|
|
107
|
+
if (!map.has(key)) {
|
|
108
|
+
if (def === false)
|
|
109
|
+
return key;
|
|
110
|
+
return def;
|
|
111
|
+
}
|
|
112
|
+
let [txt, format] = map.get(key);
|
|
113
|
+
return react_1.default.createElement("span", { className: "c-dict-border", style: { color: format, borderLeftColor: format } }, txt);
|
|
114
|
+
};
|
|
115
|
+
const extClass = (key, def, map) => {
|
|
116
|
+
if (!map.has(key)) {
|
|
117
|
+
if (def === false)
|
|
118
|
+
return key;
|
|
119
|
+
return def;
|
|
120
|
+
}
|
|
121
|
+
let [txt, format] = map.get(key);
|
|
122
|
+
if (format) {
|
|
123
|
+
return react_1.default.createElement("span", { className: format }, txt);
|
|
124
|
+
}
|
|
125
|
+
return txt;
|
|
126
|
+
};
|
|
127
|
+
const renderDictValue = (info, item) => {
|
|
128
|
+
switch (info.format) {
|
|
129
|
+
case 'tag':
|
|
130
|
+
// return tagRender(item.value);
|
|
131
|
+
break;
|
|
132
|
+
case 'color':
|
|
133
|
+
break;
|
|
134
|
+
// return;
|
|
135
|
+
case 'status':
|
|
136
|
+
break;
|
|
137
|
+
// return;
|
|
138
|
+
case 'sup':
|
|
139
|
+
// return;
|
|
140
|
+
break;
|
|
141
|
+
case 'sub':
|
|
142
|
+
// return;
|
|
143
|
+
break;
|
|
144
|
+
case 'icon':
|
|
145
|
+
// return;
|
|
146
|
+
break;
|
|
147
|
+
case 'progress':
|
|
148
|
+
// return;
|
|
149
|
+
case 'clazz':
|
|
150
|
+
return react_1.default.createElement("span", { className: item.format }, item.label);
|
|
151
|
+
default:
|
|
152
|
+
return item.label;
|
|
153
|
+
}
|
|
154
|
+
return item.label;
|
|
155
|
+
};
|
|
156
|
+
const _DictRender = (props) => {
|
|
157
|
+
// if (DICT == null) return NONE;
|
|
158
|
+
if (props.value === null)
|
|
159
|
+
return props.default || Const_2.NONE;
|
|
160
|
+
const dictInfo = DICT.get(props.dictType);
|
|
161
|
+
if (dictInfo == null)
|
|
162
|
+
return props.default || Const_2.NONE;
|
|
163
|
+
const dictKey = props.value + '';
|
|
164
|
+
let idx = lodash_1.default.findIndex(dictInfo.nodes, (item) => dictKey == item.value);
|
|
165
|
+
if (idx < 0)
|
|
166
|
+
return props.default || Const_2.NONE;
|
|
167
|
+
return renderDictValue(dictInfo, dictInfo.nodes[idx]);
|
|
168
|
+
};
|
|
169
|
+
// if (config.valueFormat) {
|
|
170
|
+
// switch (config.valueFormat) {
|
|
171
|
+
// case 'string':
|
|
172
|
+
// format = val => val + '';
|
|
173
|
+
// break;
|
|
174
|
+
// case 'number':
|
|
175
|
+
// format = val => {
|
|
176
|
+
// if (_.isNumber(val)) return val;
|
|
177
|
+
// try {
|
|
178
|
+
// return parseInt(val);
|
|
179
|
+
// } catch {
|
|
180
|
+
// return val;
|
|
181
|
+
// }
|
|
182
|
+
// }
|
|
183
|
+
// }
|
|
184
|
+
// }
|
|
185
|
+
const putOptions = (arr, config) => {
|
|
186
|
+
if (config === undefined)
|
|
187
|
+
return arr;
|
|
188
|
+
let list = arr.slice();
|
|
189
|
+
if (config.shift) {
|
|
190
|
+
if (config.shift === true) {
|
|
191
|
+
list.unshift({ label: index_1.i18n.txt(Const_1.V.TXT_ALL), value: '' });
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
list.unshift(config.shift);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (config.valueFormat == 'number') {
|
|
198
|
+
list.map(item => {
|
|
199
|
+
try {
|
|
200
|
+
item.value = parseInt(item.value);
|
|
201
|
+
}
|
|
202
|
+
catch (_a) {
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return list;
|
|
207
|
+
};
|
|
208
|
+
const DictCache = new Map();
|
|
209
|
+
const DictRender = (options) => {
|
|
210
|
+
if (lodash_1.default.isString(options) && DictCache.has(options))
|
|
211
|
+
return DictCache.get(options);
|
|
212
|
+
const props = lodash_1.default.isString(options) ? { dictType: options } : options;
|
|
213
|
+
const fn = (txt) => {
|
|
214
|
+
return react_1.default.createElement(_DictRender, Object.assign({}, props, { value: txt }));
|
|
215
|
+
};
|
|
216
|
+
fn.options = (config) => {
|
|
217
|
+
let info = DICT.get(props.dictType);
|
|
218
|
+
if (info == null)
|
|
219
|
+
return [];
|
|
220
|
+
return putOptions(info.nodes, config);
|
|
221
|
+
};
|
|
222
|
+
fn.getText = (key, def) => {
|
|
223
|
+
if (key === null)
|
|
224
|
+
return def || '';
|
|
225
|
+
const dictInfo = DICT.get(props.dictType);
|
|
226
|
+
if (dictInfo == null)
|
|
227
|
+
return def || '';
|
|
228
|
+
const dictKey = key + '';
|
|
229
|
+
let idx = lodash_1.default.findIndex(dictInfo.nodes, (item) => dictKey == item.value);
|
|
230
|
+
if (idx < 0)
|
|
231
|
+
return def || '';
|
|
232
|
+
return dictInfo.nodes[idx].label;
|
|
233
|
+
};
|
|
234
|
+
if (lodash_1.default.isString(options))
|
|
235
|
+
DictCache.set(options, fn);
|
|
236
|
+
return fn;
|
|
237
|
+
};
|
|
238
|
+
exports.DictRender = DictRender;
|
|
239
|
+
// TODO ,目前结构只支持两层,多层等做
|
|
240
|
+
const initDict = (dict) => {
|
|
241
|
+
const roots = lodash_1.default.filter(dict, item => item['parentType'] == '0' || item['parentType'] == '');
|
|
242
|
+
_V_DICT.DICTS = [];
|
|
243
|
+
roots.map(root => {
|
|
244
|
+
let info = { code: root.type, nodes: [], };
|
|
245
|
+
if (root.format && VALIDATE_FORMAT.has(root.format)) {
|
|
246
|
+
info.format = root.format;
|
|
247
|
+
}
|
|
248
|
+
_V_DICT.DICTS.push({ label: root.codeValue, value: root.type });
|
|
249
|
+
let childs = lodash_1.default.filter(dict, item => item.parentType == root.type);
|
|
250
|
+
childs.map(item => {
|
|
251
|
+
let value = lodash_1.default.trim(item.code);
|
|
252
|
+
if (value.length > 0)
|
|
253
|
+
info.nodes.push({ label: item.codeValue, value });
|
|
254
|
+
});
|
|
255
|
+
DICT.set(root.type, info);
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
exports.initDict = initDict;
|
|
@@ -0,0 +1,46 @@
|
|
|
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.imgRender = exports.fileRender = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const Icon_1 = require("../../components/_adapt/Icon");
|
|
10
|
+
const index_1 = require("../index");
|
|
11
|
+
const Const_1 = require("../../components/_setup/Const");
|
|
12
|
+
// 支持直接用浏览器打开的格式
|
|
13
|
+
const VIEW_TYPES = ['.png', '.jpg', '.svg', '.jpeg', '.gif', '.pdf', '.mp4', '.mp3'];
|
|
14
|
+
const canView = (fileName) => {
|
|
15
|
+
for (let sux of VIEW_TYPES) {
|
|
16
|
+
if (lodash_1.default.toLower(fileName).endsWith(sux)) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
};
|
|
22
|
+
const fileRender = (fileId, fileName) => {
|
|
23
|
+
if (fileName && canView(fileName)) {
|
|
24
|
+
return react_1.default.createElement("a", { href: index_1.GLOBAL.CONFIG.UPLOAD.PREVIEW + fileId, target: "_blank", title: fileName },
|
|
25
|
+
react_1.default.createElement(Icon_1.Icon, { type: "search" }),
|
|
26
|
+
" ",
|
|
27
|
+
fileName);
|
|
28
|
+
}
|
|
29
|
+
return react_1.default.createElement("a", { href: index_1.GLOBAL.CONFIG.UPLOAD.PREVIEW + fileId, target: "_downloadFrame", title: fileName ? fileName : undefined },
|
|
30
|
+
react_1.default.createElement(Icon_1.Icon, { type: "download" }),
|
|
31
|
+
" ",
|
|
32
|
+
fileName ? fileName : index_1.i18n.txt(Const_1.V.BTN_DOWNLOAD));
|
|
33
|
+
};
|
|
34
|
+
exports.fileRender = fileRender;
|
|
35
|
+
const imgRender = (fileId) => {
|
|
36
|
+
// if (portrait) {
|
|
37
|
+
// if (_.startsWith(portrait, '/') || _.startsWith(portrait, 'http:')) {
|
|
38
|
+
// return portrait;
|
|
39
|
+
// } else {
|
|
40
|
+
// return '/api/fs/view/' + portrait
|
|
41
|
+
// }
|
|
42
|
+
// }
|
|
43
|
+
// return '/images/default_user.png';
|
|
44
|
+
// <img src={userAvatar(user.portrait)} alt="avatar" style={{ height: 120, minWidth: 80, maxWidth: 320, borderRadius: 4, border: '2px solid #A82932' }} />
|
|
45
|
+
};
|
|
46
|
+
exports.imgRender = imgRender;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { BaseOption, PlainObject } from '../../basetype';
|
|
2
|
+
import type { Render, BaseRenderOptions, OptionConvertConfig } from './_define';
|
|
3
|
+
type ListRenderOptions = BaseRenderOptions & {
|
|
4
|
+
labelField?: string;
|
|
5
|
+
valueField?: string;
|
|
6
|
+
list: PlainObject[];
|
|
7
|
+
showValue?: boolean;
|
|
8
|
+
};
|
|
9
|
+
interface ListRender extends Render {
|
|
10
|
+
/**
|
|
11
|
+
* 将数据转出为 option 用于 select / checkbox / vap组件中的 options 等。
|
|
12
|
+
*/
|
|
13
|
+
options: (config?: OptionConvertConfig) => BaseOption[];
|
|
14
|
+
}
|
|
15
|
+
export declare const ListRender: (options: BaseOption[] | ListRenderOptions) => ListRender;
|
|
16
|
+
export declare const switchYesNoRender: ListRender;
|
|
17
|
+
export declare const switchEnableRender: ListRender;
|
|
18
|
+
export declare const switchDisableRender: ListRender;
|
|
19
|
+
export declare const switchOpenRender: ListRender;
|
|
20
|
+
export declare const switchCloseRender: ListRender;
|
|
21
|
+
export declare const switchShowRender: ListRender;
|
|
22
|
+
export declare const switchHideRender: ListRender;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,111 @@
|
|
|
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.switchHideRender = exports.switchShowRender = exports.switchCloseRender = exports.switchOpenRender = exports.switchDisableRender = exports.switchEnableRender = exports.switchYesNoRender = exports.ListRender = void 0;
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
+
const i18n_1 = require("../i18n");
|
|
9
|
+
const Const_1 = require("../../components/_setup/Const");
|
|
10
|
+
const _define_1 = require("./_define");
|
|
11
|
+
const Const_2 = require("../Const");
|
|
12
|
+
const ListRender = (options) => {
|
|
13
|
+
const MAP = new Map();
|
|
14
|
+
let labelField = 'label';
|
|
15
|
+
let valueField = 'value';
|
|
16
|
+
let def = null;
|
|
17
|
+
let showValue = false;
|
|
18
|
+
let list;
|
|
19
|
+
const isArr = lodash_1.default.isArray(options);
|
|
20
|
+
if (isArr) {
|
|
21
|
+
list = options;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
list = options.list;
|
|
25
|
+
if (options.default)
|
|
26
|
+
def = options.default;
|
|
27
|
+
if (options.showValue)
|
|
28
|
+
showValue = options.showValue;
|
|
29
|
+
if (options.labelField)
|
|
30
|
+
labelField = options.labelField;
|
|
31
|
+
if (options.valueField)
|
|
32
|
+
valueField = options.valueField;
|
|
33
|
+
}
|
|
34
|
+
list.map(item => {
|
|
35
|
+
if (lodash_1.default.has(item, valueField) && item[valueField] !== null) {
|
|
36
|
+
if (lodash_1.default.has(item, 'ik') && lodash_1.default.isString(item['ik']) && (0, i18n_1.hasKey)(item['ik'])) {
|
|
37
|
+
MAP.set(lodash_1.default.trim(item[valueField]), (0, i18n_1.txt)(item['ik']));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
MAP.set(lodash_1.default.trim(item[valueField]), item[labelField] + '');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const fn = (value) => {
|
|
45
|
+
if (value === null)
|
|
46
|
+
return Const_2.NONE;
|
|
47
|
+
const key = lodash_1.default.trim(value + '');
|
|
48
|
+
var text = '';
|
|
49
|
+
if (!MAP.has(key)) {
|
|
50
|
+
if (def)
|
|
51
|
+
return def;
|
|
52
|
+
if (showValue) {
|
|
53
|
+
text = value + '';
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return Const_2.NONE;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
text = MAP.get(key);
|
|
61
|
+
}
|
|
62
|
+
if (isArr)
|
|
63
|
+
return text;
|
|
64
|
+
return (0, _define_1.getValue)(text, options);
|
|
65
|
+
};
|
|
66
|
+
fn.getText = (value, def) => {
|
|
67
|
+
if (value === null)
|
|
68
|
+
return def || '';
|
|
69
|
+
const key = lodash_1.default.trim(value + '');
|
|
70
|
+
var text = '';
|
|
71
|
+
if (!MAP.has(key)) {
|
|
72
|
+
if (def)
|
|
73
|
+
return def;
|
|
74
|
+
if (showValue) {
|
|
75
|
+
text = value + '';
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
return def || '';
|
|
79
|
+
;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
text = MAP.get(key);
|
|
84
|
+
}
|
|
85
|
+
return text;
|
|
86
|
+
};
|
|
87
|
+
fn.options = (config) => {
|
|
88
|
+
let rtnOptions = [];
|
|
89
|
+
if (config && config.shift) {
|
|
90
|
+
if (config.shift === true) {
|
|
91
|
+
rtnOptions.push({ label: (0, i18n_1.txt)(Const_1.V.TXT_ALL), value: '' });
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
rtnOptions.push(config.shift);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
list.map(item => {
|
|
98
|
+
rtnOptions.push({ label: (0, i18n_1.getText)(item['ik'], item[labelField]), value: (0, _define_1.convertValue)(item[valueField], config) });
|
|
99
|
+
});
|
|
100
|
+
return rtnOptions;
|
|
101
|
+
};
|
|
102
|
+
return fn;
|
|
103
|
+
};
|
|
104
|
+
exports.ListRender = ListRender;
|
|
105
|
+
exports.switchYesNoRender = (0, exports.ListRender)([{ label: '是', value: 1, ik: Const_1.V.SWITCH_YES }, { label: '否', value: 0, ik: Const_1.V.SWITCH_NO }]);
|
|
106
|
+
exports.switchEnableRender = (0, exports.ListRender)([{ label: '启用', value: 1, ik: Const_1.V.SWITCH_ENABLE }, { label: '禁用', value: 0, ik: Const_1.V.SWITCH_DISABLE }]);
|
|
107
|
+
exports.switchDisableRender = (0, exports.ListRender)([{ label: '禁用', value: 1, ik: Const_1.V.SWITCH_DISABLE }, { label: '启用', value: 0, ik: Const_1.V.SWITCH_ENABLE }]);
|
|
108
|
+
exports.switchOpenRender = (0, exports.ListRender)([{ label: '开启', value: 1, ik: Const_1.V.SWITCH_OPEN }, { label: '启用', value: 0, ik: Const_1.V.SWITCH_CLOSE }]);
|
|
109
|
+
exports.switchCloseRender = (0, exports.ListRender)([{ label: '关闭', value: 1, ik: Const_1.V.SWITCH_CLOSE }, { label: '启用', value: 0, ik: Const_1.V.SWITCH_OPEN }]);
|
|
110
|
+
exports.switchShowRender = (0, exports.ListRender)([{ label: '显示', value: 1, ik: Const_1.V.SWITCH_SHOW }, { label: '隐藏', value: 0, ik: Const_1.V.SWITCH_HIDE }]);
|
|
111
|
+
exports.switchHideRender = (0, exports.ListRender)([{ label: '隐藏', value: 1, ik: Const_1.V.SWITCH_HIDE }, { label: '显示', value: 0, ik: Const_1.V.SWITCH_SHOW }]);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { NumberFormat, FractionDigits } from '../Format';
|
|
2
|
+
import type { BaseRenderOptions, Render } from './_define';
|
|
3
|
+
type NumberRenderOptions = Omit<BaseRenderOptions, 'format' | 'len'> & {
|
|
4
|
+
format?: NumberFormat;
|
|
5
|
+
len?: FractionDigits;
|
|
6
|
+
};
|
|
7
|
+
export declare const NumberRender: (options: NumberRenderOptions) => Render;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* 容量 Render 构造器
|
|
11
|
+
* @param byte number 大小
|
|
12
|
+
*/
|
|
13
|
+
export declare const intRender: Render;
|
|
14
|
+
export declare const numberRender: Render;
|
|
15
|
+
export declare const sizeRender: Render;
|
|
16
|
+
export declare const usdRender: Render;
|
|
17
|
+
export declare const chineseRender: Render;
|
|
18
|
+
export declare const percentRender: Render;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
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.percentRender = exports.chineseRender = exports.usdRender = exports.sizeRender = exports.numberRender = exports.intRender = exports.NumberRender = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const Format_1 = require("../Format");
|
|
10
|
+
const Const_1 = require("../Const");
|
|
11
|
+
const NumberRender = (options) => {
|
|
12
|
+
const config = options ? options : {};
|
|
13
|
+
const formater = (0, Format_1.getFormater)(config.format, options.len);
|
|
14
|
+
const fn = (txt) => {
|
|
15
|
+
if (txt === null)
|
|
16
|
+
return options.default || Const_1.NONE;
|
|
17
|
+
let num = null;
|
|
18
|
+
if (lodash_1.default.isString(txt)) {
|
|
19
|
+
try {
|
|
20
|
+
num = parseFloat(txt);
|
|
21
|
+
}
|
|
22
|
+
catch (_a) {
|
|
23
|
+
return options.default || Const_1.NONE;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else if (lodash_1.default.isNumber(txt)) {
|
|
27
|
+
num = txt;
|
|
28
|
+
}
|
|
29
|
+
const rtn = formater(num);
|
|
30
|
+
if (options.onlyText || options.className == null)
|
|
31
|
+
return rtn + '';
|
|
32
|
+
return react_1.default.createElement("span", { className: options.className }, rtn);
|
|
33
|
+
};
|
|
34
|
+
fn.getText = (txt, def = '0') => {
|
|
35
|
+
if (txt === null)
|
|
36
|
+
return def;
|
|
37
|
+
let num = null;
|
|
38
|
+
if (lodash_1.default.isString(txt)) {
|
|
39
|
+
try {
|
|
40
|
+
num = parseFloat(txt);
|
|
41
|
+
}
|
|
42
|
+
catch (_a) {
|
|
43
|
+
return def;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
else if (lodash_1.default.isNumber(txt)) {
|
|
47
|
+
num = txt;
|
|
48
|
+
}
|
|
49
|
+
const rtn = formater(num);
|
|
50
|
+
return rtn;
|
|
51
|
+
};
|
|
52
|
+
return fn;
|
|
53
|
+
};
|
|
54
|
+
exports.NumberRender = NumberRender;
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* 容量 Render 构造器
|
|
58
|
+
* @param byte number 大小
|
|
59
|
+
*/
|
|
60
|
+
exports.intRender = (0, exports.NumberRender)({ format: 'int' });
|
|
61
|
+
exports.numberRender = (0, exports.NumberRender)({ format: 'number', len: 2 });
|
|
62
|
+
exports.sizeRender = (0, exports.NumberRender)({ format: 'size' });
|
|
63
|
+
exports.usdRender = (0, exports.NumberRender)({ format: 'usd' });
|
|
64
|
+
exports.chineseRender = (0, exports.NumberRender)({ format: 'chinese' });
|
|
65
|
+
exports.percentRender = (0, exports.NumberRender)({ format: 'percent' });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Render, OptionConvertConfig } from './_define';
|
|
2
|
+
import type { BaseOption } from '../../basetype';
|
|
3
|
+
type PresetStatusColorType = 'success' | 'processing' | 'error' | 'default' | 'warning';
|
|
4
|
+
interface StatusRender extends Render {
|
|
5
|
+
/**
|
|
6
|
+
* 将数据转出为 option 用于 select / checkbox / vap组件中的 options 等。
|
|
7
|
+
*/
|
|
8
|
+
options: (config?: OptionConvertConfig) => BaseOption[];
|
|
9
|
+
}
|
|
10
|
+
type StatusRenderOptions = Partial<Record<PresetStatusColorType, BaseOption>>;
|
|
11
|
+
export declare const StatusRender: (options: StatusRenderOptions) => StatusRender;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
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.StatusRender = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
+
const antd_1 = require("antd");
|
|
10
|
+
const _define_1 = require("./_define");
|
|
11
|
+
const i18n_1 = require("../i18n");
|
|
12
|
+
const Const_1 = require("../Const");
|
|
13
|
+
const Const_2 = require("../../components/_setup/Const");
|
|
14
|
+
const STATUS = ["success", "processing", "error", "default", "warning"];
|
|
15
|
+
const StatusRender = (options) => {
|
|
16
|
+
const StatusMap = new Map();
|
|
17
|
+
STATUS.map((key) => {
|
|
18
|
+
if (lodash_1.default.has(options, key)) {
|
|
19
|
+
StatusMap.set(options[key].value + '', { label: (0, i18n_1.getText)(options[key].ik, options[key].label), status: key });
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const fn = (value) => {
|
|
23
|
+
// "success", "processing", "error", "default", "warning"
|
|
24
|
+
const key = value + '';
|
|
25
|
+
let info = null;
|
|
26
|
+
if (StatusMap.has(key)) {
|
|
27
|
+
info = StatusMap.get(key);
|
|
28
|
+
}
|
|
29
|
+
else if (StatusMap.has('default')) {
|
|
30
|
+
info = StatusMap.get('default');
|
|
31
|
+
}
|
|
32
|
+
if (info != null)
|
|
33
|
+
return react_1.default.createElement(antd_1.Badge, { status: info.status, text: info.label });
|
|
34
|
+
return Const_1.NONE;
|
|
35
|
+
};
|
|
36
|
+
fn.options = (config) => {
|
|
37
|
+
let rtnOptions = [];
|
|
38
|
+
if (config && config.shift) {
|
|
39
|
+
if (config.shift === true) {
|
|
40
|
+
rtnOptions.push({ label: (0, i18n_1.txt)(Const_2.V.TXT_ALL), value: '' });
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
rtnOptions.push(config.shift);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
STATUS.map((key) => {
|
|
47
|
+
if (lodash_1.default.has(options, key)) {
|
|
48
|
+
rtnOptions.push({ label: options[key].label, value: (0, _define_1.convertValue)(options[key].value, config) });
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return rtnOptions;
|
|
52
|
+
};
|
|
53
|
+
fn.getText = (value, def) => {
|
|
54
|
+
const key = value + '';
|
|
55
|
+
let info = null;
|
|
56
|
+
if (StatusMap.has(key)) {
|
|
57
|
+
info = StatusMap.get(key);
|
|
58
|
+
}
|
|
59
|
+
else if (StatusMap.has('default')) {
|
|
60
|
+
info = StatusMap.get('default');
|
|
61
|
+
}
|
|
62
|
+
if (info != null)
|
|
63
|
+
return info.label;
|
|
64
|
+
return def || key;
|
|
65
|
+
};
|
|
66
|
+
return fn;
|
|
67
|
+
};
|
|
68
|
+
exports.StatusRender = StatusRender;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseRenderOptions, Render } from './_define';
|
|
2
|
+
export declare const StrRender: (options?: number | BaseRenderOptions) => Render;
|
|
3
|
+
/**
|
|
4
|
+
* 返回一个 htmlRender,用于显示自定义的html,会用div包住
|
|
5
|
+
* @param className 包住自定义html的 className 默认为空
|
|
6
|
+
*/
|
|
7
|
+
export declare const HTMRender: (options?: BaseRenderOptions) => Render;
|
|
8
|
+
export declare const strRender: Render;
|
|
9
|
+
export declare const htmlRender: Render;
|
|
10
|
+
export declare const StrCopyRender: (options: number | BaseRenderOptions) => Render;
|
|
11
|
+
/**
|
|
12
|
+
* 默认使用长度为 24 的 Render
|
|
13
|
+
*/
|
|
14
|
+
export declare const strCopyRender: Render;
|