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
|
@@ -1,25 +1,31 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import React, { useEffect, useState, useRef } from 'react';
|
|
3
|
+
// @ts-ignore
|
|
2
4
|
import { useParams, useSearchParams,useNavigate } from 'react-router-dom';
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import { Table, Input, Button, Form,Checkbox,Radio } from 'antd';
|
|
3
7
|
|
|
4
8
|
import {usePaginationWithForm} from '@/hooks';
|
|
5
9
|
import {GET_LIST,TEST_AUTH} from '@/services/demo';
|
|
6
10
|
import {GET_STAFF_LIST,GET_DEP_LIST} from '@/services/common';
|
|
7
11
|
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import styles from './index.less';
|
|
12
|
+
import {FormBlockByTitle} from '@/components/layout/formBlock';
|
|
13
|
+
|
|
11
14
|
import PageTitle from '@/pages/components/pageTitle';
|
|
12
15
|
import TotalRecord from '@/pages/components/totalRecord';
|
|
13
|
-
import {ShowErrorAlert,ShowAlert,ShowConfirm} from '@/components/
|
|
14
|
-
import ShowToast from '@/components/
|
|
15
|
-
import Empty from '@/components/
|
|
16
|
-
import FormRow from '@/components/
|
|
17
|
-
import FormTable from '@/components/
|
|
18
|
-
import UploadHelper from '@/components/
|
|
19
|
-
import StaffSelect from '@/components/
|
|
20
|
-
import DepSelect from '@/components/
|
|
16
|
+
import {ShowErrorAlert,ShowAlert,ShowConfirm} from '@/components/dialog';
|
|
17
|
+
import ShowToast from '@/components/toast';
|
|
18
|
+
import Empty from '@/components/empty';
|
|
19
|
+
import FormRow from '@/components/formRow';
|
|
20
|
+
import FormTable from '@/components/formTable';
|
|
21
|
+
import UploadHelper from '@/components/upload';
|
|
22
|
+
import StaffSelect from '@/components/select/staffSelect';
|
|
23
|
+
import DepSelect from '@/components/select/depSelect';
|
|
21
24
|
import ProviderApp from '@/provider/app';
|
|
22
25
|
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
import styles from './index.less';
|
|
28
|
+
|
|
23
29
|
const Page = () => {
|
|
24
30
|
const providerApp = ProviderApp.useContainer();
|
|
25
31
|
const navigate= useNavigate();
|
|
@@ -1,9 +1,29 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import { useState,useMemo, useEffect } from 'react';
|
|
3
|
+
// @ts-ignore
|
|
2
4
|
import { useSearchParams,useNavigate } from 'react-router-dom';
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
import { createContainer } from "unstated-next"
|
|
7
|
+
|
|
3
8
|
import {setLogout,setToLogin,setRefreshToken} from '@/services/token';
|
|
4
9
|
import { setJwt } from '@/services';
|
|
5
10
|
|
|
6
|
-
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @typedef AppContaniner
|
|
15
|
+
* @property {boolean} loading - 当前是否是加载状态
|
|
16
|
+
* @property {(open:boolean)=>void} setLoading - 设置加载状态
|
|
17
|
+
* @property {object} nav - 导航栏配置
|
|
18
|
+
* @property {(option:object)=>void} setNav - 设置导航栏配置
|
|
19
|
+
* @property {()=>Promise} logout - 注销病退回登录界面
|
|
20
|
+
* @property {(redirectUrl:string)=>Promise} toLogin - 登录并跳转
|
|
21
|
+
* @property {(user:object)=>void} setUser - 注销病退回登录界面
|
|
22
|
+
* @property {object} user - 注销病退回登录界面
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
|
|
7
27
|
const useApp=() =>{
|
|
8
28
|
const [search] = useSearchParams();
|
|
9
29
|
const navigate= useNavigate();
|
|
@@ -61,6 +81,15 @@ const useApp=() =>{
|
|
|
61
81
|
return action
|
|
62
82
|
}
|
|
63
83
|
|
|
84
|
+
/**
|
|
85
|
+
* @typedef {object} AppProvider
|
|
86
|
+
* @property {function():AppContaniner} useContainer
|
|
87
|
+
* @property {React.ComponentType<any>} Provider
|
|
88
|
+
*/
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* @type {AppProvider}
|
|
92
|
+
*/
|
|
64
93
|
const App = createContainer(useApp);
|
|
65
94
|
|
|
66
95
|
export default App;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import React,{Suspense} from 'react';
|
|
3
|
+
// @ts-ignore
|
|
2
4
|
import { Routes, Route, Navigate } from 'react-router-dom';
|
|
3
5
|
|
|
4
|
-
import { LayoutBasic, Layout } from '@/components/
|
|
5
|
-
import PageLoading from '@/components/
|
|
6
|
+
import { LayoutBasic, Layout } from '@/components/layout';
|
|
7
|
+
import PageLoading from '@/components/page/pageLoading';
|
|
6
8
|
|
|
7
9
|
import Login from '@/pages/login';
|
|
8
10
|
// import {AuthLogin} from '@/components/Auth';
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import axios from 'axios';
|
|
1
3
|
|
|
2
4
|
import {GET_TOKEN,GET_DEFAULT_CROSS} from '@/services';
|
|
3
|
-
|
|
5
|
+
|
|
4
6
|
|
|
5
7
|
/**
|
|
6
8
|
* 获取员工列表
|
|
7
9
|
*/
|
|
8
10
|
export async function GET_STAFF_LIST() {
|
|
11
|
+
// @ts-ignore
|
|
9
12
|
let ret = await GET_DEFAULT_CROSS(`${OA_HOST}/common/getNewUserList`);
|
|
10
13
|
return ret;
|
|
11
14
|
// let response = await axios({
|
|
@@ -23,6 +26,7 @@ export async function GET_STAFF_LIST() {
|
|
|
23
26
|
* 所有部门信息
|
|
24
27
|
*/
|
|
25
28
|
export async function GET_DEP_LIST() {
|
|
29
|
+
// @ts-ignore
|
|
26
30
|
return GET_DEFAULT_CROSS(`${OA_HOST}/common/getBenefitDept`);
|
|
27
31
|
}
|
|
28
32
|
|
|
@@ -31,6 +35,7 @@ export async function GET_DEP_LIST() {
|
|
|
31
35
|
* @returns
|
|
32
36
|
*/
|
|
33
37
|
export function GET_COMPANY_LIST(){
|
|
38
|
+
// @ts-ignore
|
|
34
39
|
return GET_DEFAULT_CROSS(`${OA_HOST}/filestore/list?status=1`);
|
|
35
40
|
}
|
|
36
41
|
|
|
@@ -51,6 +56,7 @@ export async function POST_IMPORT_EXCEL(url, file, onProgress) {
|
|
|
51
56
|
url: url,
|
|
52
57
|
data: formdata,
|
|
53
58
|
onUploadProgress: (e) => {
|
|
59
|
+
// @ts-ignore
|
|
54
60
|
onProgress({ percent: `${e.loaded}/${e.total}` * 100 });
|
|
55
61
|
},
|
|
56
62
|
});
|
|
@@ -61,6 +67,7 @@ export async function POST_IMPORT_EXCEL(url, file, onProgress) {
|
|
|
61
67
|
* 获取下载文件的url路径
|
|
62
68
|
*/
|
|
63
69
|
export function GET_DOWNLOAD_FILE(s_name) {
|
|
70
|
+
// @ts-ignore
|
|
64
71
|
return `${OA_HOST}/file/download?name=${s_name}`;
|
|
65
72
|
}
|
|
66
73
|
|
|
@@ -81,6 +88,7 @@ export async function UPLOAD_FILE(file, param, onProgress) {
|
|
|
81
88
|
|
|
82
89
|
let response = await axios({
|
|
83
90
|
method: 'post',
|
|
91
|
+
// @ts-ignore
|
|
84
92
|
url: `${OA_HOST}/file/upload`,
|
|
85
93
|
data: formdata,
|
|
86
94
|
xsrfCookieName: '',
|
|
@@ -88,6 +96,7 @@ export async function UPLOAD_FILE(file, param, onProgress) {
|
|
|
88
96
|
withCredentials: true,
|
|
89
97
|
|
|
90
98
|
onUploadProgress: (e) => {
|
|
99
|
+
// @ts-ignore
|
|
91
100
|
let per = parseFloat((e.loaded / e.total) * 100).toFixed(0);
|
|
92
101
|
onProgress({ percent: per });
|
|
93
102
|
},
|
|
@@ -111,6 +120,9 @@ export async function UPLOAD_FILE(file, param, onProgress) {
|
|
|
111
120
|
* types:array|string,['png','gif']|'png' 类型
|
|
112
121
|
*/
|
|
113
122
|
export function CHECK_FILE_TYPE(types, filename) {
|
|
123
|
+
/**
|
|
124
|
+
* @type RegExp|string
|
|
125
|
+
*/
|
|
114
126
|
let reg = '';
|
|
115
127
|
|
|
116
128
|
if (types.constructor === Array) {
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import Axios from 'axios';
|
|
3
|
+
// @ts-ignore
|
|
2
4
|
import qs from 'qs';
|
|
5
|
+
// @ts-ignore
|
|
3
6
|
import { message } from 'antd';
|
|
7
|
+
|
|
4
8
|
import { toHref, exportExcel } from '@/utils';
|
|
5
9
|
import { CHANGE_TOKEN, setRefreshToken ,toLogin} from './token';
|
|
6
10
|
const axios = Axios.create();
|
|
11
|
+
|
|
12
|
+
// @ts-ignore
|
|
7
13
|
console.log(`========API_HOST:${API_HOST}========`);
|
|
8
14
|
|
|
9
15
|
const tokenMode='header';//header,cookie
|
|
@@ -95,10 +101,23 @@ axios.interceptors.response.use(
|
|
|
95
101
|
}
|
|
96
102
|
);
|
|
97
103
|
|
|
98
|
-
|
|
104
|
+
/**
|
|
105
|
+
* @typedef RequestOptions 发送请求的扩展信息
|
|
106
|
+
* @property {number|boolean} ttl=false - 接口缓存周期,开启后默认为2秒,ttl单位为毫秒
|
|
107
|
+
* @property {string|boolean} noInterceptors=false - 关闭拦截类型,'all'为关闭包括401、403在内的所有异常,默认情况下只拦截response.code不为0的情况
|
|
108
|
+
*
|
|
109
|
+
*/
|
|
99
110
|
|
|
100
111
|
|
|
101
112
|
let buffer = {};
|
|
113
|
+
/**
|
|
114
|
+
* @function
|
|
115
|
+
* @description 发送一个GET请求
|
|
116
|
+
* @param {string} url - 请求地址
|
|
117
|
+
* @param {Object} [param] - 请求的参数
|
|
118
|
+
* @param {RequestOptions} [options] - 扩展参数
|
|
119
|
+
* @returns {Promise<Object>}
|
|
120
|
+
*/
|
|
102
121
|
export async function GET_DEFAULT(url, param, options) {
|
|
103
122
|
if (param) param = qs.stringify(param, { arrayFormat: 'indices' });
|
|
104
123
|
let now = Date.now();
|
|
@@ -131,6 +150,13 @@ export async function GET_DEFAULT(url, param, options) {
|
|
|
131
150
|
return response && response.data ? response.data : null;
|
|
132
151
|
}
|
|
133
152
|
|
|
153
|
+
/**
|
|
154
|
+
* @function
|
|
155
|
+
* @description 发送一个GET请求
|
|
156
|
+
* @param {string} url - 请求地址
|
|
157
|
+
* @param {Object} [param] - 请求的参数
|
|
158
|
+
* @returns {Promise<Object>}
|
|
159
|
+
*/
|
|
134
160
|
export async function GET_DEFAULT_CROSS(url, param) {
|
|
135
161
|
if (param) param = qs.stringify(param, { arrayFormat: 'indices' });
|
|
136
162
|
|
|
@@ -143,6 +169,14 @@ export async function GET_DEFAULT_CROSS(url, param) {
|
|
|
143
169
|
});
|
|
144
170
|
return response && response.data ? response.data : null;
|
|
145
171
|
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* 导出EXCEL
|
|
175
|
+
* @param {string} url - 接口地址
|
|
176
|
+
* @param {any} param - 接口参数
|
|
177
|
+
* @param {any} user - 用户信息
|
|
178
|
+
* @returns {Promise}
|
|
179
|
+
*/
|
|
146
180
|
export async function EXPORT_DEFAULT_CROSS(url, param, user) {
|
|
147
181
|
if (param) param = qs.stringify(param, { arrayFormat: 'indices' });
|
|
148
182
|
|
|
@@ -158,7 +192,14 @@ export async function EXPORT_DEFAULT_CROSS(url, param, user) {
|
|
|
158
192
|
exportExcel(response, user);
|
|
159
193
|
}
|
|
160
194
|
|
|
161
|
-
|
|
195
|
+
/**
|
|
196
|
+
* 发送一个POST请求
|
|
197
|
+
* @param {string} url - 请求地址
|
|
198
|
+
* @param {Object} [params] - 请求的参数
|
|
199
|
+
* @param {RequestOptions} [options] - 扩展参数
|
|
200
|
+
* @returns {Promise<Object>}
|
|
201
|
+
*/
|
|
202
|
+
export async function POST_DEFAULT(url, params, options) {
|
|
162
203
|
let data = params;
|
|
163
204
|
// if (params) params = qs.stringify(params, { arrayFormat: 'indices' });
|
|
164
205
|
// if (typeof params === 'string') {
|
|
@@ -168,7 +209,7 @@ export async function POST_DEFAULT(url, params, method, options) {
|
|
|
168
209
|
// }
|
|
169
210
|
// let token= await GET_TOKEN();
|
|
170
211
|
let response = await axios({
|
|
171
|
-
method:
|
|
212
|
+
method: 'POST',
|
|
172
213
|
url: url,
|
|
173
214
|
data:{
|
|
174
215
|
// _token:token,
|
|
@@ -180,6 +221,12 @@ export async function POST_DEFAULT(url, params, method, options) {
|
|
|
180
221
|
return response && response.data ? response.data : null;
|
|
181
222
|
}
|
|
182
223
|
|
|
224
|
+
/**
|
|
225
|
+
* 发送一个POST请求
|
|
226
|
+
* @param {string} url - 请求地址
|
|
227
|
+
* @param {Object} [params] - 请求的参数
|
|
228
|
+
* @returns {Promise<Object>}
|
|
229
|
+
*/
|
|
183
230
|
export async function POST_DEFAULT_CROSS(url, params) {
|
|
184
231
|
// let token= await GET_TOKEN();
|
|
185
232
|
|
|
@@ -246,13 +293,10 @@ export function FORMAT_RESPONSE_NO_PAGINATION(response){
|
|
|
246
293
|
return req;
|
|
247
294
|
}
|
|
248
295
|
|
|
249
|
-
|
|
250
|
-
*
|
|
251
|
-
* @param {} error 业务接口401时,用 refreshToken 重新获取token,再重试当前接口
|
|
252
|
-
* @returns
|
|
253
|
-
*/
|
|
296
|
+
|
|
254
297
|
const refreshAndRetry = async (error) => {
|
|
255
298
|
if (!localStorage.getItem('refreshToken')) {
|
|
299
|
+
// @ts-ignore
|
|
256
300
|
if(toLogin)toLogin(error.response.data.data.auth_url);
|
|
257
301
|
return;
|
|
258
302
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import Axios from 'axios';
|
|
3
|
+
// @ts-ignore
|
|
2
4
|
import { message } from 'antd';
|
|
5
|
+
|
|
3
6
|
import { toHref } from '@/utils';
|
|
4
7
|
const axios = Axios.create();
|
|
5
8
|
|
|
@@ -30,6 +33,7 @@ export const setRefreshToken = (value) => {
|
|
|
30
33
|
|
|
31
34
|
export let logout = ()=>{}
|
|
32
35
|
export const setLogout=(fn)=>{
|
|
36
|
+
// @ts-ignore
|
|
33
37
|
window.logout=fn;
|
|
34
38
|
logout=fn;
|
|
35
39
|
}
|
|
@@ -71,11 +75,13 @@ axios.interceptors.response.use(
|
|
|
71
75
|
}
|
|
72
76
|
console.log('token error:', JSON.stringify(error));
|
|
73
77
|
const url = error.response.data.data.auth_url;
|
|
78
|
+
// @ts-ignore
|
|
74
79
|
if(toLogin)toLogin(url);
|
|
75
80
|
return;
|
|
76
81
|
// jwt失效
|
|
77
82
|
if (error.response.status === 401) {
|
|
78
83
|
const url = error.response.data.data.auth_url;
|
|
84
|
+
// @ts-ignore
|
|
79
85
|
if(toLogin)toLogin(url);
|
|
80
86
|
return;
|
|
81
87
|
} else if (error.response.status === 403) {
|
|
@@ -127,6 +133,7 @@ async function POST_DEFAULT_CROSS(url, params) {
|
|
|
127
133
|
*/
|
|
128
134
|
export async function CHANGE_TOKEN(params){
|
|
129
135
|
let values = params ? params : {refresh_token: refreshToken};
|
|
136
|
+
// @ts-ignore
|
|
130
137
|
const res = await POST_DEFAULT_CROSS(`${KSSO_HOST}/oauth/ksso/exchange`, values);
|
|
131
138
|
return res;
|
|
132
139
|
}
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import moment from 'moment';
|
|
2
3
|
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 打开一个第三方链接
|
|
7
|
+
* @param {string} link - 链接地址
|
|
8
|
+
* @param {string} [target='_blank'] - 打开方式,_blank:新窗口打开
|
|
9
|
+
*/
|
|
3
10
|
export const openLink = (link, target = '_blank') => {
|
|
4
11
|
let domLink = document.createElement('a');
|
|
5
12
|
domLink.href = link;
|
|
6
13
|
domLink.setAttribute('target', target);
|
|
14
|
+
// @ts-ignore
|
|
7
15
|
domLink.style.opacity = 0;
|
|
16
|
+
// @ts-ignore
|
|
8
17
|
domLink.style.zIndex = -999;
|
|
9
18
|
document.body.appendChild(domLink);
|
|
10
19
|
domLink.click();
|
|
@@ -13,50 +22,60 @@ export const openLink = (link, target = '_blank') => {
|
|
|
13
22
|
}, 200);
|
|
14
23
|
}
|
|
15
24
|
|
|
25
|
+
/**
|
|
26
|
+
* 判断当前是否为移动端
|
|
27
|
+
* @returns {boolean}
|
|
28
|
+
*/
|
|
16
29
|
export const isMobile = () => {
|
|
17
30
|
return navigator.userAgent.match(
|
|
18
31
|
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
|
19
|
-
)
|
|
32
|
+
)?true:false
|
|
20
33
|
}
|
|
21
34
|
|
|
22
|
-
export const toHref = (url, replace, newWindow) => {
|
|
23
|
-
if (window.knFeishu) {
|
|
24
|
-
window.knFeishu.ToHref(url, replace, newWindow);
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
if (newWindow) {
|
|
28
|
-
window.open(url);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (replace) {
|
|
32
|
-
location.replace(url);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
location.href = url;
|
|
36
|
-
};
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
/**
|
|
37
|
+
* 跳转URL-兼容飞书
|
|
38
|
+
* @param {string} url - 链接地址
|
|
39
|
+
* @param {object} [options] - 参数
|
|
40
|
+
* @param {boolean} [options.replace] - 是否要覆盖当前URL记录
|
|
41
|
+
* @param {boolean} [options.newWindow] - 是否新窗口中打开
|
|
42
|
+
* @param {boolean} [options.reload] - 是否重载当前页面
|
|
43
|
+
*
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
export const jumpUrl=(url,options={})=>{
|
|
47
|
+
const {replace=false,newWindow=false,reload=false}= options;
|
|
48
|
+
if(!reload){
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
if(window.knFeishu){
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
window.knFeishu.ToHref(url,replace,newWindow);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if(reload){
|
|
41
58
|
location.reload();
|
|
42
59
|
return;
|
|
43
60
|
}
|
|
44
|
-
if
|
|
61
|
+
if(replace){
|
|
45
62
|
location.replace(url);
|
|
46
63
|
return;
|
|
47
64
|
}
|
|
48
|
-
if
|
|
65
|
+
if(newWindow){
|
|
49
66
|
window.open(url);
|
|
50
67
|
return;
|
|
51
68
|
}
|
|
52
|
-
location.href
|
|
69
|
+
location.href=url;
|
|
53
70
|
|
|
54
71
|
}
|
|
55
72
|
|
|
56
73
|
|
|
57
74
|
// 关闭页面
|
|
58
75
|
export const closeWindow = () => {
|
|
76
|
+
// @ts-ignore
|
|
59
77
|
if (window.knFeishu && window.knFeishu.closeWindow) {
|
|
78
|
+
// @ts-ignore
|
|
60
79
|
window.knFeishu.closeWindow();
|
|
61
80
|
} else {
|
|
62
81
|
if (window.close) {
|
|
@@ -66,6 +85,26 @@ export const closeWindow = () => {
|
|
|
66
85
|
};
|
|
67
86
|
|
|
68
87
|
|
|
88
|
+
|
|
89
|
+
export const toHref = (url, replace, newWindow) => {
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
if (window.knFeishu) {
|
|
92
|
+
// @ts-ignore
|
|
93
|
+
window.knFeishu.ToHref(url, replace, newWindow);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
if (newWindow) {
|
|
97
|
+
window.open(url);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (replace) {
|
|
101
|
+
location.replace(url);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
location.href = url;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
|
|
69
108
|
export function formatMoney(s, n = 2) {
|
|
70
109
|
if (typeof s === 'undefined' || s === '') {
|
|
71
110
|
return '-'
|
|
@@ -99,6 +138,7 @@ export const isEditAuth = (user) => {
|
|
|
99
138
|
}
|
|
100
139
|
|
|
101
140
|
export const exportExcel = (response, user) => {
|
|
141
|
+
// @ts-ignore
|
|
102
142
|
const blob = new Blob([response.data], { type: `${type},charset=UTF-8` });
|
|
103
143
|
const disposition = response.headers.get('content-disposition');
|
|
104
144
|
const fileName = `管理系统-${user.usr_username}-${moment().format('YYYY-MM-DD')}.xlsx`;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
|
+
|
|
3
4
|
import { isMobile } from '@/utils';
|
|
4
5
|
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
import styles from './index.less';
|
|
8
|
+
|
|
5
9
|
|
|
10
|
+
/**
|
|
11
|
+
* 页脚
|
|
12
|
+
* @param {object} props
|
|
13
|
+
* @param {string} [props.name='footer'] - 页脚名称
|
|
14
|
+
* @param {string} [props.defaultHeight='100%'] - 默认footer高度
|
|
15
|
+
*
|
|
16
|
+
* @returns {JSX.Element}
|
|
17
|
+
*/
|
|
6
18
|
const Footer = (props) => {
|
|
7
19
|
const {name='footer',defaultHeight='100%'}=props;
|
|
8
20
|
const [url, setUrl] = useState('');
|
|
@@ -17,9 +29,11 @@ const Footer = (props) => {
|
|
|
17
29
|
})
|
|
18
30
|
|
|
19
31
|
if(isMobile()){
|
|
32
|
+
// @ts-ignore
|
|
20
33
|
setUrl(`${MICRO_FRONT}/offcial-footer/mobileFooter.html`);
|
|
21
34
|
return;
|
|
22
35
|
}
|
|
36
|
+
// @ts-ignore
|
|
23
37
|
setUrl(`${MICRO_FRONT}/offcial-footer/pcFooter.html`)
|
|
24
38
|
}, [])
|
|
25
39
|
return (
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
|
|
2
4
|
import useScroll from '@/hooks/useScroll';
|
|
5
|
+
|
|
6
|
+
// @ts-ignore
|
|
3
7
|
import styles from './index.less';
|
|
4
8
|
|
|
9
|
+
/**
|
|
10
|
+
* 头部导航栏
|
|
11
|
+
* @returns {JSX.Element}
|
|
12
|
+
*/
|
|
5
13
|
const Header = () => {
|
|
6
14
|
const scroll = useScroll();
|
|
7
15
|
const menu = [
|
|
@@ -14,7 +22,9 @@ const Header = () => {
|
|
|
14
22
|
const refSetActiveMenu = useRef();
|
|
15
23
|
const refScroll = useRef();
|
|
16
24
|
|
|
25
|
+
// @ts-ignore
|
|
17
26
|
refScroll.current=scroll;
|
|
27
|
+
// @ts-ignore
|
|
18
28
|
refSetActiveMenu.current=setActiveMenu;
|
|
19
29
|
|
|
20
30
|
const onClick = (type) => {
|
|
@@ -30,18 +40,22 @@ const Header = () => {
|
|
|
30
40
|
|
|
31
41
|
scroll.addEventListener('scroll',(top)=>{
|
|
32
42
|
if(top==0){
|
|
43
|
+
// @ts-ignore
|
|
33
44
|
refSetActiveMenu.current(menu[0].type);
|
|
34
45
|
return;
|
|
35
46
|
}
|
|
36
47
|
for(let i=menusDom.length-1;i>0;i--){
|
|
37
48
|
if( menusDom[i] ){
|
|
38
49
|
let currentTop= menusDom[i].offsetTop;
|
|
50
|
+
// @ts-ignore
|
|
39
51
|
if(top+refScroll.current.height*0.6 >= currentTop){
|
|
52
|
+
// @ts-ignore
|
|
40
53
|
refSetActiveMenu.current(menu[i].type);
|
|
41
54
|
return;
|
|
42
55
|
}
|
|
43
56
|
}
|
|
44
57
|
}
|
|
58
|
+
// @ts-ignore
|
|
45
59
|
refSetActiveMenu.current(menu[0].type);
|
|
46
60
|
|
|
47
61
|
})
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import React from "react";
|
|
3
|
+
// @ts-ignore
|
|
2
4
|
import styles from'./index.less';
|
|
3
5
|
|
|
6
|
+
/**
|
|
7
|
+
* iconFont图标
|
|
8
|
+
* @param {object} props
|
|
9
|
+
* @param {string} [props.icon] - 图标名称
|
|
10
|
+
* @param {string} [props.className] - 扩展类名
|
|
11
|
+
*
|
|
12
|
+
* @returns {JSX.Element}
|
|
13
|
+
*/
|
|
4
14
|
const IconFont=(props)=>{
|
|
5
15
|
const {icon,className,...others} = props;
|
|
6
16
|
return (
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import React from 'react';
|
|
3
|
+
// @ts-ignore
|
|
3
4
|
import {Outlet} from 'react-router-dom';
|
|
4
5
|
|
|
6
|
+
import ProviderApp from '@/provider/app';
|
|
7
|
+
|
|
8
|
+
// @ts-ignore
|
|
5
9
|
import styles from './index.less';
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
/**
|
|
12
|
+
* 注入AppProvider
|
|
13
|
+
* @returns {JSX.Element}
|
|
14
|
+
*/
|
|
8
15
|
const Layout = (props) => {
|
|
9
16
|
return (
|
|
10
17
|
<ProviderApp.Provider>
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
// @ts-ignore
|
|
1
2
|
import React from 'react';
|
|
3
|
+
// @ts-ignore
|
|
2
4
|
import {Outlet} from 'react-router-dom';
|
|
5
|
+
|
|
3
6
|
import ProviderApp from '@/provider/app';
|
|
4
7
|
|
|
8
|
+
/**
|
|
9
|
+
* 注入AppProvider
|
|
10
|
+
* @returns {JSX.Element}
|
|
11
|
+
*/
|
|
5
12
|
const LayoutProvider=(props)=>{
|
|
6
13
|
return (
|
|
7
14
|
<ProviderApp.Provider>
|