kn-cli 1.0.43 → 1.0.45
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 +2 -1
- package/readme.md +6 -0
- package/src/utils/index.js +1 -1
- package/templates/template_admin/.gitignore +6 -0
- package/templates/template_admin/build.sh +2 -0
- package/templates/template_admin/cli.config.js +21 -0
- package/templates/template_admin/dev.sh +89 -0
- package/templates/template_admin/frontend_build.sh +83 -0
- package/templates/template_admin/init/prepare-commit-msg +5 -0
- package/templates/template_admin/init.sh +33 -0
- package/templates/template_admin/package.json +23 -0
- package/templates/template_admin/public/404.html +26 -0
- package/templates/template_admin/public/favicon.ico +0 -0
- package/templates/template_admin/public/favicon.png +0 -0
- package/templates/template_admin/public/index.html +43 -0
- package/templates/template_admin/public/src/_antd.less +4 -0
- package/templates/template_admin/public/src/_reset.less +128 -0
- package/templates/template_admin/public/src/_variable.less +80 -0
- package/templates/template_admin/public/src/assets/iconfont/iconfont.eot +0 -0
- package/templates/template_admin/public/src/assets/iconfont/iconfont.less +57 -0
- package/templates/template_admin/public/src/assets/iconfont/iconfont.svg +36 -0
- package/templates/template_admin/public/src/assets/iconfont/iconfont.ttf +0 -0
- package/templates/template_admin/public/src/assets/iconfont/iconfont.woff +0 -0
- package/templates/template_admin/public/src/assets/iconfont/iconfont.woff2 +0 -0
- package/templates/template_admin/public/src/assets/images/avatar.png +0 -0
- package/templates/template_admin/public/src/assets/images/loading.svg +40 -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/Auth/index.jsx +44 -0
- package/templates/template_admin/public/src/components/Header/index.jsx +57 -0
- package/templates/template_admin/public/src/components/Header/index.less +57 -0
- package/templates/template_admin/public/src/components/IconFont/index.jsx +10 -0
- package/templates/template_admin/public/src/components/IconFont/index.less +5 -0
- package/templates/template_admin/public/src/components/Layout/Basic/index.jsx +26 -0
- package/templates/template_admin/public/src/components/Layout/Basic/index.less +37 -0
- package/templates/template_admin/public/src/components/Layout/CenterBody/index.jsx +15 -0
- package/templates/template_admin/public/src/components/Layout/CenterBody/index.less +30 -0
- package/templates/template_admin/public/src/components/Layout/Provider/index.jsx +12 -0
- package/templates/template_admin/public/src/components/Layout/index.jsx +27 -0
- package/templates/template_admin/public/src/components/Layout/index.less +63 -0
- package/templates/template_admin/public/src/components/Link/index.jsx +24 -0
- package/templates/template_admin/public/src/components/Link/index.less +11 -0
- package/templates/template_admin/public/src/components/Loading/index.jsx +14 -0
- package/templates/template_admin/public/src/components/Loading/index.less +85 -0
- package/templates/template_admin/public/src/components/Menu/index.jsx +126 -0
- package/templates/template_admin/public/src/components/Menu/index.less +19 -0
- package/templates/template_admin/public/src/components/Page/PageLoading/index.jsx +30 -0
- package/templates/template_admin/public/src/components/Page/PageLoading/index.less +29 -0
- package/templates/template_admin/public/src/components/Popup/index.jsx +22 -0
- package/templates/template_admin/public/src/components/Popup/index.less +18 -0
- package/templates/template_admin/public/src/components/Toast/index.jsx +60 -0
- package/templates/template_admin/public/src/components/Toast/index.less +43 -0
- package/templates/template_admin/public/src/components/TopMenu/index.jsx +228 -0
- package/templates/template_admin/public/src/components/TopMenu/index.less +105 -0
- package/templates/template_admin/public/src/components/mask/index.jsx +47 -0
- package/templates/template_admin/public/src/components/mask/index.less +32 -0
- package/templates/template_admin/public/src/dictionary/index.js +103 -0
- package/templates/template_admin/public/src/hooks/index.jsx +18 -0
- package/templates/template_admin/public/src/hooks/useDelay.jsx +29 -0
- package/templates/template_admin/public/src/hooks/useImageLoader.jsx +27 -0
- package/templates/template_admin/public/src/hooks/useLoading.jsx +42 -0
- package/templates/template_admin/public/src/hooks/useLogin.jsx +33 -0
- package/templates/template_admin/public/src/hooks/useNextPage.jsx +89 -0
- package/templates/template_admin/public/src/hooks/usePreload.jsx +66 -0
- package/templates/template_admin/public/src/hooks/useScrollTop.jsx +32 -0
- package/templates/template_admin/public/src/hooks/useSearch.jsx +137 -0
- package/templates/template_admin/public/src/hooks/useUpdate.jsx +11 -0
- package/templates/template_admin/public/src/index.jsx +50 -0
- package/templates/template_admin/public/src/mock/auth.js +91 -0
- package/templates/template_admin/public/src/mock/index.js +63 -0
- package/templates/template_admin/public/src/mock/user.js +70 -0
- package/templates/template_admin/public/src/mock/utils.js +33 -0
- package/templates/template_admin/public/src/pages/checkLogin/index.jsx +13 -0
- package/templates/template_admin/public/src/pages/index.jsx +23 -0
- package/templates/template_admin/public/src/pages/index.less +22 -0
- package/templates/template_admin/public/src/pages/login/index.jsx +27 -0
- package/templates/template_admin/public/src/pages/login/index.less +44 -0
- package/templates/template_admin/public/src/pages/material/index.jsx +12 -0
- package/templates/template_admin/public/src/pages/order/index.jsx +12 -0
- package/templates/template_admin/public/src/pages/permission/index.jsx +12 -0
- package/templates/template_admin/public/src/pages/subHome/index.jsx +12 -0
- package/templates/template_admin/public/src/pages/subHome2/index.jsx +12 -0
- package/templates/template_admin/public/src/pages/subHome3/index.jsx +12 -0
- package/templates/template_admin/public/src/pages/suggest/index.jsx +12 -0
- package/templates/template_admin/public/src/pages/superAdminLogin/index.jsx +57 -0
- package/templates/template_admin/public/src/pages/superAdminLogin/index.less +44 -0
- package/templates/template_admin/public/src/pages/user/index.jsx +13 -0
- package/templates/template_admin/public/src/pages/userData/index.jsx +12 -0
- package/templates/template_admin/public/src/pages/video/index.jsx +12 -0
- package/templates/template_admin/public/src/provider/app.jsx +119 -0
- package/templates/template_admin/public/src/provider/menu.jsx +20 -0
- package/templates/template_admin/public/src/route.jsx +77 -0
- package/templates/template_admin/public/src/services/auth.js +28 -0
- package/templates/template_admin/public/src/services/index.js +181 -0
- package/templates/template_admin/public/src/services/user.js +26 -0
- package/templates/template_admin/public/src/utils/index.js +38 -0
- package/templates/template_admin/public/static/about.html +1 -0
- package/templates/template_admin/public/static/kssoLogin.html +22 -0
- package/templates/template_admin/readme.md +55 -0
- package/templates/template_admin/report.sh +68 -0
- package/templates/template_admin/tools/iconfont/gulpfile.js +70 -0
- package/templates/template_admin/tools/iconfont/package.json +20 -0
- package/templates/template_admin/tools/iconfont/run.sh +39 -0
- package/templates/template_admin/tools/iconfont/svg/arrowBack.svg +1 -0
- package/templates/template_admin/tools/iconfont/svg/check.svg +1 -0
- package/templates/template_admin/tools/iconfont/svg/close.svg +1 -0
- package/templates/template_admin/tools/iconfont/svg/down.svg +1 -0
- package/templates/template_admin/tools/iconfont/svg/image.svg +1 -0
- package/templates/template_admin/tools/iconfont/svg/play.svg +1 -0
- package/templates/template_admin/tools/iconfont/svg/refresh.svg +1 -0
- package/templates/template_admin/tools/iconfont/svg/warn.svg +1 -0
- package/templates/template_admin/tools/iconfont/templates/_icons.css +26 -0
- package/templates/template_admin/tools/iconfont/templates/_icons.less +29 -0
- package/templates/template_admin/tools/iconfont/templates/index.html +56 -0
- package/templates/template_admin/tools/tinypng/package.json +11 -0
- package/templates/template_admin/tools/tinypng/run.sh +15 -0
- package/templates/template_admin/webpack.api.js +33 -0
- package/templates/template_app/.gitignore +6 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
|
4
|
+
<defs>
|
|
5
|
+
<font id="iconfont" horiz-adv-x="191.87258461178124">
|
|
6
|
+
<font-face font-family="iconfont"
|
|
7
|
+
units-per-em="128" ascent="128"
|
|
8
|
+
descent="0" />
|
|
9
|
+
<missing-glyph horiz-adv-x="0" />
|
|
10
|
+
<glyph glyph-name="arrowBack"
|
|
11
|
+
unicode=""
|
|
12
|
+
horiz-adv-x="128" d="M39.955 63.998L81.957 105.999L87.613 100.343L45.612 58.34zM45.652 69.692L88.149 27.196L82.492 21.539L39.995 64.036z" />
|
|
13
|
+
<glyph glyph-name="check"
|
|
14
|
+
unicode=""
|
|
15
|
+
horiz-adv-x="128" d="M51.382857125 40.68571425C53.4034285 37.8514285 57.61828575 37.8514285 59.648 40.68571425L93.348571375 87.40571425A1.28 1.28 0 0 1 92.30628575 89.444571375H84.8A5.092571375 5.092571375 0 0 1 80.65828575 87.31428575L55.515428625 52.43428575L44.132571375 68.24228575A5.12 5.12 0 0 1 39.98171425 70.363428625H32.484571375A1.28 1.28 0 0 1 31.44228575 68.33371425L51.37371425 40.68571425zM122.88 128H5.12A5.12 5.12 0 0 1 0 122.88V5.12C0 2.28571425 2.28571425 0 5.12 0H122.88C125.71428575 0 128 2.28571425 128 5.12V122.88A5.12 5.12 0 0 1 122.88 128zM116.48 11.52H11.52V116.48H116.48V11.52z" />
|
|
16
|
+
<glyph glyph-name="close"
|
|
17
|
+
unicode=""
|
|
18
|
+
horiz-adv-x="128" d="M74.56591125 63.999946625L127.611200375 125.42922875C128.496533 126.453227875 127.749866875 127.99989325 126.373868 127.999893375H110.2458815A3.338663875 3.338663875 0 0 1 107.76055025 126.87989425L64.00592 76.213269875L20.240623125 126.87989425A3.274664 3.274664 0 0 1 17.755291875 127.999893375H1.627305375C0.240639875 127.999893375 -0.506026125 126.453228 0.389973 125.42922875L53.4565955 63.999946625L0.389973 2.5706645C-0.495359625 1.546665375 0.2513065 0 1.627305375 0H17.755291875C18.715291125 0 19.611290375 0.415999625 20.240623125 1.119999125L64.00592 51.7866235L107.771216875 1.119999125A3.274664 3.274664 0 0 1 110.256548125 0H126.384534625C127.771200125 0 128.517866125 1.546665375 127.621867 2.5706645L74.5552445 63.999946625z" />
|
|
19
|
+
<glyph glyph-name="down"
|
|
20
|
+
unicode=""
|
|
21
|
+
horiz-adv-x="191.87258461178124" d="M189.9647490035717 128H171.0226685809696C169.7427983176176 128 168.5269214986842 127.36005675 167.758999415672 126.35214625L95.9902723763624 28.4568345L24.2215453370529 126.35214625A4.0635882205157 4.063639375 0 0 1 20.9738744703607 128H2.0317940477586C0.3839610415061 128 -0.5759416247583 126.14416475 0.3839610415061 124.832281125L89.4309370735613 3.3070665A8.1111780174276 8.111280125 0 0 1 102.5016125333505 3.3070665L191.580585287615 124.832281125A1.9837989019456 1.983823875 0 0 1 189.9807474271755 128z" />
|
|
22
|
+
<glyph glyph-name="image"
|
|
23
|
+
unicode=""
|
|
24
|
+
horiz-adv-x="170.63111851697565" d="M164.5781985954392 127.998613375H6.0800812704923A5.9520795555871 5.951866125 0 0 1 0 122.185410875V5.814695875C0 2.6041015 2.7200362854808 0.001493375 6.0907480279826 0.00149325H164.5888653529294A5.9520795555871 5.951866125 0 0 1 170.679613380912 5.814695875V122.185410875A5.9520795555871 5.951866125 0 0 1 164.5781985954392 127.998613375zM156.9514299885937 13.089198875H13.7175166348281V20.342369L40.0965356627626 50.219030125L68.6835842415614 17.8570915L113.164178483573 68.181292625L156.9514299885937 18.614407875V13.089198875zM156.9514299885937 36.694001L114.3268606752104 84.948915375A1.5573540938434 1.55729825 0 0 1 112.001496166931 84.948915375L68.6942509990517 35.926018375L41.2592178544 66.96532A1.5573540938434 1.55729825 0 0 1 38.9338534711252 66.96532L13.7175166348281 38.421962125V114.900241375H156.9514299885937V36.694001zM45.7179441110941 74.18649075C54.9767344892281 74.18649075 62.4755012561638 81.343663 62.4755012561638 90.18613075C62.4755012561638 99.017932 54.9767343642236 106.18577075 45.7179441110941 106.185770875S28.9497200835296 99.017932125 28.9497200835296 90.18613075C28.9497200835296 81.343663 36.4591537329601 74.18649075 45.7179441110941 74.18649075zM45.7179441110941 95.274016375C48.6726503114049 95.274016375 51.0513487321399 93.0020675 51.0513486071354 90.18613075A5.2054029061406 5.20521625 0 0 0 45.7179441110941 85.087578875A5.2054029061406 5.20521625 0 0 0 40.3845394900483 90.18613075C40.3845394900483 93.002067375 42.7632379107832 95.27401625 45.7179441110941 95.274016375z" />
|
|
25
|
+
<glyph glyph-name="play"
|
|
26
|
+
unicode=""
|
|
27
|
+
horiz-adv-x="128" d="M52.84571425 37.504L84.75428575 62.57371425C85.6685715 63.296 85.6685715 64.676571375 84.75428575 65.408L52.84571425 90.496A1.81028575 1.81028575 0 0 1 49.92 89.088V38.93028575C49.92 37.421714375 51.657142875 36.5805715 52.84571425 37.504zM122.88 128H5.12A5.12 5.12 0 0 1 0 122.88V5.12C0 2.28571425 2.28571425 0 5.12 0H122.88C125.71428575 0 128 2.28571425 128 5.12V122.88A5.12 5.12 0 0 1 122.88 128zM116.48 11.52H11.52V116.48H116.48V11.52z" />
|
|
28
|
+
<glyph glyph-name="refresh"
|
|
29
|
+
unicode=""
|
|
30
|
+
horiz-adv-x="128" d="M85.504 77.568Q83.328 78.592 83.52 80.32T84.992 83.072Q85.376 83.328 87.488 85.056T92.672 89.216Q87.296 95.36 79.872 98.88T63.744 102.4Q55.68 102.4 48.64 99.392T36.352 91.136T28.096 78.848T25.088 63.744Q25.088 55.808 28.096 48.768T36.352 36.48T48.64 28.224T63.744 25.216Q70.4 25.216 76.352 27.328T87.232 33.28T95.68 42.304T100.864 53.632Q101.76 56.576 104.192 58.496T109.952 60.416Q113.92 60.416 116.672 57.6T119.424 50.944Q119.424 49.152 118.784 47.488Q116.096 38.528 110.848 30.976T98.368 17.984T82.304 9.472T63.744 6.4Q51.84 6.4 41.344 10.88T23.104 23.168T10.816 41.408T6.272 63.744T10.816 86.144T23.104 104.384T41.344 116.672T63.744 121.216Q76.928 121.216 88.192 115.776T107.392 100.992Q110.336 103.168 112.32 104.768T114.816 106.752Q115.584 107.392 116.48 107.712T118.144 107.712T119.488 106.368T120.32 103.296Q120.448 102.144 120.576 99.392T120.832 92.992T120.96 85.44T120.832 78.08Q120.704 73.728 118.784 71.808Q117.76 70.784 115.712 70.656T111.36 71.04Q107.904 71.808 103.744 72.704T95.808 74.56T89.152 76.352T85.504 77.568z" />
|
|
31
|
+
<glyph glyph-name="warn"
|
|
32
|
+
unicode=""
|
|
33
|
+
horiz-adv-x="128" d="M64 128A64 64 0 1 1 128 64A64 64 0 0 1 64 128zM64 25.6A6.4 6.4 0 1 0 70.4 32A6.4 6.4 0 0 0 64 25.6zM70.4 44.8H57.6V102.4H70.4z" />
|
|
34
|
+
</font>
|
|
35
|
+
</defs>
|
|
36
|
+
</svg>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: none; display: block; shape-rendering: auto;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
|
|
3
|
+
<g transform="rotate(0 50 50)">
|
|
4
|
+
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#94908d">
|
|
5
|
+
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.8888888888888888s" repeatCount="indefinite"></animate>
|
|
6
|
+
</rect>
|
|
7
|
+
</g><g transform="rotate(40 50 50)">
|
|
8
|
+
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#94908d">
|
|
9
|
+
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.7777777777777778s" repeatCount="indefinite"></animate>
|
|
10
|
+
</rect>
|
|
11
|
+
</g><g transform="rotate(80 50 50)">
|
|
12
|
+
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#94908d">
|
|
13
|
+
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite"></animate>
|
|
14
|
+
</rect>
|
|
15
|
+
</g><g transform="rotate(120 50 50)">
|
|
16
|
+
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#94908d">
|
|
17
|
+
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.5555555555555556s" repeatCount="indefinite"></animate>
|
|
18
|
+
</rect>
|
|
19
|
+
</g><g transform="rotate(160 50 50)">
|
|
20
|
+
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#94908d">
|
|
21
|
+
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.4444444444444444s" repeatCount="indefinite"></animate>
|
|
22
|
+
</rect>
|
|
23
|
+
</g><g transform="rotate(200 50 50)">
|
|
24
|
+
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#94908d">
|
|
25
|
+
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite"></animate>
|
|
26
|
+
</rect>
|
|
27
|
+
</g><g transform="rotate(240 50 50)">
|
|
28
|
+
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#94908d">
|
|
29
|
+
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.2222222222222222s" repeatCount="indefinite"></animate>
|
|
30
|
+
</rect>
|
|
31
|
+
</g><g transform="rotate(280 50 50)">
|
|
32
|
+
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#94908d">
|
|
33
|
+
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="-0.1111111111111111s" repeatCount="indefinite"></animate>
|
|
34
|
+
</rect>
|
|
35
|
+
</g><g transform="rotate(320 50 50)">
|
|
36
|
+
<rect x="47" y="24" rx="3" ry="6" width="6" height="12" fill="#94908d">
|
|
37
|
+
<animate attributeName="opacity" values="1;0" keyTimes="0;1" dur="1s" begin="0s" repeatCount="indefinite"></animate>
|
|
38
|
+
</rect>
|
|
39
|
+
</g>
|
|
40
|
+
<!-- [ldio] generated by https://loading.io/ --></svg>
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import ProviderApp from '@/provider/app';
|
|
3
|
+
import { useNavigate } from 'react-router-dom';
|
|
4
|
+
import {useLoading} from '@/hooks';
|
|
5
|
+
|
|
6
|
+
export const AuthShow=(props)=>{
|
|
7
|
+
const {name} = props;
|
|
8
|
+
const app = ProviderApp.useContainer();
|
|
9
|
+
if(app?.user?.authorities?.includes(name)){
|
|
10
|
+
return props.children;
|
|
11
|
+
}
|
|
12
|
+
return <></>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const AuthLogin=(props)=>{
|
|
16
|
+
const navigate = useNavigate();
|
|
17
|
+
const [pass,setPass] = useState(false)
|
|
18
|
+
const app = ProviderApp.useContainer();
|
|
19
|
+
const loading = useLoading();
|
|
20
|
+
|
|
21
|
+
const check=async ()=>{
|
|
22
|
+
loading.setLoading(true);
|
|
23
|
+
console.log(`[Auth]检查用户登录态`)
|
|
24
|
+
const req =await app.isLogin();
|
|
25
|
+
loading.setLoading(false);
|
|
26
|
+
if(req){
|
|
27
|
+
console.log(`[Auth]检查用户登录态成功`)
|
|
28
|
+
setPass(true);
|
|
29
|
+
}else{
|
|
30
|
+
console.log(`[Auth]检查用户登录态失败`)
|
|
31
|
+
setPass(false);
|
|
32
|
+
navigate('/login');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
useEffect(check,[]);
|
|
36
|
+
|
|
37
|
+
if(pass){
|
|
38
|
+
return props.children;
|
|
39
|
+
}
|
|
40
|
+
return <>检查登录态中...</>
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
export default {AuthShow,AuthLogin};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import IconFont from '../IconFont';
|
|
3
|
+
import styles from './index.less';
|
|
4
|
+
|
|
5
|
+
const Header=(props)=>{
|
|
6
|
+
const {
|
|
7
|
+
visible=true,
|
|
8
|
+
className='',
|
|
9
|
+
title='标题',
|
|
10
|
+
subTitle='',
|
|
11
|
+
leftLabel='',
|
|
12
|
+
rightLabel='',
|
|
13
|
+
left=<IconFont className={styles.leftIcon} icon='arrowBack' />,
|
|
14
|
+
right='',
|
|
15
|
+
syncDocumentTitle=false
|
|
16
|
+
} = props;
|
|
17
|
+
|
|
18
|
+
// 同步更新网页标题
|
|
19
|
+
useEffect(()=>{
|
|
20
|
+
if(syncDocumentTitle){
|
|
21
|
+
document.title= title;
|
|
22
|
+
}
|
|
23
|
+
},[title])
|
|
24
|
+
const onLeft=()=>{
|
|
25
|
+
window.history.back();
|
|
26
|
+
}
|
|
27
|
+
const onLeftLabel=()=>{
|
|
28
|
+
if(props.onLeftLabel){props.onLeftLabel()}
|
|
29
|
+
}
|
|
30
|
+
const onRight=()=>{
|
|
31
|
+
if(props.onRight){props.onRight()}
|
|
32
|
+
}
|
|
33
|
+
const onRightLabel=()=>{
|
|
34
|
+
if(props.onRightLabel){props.onRightLabel()}
|
|
35
|
+
}
|
|
36
|
+
const onTitle=()=>{
|
|
37
|
+
if(props.onTitle){props.onTitle()}
|
|
38
|
+
}
|
|
39
|
+
return (
|
|
40
|
+
<section className={`${styles.header} ${className}`} data-visible={visible}>
|
|
41
|
+
<hgroup className={styles.group}>
|
|
42
|
+
{left&&(<section className={styles.left} onClick={onLeft}>{left}</section>)}
|
|
43
|
+
{leftLabel&&<span className={styles.leftLabel} onClick={onLeftLabel}>{leftLabel}</span>}
|
|
44
|
+
</hgroup>
|
|
45
|
+
<section className={styles.center}>
|
|
46
|
+
{title&&<span onClick={onTitle}>{title}</span>}
|
|
47
|
+
{subTitle&&<span>{subTitle}</span>}
|
|
48
|
+
</section>
|
|
49
|
+
<hgroup className={styles.group}>
|
|
50
|
+
{rightLabel&&<span className={styles.rightLabel} onClick={onRightLabel}>{rightLabel}</span>}
|
|
51
|
+
{right&&(<section className={styles.right} onClick={onRight}>{right}</section>)}
|
|
52
|
+
</hgroup>
|
|
53
|
+
|
|
54
|
+
</section>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
export default Header;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
@import '~@/_variable.less';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
.header{
|
|
5
|
+
z-index: 1;
|
|
6
|
+
height:var(--height-header);
|
|
7
|
+
background-color: white;
|
|
8
|
+
width:100%;
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
box-shadow: 0 0 2px 0 #ccc;
|
|
12
|
+
padding: 0 var(--padding-default);
|
|
13
|
+
&[data-visible='false']{
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
.group{
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
height:100%;
|
|
20
|
+
min-width: 1px;
|
|
21
|
+
}
|
|
22
|
+
.right,
|
|
23
|
+
.left{
|
|
24
|
+
display: flex;
|
|
25
|
+
align-items: center;
|
|
26
|
+
font-size: 24px;
|
|
27
|
+
.rightIcon,
|
|
28
|
+
.leftIcon{
|
|
29
|
+
margin-top: 6px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
.rightLabel,
|
|
33
|
+
.leftLabel{
|
|
34
|
+
&:not(:first-child){
|
|
35
|
+
margin-left:var(--padding-small)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.center{
|
|
40
|
+
flex:1;
|
|
41
|
+
height:100%;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
align-items: center;
|
|
45
|
+
justify-content: center;
|
|
46
|
+
color:var(--color-text);
|
|
47
|
+
span:nth-child(1){
|
|
48
|
+
font-size: 16px;
|
|
49
|
+
color:inherit;
|
|
50
|
+
}
|
|
51
|
+
span:nth-child(2){
|
|
52
|
+
font-size: 12px;
|
|
53
|
+
color:inherit;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import styles from'./index.less';
|
|
3
|
+
|
|
4
|
+
const IconFont=(props)=>{
|
|
5
|
+
const {icon,className,...others} = props;
|
|
6
|
+
return (
|
|
7
|
+
<span {...others} className={`iconfont icon-${icon} ${styles.iconBox} ${className||''}`} ></span>
|
|
8
|
+
)
|
|
9
|
+
}
|
|
10
|
+
export default IconFont;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Outlet} from 'react-router-dom';
|
|
3
|
+
import {LayoutCenterBody} from '@/components/Layout';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
import styles from './index.less';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const LayoutBasic=(props)=>{
|
|
10
|
+
const {className,nav="",topMenu=""} = props;
|
|
11
|
+
return (
|
|
12
|
+
<LayoutCenterBody layout='x-center'>
|
|
13
|
+
<section className={styles.wrap} >
|
|
14
|
+
{topMenu}
|
|
15
|
+
<section className={styles.content}>
|
|
16
|
+
{nav}
|
|
17
|
+
<section className={styles.body}>
|
|
18
|
+
<Outlet />
|
|
19
|
+
</section>
|
|
20
|
+
</section>
|
|
21
|
+
</section>
|
|
22
|
+
</LayoutCenterBody>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default LayoutBasic;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@import '~@/_variable.less';
|
|
2
|
+
|
|
3
|
+
.wrap{
|
|
4
|
+
width:100%;
|
|
5
|
+
height:100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.content{
|
|
11
|
+
width:100%;
|
|
12
|
+
flex:1;
|
|
13
|
+
display: flex;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
.body{
|
|
16
|
+
overflow: auto;
|
|
17
|
+
background-color: var(--color-body-background);
|
|
18
|
+
flex:1;
|
|
19
|
+
height:100%;
|
|
20
|
+
&::-webkit-scrollbar {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
.navBackground{
|
|
27
|
+
position: fixed;
|
|
28
|
+
left:0;
|
|
29
|
+
top:0;
|
|
30
|
+
background-color: rgba(0,0,0,.5);
|
|
31
|
+
width:100%;
|
|
32
|
+
height:100%;
|
|
33
|
+
z-index: var(--z-nav-mobile);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import styles from './index.less';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const LayoutCenterBody=(props)=>{
|
|
7
|
+
const {className,layout='normal'} = props;
|
|
8
|
+
|
|
9
|
+
return (
|
|
10
|
+
<section data-layout={layout} className={ className?`${styles.contentBody} ${className}`:styles.contentBody }>
|
|
11
|
+
{props.children}
|
|
12
|
+
</section>
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
export default LayoutCenterBody;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@import '~@/_variable.less';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
.contentBody{
|
|
5
|
+
width:100%;
|
|
6
|
+
height:100%;
|
|
7
|
+
&[data-layout='xy-center']{
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
align-items: center;
|
|
12
|
+
}
|
|
13
|
+
&[data-layout='x-center']{
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: center;
|
|
17
|
+
}
|
|
18
|
+
&[data-layout='y-center']{
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
body[data-debug-layout]{
|
|
26
|
+
.contentBody{
|
|
27
|
+
border:1px solid red;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Outlet} from 'react-router-dom';
|
|
3
|
+
import ProviderApp from '@/provider/app';
|
|
4
|
+
|
|
5
|
+
const LayoutProvider=(props)=>{
|
|
6
|
+
return (
|
|
7
|
+
<ProviderApp.Provider>
|
|
8
|
+
<Outlet />
|
|
9
|
+
</ProviderApp.Provider>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
12
|
+
export default LayoutProvider;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ProviderApp from '@/provider/app';
|
|
3
|
+
|
|
4
|
+
import {Outlet} from 'react-router-dom';
|
|
5
|
+
import { ConfigProvider } from 'antd';
|
|
6
|
+
import LayoutBasic from './Basic';
|
|
7
|
+
import LayoutCenterBody from './CenterBody';
|
|
8
|
+
import zhCN from 'antd/lib/locale/zh_CN';
|
|
9
|
+
|
|
10
|
+
import styles from './index.less';
|
|
11
|
+
|
|
12
|
+
// 站点最基础的layout,用于控制一些全局环境变量
|
|
13
|
+
const Layout = (props) => {
|
|
14
|
+
return (
|
|
15
|
+
<ProviderApp.Provider>
|
|
16
|
+
<ConfigProvider locale={zhCN}>
|
|
17
|
+
<section className={styles.layout} >
|
|
18
|
+
<Outlet />
|
|
19
|
+
</section>
|
|
20
|
+
</ConfigProvider>
|
|
21
|
+
</ProviderApp.Provider>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export { Layout,LayoutCenterBody,LayoutBasic };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@import '~@/_variable.less';
|
|
2
|
+
|
|
3
|
+
.layout {
|
|
4
|
+
width: 100%;
|
|
5
|
+
height:100%;
|
|
6
|
+
left:0;
|
|
7
|
+
top:0;
|
|
8
|
+
position: absolute;
|
|
9
|
+
margin: 0 auto;
|
|
10
|
+
z-index:0;
|
|
11
|
+
background:white;
|
|
12
|
+
display: flex;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
|
|
15
|
+
.app-scroll-body-pull-load-box{
|
|
16
|
+
width:100%;
|
|
17
|
+
height:100%;
|
|
18
|
+
overflow: scroll;
|
|
19
|
+
-webkit-overflow-scrolling: touch;
|
|
20
|
+
&::-webkit-scrollbar {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.app-scroll-body-pull-load{
|
|
26
|
+
height:@pullLoadHeight+PX;
|
|
27
|
+
background:#F2F5FA;
|
|
28
|
+
width:100%;
|
|
29
|
+
color:#aaa;
|
|
30
|
+
z-index:1;
|
|
31
|
+
|
|
32
|
+
position: absolute;
|
|
33
|
+
left:0;
|
|
34
|
+
top:0;
|
|
35
|
+
transform: translate3d(0,-@pullLoadHeight+PX,0);
|
|
36
|
+
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: row;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
align-items: center;
|
|
41
|
+
|
|
42
|
+
div,img{
|
|
43
|
+
// width:56*2+px;
|
|
44
|
+
max-height: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
.app-scroll-body{
|
|
49
|
+
width:100%;
|
|
50
|
+
min-height:100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
body[data-debug-layout]{
|
|
56
|
+
.layout .center{
|
|
57
|
+
border:4px solid #4366a0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { openLink,jumpUrl } from '@/utils';
|
|
3
|
+
import styles from './index.less';
|
|
4
|
+
|
|
5
|
+
const Link=(props)=>{
|
|
6
|
+
const {children,className='',onClick,href='',target=''} = props;
|
|
7
|
+
|
|
8
|
+
const onLink=()=>{
|
|
9
|
+
if(href){
|
|
10
|
+
if(target=='_blank'){
|
|
11
|
+
openLink(href);
|
|
12
|
+
// window.open(href);
|
|
13
|
+
}else{
|
|
14
|
+
jumpUrl(href);
|
|
15
|
+
}
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if(onClick)onClick();
|
|
19
|
+
}
|
|
20
|
+
return (
|
|
21
|
+
<span onClick={onLink} className={`${styles.linkWrap} ${className}`}>{children}</span>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
export default React.memo(Link);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import React,{useMemo} from 'react';
|
|
4
|
+
import styles from './index.less';
|
|
5
|
+
styles;
|
|
6
|
+
export const Loading=()=>{
|
|
7
|
+
return (
|
|
8
|
+
<div className="ldio-2oha7mxue8v">
|
|
9
|
+
<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
|
|
10
|
+
</div>
|
|
11
|
+
)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default React.memo(Loading);
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
|
|
2
|
+
:global{
|
|
3
|
+
@color:#fff;
|
|
4
|
+
@keyframes ldio-2oha7mxue8v {
|
|
5
|
+
0% { opacity: 1 }
|
|
6
|
+
100% { opacity: 0 }
|
|
7
|
+
}
|
|
8
|
+
.ldio-2oha7mxue8v div:local {
|
|
9
|
+
left:0px;
|
|
10
|
+
top:0px;
|
|
11
|
+
position: absolute;
|
|
12
|
+
animation: ldio-2oha7mxue8v linear 1s infinite;
|
|
13
|
+
background: @color;
|
|
14
|
+
width: 12px;
|
|
15
|
+
height: 24px;
|
|
16
|
+
border-radius: 6px / 12px;
|
|
17
|
+
transform-origin: 40px 40px;
|
|
18
|
+
}
|
|
19
|
+
.ldio-2oha7mxue8v div:nth-child(1) {
|
|
20
|
+
transform: rotate(0deg);
|
|
21
|
+
animation-delay: -0.9166666666666666s;
|
|
22
|
+
background: @color;
|
|
23
|
+
}.ldio-2oha7mxue8v div:nth-child(2) {
|
|
24
|
+
transform: rotate(30deg);
|
|
25
|
+
animation-delay: -0.8333333333333334s;
|
|
26
|
+
background: @color;
|
|
27
|
+
}.ldio-2oha7mxue8v div:nth-child(3) {
|
|
28
|
+
transform: rotate(60deg);
|
|
29
|
+
animation-delay: -0.75s;
|
|
30
|
+
background: @color;
|
|
31
|
+
}.ldio-2oha7mxue8v div:nth-child(4) {
|
|
32
|
+
transform: rotate(90deg);
|
|
33
|
+
animation-delay: -0.6666666666666666s;
|
|
34
|
+
background: @color;
|
|
35
|
+
}.ldio-2oha7mxue8v div:nth-child(5) {
|
|
36
|
+
transform: rotate(120deg);
|
|
37
|
+
animation-delay: -0.5833333333333334s;
|
|
38
|
+
background: @color;
|
|
39
|
+
}.ldio-2oha7mxue8v div:nth-child(6) {
|
|
40
|
+
transform: rotate(150deg);
|
|
41
|
+
animation-delay: -0.5s;
|
|
42
|
+
background: @color;
|
|
43
|
+
}.ldio-2oha7mxue8v div:nth-child(7) {
|
|
44
|
+
transform: rotate(180deg);
|
|
45
|
+
animation-delay: -0.4166666666666667s;
|
|
46
|
+
background: @color;
|
|
47
|
+
}.ldio-2oha7mxue8v div:nth-child(8) {
|
|
48
|
+
transform: rotate(210deg);
|
|
49
|
+
animation-delay: -0.3333333333333333s;
|
|
50
|
+
background: @color;
|
|
51
|
+
}.ldio-2oha7mxue8v div:nth-child(9) {
|
|
52
|
+
transform: rotate(240deg);
|
|
53
|
+
animation-delay: -0.25s;
|
|
54
|
+
background: @color;
|
|
55
|
+
}.ldio-2oha7mxue8v div:nth-child(10) {
|
|
56
|
+
transform: rotate(270deg);
|
|
57
|
+
animation-delay: -0.16666666666666666s;
|
|
58
|
+
background: @color;
|
|
59
|
+
}.ldio-2oha7mxue8v div:nth-child(11) {
|
|
60
|
+
transform: rotate(300deg);
|
|
61
|
+
animation-delay: -0.08333333333333333s;
|
|
62
|
+
background: @color;
|
|
63
|
+
}.ldio-2oha7mxue8v div:nth-child(12) {
|
|
64
|
+
transform: rotate(330deg);
|
|
65
|
+
animation-delay: 0s;
|
|
66
|
+
background: @color;
|
|
67
|
+
}
|
|
68
|
+
.loadingio-spinner-spinner-vviroavveu {
|
|
69
|
+
width: 200px;
|
|
70
|
+
height: 200px;
|
|
71
|
+
display: inline-block;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
background: transparent;
|
|
74
|
+
}
|
|
75
|
+
.ldio-2oha7mxue8v {
|
|
76
|
+
width: 80px;
|
|
77
|
+
height: 80px;
|
|
78
|
+
position: relative;
|
|
79
|
+
transform: translateZ(0) scale(1);
|
|
80
|
+
backface-visibility: hidden;
|
|
81
|
+
transform-origin: 0 0; /* see note above */
|
|
82
|
+
}
|
|
83
|
+
.ldio-2oha7mxue8v div { box-sizing: content-box; }
|
|
84
|
+
/* generated by https://loading.io/ */
|
|
85
|
+
}
|