kn-cli 1.0.90 → 1.0.92
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/package.json +1 -1
- package/readme.md +7 -0
- package/src/create.js +22 -2
- package/src/utils/index.js +1 -1
- package/templates/template_admin/cli.config.js +1 -1
- package/templates/template_admin/jsconfig.json +5 -1
- package/templates/template_admin/package.json +1 -1
- package/templates/template_admin/public/index.html +2 -2
- package/templates/template_admin/public/src/components/{Auth → auth}/index.jsx +21 -3
- package/templates/template_admin/public/src/components/{IconFont → iconFont}/index.jsx +10 -0
- package/templates/template_admin/public/src/components/{Layout/Basic → layout/basic}/index.jsx +13 -3
- package/templates/template_admin/public/src/components/layout/centerBody/index.jsx +25 -0
- package/templates/template_admin/public/src/components/{Layout → layout}/index.jsx +15 -6
- package/templates/template_admin/public/src/components/layout/provider/index.jsx +19 -0
- package/templates/{template_app/public/src/components/Link → template_admin/public/src/components/link}/index.jsx +15 -0
- package/templates/template_admin/public/src/components/{Menu → menu}/index.jsx +15 -8
- package/templates/{template_app/public/src/components/Page/PageLoading → template_admin/public/src/components/page/pageLoading}/index.jsx +25 -4
- package/templates/{template_app/public/src/components/Popup → template_admin/public/src/components/popup}/index.jsx +13 -0
- package/templates/template_admin/public/src/components/{Toast → toast}/index.jsx +20 -1
- package/templates/template_admin/public/src/components/{TopMenu → topMenu}/index.jsx +13 -8
- package/templates/template_admin/public/src/dictionary/index.js +8 -3
- package/templates/template_admin/public/src/hooks/index.jsx +1 -0
- package/templates/template_admin/public/src/hooks/useDelay.jsx +5 -0
- package/templates/template_admin/public/src/hooks/useImageLoader.jsx +1 -2
- package/templates/template_admin/public/src/hooks/useLoading.jsx +5 -1
- package/templates/template_admin/public/src/hooks/usePreload.jsx +2 -1
- package/templates/template_admin/public/src/hooks/useScrollTop.jsx +12 -0
- package/templates/template_admin/public/src/hooks/useSearch.jsx +28 -2
- package/templates/template_admin/public/src/hooks/useUpdate.jsx +5 -0
- package/templates/template_admin/public/src/index.jsx +16 -2
- package/templates/template_admin/public/src/pages/material/index.jsx +2 -1
- package/templates/template_admin/public/src/pages/user/index.jsx +7 -2
- package/templates/template_admin/public/src/provider/app.jsx +39 -4
- package/templates/template_admin/public/src/provider/menu.jsx +4 -1
- package/templates/template_admin/public/src/route.jsx +8 -5
- package/templates/template_admin/public/src/services/index.js +38 -4
- package/templates/template_admin/public/src/services/user.js +3 -3
- package/templates/template_admin/public/src/type.js +48 -0
- package/templates/template_admin/public/src/utils/index.js +34 -18
- package/templates/template_app/cli.config.js +1 -1
- package/templates/template_app/jsconfig.json +5 -1
- package/templates/template_app/package.json +1 -1
- package/templates/template_app/public/src/components/{Auth → auth}/index.jsx +20 -2
- package/templates/template_app/public/src/components/{Header → header}/index.jsx +25 -1
- package/templates/{template_oa_jwt/public/src/components/IconFont → template_app/public/src/components/iconFont}/index.jsx +10 -0
- package/templates/template_app/public/src/components/{Layout/App → layout/app}/index.jsx +12 -2
- package/templates/template_app/public/src/components/layout/index.jsx +6 -0
- package/templates/{template_admin/public/src/components/Layout/Provider → template_app/public/src/components/layout/provider}/index.jsx +3 -0
- package/templates/template_app/public/src/components/link/index.jsx +39 -0
- package/templates/template_app/public/src/components/{Marquee → marquee}/index.jsx +11 -2
- package/templates/{template_oa/public/src/components/Page/PageLoading → template_app/public/src/components/page/pageLoading}/index.jsx +23 -3
- package/templates/{template_oa_jwt/public/src/components/Popup → template_app/public/src/components/popup}/index.jsx +13 -0
- package/templates/{template_oa_jwt/public/src/components/Toast → template_app/public/src/components/toast}/index.jsx +21 -1
- package/templates/template_app/public/src/dictionary/index.js +7 -3
- package/templates/template_app/public/src/hooks/index.jsx +1 -0
- package/templates/template_app/public/src/hooks/useDelay.jsx +5 -0
- package/templates/template_app/public/src/hooks/useImageLoader.jsx +1 -2
- package/templates/template_app/public/src/hooks/useLoading.jsx +5 -1
- package/templates/template_app/public/src/hooks/usePreload.jsx +2 -1
- package/templates/template_app/public/src/hooks/useScrollTop.jsx +12 -0
- package/templates/template_app/public/src/index.jsx +22 -5
- package/templates/template_app/public/src/pages/dictionary/index.jsx +9 -1
- package/templates/template_app/public/src/pages/index.jsx +16 -4
- package/templates/template_app/public/src/pages/list/index.jsx +7 -1
- package/templates/template_app/public/src/pages/login/index.jsx +10 -4
- package/templates/template_app/public/src/pages/user/index.jsx +7 -2
- package/templates/template_app/public/src/provider/app.jsx +5 -3
- package/templates/template_app/public/src/route.jsx +5 -2
- package/templates/template_app/public/src/services/index.js +10 -8
- package/templates/template_app/public/src/services/user.js +4 -4
- package/templates/template_app/public/src/type.js +27 -0
- package/templates/template_app/public/src/utils/index.js +6 -0
- package/templates/template_oa/cli.config.js +1 -1
- package/templates/template_oa/jsconfig.json +5 -1
- package/templates/template_oa/package.json +1 -1
- package/templates/template_oa/public/src/components/dialog/index.jsx +237 -0
- package/templates/{template_oa_jwt/public/src/components/Empty → template_oa/public/src/components/empty}/index.jsx +9 -0
- package/templates/{template_oa_jwt/public/src/components/FormRow → template_oa/public/src/components/formRow}/index.jsx +25 -3
- package/templates/{template_oa_jwt/public/src/components/FormTable → template_oa/public/src/components/formTable}/index.jsx +39 -1
- package/templates/template_oa/public/src/components/iconFont/index.jsx +22 -0
- package/templates/template_oa/public/src/components/{IFrame → iframe}/index.jsx +18 -4
- package/templates/template_oa/public/src/components/{Layout/Basic → layout/basic}/index.jsx +7 -1
- package/templates/template_oa/public/src/components/{Layout/CenterBody → layout/centerBody}/index.jsx +2 -0
- package/templates/template_oa/public/src/components/{Layout/FormBlock → layout/formBlock}/index.jsx +3 -1
- package/templates/{template_oa_jwt/public/src/components/Layout → template_oa/public/src/components/layout}/index.jsx +12 -6
- package/templates/{template_oa_jwt/public/src/components/Layout/Provider → template_oa/public/src/components/layout/provider}/index.jsx +4 -0
- package/templates/{template_offcial/public/src/components/Link → template_oa/public/src/components/link}/index.jsx +16 -0
- package/templates/template_oa/public/src/components/{Nav → nav}/index.jsx +8 -2
- package/templates/{template_admin/public/src/components/Page/PageLoading → template_oa/public/src/components/page/pageLoading}/index.jsx +25 -4
- package/templates/{template_admin/public/src/components/Popup → template_oa/public/src/components/popup}/index.jsx +13 -0
- package/templates/{template_oa_jwt/public/src/components/Select/DepSelect → template_oa/public/src/components/select/depSelect}/index.jsx +15 -0
- package/templates/template_oa/public/src/components/{Select/StaffSelect → select/staffSelect}/index.jsx +27 -0
- package/templates/template_oa/public/src/components/title/index.jsx +3 -0
- package/templates/template_oa/public/src/components/{Toast → toast}/index.jsx +21 -1
- package/templates/template_oa/public/src/components/{Upload → upload}/index.jsx +41 -3
- package/templates/template_oa/public/src/hooks/index.jsx +1 -0
- package/templates/template_oa/public/src/hooks/useDelay.jsx +5 -0
- package/templates/template_oa/public/src/hooks/useImageLoader.jsx +1 -2
- package/templates/template_oa/public/src/hooks/useLoading.jsx +5 -1
- package/templates/template_oa/public/src/hooks/usePreload.jsx +2 -1
- package/templates/template_oa/public/src/hooks/useScrollTop.jsx +12 -0
- package/templates/template_oa/public/src/hooks/useSearch.jsx +28 -2
- package/templates/template_oa/public/src/hooks/useUpdate.jsx +5 -0
- package/templates/template_oa/public/src/index.jsx +15 -1
- package/templates/template_oa/public/src/pages/video/index.jsx +17 -13
- package/templates/template_oa/public/src/provider/app.jsx +33 -2
- package/templates/template_oa/public/src/route.jsx +4 -2
- package/templates/template_oa/public/src/services/common.js +11 -0
- package/templates/template_oa/public/src/services/index.js +44 -2
- package/templates/template_oa/public/src/type.js +48 -0
- package/templates/template_oa/public/src/utils/index.js +34 -17
- package/templates/template_oa_jwt/cli.config.js +1 -1
- package/templates/template_oa_jwt/jsconfig.json +5 -1
- package/templates/template_oa_jwt/package.json +1 -1
- package/templates/template_oa_jwt/public/src/components/dialog/index.jsx +237 -0
- package/templates/{template_oa/public/src/components/Empty → template_oa_jwt/public/src/components/empty}/index.jsx +9 -0
- package/templates/{template_oa/public/src/components/FormRow → template_oa_jwt/public/src/components/formRow}/index.jsx +25 -3
- package/templates/{template_oa/public/src/components/FormTable → template_oa_jwt/public/src/components/formTable}/index.jsx +41 -2
- package/templates/template_oa_jwt/public/src/components/formTable/index.less +18 -0
- package/templates/template_oa_jwt/public/src/components/iconFont/index.jsx +22 -0
- package/templates/template_oa_jwt/public/src/components/{IFrame → iframe}/index.jsx +15 -0
- package/templates/template_oa_jwt/public/src/components/{Layout/Basic → layout/basic}/index.jsx +11 -6
- package/templates/template_oa_jwt/public/src/components/{Layout/CenterBody → layout/centerBody}/index.jsx +2 -0
- package/templates/template_oa_jwt/public/src/components/{Layout/FormBlock → layout/formBlock}/index.jsx +3 -1
- package/templates/{template_oa/public/src/components/Layout → template_oa_jwt/public/src/components/layout}/index.jsx +10 -4
- package/templates/{template_oa/public/src/components/Layout/Provider → template_oa_jwt/public/src/components/layout/provider}/index.jsx +4 -0
- package/templates/template_oa_jwt/public/src/components/{Link → link}/index.jsx +16 -0
- package/templates/template_oa_jwt/public/src/components/{Nav → nav}/index.jsx +11 -5
- package/templates/template_oa_jwt/public/src/components/{Page/PageLoading → page/pageLoading}/index.jsx +25 -4
- package/templates/{template_oa/public/src/components/Popup → template_oa_jwt/public/src/components/popup}/index.jsx +13 -0
- package/templates/{template_oa/public/src/components/Select/DepSelect → template_oa_jwt/public/src/components/select/depSelect}/index.jsx +15 -0
- package/templates/template_oa_jwt/public/src/components/{Select/StaffSelect → select/staffSelect}/index.jsx +27 -0
- package/templates/template_oa_jwt/public/src/components/title/index.jsx +3 -0
- package/templates/template_oa_jwt/public/src/components/toast/index.jsx +80 -0
- package/templates/template_oa_jwt/public/src/components/{Upload → upload}/index.jsx +41 -3
- package/templates/template_oa_jwt/public/src/dictionary/index.js +2 -0
- package/templates/template_oa_jwt/public/src/hooks/index.jsx +2 -2
- package/templates/template_oa_jwt/public/src/hooks/useDelay.jsx +5 -0
- package/templates/template_oa_jwt/public/src/hooks/useImageLoader.jsx +1 -2
- package/templates/template_oa_jwt/public/src/hooks/useLoading.jsx +5 -1
- package/templates/template_oa_jwt/public/src/hooks/usePreload.jsx +2 -1
- package/templates/template_oa_jwt/public/src/hooks/useScrollTop.jsx +12 -0
- package/templates/template_oa_jwt/public/src/hooks/useSearch.jsx +28 -2
- package/templates/template_oa_jwt/public/src/hooks/useUpdate.jsx +5 -0
- package/templates/template_oa_jwt/public/src/pages/demo/index.jsx +17 -11
- package/templates/template_oa_jwt/public/src/provider/app.jsx +30 -1
- package/templates/template_oa_jwt/public/src/route.jsx +4 -2
- package/templates/template_oa_jwt/public/src/services/common.js +13 -1
- package/templates/template_oa_jwt/public/src/services/index.js +52 -8
- package/templates/template_oa_jwt/public/src/services/token.js +7 -0
- package/templates/template_oa_jwt/public/src/utils/index.js +62 -22
- package/templates/template_offcial/cli.config.js +1 -1
- package/templates/template_offcial/jsconfig.json +5 -1
- package/templates/template_offcial/package.json +1 -1
- package/templates/template_offcial/public/src/components/{Footer → footer}/index.jsx +15 -1
- package/templates/template_offcial/public/src/components/{Header → header}/index.jsx +14 -0
- package/templates/{template_app/public/src/components/IconFont → template_offcial/public/src/components/iconFont}/index.jsx +10 -0
- package/templates/template_offcial/public/src/components/{Layout → layout}/index.jsx +10 -3
- package/templates/{template_app/public/src/components/Layout/Provider → template_offcial/public/src/components/layout/provider}/index.jsx +7 -0
- package/templates/template_offcial/public/src/components/link/index.jsx +39 -0
- package/templates/template_offcial/public/src/components/page/pageLoading/index.jsx +51 -0
- package/templates/template_offcial/public/src/components/popup/index.jsx +35 -0
- package/templates/{template_app/public/src/components/Toast → template_offcial/public/src/components/toast}/index.jsx +20 -1
- package/templates/template_offcial/public/src/hooks/index.jsx +1 -0
- package/templates/template_offcial/public/src/hooks/useImageLoader.jsx +1 -0
- package/templates/template_offcial/public/src/hooks/useInToView.jsx +3 -0
- package/templates/template_offcial/public/src/hooks/usePreload.jsx +1 -0
- package/templates/template_offcial/public/src/hooks/useScroll.jsx +8 -0
- package/templates/template_offcial/public/src/index.jsx +15 -2
- package/templates/template_offcial/public/src/pages/index.jsx +8 -1
- package/templates/template_offcial/public/src/pages/pc/index.jsx +4 -2
- package/templates/template_offcial/public/src/provider/app.jsx +28 -2
- package/templates/template_offcial/public/src/route.jsx +4 -2
- package/templates/template_offcial/public/src/services/index.js +38 -2
- package/templates/template_offcial/public/src/services/user.js +3 -3
- package/templates/template_offcial/public/src/type.js +47 -0
- package/templates/template_admin/public/src/components/Alert/index.jsx +0 -0
- package/templates/template_admin/public/src/components/Alert/index.less +0 -0
- package/templates/template_admin/public/src/components/Header/index.jsx +0 -57
- package/templates/template_admin/public/src/components/Layout/CenterBody/index.jsx +0 -15
- package/templates/template_admin/public/src/components/Link/index.jsx +0 -24
- package/templates/template_admin/public/src/components/Loading/index.jsx +0 -14
- package/templates/template_admin/public/src/components/Loading/index.less +0 -85
- package/templates/template_admin/public/src/components/mask/index.jsx +0 -47
- package/templates/template_admin/public/src/components/mask/index.less +0 -32
- package/templates/template_admin/public/src/hooks/useLogin.jsx +0 -33
- package/templates/template_app/public/src/components/Header/index.less +0 -57
- package/templates/template_app/public/src/components/Layout/index.jsx +0 -4
- package/templates/template_app/public/src/hooks/useLogin.jsx +0 -33
- package/templates/template_oa/public/src/components/Alert/index.jsx +0 -0
- package/templates/template_oa/public/src/components/Alert/index.less +0 -0
- package/templates/template_oa/public/src/components/Auth/index.jsx +0 -44
- package/templates/template_oa/public/src/components/Dialog/index.jsx +0 -150
- package/templates/template_oa/public/src/components/Footer/index.jsx +0 -17
- package/templates/template_oa/public/src/components/Footer/index.less +0 -28
- package/templates/template_oa/public/src/components/IconFont/index.jsx +0 -10
- package/templates/template_oa/public/src/components/Link/index.jsx +0 -24
- package/templates/template_oa/public/src/components/Loading/index.jsx +0 -14
- package/templates/template_oa/public/src/components/Loading/index.less +0 -85
- package/templates/template_oa_jwt/public/src/components/Alert/index.jsx +0 -0
- package/templates/template_oa_jwt/public/src/components/Alert/index.less +0 -0
- package/templates/template_oa_jwt/public/src/components/Auth/index.jsx +0 -44
- package/templates/template_oa_jwt/public/src/components/Dialog/index.jsx +0 -150
- package/templates/template_oa_jwt/public/src/components/Footer/index.jsx +0 -17
- package/templates/template_oa_jwt/public/src/components/Footer/index.less +0 -28
- package/templates/template_oa_jwt/public/src/components/Loading/index.jsx +0 -16
- package/templates/template_oa_jwt/public/src/components/Loading/index.less +0 -96
- package/templates/template_offcial/public/src/components/Alert/index.jsx +0 -0
- package/templates/template_offcial/public/src/components/Alert/index.less +0 -0
- package/templates/template_offcial/public/src/components/IconFont/index.jsx +0 -10
- package/templates/template_offcial/public/src/components/Layout/Provider/index.jsx +0 -12
- package/templates/template_offcial/public/src/components/Page/PageLoading/index.jsx +0 -30
- package/templates/template_offcial/public/src/components/Popup/index.jsx +0 -22
- package/templates/template_offcial/public/src/components/Toast/index.jsx +0 -60
- /package/templates/template_admin/public/src/components/{IconFont → iconFont}/index.less +0 -0
- /package/templates/template_admin/public/src/components/{Layout/Basic → layout/basic}/index.less +0 -0
- /package/templates/template_admin/public/src/components/{Layout/CenterBody → layout/centerBody}/index.less +0 -0
- /package/templates/template_admin/public/src/components/{Layout → layout}/index.less +0 -0
- /package/templates/template_admin/public/src/components/{Link → link}/index.less +0 -0
- /package/templates/template_admin/public/src/components/{Menu → menu}/index.less +0 -0
- /package/templates/template_admin/public/src/components/{Page/PageLoading → page/pageLoading}/index.less +0 -0
- /package/templates/template_admin/public/src/components/{Popup → popup}/index.less +0 -0
- /package/templates/template_admin/public/src/components/{Toast → toast}/index.less +0 -0
- /package/templates/template_admin/public/src/components/{TopMenu → topMenu}/index.less +0 -0
- /package/templates/{template_admin/public/src/components/Header → template_app/public/src/components/header}/index.less +0 -0
- /package/templates/template_app/public/src/components/{IconFont → iconFont}/index.less +0 -0
- /package/templates/template_app/public/src/components/{Layout/App → layout/app}/index.less +0 -0
- /package/templates/template_app/public/src/components/{Link → link}/index.less +0 -0
- /package/templates/template_app/public/src/components/{Marquee → marquee}/index.less +0 -0
- /package/templates/template_app/public/src/components/{Page/PageLoading → page/pageLoading}/index.less +0 -0
- /package/templates/template_app/public/src/components/{Popup → popup}/index.less +0 -0
- /package/templates/template_app/public/src/components/{Toast → toast}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{Dialog → dialog}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{Empty → empty}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{FormRow → formRow}/index.less +0 -0
- /package/templates/{template_oa_jwt/public/src/components/FormTable → template_oa/public/src/components/formTable}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{IconFont → iconFont}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{IFrame → iframe}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{Layout/Basic → layout/basic}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{Layout/CenterBody → layout/centerBody}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{Layout/FormBlock → layout/formBlock}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{Layout → layout}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{Link → link}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{Nav → nav}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{Page/PageLoading → page/pageLoading}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{Popup → popup}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{Select/StaffSelect → select/staffSelect}/index.less +0 -0
- /package/templates/template_oa/public/src/components/{Toast → toast}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{Dialog → dialog}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{Empty → empty}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{FormRow → formRow}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{IconFont → iconFont}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{IFrame → iframe}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{Layout/Basic → layout/basic}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{Layout/CenterBody → layout/centerBody}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{Layout/FormBlock → layout/formBlock}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{Layout → layout}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{Link → link}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{Nav → nav}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{Page/PageLoading → page/pageLoading}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{Popup → popup}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{Select/StaffSelect → select/staffSelect}/index.less +0 -0
- /package/templates/template_oa_jwt/public/src/components/{Toast → toast}/index.less +0 -0
- /package/templates/template_offcial/public/src/components/{Footer → footer}/index.less +0 -0
- /package/templates/template_offcial/public/src/components/{Header → header}/index.less +0 -0
- /package/templates/template_offcial/public/src/components/{IconFont → iconFont}/index.less +0 -0
- /package/templates/template_offcial/public/src/components/{Layout → layout}/index.less +0 -0
- /package/templates/template_offcial/public/src/components/{Link → link}/index.less +0 -0
- /package/templates/template_offcial/public/src/components/{Page/PageLoading → page/pageLoading}/index.less +0 -0
- /package/templates/template_offcial/public/src/components/{Popup → popup}/index.less +0 -0
- /package/templates/template_offcial/public/src/components/{Toast → toast}/index.less +0 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from 'react';
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import ReactDOM from 'react-dom';
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import { Button } from 'antd';
|
|
7
|
+
|
|
8
|
+
import IconFont from '@/components/iconFont';
|
|
9
|
+
|
|
10
|
+
import Popup from '@/components/popup';
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
import styles from './index.less';
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 对话框组件
|
|
17
|
+
* @param {object} props
|
|
18
|
+
* @param {string} props.title - 对话框的标题内容
|
|
19
|
+
* @param {string} [props.okText='确认'] - 确认按钮文案
|
|
20
|
+
* @param {string} [props.cancelText='取消'] - 取消按钮文案
|
|
21
|
+
* @param {boolean} [props.noCancel=false] - 不显示取消按钮
|
|
22
|
+
* @param {()=>Promise<boolean>} [props.onOk] - 点击确认按钮回调
|
|
23
|
+
* @param {()=>Promise<boolean>} [props.onClose] - 点击关闭的回调
|
|
24
|
+
* @param {()=>void} [props.destory] - 对话框销毁的回调
|
|
25
|
+
* @param {JSX.Element|any} [props.children] - 子组件
|
|
26
|
+
*
|
|
27
|
+
* @returns {JSX.Element}
|
|
28
|
+
*/
|
|
29
|
+
const Dialog = (props) => {
|
|
30
|
+
const {
|
|
31
|
+
title='',
|
|
32
|
+
okText='确认',
|
|
33
|
+
cancelText='取消',
|
|
34
|
+
noCancel=false,
|
|
35
|
+
onOk:fnOnOk,
|
|
36
|
+
onClose:fnOnClose,
|
|
37
|
+
destory,
|
|
38
|
+
children
|
|
39
|
+
}= props;
|
|
40
|
+
async function onClose() {
|
|
41
|
+
if (fnOnClose) {
|
|
42
|
+
let ret = await fnOnClose();
|
|
43
|
+
if (ret) {
|
|
44
|
+
destory();
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
destory();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async function onOk() {
|
|
51
|
+
if (fnOnOk) {
|
|
52
|
+
let ret = await fnOnOk();
|
|
53
|
+
if (ret) {
|
|
54
|
+
destory();
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
destory();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return (
|
|
61
|
+
<section className={styles.body}>
|
|
62
|
+
<div className={styles.mask} />
|
|
63
|
+
<section className={styles.wrap}>
|
|
64
|
+
<div className={styles.header}>
|
|
65
|
+
<span>{title}</span>
|
|
66
|
+
<IconFont icon='close' className={styles.close} onClick={onClose} />
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
{children}
|
|
70
|
+
|
|
71
|
+
<div className={styles.footer}>
|
|
72
|
+
<Button type='primary' onClick={onOk}>
|
|
73
|
+
{okText}
|
|
74
|
+
</Button>
|
|
75
|
+
{noCancel ? (
|
|
76
|
+
''
|
|
77
|
+
) : (
|
|
78
|
+
<Button onClick={onClose} style={{ marginLeft: '10px' }}>
|
|
79
|
+
{cancelText}
|
|
80
|
+
</Button>
|
|
81
|
+
)}
|
|
82
|
+
</div>
|
|
83
|
+
</section>
|
|
84
|
+
</section>
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* 显示一个对话框
|
|
90
|
+
* @param {Object} props
|
|
91
|
+
* @param {string} props.title - 对话框标题
|
|
92
|
+
* @param {string} [props.okText='确认'] - 确认按钮文案
|
|
93
|
+
* @param {string} [props.cancelText='取消'] - 取消按钮文案
|
|
94
|
+
* @param {boolean} [props.noCancel=false] - 不显示取消按钮
|
|
95
|
+
* @param {()=>Promise<boolean>} [props.onOk] - 点击确认按钮回调
|
|
96
|
+
* @param {()=>Promise<boolean>} [props.onClose] - 点击关闭的回调
|
|
97
|
+
* @param {JSX.Element|any} [props.component] - 对话框内的实际内容
|
|
98
|
+
*
|
|
99
|
+
* @returns {Promise<boolean>}
|
|
100
|
+
*/
|
|
101
|
+
export const ShowDialog = (props={title:''}) => {
|
|
102
|
+
const {title,onOk,okText,cancelText,noCancel,onClose,component}= props;
|
|
103
|
+
return new Promise((reslove) => {
|
|
104
|
+
let popup = Popup(reslove);
|
|
105
|
+
ReactDOM.render(
|
|
106
|
+
<Dialog
|
|
107
|
+
title={title}
|
|
108
|
+
destory={popup.destory}
|
|
109
|
+
onOk={onOk}
|
|
110
|
+
okText={okText}
|
|
111
|
+
cancelText={cancelText}
|
|
112
|
+
noCancel={noCancel}
|
|
113
|
+
onClose={onClose}
|
|
114
|
+
>
|
|
115
|
+
{component}
|
|
116
|
+
</Dialog>,
|
|
117
|
+
popup.dom
|
|
118
|
+
);
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* 一个带确认和取消的确认对话框
|
|
124
|
+
* @param {Object} props
|
|
125
|
+
* @param {string} props.title - 对话框标题
|
|
126
|
+
* @param {string} [props.okText='确认'] - 确认按钮文案
|
|
127
|
+
* @param {string} [props.cancelText='取消'] - 取消按钮文案
|
|
128
|
+
* @param {boolean} [props.noCancel=false] - 不显示取消按钮
|
|
129
|
+
* @param {JSX.Element|any} [props.content] - 对话框内的实际内容
|
|
130
|
+
* @returns {Promise<boolean>}
|
|
131
|
+
*/
|
|
132
|
+
export const ShowConfirm = async (props) => {
|
|
133
|
+
if (typeof props === 'string') {
|
|
134
|
+
// @ts-ignore
|
|
135
|
+
props = { content: props };
|
|
136
|
+
}
|
|
137
|
+
const {title='注意',okText='确认',cancelText='取消',noCancel=false,content}= props;
|
|
138
|
+
|
|
139
|
+
let result = false;
|
|
140
|
+
await ShowDialog({
|
|
141
|
+
title: title || '注意',
|
|
142
|
+
okText: okText || '确认',
|
|
143
|
+
cancelText: cancelText || '取消',
|
|
144
|
+
noCancel: noCancel,
|
|
145
|
+
onClose: async () => {
|
|
146
|
+
result = false;
|
|
147
|
+
return Promise.resolve(true);
|
|
148
|
+
},
|
|
149
|
+
onOk: async () => {
|
|
150
|
+
result = true;
|
|
151
|
+
return Promise.resolve(true);
|
|
152
|
+
},
|
|
153
|
+
component: (
|
|
154
|
+
<div className={styles.confirmWrap}>
|
|
155
|
+
{content}
|
|
156
|
+
</div>
|
|
157
|
+
),
|
|
158
|
+
});
|
|
159
|
+
return result;
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* 一个只有确认按钮的提示框
|
|
164
|
+
* @param {Object} props
|
|
165
|
+
* @param {string} [props.okText='确认'] - 确认按钮文案
|
|
166
|
+
* @param {JSX.Element|any} [props.content] - 对话框内的实际内容
|
|
167
|
+
* @param {()=>void} [props.onOk] - 点击确认的回调
|
|
168
|
+
* @param {()=>void} props.destory - 关闭对话框的回调
|
|
169
|
+
* @param {string} [props.type='error'] - 警告类型,'error'|'suuccess'
|
|
170
|
+
*
|
|
171
|
+
* @returns {JSX.Element}
|
|
172
|
+
*/
|
|
173
|
+
const Alert = (props) => {
|
|
174
|
+
const {onOk:fnOnOk,destory,type,content,okText='确认'}= props;
|
|
175
|
+
function onOk() {
|
|
176
|
+
if (fnOnOk) fnOnOk();
|
|
177
|
+
destory();
|
|
178
|
+
}
|
|
179
|
+
return (
|
|
180
|
+
<section className={styles.body }>
|
|
181
|
+
<div className={styles.mask} />
|
|
182
|
+
<section className={styles.wrapAlert}>
|
|
183
|
+
<div className={styles.alertContent}>
|
|
184
|
+
<div className={type === 'success' ? styles.iconSuccess : styles.iconError} />
|
|
185
|
+
<span>{content}</span>
|
|
186
|
+
</div>
|
|
187
|
+
<div className={styles.alertFooter}>
|
|
188
|
+
<span onClick={onOk}>{okText}</span>
|
|
189
|
+
</div>
|
|
190
|
+
</section>
|
|
191
|
+
</section>
|
|
192
|
+
);
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* 显示一个alert
|
|
197
|
+
* @param {Object} props
|
|
198
|
+
* @param {JSX.Element|any} [props.content] - 对话框内的实际内容
|
|
199
|
+
* @param {()=>void} [props.onOk] - 点击确认的回调
|
|
200
|
+
* @param {string} [props.type='success'] - 警告类型,'error'|'suuccess'
|
|
201
|
+
*
|
|
202
|
+
* @returns {Promise<void>}
|
|
203
|
+
*/
|
|
204
|
+
export const ShowAlert = (props) => {
|
|
205
|
+
if (props.constructor === String) {
|
|
206
|
+
// @ts-ignore
|
|
207
|
+
props = { content: props };
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
const {type='success',onOk,content}=props;
|
|
211
|
+
|
|
212
|
+
return new Promise((reslove) => {
|
|
213
|
+
let popup = Popup(reslove);
|
|
214
|
+
|
|
215
|
+
ReactDOM.render(
|
|
216
|
+
<Alert destory={popup.destory} type={type} onOk={onOk} content={content} />,
|
|
217
|
+
popup.dom
|
|
218
|
+
);
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* 显示一个错误提示alert
|
|
224
|
+
* @param {Object} props
|
|
225
|
+
* @param {JSX.Element|any} [props.content] - 对话框内的实际内容
|
|
226
|
+
* @param {()=>void} [props.onOk] - 点击确认的回调
|
|
227
|
+
*
|
|
228
|
+
* @returns {Promise<void>}
|
|
229
|
+
*/
|
|
230
|
+
export const ShowErrorAlert = (props) => {
|
|
231
|
+
if (props.constructor === String) {
|
|
232
|
+
props = { content: props };
|
|
233
|
+
}
|
|
234
|
+
return ShowAlert({ ...props, type: 'fail' });
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
export default Dialog;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import React from 'react';
|
|
3
|
+
// @ts-ignore
|
|
2
4
|
import { Empty, Button } from 'antd';
|
|
5
|
+
|
|
6
|
+
// @ts-ignore
|
|
3
7
|
import styles from './index.less';
|
|
4
8
|
|
|
5
9
|
/**
|
|
6
10
|
* 当table数据为空时下方有“添加数据”按钮
|
|
11
|
+
* @param {object} props
|
|
12
|
+
* @param {()=>void} [props.onClick] - 点击添加数据的回调
|
|
13
|
+
* @param {boolean} [props.editmode] - 是否允许编辑模式,允许的话就会有添加数据的按钮
|
|
14
|
+
*
|
|
15
|
+
* @returns {JSX.Element}
|
|
7
16
|
*/
|
|
8
17
|
function TableEmpty(props) {
|
|
9
18
|
return (
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
// @ts-ignore
|
|
2
5
|
import styles from './index.less';
|
|
3
6
|
|
|
7
|
+
/**
|
|
8
|
+
* 表单的行组件,用于将子组件按照一行2列方式排列
|
|
9
|
+
* @param {Object} props
|
|
10
|
+
* @param {JSX.Element[]|JSX.Element} props.children
|
|
11
|
+
*
|
|
12
|
+
* @returns {JSX.Element}
|
|
13
|
+
*/
|
|
4
14
|
const FormRow = (props) => {
|
|
5
15
|
function createCol(item, idx) {
|
|
6
16
|
if (!item) return '';
|
|
@@ -9,6 +19,7 @@ const FormRow = (props) => {
|
|
|
9
19
|
<div key={idx} className={styles.formRow}>
|
|
10
20
|
<hgroup className={styles.row}>
|
|
11
21
|
<div className={styles.title}>
|
|
22
|
+
{/* @ts-ignore */}
|
|
12
23
|
<div required={editmode && item.props.required}>{item.props.label}</div>
|
|
13
24
|
</div>
|
|
14
25
|
<div className={styles.data}>{item}</div>
|
|
@@ -18,20 +29,31 @@ const FormRow = (props) => {
|
|
|
18
29
|
}
|
|
19
30
|
return (
|
|
20
31
|
<section className={styles.formRowBody}>
|
|
32
|
+
{/* @ts-ignore */}
|
|
21
33
|
{props.children.length > 0 ? props.children.map(createCol) : createCol(props.children)}
|
|
22
34
|
</section>
|
|
23
35
|
);
|
|
24
36
|
};
|
|
25
37
|
|
|
38
|
+
/**
|
|
39
|
+
* 表单的行组件中的列组件
|
|
40
|
+
* @param {Object} props
|
|
41
|
+
* @param {JSX.Element[]|JSX.Element} props.children
|
|
42
|
+
* @param {boolean} [props.editmode=true] - 可编辑模式
|
|
43
|
+
* @param {string} [props.txtdata='-'] - 列的标题
|
|
44
|
+
* @param {boolean} [props.textarea=false] - 是否多行显示文本
|
|
45
|
+
*
|
|
46
|
+
* @returns {JSX.Element|JSX.Element[]|any}
|
|
47
|
+
*/
|
|
26
48
|
function HocEditControl(props) {
|
|
27
49
|
const { editmode = true, txtdata ,textarea} = props;
|
|
28
50
|
if (editmode) {
|
|
29
51
|
return props.children;
|
|
30
52
|
}
|
|
31
53
|
if(textarea){
|
|
32
|
-
return <span style={{whiteSpace:'pre-wrap'}}>{txtdata
|
|
54
|
+
return <span style={{whiteSpace:'pre-wrap'}}>{txtdata}</span>
|
|
33
55
|
}
|
|
34
|
-
return <span>{txtdata
|
|
56
|
+
return <span>{txtdata}</span>;
|
|
35
57
|
}
|
|
36
58
|
|
|
37
59
|
FormRow.Col = HocEditControl;
|
|
@@ -1,7 +1,46 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import React ,{useImperativeHandle,useState,forwardRef} from 'react';
|
|
3
|
+
|
|
4
|
+
// @ts-ignore
|
|
2
5
|
import uuid from 'js-uuid';
|
|
6
|
+
|
|
7
|
+
// @ts-ignore
|
|
3
8
|
import styles from './index.less';
|
|
4
9
|
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @typedef {object} ColumnsOptions
|
|
13
|
+
* @property {string} formItemName
|
|
14
|
+
* @property {(record:any,index:number,event:any)=>void} onDel
|
|
15
|
+
* @property {(record:any,index:number,event:any)=>void} onAdd
|
|
16
|
+
* @property {(record:any,index:number,event:any)=>void} onCopy
|
|
17
|
+
* @property {(initValue:[],event:any)=>void} onReset
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 表格表单组件
|
|
22
|
+
* @param {Object} props
|
|
23
|
+
* @param {JSX.Element|any} props.Table - Table组件,一般为antd的Table组件
|
|
24
|
+
* @param {Object} props.form - Form组件
|
|
25
|
+
* @param {string} props.formItemName - 表格FormItem的name
|
|
26
|
+
* @param {boolean} [props.saveLast=false] - 是否当没有数据时,默认保留一行数据
|
|
27
|
+
* @param {Object[]} [props.initialValue] - 初始数据
|
|
28
|
+
*
|
|
29
|
+
* @param {(record:object,index:number)=>object[]} [props.onCopy] - 点击复制的回调
|
|
30
|
+
* @param {(record:object,index:number)=>object[]} [props.onAdd] - 点击添加的回调
|
|
31
|
+
*
|
|
32
|
+
* @param {(value:any)=>void} [props.onChange] - 数据发生变动时的回调
|
|
33
|
+
* @param {(value:any)=>void} [props.onRefresh] - 刷新时的回调
|
|
34
|
+
*
|
|
35
|
+
* @param {(options:ColumnsOptions)=>[]} props.columns - 获取列配置数据的回调
|
|
36
|
+
*
|
|
37
|
+
* @param {Object} [props.newdata] - 添加新行的数据模版
|
|
38
|
+
* @param {Object} [props.antTableOptions] - antd的Table扩展参数
|
|
39
|
+
*
|
|
40
|
+
* @param {any} ref
|
|
41
|
+
*
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
5
44
|
const TableFormItem =(props,ref)=> {
|
|
6
45
|
const {Table,form,formItemName,saveLast} = props;
|
|
7
46
|
const getNewId=()=>{
|
|
@@ -121,7 +160,6 @@ const TableFormItem =(props,ref)=> {
|
|
|
121
160
|
}));
|
|
122
161
|
|
|
123
162
|
return (
|
|
124
|
-
|
|
125
163
|
<Table
|
|
126
164
|
className={styles.table}
|
|
127
165
|
{...{rowKey: '_rowKey',...props.antTableOptions}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
import styles from'./index.less';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* iconFont图标
|
|
9
|
+
* @param {object} props
|
|
10
|
+
* @param {string} [props.icon] - 图标名称
|
|
11
|
+
* @param {string} [props.className] - 扩展类名
|
|
12
|
+
* @param {()=>void} [props.onClick] - 点击回调
|
|
13
|
+
*
|
|
14
|
+
* @returns {JSX.Element}
|
|
15
|
+
*/
|
|
16
|
+
const IconFont=(props)=>{
|
|
17
|
+
const {icon,className,...others} = props;
|
|
18
|
+
return (
|
|
19
|
+
<span {...others} className={`iconfont icon-${icon} ${styles.iconBox} ${className||''}`} ></span>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
export default IconFont;
|
|
@@ -1,20 +1,34 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import React, { useEffect,useState,useRef } from 'react';
|
|
3
|
+
|
|
4
|
+
// @ts-ignore
|
|
2
5
|
import styles from './index.less';
|
|
3
6
|
|
|
7
|
+
/**
|
|
8
|
+
* iframe组件
|
|
9
|
+
* @param {object} props
|
|
10
|
+
* @param {string} props.name - iframe的唯一名称
|
|
11
|
+
* @param {string} props.url - url地址
|
|
12
|
+
*
|
|
13
|
+
* @param {string} [props.className] - 扩展样式名
|
|
14
|
+
*
|
|
15
|
+
* @returns {JSX.Element}
|
|
16
|
+
*/
|
|
4
17
|
const Iframe=(props)=>{
|
|
5
|
-
const {className=''}=props;
|
|
18
|
+
const {className='',name,url}=props;
|
|
6
19
|
const ref = useRef();
|
|
7
20
|
const [height,setHeight] = useState('0px');
|
|
8
21
|
|
|
9
22
|
useEffect(()=>{
|
|
10
23
|
window.addEventListener('message',(e)=>{
|
|
11
24
|
if(e?.data?.msg==='resize'){
|
|
12
|
-
if(e.data.id===
|
|
25
|
+
if(e.data.id===name){
|
|
13
26
|
setHeight(e.data.height+2+'px');
|
|
14
27
|
}
|
|
15
28
|
}else if(e?.data?.msg==='link'){
|
|
16
29
|
location.href=e.data.url;
|
|
17
30
|
}else if(e?.data?.msg==='server'){
|
|
31
|
+
// @ts-ignore
|
|
18
32
|
const url = `${OA_KSSO_HOST}?target=${encodeURIComponent(location.href)}`;
|
|
19
33
|
location.href=url;
|
|
20
34
|
}else{
|
|
@@ -27,9 +41,9 @@ const Iframe=(props)=>{
|
|
|
27
41
|
<iframe
|
|
28
42
|
className={`${styles.iframeWrap} ${className}`}
|
|
29
43
|
sandbox='allow-same-origin allow-scripts'
|
|
30
|
-
name={
|
|
44
|
+
name={name}
|
|
31
45
|
ref={ref}
|
|
32
|
-
src={
|
|
46
|
+
src={url}
|
|
33
47
|
style={{width:'100%',height:height,verticalAlign:'bottom'}}
|
|
34
48
|
scrolling="none"
|
|
35
49
|
frameBorder="0"
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import React from 'react';
|
|
3
|
+
// @ts-ignore
|
|
2
4
|
import {Outlet} from 'react-router-dom';
|
|
3
|
-
|
|
5
|
+
|
|
6
|
+
import Iframe from '@/components/iframe';
|
|
7
|
+
|
|
8
|
+
// @ts-ignore
|
|
4
9
|
import styles from './index.less';
|
|
5
10
|
|
|
6
11
|
|
|
@@ -8,6 +13,7 @@ const LayoutBasic=(props)=>{
|
|
|
8
13
|
const {nav=""} = props;
|
|
9
14
|
return (
|
|
10
15
|
<section className={styles.htmlWrap}>
|
|
16
|
+
{/* @ts-ignore */}
|
|
11
17
|
<Iframe name='header' url={OA_MENU_HOST} className={styles.iframeHeader} />
|
|
12
18
|
<section className={styles.headerSpace}></section>
|
|
13
19
|
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
// @ts-ignore
|
|
5
4
|
import {Outlet} from 'react-router-dom';
|
|
6
|
-
|
|
7
|
-
import LayoutBasic from './Basic';
|
|
8
|
-
import LayoutCenterBody from './CenterBody';
|
|
5
|
+
// @ts-ignore
|
|
9
6
|
import zhCN from 'antd/lib/locale/zh_CN';
|
|
7
|
+
// @ts-ignore
|
|
8
|
+
import { ConfigProvider } from 'antd';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
import ProviderApp from '@/provider/app';
|
|
12
|
+
|
|
13
|
+
import LayoutBasic from './basic';
|
|
14
|
+
import LayoutCenterBody from './centerBody';
|
|
10
15
|
|
|
16
|
+
// @ts-ignore
|
|
11
17
|
import styles from './index.less';
|
|
12
18
|
styles;
|
|
13
19
|
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import React from 'react';
|
|
3
|
+
|
|
2
4
|
import { openLink,jumpUrl } from '@/utils';
|
|
5
|
+
|
|
6
|
+
// @ts-ignore
|
|
3
7
|
import styles from './index.less';
|
|
4
8
|
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 超链接组件
|
|
12
|
+
* @param {object} [props]
|
|
13
|
+
* @param {JSX.Element|string} [props.children] - 子组件
|
|
14
|
+
* @param {string} [props.className] - 扩展类样式名称
|
|
15
|
+
* @param {Function} [props.onClick] - 点击链接的回调
|
|
16
|
+
* @param {string} [props.href] - 跳转链接
|
|
17
|
+
* @param {string} [props.target] - 当target='_blank'时代表新窗口打开
|
|
18
|
+
*
|
|
19
|
+
* @returns {JSX.Element}
|
|
20
|
+
*/
|
|
5
21
|
const Link=(props)=>{
|
|
6
22
|
const {children,className='',onClick,href='',target=''} = props;
|
|
7
23
|
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-ignore
|
|
2
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
// @ts-ignore
|
|
3
4
|
import {matchPath,useLocation,useNavigate,} from 'react-router-dom';
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import { Menu } from 'antd';
|
|
7
|
+
// @ts-ignore
|
|
4
8
|
import { AppstoreOutlined, MailOutlined, SettingOutlined } from '@ant-design/icons';
|
|
9
|
+
|
|
5
10
|
import {useLoading} from '@/hooks';
|
|
6
11
|
|
|
12
|
+
// @ts-ignore
|
|
7
13
|
import styles from './index.less';
|
|
8
14
|
|
|
9
15
|
const ICON_NAME={
|
|
@@ -92,7 +98,7 @@ const LeftMenu=(props)=>{
|
|
|
92
98
|
return item;
|
|
93
99
|
}
|
|
94
100
|
|
|
95
|
-
|
|
101
|
+
// @ts-ignore
|
|
96
102
|
window.matchPath=matchPath;
|
|
97
103
|
|
|
98
104
|
|
|
@@ -1,13 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from 'react';
|
|
3
|
+
// @ts-ignore
|
|
2
4
|
import ReactDOM from 'react-dom';
|
|
3
|
-
|
|
4
|
-
import Popup from '@/components/
|
|
5
|
+
|
|
6
|
+
import Popup from '@/components/popup';
|
|
7
|
+
|
|
8
|
+
// @ts-ignore
|
|
5
9
|
import imgLoading from '@/assets/images/loading.svg';
|
|
6
10
|
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
import CSS from './index.less';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 页面Loading状态
|
|
16
|
+
* @param {object} [props]
|
|
17
|
+
* @param {boolean} [props.visible=true] - 是否显示状态
|
|
18
|
+
*
|
|
19
|
+
* @returns {JSX.Element}
|
|
20
|
+
*/
|
|
7
21
|
const PageLoading = (props) => {
|
|
8
22
|
const {visible=true} = props;
|
|
9
23
|
if(!visible){
|
|
10
|
-
return
|
|
24
|
+
return <></>;
|
|
11
25
|
}
|
|
12
26
|
return (
|
|
13
27
|
<div className={CSS.wrap } >
|
|
@@ -18,6 +32,13 @@ const PageLoading = (props) => {
|
|
|
18
32
|
);
|
|
19
33
|
};
|
|
20
34
|
|
|
35
|
+
/**
|
|
36
|
+
* 全屏置顶显示一个页面loading组件
|
|
37
|
+
* @param {object} [props]
|
|
38
|
+
* @param {boolean} [props.canTouch=false] - 是否允许用户点击屏幕穿透到下面的组件
|
|
39
|
+
*
|
|
40
|
+
* @returns {(string)=>void}
|
|
41
|
+
*/
|
|
21
42
|
export const ShowPageLoading=(props={canTouch:false})=>{
|
|
22
43
|
let popup = Popup(()=>{},{cantouch:props.canTouch});
|
|
23
44
|
ReactDOM.render(
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import React from 'react';
|
|
3
|
+
// @ts-ignore
|
|
2
4
|
import ReactDOM from 'react-dom';
|
|
5
|
+
|
|
6
|
+
// @ts-ignore
|
|
3
7
|
import styles from './index.less';
|
|
4
8
|
styles;
|
|
5
9
|
|
|
10
|
+
/**
|
|
11
|
+
* 一个全屏置顶的遮罩层
|
|
12
|
+
* @param {(result)=>void} reslove - 遮罩层的关闭回调
|
|
13
|
+
* @param {Object} [options] - 参数
|
|
14
|
+
* @param {boolean} [options.cantouch=false] - 是否允许被点击穿透
|
|
15
|
+
* @param {boolean} [options.transparent=false] - 是否遮罩层完全透明
|
|
16
|
+
*
|
|
17
|
+
* @returns { {dom:HTMLElement,destory:()=>void} }
|
|
18
|
+
*/
|
|
6
19
|
const Popup = (reslove,options) => {
|
|
7
20
|
let rootDom = document.createElement('div');
|
|
8
21
|
rootDom.className='popup-box';
|