create-young-proj 0.13.0 → 1.1.0-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (198) hide show
  1. package/.editorconfig +14 -0
  2. package/.vscode/settings.json +39 -0
  3. package/CHANGELOG.md +256 -0
  4. package/README.md +38 -25
  5. package/build.config.ts +22 -0
  6. package/eslint.config.js +35 -0
  7. package/package.json +10 -15
  8. package/src/index.ts +366 -0
  9. package/template-admin-server/_nvmrc +1 -0
  10. package/template-nuxt-admin/.vscode/settings.json +20 -6
  11. package/template-nuxt-admin/Dockerfile +3 -3
  12. package/template-nuxt-admin/README.md +23 -16
  13. package/template-nuxt-admin/_nvmrc +1 -0
  14. package/template-nuxt-admin/app.vue +10 -2
  15. package/template-nuxt-admin/boot.mjs +7 -7
  16. package/template-nuxt-admin/components/TopSearch.vue +1 -2
  17. package/template-nuxt-admin/components/YoungChangePassword.vue +2 -5
  18. package/template-nuxt-admin/components/YoungCodeInput.vue +1 -2
  19. package/template-nuxt-admin/components/YoungEditor.vue +81 -0
  20. package/template-nuxt-admin/components/ZenMode.vue +21 -0
  21. package/template-nuxt-admin/components/layout/NavBar.vue +3 -2
  22. package/template-nuxt-admin/composables/api.ts +7 -15
  23. package/template-nuxt-admin/composables/icon.ts +1 -3
  24. package/template-nuxt-admin/composables/nav.ts +11 -1
  25. package/template-nuxt-admin/composables/user.ts +3 -1
  26. package/template-nuxt-admin/env.d.ts +8 -8
  27. package/template-nuxt-admin/eslint.config.js +33 -0
  28. package/template-nuxt-admin/layouts/default.vue +45 -7
  29. package/template-nuxt-admin/middleware/auth.global.ts +2 -5
  30. package/template-nuxt-admin/nuxt.config.ts +21 -21
  31. package/template-nuxt-admin/package.json +8 -9
  32. package/template-nuxt-admin/pages/system/api.vue +1 -3
  33. package/template-nuxt-admin/pages/system/hooks/useRole.ts +1 -8
  34. package/template-nuxt-admin/pages/system/menuList.vue +4 -6
  35. package/template-nuxt-admin/pages/system/role.vue +1 -2
  36. package/template-nuxt-admin/pages/system/user.vue +1 -3
  37. package/template-nuxt-admin/public/index.umd.js +74 -0
  38. package/template-nuxt-admin/public/index.umd.js.map +1 -0
  39. package/template-nuxt-admin/server/plugins/env.ts +3 -2
  40. package/template-nuxt-admin/server/utils/index.ts +1 -1
  41. package/template-nuxt-admin/typings/global.d.ts +6 -6
  42. package/template-nuxt-admin/typings/system.d.ts +55 -54
  43. package/template-nuxt-admin/typings/user.d.ts +12 -12
  44. package/template-nuxt-admin/utils/tool.ts +4 -8
  45. package/template-nuxt-admin/yarn.lock +1913 -2002
  46. package/template-nuxt-website/.nvmrc +1 -0
  47. package/template-nuxt-website/.vscode/extensions.json +12 -0
  48. package/template-nuxt-website/.vscode/settings.json +39 -0
  49. package/template-nuxt-website/Dockerfile +41 -0
  50. package/template-nuxt-website/README.md +117 -0
  51. package/template-nuxt-website/_gitignore +26 -0
  52. package/template-nuxt-website/_npmrc +2 -0
  53. package/template-nuxt-website/_nvmrc +1 -0
  54. package/template-nuxt-website/app.vue +66 -0
  55. package/template-nuxt-website/assets/tabbar/event.png +0 -0
  56. package/template-nuxt-website/assets/tabbar/event_active.png +0 -0
  57. package/template-nuxt-website/assets/tabbar/game.png +0 -0
  58. package/template-nuxt-website/assets/tabbar/game_active.png +0 -0
  59. package/template-nuxt-website/assets/tabbar/shop.png +0 -0
  60. package/template-nuxt-website/assets/tabbar/shop_active.png +0 -0
  61. package/template-nuxt-website/assets/tabbar/user.png +0 -0
  62. package/template-nuxt-website/assets/tabbar/user_active.png +0 -0
  63. package/template-nuxt-website/boot.mjs +16 -0
  64. package/template-nuxt-website/components/AboutNav.vue +27 -0
  65. package/template-nuxt-website/components/BreadNav.vue +35 -0
  66. package/template-nuxt-website/components/Follow.vue +48 -0
  67. package/template-nuxt-website/components/FriendLink.vue +36 -0
  68. package/template-nuxt-website/components/mobile/NavBar.vue +50 -0
  69. package/template-nuxt-website/components/top/Extra.vue +50 -0
  70. package/template-nuxt-website/components/top/Nav.vue +87 -0
  71. package/template-nuxt-website/components/young/Banner.vue +100 -0
  72. package/template-nuxt-website/components/young/Footer.vue +44 -0
  73. package/template-nuxt-website/components/young/Header.vue +25 -0
  74. package/template-nuxt-website/components/young/Tabbar.vue +76 -0
  75. package/template-nuxt-website/composables/ad.ts +20 -0
  76. package/template-nuxt-website/composables/config.ts +11 -0
  77. package/template-nuxt-website/composables/nav.ts +30 -0
  78. package/template-nuxt-website/composables/share.ts +22 -0
  79. package/template-nuxt-website/composables/utils.ts +84 -0
  80. package/template-nuxt-website/config/.devrc +11 -0
  81. package/template-nuxt-website/config/.onlinerc +13 -0
  82. package/template-nuxt-website/config/.testrc +11 -0
  83. package/template-nuxt-website/env.d.ts +55 -0
  84. package/template-nuxt-website/error.vue +69 -0
  85. package/template-nuxt-website/eslint.config.js +34 -0
  86. package/template-nuxt-website/layouts/default.vue +80 -0
  87. package/template-nuxt-website/layouts/home.vue +75 -0
  88. package/template-nuxt-website/layouts/tabbar.vue +78 -0
  89. package/template-nuxt-website/nuxt.config.ts +98 -0
  90. package/template-nuxt-website/package.json +41 -0
  91. package/template-nuxt-website/pages/index.html.vue +16 -0
  92. package/template-nuxt-website/pages/index.vue +29 -0
  93. package/template-nuxt-website/pages/match.html.vue +23 -0
  94. package/template-nuxt-website/pages/news/[id].html.vue +57 -0
  95. package/template-nuxt-website/pages/news.html.vue +26 -0
  96. package/template-nuxt-website/pages/shop.html.vue +26 -0
  97. package/template-nuxt-website/public/favicon.ico +0 -0
  98. package/template-nuxt-website/public/robots.txt +2 -0
  99. package/template-nuxt-website/public/svg/image_placeholder.svg +15 -0
  100. package/template-nuxt-website/server/api/get_footer_info.get.ts +52 -0
  101. package/template-nuxt-website/server/api/get_gray_status.get.ts +38 -0
  102. package/template-nuxt-website/server/api/get_head_nav.get.ts +38 -0
  103. package/template-nuxt-website/server/api/get_home_banner.get.ts +28 -0
  104. package/template-nuxt-website/server/api/get_seo_info.get.ts +32 -0
  105. package/template-nuxt-website/server/middleware/platform.ts +11 -0
  106. package/template-nuxt-website/server/plugins/init.ts +147 -0
  107. package/template-nuxt-website/server/tsconfig.json +3 -0
  108. package/template-nuxt-website/server/utils/index.ts +12 -0
  109. package/template-nuxt-website/server/utils/proxy.ts +59 -0
  110. package/template-nuxt-website/tsconfig.json +4 -0
  111. package/template-nuxt-website/typings/banner.d.ts +30 -0
  112. package/template-nuxt-website/typings/nav.d.ts +34 -0
  113. package/template-nuxt-website/typings/system.d.ts +22 -0
  114. package/template-nuxt-website/uno.config.ts +40 -0
  115. package/template-nuxt-website/utils/tool.ts +171 -0
  116. package/template-nuxt-website/yarn.lock +8018 -0
  117. package/template-uni-app/.vscode/settings.json +20 -6
  118. package/template-uni-app/README.md +5 -0
  119. package/template-uni-app/_nvmrc +1 -0
  120. package/template-uni-app/eslint.config.js +35 -0
  121. package/template-uni-app/package.json +22 -21
  122. package/template-uni-app/pnpm-lock.yaml +2557 -1543
  123. package/template-uni-app/src/env.d.ts +6 -6
  124. package/template-uni-app/src/typings/global.d.ts +1 -1
  125. package/template-uni-app/src/utils/modal.ts +2 -2
  126. package/template-uni-app/tsconfig.json +3 -3
  127. package/tsconfig.json +11 -0
  128. package/dist/index.mjs +0 -51
  129. package/template-nuxt-admin/.eslintrc +0 -14
  130. package/template-uni-app/.vscode/.server-controller-port.log +0 -5
  131. package/template-uni-app/dist/dev/mp-weixin/apis/index.js +0 -43
  132. package/template-uni-app/dist/dev/mp-weixin/apis/requests/get.js +0 -10
  133. package/template-uni-app/dist/dev/mp-weixin/apis/requests/index.js +0 -1
  134. package/template-uni-app/dist/dev/mp-weixin/apis/requests/post.js +0 -15
  135. package/template-uni-app/dist/dev/mp-weixin/app.js +0 -92
  136. package/template-uni-app/dist/dev/mp-weixin/app.json +0 -51
  137. package/template-uni-app/dist/dev/mp-weixin/app.wxss +0 -2378
  138. package/template-uni-app/dist/dev/mp-weixin/common/assets.js +0 -13
  139. package/template-uni-app/dist/dev/mp-weixin/common/vendor.js +0 -9166
  140. package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.js +0 -22
  141. package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.json +0 -4
  142. package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.wxml +0 -1
  143. package/template-uni-app/dist/dev/mp-weixin/components/young-loading/young-loading.wxss +0 -0
  144. package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.js +0 -22
  145. package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.json +0 -4
  146. package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.wxml +0 -1
  147. package/template-uni-app/dist/dev/mp-weixin/components/young-loading-mini/young-loading-mini.wxss +0 -0
  148. package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.js +0 -81
  149. package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.json +0 -4
  150. package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxml +0 -1
  151. package/template-uni-app/dist/dev/mp-weixin/components/young-navbar/young-navbar.wxss +0 -108
  152. package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.js +0 -55
  153. package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.json +0 -4
  154. package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxml +0 -1
  155. package/template-uni-app/dist/dev/mp-weixin/components/young-tabbar/young-tabbar.wxss +0 -88
  156. package/template-uni-app/dist/dev/mp-weixin/config/enum.js +0 -21
  157. package/template-uni-app/dist/dev/mp-weixin/config/index.js +0 -1
  158. package/template-uni-app/dist/dev/mp-weixin/config/map.js +0 -1
  159. package/template-uni-app/dist/dev/mp-weixin/layouts/default.js +0 -29
  160. package/template-uni-app/dist/dev/mp-weixin/layouts/default.json +0 -6
  161. package/template-uni-app/dist/dev/mp-weixin/layouts/default.wxml +0 -1
  162. package/template-uni-app/dist/dev/mp-weixin/layouts/default.wxss +0 -0
  163. package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.js +0 -56
  164. package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.json +0 -9
  165. package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxml +0 -1
  166. package/template-uni-app/dist/dev/mp-weixin/layouts/tabbar.wxss +0 -0
  167. package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.js +0 -98
  168. package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.json +0 -4
  169. package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxml +0 -1
  170. package/template-uni-app/dist/dev/mp-weixin/node-modules/@dcloudio/uni-ui/lib/uni-card/uni-card.wxss +0 -125
  171. package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.js +0 -37
  172. package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.json +0 -5
  173. package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxml +0 -1
  174. package/template-uni-app/dist/dev/mp-weixin/pages/demo/index.wxss +0 -0
  175. package/template-uni-app/dist/dev/mp-weixin/pages/index.js +0 -50
  176. package/template-uni-app/dist/dev/mp-weixin/pages/index.json +0 -5
  177. package/template-uni-app/dist/dev/mp-weixin/pages/index.wxml +0 -1
  178. package/template-uni-app/dist/dev/mp-weixin/pages/index.wxss +0 -0
  179. package/template-uni-app/dist/dev/mp-weixin/pages/my.js +0 -22
  180. package/template-uni-app/dist/dev/mp-weixin/pages/my.json +0 -3
  181. package/template-uni-app/dist/dev/mp-weixin/pages/my.wxml +0 -1
  182. package/template-uni-app/dist/dev/mp-weixin/pages/my.wxss +0 -0
  183. package/template-uni-app/dist/dev/mp-weixin/project.config.json +0 -55
  184. package/template-uni-app/dist/dev/mp-weixin/project.private.config.json +0 -6
  185. package/template-uni-app/dist/dev/mp-weixin/static/back.png +0 -0
  186. package/template-uni-app/dist/dev/mp-weixin/static/h.png +0 -0
  187. package/template-uni-app/dist/dev/mp-weixin/static/home.png +0 -0
  188. package/template-uni-app/dist/dev/mp-weixin/static/home_active.png +0 -0
  189. package/template-uni-app/dist/dev/mp-weixin/static/more.png +0 -0
  190. package/template-uni-app/dist/dev/mp-weixin/static/my.png +0 -0
  191. package/template-uni-app/dist/dev/mp-weixin/static/my_active.png +0 -0
  192. package/template-uni-app/dist/dev/mp-weixin/static/network.png +0 -0
  193. package/template-uni-app/dist/dev/mp-weixin/store/index.js +0 -8
  194. package/template-uni-app/dist/dev/mp-weixin/store/local/index.js +0 -13
  195. package/template-uni-app/dist/dev/mp-weixin/store/system.js +0 -14
  196. package/template-uni-app/dist/dev/mp-weixin/utils/modal.js +0 -78
  197. package/template-uni-app/dist/dev/mp-weixin/utils/route.js +0 -83
  198. package/template-uni-app/dist/dev/mp-weixin/utils/system.js +0 -27
@@ -0,0 +1,81 @@
1
+ <!--
2
+ * @Author: zhangyang
3
+ * @Date: 2023-08-04 17:03:05
4
+ * @LastEditTime: 2023-11-07 14:17:33
5
+ * @Description:
6
+ -->
7
+ <script lang="ts" setup>
8
+ import '@wangeditor/editor/dist/css/style.css'
9
+ import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
10
+
11
+ const prop = withDefaults(defineProps<{
12
+ modelValue: string
13
+ disabled: boolean
14
+ height?: number
15
+ uploadFn: (file: File) => Promise<string>
16
+ }>(), {
17
+ height: 410,
18
+ })
19
+
20
+ const emit = defineEmits<{
21
+ (e: 'update:modelValue', v: string): void
22
+ }>()
23
+ // 编辑器实例,必须用 shallowRef,重要!
24
+ const editorRef = shallowRef()
25
+
26
+ // 编辑器配置
27
+ const editorConfig = {
28
+ placeholder: '请输入内容...',
29
+ MENU_CONF: {
30
+ uploadImage: {
31
+ /**
32
+ * 自定义图片上传
33
+ */
34
+ customUpload: async (file: File, insertFn: Function) => {
35
+ const url = await prop.uploadFn(file)
36
+ insertFn(url)
37
+ },
38
+ },
39
+ },
40
+ }
41
+
42
+ watchEffect(async () => {
43
+ while (!editorRef.value)
44
+ await nextTick()
45
+
46
+ if (prop.disabled)
47
+ editorRef.value?.disable()
48
+ else
49
+ editorRef.value?.enable()
50
+ })
51
+
52
+ // 组件销毁时,及时销毁编辑器
53
+ onBeforeUnmount(() => {
54
+ editorRef.value?.destroy()
55
+ })
56
+
57
+ const toolbarConfig = {
58
+ excludeKeys: [
59
+ 'insertVideo', 'uploadVideo', 'editVideoSize', 'group-video',
60
+ ],
61
+ }
62
+ </script>
63
+
64
+ <template>
65
+ <div class="border border-[#ccc]">
66
+ <!-- 工具栏 -->
67
+ <Toolbar :editor="editorRef" :default-config="toolbarConfig" class="border-b border-[#ccc]" />
68
+ <!-- 编辑器 -->
69
+ <Editor
70
+ :model-value="modelValue" :default-config="editorConfig"
71
+ :style="{ height: `${height}px` }" class="overflow-y-auto" :class="{ 'cursor-not-allowed': disabled }"
72
+ @update:model-value="(v) => emit('update:modelValue', v)" @on-created="(v) => editorRef = v"
73
+ />
74
+ </div>
75
+ </template>
76
+
77
+ <style>
78
+ .w-e-full-screen-container {
79
+ z-index: 1;
80
+ }
81
+ </style>
@@ -0,0 +1,21 @@
1
+ <!--
2
+ * @Author: zhangyang
3
+ * @Date: 2023-11-07 15:28:35
4
+ * @LastEditTime: 2023-11-07 16:07:52
5
+ * @Description: 工作区全屏切换
6
+ -->
7
+ <script lang="ts" setup>
8
+ const { zen_mode, zen_mode_helper } = storeToRefs(useNavStore())
9
+
10
+ function toggle() {
11
+ zen_mode.value = !zen_mode.value
12
+ if (zen_mode.value)
13
+ zen_mode_helper.value = false
14
+ }
15
+ </script>
16
+
17
+ <template>
18
+ <ElButton circle :title="zen_mode ? '恢复正常布局' : '工作区全屏'" :type="zen_mode ? 'danger' : 'primary'" @click="toggle">
19
+ <div class="i-bi-person-workspace" />
20
+ </ElButton>
21
+ </template>
@@ -1,11 +1,11 @@
1
1
  <!--
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-21 16:38:20
4
- * @LastEditTime: 2023-09-13 09:46:18
4
+ * @LastEditTime: 2023-11-07 16:01:17
5
5
  * @Description:
6
6
  -->
7
7
  <script lang="ts" setup>
8
- const { isCollapse, breadcrumb_arr } = storeToRefs(useNavStore())
8
+ const { isCollapse, breadcrumb_arr, zen_mode } = storeToRefs(useNavStore())
9
9
 
10
10
  function collapseHandler() {
11
11
  if (WindowSize['lt-lg']) {
@@ -47,6 +47,7 @@ function collapseHandler() {
47
47
  </ElBreadcrumb>
48
48
  </div>
49
49
  <div class="right-panel">
50
+ <ZenMode />
50
51
  <TopSearch />
51
52
  <ScreenFull />
52
53
  <TopUser />
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-06-20 17:14:58
4
- * @LastEditTime: 2023-09-08 17:33:20
4
+ * @LastEditTime: 2023-11-07 14:55:10
5
5
  * @Description:
6
6
  */
7
7
  import { useHttp } from '@bluesyoung/http'
@@ -53,22 +53,14 @@ const http = useHttp<{
53
53
 
54
54
  if (typeof err === 'string') {
55
55
  // 通用失败,弹出提示信息
56
- showNotify({
57
- type: 'danger',
58
- message: err,
59
- })
56
+ ElMessage.error(err)
60
57
  }
61
58
  if ((err as any) instanceof Error) {
62
- showNotify({
63
- type: 'danger',
64
- // 接口出错
65
- message:
66
- err?.response?.data?.message
67
- || err?.response?.data?.msg
68
- || err?.response?.data
69
- || err.message
70
- || '网络错误!',
71
- })
59
+ ElMessage.error(err?.response?.data?.message
60
+ || err?.response?.data?.msg
61
+ || err?.response?.data
62
+ || err.message
63
+ || '网络错误!')
72
64
  }
73
65
 
74
66
  throw err
@@ -1,12 +1,10 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-21 15:20:01
4
- * @LastEditTime: 2023-07-21 15:49:22
4
+ * @LastEditTime: 2023-11-07 14:48:21
5
5
  * @Description:
6
6
  * @unocss-include
7
7
  */
8
- import type { SelectOptionItem } from '@bluesyoung/ui-vue3-element-plus'
9
-
10
8
  export const MenuIcons = [
11
9
  'i-icon-park-solid-analysis',
12
10
  'i-ant-design-account-book-outlined',
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-06-01 12:03:44
4
- * @LastEditTime: 2023-09-15 15:23:04
4
+ * @LastEditTime: 2023-11-07 15:50:47
5
5
  * @Description:
6
6
  */
7
7
  export const useNavStore = defineStore('useNavStore', () => {
@@ -56,6 +56,14 @@ export const useNavStore = defineStore('useNavStore', () => {
56
56
  document.body.style.overflow = 'auto'
57
57
  })
58
58
 
59
+ /**
60
+ * 工作区全屏控制
61
+ */
62
+ const zen_mode = ref(false)
63
+ /**
64
+ * 工作区全屏时,临时显示顶部导航栏
65
+ */
66
+ const zen_mode_helper = ref(false)
59
67
  return {
60
68
  title,
61
69
  sub_title,
@@ -68,6 +76,8 @@ export const useNavStore = defineStore('useNavStore', () => {
68
76
  nodeMap,
69
77
  breadcrumb_arr,
70
78
  generateNodeMap,
79
+ zen_mode,
80
+ zen_mode_helper,
71
81
  }
72
82
  })
73
83
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-06-21 12:03:42
4
- * @LastEditTime: 2023-09-08 10:33:28
4
+ * @LastEditTime: 2023-11-07 16:41:48
5
5
  * @Description:
6
6
  */
7
7
  export const useUserStore = defineStore('useUserStore', () => {
@@ -9,6 +9,7 @@ export const useUserStore = defineStore('useUserStore', () => {
9
9
 
10
10
  const avatar = computed(() => cookie.value?.headimgurl)
11
11
  const nick = computed(() => cookie.value?.nickname)
12
+ const userId = computed(() => cookie.value?.uuid)
12
13
  const token = computed(() => {
13
14
  if (!validateToken())
14
15
  removeToken()
@@ -39,6 +40,7 @@ export const useUserStore = defineStore('useUserStore', () => {
39
40
  SaveFlag,
40
41
  Exptime,
41
42
  removeToken,
43
+ userId,
42
44
  }
43
45
  })
44
46
 
@@ -12,36 +12,36 @@ interface ImportMetaEnv {
12
12
  /**
13
13
  * 当前版本
14
14
  */
15
- NUXT_PUBLIC_CURRENT_VERSION: string;
15
+ NUXT_PUBLIC_CURRENT_VERSION: string
16
16
  /**
17
17
  * 后台服务器地址
18
18
  */
19
- NUXT_PUBLIC_API_BASE: string;
19
+ NUXT_PUBLIC_API_BASE: string
20
20
  /**
21
21
  * 后台标题
22
22
  */
23
- NUXT_PUBLIC_TITLE: string;
23
+ NUXT_PUBLIC_TITLE: string
24
24
  /**
25
25
  * 后台副标题
26
26
  */
27
- NUXT_PUBLIC_SUB_TITLE?: string;
27
+ NUXT_PUBLIC_SUB_TITLE?: string
28
28
  /**
29
29
  * slogan
30
30
  */
31
- NUXT_PUBLIC_SLOGAN?: string;
31
+ NUXT_PUBLIC_SLOGAN?: string
32
32
  /**
33
33
  * 登录背景图
34
34
  */
35
- NUXT_PUBLIC_LOGIN_BG: string;
35
+ NUXT_PUBLIC_LOGIN_BG: string
36
36
  /**
37
37
  * 后台 logo
38
38
  */
39
- NUXT_PUBLIC_LOGIN_LOGO: string;
39
+ NUXT_PUBLIC_LOGIN_LOGO: string
40
40
  };
41
41
 
42
42
  declare interface Window {
43
43
  /**
44
44
  * 注入到前端使用的环境变量
45
45
  */
46
- __YOUNG_ENV__: ImportMetaEnv;
46
+ __YOUNG_ENV__: ImportMetaEnv
47
47
  };
@@ -0,0 +1,33 @@
1
+ /*
2
+ * @Author: zhangyang
3
+ * @Date: 2023-11-01 10:13:50
4
+ * @LastEditTime: 2023-11-01 16:52:29
5
+ * @Description:
6
+ */
7
+ import antfu from '@antfu/eslint-config'
8
+
9
+ export default antfu({
10
+ overrides: {
11
+ vue: {
12
+ 'vue/valid-v-model': 'off',
13
+ },
14
+ typescript: {
15
+ 'ts/no-use-before-define': 'off',
16
+ 'ts/no-unused-vars': 'off',
17
+ 'ts/ban-types': 'off',
18
+ 'ts/ban-ts-comment': 'off',
19
+ },
20
+ },
21
+ rules: {
22
+ 'no-console': 'off',
23
+ 'node/prefer-global/process': 'off',
24
+ 'unused-imports/no-unused-vars': 'off',
25
+ 'no-throw-literal': 'off',
26
+ 'antfu/consistent-list-newline': 'off',
27
+ 'style/jsx-indent': 'off',
28
+ },
29
+ }, {
30
+ ignores: [
31
+ 'public',
32
+ ],
33
+ })
@@ -1,15 +1,19 @@
1
1
  <!--
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-21 11:49:00
4
- * @LastEditTime: 2023-07-28 17:41:44
4
+ * @LastEditTime: 2023-11-07 16:58:16
5
5
  * @Description:
6
6
  -->
7
7
  <script lang="ts" setup>
8
- const { isCollapse } = storeToRefs(useNavStore())
8
+ const { isCollapse, zen_mode, zen_mode_helper } = storeToRefs(useNavStore())
9
9
  const { enter, isSupported } = useFullscreen()
10
10
 
11
11
  const fullTip = useLocalStorage('全屏提示', false)
12
12
 
13
+ const { userId, nick } = storeToRefs(useUserStore())
14
+
15
+ const waterTxt = computed(() => `${userId.value}\n${nick.value}`)
16
+
13
17
  onMounted(() => {
14
18
  const { innerWidth, innerHeight } = window
15
19
  if (innerHeight > innerWidth) {
@@ -46,14 +50,34 @@ onMounted(() => {
46
50
 
47
51
  <template>
48
52
  <div class="layout-admin-wrapper">
53
+ <!-- 全局水印, 按需启用 -->
54
+ <!-- <VanWatermark
55
+ v-if="waterTxt"
56
+ :content="waterTxt"
57
+ :gap-x="30"
58
+ :gap-y="10"
59
+ full-page
60
+ text-color="#eee"
61
+ /> -->
49
62
  <!-- SubMenu -->
50
- <LayoutSideBar />
51
- <div class="layout-container-vertical" :class="{ 'is-collapse': isCollapse }">
63
+ <LayoutSideBar v-show="!zen_mode" />
64
+ <div
65
+ class="layout-container-vertical" :class="{
66
+ 'is-collapse': isCollapse,
67
+ 'is-zen-mode': zen_mode,
68
+ 'is-zen-mode-helper': zen_mode_helper,
69
+ }"
70
+ >
52
71
  <div class="layout-main">
53
72
  <!-- Header -->
54
- <div class="layout-header" :class="{ 'is-collapse': isCollapse }">
55
- <LayoutNavBar />
56
- <LayoutTabsBar lt-lg="!hidden" />
73
+ <div
74
+ class="layout-header" :class="{
75
+ 'is-collapse': isCollapse,
76
+ 'is-zen-mode': zen_mode,
77
+ }"
78
+ >
79
+ <LayoutNavBar v-show="!zen_mode || zen_mode_helper" />
80
+ <LayoutTabsBar v-show="!zen_mode || zen_mode_helper" lt-lg="!hidden" />
57
81
  </div>
58
82
  <div class="app-main-container">
59
83
  <!-- Main -->
@@ -82,6 +106,16 @@ onMounted(() => {
82
106
  border-right: 0;
83
107
  }
84
108
 
109
+ &.is-zen-mode {
110
+ margin-left: 0 !important;
111
+ margin-top: 0;
112
+ border-right: 0;
113
+ }
114
+
115
+ &.is-zen-mode-helper {
116
+ margin-top: $base-header-height;
117
+ }
118
+
85
119
  .layout-main {
86
120
  min-height: 100%;
87
121
 
@@ -96,6 +130,10 @@ onMounted(() => {
96
130
  &.is-collapse {
97
131
  width: calc(100% - $base-left-menu-width-min);
98
132
  }
133
+
134
+ &.is-zen-mode {
135
+ width: 100% !important;
136
+ }
99
137
  }
100
138
  }
101
139
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-21 10:02:19
4
- * @LastEditTime: 2023-09-13 09:45:34
4
+ * @LastEditTime: 2023-11-07 14:55:45
5
5
  * @Description:
6
6
  */
7
7
  export default defineNuxtRouteMiddleware(async (to, from) => {
@@ -42,10 +42,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
42
42
 
43
43
  if (!hasLogin.value && to.path !== '/login') {
44
44
  // 页面需要登录,但是未登录
45
- showNotify({
46
- type: 'danger',
47
- message: '未登录或登录过期,请重新登录',
48
- })
45
+ ElMessage.error('未登录或登录过期,请重新登录')
49
46
  return navigateTo(`/login?redirect=${encodeURIComponent(to.fullPath)}`, {
50
47
  replace: true,
51
48
  })
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-05-25 19:45:20
4
- * @LastEditTime: 2023-09-16 16:34:29
4
+ * @LastEditTime: 2023-11-07 15:56:03
5
5
  * @Description:
6
6
  */
7
7
  import { resolve } from 'node:path'
@@ -11,6 +11,9 @@ export default defineNuxtConfig({
11
11
  ssr: false,
12
12
  app: {
13
13
  head: {
14
+ htmlAttrs: {
15
+ lang: 'zh-CN',
16
+ },
14
17
  viewport: 'width=device-width,initial-scale=1.0,user-scalable=no,shrink-to-fit=no',
15
18
  meta: [
16
19
  { name: 'theme-color', content: '#ffffff' },
@@ -26,12 +29,12 @@ export default defineNuxtConfig({
26
29
  href: '/favicon.svg',
27
30
  },
28
31
  {
29
- rel: 'preload',
32
+ rel: 'prefetch',
30
33
  as: 'image',
31
34
  href: '/image_placeholder.svg',
32
35
  },
33
36
  {
34
- rel: 'preload',
37
+ rel: 'prefetch',
35
38
  as: 'image',
36
39
  href: '/tabbar_bg.png',
37
40
  },
@@ -50,44 +53,35 @@ export default defineNuxtConfig({
50
53
  }
51
54
  `,
52
55
  },
56
+ {
57
+ src: '/index.umd.js',
58
+ async: true,
59
+ },
53
60
  ],
54
61
  },
55
62
  },
56
63
 
57
- lazyLoad: {
58
- audio: false,
59
- // 默认使用原生的 loading="lazy"
60
- // native: true,
61
- // js 实现,仅指令生效 v-lazy-load
62
- // directiveOnly: true,
63
- // @ts-expect-error js 实现的占位图
64
- defaultImage: '/image_placeholder.svg',
64
+ imports: {
65
+ dirs: ['utils/**/*.{ts,tsx}'],
65
66
  },
66
67
 
67
68
  nitro: {
68
69
  output: {
69
70
  dir: resolve(__dirname, './dist'),
70
71
  },
72
+ sourceMap: false,
73
+ minify: true,
71
74
  },
72
75
 
73
- // 开发调试工具,按需启用
74
- // devtools: {
75
- // enabled: true,
76
- // },
77
-
78
76
  modules: [
79
77
  '@vueuse/nuxt',
80
78
  '@unocss/nuxt',
81
79
  '@element-plus/nuxt',
82
80
  '@pinia/nuxt',
83
81
  '@vant/nuxt',
84
- 'nuxt-lazy-load',
82
+ '@bluesyoung/ui-vue3-element-plus/nuxt',
85
83
  ],
86
84
 
87
- pinia: {
88
- autoImports: ['defineStore', 'storeToRefs', 'acceptHMRUpdate'],
89
- },
90
-
91
85
  vite: {
92
86
  build: {
93
87
  // 兼容钉钉浏览器
@@ -103,4 +97,10 @@ export default defineNuxtConfig({
103
97
  },
104
98
  },
105
99
  },
100
+
101
+ vue: {
102
+ compilerOptions: {
103
+ isCustomElement: tag => ['young-float-ball'].includes(tag),
104
+ },
105
+ },
106
106
  })
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-app",
3
+ "type": "module",
3
4
  "version": "0.0.0",
4
5
  "private": true,
5
6
  "scripts": {
@@ -15,7 +16,7 @@
15
16
  "@bluesyoung/casdoor-auth": "^0.1.0",
16
17
  "@bluesyoung/http": "^1.0.1",
17
18
  "@bluesyoung/ui-vue3": "^0.1.1",
18
- "@bluesyoung/ui-vue3-element-plus": "0.13.0",
19
+ "@bluesyoung/ui-vue3-element-plus": "1.3.5",
19
20
  "@bluesyoung/utils": "0.2.1",
20
21
  "@wangeditor/editor": "^5.1.23",
21
22
  "@wangeditor/editor-for-vue": "^5.1.12",
@@ -29,26 +30,24 @@
29
30
  "vue-cropper": "^1.0.9"
30
31
  },
31
32
  "devDependencies": {
32
- "@antfu/eslint-config": "^0.42.0",
33
+ "@antfu/eslint-config": "^1.1.0",
33
34
  "@bluesyoung/logger": "^0.0.1",
34
35
  "@element-plus/nuxt": "^1.0.5",
35
36
  "@iconify/json": "^2.2.93",
36
- "@nuxt/devtools": "^0.8.2",
37
- "@pinia/nuxt": "^0.4.11",
37
+ "@pinia/nuxt": "^0.5.1",
38
38
  "@types/file-saver": "^2.0.5",
39
39
  "@types/md5": "^2.3.2",
40
- "@types/node": "20.6.2",
40
+ "@types/node": "20.8.10",
41
41
  "@types/qrcode": "^1.5.1",
42
- "@unocss/nuxt": "^0.55.6",
42
+ "@unocss/nuxt": "^0.57.2",
43
43
  "@vant/nuxt": "^1.0.2",
44
44
  "@vueuse/nuxt": "^10.2.1",
45
45
  "add": "^2.0.6",
46
46
  "dayjs": "^1.11.9",
47
47
  "element-plus": "^2.3.8",
48
48
  "eslint": "^8.48.0",
49
- "lint-staged": "^14.0.1",
50
- "nuxt": "^3.7.3",
51
- "nuxt-lazy-load": "^3.0.4",
49
+ "lint-staged": "^15.0.2",
50
+ "nuxt": "^3.8.1",
52
51
  "pinia": "^2.1.4",
53
52
  "sass": "^1.64.0",
54
53
  "simple-git-hooks": "^2.9.0",
@@ -1,12 +1,10 @@
1
1
  <!--
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-25 16:44:56
4
- * @LastEditTime: 2023-08-25 16:54:08
4
+ * @LastEditTime: 2023-11-07 14:42:48
5
5
  * @Description:
6
6
  -->
7
7
  <script lang="ts" setup>
8
- import { YoungDialog, YoungPagination, YoungSearchForm, YoungSelect, YoungTablePro, useFormMode, useQuery } from '@bluesyoung/ui-vue3-element-plus'
9
- import type { SelectOptionItem, TableDataItem, TableHeadItem, YoungSearchScheme } from '@bluesyoung/ui-vue3-element-plus'
10
8
  import { deepClone } from '@bluesyoung/utils'
11
9
  import { ElButton, ElTag } from 'element-plus'
12
10
 
@@ -1,16 +1,9 @@
1
1
  /*
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-26 15:51:14
4
- * @LastEditTime: 2023-07-28 11:22:35
4
+ * @LastEditTime: 2023-11-07 14:43:01
5
5
  * @Description:
6
6
  */
7
- import type {
8
- SelectOptionItem,
9
- TableDataItem,
10
- TableHeadItem,
11
- YoungSearchScheme,
12
- } from '@bluesyoung/ui-vue3-element-plus'
13
- import { YoungSelect, useFormMode, useQuery } from '@bluesyoung/ui-vue3-element-plus'
14
7
  import { deepClone } from '@bluesyoung/utils'
15
8
 
16
9
  export function useRoleBase() {
@@ -1,12 +1,10 @@
1
1
  <!--
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-25 16:45:17
4
- * @LastEditTime: 2023-08-25 16:55:00
4
+ * @LastEditTime: 2023-11-07 14:42:06
5
5
  * @Description:
6
6
  -->
7
7
  <script lang="ts" setup>
8
- import { YoungDialog, YoungSelect, YoungTablePro, useFormMode } from '@bluesyoung/ui-vue3-element-plus'
9
- import type { TableHeadItem } from '@bluesyoung/ui-vue3-element-plus'
10
8
  import { deepClone, isArray } from '@bluesyoung/utils'
11
9
  import { ElButton } from 'element-plus'
12
10
 
@@ -225,13 +223,13 @@ const tableHead: TableHeadItem<NavArrItem>[] = [
225
223
  render: row => h(YoungSelect, {
226
224
  'modelValue': row.visible,
227
225
  'options': [{ label: '显示', value: 1 }, { label: '隐藏', value: 0 }],
228
- 'onUpdate:modelValue': async (e: number) => {
226
+ 'onUpdate:modelValue': async (e) => {
229
227
  // 状态未修改
230
228
  if (e === row.visible)
231
229
  return
232
230
 
233
- row.visible = e
234
- await apis.patch.changeMenuItem({ ...row, visible: e })
231
+ row.visible = +e
232
+ await apis.patch.changeMenuItem({ ...row, visible: +e })
235
233
  ElMessage.success('菜单修改成功!')
236
234
  },
237
235
  }),
@@ -1,11 +1,10 @@
1
1
  <!--
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-25 16:45:39
4
- * @LastEditTime: 2023-08-25 16:55:10
4
+ * @LastEditTime: 2023-11-07 14:41:43
5
5
  * @Description:
6
6
  -->
7
7
  <script lang="ts" setup>
8
- import { YoungDialog, YoungPagination, YoungSearchForm, YoungTablePro } from '@bluesyoung/ui-vue3-element-plus'
9
8
  import { useRoleApi, useRoleBase, useRoleMenu } from './hooks/useRole'
10
9
 
11
10
  definePageMeta({
@@ -1,12 +1,10 @@
1
1
  <!--
2
2
  * @Author: zhangyang
3
3
  * @Date: 2023-07-25 16:46:00
4
- * @LastEditTime: 2023-08-25 16:55:17
4
+ * @LastEditTime: 2023-11-07 14:41:11
5
5
  * @Description:
6
6
  -->
7
7
  <script lang="ts" setup>
8
- import { YoungDialog, YoungPagination, YoungSearchForm, YoungSelect, YoungTablePro, useFormMode, useQuery } from '@bluesyoung/ui-vue3-element-plus'
9
- import type { SelectOptionItem, TableDataItem, TableHeadItem, YoungSearchScheme } from '@bluesyoung/ui-vue3-element-plus'
10
8
  import { deepClone } from '@bluesyoung/utils'
11
9
  import { ElButton } from 'element-plus'
12
10