@pubinfo/core 2.0.0-beta.14 → 2.0.0-beta.16

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 (50) hide show
  1. package/dist/{AppSetting-CCvx0lqd.js → AppSetting-jAFvWPf_.js} +16 -16
  2. package/dist/{HCheckList.vue_vue_type_script_setup_true_lang-BP4YCym4.js → HCheckList.vue_vue_type_script_setup_true_lang-03vNFTY7.js} +2 -2
  3. package/dist/{PreferencesContent-B2uvCxH7.js → PreferencesContent-BKospVVk.js} +58 -58
  4. package/dist/{SettingBreadcrumb-CQYovqN-.js → SettingBreadcrumb-B-MGqvCL.js} +2 -2
  5. package/dist/{SettingCopyright-B3kEXFe1.js → SettingCopyright-DJYD0pRt.js} +1 -1
  6. package/dist/{SettingEnableTransition-DMI2qjWt.js → SettingEnableTransition-CbigI-kJ.js} +1 -1
  7. package/dist/{SettingHome-C7dhemZ5.js → SettingHome-srwYPPUa.js} +1 -1
  8. package/dist/{SettingMenu-DVblMz0x.js → SettingMenu-6cFfXyh6.js} +2 -2
  9. package/dist/{SettingMode-AiRRWrFq.js → SettingMode-DCVZHznZ.js} +1 -1
  10. package/dist/{SettingNavSearch-DVda3ppO.js → SettingNavSearch-8SpKAVyw.js} +1 -1
  11. package/dist/{SettingOther-Zl4WPgxd.js → SettingOther-BcYQ2Ed7.js} +1 -1
  12. package/dist/{SettingPage-BEqFAFAZ.js → SettingPage-obBObHeU.js} +1 -1
  13. package/dist/{SettingTabbar-BIQgX8Qq.js → SettingTabbar-BsGbQ-D2.js} +2 -2
  14. package/dist/{SettingThemes-C5MbD1OJ.js → SettingThemes-m8f3gPn2.js} +2 -2
  15. package/dist/{SettingToolbar-DkFBagLe.js → SettingToolbar-WmyCi6TX.js} +1 -1
  16. package/dist/{SettingTopbar-CPGYfMic.js → SettingTopbar-bBmoKC9Z.js} +2 -2
  17. package/dist/{SettingWidthMode-KUYF9mmX.js → SettingWidthMode-B1OdsVl5.js} +1 -1
  18. package/dist/{TopThinMode-CWlzIWyR.js → TopThinMode-D4d9RmKt.js} +1 -1
  19. package/dist/{_...all_-ByL_l69K.js → _...all_-D6gpCuEL.js} +1 -1
  20. package/dist/{colors-suUdBG0G.js → colors-C5Ze8zIC.js} +1 -1
  21. package/dist/components/PassStrengthValidator/index.vue.d.ts +2 -2
  22. package/dist/{index-DavJkyu2.js → index-B-J9tu40.js} +2 -2
  23. package/dist/{index-BEukdLoy.js → index-B2C38hfC.js} +31 -31
  24. package/dist/{index-CZl5B_BS.js → index-BP62vA7t.js} +19 -19
  25. package/dist/{index-CJuwuJt2.js → index-BSzSj0b3.js} +4 -4
  26. package/dist/{index-Bcos6jMe.js → index-CAoR4_8l.js} +1562 -1561
  27. package/dist/{index-CfD8orIa.js → index-CMTmyz7f.js} +15 -15
  28. package/dist/{index-D1T15Wbu.js → index-DQbvPQCH.js} +30 -30
  29. package/dist/{index-D8HgRilY.js → index-DQlWenum.js} +12 -12
  30. package/dist/{index-DiFGrnRo.js → index-SGumP-Y7.js} +1 -1
  31. package/dist/index.js +45 -44
  32. package/dist/{index.vue_vue_type_style_index_0_scoped_fa1c6ee4_lang-Cux2HLXY.js → index.vue_vue_type_style_index_0_scoped_fa1c6ee4_lang--zsKN-Gh.js} +1 -1
  33. package/dist/layout/ui-kit/HCheckList.vue.d.ts +2 -2
  34. package/dist/layout/ui-kit/HTabList.vue.d.ts +2 -2
  35. package/dist/{menu-Cu11pQEA.js → menu-x8H6Akde.js} +2335 -2337
  36. package/dist/{pick-DI_ndFGY.js → pick-DMuBL1OS.js} +1 -1
  37. package/dist/request.js +23 -23
  38. package/dist/route/index.d.ts +0 -1
  39. package/dist/route/routes.d.ts +20 -1
  40. package/dist/style.css +1 -1
  41. package/package.json +3 -3
  42. package/src/layout/components/Tools/index.vue +1 -0
  43. package/src/route/index.ts +0 -1
  44. package/src/route/routes.ts +67 -44
  45. package/src/stores/modules/route.ts +2 -2
  46. package/dist/index-DTQQt_XY.js +0 -10
  47. package/dist/pages/system/index.vue.d.ts +0 -2
  48. package/dist/route/async.d.ts +0 -9
  49. package/src/pages/system/index.vue +0 -5
  50. package/src/route/async.ts +0 -18
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pubinfo/core",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.14",
4
+ "version": "2.0.0-beta.16",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "vue": "^3.5.13",
29
29
  "vue-i18n": "^10.0.5",
30
30
  "vue-router": "^4.5.0",
31
- "@pubinfo/config": "2.0.0-beta.14"
31
+ "@pubinfo/config": "2.0.0-beta.16"
32
32
  },
33
33
  "dependencies": {
34
34
  "@alova/adapter-axios": "^2.0.13",
@@ -85,7 +85,7 @@
85
85
  "vue": "^3.5.13",
86
86
  "vue-i18n": "^10.0.5",
87
87
  "vue-router": "^4.5.0",
88
- "@pubinfo/config": "2.0.0-beta.14"
88
+ "@pubinfo/config": "2.0.0-beta.16"
89
89
  },
90
90
  "scripts": {
91
91
  "dev": "vite build -w -m watch",
@@ -39,6 +39,7 @@ const userMenu = computed(() => [
39
39
  [
40
40
  {
41
41
  label: generateI18nTitle('route.home', settingsStore.settings.home.title),
42
+ icon: 'i-ant-design:home-twotone',
42
43
  handle: () => router.push({ name: 'Home' }),
43
44
  hide: !settingsStore.settings.home.enable,
44
45
  },
@@ -7,6 +7,5 @@ export function setupRouterGuard({ router }: { router: Router }) {
7
7
  createSettingGuard(router);
8
8
  }
9
9
 
10
- export * from './async';
11
10
  export * from './guard';
12
11
  export * from './routes';
@@ -1,9 +1,75 @@
1
- // 内置路由
1
+ import type { Route } from '#/vue-router';
2
2
  import type { RouteRecordRaw } from 'vue-router';
3
3
  import { readProject } from '@/context';
4
4
  import { useSettingsStore, useUserStore } from '@/stores';
5
5
  import { isUndefined } from 'lodash-es';
6
6
 
7
+ let asyncRoutes: Route.recordMainRaw[] = [];
8
+
9
+ /**
10
+ * 定义并注册动态路由
11
+ */
12
+ export function defineAsyncRoutes(routes: Route.recordMainRaw[]) {
13
+ asyncRoutes = [...asyncRoutes, ...routes];
14
+ return routes;
15
+ }
16
+
17
+ /**
18
+ * 读取注册的动态路由
19
+ */
20
+ export function getAsyncRoutes() {
21
+ return asyncRoutes;
22
+ }
23
+
24
+ const systemRoutes: RouteRecordRaw[] = [
25
+ {
26
+ path: '/',
27
+ component: readProject().layout,
28
+ meta: {
29
+ title: () => useSettingsStore().settings.home.title,
30
+ breadcrumb: false,
31
+ },
32
+ children: [
33
+ {
34
+ path: 'reload',
35
+ name: 'Reload',
36
+ component: () => import('@/pages/system/reload.vue'),
37
+ meta: {
38
+ title: '重新加载',
39
+ breadcrumb: false,
40
+ },
41
+ },
42
+ {
43
+ path: 'personal/profile',
44
+ name: 'Profile',
45
+ component: () => import('@/pages/personal/profile/index.vue'),
46
+ meta: {
47
+ title: '个人中心',
48
+ i18n: 'route.personal.profile',
49
+ icon: 'i-iconamoon-profile-duotone',
50
+ },
51
+ },
52
+ ],
53
+ },
54
+ ];
55
+
56
+ /**
57
+ * 定义并注册系统路由(含Layout)
58
+ */
59
+ export function defineSystemRoutes(routes: RouteRecordRaw[]) {
60
+ systemRoutes[0].children = [...(systemRoutes?.[0]?.children ?? []), ...routes];
61
+ }
62
+
63
+ /**
64
+ * 读取注册的系统路由
65
+ */
66
+ export function getSystemRoutes() {
67
+ return systemRoutes;
68
+ }
69
+
70
+ /**
71
+ * 内置静态路由
72
+ */
7
73
  export const constantRoutes: RouteRecordRaw[] = [
8
74
  {
9
75
  path: '/change-password/:changePassWordToken',
@@ -56,46 +122,3 @@ export const constantRoutes: RouteRecordRaw[] = [
56
122
  },
57
123
  },
58
124
  ];
59
-
60
- export const systemRoutes: RouteRecordRaw[] = [
61
- {
62
- path: '/',
63
- component: readProject().layout,
64
- meta: {
65
- title: () => useSettingsStore().settings.home.title,
66
- breadcrumb: false,
67
- },
68
- children: [
69
- {
70
- path: '',
71
- name: 'Home',
72
- component: () => import('@/pages/system/index.vue'),
73
- meta: {
74
- title: () => useSettingsStore().settings.home.title,
75
- i18n: 'route.home',
76
- icon: 'i-ant-design:home-twotone',
77
- breadcrumb: false,
78
- },
79
- },
80
- {
81
- path: 'reload',
82
- name: 'Reload',
83
- component: () => import('@/pages/system/reload.vue'),
84
- meta: {
85
- title: '重新加载',
86
- breadcrumb: false,
87
- },
88
- },
89
- {
90
- path: 'personal/profile',
91
- name: 'Profile',
92
- component: () => import('@/pages/personal/profile/index.vue'),
93
- meta: {
94
- title: '个人中心',
95
- i18n: 'route.personal.profile',
96
- icon: 'i-iconamoon-profile-duotone',
97
- },
98
- },
99
- ],
100
- },
101
- ];
@@ -3,8 +3,7 @@ import type { RouteMeta, RouteRecordRaw } from 'vue-router';
3
3
 
4
4
  import { GetApiRouteList } from '@/api/system/app';
5
5
  import { readProject } from '@/context';
6
- import { getAsyncRoutes } from '@/route';
7
- import { systemRoutes } from '@/route/routes';
6
+ import { getAsyncRoutes, getSystemRoutes } from '@/route';
8
7
  import { resolveRoutePath } from '@/utils';
9
8
  import { cloneDeep, defaultTo, get, has, isArray, isString, isUndefined, merge, omit } from 'lodash-es';
10
9
  import { defineStore } from 'pinia';
@@ -190,6 +189,7 @@ const useRouteStore = defineStore(
190
189
  * @returns {Array<RouteRecordRaw>} 扁平化的系统路由。
191
190
  */
192
191
  const flatSystemRoutes = computed(() => {
192
+ const systemRoutes = getSystemRoutes();
193
193
  const routes = [...systemRoutes];
194
194
  routes.forEach(item => flattenSystemRoutes(item));
195
195
  return routes;
@@ -1,10 +0,0 @@
1
- import { createElementBlock as e, openBlock as o } from "vue";
2
- import { _ as c } from "./_plugin-vue_export-helper-CHgC5LLL.js";
3
- const t = {}, r = { class: "home" };
4
- function n(s, _) {
5
- return o(), e("div", r, " 主页 ");
6
- }
7
- const i = /* @__PURE__ */ c(t, [["render", n]]);
8
- export {
9
- i as default
10
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
2
- export default _default;
@@ -1,9 +0,0 @@
1
- import { Route } from '../../types/vue-router';
2
- /**
3
- * 定义并注册动态路由
4
- */
5
- export declare function defineAsyncRoutes(routes: Route.recordMainRaw[]): Route.recordMainRaw[];
6
- /**
7
- * 读取注册的动态路由
8
- */
9
- export declare function getAsyncRoutes(): Route.recordMainRaw[];
@@ -1,5 +0,0 @@
1
- <template>
2
- <div class="home">
3
- 主页
4
- </div>
5
- </template>
@@ -1,18 +0,0 @@
1
- import type { Route } from '#/vue-router';
2
-
3
- let asyncRoutes: Route.recordMainRaw[] = [];
4
-
5
- /**
6
- * 定义并注册动态路由
7
- */
8
- export function defineAsyncRoutes(routes: Route.recordMainRaw[]) {
9
- asyncRoutes = [...asyncRoutes, ...routes];
10
- return routes;
11
- }
12
-
13
- /**
14
- * 读取注册的动态路由
15
- */
16
- export function getAsyncRoutes() {
17
- return asyncRoutes;
18
- }