create-young-proj 1.6.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/README.md +6 -1
  3. package/dist/index.mjs +19 -19
  4. package/package.json +1 -1
  5. package/src/index.ts +6 -1
  6. package/template-admin-server/src/service/role.service.ts +5 -3
  7. package/template-big-screen/.editorconfig +14 -0
  8. package/template-big-screen/.nvmrc +1 -0
  9. package/template-big-screen/.vscode/extensions.json +12 -0
  10. package/template-big-screen/.vscode/settings.json +39 -0
  11. package/template-big-screen/Dockerfile +49 -0
  12. package/template-big-screen/README.md +20 -0
  13. package/template-big-screen/_gitignore +23 -0
  14. package/template-big-screen/_npmrc +2 -0
  15. package/template-big-screen/_nvmrc +1 -0
  16. package/template-big-screen/boot.mjs +16 -0
  17. package/template-big-screen/config/.devrc +1 -0
  18. package/template-big-screen/config/.onlinerc +1 -0
  19. package/template-big-screen/config/.testrc +1 -0
  20. package/template-big-screen/eslint.config.js +34 -0
  21. package/template-big-screen/index.html +48 -0
  22. package/template-big-screen/nitro.config.ts +23 -0
  23. package/template-big-screen/package.json +66 -0
  24. package/template-big-screen/plugins/init.ts +57 -0
  25. package/template-big-screen/public/favicon.svg +3 -0
  26. package/template-big-screen/routes/api/[...all].ts +19 -0
  27. package/template-big-screen/routes/get/env.ts +13 -0
  28. package/template-big-screen/src/App.vue +24 -0
  29. package/template-big-screen/src/apis/get.ts +77 -0
  30. package/template-big-screen/src/apis/index.ts +53 -0
  31. package/template-big-screen/src/apis/post.ts +14 -0
  32. package/template-big-screen/src/assets/data/china.json +1 -0
  33. package/template-big-screen/src/components/YoungCountUp.vue +29 -0
  34. package/template-big-screen/src/components/YoungECharts/config.ts +56 -0
  35. package/template-big-screen/src/components/YoungECharts/index.vue +111 -0
  36. package/template-big-screen/src/components/YoungHeader.vue +54 -0
  37. package/template-big-screen/src/components/YoungSectionContainer.vue +55 -0
  38. package/template-big-screen/src/components/YoungSectionHeader.vue +23 -0
  39. package/template-big-screen/src/composables/breakPoint.ts +20 -0
  40. package/template-big-screen/src/composables/dark.ts +52 -0
  41. package/template-big-screen/src/composables/echarts.ts +17 -0
  42. package/template-big-screen/src/composables/loadData.ts +38 -0
  43. package/template-big-screen/src/directives/ellipsis.ts +20 -0
  44. package/template-big-screen/src/directives/index.ts +13 -0
  45. package/template-big-screen/src/enums/breakpointEnum.ts +9 -0
  46. package/template-big-screen/src/layouts/404.vue +19 -0
  47. package/template-big-screen/src/layouts/blank.vue +9 -0
  48. package/template-big-screen/src/layouts/default.vue +17 -0
  49. package/template-big-screen/src/main.ts +59 -0
  50. package/template-big-screen/src/modules/index.ts +8 -0
  51. package/template-big-screen/src/modules/pinia.ts +11 -0
  52. package/template-big-screen/src/modules/router.ts +28 -0
  53. package/template-big-screen/src/pages/[...all].vue +16 -0
  54. package/template-big-screen/src/pages/electricity/build.vue +135 -0
  55. package/template-big-screen/src/pages/electricity/reliability.vue +137 -0
  56. package/template-big-screen/src/pages/electricity/sale-and-cost.vue +158 -0
  57. package/template-big-screen/src/pages/index.vue +59 -0
  58. package/template-big-screen/src/pages/kpi.vue +129 -0
  59. package/template-big-screen/src/pages/manage-improve.vue +114 -0
  60. package/template-big-screen/src/pages/social/condition.vue +202 -0
  61. package/template-big-screen/src/pages/social/electricity-usage.vue +140 -0
  62. package/template-big-screen/src/styles/index.scss +82 -0
  63. package/template-big-screen/tsconfig.json +38 -0
  64. package/template-big-screen/types/auto-imports.d.ts +949 -0
  65. package/template-big-screen/types/components.d.ts +19 -0
  66. package/template-big-screen/types/echarts.d.ts +36 -0
  67. package/template-big-screen/types/index.d.ts +45 -0
  68. package/template-big-screen/types/type.d.ts +38 -0
  69. package/template-big-screen/uno.config.ts +68 -0
  70. package/template-big-screen/vite.config.ts +131 -0
  71. package/template-big-screen/yarn.lock +7443 -0
  72. package/template-nuxt-admin/README.md +3 -3
  73. package/template-nuxt-admin/boot.mjs +4 -1
  74. package/template-nuxt-admin/composables/config.ts +2 -2
  75. package/template-nuxt-admin/config/.devrc +1 -1
  76. package/template-nuxt-admin/config/.onlinerc +1 -1
  77. package/template-nuxt-admin/config/.testrc +1 -1
  78. package/template-nuxt-admin/nuxt.config.ts +14 -5
  79. package/template-nuxt-admin/package.json +12 -11
  80. package/template-nuxt-admin/pages/system/api.vue +6 -6
  81. package/template-nuxt-admin/pages/system/role.vue +4 -4
  82. package/template-nuxt-admin/pages/system/user.vue +4 -4
  83. package/template-nuxt-admin/server/api/[...all].ts +10 -3
  84. package/template-nuxt-admin/server/plugins/env.ts +5 -4
  85. package/template-nuxt-admin/uno.config.ts +1 -9
  86. package/template-nuxt-admin/yarn.lock +3659 -3363
  87. package/template-nuxt-mobile/package.json +1 -0
  88. package/template-nuxt-mobile/server/utils/proxy.ts +1 -30
  89. package/template-nuxt-mobile/yarn.lock +9 -0
  90. package/template-nuxt-website/package.json +1 -0
  91. package/template-nuxt-website/server/utils/proxy.ts +1 -30
  92. package/template-nuxt-website/yarn.lock +9 -0
  93. package/template-uni-app/README.md +6 -1
  94. package/template-uni-app/_env +2 -1
  95. package/template-uni-app/auto-imports.d.ts +0 -4
  96. package/template-uni-app/custom-plugins/multiconf.ts +13 -1
  97. package/template-uni-app/package.json +17 -17
  98. package/template-uni-app/pnpm-lock.yaml +565 -985
  99. package/template-uni-app/src/App.vue +11 -1
  100. package/template-uni-app/src/apis/index.ts +9 -2
  101. package/template-uni-app/src/components/young-loading/young-loading.vue +4 -2
  102. package/template-uni-app/src/env.d.ts +7 -2
  103. package/template-uni-app/src/utils/auth.ts +24 -1
  104. package/template-uni-app/src/utils/index.ts +1 -2
  105. package/template-uni-app/src/utils/system.ts +6 -1
  106. package/template-nuxt-admin/server/utils/index.ts +0 -36
  107. package/template-uni-app/src/utils/map.ts +0 -98
@@ -17,6 +17,7 @@
17
17
  "@bluesyoung/logger": "^0.0.1",
18
18
  "@bluesyoung/utils": "^0.2.1",
19
19
  "c12": "^1.4.2",
20
+ "h3-proxy": "^1.12.0",
20
21
  "http-proxy": "^1.18.1"
21
22
  },
22
23
  "devDependencies": {
@@ -1,40 +1,11 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-09-27 11:22:08
4
- * @LastEditTime: 2023-11-01 19:10:45
4
+ * @LastEditTime: 2024-03-08 15:04:57
5
5
  * @Description:
6
6
  */
7
- import type { ServerOptions as HTTPProxyOptions } from 'http-proxy'
8
- import ProxyModule from 'http-proxy'
9
7
  import type { H3Event } from 'h3'
10
8
 
11
- /**
12
- * @param target 接口代理的具体地址
13
- * @param defaults 代理配置
14
- * @example
15
- * export default defineEventHandler(async (event) => {
16
- * const proxy = createTransparentProxy(`http://127.0.0.1:3333`);
17
- * await proxy.handle(event);
18
- * });
19
- */
20
- export function createTransparentProxy(target: string, defaults: HTTPProxyOptions = {}) {
21
- const proxy = ProxyModule.createProxy()
22
- const handle = (event: H3Event, opts: HTTPProxyOptions = {}) => {
23
- return new Promise<void>((resolve, reject) => {
24
- proxy.web(event.node.req, event.node.res, { target, ...defaults, ...opts }, (error: any) => {
25
- if (error.code !== 'ECONNRESET')
26
- reject(error)
27
-
28
- resolve()
29
- })
30
- })
31
- }
32
- return {
33
- proxy,
34
- handle,
35
- }
36
- }
37
-
38
9
  /**
39
10
  * 服务端发送的请求
40
11
  */
@@ -4232,6 +4232,15 @@ gzip-size@^7.0.0:
4232
4232
  dependencies:
4233
4233
  duplexer "^0.1.2"
4234
4234
 
4235
+ h3-proxy@^1.12.0:
4236
+ version "1.12.0"
4237
+ resolved "https://registry.npmmirror.com/h3-proxy/-/h3-proxy-1.12.0.tgz#2a25c6df3fae63e8a1183ba234cd100038e0d4ca"
4238
+ integrity sha512-nvYRfRVPyU2Nt3Z5gZoAPp8swUH6XTltV6mRQUnTJHc9UulYcCVyQCZX32tJdGESDvurE18WtjXT8sWWioCzFw==
4239
+ dependencies:
4240
+ consola "^3.2.3"
4241
+ is-glob "^4.0.3"
4242
+ micromatch "^4.0.5"
4243
+
4235
4244
  h3@^1.6.6, h3@^1.8.1, h3@^1.8.2:
4236
4245
  version "1.8.2"
4237
4246
  resolved "https://registry.npmmirror.com/h3/-/h3-1.8.2.tgz#69ea8ca0285c1bb268cd08b9a7017e02939f88b7"
@@ -16,6 +16,7 @@
16
16
  "@bluesyoung/logger": "^0.0.1",
17
17
  "@bluesyoung/utils": "^0.2.1",
18
18
  "c12": "^1.4.2",
19
+ "h3-proxy": "^1.12.0",
19
20
  "http-proxy": "^1.18.1"
20
21
  },
21
22
  "devDependencies": {
@@ -1,40 +1,11 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-09-27 11:22:08
4
- * @LastEditTime: 2023-11-01 19:10:45
4
+ * @LastEditTime: 2024-03-08 15:05:53
5
5
  * @Description:
6
6
  */
7
- import type { ServerOptions as HTTPProxyOptions } from 'http-proxy'
8
- import ProxyModule from 'http-proxy'
9
7
  import type { H3Event } from 'h3'
10
8
 
11
- /**
12
- * @param target 接口代理的具体地址
13
- * @param defaults 代理配置
14
- * @example
15
- * export default defineEventHandler(async (event) => {
16
- * const proxy = createTransparentProxy(`http://127.0.0.1:3333`);
17
- * await proxy.handle(event);
18
- * });
19
- */
20
- export function createTransparentProxy(target: string, defaults: HTTPProxyOptions = {}) {
21
- const proxy = ProxyModule.createProxy()
22
- const handle = (event: H3Event, opts: HTTPProxyOptions = {}) => {
23
- return new Promise<void>((resolve, reject) => {
24
- proxy.web(event.node.req, event.node.res, { target, ...defaults, ...opts }, (error: any) => {
25
- if (error.code !== 'ECONNRESET')
26
- reject(error)
27
-
28
- resolve()
29
- })
30
- })
31
- }
32
- return {
33
- proxy,
34
- handle,
35
- }
36
- }
37
-
38
9
  /**
39
10
  * 服务端发送的请求
40
11
  */
@@ -4146,6 +4146,15 @@ gzip-size@^7.0.0:
4146
4146
  dependencies:
4147
4147
  duplexer "^0.1.2"
4148
4148
 
4149
+ h3-proxy@^1.12.0:
4150
+ version "1.12.0"
4151
+ resolved "https://registry.npmmirror.com/h3-proxy/-/h3-proxy-1.12.0.tgz#2a25c6df3fae63e8a1183ba234cd100038e0d4ca"
4152
+ integrity sha512-nvYRfRVPyU2Nt3Z5gZoAPp8swUH6XTltV6mRQUnTJHc9UulYcCVyQCZX32tJdGESDvurE18WtjXT8sWWioCzFw==
4153
+ dependencies:
4154
+ consola "^3.2.3"
4155
+ is-glob "^4.0.3"
4156
+ micromatch "^4.0.5"
4157
+
4149
4158
  h3@^1.6.6, h3@^1.8.1, h3@^1.8.2:
4150
4159
  version "1.8.2"
4151
4160
  resolved "https://registry.npmmirror.com/h3/-/h3-1.8.2.tgz#69ea8ca0285c1bb268cd08b9a7017e02939f88b7"
@@ -93,4 +93,9 @@ npm i -g young-commit
93
93
 
94
94
  2. 创建对应的 `.env.{mode}` 文件
95
95
 
96
- 3. 代码中使用 `import.meta.env.{变量名}` 直接读取使用
96
+ 3. 代码中使用 `import.meta.env.{变量名}` 直接读取使用
97
+
98
+
99
+ ## 注意!!!
100
+
101
+ **`APP` 必须配置 `VITE_API_BASE_URL` 的环境变量用以接口请求**
@@ -1,3 +1,4 @@
1
1
  # 此处存放公共配置
2
- VITE_APPID = tochangetowxappid_dev
2
+ VITE_APPID = tochangetoappid_dev
3
+ VITE_APPNAME = tochangetoappname
3
4
  VITE_CUSTOM_LOADING = true
@@ -423,7 +423,6 @@ declare module 'vue' {
423
423
  readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
424
424
  readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
425
425
  readonly fingerPrintAuth: UnwrapRef<typeof import('./src/utils/auth')['fingerPrintAuth']>
426
- readonly geocoderLocation: UnwrapRef<typeof import('./src/utils/map')['geocoderLocation']>
427
426
  readonly getActivePinia: UnwrapRef<typeof import('pinia')['getActivePinia']>
428
427
  readonly getAuthInfo: UnwrapRef<typeof import('./src/utils/auth')['getAuthInfo']>
429
428
  readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
@@ -516,7 +515,6 @@ declare module 'vue' {
516
515
  readonly resolveRef: UnwrapRef<typeof import('@vueuse/core')['resolveRef']>
517
516
  readonly resolveUnref: UnwrapRef<typeof import('@vueuse/core')['resolveUnref']>
518
517
  readonly route: UnwrapRef<typeof import('./src/utils/route')['route']>
519
- readonly searchLoaction: UnwrapRef<typeof import('./src/utils/map')['searchLoaction']>
520
518
  readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
521
519
  readonly setLocationInfo: UnwrapRef<typeof import('./src/store/local/index')['setLocationInfo']>
522
520
  readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
@@ -796,7 +794,6 @@ declare module '@vue/runtime-core' {
796
794
  readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
797
795
  readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
798
796
  readonly fingerPrintAuth: UnwrapRef<typeof import('./src/utils/auth')['fingerPrintAuth']>
799
- readonly geocoderLocation: UnwrapRef<typeof import('./src/utils/map')['geocoderLocation']>
800
797
  readonly getActivePinia: UnwrapRef<typeof import('pinia')['getActivePinia']>
801
798
  readonly getAuthInfo: UnwrapRef<typeof import('./src/utils/auth')['getAuthInfo']>
802
799
  readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
@@ -889,7 +886,6 @@ declare module '@vue/runtime-core' {
889
886
  readonly resolveRef: UnwrapRef<typeof import('@vueuse/core')['resolveRef']>
890
887
  readonly resolveUnref: UnwrapRef<typeof import('@vueuse/core')['resolveUnref']>
891
888
  readonly route: UnwrapRef<typeof import('./src/utils/route')['route']>
892
- readonly searchLoaction: UnwrapRef<typeof import('./src/utils/map')['searchLoaction']>
893
889
  readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
894
890
  readonly setLocationInfo: UnwrapRef<typeof import('./src/store/local/index')['setLocationInfo']>
895
891
  readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-19 14:32:45
4
- * @LastEditTime: 2023-11-16 09:57:41
4
+ * @LastEditTime: 2024-02-01 11:29:08
5
5
  * @Description:
6
6
  */
7
7
  import type { Plugin } from 'vite'
@@ -22,6 +22,9 @@ export function multiConf(env: string) {
22
22
  },
23
23
  generateBundle(options, bundle) {
24
24
  const appid = configEnv.VITE_APPID
25
+ const appname = configEnv.VITE_APPNAME
26
+
27
+ // 微信小程序
25
28
  const json = bundle['project.config.json'] as OutputAsset
26
29
  if (json?.source && typeof json.source === 'string') {
27
30
  const jsonConf = JSON.parse(json.source)
@@ -80,6 +83,15 @@ export function multiConf(env: string) {
80
83
 
81
84
  app.source = JSON.stringify(appConf, null, 2)
82
85
  }
86
+
87
+ // APP
88
+ const manifest = bundle['manifest.json'] as OutputAsset
89
+ if (manifest?.source && typeof manifest.source === 'string') {
90
+ const manifestConf = JSON.parse(manifest.source)
91
+ manifestConf.id = appid
92
+ manifestConf.name = appname
93
+ manifest.source = JSON.stringify(manifestConf, null, 2)
94
+ }
83
95
  },
84
96
  } as Plugin
85
97
  }
@@ -47,19 +47,19 @@
47
47
  "dependencies": {
48
48
  "@bluesyoung/http": "^1.2.0",
49
49
  "@bluesyoung/utils": "^0.2.1",
50
- "@dcloudio/uni-app": "3.0.0-3080720230703001",
51
- "@dcloudio/uni-app-plus": "3.0.0-3080720230703001",
52
- "@dcloudio/uni-components": "3.0.0-3080720230703001",
53
- "@dcloudio/uni-h5": "3.0.0-3080720230703001",
54
- "@dcloudio/uni-mp-alipay": "3.0.0-3080720230703001",
55
- "@dcloudio/uni-mp-baidu": "3.0.0-3080720230703001",
56
- "@dcloudio/uni-mp-jd": "3.0.0-3080720230703001",
57
- "@dcloudio/uni-mp-kuaishou": "3.0.0-3080720230703001",
58
- "@dcloudio/uni-mp-lark": "3.0.0-3080720230703001",
59
- "@dcloudio/uni-mp-qq": "3.0.0-3080720230703001",
60
- "@dcloudio/uni-mp-toutiao": "3.0.0-3080720230703001",
61
- "@dcloudio/uni-mp-weixin": "3.0.0-3080720230703001",
62
- "@dcloudio/uni-quickapp-webview": "3.0.0-3080720230703001",
50
+ "@dcloudio/uni-app": "3.0.0-3090920231225001",
51
+ "@dcloudio/uni-app-plus": "3.0.0-3090920231225001",
52
+ "@dcloudio/uni-components": "3.0.0-3090920231225001",
53
+ "@dcloudio/uni-h5": "3.0.0-3090920231225001",
54
+ "@dcloudio/uni-mp-alipay": "3.0.0-3090920231225001",
55
+ "@dcloudio/uni-mp-baidu": "3.0.0-3090920231225001",
56
+ "@dcloudio/uni-mp-jd": "3.0.0-3090920231225001",
57
+ "@dcloudio/uni-mp-kuaishou": "3.0.0-3090920231225001",
58
+ "@dcloudio/uni-mp-lark": "3.0.0-3090920231225001",
59
+ "@dcloudio/uni-mp-qq": "3.0.0-3090920231225001",
60
+ "@dcloudio/uni-mp-toutiao": "3.0.0-3090920231225001",
61
+ "@dcloudio/uni-mp-weixin": "3.0.0-3090920231225001",
62
+ "@dcloudio/uni-quickapp-webview": "3.0.0-3090920231225001",
63
63
  "@uni-helper/uni-use": "^0.17.1",
64
64
  "@vueuse/core": "9",
65
65
  "dayjs": "^1.11.10",
@@ -78,11 +78,11 @@
78
78
  "devDependencies": {
79
79
  "@antfu/eslint-config": "^1.1.2",
80
80
  "@dcloudio/types": "^3.4.3",
81
- "@dcloudio/uni-automator": "3.0.0-3080720230703001",
82
- "@dcloudio/uni-cli-shared": "3.0.0-3080720230703001",
83
- "@dcloudio/uni-stacktracey": "3.0.0-3080720230703001",
81
+ "@dcloudio/uni-automator": "3.0.0-3090920231225001",
82
+ "@dcloudio/uni-cli-shared": "3.0.0-3090920231225001",
83
+ "@dcloudio/uni-stacktracey": "3.0.0-3090920231225001",
84
84
  "@dcloudio/uni-ui": "^1.4.28",
85
- "@dcloudio/vite-plugin-uni": "3.0.0-3080720230703001",
85
+ "@dcloudio/vite-plugin-uni": "3.0.0-3090920231225001",
86
86
  "@types/md5": "^2.3.5",
87
87
  "@uni-helper/pages-json-schema": "^0.2.12",
88
88
  "@uni-helper/uni-app-types": "^0.5.8",