@_tc/template-core 0.0.1-bate.1 → 0.0.1-bate.10
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/{app → cjs/app}/controller/base.d.ts +1 -2
- package/{app → cjs/app}/controller/base.js +0 -3
- package/{app → cjs/app}/controller/project.d.ts +1 -2
- package/cjs/app/controller/project.js +50 -0
- package/{app → cjs/app}/controller/view.d.ts +1 -2
- package/{app → cjs/app}/controller/view.js +0 -1
- package/cjs/app/data/signKey.d.ts +1 -0
- package/{app → cjs/app}/data/signKey.js +0 -1
- package/cjs/app/extend/db.d.ts +2 -0
- package/cjs/app/extend/db.js +12 -0
- package/cjs/app/extend/generateErrorMessage.d.ts +7 -0
- package/{app → cjs/app}/extend/generateErrorMessage.js +3 -1
- package/cjs/app/extend/logger.d.ts +11 -0
- package/{app → cjs/app}/extend/logger.js +0 -1
- package/cjs/app/extend/parsingParamsOnUrl.d.ts +2 -0
- package/{app → cjs/app}/extend/parsingParamsOnUrl.js +0 -1
- package/{app → cjs/app}/extend/render-view.d.ts +1 -2
- package/{app → cjs/app}/extend/render-view.js +0 -1
- package/{app → cjs/app}/middleware/api-params-verify.d.ts +1 -2
- package/{app → cjs/app}/middleware/api-params-verify.js +0 -1
- package/{app → cjs/app}/middleware/api-sign-verify.d.ts +1 -2
- package/{app → cjs/app}/middleware/api-sign-verify.js +0 -1
- package/{app → cjs/app}/middleware/error-handle.d.ts +1 -2
- package/{app → cjs/app}/middleware/error-handle.js +0 -1
- package/{app → cjs/app}/middleware/project-handler.d.ts +1 -2
- package/{app → cjs/app}/middleware/project-handler.js +0 -1
- package/cjs/app/middleware.d.ts +5 -0
- package/{app → cjs/app}/middleware.js +23 -2
- package/cjs/app/router/project.d.ts +4 -0
- package/{app → cjs/app}/router/project.js +0 -1
- package/cjs/app/router/view.d.ts +4 -0
- package/{app → cjs/app}/router/view.js +0 -1
- package/cjs/app/router-schema/project.d.ts +3 -0
- package/{app → cjs/app}/router-schema/project.js +0 -1
- package/cjs/app/service/bese.d.ts +10 -0
- package/{app → cjs/app}/service/bese.js +0 -1
- package/cjs/app/service/project.d.ts +27 -0
- package/cjs/app/service/project.js +42 -0
- package/cjs/app/type.d.ts +2 -0
- package/{app → cjs/app}/type.js +0 -1
- package/cjs/app/typings.d.ts +49 -0
- package/{app → cjs/app}/typings.js +0 -1
- package/cjs/app/view/entry.tpl +30 -0
- package/cjs/bundler/dev.d.ts +1 -0
- package/cjs/bundler/dev.js +68 -0
- package/cjs/bundler/index.d.ts +1 -0
- package/cjs/bundler/index.js +18 -0
- package/cjs/bundler/prod.d.ts +1 -0
- package/cjs/bundler/prod.js +19 -0
- package/cjs/bundler/utils.d.ts +7 -0
- package/cjs/bundler/utils.js +127 -0
- package/cjs/index.d.ts +28 -0
- package/{index.js → cjs/index.js} +0 -1
- package/cjs/packages/core/env.d.ts +15 -0
- package/{packages → cjs/packages}/core/env.js +0 -1
- package/cjs/packages/core/index.d.ts +6 -0
- package/{packages → cjs/packages}/core/index.js +24 -1
- package/cjs/packages/core/loader/config.d.ts +9 -0
- package/{packages → cjs/packages}/core/loader/config.js +14 -1
- package/cjs/packages/core/loader/controller.d.ts +17 -0
- package/{packages → cjs/packages}/core/loader/controller.js +23 -1
- package/cjs/packages/core/loader/extend.d.ts +8 -0
- package/{packages → cjs/packages}/core/loader/extend.js +8 -1
- package/cjs/packages/core/loader/middleware.d.ts +11 -0
- package/cjs/packages/core/loader/middleware.js +38 -0
- package/cjs/packages/core/loader/model.d.ts +36 -0
- package/{packages → cjs/packages}/core/loader/model.js +43 -1
- package/cjs/packages/core/loader/router-schema.d.ts +18 -0
- package/{packages → cjs/packages}/core/loader/router-schema.js +16 -1
- package/{packages → cjs/packages}/core/loader/router.d.ts +5 -1
- package/{packages → cjs/packages}/core/loader/router.js +20 -4
- package/cjs/packages/core/loader/service.d.ts +17 -0
- package/{packages → cjs/packages}/core/loader/service.js +14 -1
- package/cjs/packages/core/paths.d.ts +11 -0
- package/{packages → cjs/packages}/core/paths.js +0 -1
- package/{packages → cjs/packages}/core/types.d.ts +1 -1
- package/{packages → cjs/packages}/core/types.js +0 -1
- package/{packages → cjs/packages}/utils/getAllFilesInFolder.d.ts +5 -1
- package/{packages → cjs/packages}/utils/getAllFilesInFolder.js +0 -1
- package/cjs/packages/utils/getAllFnReturnValue.d.ts +0 -0
- package/cjs/packages/utils/getAllFnReturnValue.js +6 -0
- package/cjs/packages/utils/index.d.ts +4 -0
- package/{packages → cjs/packages}/utils/index.js +0 -1
- package/{packages → cjs/packages}/utils/loadFile.d.ts +6 -1
- package/{packages → cjs/packages}/utils/loadFile.js +9 -1
- package/cjs/packages/utils/path.d.ts +24 -0
- package/{packages → cjs/packages}/utils/path.js +14 -1
- package/cjs/packages/utils/runFileFn.d.ts +5 -0
- package/{packages → cjs/packages}/utils/runFileFn.js +0 -1
- package/cjs/typings/type.d.ts +4 -0
- package/{typings → cjs/typings}/type.js +0 -1
- package/esm/app/controller/base.d.ts +14 -0
- package/esm/app/controller/base.js +21 -0
- package/esm/app/controller/project.d.ts +12 -0
- package/{app → esm/app}/controller/project.js +3 -9
- package/esm/app/controller/view.d.ts +9 -0
- package/esm/app/controller/view.js +12 -0
- package/esm/app/data/signKey.js +1 -0
- package/esm/app/extend/db.js +9 -0
- package/esm/app/extend/generateErrorMessage.js +12 -0
- package/esm/app/extend/logger.js +37 -0
- package/esm/app/extend/parsingParamsOnUrl.js +20 -0
- package/esm/app/extend/render-view.d.ts +5 -0
- package/esm/app/extend/render-view.js +16 -0
- package/esm/app/middleware/api-params-verify.d.ts +6 -0
- package/esm/app/middleware/api-params-verify.js +58 -0
- package/esm/app/middleware/api-sign-verify.d.ts +6 -0
- package/esm/app/middleware/api-sign-verify.js +23 -0
- package/esm/app/middleware/error-handle.d.ts +6 -0
- package/esm/app/middleware/error-handle.js +31 -0
- package/esm/app/middleware/project-handler.d.ts +5 -0
- package/esm/app/middleware/project-handler.js +19 -0
- package/esm/app/middleware.js +55 -0
- package/esm/app/router/project.js +6 -0
- package/esm/app/router/view.js +3 -0
- package/esm/app/router-schema/project.js +31 -0
- package/esm/app/service/bese.js +12 -0
- package/{app → esm/app}/service/project.js +6 -11
- package/esm/app/type.js +1 -0
- package/esm/app/typings.js +1 -0
- package/esm/app/view/entry.tpl +30 -0
- package/esm/bundler/dev.d.ts +2 -0
- package/esm/bundler/dev.js +29 -0
- package/esm/bundler/index.d.ts +2 -0
- package/esm/bundler/index.js +14 -0
- package/esm/bundler/prod.d.ts +2 -0
- package/esm/bundler/prod.js +16 -0
- package/esm/bundler/utils.d.ts +8 -0
- package/esm/bundler/utils.js +85 -0
- package/esm/index.js +13 -0
- package/esm/packages/core/env.js +23 -0
- package/esm/packages/core/index.js +109 -0
- package/esm/packages/core/loader/config.d.ts +10 -0
- package/esm/packages/core/loader/config.js +43 -0
- package/esm/packages/core/loader/controller.d.ts +18 -0
- package/esm/packages/core/loader/controller.js +38 -0
- package/esm/packages/core/loader/extend.d.ts +9 -0
- package/esm/packages/core/loader/extend.js +39 -0
- package/esm/packages/core/loader/middleware.d.ts +12 -0
- package/esm/packages/core/loader/middleware.js +36 -0
- package/esm/packages/core/loader/model.d.ts +37 -0
- package/esm/packages/core/loader/model.js +127 -0
- package/esm/packages/core/loader/router-schema.d.ts +19 -0
- package/esm/packages/core/loader/router-schema.js +33 -0
- package/esm/packages/core/loader/router.d.ts +9 -0
- package/esm/packages/core/loader/router.js +57 -0
- package/esm/packages/core/loader/service.d.ts +18 -0
- package/esm/packages/core/loader/service.js +28 -0
- package/esm/packages/core/paths.js +6 -0
- package/esm/packages/core/types.d.ts +75 -0
- package/esm/packages/core/types.js +1 -0
- package/esm/packages/utils/getAllFilesInFolder.d.ts +10 -0
- package/esm/packages/utils/getAllFilesInFolder.js +8 -0
- package/esm/packages/utils/getAllFnReturnValue.js +6 -0
- package/esm/packages/utils/index.js +4 -0
- package/esm/packages/utils/loadFile.d.ts +21 -0
- package/esm/packages/utils/loadFile.js +63 -0
- package/esm/packages/utils/path.d.ts +25 -0
- package/esm/packages/utils/path.js +27 -0
- package/esm/packages/utils/runFileFn.js +1 -0
- package/esm/typings/type.d.ts +5 -0
- package/esm/typings/type.js +1 -0
- package/fe/frontend/main.d.ts +3 -0
- package/fe/frontend/main.js +6 -0
- package/fe/frontend/testPage/index.d.ts +3 -0
- package/fe/frontend/testPage/index.js +6 -0
- package/fe/frontend/testPage/testPage.entry.d.ts +2 -0
- package/fe/frontend/testPage/testPage.entry.js +4 -0
- package/fe/packages/ui/react/assets/table/no-result.svg +5 -0
- package/fe/packages/ui/react/components/Button/Button.d.ts +39 -0
- package/fe/packages/ui/react/components/Button/Button.js +42 -0
- package/fe/packages/ui/react/components/Button/SumbitButton.d.ts +13 -0
- package/fe/packages/ui/react/components/Button/SumbitButton.js +32 -0
- package/fe/packages/ui/react/components/Button/index.d.ts +4 -0
- package/fe/packages/ui/react/components/Button/index.js +2 -0
- package/fe/packages/ui/react/components/Checkbox/Checkbox.d.ts +17 -0
- package/fe/packages/ui/react/components/Checkbox/Checkbox.js +37 -0
- package/fe/packages/ui/react/components/Checkbox/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Checkbox/index.js +1 -0
- package/fe/packages/ui/react/components/ConfirmDialog.d.ts +20 -0
- package/fe/packages/ui/react/components/ConfirmDialog.js +9 -0
- package/fe/packages/ui/react/components/DataTable/ActionBtn.d.ts +6 -0
- package/fe/packages/ui/react/components/DataTable/ActionBtn.js +13 -0
- package/fe/packages/ui/react/components/DataTable/data-table.d.ts +44 -0
- package/fe/packages/ui/react/components/DataTable/data-table.js +141 -0
- package/fe/packages/ui/react/components/Date/Calendar.d.ts +35 -0
- package/fe/packages/ui/react/components/Date/Calendar.js +215 -0
- package/fe/packages/ui/react/components/Date/Date.d.ts +36 -0
- package/fe/packages/ui/react/components/Date/Date.js +178 -0
- package/fe/packages/ui/react/components/Date/DateTestPage.d.ts +2 -0
- package/fe/packages/ui/react/components/Date/DateTestPage.js +29 -0
- package/fe/packages/ui/react/components/Date/LocaleContext.d.ts +6 -0
- package/fe/packages/ui/react/components/Date/LocaleContext.js +8 -0
- package/fe/packages/ui/react/components/Date/LocaleProvider.d.ts +19 -0
- package/fe/packages/ui/react/components/Date/LocaleProvider.js +24 -0
- package/fe/packages/ui/react/components/Date/TimePicker.d.ts +7 -0
- package/fe/packages/ui/react/components/Date/TimePicker.js +76 -0
- package/fe/packages/ui/react/components/Date/data.d.ts +6 -0
- package/fe/packages/ui/react/components/Date/data.js +4 -0
- package/fe/packages/ui/react/components/Date/dateLocaleStore.d.ts +16 -0
- package/fe/packages/ui/react/components/Date/dateLocaleStore.js +14 -0
- package/fe/packages/ui/react/components/Date/index.d.ts +6 -0
- package/fe/packages/ui/react/components/Date/index.js +5 -0
- package/fe/packages/ui/react/components/Date/locales.d.ts +42 -0
- package/fe/packages/ui/react/components/Date/locales.js +52 -0
- package/fe/packages/ui/react/components/Dropdown.d.ts +16 -0
- package/fe/packages/ui/react/components/Dropdown.js +54 -0
- package/fe/packages/ui/react/components/Form/Form.d.ts +18 -0
- package/fe/packages/ui/react/components/Form/Form.js +8 -0
- package/fe/packages/ui/react/components/Form/FormItem.d.ts +41 -0
- package/fe/packages/ui/react/components/Form/FormItem.js +43 -0
- package/fe/packages/ui/react/components/Form/SchemeForm/data.d.ts +51 -0
- package/fe/packages/ui/react/components/Form/SchemeForm/data.js +8 -0
- package/fe/packages/ui/react/components/Form/SchemeForm/index.d.ts +152 -0
- package/fe/packages/ui/react/components/Form/SchemeForm/index.js +69 -0
- package/fe/packages/ui/react/components/Form/index.d.ts +5 -0
- package/fe/packages/ui/react/components/Form/index.js +4 -0
- package/fe/packages/ui/react/components/Form/useForm.d.ts +3 -0
- package/fe/packages/ui/react/components/Form/useForm.js +1 -0
- package/fe/packages/ui/react/components/ImagePreview/ImagePreview.d.ts +8 -0
- package/fe/packages/ui/react/components/ImagePreview/ImagePreview.js +166 -0
- package/fe/packages/ui/react/components/ImagePreview/PreviewImage.d.ts +11 -0
- package/fe/packages/ui/react/components/ImagePreview/PreviewImage.js +25 -0
- package/fe/packages/ui/react/components/ImagePreview/index.d.ts +3 -0
- package/fe/packages/ui/react/components/ImagePreview/index.js +2 -0
- package/fe/packages/ui/react/components/Input/Input.d.ts +41 -0
- package/fe/packages/ui/react/components/Input/Input.js +60 -0
- package/fe/packages/ui/react/components/Input/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Input/index.js +1 -0
- package/fe/packages/ui/react/components/Label/Label.d.ts +51 -0
- package/fe/packages/ui/react/components/Label/Label.js +35 -0
- package/fe/packages/ui/react/components/Label/index.d.ts +3 -0
- package/fe/packages/ui/react/components/Label/index.js +2 -0
- package/fe/packages/ui/react/components/Message/Message.d.ts +20 -0
- package/fe/packages/ui/react/components/Message/Message.js +55 -0
- package/fe/packages/ui/react/components/Message/MessageManager.d.ts +37 -0
- package/fe/packages/ui/react/components/Message/MessageManager.js +90 -0
- package/fe/packages/ui/react/components/Message/data.d.ts +2 -0
- package/fe/packages/ui/react/components/Message/data.js +1 -0
- package/fe/packages/ui/react/components/Message/index.d.ts +3 -0
- package/fe/packages/ui/react/components/Message/index.js +1 -0
- package/fe/packages/ui/react/components/Modal/Modal.d.ts +25 -0
- package/fe/packages/ui/react/components/Modal/Modal.js +51 -0
- package/fe/packages/ui/react/components/Modal/ModalManager.d.ts +59 -0
- package/fe/packages/ui/react/components/Modal/ModalManager.js +89 -0
- package/fe/packages/ui/react/components/Modal/index.d.ts +4 -0
- package/fe/packages/ui/react/components/Modal/index.js +2 -0
- package/fe/packages/ui/react/components/Pagination.d.ts +18 -0
- package/fe/packages/ui/react/components/Pagination.js +88 -0
- package/fe/packages/ui/react/components/Search/Search.d.ts +17 -0
- package/fe/packages/ui/react/components/Search/Search.js +12 -0
- package/fe/packages/ui/react/components/Search/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Search/index.js +1 -0
- package/fe/packages/ui/react/components/Select/Select.d.ts +21 -0
- package/fe/packages/ui/react/components/Select/Select.js +180 -0
- package/fe/packages/ui/react/components/Select/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Select/index.js +1 -0
- package/fe/packages/ui/react/components/Skeleton/Skeleton.d.ts +28 -0
- package/fe/packages/ui/react/components/Skeleton/Skeleton.js +31 -0
- package/fe/packages/ui/react/components/Skeleton/index.d.ts +3 -0
- package/fe/packages/ui/react/components/Skeleton/index.js +1 -0
- package/fe/packages/ui/react/components/Switch/Switch.d.ts +11 -0
- package/fe/packages/ui/react/components/Switch/Switch.js +20 -0
- package/fe/packages/ui/react/components/Switch/index.d.ts +2 -0
- package/fe/packages/ui/react/components/Switch/index.js +1 -0
- package/fe/packages/ui/react/components/TableSearch/TableSearch.d.ts +67 -0
- package/fe/packages/ui/react/components/TableSearch/TableSearch.js +119 -0
- package/fe/packages/ui/react/components/TableSearch/index.d.ts +2 -0
- package/fe/packages/ui/react/components/TableSearch/index.js +1 -0
- package/fe/packages/ui/react/components/TableSearch/lang.d.ts +15 -0
- package/fe/packages/ui/react/components/TableSearch/lang.js +23 -0
- package/fe/packages/ui/react/components/TableSearch/tableSearchLocaleStore.d.ts +9 -0
- package/fe/packages/ui/react/components/TableSearch/tableSearchLocaleStore.js +11 -0
- package/fe/packages/ui/react/components/Textarea.d.ts +59 -0
- package/fe/packages/ui/react/components/Textarea.js +35 -0
- package/fe/packages/ui/react/components/Tooltip.d.ts +25 -0
- package/fe/packages/ui/react/components/Tooltip.js +118 -0
- package/fe/packages/ui/react/components/TreeSelect.d.ts +25 -0
- package/fe/packages/ui/react/components/TreeSelect.js +162 -0
- package/fe/packages/ui/react/components/Upload/ImageUpload.d.ts +9 -0
- package/fe/packages/ui/react/components/Upload/ImageUpload.js +63 -0
- package/fe/packages/ui/react/components/Upload/Upload.d.ts +41 -0
- package/fe/packages/ui/react/components/Upload/Upload.js +5 -0
- package/fe/packages/ui/react/components/Upload/index.d.ts +3 -0
- package/fe/packages/ui/react/components/Upload/index.js +2 -0
- package/fe/packages/ui/react/components/breadcrumb.d.ts +35 -0
- package/fe/packages/ui/react/components/breadcrumb.js +78 -0
- package/fe/packages/ui/react/components/hooks/useInputController.d.ts +24 -0
- package/fe/packages/ui/react/components/hooks/useInputController.js +45 -0
- package/fe/packages/ui/react/components/index.d.ts +24 -0
- package/fe/packages/ui/react/components/index.js +23 -0
- package/fe/packages/ui/react/components/table.d.ts +17 -0
- package/fe/packages/ui/react/components/table.js +20 -0
- package/fe/packages/ui/react/components/testPage/index.d.ts +3 -0
- package/fe/packages/ui/react/components/testPage/index.js +118 -0
- package/fe/packages/ui/react/hooks/useBreadcrumb.d.ts +10 -0
- package/fe/packages/ui/react/hooks/useBreadcrumb.js +2 -0
- package/fe/packages/ui/react/hooks/useInit.d.ts +3 -0
- package/fe/packages/ui/react/hooks/useInit.js +9 -0
- package/fe/packages/ui/react/hooks/useLanguage.d.ts +7 -0
- package/fe/packages/ui/react/hooks/useLanguage.js +4 -0
- package/fe/packages/ui/react/hooks/usePagination.d.ts +16 -0
- package/fe/packages/ui/react/hooks/usePagination.js +27 -0
- package/fe/packages/ui/react/index.d.ts +3 -0
- package/fe/packages/ui/react/index.js +4 -0
- package/fe/packages/ui/react/lib/export.d.ts +66 -0
- package/fe/packages/ui/react/lib/export.js +138 -0
- package/fe/packages/ui/react/lib/utils.d.ts +34 -0
- package/fe/packages/ui/react/lib/utils.js +70 -0
- package/fe/packages/ui/react/locales/index.d.ts +8 -0
- package/fe/packages/ui/react/locales/index.js +6 -0
- package/fe/packages/ui/react/stores/breadcrumb.d.ts +15 -0
- package/fe/packages/ui/react/stores/breadcrumb.js +66 -0
- package/fe/packages/ui/react/stores/language.d.ts +13 -0
- package/fe/packages/ui/react/stores/language.js +51 -0
- package/{typings/type.d.ts → fe/packages/ui/react/types/index.d.ts} +1 -1
- package/fe/packages/ui/react/types/index.js +1 -0
- package/package.json +38 -4
- package/app/controller/base.d.ts.map +0 -1
- package/app/controller/base.js.map +0 -1
- package/app/controller/project.d.ts.map +0 -1
- package/app/controller/project.js.map +0 -1
- package/app/controller/view.d.ts.map +0 -1
- package/app/controller/view.js.map +0 -1
- package/app/data/signKey.d.ts.map +0 -1
- package/app/data/signKey.js.map +0 -1
- package/app/extend/db.d.ts.map +0 -1
- package/app/extend/db.js +0 -8
- package/app/extend/db.js.map +0 -1
- package/app/extend/generateErrorMessage.d.ts.map +0 -1
- package/app/extend/generateErrorMessage.js.map +0 -1
- package/app/extend/logger.d.ts.map +0 -1
- package/app/extend/logger.js.map +0 -1
- package/app/extend/parsingParamsOnUrl.d.ts.map +0 -1
- package/app/extend/parsingParamsOnUrl.js.map +0 -1
- package/app/extend/render-view.d.ts.map +0 -1
- package/app/extend/render-view.js.map +0 -1
- package/app/middleware/api-params-verify.d.ts.map +0 -1
- package/app/middleware/api-params-verify.js.map +0 -1
- package/app/middleware/api-sign-verify.d.ts.map +0 -1
- package/app/middleware/api-sign-verify.js.map +0 -1
- package/app/middleware/error-handle.d.ts.map +0 -1
- package/app/middleware/error-handle.js.map +0 -1
- package/app/middleware/project-handler.d.ts.map +0 -1
- package/app/middleware/project-handler.js.map +0 -1
- package/app/middleware.d.ts.map +0 -1
- package/app/middleware.js.map +0 -1
- package/app/router/project.d.ts.map +0 -1
- package/app/router/project.js.map +0 -1
- package/app/router/view.d.ts.map +0 -1
- package/app/router/view.js.map +0 -1
- package/app/router-schema/project.d.ts.map +0 -1
- package/app/router-schema/project.js.map +0 -1
- package/app/service/bese.d.ts.map +0 -1
- package/app/service/bese.js.map +0 -1
- package/app/service/project.d.ts.map +0 -1
- package/app/service/project.js.map +0 -1
- package/app/type.d.ts.map +0 -1
- package/app/type.js.map +0 -1
- package/app/typings.d.ts.map +0 -1
- package/app/typings.js.map +0 -1
- package/index.d.ts.map +0 -1
- package/index.js.map +0 -1
- package/model/index.d.ts +0 -2
- package/model/index.d.ts.map +0 -1
- package/model/index.js +0 -7
- package/model/index.js.map +0 -1
- package/model/test.d.ts +0 -6
- package/model/test.d.ts.map +0 -1
- package/model/test.js +0 -6
- package/model/test.js.map +0 -1
- package/model/test2.d.ts +0 -6
- package/model/test2.d.ts.map +0 -1
- package/model/test2.js +0 -6
- package/model/test2.js.map +0 -1
- package/packages/core/env.d.ts.map +0 -1
- package/packages/core/env.js.map +0 -1
- package/packages/core/index.d.ts.map +0 -1
- package/packages/core/index.js.map +0 -1
- package/packages/core/loader/config.d.ts +0 -4
- package/packages/core/loader/config.d.ts.map +0 -1
- package/packages/core/loader/config.js.map +0 -1
- package/packages/core/loader/controller.d.ts +0 -4
- package/packages/core/loader/controller.d.ts.map +0 -1
- package/packages/core/loader/controller.js.map +0 -1
- package/packages/core/loader/extend.d.ts +0 -4
- package/packages/core/loader/extend.d.ts.map +0 -1
- package/packages/core/loader/extend.js.map +0 -1
- package/packages/core/loader/middleware.d.ts +0 -4
- package/packages/core/loader/middleware.d.ts.map +0 -1
- package/packages/core/loader/middleware.js +0 -16
- package/packages/core/loader/middleware.js.map +0 -1
- package/packages/core/loader/model.d.ts +0 -15
- package/packages/core/loader/model.d.ts.map +0 -1
- package/packages/core/loader/model.js.map +0 -1
- package/packages/core/loader/router-schema.d.ts +0 -4
- package/packages/core/loader/router-schema.d.ts.map +0 -1
- package/packages/core/loader/router-schema.js.map +0 -1
- package/packages/core/loader/router.d.ts.map +0 -1
- package/packages/core/loader/router.js.map +0 -1
- package/packages/core/loader/service.d.ts +0 -4
- package/packages/core/loader/service.d.ts.map +0 -1
- package/packages/core/loader/service.js.map +0 -1
- package/packages/core/paths.d.ts.map +0 -1
- package/packages/core/paths.js.map +0 -1
- package/packages/core/types.d.ts.map +0 -1
- package/packages/core/types.js.map +0 -1
- package/packages/utils/getAllFilesInFolder.d.ts.map +0 -1
- package/packages/utils/getAllFilesInFolder.js.map +0 -1
- package/packages/utils/getAllFnReturnValue.d.ts.map +0 -1
- package/packages/utils/getAllFnReturnValue.js +0 -2
- package/packages/utils/getAllFnReturnValue.js.map +0 -1
- package/packages/utils/index.d.ts.map +0 -1
- package/packages/utils/index.js.map +0 -1
- package/packages/utils/loadFile.d.ts.map +0 -1
- package/packages/utils/loadFile.js.map +0 -1
- package/packages/utils/path.d.ts +0 -7
- package/packages/utils/path.d.ts.map +0 -1
- package/packages/utils/path.js.map +0 -1
- package/packages/utils/runFileFn.d.ts.map +0 -1
- package/packages/utils/runFileFn.js.map +0 -1
- package/typings/type.d.ts.map +0 -1
- package/typings/type.js.map +0 -1
- /package/{app → esm/app}/data/signKey.d.ts +0 -0
- /package/{app → esm/app}/extend/db.d.ts +0 -0
- /package/{app → esm/app}/extend/generateErrorMessage.d.ts +0 -0
- /package/{app → esm/app}/extend/logger.d.ts +0 -0
- /package/{app → esm/app}/extend/parsingParamsOnUrl.d.ts +0 -0
- /package/{app → esm/app}/middleware.d.ts +0 -0
- /package/{app → esm/app}/router/project.d.ts +0 -0
- /package/{app → esm/app}/router/view.d.ts +0 -0
- /package/{app → esm/app}/router-schema/project.d.ts +0 -0
- /package/{app → esm/app}/service/bese.d.ts +0 -0
- /package/{app → esm/app}/service/project.d.ts +0 -0
- /package/{app → esm/app}/type.d.ts +0 -0
- /package/{app → esm/app}/typings.d.ts +0 -0
- /package/{index.d.ts → esm/index.d.ts} +0 -0
- /package/{packages → esm/packages}/core/env.d.ts +0 -0
- /package/{packages → esm/packages}/core/index.d.ts +0 -0
- /package/{packages → esm/packages}/core/paths.d.ts +0 -0
- /package/{packages → esm/packages}/utils/getAllFnReturnValue.d.ts +0 -0
- /package/{packages → esm/packages}/utils/index.d.ts +0 -0
- /package/{packages → esm/packages}/utils/runFileFn.d.ts +0 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Form, FormItem, ImageUpload, Input, Label, SchemeForm, Skeleton, TableSearch, TreeSelect, useForm, } from '../../components';
|
|
3
|
+
import { useRef, useState } from 'react';
|
|
4
|
+
import DateTestPage from '../Date/DateTestPage';
|
|
5
|
+
import { PreviewImage } from '../../components';
|
|
6
|
+
function TreeSelectDemo() {
|
|
7
|
+
const [value, setValue] = useState(['1.1.1', '1.1.2']);
|
|
8
|
+
const [indeterminate, setIndeterminate] = useState([]);
|
|
9
|
+
const treeData = [
|
|
10
|
+
{
|
|
11
|
+
id: '1',
|
|
12
|
+
name: '1',
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
id: '1.1',
|
|
16
|
+
name: '1.1',
|
|
17
|
+
children: [
|
|
18
|
+
{
|
|
19
|
+
id: '1.1.1',
|
|
20
|
+
name: '1.1.1',
|
|
21
|
+
children: [
|
|
22
|
+
{
|
|
23
|
+
id: '1.1.1.1',
|
|
24
|
+
name: '1.1.1.1',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: '1.1.1.2',
|
|
28
|
+
name: '1.1.1.2',
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
{ id: '1.1.2', name: '1.1.2' },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: '1.2',
|
|
37
|
+
name: '1.2',
|
|
38
|
+
children: [
|
|
39
|
+
{ id: '1.2.1', name: '1.2.1' },
|
|
40
|
+
{ id: '1.2.2', name: '1.2.2' },
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "mb-4", children: [_jsxs("div", { children: ["\u9009\u4E2D: ", JSON.stringify(value)] }), _jsxs("div", { children: ["\u534A\u9009: ", JSON.stringify(indeterminate)] })] }), _jsx(TreeSelect, { data: treeData, value: value, onChange: ({ checked, indeterminate }) => {
|
|
47
|
+
setValue(checked);
|
|
48
|
+
setIndeterminate(indeterminate);
|
|
49
|
+
} })] }));
|
|
50
|
+
}
|
|
51
|
+
function PreviewImageDemo() {
|
|
52
|
+
const images = [
|
|
53
|
+
'https://s3.ap-northeast-1.amazonaws.com/ezpay-test/52903c41-2eec-4326-95f0-79d56a4dc19c.png',
|
|
54
|
+
'https://aisearch.cdn.bcebos.com/homepage/dashboard/ai_picture_create/15.png',
|
|
55
|
+
];
|
|
56
|
+
return (_jsx(_Fragment, { children: _jsx(PreviewImage, { images: images, initialIndex: 0 }) }));
|
|
57
|
+
}
|
|
58
|
+
function MyForm() {
|
|
59
|
+
const [form] = useForm();
|
|
60
|
+
const onFinish = (values) => {
|
|
61
|
+
console.log('表单值:', values);
|
|
62
|
+
};
|
|
63
|
+
return (_jsxs(Form, { form: form, onFinish: onFinish, children: [_jsx(FormItem, { name: "username", label: "\u7528\u6237\u540D", required: true, rules: [{ required: true, message: '请输入用户名' }], children: _jsx(Input, { placeholder: "\u8BF7\u8F93\u5165\u7528\u6237\u540D" }) }), _jsx(FormItem, { name: "password", label: "\u5BC6\u7801", required: true, rules: [{ required: true, message: '请输入密码' }], children: _jsx(Input, { type: "password", placeholder: "\u8BF7\u8F93\u5165\u5BC6\u7801" }) }), _jsx(Button, { type: "submit", children: "\u63D0\u4EA4" })] }));
|
|
64
|
+
}
|
|
65
|
+
const TestPage = () => {
|
|
66
|
+
const form = useRef(undefined);
|
|
67
|
+
return (_jsxs("div", { children: [_jsx("h1", { children: "button" }), _jsx(Button, { onClick: () => console.log(form), children: "click" }), _jsx("h2", { children: "text" }), _jsx(Button, { variant: "text", onClick: () => console.log(form), children: "click" }), _jsx(Button, { disabled: true, variant: "text", onClick: () => console.log(form), children: "click" }), _jsx("h1", { children: "input" }), _jsx(Input, {}), _jsx("h1", { children: "form" }), _jsx(MyForm, {}), _jsx("h1", { children: "schemeform" }), _jsx(SchemeForm, { layout: "horizontal", getForm: (f) => {
|
|
68
|
+
form.current = f;
|
|
69
|
+
}, schemes: [
|
|
70
|
+
{
|
|
71
|
+
name: 'username',
|
|
72
|
+
label: '用户名',
|
|
73
|
+
type: 'input',
|
|
74
|
+
required: true,
|
|
75
|
+
rules: [{ required: true, message: '请输入用户名' }],
|
|
76
|
+
fieldProps: {
|
|
77
|
+
placeholder: '请输入用户名',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'role',
|
|
82
|
+
label: '角色',
|
|
83
|
+
type: 'select',
|
|
84
|
+
fieldProps: {
|
|
85
|
+
placeholder: '请选择',
|
|
86
|
+
options: [
|
|
87
|
+
{ label: '管理员', value: 'admin' },
|
|
88
|
+
{ label: '用户', value: 'user' },
|
|
89
|
+
],
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
], onFinish: (values) => console.log(values) }), _jsx("h1", { children: "label" }), _jsx("div", { children: _jsx(Label, { label: "labelName", layout: "horizontal", children: "123" }) }), _jsx("h1", { children: "TableSearch " }), _jsx(TableSearch, { onSearch: (v) => {
|
|
93
|
+
console.log(v);
|
|
94
|
+
}, schemes: [
|
|
95
|
+
{ type: 'input', fieldProps: {}, name: '1', label: '1' },
|
|
96
|
+
{ type: 'switch', fieldProps: {}, name: '2', label: '2' },
|
|
97
|
+
{ type: 'select', fieldProps: { options: [{ value: '3', label: '3' }] }, name: '3', label: '3' },
|
|
98
|
+
{ type: 'textarea', fieldProps: {}, name: '4', label: '4' },
|
|
99
|
+
{ type: 'date', fieldProps: {}, name: '5', label: '5' },
|
|
100
|
+
{
|
|
101
|
+
type: 'date',
|
|
102
|
+
fieldProps: {
|
|
103
|
+
mode: 'range',
|
|
104
|
+
},
|
|
105
|
+
name: '6',
|
|
106
|
+
label: '6',
|
|
107
|
+
},
|
|
108
|
+
{ type: 'input', fieldProps: {}, name: '7', label: '7' },
|
|
109
|
+
{ type: 'date', fieldProps: {}, name: '8', label: '8' },
|
|
110
|
+
{ type: 'input', fieldProps: {}, name: '9', label: '9' },
|
|
111
|
+
{ type: 'input', fieldProps: {}, name: '10', label: '10' },
|
|
112
|
+
{ type: 'input', fieldProps: {}, name: '11', label: '11' },
|
|
113
|
+
] }), _jsx("h1", { children: "Skeleton" }), _jsx(Skeleton, { mode: "pageloading", rows: 5, showTitle: true, showActions: true }), _jsx(Skeleton, { mode: "tableloading", rows: 8 }), _jsx(Skeleton, { mode: "componentsloading", rows: 3 }), _jsx("h1", { children: "TreeSelect" }), _jsx(TreeSelectDemo, {}), _jsx(DateTestPage, {}), _jsx("h1", { children: "PreviewImage" }), _jsx(PreviewImageDemo, {}), _jsx("h1", { children: "ImageUpload" }), _jsx(ImageUpload, { accept: ".jpg,.png", maxCount: 4, beforeChange: (f) => {
|
|
114
|
+
console.log(f);
|
|
115
|
+
return parseInt(Math.random() * 10 + '') % 2 === 0;
|
|
116
|
+
} })] }));
|
|
117
|
+
};
|
|
118
|
+
export default TestPage;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const useBreadcrumb: import("zustand").UseBoundStore<import("zustand").StoreApi<{
|
|
2
|
+
items: import("..").BreadcrumbItemData[];
|
|
3
|
+
} & {
|
|
4
|
+
setItems: (items: import("..").BreadcrumbItemData[]) => void;
|
|
5
|
+
addItem: (item: import("..").BreadcrumbItemData) => void;
|
|
6
|
+
removeItem: (id: string | number) => void;
|
|
7
|
+
clearItems: () => void;
|
|
8
|
+
setActiveItem: (id: string | number) => void;
|
|
9
|
+
}>>;
|
|
10
|
+
//# sourceMappingURL=useBreadcrumb.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type PaginationValue = {
|
|
2
|
+
current: number;
|
|
3
|
+
size: number;
|
|
4
|
+
total: number;
|
|
5
|
+
};
|
|
6
|
+
type IParams = {
|
|
7
|
+
defaultValue?: PaginationValue;
|
|
8
|
+
};
|
|
9
|
+
export default function usePagination(params?: IParams): import("react").RefObject<{
|
|
10
|
+
current: number;
|
|
11
|
+
size: number;
|
|
12
|
+
total: number;
|
|
13
|
+
onChange: (params: Partial<PaginationValue>) => void;
|
|
14
|
+
}>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=usePagination.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { useCallback, useRef, useState } from 'react';
|
|
2
|
+
import useInit from './useInit';
|
|
3
|
+
export default function usePagination(params) {
|
|
4
|
+
const initValue = {
|
|
5
|
+
...(params?.defaultValue ?? { current: 1, size: 10, total: 0 }),
|
|
6
|
+
onChange: () => { },
|
|
7
|
+
};
|
|
8
|
+
const paginationData = useRef({ ...initValue });
|
|
9
|
+
const [, changeView] = useState(0);
|
|
10
|
+
const updata = useCallback((params) => {
|
|
11
|
+
if (typeof params.current !== 'undefined') {
|
|
12
|
+
paginationData.current.current = params.current;
|
|
13
|
+
}
|
|
14
|
+
if (typeof params.size !== 'undefined') {
|
|
15
|
+
paginationData.current.size = params.size;
|
|
16
|
+
}
|
|
17
|
+
if (typeof params.total !== 'undefined') {
|
|
18
|
+
paginationData.current.total = params.total;
|
|
19
|
+
}
|
|
20
|
+
if ([params.size, params.current, params.total].some((i) => typeof i !== 'undefined'))
|
|
21
|
+
changeView((e) => e + 1);
|
|
22
|
+
}, []);
|
|
23
|
+
useInit(() => {
|
|
24
|
+
paginationData.current.onChange = updata;
|
|
25
|
+
});
|
|
26
|
+
return paginationData;
|
|
27
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 导出 Excel 工具方法
|
|
3
|
+
*
|
|
4
|
+
* 功能:
|
|
5
|
+
* - 支持导出「当前页」或「当前查询条件下的全部页数据」
|
|
6
|
+
* - 通过 DataTable 的 columns 控制导出列及顺序
|
|
7
|
+
*
|
|
8
|
+
* 使用方式(示例):
|
|
9
|
+
* ```ts
|
|
10
|
+
* await exportToExcel({
|
|
11
|
+
* fetchData: (pageNum, pageSize) => getWithdrawList({ ...searchParams, pageNum, pageSize }),
|
|
12
|
+
* columns, // 直接复用 DataTable 的 columns
|
|
13
|
+
* exportType: 'all', // 'all' 导出全部页;'current' 仅导出当前页
|
|
14
|
+
* currentPage,
|
|
15
|
+
* pageSize,
|
|
16
|
+
* total,
|
|
17
|
+
* currentPageData: tableData, // 可选,导出当前页时直接使用现有数据,避免重复请求
|
|
18
|
+
* fileName: '提币记录',
|
|
19
|
+
* })
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
import { type ColumnDef } from '../components';
|
|
23
|
+
export declare const ExportType: {
|
|
24
|
+
/**
|
|
25
|
+
* 当前查询条件下所有页
|
|
26
|
+
*/
|
|
27
|
+
readonly all: 0;
|
|
28
|
+
/**
|
|
29
|
+
* 当前页
|
|
30
|
+
*/
|
|
31
|
+
readonly current: 1;
|
|
32
|
+
};
|
|
33
|
+
export type ExportType = (typeof ExportType)[keyof typeof ExportType];
|
|
34
|
+
interface ExportExcelParams<T> {
|
|
35
|
+
/** 获取数据方法 */
|
|
36
|
+
fetchData: (pageNum: number, pageSize: number, searchParams?: Record<string, any>) => Promise<{
|
|
37
|
+
records: T[];
|
|
38
|
+
total: number;
|
|
39
|
+
}>;
|
|
40
|
+
/** 直接复用 DataTable 的 columns 配置 会自动过滤 操作栏*/
|
|
41
|
+
columns: ColumnDef<T>[];
|
|
42
|
+
/** 导出类型:all=当前查询条件下所有页;current=当前页 */
|
|
43
|
+
exportType: ExportType;
|
|
44
|
+
/** 当前页码(导出当前页时使用)默认 1 */
|
|
45
|
+
currentPage?: number;
|
|
46
|
+
/** 每页条数,默认 2000 */
|
|
47
|
+
pageSize?: number;
|
|
48
|
+
/**
|
|
49
|
+
* 最大导出条数,超过则停止继续请求
|
|
50
|
+
* @default 10000
|
|
51
|
+
*/
|
|
52
|
+
maxCount?: number;
|
|
53
|
+
/**
|
|
54
|
+
* 当前页已有数据
|
|
55
|
+
* - 当 exportType === 'current' 且传入该字段时,将直接使用该数据,不会再次请求接口
|
|
56
|
+
*/
|
|
57
|
+
currentPageData?: T[];
|
|
58
|
+
/** 文件名(不含扩展名),默认:export-YYYYMMDDHHmmss */
|
|
59
|
+
fileName?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 通用导出 Excel 方法
|
|
63
|
+
*/
|
|
64
|
+
export declare function exportToExcel<T>(options: ExportExcelParams<T>): Promise<void>;
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=export.d.ts.map
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 导出 Excel 工具方法
|
|
3
|
+
*
|
|
4
|
+
* 功能:
|
|
5
|
+
* - 支持导出「当前页」或「当前查询条件下的全部页数据」
|
|
6
|
+
* - 通过 DataTable 的 columns 控制导出列及顺序
|
|
7
|
+
*
|
|
8
|
+
* 使用方式(示例):
|
|
9
|
+
* ```ts
|
|
10
|
+
* await exportToExcel({
|
|
11
|
+
* fetchData: (pageNum, pageSize) => getWithdrawList({ ...searchParams, pageNum, pageSize }),
|
|
12
|
+
* columns, // 直接复用 DataTable 的 columns
|
|
13
|
+
* exportType: 'all', // 'all' 导出全部页;'current' 仅导出当前页
|
|
14
|
+
* currentPage,
|
|
15
|
+
* pageSize,
|
|
16
|
+
* total,
|
|
17
|
+
* currentPageData: tableData, // 可选,导出当前页时直接使用现有数据,避免重复请求
|
|
18
|
+
* fileName: '提币记录',
|
|
19
|
+
* })
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
import { message } from '../components';
|
|
23
|
+
import * as XLSX from 'xlsx';
|
|
24
|
+
const getTextFromReactNode = (node) => {
|
|
25
|
+
if (node == null || typeof node !== 'object') {
|
|
26
|
+
return node;
|
|
27
|
+
}
|
|
28
|
+
if ('props' in node && node.props && typeof node.props === 'object' && 'children' in node.props) {
|
|
29
|
+
const children = node.props.children;
|
|
30
|
+
if (Array.isArray(children)) {
|
|
31
|
+
return children.map((child) => getTextFromReactNode(child)).flat();
|
|
32
|
+
}
|
|
33
|
+
return getTextFromReactNode(children);
|
|
34
|
+
}
|
|
35
|
+
return String(node);
|
|
36
|
+
};
|
|
37
|
+
export const ExportType = {
|
|
38
|
+
/**
|
|
39
|
+
* 当前查询条件下所有页
|
|
40
|
+
*/
|
|
41
|
+
all: 0,
|
|
42
|
+
/**
|
|
43
|
+
* 当前页
|
|
44
|
+
*/
|
|
45
|
+
current: 1,
|
|
46
|
+
};
|
|
47
|
+
/** 读取嵌套字段值,支持 a.b.c 形式 */
|
|
48
|
+
const getValue = (row, dataIndex) => {
|
|
49
|
+
const key = String(dataIndex);
|
|
50
|
+
if (!key.includes('.'))
|
|
51
|
+
return row?.[key];
|
|
52
|
+
return key.split('.').reduce((acc, cur) => (acc == null ? acc : acc[cur]), row);
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* 通用导出 Excel 方法
|
|
56
|
+
*/
|
|
57
|
+
export async function exportToExcel(options) {
|
|
58
|
+
const { fetchData, exportType, currentPage = 1, pageSize = 2000, maxCount = 10000, currentPageData, fileName, } = options;
|
|
59
|
+
const defaultSearchParams = { export: true };
|
|
60
|
+
const cols = options.columns;
|
|
61
|
+
const fieldConfigs = cols
|
|
62
|
+
// 过滤掉操作列
|
|
63
|
+
.filter((col) => !col.isAction && col.key !== 'action')
|
|
64
|
+
.map((col) => ({
|
|
65
|
+
title: col.title,
|
|
66
|
+
dataIndex: (col.dataIndex || col.key),
|
|
67
|
+
render: col.renderExport ?? col.render,
|
|
68
|
+
}));
|
|
69
|
+
if (!fieldConfigs.length) {
|
|
70
|
+
console.warn('[exportToExcel] 导出列配置为空,已终止导出');
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const infoMessageId = message.info('导出中...', { duration: 999999999 });
|
|
74
|
+
try {
|
|
75
|
+
let allData = [];
|
|
76
|
+
if (exportType === ExportType.current) {
|
|
77
|
+
// 优先使用已存在的当前页数据,避免重复请求
|
|
78
|
+
if (currentPageData && currentPageData.length) {
|
|
79
|
+
allData = currentPageData;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
const res = await fetchData(currentPage, pageSize, defaultSearchParams);
|
|
83
|
+
allData = res.records || [];
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
// 导出所有页:按页拉取,直到数据不足一整页或达到最大条数
|
|
88
|
+
const list = [];
|
|
89
|
+
for (let page = 1;; page += 1) {
|
|
90
|
+
const res = await fetchData(page, pageSize, defaultSearchParams);
|
|
91
|
+
const records = res.records || [];
|
|
92
|
+
if (!records.length)
|
|
93
|
+
break;
|
|
94
|
+
list.push(...records);
|
|
95
|
+
// 达到最大条数后直接截断并停止
|
|
96
|
+
if (list.length >= maxCount) {
|
|
97
|
+
list.length = maxCount;
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
// 本页数据不足 pageSize,说明已到最后一页
|
|
101
|
+
if (records.length < pageSize)
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
allData = list;
|
|
105
|
+
}
|
|
106
|
+
if (!allData.length) {
|
|
107
|
+
message.warning?.('暂无可导出的数据');
|
|
108
|
+
message.close(infoMessageId);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
// 构建表头
|
|
112
|
+
const header = fieldConfigs.map((f) => f.title);
|
|
113
|
+
// 构建数据行
|
|
114
|
+
const dataRows = allData.map((row, index) => fieldConfigs.map((f) => {
|
|
115
|
+
const v = f.render ? f.render(getValue(row, f.dataIndex), row, index) : getValue(row, f.dataIndex);
|
|
116
|
+
// 如果v是ReactNode
|
|
117
|
+
// 需要获取最深层的text
|
|
118
|
+
if (v && typeof v === 'object' && 'props' in v && 'children' in v.props) {
|
|
119
|
+
return getTextFromReactNode(v);
|
|
120
|
+
}
|
|
121
|
+
return v;
|
|
122
|
+
}));
|
|
123
|
+
const worksheet = XLSX.utils.aoa_to_sheet([header, ...dataRows]);
|
|
124
|
+
const workbook = XLSX.utils.book_new();
|
|
125
|
+
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
|
126
|
+
const now = new Date();
|
|
127
|
+
const pad = (n) => (n < 10 ? `0${n}` : String(n));
|
|
128
|
+
const defaultName = `export-${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
|
|
129
|
+
XLSX.writeFile(workbook, `${fileName || defaultName}.xlsx`);
|
|
130
|
+
message.close(infoMessageId);
|
|
131
|
+
message.success?.('导出成功');
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
console.error('[exportToExcel] 导出失败:', error);
|
|
135
|
+
message.close(infoMessageId);
|
|
136
|
+
message.error?.('导出失败,请稍后重试');
|
|
137
|
+
}
|
|
138
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ClassValue } from "clsx";
|
|
2
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
+
/**
|
|
4
|
+
* 日期时间格式化工具
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* 格式化日期时间
|
|
8
|
+
* @param date 日期字符串或 Date 对象
|
|
9
|
+
* @param format 格式化模板,默认 'YYYY-MM-DD HH:mm:ss'
|
|
10
|
+
* @returns 格式化后的字符串
|
|
11
|
+
*/
|
|
12
|
+
export declare function formatDateTime(date: string | Date | null | undefined | number, format?: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* 格式化日期
|
|
15
|
+
* @param date 日期字符串或 Date 对象
|
|
16
|
+
* @returns 格式化后的字符串 YYYY-MM-DD
|
|
17
|
+
*/
|
|
18
|
+
export declare function formatDate(date: string | Date | null | undefined): string;
|
|
19
|
+
/**
|
|
20
|
+
* 格式化时间
|
|
21
|
+
* @param date 日期字符串或 Date 对象
|
|
22
|
+
* @returns 格式化后的字符串 HH:mm:ss
|
|
23
|
+
*/
|
|
24
|
+
export declare function formatTime(date: string | Date | null | undefined): string;
|
|
25
|
+
/**
|
|
26
|
+
* 生成开始结束时间
|
|
27
|
+
* @param dates 日期字符串或 Date 对象数组
|
|
28
|
+
* @returns 开始结束时间对象 { start: string; end: string }
|
|
29
|
+
*/
|
|
30
|
+
export declare function generateStartEndTime(dates: string[] | Date[] | null | undefined): {
|
|
31
|
+
start: string;
|
|
32
|
+
end: string;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
export function cn(...inputs) {
|
|
4
|
+
return twMerge(clsx(inputs));
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 日期时间格式化工具
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* 格式化日期时间
|
|
11
|
+
* @param date 日期字符串或 Date 对象
|
|
12
|
+
* @param format 格式化模板,默认 'YYYY-MM-DD HH:mm:ss'
|
|
13
|
+
* @returns 格式化后的字符串
|
|
14
|
+
*/
|
|
15
|
+
export function formatDateTime(date, format = "YYYY-MM-DD HH:mm:ss") {
|
|
16
|
+
if (!date)
|
|
17
|
+
return "-";
|
|
18
|
+
let d = new Date(date);
|
|
19
|
+
// 接口返回的时间戳为 秒
|
|
20
|
+
const tmpY = d.getFullYear();
|
|
21
|
+
if (typeof date === "number" && tmpY === 1970) {
|
|
22
|
+
d = new Date(date * 1000);
|
|
23
|
+
}
|
|
24
|
+
if (isNaN(d.getTime()))
|
|
25
|
+
return "-";
|
|
26
|
+
const year = d.getFullYear();
|
|
27
|
+
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
28
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
29
|
+
const hours = String(d.getHours()).padStart(2, "0");
|
|
30
|
+
const minutes = String(d.getMinutes()).padStart(2, "0");
|
|
31
|
+
const seconds = String(d.getSeconds()).padStart(2, "0");
|
|
32
|
+
return format
|
|
33
|
+
.replace("YYYY", String(year))
|
|
34
|
+
.replace("MM", month)
|
|
35
|
+
.replace("DD", day)
|
|
36
|
+
.replace("HH", hours)
|
|
37
|
+
.replace("mm", minutes)
|
|
38
|
+
.replace("ss", seconds);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 格式化日期
|
|
42
|
+
* @param date 日期字符串或 Date 对象
|
|
43
|
+
* @returns 格式化后的字符串 YYYY-MM-DD
|
|
44
|
+
*/
|
|
45
|
+
export function formatDate(date) {
|
|
46
|
+
return formatDateTime(date, "YYYY-MM-DD");
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 格式化时间
|
|
50
|
+
* @param date 日期字符串或 Date 对象
|
|
51
|
+
* @returns 格式化后的字符串 HH:mm:ss
|
|
52
|
+
*/
|
|
53
|
+
export function formatTime(date) {
|
|
54
|
+
return formatDateTime(date, "HH:mm:ss");
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 生成开始结束时间
|
|
58
|
+
* @param dates 日期字符串或 Date 对象数组
|
|
59
|
+
* @returns 开始结束时间对象 { start: string; end: string }
|
|
60
|
+
*/
|
|
61
|
+
export function generateStartEndTime(dates) {
|
|
62
|
+
if (!dates)
|
|
63
|
+
return { start: "", end: "" };
|
|
64
|
+
const start = dates[0];
|
|
65
|
+
const end = dates[dates.length - 1];
|
|
66
|
+
return {
|
|
67
|
+
start: formatDateTime(start, "YYYY-MM-DD 00:00:00"),
|
|
68
|
+
end: formatDateTime(end, "YYYY-MM-DD 23:59:59"),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const defaultLanguage: "zh-CN";
|
|
2
|
+
export declare const languageLocalKey = "tc_language";
|
|
3
|
+
export declare const translations: {
|
|
4
|
+
readonly 'zh-CN': {};
|
|
5
|
+
readonly 'en-US': {};
|
|
6
|
+
};
|
|
7
|
+
export type Language = keyof typeof translations;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BreadcrumbItemData } from '../components/breadcrumb';
|
|
2
|
+
type State = {
|
|
3
|
+
items: BreadcrumbItemData[];
|
|
4
|
+
};
|
|
5
|
+
type Actions = {
|
|
6
|
+
setItems: (items: BreadcrumbItemData[]) => void;
|
|
7
|
+
addItem: (item: BreadcrumbItemData) => void;
|
|
8
|
+
removeItem: (id: string | number) => void;
|
|
9
|
+
clearItems: () => void;
|
|
10
|
+
setActiveItem: (id: string | number) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const breadcrumbStore: import("zustand").UseBoundStore<import("zustand").StoreApi<State & Actions>>;
|
|
13
|
+
export declare const useBreadcrumbStore: import("zustand").UseBoundStore<import("zustand").StoreApi<State & Actions>>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { create } from 'zustand';
|
|
2
|
+
const BREADCRUMB_STORAGE_KEY = 'app-breadcrumb';
|
|
3
|
+
const loadBreadcrumbFromStorage = () => {
|
|
4
|
+
try {
|
|
5
|
+
const stored = localStorage.getItem(BREADCRUMB_STORAGE_KEY);
|
|
6
|
+
if (stored) {
|
|
7
|
+
const items = JSON.parse(stored);
|
|
8
|
+
return items.map((item) => ({
|
|
9
|
+
id: item.id,
|
|
10
|
+
label: item.label || item.name || '',
|
|
11
|
+
desctext: item.desctext,
|
|
12
|
+
path: item.path,
|
|
13
|
+
active: item.active,
|
|
14
|
+
closable: item.closable,
|
|
15
|
+
}));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
// ignore
|
|
20
|
+
}
|
|
21
|
+
return [];
|
|
22
|
+
};
|
|
23
|
+
const saveBreadcrumbToStorage = (items) => {
|
|
24
|
+
try {
|
|
25
|
+
localStorage.setItem(BREADCRUMB_STORAGE_KEY, JSON.stringify(items));
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
// ignore
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export const breadcrumbStore = create((set) => ({
|
|
32
|
+
items: loadBreadcrumbFromStorage(),
|
|
33
|
+
setItems: (items) => {
|
|
34
|
+
set({ items });
|
|
35
|
+
},
|
|
36
|
+
addItem: (item) => {
|
|
37
|
+
set((state) => {
|
|
38
|
+
if (state.items.some((i) => i.id === item.id)) {
|
|
39
|
+
return state;
|
|
40
|
+
}
|
|
41
|
+
return { items: [...state.items, item] };
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
removeItem: (id) => {
|
|
45
|
+
set((state) => ({
|
|
46
|
+
items: state.items.filter((item) => item.id !== id || item.closable === false),
|
|
47
|
+
}));
|
|
48
|
+
},
|
|
49
|
+
clearItems: () => {
|
|
50
|
+
set((state) => ({
|
|
51
|
+
items: state.items.filter((item) => item.closable === false),
|
|
52
|
+
}));
|
|
53
|
+
},
|
|
54
|
+
setActiveItem: (id) => {
|
|
55
|
+
set((state) => ({
|
|
56
|
+
items: state.items.map((item) => ({
|
|
57
|
+
...item,
|
|
58
|
+
active: item.id === id,
|
|
59
|
+
})),
|
|
60
|
+
}));
|
|
61
|
+
},
|
|
62
|
+
}));
|
|
63
|
+
breadcrumbStore.subscribe((state) => {
|
|
64
|
+
saveBreadcrumbToStorage(state.items);
|
|
65
|
+
});
|
|
66
|
+
export const useBreadcrumbStore = breadcrumbStore;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Language } from '../locales';
|
|
2
|
+
export declare const getLanguage: <T extends object>(key: string, fillingData?: T) => any;
|
|
3
|
+
export declare const t: <T extends object>(key: string, fillingData?: T) => any;
|
|
4
|
+
type State = {
|
|
5
|
+
language: Language;
|
|
6
|
+
};
|
|
7
|
+
type Actions = {
|
|
8
|
+
setLanguage: (lang: Language) => void;
|
|
9
|
+
t: typeof t;
|
|
10
|
+
};
|
|
11
|
+
export declare const useLanguages: import("zustand").UseBoundStore<import("zustand").StoreApi<State & Actions>>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=language.d.ts.map
|