@yyp92-cli/template-react-pc 2.1.0 → 2.2.0

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.
Files changed (76) hide show
  1. package/package.json +4 -1
  2. package/CHANGELOG.md +0 -55
  3. package/template/.env.development +0 -5
  4. package/template/.env.production +0 -4
  5. package/template/.env.test +0 -4
  6. package/template/.eslintrc.cjs +0 -18
  7. package/template/README.md +0 -15
  8. package/template/index.html +0 -13
  9. package/template/package.json +0 -42
  10. package/template/pnpm-lock.yaml +0 -3570
  11. package/template/public/vite.svg +0 -1
  12. package/template/src/antdTheme/darkTheme.ts +0 -285
  13. package/template/src/antdTheme/lightTheme.ts +0 -286
  14. package/template/src/app.scss +0 -29
  15. package/template/src/app.tsx +0 -14
  16. package/template/src/assets/iconfont/demo.css +0 -539
  17. package/template/src/assets/iconfont/demo_index.html +0 -211
  18. package/template/src/assets/iconfont/iconfont.css +0 -19
  19. package/template/src/assets/iconfont/iconfont.js +0 -1
  20. package/template/src/assets/iconfont/iconfont.json +0 -16
  21. package/template/src/assets/iconfont/iconfont.ttf +0 -0
  22. package/template/src/assets/iconfont/iconfont.woff +0 -0
  23. package/template/src/assets/iconfont/iconfont.woff2 +0 -0
  24. package/template/src/assets/react.svg +0 -1
  25. package/template/src/components/403/index.tsx +0 -22
  26. package/template/src/components/404/index.tsx +0 -24
  27. package/template/src/components/index.ts +0 -3
  28. package/template/src/components/layout/content/index.module.scss +0 -22
  29. package/template/src/components/layout/content/index.tsx +0 -109
  30. package/template/src/components/layout/footer/index.module.scss +0 -12
  31. package/template/src/components/layout/footer/index.tsx +0 -15
  32. package/template/src/components/layout/header/index.module.scss +0 -21
  33. package/template/src/components/layout/header/index.tsx +0 -115
  34. package/template/src/components/layout/index.module.scss +0 -8
  35. package/template/src/components/layout/index.tsx +0 -47
  36. package/template/src/components/layout/side/index.module.scss +0 -31
  37. package/template/src/components/layout/side/index.tsx +0 -109
  38. package/template/src/components/layout-horizontal/content/index.module.scss +0 -22
  39. package/template/src/components/layout-horizontal/content/index.tsx +0 -105
  40. package/template/src/components/layout-horizontal/footer/index.module.scss +0 -12
  41. package/template/src/components/layout-horizontal/footer/index.tsx +0 -15
  42. package/template/src/components/layout-horizontal/header/index.module.scss +0 -23
  43. package/template/src/components/layout-horizontal/header/index.tsx +0 -115
  44. package/template/src/components/layout-horizontal/index.module.scss +0 -8
  45. package/template/src/components/layout-horizontal/index.tsx +0 -48
  46. package/template/src/components/layout-horizontal/side/index.module.scss +0 -32
  47. package/template/src/components/layout-horizontal/side/index.tsx +0 -104
  48. package/template/src/components/login/index.module.scss +0 -23
  49. package/template/src/components/login/index.tsx +0 -133
  50. package/template/src/global/constants.ts +0 -5
  51. package/template/src/pages/home/index.module.scss +0 -0
  52. package/template/src/pages/home/index.tsx +0 -90
  53. package/template/src/router/router.tsx +0 -190
  54. package/template/src/service/api.ts +0 -9
  55. package/template/src/service/config.ts +0 -9
  56. package/template/src/service/index.ts +0 -1
  57. package/template/src/service/request/index.ts +0 -267
  58. package/template/src/service/request/type.ts +0 -5
  59. package/template/src/service/service.ts +0 -27
  60. package/template/src/store/antdToken.ts +0 -35
  61. package/template/src/store/login.ts +0 -38
  62. package/template/src/store/menus.ts +0 -30
  63. package/template/src/store/permission.ts +0 -30
  64. package/template/src/store/token.ts +0 -30
  65. package/template/src/theme/darkTheme.scss +0 -47
  66. package/template/src/theme/lightTheme.scss +0 -49
  67. package/template/src/utils/base64ToBlob.ts +0 -41
  68. package/template/src/utils/cache.ts +0 -44
  69. package/template/src/utils/changeTheme.ts +0 -14
  70. package/template/src/utils/download.ts +0 -45
  71. package/template/src/utils/filterMenu.ts +0 -34
  72. package/template/src/utils/index.ts +0 -5
  73. package/template/src/vite-env.d.ts +0 -5
  74. package/template/tsconfig.json +0 -45
  75. package/template/tsconfig.node.json +0 -10
  76. package/template/vite.config.ts +0 -49
@@ -1,45 +0,0 @@
1
- import {isFunction} from 'lodash-es'
2
-
3
- // 下载文件
4
- export const downloadFile = (
5
- output: any,
6
- downloadFileName: string = '未命名文件',
7
- handleCancel: () => void = () => {}
8
- ) => {
9
- if (!output && isFunction(handleCancel)) {
10
- handleCancel()
11
- return
12
- }
13
-
14
- fetch(output, {responseType: 'blob'} as any)
15
- .then((res: any) => res?.blob?.())
16
- .then((res: any) => {
17
- if ((window?.navigator as any)?.msSaveBlob) {
18
- const suffix = output?.split?.('.')?.pop?.();
19
- downloadFileName = downloadFileName === '未命名文件'
20
- ? downloadFileName + '.' + suffix
21
- : downloadFileName;
22
-
23
- try {
24
- (window?.navigator as any)?.msSaveBlob(res, downloadFileName);
25
- }
26
- catch(e) {
27
-
28
- }
29
- }
30
- else {
31
- const link = document.createElement('a');
32
- link.href = window.URL.createObjectURL(res);
33
- link.download = downloadFileName;
34
- link.style.display = 'none';
35
- document.body.appendChild(link);
36
- link.click();
37
- }
38
- }).catch(e => {
39
- // console.error(e)
40
- // handleCancel()
41
- })
42
- .finally(() => {
43
- isFunction(handleCancel) && handleCancel()
44
- })
45
- }
@@ -1,34 +0,0 @@
1
- /**
2
- * * 根据权限来生成菜单
3
- * @param menu
4
- * @param permissions
5
- * @returns
6
- */
7
- export const filterMenu = (menu: any[], permissions: string[]) => {
8
- const newList: any = []
9
-
10
- menu.forEach((group: any) => {
11
- if (permissions.includes(group.key)) {
12
- const data = {...group}
13
- delete data.hideInMenu
14
- delete data.showFullScreen
15
-
16
- if (Array.isArray(data?.children)) {
17
- const children = data.children
18
- .filter((item: any) => permissions.includes(item.key) && !item?.hideInMenu)
19
- .map((item: any) => {
20
- const newItem = {...item}
21
- delete newItem.hideInMenu
22
- delete newItem.showFullScreen
23
-
24
- return newItem
25
- })
26
- data.children = children
27
- }
28
-
29
- newList.push(data)
30
- }
31
- })
32
-
33
- return newList
34
- }
@@ -1,5 +0,0 @@
1
- export * from './download'
2
- export * from './base64ToBlob'
3
- export * from './cache'
4
- export * from './changeTheme'
5
- export * from './filterMenu'
@@ -1,5 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- // * 为了解决 导入.tsx结尾的组件报错
4
- declare module '*.tsx'
5
- declare module 'loadsh'}
@@ -1,45 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "useDefineForClassFields": true,
5
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
- "module": "ESNext",
7
- "skipLibCheck": true,
8
-
9
- /* Bundler mode */
10
- /*
11
- * 报错:配置文件报错及 React.StrictNode报错:类型“Element”的参数不能赋给类型“ReactNode”的参数
12
- *
13
- * 解决:
14
- * 1.改为node
15
- * 2.删除这行 "resolveJsonModule": true
16
- */
17
- "moduleResolution": "node",
18
-
19
- /*
20
- * import 导入的react报错
21
- * 解决: 增加这行:"esModuleInterop": true,
22
- */
23
- "esModuleInterop": true,
24
- "allowSyntheticDefaultImports": true,
25
- "isolatedModules": true,
26
- "noEmit": true,
27
- "jsx": "react-jsx",
28
-
29
- /* Linting */
30
- "strict": true,
31
- "noUnusedLocals": true,
32
- "noUnusedParameters": true,
33
- "noFallthroughCasesInSwitch": true,
34
-
35
- "baseUrl": ".",
36
- "paths": {
37
- "@/*": ["src/*"],
38
- "@components/*": ["src/components/*"],
39
- "@utils/*": ["src/utils/*"]
40
- // 其他路径别名...
41
- }
42
- },
43
- "include": ["src"],
44
- "references": [{ "path": "./tsconfig.node.json" }]
45
- }
@@ -1,10 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "skipLibCheck": true,
5
- "module": "ESNext",
6
- "moduleResolution": "node",
7
- "allowSyntheticDefaultImports": true
8
- },
9
- "include": ["vite.config.ts"]
10
- }
@@ -1,49 +0,0 @@
1
- import { defineConfig, loadEnv } from 'vite'
2
- import type {ConfigEnv} from 'vite'
3
- import react from '@vitejs/plugin-react'
4
- import path from 'path'
5
-
6
- // https://vitejs.dev/config/
7
- export default defineConfig({
8
- base: './',
9
-
10
- server: {
11
- proxy: {
12
- '/api': {
13
- target: 'https://httpbin.org',
14
- changeOrigin: true,
15
- rewrite: (path) => path.replace(/^\/api/, '')
16
- }
17
- }
18
- },
19
-
20
- build: {
21
- sourcemap: true,
22
- outDir: 'dist'
23
- },
24
-
25
- plugins: [
26
- react()
27
- ],
28
-
29
- css: {
30
- preprocessorOptions: {
31
- scss: {
32
- // 启用现代 API(关键配置)
33
- api: 'modern-compiler'
34
- },
35
- sass: {
36
- // sass 和 scss 都需要配置
37
- api: 'modern-compiler'
38
- }
39
- }
40
- },
41
-
42
- resolve: {
43
- alias: {
44
- // 在这里添加路径别名
45
- '@': path.resolve("./src")
46
- // 其他路径别名...
47
- },
48
- }
49
- })