@gx-design-vue/create-gx-cli 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (256) hide show
  1. package/package.json +1 -1
  2. package/src/main.js +1 -0
  3. package/template-design-pro/.editorconfig +19 -0
  4. package/template-design-pro/.env +2 -0
  5. package/template-design-pro/.env.development +18 -0
  6. package/template-design-pro/.env.pro +32 -0
  7. package/template-design-pro/.env.production +32 -0
  8. package/template-design-pro/.env.test +20 -0
  9. package/template-design-pro/.eslintignore +16 -0
  10. package/template-design-pro/.eslintrc.js +64 -0
  11. package/template-design-pro/.gitpod.yml +6 -0
  12. package/template-design-pro/.husky/pre-commit +4 -0
  13. package/template-design-pro/.prettierignore +9 -0
  14. package/template-design-pro/.stylelintignore +3 -0
  15. package/template-design-pro/.yarnclean +48 -0
  16. package/template-design-pro/LICENSE +21 -0
  17. package/template-design-pro/README.md +111 -0
  18. package/template-design-pro/build/constant.ts +6 -0
  19. package/template-design-pro/build/generate/generateModifyVars.ts +18 -0
  20. package/template-design-pro/build/getConfigFileName.ts +13 -0
  21. package/template-design-pro/build/script/buildConf.ts +44 -0
  22. package/template-design-pro/build/script/postBuild.ts +25 -0
  23. package/template-design-pro/build/script/reSetRootHtml.ts +20 -0
  24. package/template-design-pro/build/utils.ts +85 -0
  25. package/template-design-pro/build/vite/cdn.ts +7 -0
  26. package/template-design-pro/build/vite/optimizer.ts +22 -0
  27. package/template-design-pro/build/vite/plugin/autoImport.ts +18 -0
  28. package/template-design-pro/build/vite/plugin/compress.ts +35 -0
  29. package/template-design-pro/build/vite/plugin/hmr.ts +25 -0
  30. package/template-design-pro/build/vite/plugin/html.ts +47 -0
  31. package/template-design-pro/build/vite/plugin/index.ts +89 -0
  32. package/template-design-pro/build/vite/plugin/mock.ts +20 -0
  33. package/template-design-pro/build/vite/plugin/pwa.ts +37 -0
  34. package/template-design-pro/build/vite/plugin/styleImport.ts +129 -0
  35. package/template-design-pro/build/vite/plugin/visualizer.ts +17 -0
  36. package/template-design-pro/build/vite/plugin/vite-plugin-antd-theme/index.ts +24 -0
  37. package/template-design-pro/build/vite/plugin/vite-plugin-mock/createMockServer.ts +303 -0
  38. package/template-design-pro/build/vite/plugin/vite-plugin-mock/createProdMockServer.ts +93 -0
  39. package/template-design-pro/build/vite/plugin/vite-plugin-mock/index.ts +68 -0
  40. package/template-design-pro/build/vite/plugin/vite-plugin-mock/types.ts +30 -0
  41. package/template-design-pro/build/vite/plugin/vite-plugin-mock/utils.ts +26 -0
  42. package/template-design-pro/commitlint.config.js +32 -0
  43. package/template-design-pro/config/config.ts +14 -0
  44. package/template-design-pro/config/default/animate.ts +30 -0
  45. package/template-design-pro/config/default/defaultSettings.ts +75 -0
  46. package/template-design-pro/config/default/network.ts +16 -0
  47. package/template-design-pro/config/default/proxy.ts +26 -0
  48. package/template-design-pro/config/default/theme.ts +43 -0
  49. package/template-design-pro/config/default/themeColor.ts +62 -0
  50. package/template-design-pro/index.html +45 -0
  51. package/template-design-pro/jest.config.mjs +36 -0
  52. package/template-design-pro/mock/_createProductionServer.ts +19 -0
  53. package/template-design-pro/mock/_util.ts +55 -0
  54. package/template-design-pro/mock/controller/menu.ts +85 -0
  55. package/template-design-pro/mock/controller/notices.ts +114 -0
  56. package/template-design-pro/mock/system/dict.ts +60 -0
  57. package/template-design-pro/mock/system/user.ts +218 -0
  58. package/template-design-pro/package.json +151 -0
  59. package/template-design-pro/pnpm-lock.yaml +9913 -0
  60. package/template-design-pro/postcss.config.js +5 -0
  61. package/template-design-pro/prettier.config.js +18 -0
  62. package/template-design-pro/public/resource/css/index.css +171 -0
  63. package/template-design-pro/public/resource/img/favicon.ico +0 -0
  64. package/template-design-pro/public/resource/img/logo.png +0 -0
  65. package/template-design-pro/public/resource/img/pro_icon.svg +5 -0
  66. package/template-design-pro/public/resource/img/pwa-192x192.png +0 -0
  67. package/template-design-pro/public/resource/img/pwa-512x512.png +0 -0
  68. package/template-design-pro/src/App.vue +47 -0
  69. package/template-design-pro/src/assets/error_images/403.png +0 -0
  70. package/template-design-pro/src/assets/error_images/404.png +0 -0
  71. package/template-design-pro/src/assets/error_images/cloud.png +0 -0
  72. package/template-design-pro/src/assets/login_images/login_background.svg +69 -0
  73. package/template-design-pro/src/assets/logo.png +0 -0
  74. package/template-design-pro/src/assets/menu_font/iconfont.css +94 -0
  75. package/template-design-pro/src/assets/menu_font/iconfont.eot +0 -0
  76. package/template-design-pro/src/assets/menu_font/iconfont.js +1 -0
  77. package/template-design-pro/src/assets/menu_font/iconfont.json +142 -0
  78. package/template-design-pro/src/assets/menu_font/iconfont.svg +57 -0
  79. package/template-design-pro/src/assets/menu_font/iconfont.ttf +0 -0
  80. package/template-design-pro/src/assets/menu_font/iconfont.woff +0 -0
  81. package/template-design-pro/src/assets/menu_font/iconfont.woff2 +0 -0
  82. package/template-design-pro/src/assets/menu_font/index.less +94 -0
  83. package/template-design-pro/src/common/global.ts +1 -0
  84. package/template-design-pro/src/components/GDesign/ProLayout/BasicLayout.less +80 -0
  85. package/template-design-pro/src/components/GDesign/ProLayout/BasicLayout.tsx +342 -0
  86. package/template-design-pro/src/components/GDesign/ProLayout/PageLoading.tsx +20 -0
  87. package/template-design-pro/src/components/GDesign/ProLayout/RenderTypings.ts +31 -0
  88. package/template-design-pro/src/components/GDesign/ProLayout/RouteContext.tsx +82 -0
  89. package/template-design-pro/src/components/GDesign/ProLayout/WrapContent.tsx +69 -0
  90. package/template-design-pro/src/components/GDesign/ProLayout/components/GlobalFooter/index.tsx +88 -0
  91. package/template-design-pro/src/components/GDesign/ProLayout/components/GlobalHeader/DefaultHeader.tsx +189 -0
  92. package/template-design-pro/src/components/GDesign/ProLayout/components/GlobalHeader/Header.less +8 -0
  93. package/template-design-pro/src/components/GDesign/ProLayout/components/GlobalHeader/index.tsx +105 -0
  94. package/template-design-pro/src/components/GDesign/ProLayout/components/GlobalHeader/props.ts +69 -0
  95. package/template-design-pro/src/components/GDesign/ProLayout/components/GlobalHeader/style.less +144 -0
  96. package/template-design-pro/src/components/GDesign/ProLayout/components/LogoContent/index.tsx +81 -0
  97. package/template-design-pro/src/components/GDesign/ProLayout/components/LogoContent/props.ts +29 -0
  98. package/template-design-pro/src/components/GDesign/ProLayout/components/MultiTab/index.tsx +384 -0
  99. package/template-design-pro/src/components/GDesign/ProLayout/components/MultiTab/props.ts +15 -0
  100. package/template-design-pro/src/components/GDesign/ProLayout/components/MultiTab/style.less +79 -0
  101. package/template-design-pro/src/components/GDesign/ProLayout/components/NoticeIcon/NoticeIcon.tsx +148 -0
  102. package/template-design-pro/src/components/GDesign/ProLayout/components/NoticeIcon/NoticeList.module.less +115 -0
  103. package/template-design-pro/src/components/GDesign/ProLayout/components/NoticeIcon/NoticeList.tsx +154 -0
  104. package/template-design-pro/src/components/GDesign/ProLayout/components/NoticeIcon/index.less +39 -0
  105. package/template-design-pro/src/components/GDesign/ProLayout/components/NoticeIcon/index.tsx +133 -0
  106. package/template-design-pro/src/components/GDesign/ProLayout/components/PageContainer/index.tsx +190 -0
  107. package/template-design-pro/src/components/GDesign/ProLayout/components/PageContainer/props.ts +48 -0
  108. package/template-design-pro/src/components/GDesign/ProLayout/components/PageContainer/style.less +128 -0
  109. package/template-design-pro/src/components/GDesign/ProLayout/components/PageContainer/typings.ts +0 -0
  110. package/template-design-pro/src/components/GDesign/ProLayout/components/RightContent/AvatarDropdown.tsx +63 -0
  111. package/template-design-pro/src/components/GDesign/ProLayout/components/RightContent/HeaderSearch.tsx +122 -0
  112. package/template-design-pro/src/components/GDesign/ProLayout/components/RightContent/headerSearch.less +30 -0
  113. package/template-design-pro/src/components/GDesign/ProLayout/components/RightContent/index.tsx +95 -0
  114. package/template-design-pro/src/components/GDesign/ProLayout/components/RightContent/style.less +90 -0
  115. package/template-design-pro/src/components/GDesign/ProLayout/components/SettingDrawer/BlockCheckbox.tsx +70 -0
  116. package/template-design-pro/src/components/GDesign/ProLayout/components/SettingDrawer/LayoutSetting.tsx +107 -0
  117. package/template-design-pro/src/components/GDesign/ProLayout/components/SettingDrawer/ThemeColor.tsx +68 -0
  118. package/template-design-pro/src/components/GDesign/ProLayout/components/SettingDrawer/index.tsx +346 -0
  119. package/template-design-pro/src/components/GDesign/ProLayout/components/SiderMenu/BaseMenu.tsx +224 -0
  120. package/template-design-pro/src/components/GDesign/ProLayout/components/SiderMenu/SiderMenu.tsx +224 -0
  121. package/template-design-pro/src/components/GDesign/ProLayout/components/SiderMenu/index.tsx +43 -0
  122. package/template-design-pro/src/components/GDesign/ProLayout/components/SiderMenu/props.ts +112 -0
  123. package/template-design-pro/src/components/GDesign/ProLayout/components/SiderMenu/style.less +262 -0
  124. package/template-design-pro/src/components/GDesign/ProLayout/components/SiderMenu/typings.ts +44 -0
  125. package/template-design-pro/src/components/GDesign/ProLayout/default.less +2 -0
  126. package/template-design-pro/src/components/GDesign/ProLayout/defaultSettings.ts +121 -0
  127. package/template-design-pro/src/components/GDesign/ProLayout/hooks/context/index.ts +45 -0
  128. package/template-design-pro/src/components/GDesign/ProLayout/index.ts +43 -0
  129. package/template-design-pro/src/components/GDesign/ProLayout/props.ts +57 -0
  130. package/template-design-pro/src/components/GDesign/ProLayout/style.less +272 -0
  131. package/template-design-pro/src/components/GDesign/ProLayout/typings.ts +1 -0
  132. package/template-design-pro/src/components/GDesign/ProLayout/utils/getMenuData.ts +31 -0
  133. package/template-design-pro/src/components/GDesign/ProLayout/utils/index.ts +94 -0
  134. package/template-design-pro/src/components/GDesign/ProLayout/utils/isImg/index.ts +6 -0
  135. package/template-design-pro/src/components/GDesign/ProLayout/utils/isUrl/index.ts +5 -0
  136. package/template-design-pro/src/components/GDesign/Result/index.tsx +142 -0
  137. package/template-design-pro/src/components/GDesign/Result/style.less +140 -0
  138. package/template-design-pro/src/components/GDesign/Scrollbars/components/Bar/index.tsx +56 -0
  139. package/template-design-pro/src/components/GDesign/Scrollbars/components/Bar/props.ts +23 -0
  140. package/template-design-pro/src/components/GDesign/Scrollbars/components/Thumb/index.tsx +164 -0
  141. package/template-design-pro/src/components/GDesign/Scrollbars/components/Thumb/props.ts +11 -0
  142. package/template-design-pro/src/components/GDesign/Scrollbars/context.ts +10 -0
  143. package/template-design-pro/src/components/GDesign/Scrollbars/index.tsx +200 -0
  144. package/template-design-pro/src/components/GDesign/Scrollbars/props.ts +65 -0
  145. package/template-design-pro/src/components/GDesign/Scrollbars/style.less +85 -0
  146. package/template-design-pro/src/components/GDesign/Scrollbars/util.ts +40 -0
  147. package/template-design-pro/src/components/GDesign/utils/index.ts +7 -0
  148. package/template-design-pro/src/components/PageLoading/index.tsx +44 -0
  149. package/template-design-pro/src/components/PageTransition/index.vue +98 -0
  150. package/template-design-pro/src/components/index.ts +6 -0
  151. package/template-design-pro/src/core/ant-design/index.ts +14 -0
  152. package/template-design-pro/src/core/gx-admin-design/index.ts +7 -0
  153. package/template-design-pro/src/core/gx-admin-directives/index.ts +8 -0
  154. package/template-design-pro/src/core/gx-admin-directives/permission.ts +28 -0
  155. package/template-design-pro/src/core/gx-design/index.ts +7 -0
  156. package/template-design-pro/src/core/gx-pro-design/index.ts +10 -0
  157. package/template-design-pro/src/core/index.ts +27 -0
  158. package/template-design-pro/src/design/ant-design/index.less +4 -0
  159. package/template-design-pro/src/design/ant-design/layout.less +29 -0
  160. package/template-design-pro/src/design/ant-design/menu.less +55 -0
  161. package/template-design-pro/src/design/ant-design/table.less +67 -0
  162. package/template-design-pro/src/design/ant-design/tooltip.less +13 -0
  163. package/template-design-pro/src/design/color.less +1 -0
  164. package/template-design-pro/src/design/config.less +5 -0
  165. package/template-design-pro/src/design/index.less +41 -0
  166. package/template-design-pro/src/design/mixin.less +66 -0
  167. package/template-design-pro/src/design/normalize.less +390 -0
  168. package/template-design-pro/src/global.less +15 -0
  169. package/template-design-pro/src/hooks/core/index.ts +3 -0
  170. package/template-design-pro/src/hooks/core/useRequest/index.ts +70 -0
  171. package/template-design-pro/src/hooks/core/useRequest/typings.ts +0 -0
  172. package/template-design-pro/src/hooks/event/index.ts +3 -0
  173. package/template-design-pro/src/hooks/event/useClipboard.ts +14 -0
  174. package/template-design-pro/src/hooks/system/index.ts +5 -0
  175. package/template-design-pro/src/hooks/system/useDict.ts +62 -0
  176. package/template-design-pro/src/hooks/system/usePermissions.ts +39 -0
  177. package/template-design-pro/src/hooks/typings.ts +17 -0
  178. package/template-design-pro/src/layout/BasicLayout.vue +104 -0
  179. package/template-design-pro/src/layout/BlankLayout.vue +5 -0
  180. package/template-design-pro/src/layout/ContentView.vue +76 -0
  181. package/template-design-pro/src/layout/IframeView.vue +1 -0
  182. package/template-design-pro/src/layout/UserLayout.vue +7 -0
  183. package/template-design-pro/src/main.ts +34 -0
  184. package/template-design-pro/src/plugins/index.ts +3 -0
  185. package/template-design-pro/src/router/guard/index.ts +84 -0
  186. package/template-design-pro/src/router/guard/permissions.ts +73 -0
  187. package/template-design-pro/src/router/guard/stateGuard.ts +11 -0
  188. package/template-design-pro/src/router/helper/routeHelper.ts +244 -0
  189. package/template-design-pro/src/router/helper/utils.ts +19 -0
  190. package/template-design-pro/src/router/index.ts +30 -0
  191. package/template-design-pro/src/router/routes/index.ts +85 -0
  192. package/template-design-pro/src/router/routes/modules/workplace.ts +19 -0
  193. package/template-design-pro/src/services/common/index.ts +11 -0
  194. package/template-design-pro/src/services/controller/router.ts +10 -0
  195. package/template-design-pro/src/services/controller/user.ts +35 -0
  196. package/template-design-pro/src/services/system/dictData.ts +10 -0
  197. package/template-design-pro/src/services/system/notices.ts +9 -0
  198. package/template-design-pro/src/store/index.ts +32 -0
  199. package/template-design-pro/src/store/modules/dict.ts +27 -0
  200. package/template-design-pro/src/store/modules/permission.ts +19 -0
  201. package/template-design-pro/src/store/modules/routes.ts +110 -0
  202. package/template-design-pro/src/store/modules/settings.ts +102 -0
  203. package/template-design-pro/src/store/modules/tabsRouter.ts +73 -0
  204. package/template-design-pro/src/store/modules/user.ts +153 -0
  205. package/template-design-pro/src/utils/accessToken.ts +93 -0
  206. package/template-design-pro/src/utils/crypto.ts +39 -0
  207. package/template-design-pro/src/utils/env.ts +52 -0
  208. package/template-design-pro/src/utils/fetchFile.ts +79 -0
  209. package/template-design-pro/src/utils/index.ts +127 -0
  210. package/template-design-pro/src/utils/pageTitle.ts +17 -0
  211. package/template-design-pro/src/utils/request/XHR.ts +131 -0
  212. package/template-design-pro/src/utils/request/axiosCancel.ts +60 -0
  213. package/template-design-pro/src/utils/request/checkStatus.ts +26 -0
  214. package/template-design-pro/src/utils/request/index.ts +145 -0
  215. package/template-design-pro/src/utils/request/typings.ts +114 -0
  216. package/template-design-pro/src/utils/storage.ts +194 -0
  217. package/template-design-pro/src/utils/uploadFile.ts +26 -0
  218. package/template-design-pro/src/utils/util.ts +278 -0
  219. package/template-design-pro/src/utils/validate.ts +221 -0
  220. package/template-design-pro/src/views/Iframe/index.vue +76 -0
  221. package/template-design-pro/src/views/MenuOne/index.vue +15 -0
  222. package/template-design-pro/src/views/MenuTwo/index.vue +13 -0
  223. package/template-design-pro/src/views/exception/403/index.vue +9 -0
  224. package/template-design-pro/src/views/exception/404/index.vue +9 -0
  225. package/template-design-pro/src/views/user/login/index.vue +110 -0
  226. package/template-design-pro/src/views/user/login/style.less +38 -0
  227. package/template-design-pro/stylelint.config.js +106 -0
  228. package/template-design-pro/tests/__mocks__/fileMock.ts +1 -0
  229. package/template-design-pro/tests/__mocks__/styleMock.ts +1 -0
  230. package/template-design-pro/tests/__mocks__/workerMock.ts +5 -0
  231. package/template-design-pro/tests/server/README.md +15 -0
  232. package/template-design-pro/tests/server/controller/FileController.ts +18 -0
  233. package/template-design-pro/tests/server/controller/UserController.ts +15 -0
  234. package/template-design-pro/tests/server/ecosystem.config.js +18 -0
  235. package/template-design-pro/tests/server/index.ts +63 -0
  236. package/template-design-pro/tests/server/nodemon.json +8 -0
  237. package/template-design-pro/tests/server/package.json +36 -0
  238. package/template-design-pro/tests/server/routes.ts +23 -0
  239. package/template-design-pro/tests/server/service/FileService.ts +54 -0
  240. package/template-design-pro/tests/server/service/UserService.ts +25 -0
  241. package/template-design-pro/tests/server/tsconfig.json +15 -0
  242. package/template-design-pro/tests/server/utils.ts +9 -0
  243. package/template-design-pro/tests/server/yarn.lock +2955 -0
  244. package/template-design-pro/tests/test.spec.ts +16 -0
  245. package/template-design-pro/tsconfig.json +47 -0
  246. package/template-design-pro/types/auto-imports.d.ts +61 -0
  247. package/template-design-pro/types/config.d.ts +100 -0
  248. package/template-design-pro/types/global.d.ts +103 -0
  249. package/template-design-pro/types/gx-components.d.ts +24 -0
  250. package/template-design-pro/types/index.d.ts +13 -0
  251. package/template-design-pro/types/mock.d.ts +23 -0
  252. package/template-design-pro/types/module.d.ts +16 -0
  253. package/template-design-pro/types/response.d.ts +15 -0
  254. package/template-design-pro/types/route.d.ts +89 -0
  255. package/template-design-pro/vite.config.ts +136 -0
  256. package/template-design-pro/yarn.lock +9697 -0
@@ -0,0 +1,272 @@
1
+ @import './default.less';
2
+
3
+ @import './BasicLayout.less';
4
+ @import './components/GlobalHeader/Header.less';
5
+ @import './components/GlobalHeader/style.less';
6
+ @import './components/RightContent/style.less';
7
+ @import './components/SiderMenu/style.less';
8
+ @import './components/PageContainer/style.less';
9
+ @import './components/MultiTab/style.less';
10
+
11
+ .@{gx-prefix-pro} {
12
+ &-watermark-wrapper {
13
+ position: relative;
14
+ }
15
+
16
+ &-basic-layout {
17
+ .@{gx-prefix-pro} {
18
+ &-header-search {
19
+ display: inline-flex;
20
+ align-items: center;
21
+
22
+ &-input {
23
+ width: 0;
24
+ min-width: 0;
25
+ overflow: hidden;
26
+ background: transparent;
27
+ border-radius: 0;
28
+ transition: width 0.3s, margin-left 0.3s;
29
+
30
+ :global(.ant-select-selection) {
31
+ background: transparent;
32
+ }
33
+
34
+ input {
35
+ box-shadow: none !important;
36
+ }
37
+ }
38
+
39
+ &-show {
40
+ width: 210px;
41
+ margin-left: 8px;
42
+ }
43
+ }
44
+
45
+ &-right-content-action {
46
+ &.gx-pro-header-search {
47
+ padding: 0 12px;
48
+ }
49
+ }
50
+ }
51
+ }
52
+
53
+ &-global-footer {
54
+ padding: 0 16px;
55
+ margin: 48px 0 24px;
56
+ text-align: center;
57
+ }
58
+
59
+ &-global-footer-links {
60
+ margin-bottom: 8px;
61
+
62
+ a {
63
+ color: rgba(0, 0, 0, 0.45);
64
+ transition: all 0.3s;
65
+
66
+ &:not(:last-child) {
67
+ margin-right: 40px;
68
+ }
69
+ }
70
+ }
71
+
72
+ &-global-footer-copyright {
73
+ font-size: 14px;
74
+ color: @text-color-secondary;
75
+
76
+ a {
77
+ color: @text-color-secondary;
78
+
79
+ &:hover {
80
+ color: @text-color-secondary;
81
+ }
82
+ }
83
+ }
84
+
85
+ &-setting-drawer {
86
+ &-handle {
87
+ position: absolute;
88
+ top: 240px;
89
+ right: 300px;
90
+ z-index: 1;
91
+ display: flex;
92
+ align-items: center;
93
+ justify-content: center;
94
+ width: 48px;
95
+ height: 48px;
96
+ font-size: 16px;
97
+ text-align: center;
98
+ pointer-events: auto;
99
+ cursor: pointer;
100
+ background: var(--ant-primary-color);
101
+ border-radius: 4px 0 0 4px;
102
+ }
103
+
104
+ &-content {
105
+ position: relative;
106
+ min-height: 100%;
107
+ padding: 24px;
108
+ }
109
+
110
+ &-title {
111
+ margin-bottom: 12px;
112
+ font-size: 14px;
113
+ line-height: 22px;
114
+ color: rgba(0, 0, 0, 0.85);
115
+ }
116
+
117
+ &-block-checbox {
118
+ display: flex;
119
+
120
+ &-item {
121
+ position: relative;
122
+ width: 44px;
123
+ height: 36px;
124
+ margin-right: 16px;
125
+ overflow: hidden;
126
+ cursor: pointer;
127
+ background-color: #f0f2f5;
128
+ border-radius: 4px;
129
+ box-shadow: 0 1px 2.5px 0 rgb(0 0 0 / 18%);
130
+
131
+ &::before {
132
+ position: absolute;
133
+ top: 0;
134
+ left: 0;
135
+ width: 33%;
136
+ height: 100%;
137
+ content: '';
138
+ background-color: @white;
139
+ }
140
+
141
+ &::after {
142
+ position: absolute;
143
+ top: 0;
144
+ left: 0;
145
+ width: 100%;
146
+ height: 25%;
147
+ content: '';
148
+ background-color: @white;
149
+ }
150
+
151
+ &-light {
152
+ &::before {
153
+ content: '';
154
+ background-color: @white;
155
+ }
156
+
157
+ &::after {
158
+ background-color: @white;
159
+ }
160
+ }
161
+
162
+ &-dark {
163
+ &::before {
164
+ content: '';
165
+ background-color: #001529;
166
+ }
167
+
168
+ &::after {
169
+ background-color: #001529;
170
+ }
171
+ }
172
+
173
+ &-side {
174
+ &::before {
175
+ z-index: 1;
176
+ content: '';
177
+ background-color: #001529;
178
+ }
179
+
180
+ &::after {
181
+ background-color: @white;
182
+ }
183
+ }
184
+
185
+ &-mix {
186
+ &::before {
187
+ content: '';
188
+ background-color: @white;
189
+ }
190
+
191
+ &::after {
192
+ background-color: #001529;
193
+ }
194
+ }
195
+
196
+ &-simple {
197
+ &::before {
198
+ content: '';
199
+ background-color: @white;
200
+ }
201
+
202
+ &::after {
203
+ display: none;
204
+ }
205
+ }
206
+ }
207
+
208
+ &-selectIcon {
209
+ position: absolute;
210
+ right: 6px;
211
+ bottom: 4px;
212
+ font-size: 14px;
213
+ font-weight: 700;
214
+ color: var(--ant-primary-color);
215
+ pointer-events: none;
216
+ }
217
+ }
218
+
219
+ &-theme-color {
220
+ &-content {
221
+ margin-top: 16px;
222
+ overflow: hidden;
223
+ }
224
+
225
+ .gx-pro-setting-drawer-theme-color-block {
226
+ float: left;
227
+ width: 20px;
228
+ height: 20px;
229
+ margin-top: 8px;
230
+ margin-right: 8px;
231
+ font-weight: 700;
232
+ color: @white;
233
+ text-align: center;
234
+ cursor: pointer;
235
+ border-radius: 2px;
236
+ }
237
+ }
238
+ }
239
+
240
+ &-dropdown-container {
241
+ & > * {
242
+ background-color: #fff;
243
+ border-radius: 4px;
244
+ box-shadow: 0 6px 16px -8px rgb(0 0 0 / 8%), 0 9px 28px 0 rgb(0 0 0 / 5%),
245
+ 0 12px 48px 16px rgb(0 0 0 / 3%);
246
+ }
247
+ }
248
+ }
249
+
250
+ @media screen and (max-width: @screen-xs) {
251
+ html {
252
+ body {
253
+ .gx-pro-dropdown-container {
254
+ width: 100% !important;
255
+ }
256
+
257
+ .gx-pro-dropdown-container > * {
258
+ border-radius: 0 !important;
259
+ }
260
+ }
261
+ }
262
+ }
263
+
264
+ @media only screen and (max-width: @screen-md) {
265
+ html {
266
+ body {
267
+ .gx-pro-header-search {
268
+ display: none;
269
+ }
270
+ }
271
+ }
272
+ }
@@ -0,0 +1 @@
1
+ export type ProProps = Record<never, never>
@@ -0,0 +1,31 @@
1
+ export { clearMenuItem, flatMap, getMenuFirstChildren } from './index'
2
+
3
+ export type MenuData = {
4
+ menuData: AppRouteModule[];
5
+ breadcrumb: RecordType;
6
+ };
7
+
8
+ const formatRelativePath = (
9
+ routes: AppRouteModule[],
10
+ breadcrumb: RecordType
11
+ ): AppRouteModule[] => {
12
+ // 计算路由绝对路径
13
+ return routes.map(route => {
14
+ route.path = route.path.replace('//', '/')
15
+ // format children routes
16
+ if (route.children && route.children.length > 0) {
17
+ route.children = formatRelativePath(route.children, breadcrumb)
18
+ }
19
+ breadcrumb[`${route.path}`] = route
20
+ return route
21
+ })
22
+ }
23
+
24
+ export const getMenuData = (routes: AppRouteModule[]): MenuData => {
25
+ const childrenRoute = routes.find(route => route.path === '/')
26
+ const breadcrumb: RecordType = {}
27
+ return {
28
+ menuData: formatRelativePath(childrenRoute?.children || ([] as AppRouteModule[]), breadcrumb),
29
+ breadcrumb
30
+ }
31
+ }
@@ -0,0 +1,94 @@
1
+ export { default as isUrl } from './isUrl'
2
+ export { default as isImg } from './isImg'
3
+
4
+ export function clearMenuItem(menusData: AppRouteModule[]): AppRouteModule[] {
5
+ return menusData
6
+ .map((item: AppRouteModule) => {
7
+ const finalItem = { ...item }
8
+ if (!finalItem.name || finalItem.meta?.hideInMenu) {
9
+ return null
10
+ }
11
+
12
+ if (finalItem && finalItem?.children) {
13
+ if (
14
+ finalItem.children.some(
15
+ (child: AppRouteModule) => child && child.name && !child.meta?.hideInMenu
16
+ )
17
+ ) {
18
+ return {
19
+ ...item,
20
+ children: clearMenuItem(finalItem.children)
21
+ }
22
+ }
23
+ delete finalItem.children
24
+ }
25
+ return finalItem
26
+ })
27
+ .filter(item => item) as AppRouteModule[]
28
+ }
29
+
30
+ export function flatMap(menusData: AppRouteModule[]): AppRouteModule[] {
31
+ return menusData
32
+ .map(item => {
33
+ const finalItem = { ...item } as AppRouteModule
34
+ if (!finalItem.name || finalItem.meta?.hideInMenu) {
35
+ return null
36
+ }
37
+ finalItem.linkPath = getMenuFirstLastChildPath(finalItem.children || [])
38
+
39
+ if (finalItem.children) {
40
+ delete finalItem.children
41
+ }
42
+ return finalItem
43
+ })
44
+ .filter(item => item) as any[]
45
+ }
46
+
47
+ export function getMenuFirstChildren(menus: AppRouteModule[], key?: string) {
48
+ const menuKey = (key || '').split('/').length === 2
49
+ ? (key || '')
50
+ : `/${(key || '').split('/')[1]}`
51
+ return key === undefined
52
+ ? []
53
+ : (menus[menus.findIndex(menu => menu.path === menuKey)] || {}).children || []
54
+ }
55
+
56
+ export function getMenuFirstLastChildPath(data: AppRouteModule[]): string {
57
+ let newPath = ''
58
+ const getRoutePath = function (newdata) {
59
+ let firstPath = ''
60
+ if (newdata.children && newdata.children.length > 0) {
61
+ firstPath = getRoutePath(newdata.children[0])
62
+ } else {
63
+ firstPath = `${newdata.path}`
64
+ }
65
+ return firstPath
66
+ }
67
+ if (data.length > 0 && data[0].children && data[0].children.length > 0) {
68
+ newPath = getRoutePath(data[0].children[0])
69
+ } else {
70
+ newPath = data.length > 0 ? data[0].path : ''
71
+ }
72
+ return newPath
73
+ }
74
+
75
+ export interface Attrs {
76
+ [key: string]: string;
77
+ }
78
+
79
+ export type StringKeyOf<T> = Extract<keyof T, string>;
80
+
81
+ export type EventHandlers<E> = {
82
+ [K in StringKeyOf<E>]?: E[K] extends Function ? E[K] : (payload: E[K]) => void;
83
+ };
84
+
85
+ /**
86
+ * Creates an object composed of the picked object properties.
87
+ * @param obj The source object
88
+ * @param paths The property paths to pick
89
+ */
90
+ export function pick<T, K extends keyof T>(obj: T, paths: K[]): Pick<T, K> {
91
+ return {
92
+ ...paths.reduce((mem, key) => ({ ...mem, [key]: obj[key] }), {}),
93
+ } as Pick<T, K>
94
+ }
@@ -0,0 +1,6 @@
1
+ /** 判断是否是图片链接 */
2
+ function isImg(path: string): boolean {
3
+ return /\w.(png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(path)
4
+ }
5
+
6
+ export default isImg
@@ -0,0 +1,5 @@
1
+ const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/
2
+
3
+ const isUrl = (path: string): boolean => reg.test(path)
4
+
5
+ export default isUrl
@@ -0,0 +1,142 @@
1
+ import { defineComponent, onMounted, reactive, watch, onBeforeUnmount, computed } from 'vue'
2
+ import { Row, Col } from 'ant-design-vue'
3
+ import { useStore } from '@gx-vuex'
4
+ import { useRouter } from 'vue-router'
5
+ import Result403 from '@/assets/error_images/403.png'
6
+ import Result404 from '@/assets/error_images/404.png'
7
+ import ResultCloud from '@/assets/error_images/cloud.png'
8
+ import './style.less'
9
+
10
+ export interface subInfo {
11
+ headline: string
12
+ info: string
13
+ exceptionImage: string
14
+ }
15
+
16
+ interface resultSubInfo {
17
+ 404: subInfo
18
+ 403: subInfo
19
+ }
20
+
21
+ interface resultState {
22
+ jumpTime: number
23
+ oops: string
24
+ headline: string
25
+ info: string
26
+ btn: string
27
+ timer: number | any
28
+ exceptionImage: any
29
+ }
30
+
31
+ const resultSubInfo: resultSubInfo = {
32
+ '404': {
33
+ headline: '当前页面不存在...',
34
+ info: '请检查您输入的网址是否正确,或点击下面的按钮返回首页。',
35
+ exceptionImage: Result404
36
+ },
37
+ '403': {
38
+ headline: '您没有操作角色...',
39
+ info: '当前帐号没有操作角色,请联系管理员。',
40
+ exceptionImage: Result403
41
+ }
42
+ }
43
+
44
+ export default defineComponent({
45
+ props: {
46
+ status: {
47
+ type: String,
48
+ required: true,
49
+ default: '404'
50
+ }
51
+ },
52
+ setup(props) {
53
+ const store = useStore()
54
+ const router = useRouter()
55
+
56
+ const routers = computed(() => store.routes.routes)
57
+
58
+ const backRouter = computed(() => (routers.value?.length ? '/' : '/user/login'))
59
+
60
+ const state = reactive<resultState>({
61
+ jumpTime: 5,
62
+ oops: '抱歉!',
63
+ headline: '您没有操作角色...',
64
+ info: '当前帐号没有操作角色,请联系管理员。',
65
+ btn: `${routers.value?.length ? '返回首页' : '返回登录页'}`,
66
+ timer: 0,
67
+ exceptionImage: Result404
68
+ })
69
+
70
+ onMounted(() => {
71
+ timeChange()
72
+ })
73
+
74
+ onBeforeUnmount(() => {
75
+ clearInterval(state.timer)
76
+ })
77
+
78
+ watch(
79
+ () => props.status,
80
+ (val: string) => {
81
+ Object.keys(resultSubInfo).map((item: string) => {
82
+ if (item === val) {
83
+ Object.keys(resultSubInfo[item]).map((el: any) => {
84
+ state[el] = resultSubInfo[item][el]
85
+ return el
86
+ })
87
+ }
88
+ return item
89
+ })
90
+ },
91
+ {
92
+ deep: true,
93
+ immediate: true
94
+ }
95
+ )
96
+
97
+ const timeChange = () => {
98
+ state.timer = setInterval(() => {
99
+ if (state.jumpTime) {
100
+ state.jumpTime--
101
+ } else {
102
+ handleBackRouter()
103
+ }
104
+ }, 1000)
105
+ }
106
+
107
+ const handleBackRouter = () => {
108
+ router.push({ path: backRouter.value })
109
+ if (routers.value?.length) {
110
+ store.tabsRouter.delOthersVisitedRoutes({ path: '/' })
111
+ } else {
112
+ store.user.resetPermissions()
113
+ }
114
+ clearInterval(state.timer)
115
+ }
116
+
117
+ return () => (
118
+ <div class="error-container">
119
+ <div class="error-content">
120
+ <Row gutter={20}>
121
+ <Col lg={12} md={12} sm={24} xl={12} xs={24}>
122
+ <div class="pic-error">
123
+ <img class="pic-error-parent" src={state.exceptionImage} />
124
+ <img class={['pic-error-child', 'left']} src={ResultCloud} />
125
+ </div>
126
+ </Col>
127
+ <Col lg={12} md={12} sm={24} xl={12} xs={24}>
128
+ <div class="bullshit">
129
+ <div class="bullshit-oops">{state.oops}</div>
130
+ <div class="bullshit-headline">{state.headline}</div>
131
+ <div class="bullshit-info">{state.info}</div>
132
+ <a class="bullshit-return-home" onClick={() => handleBackRouter()}>
133
+ {state.jumpTime}s&nbsp;{state.btn}
134
+ </a>
135
+ </div>
136
+ </Col>
137
+ </Row>
138
+ </div>
139
+ </div>
140
+ )
141
+ }
142
+ })
@@ -0,0 +1,140 @@
1
+ .error-container {
2
+ position: relative;
3
+ height: 100vh;
4
+
5
+ .error-content {
6
+ position: absolute;
7
+ top: 55%;
8
+ left: 50%;
9
+ width: 40vw;
10
+ height: 400px;
11
+ transform: translate(-50%, -50%);
12
+
13
+ .pic-error {
14
+ position: relative;
15
+ float: left;
16
+ width: 100%;
17
+ overflow: hidden;
18
+
19
+ .pic-error-parent {
20
+ width: 100%;
21
+ }
22
+
23
+ .pic-error-child {
24
+ position: absolute;
25
+
26
+ &.left {
27
+ top: 17px;
28
+ left: 220px;
29
+ width: 80px;
30
+ opacity: 0;
31
+ animation-name: cloudLeft;
32
+ animation-duration: 2s;
33
+ animation-timing-function: linear;
34
+ animation-delay: 1s;
35
+ animation-fill-mode: forwards;
36
+ }
37
+
38
+ @keyframes cloudLeft {
39
+ 0% {
40
+ top: 17px;
41
+ left: 220px;
42
+ opacity: 0;
43
+ }
44
+
45
+ 20% {
46
+ top: 33px;
47
+ left: 188px;
48
+ opacity: 1;
49
+ }
50
+
51
+ 80% {
52
+ top: 81px;
53
+ left: 92px;
54
+ opacity: 1;
55
+ }
56
+
57
+ 100% {
58
+ top: 97px;
59
+ left: 60px;
60
+ opacity: 0;
61
+ }
62
+ }
63
+ }
64
+ }
65
+
66
+ .bullshit {
67
+ position: relative;
68
+ float: left;
69
+ width: 300px;
70
+ padding: 30px 0;
71
+ overflow: hidden;
72
+
73
+ .bullshit-oops {
74
+ margin-bottom: 20px;
75
+ font-size: 32px;
76
+ font-weight: bold;
77
+ line-height: 40px;
78
+ opacity: 0;
79
+ animation-name: slideUp;
80
+ animation-duration: 0.5s;
81
+ animation-fill-mode: forwards;
82
+ }
83
+
84
+ .bullshit-headline {
85
+ margin-bottom: 10px;
86
+ font-size: 20px;
87
+ font-weight: bold;
88
+ line-height: 24px;
89
+ color: #222;
90
+ opacity: 0;
91
+ animation-name: slideUp;
92
+ animation-duration: 0.5s;
93
+ animation-delay: 0.1s;
94
+ animation-fill-mode: forwards;
95
+ }
96
+
97
+ .bullshit-info {
98
+ margin-bottom: 30px;
99
+ font-size: 13px;
100
+ line-height: 21px;
101
+ opacity: 0;
102
+ animation-name: slideUp;
103
+ animation-duration: 0.5s;
104
+ animation-delay: 0.2s;
105
+ animation-fill-mode: forwards;
106
+ }
107
+
108
+ .bullshit-return-home {
109
+ display: block;
110
+ float: left;
111
+ width: 110px;
112
+ height: 36px;
113
+ font-size: 14px;
114
+ line-height: 36px;
115
+ color: #fff;
116
+ text-align: center;
117
+ cursor: pointer;
118
+ background: var(--ant-primary-color);
119
+ border-radius: 100px;
120
+ opacity: 0;
121
+ animation-name: slideUp;
122
+ animation-duration: 0.5s;
123
+ animation-delay: 0.3s;
124
+ animation-fill-mode: forwards;
125
+ }
126
+ }
127
+ }
128
+ }
129
+
130
+ @keyframes slideUp {
131
+ 0% {
132
+ opacity: 0;
133
+ transform: translateY(60px);
134
+ }
135
+
136
+ 100% {
137
+ opacity: 1;
138
+ transform: translateY(0);
139
+ }
140
+ }