xto-fronted 0.4.108 → 0.4.110

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 (93) hide show
  1. package/dist/App.vue.d.ts +2 -0
  2. package/dist/api/auth.d.ts +8 -0
  3. package/dist/api/index.d.ts +6 -0
  4. package/dist/api/index.js +26 -0
  5. package/dist/api/system.d.ts +16 -0
  6. package/dist/api/user.d.ts +13 -0
  7. package/dist/api.d.ts +2 -0
  8. package/dist/components/Layout/Footer.vue.d.ts +2 -0
  9. package/dist/components/Layout/Header.vue.d.ts +5 -0
  10. package/dist/components/Layout/MixTopMenu.vue.d.ts +10 -0
  11. package/dist/components/Layout/Sidebar.vue.d.ts +13 -0
  12. package/dist/components/Layout/SidebarMenuItem.vue.d.ts +5 -0
  13. package/dist/components/Layout/Tabs.vue.d.ts +2 -0
  14. package/dist/components/Layout/TopMenu.vue.d.ts +10 -0
  15. package/dist/components/Layout/index.vue.d.ts +7 -0
  16. package/dist/composables/useApp.d.ts +29 -0
  17. package/dist/composables/useAuth.d.ts +6 -0
  18. package/dist/composables/useForm.d.ts +20 -0
  19. package/dist/composables/useI18n.d.ts +30 -0
  20. package/dist/composables/useTable.d.ts +29 -0
  21. package/dist/directives/permission.d.ts +4 -0
  22. package/dist/enums/index.d.ts +32 -0
  23. package/dist/index-BMIR-PSJ.js +515 -0
  24. package/dist/index-C3r5dnEs.js +479 -0
  25. package/dist/index-CLcJb_H7.js +189 -0
  26. package/dist/index-Ch8vmOiD.js +641 -0
  27. package/dist/index-DTWHgS2f.js +3167 -0
  28. package/dist/index.d.ts +63 -0
  29. package/dist/index.js +99 -0
  30. package/dist/main.d.ts +0 -0
  31. package/dist/router/dynamicRoutes.d.ts +30 -0
  32. package/dist/router/guards.d.ts +17 -0
  33. package/dist/router/index.d.ts +6 -0
  34. package/dist/router/layoutRoute.d.ts +23 -0
  35. package/dist/router/staticRoutes.d.ts +2 -0
  36. package/dist/stores/app.d.ts +99 -0
  37. package/dist/stores/auth.d.ts +41 -0
  38. package/dist/stores/index.d.ts +10 -0
  39. package/dist/stores/locale.d.ts +42 -0
  40. package/dist/stores/menu.d.ts +83 -0
  41. package/dist/stores/user.d.ts +92 -0
  42. package/dist/style.css +1 -0
  43. package/dist/user-CHxvQHYq.js +1182 -0
  44. package/dist/utils/auth.d.ts +27 -0
  45. package/dist/utils/config.d.ts +46 -0
  46. package/dist/utils/permission.d.ts +17 -0
  47. package/dist/utils/request.d.ts +34 -0
  48. package/dist/utils/storage.d.ts +24 -0
  49. package/dist/views/dashboard/index.vue.d.ts +2 -0
  50. package/dist/views/error/403.vue.d.ts +2 -0
  51. package/dist/views/error/404.vue.d.ts +2 -0
  52. package/dist/views/login/index.vue.d.ts +4 -0
  53. package/dist/views/system/menu/index.vue.d.ts +4 -0
  54. package/dist/views/system/role/index.vue.d.ts +4 -0
  55. package/dist/views/system/user/index.vue.d.ts +4 -0
  56. package/package.json +1 -1
  57. package/src/index.ts +2 -1
  58. package/src/router/layoutRoute.ts +4 -1
  59. package/src/utils/config.ts +14 -1
  60. package/dist/assets/404-Cw_4ZCL6.css +0 -1
  61. package/dist/assets/404-Ds4qQp_I.js +0 -1
  62. package/dist/assets/_plugin-vue_export-helper-DlAUqK2U.js +0 -1
  63. package/dist/assets/index-8nuVIlbv.css +0 -1
  64. package/dist/assets/index-BHz6c6nU.js +0 -1
  65. package/dist/assets/index-BRR97dc6.js +0 -1
  66. package/dist/assets/index-BiVrui0e.js +0 -1
  67. package/dist/assets/index-BlRslYYI.css +0 -1
  68. package/dist/assets/index-BmKXwp1h.js +0 -2
  69. package/dist/assets/index-BudArKxR.css +0 -1
  70. package/dist/assets/index-CFhWBbxk.css +0 -1
  71. package/dist/assets/index-CcPloqYU.css +0 -1
  72. package/dist/assets/index-Cpew6d-v.css +0 -1
  73. package/dist/assets/index-DTpYpZOm.js +0 -1
  74. package/dist/assets/index-Dr4dkRtj.js +0 -1
  75. package/dist/assets/index-Y3uGV-U1.js +0 -1
  76. package/dist/assets/index-aJcLMKgc.js +0 -1
  77. package/dist/assets/index-vfvEFrCH.css +0 -1
  78. package/dist/assets/vendor-DZmPBJ9d.js +0 -16
  79. package/dist/assets/vue-vendor-emeAKDpw.js +0 -29
  80. package/dist/assets/xto-base-CL2NKZJJ.css +0 -1
  81. package/dist/assets/xto-base-CqtR85Rk.js +0 -1
  82. package/dist/assets/xto-business--V1F5Gwb.css +0 -1
  83. package/dist/assets/xto-core-DMuDa0Wb.js +0 -1
  84. package/dist/assets/xto-data-BESpuXuX.js +0 -1
  85. package/dist/assets/xto-data-MxZsiJgi.css +0 -1
  86. package/dist/assets/xto-feedback-Bxx38c3P.css +0 -1
  87. package/dist/assets/xto-feedback-DpxPzvBf.js +0 -1
  88. package/dist/assets/xto-form-Cu6q3VLG.css +0 -1
  89. package/dist/assets/xto-form-DeLishR4.js +0 -1
  90. package/dist/assets/xto-layout-BDD6sSlM.css +0 -1
  91. package/dist/assets/xto-navigation-DVpBd-R6.js +0 -1
  92. package/dist/assets/xto-navigation-XfpyMpEo.css +0 -1
  93. package/dist/index.html +0 -28
@@ -0,0 +1,63 @@
1
+ import { LocaleCode } from '@xto/core/locale';
2
+ export interface XtoConfig {
3
+ appName?: string;
4
+ appId?: string;
5
+ clientId?: string;
6
+ apiBaseUrl?: string;
7
+ basePath?: string;
8
+ indexPath?: string;
9
+ loginPath?: string;
10
+ locale?: LocaleCode;
11
+ }
12
+ /**
13
+ * 初始化 XTO 应用
14
+ * 在项目入口文件中调用此函数设置应用配置
15
+ *
16
+ * @param config 应用配置
17
+ * @returns Promise,等待运行时配置加载完成
18
+ */
19
+ export declare function createXtoApp(config: Partial<XtoConfig>): Promise<{
20
+ config: {
21
+ appName: string;
22
+ appId: string;
23
+ clientId: string;
24
+ apiBaseUrl: string;
25
+ basePath: string;
26
+ indexPath: string;
27
+ loginPath: string;
28
+ locale: LocaleCode;
29
+ };
30
+ }>;
31
+ export { default as Layout } from './components/Layout/index.vue';
32
+ export { default as Header } from './components/Layout/Header.vue';
33
+ export { default as Sidebar } from './components/Layout/Sidebar.vue';
34
+ export { default as Tabs } from './components/Layout/Tabs.vue';
35
+ export { default as Footer } from './components/Layout/Footer.vue';
36
+ export { default as Login } from './views/login/index.vue';
37
+ export { default as NotFound } from './views/error/404.vue';
38
+ export { default as Forbidden } from './views/error/403.vue';
39
+ export * from './composables/useApp';
40
+ export * from './composables/useAuth';
41
+ export * from './composables/useForm';
42
+ export * from './composables/useTable';
43
+ export * from './composables/useI18n';
44
+ export * from './utils/auth';
45
+ export * from './utils/permission';
46
+ export * from './utils/request';
47
+ export * from './utils/storage';
48
+ export * from './utils/config';
49
+ export * from './stores/app';
50
+ export * from './stores/auth';
51
+ export * from './stores/menu';
52
+ export * from './stores/user';
53
+ export * from './stores/locale';
54
+ export { default as router, resetRouter } from './router';
55
+ export * from './router/staticRoutes';
56
+ export * from './router/dynamicRoutes';
57
+ export { createLayoutRoute, createRouter } from './router/layoutRoute';
58
+ export { setupRouterGuards } from './router/guards';
59
+ export * from './api/auth';
60
+ export * from './api/system';
61
+ export * from './api/user';
62
+ export * from './enums';
63
+ export { default as permissionDirective } from './directives/permission';
package/dist/index.js ADDED
@@ -0,0 +1,99 @@
1
+ import { F as a, c as t, G as o, d as r, e as n, H as u, L as i, i as p, M as l, b as T, f as d, g, h as R, S as c, a as h, j as k, T as f, k as S, l as U, m, n as A, o as M, p as y, q as x, r as L, s as C, t as D, u as b, v as I, w as B, x as F, y as G, z as E, A as P, B as O, C as v, D as w, E as H, I as N, J as j, K as q, N as z } from "./index-DTWHgS2f.js";
2
+ import { K, b as X, A as Q, c as V, a as W, d as Y, e as Z, f as _, g as $, G as ee, D as se, E as ae, C as te, L as oe, h as re, i as ne, M as ue, N as ie, j as pe, k as le, y as Te, O as de, P as ge, l as Re, m as ce, n as he, z as ke, Q as fe, I as Se, R as Ue, F as me, x as Ae, S as Me, o as ye, p as xe, r as Le, q as Ce, T as De, U as be, H as Ie, J as Be, V as Fe, W as Ge, X as Ee, Y as Pe, Z as Oe, B as ve, _ as we, u as He, s as Ne, t as je, v as qe, w as ze } from "./user-CHxvQHYq.js";
3
+ export {
4
+ a as Footer,
5
+ t as Forbidden,
6
+ o as Gender,
7
+ r as GenderOptions,
8
+ n as GenderText,
9
+ u as Header,
10
+ i as Layout,
11
+ p as Login,
12
+ l as MenuType,
13
+ T as MenuTypeOptions,
14
+ d as MenuTypeText,
15
+ g as NotFound,
16
+ R as Sidebar,
17
+ c as Status,
18
+ h as StatusOptions,
19
+ k as StatusText,
20
+ f as Tabs,
21
+ K as appConfig,
22
+ X as batchDeleteUsers,
23
+ Q as clearToken,
24
+ S as createLayoutRoute,
25
+ V as createMenu,
26
+ W as createRole,
27
+ U as createRouter,
28
+ m as createTranslator,
29
+ Y as createUser,
30
+ A as createXtoApp,
31
+ M as defaultDynamicRoutes,
32
+ Z as deleteMenu,
33
+ _ as deleteRole,
34
+ $ as deleteUser,
35
+ ee as getApiBaseUrl,
36
+ se as getAppId,
37
+ ae as getBasePath,
38
+ te as getClientId,
39
+ oe as getCode,
40
+ re as getMenuList,
41
+ ne as getMenuTree,
42
+ ue as getRefreshTime,
43
+ ie as getRefreshToken,
44
+ pe as getRoleDetail,
45
+ le as getRoleList,
46
+ Te as getToken,
47
+ de as getTokenExpire,
48
+ ge as getTokenType,
49
+ Re as getUserDetail,
50
+ ce as getUserInfo,
51
+ he as getUserList,
52
+ y as hasPermission,
53
+ x as hasRole,
54
+ ke as hasToken,
55
+ fe as http,
56
+ Se as initAppConfig,
57
+ L as isAdmin,
58
+ Ue as isTokenExpired,
59
+ C as layoutRoute,
60
+ me as loadRuntimeConfig,
61
+ Ae as local,
62
+ Me as localStorageUtil,
63
+ ye as login,
64
+ xe as logout,
65
+ D as mockMenuData,
66
+ b as permissionDirective,
67
+ Le as refreshToken,
68
+ Ce as resetPassword,
69
+ I as resetRouter,
70
+ B as router,
71
+ De as session,
72
+ be as sessionStorageUtil,
73
+ Ie as setApiBaseUrl,
74
+ Be as setBasePath,
75
+ Fe as setCode,
76
+ Ge as setRefreshTime,
77
+ Ee as setRefreshToken,
78
+ Pe as setToken,
79
+ Oe as setTokenExpire,
80
+ ve as setTokenInfo,
81
+ we as setTokenType,
82
+ F as setupRouterGuards,
83
+ G as staticRoutes,
84
+ He as updateMenu,
85
+ Ne as updateRole,
86
+ je as updateRoleStatus,
87
+ qe as updateUser,
88
+ ze as updateUserStatus,
89
+ E as useApp,
90
+ P as useAppStore,
91
+ O as useAuth,
92
+ v as useAuthStore,
93
+ w as useForm,
94
+ H as useI18n,
95
+ N as useLocaleStore,
96
+ j as useMenuStore,
97
+ q as useTable,
98
+ z as useUserStore
99
+ };
package/dist/main.d.ts ADDED
File without changes
@@ -0,0 +1,30 @@
1
+ import { RouteRecordRaw } from 'vue-router';
2
+ export declare const layoutRoute: RouteRecordRaw;
3
+ export declare const defaultDynamicRoutes: RouteRecordRaw[];
4
+ export declare const mockMenuData: ({
5
+ menuCode: string;
6
+ menuName: string;
7
+ menuUrl: string;
8
+ icon: string;
9
+ closable: boolean;
10
+ isDefault: boolean;
11
+ isOut: boolean;
12
+ children?: undefined;
13
+ } | {
14
+ menuCode: string;
15
+ menuName: string;
16
+ menuUrl: string;
17
+ icon: string;
18
+ closable: boolean;
19
+ isDefault: boolean;
20
+ isOut: boolean;
21
+ children: {
22
+ menuCode: string;
23
+ menuName: string;
24
+ menuUrl: string;
25
+ icon: string;
26
+ closable: boolean;
27
+ isDefault: boolean;
28
+ isOut: boolean;
29
+ }[];
30
+ })[];
@@ -0,0 +1,17 @@
1
+ import { Router } from 'vue-router';
2
+ interface RouterGuardOptions {
3
+ whiteList?: string[];
4
+ loginPath?: string;
5
+ homePath?: string;
6
+ appId?: string;
7
+ fetchUserInfo?: () => Promise<any>;
8
+ fetchMenu?: () => Promise<any>;
9
+ onLoginSuccess?: () => void;
10
+ }
11
+ /**
12
+ * 设置路由守卫
13
+ * @param router 路由实例
14
+ * @param options 配置选项
15
+ */
16
+ export declare function setupRouterGuards(router: Router, options?: RouterGuardOptions): void;
17
+ export {};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 路由配置
3
+ */
4
+ declare const router: import('vue-router').Router;
5
+ export declare function resetRouter(): void;
6
+ export default router;
@@ -0,0 +1,23 @@
1
+ import { RouteRecordRaw, Router } from 'vue-router';
2
+ interface LayoutRouteOptions {
3
+ indexPath?: string;
4
+ logoSrc?: string;
5
+ }
6
+ interface CreateRouterOptions {
7
+ base?: string;
8
+ }
9
+ /**
10
+ * 创建布局路由
11
+ * @param children 子路由配置
12
+ * @param options 配置选项
13
+ * @returns 布局路由配置
14
+ */
15
+ export declare function createLayoutRoute(children: RouteRecordRaw[], options?: LayoutRouteOptions): RouteRecordRaw;
16
+ /**
17
+ * 创建路由实例
18
+ * @param routes 路由配置数组
19
+ * @param options 配置选项
20
+ * @returns 路由实例
21
+ */
22
+ export declare function createRouter(routes: RouteRecordRaw[], options?: CreateRouterOptions): Router;
23
+ export {};
@@ -0,0 +1,2 @@
1
+ import { RouteRecordRaw } from 'vue-router';
2
+ export declare const staticRoutes: RouteRecordRaw[];
@@ -0,0 +1,99 @@
1
+ /**
2
+ * 应用状态
3
+ */
4
+ export type ThemeMode = 'light' | 'dark';
5
+ export type LayoutMode = 'sidebar' | 'top' | 'mix';
6
+ export declare const useAppStore: import('pinia').StoreDefinition<"app", Pick<{
7
+ appName: import('vue').Ref<string, string>;
8
+ indexPath: import('vue').Ref<string, string>;
9
+ loginPath: import('vue').Ref<string, string>;
10
+ isDark: import('vue').Ref<boolean, boolean>;
11
+ theme: import('vue').Ref<ThemeMode, ThemeMode>;
12
+ layout: import('vue').Ref<LayoutMode, LayoutMode>;
13
+ isCollapsed: import('vue').Ref<boolean, boolean>;
14
+ showTabs: import('vue').Ref<boolean, boolean>;
15
+ showFooter: import('vue').Ref<boolean, boolean>;
16
+ showBreadcrumb: import('vue').Ref<boolean, boolean>;
17
+ primaryColor: import('vue').Ref<string, string>;
18
+ cachedViews: import('vue').Ref<string[], string[]>;
19
+ mixSubMenus: import('vue').Ref<any[], any[]>;
20
+ themeClass: import('vue').ComputedRef<"light" | "dark">;
21
+ setAppName: (name: string) => void;
22
+ setIndexPath: (path: string) => void;
23
+ setLoginPath: (path: string) => void;
24
+ toggleTheme: () => void;
25
+ toggleCollapse: () => void;
26
+ setTheme: (mode: ThemeMode) => void;
27
+ setLayout: (mode: LayoutMode) => void;
28
+ toggleTabs: () => void;
29
+ toggleFooter: () => void;
30
+ toggleBreadcrumb: () => void;
31
+ setPrimaryColor: (color: string) => void;
32
+ addCachedView: (name: string) => void;
33
+ removeCachedView: (name: string) => void;
34
+ clearCachedViews: () => void;
35
+ setMixSubMenus: (menus: any[]) => void;
36
+ initTheme: () => void;
37
+ }, "appName" | "indexPath" | "loginPath" | "isDark" | "theme" | "layout" | "isCollapsed" | "showTabs" | "showFooter" | "showBreadcrumb" | "primaryColor" | "cachedViews" | "mixSubMenus">, Pick<{
38
+ appName: import('vue').Ref<string, string>;
39
+ indexPath: import('vue').Ref<string, string>;
40
+ loginPath: import('vue').Ref<string, string>;
41
+ isDark: import('vue').Ref<boolean, boolean>;
42
+ theme: import('vue').Ref<ThemeMode, ThemeMode>;
43
+ layout: import('vue').Ref<LayoutMode, LayoutMode>;
44
+ isCollapsed: import('vue').Ref<boolean, boolean>;
45
+ showTabs: import('vue').Ref<boolean, boolean>;
46
+ showFooter: import('vue').Ref<boolean, boolean>;
47
+ showBreadcrumb: import('vue').Ref<boolean, boolean>;
48
+ primaryColor: import('vue').Ref<string, string>;
49
+ cachedViews: import('vue').Ref<string[], string[]>;
50
+ mixSubMenus: import('vue').Ref<any[], any[]>;
51
+ themeClass: import('vue').ComputedRef<"light" | "dark">;
52
+ setAppName: (name: string) => void;
53
+ setIndexPath: (path: string) => void;
54
+ setLoginPath: (path: string) => void;
55
+ toggleTheme: () => void;
56
+ toggleCollapse: () => void;
57
+ setTheme: (mode: ThemeMode) => void;
58
+ setLayout: (mode: LayoutMode) => void;
59
+ toggleTabs: () => void;
60
+ toggleFooter: () => void;
61
+ toggleBreadcrumb: () => void;
62
+ setPrimaryColor: (color: string) => void;
63
+ addCachedView: (name: string) => void;
64
+ removeCachedView: (name: string) => void;
65
+ clearCachedViews: () => void;
66
+ setMixSubMenus: (menus: any[]) => void;
67
+ initTheme: () => void;
68
+ }, "themeClass">, Pick<{
69
+ appName: import('vue').Ref<string, string>;
70
+ indexPath: import('vue').Ref<string, string>;
71
+ loginPath: import('vue').Ref<string, string>;
72
+ isDark: import('vue').Ref<boolean, boolean>;
73
+ theme: import('vue').Ref<ThemeMode, ThemeMode>;
74
+ layout: import('vue').Ref<LayoutMode, LayoutMode>;
75
+ isCollapsed: import('vue').Ref<boolean, boolean>;
76
+ showTabs: import('vue').Ref<boolean, boolean>;
77
+ showFooter: import('vue').Ref<boolean, boolean>;
78
+ showBreadcrumb: import('vue').Ref<boolean, boolean>;
79
+ primaryColor: import('vue').Ref<string, string>;
80
+ cachedViews: import('vue').Ref<string[], string[]>;
81
+ mixSubMenus: import('vue').Ref<any[], any[]>;
82
+ themeClass: import('vue').ComputedRef<"light" | "dark">;
83
+ setAppName: (name: string) => void;
84
+ setIndexPath: (path: string) => void;
85
+ setLoginPath: (path: string) => void;
86
+ toggleTheme: () => void;
87
+ toggleCollapse: () => void;
88
+ setTheme: (mode: ThemeMode) => void;
89
+ setLayout: (mode: LayoutMode) => void;
90
+ toggleTabs: () => void;
91
+ toggleFooter: () => void;
92
+ toggleBreadcrumb: () => void;
93
+ setPrimaryColor: (color: string) => void;
94
+ addCachedView: (name: string) => void;
95
+ removeCachedView: (name: string) => void;
96
+ clearCachedViews: () => void;
97
+ setMixSubMenus: (menus: any[]) => void;
98
+ initTheme: () => void;
99
+ }, "setAppName" | "setIndexPath" | "setLoginPath" | "toggleTheme" | "toggleCollapse" | "setTheme" | "setLayout" | "toggleTabs" | "toggleFooter" | "toggleBreadcrumb" | "setPrimaryColor" | "addCachedView" | "removeCachedView" | "clearCachedViews" | "setMixSubMenus" | "initTheme">>;
@@ -0,0 +1,41 @@
1
+ import { TokenInfo } from '../utils/auth';
2
+ export declare const useAuthStore: import('pinia').StoreDefinition<"auth", Pick<{
3
+ token: import('vue').Ref<string | null, string | null>;
4
+ isLoggedIn: import('vue').ComputedRef<boolean>;
5
+ baseUrl: import('vue').Ref<string, string>;
6
+ appId: import('vue').Ref<string, string>;
7
+ clientId: import('vue').Ref<string, string>;
8
+ loginPath: import('vue').Ref<string, string>;
9
+ login: (tokenInfo: TokenInfo) => void;
10
+ logout: () => void;
11
+ setBaseUrl: (url: string) => void;
12
+ setAppId: (id: string) => void;
13
+ setClientId: (id: string) => void;
14
+ setLoginPath: (path: string) => void;
15
+ }, "token" | "loginPath" | "appId" | "baseUrl" | "clientId">, Pick<{
16
+ token: import('vue').Ref<string | null, string | null>;
17
+ isLoggedIn: import('vue').ComputedRef<boolean>;
18
+ baseUrl: import('vue').Ref<string, string>;
19
+ appId: import('vue').Ref<string, string>;
20
+ clientId: import('vue').Ref<string, string>;
21
+ loginPath: import('vue').Ref<string, string>;
22
+ login: (tokenInfo: TokenInfo) => void;
23
+ logout: () => void;
24
+ setBaseUrl: (url: string) => void;
25
+ setAppId: (id: string) => void;
26
+ setClientId: (id: string) => void;
27
+ setLoginPath: (path: string) => void;
28
+ }, "isLoggedIn">, Pick<{
29
+ token: import('vue').Ref<string | null, string | null>;
30
+ isLoggedIn: import('vue').ComputedRef<boolean>;
31
+ baseUrl: import('vue').Ref<string, string>;
32
+ appId: import('vue').Ref<string, string>;
33
+ clientId: import('vue').Ref<string, string>;
34
+ loginPath: import('vue').Ref<string, string>;
35
+ login: (tokenInfo: TokenInfo) => void;
36
+ logout: () => void;
37
+ setBaseUrl: (url: string) => void;
38
+ setAppId: (id: string) => void;
39
+ setClientId: (id: string) => void;
40
+ setLoginPath: (path: string) => void;
41
+ }, "login" | "setLoginPath" | "logout" | "setBaseUrl" | "setAppId" | "setClientId">>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Pinia Store 入口
3
+ */
4
+ declare const pinia: import('pinia').Pinia;
5
+ export default pinia;
6
+ export * from './user';
7
+ export * from './auth';
8
+ export * from './menu';
9
+ export * from './app';
10
+ export * from './locale';
@@ -0,0 +1,42 @@
1
+ import { LocaleCode, LocaleMessages } from '@xto/core/locale';
2
+ export type { LocaleCode, LocaleMessages };
3
+ export declare const useLocaleStore: import('pinia').StoreDefinition<"locale", Pick<{
4
+ locale: import('vue').Ref<LocaleCode, LocaleCode>;
5
+ localeName: import('vue').ComputedRef<string>;
6
+ locales: {
7
+ code: LocaleCode;
8
+ name: string;
9
+ }[];
10
+ messages: import('vue').ComputedRef<LocaleMessages>;
11
+ t: (key: string, ...args: (string | number)[]) => string;
12
+ changeLocale: (code: LocaleCode) => void;
13
+ addMessages: (msgs: LocaleMessages) => void;
14
+ initLocale: () => void;
15
+ provider: any;
16
+ }, "locale" | "locales" | "provider">, Pick<{
17
+ locale: import('vue').Ref<LocaleCode, LocaleCode>;
18
+ localeName: import('vue').ComputedRef<string>;
19
+ locales: {
20
+ code: LocaleCode;
21
+ name: string;
22
+ }[];
23
+ messages: import('vue').ComputedRef<LocaleMessages>;
24
+ t: (key: string, ...args: (string | number)[]) => string;
25
+ changeLocale: (code: LocaleCode) => void;
26
+ addMessages: (msgs: LocaleMessages) => void;
27
+ initLocale: () => void;
28
+ provider: any;
29
+ }, "messages" | "localeName" | "provider">, Pick<{
30
+ locale: import('vue').Ref<LocaleCode, LocaleCode>;
31
+ localeName: import('vue').ComputedRef<string>;
32
+ locales: {
33
+ code: LocaleCode;
34
+ name: string;
35
+ }[];
36
+ messages: import('vue').ComputedRef<LocaleMessages>;
37
+ t: (key: string, ...args: (string | number)[]) => string;
38
+ changeLocale: (code: LocaleCode) => void;
39
+ addMessages: (msgs: LocaleMessages) => void;
40
+ initLocale: () => void;
41
+ provider: any;
42
+ }, "t" | "changeLocale" | "addMessages" | "initLocale" | "provider">>;
@@ -0,0 +1,83 @@
1
+ import { MenuItem } from '../types/api';
2
+ export declare const useMenuStore: import('pinia').StoreDefinition<"menu", Pick<{
3
+ menuList: import('vue').Ref<{
4
+ menuCode: string;
5
+ menuName: string;
6
+ menuUrl: string;
7
+ icon?: string | undefined;
8
+ closable?: boolean | undefined;
9
+ isDefault?: boolean | undefined;
10
+ isOut?: boolean | undefined;
11
+ type?: number | undefined;
12
+ children?: /*elided*/ any[] | undefined;
13
+ }[], MenuItem[] | {
14
+ menuCode: string;
15
+ menuName: string;
16
+ menuUrl: string;
17
+ icon?: string | undefined;
18
+ closable?: boolean | undefined;
19
+ isDefault?: boolean | undefined;
20
+ isOut?: boolean | undefined;
21
+ type?: number | undefined;
22
+ children?: /*elided*/ any[] | undefined;
23
+ }[]>;
24
+ permissions: import('vue').Ref<string[], string[]>;
25
+ hasMenu: import('vue').ComputedRef<boolean>;
26
+ setMenuList: (menus: MenuItem[]) => void;
27
+ clearMenu: () => void;
28
+ hasPermission: (permission: string | string[]) => boolean;
29
+ }, "menuList" | "permissions">, Pick<{
30
+ menuList: import('vue').Ref<{
31
+ menuCode: string;
32
+ menuName: string;
33
+ menuUrl: string;
34
+ icon?: string | undefined;
35
+ closable?: boolean | undefined;
36
+ isDefault?: boolean | undefined;
37
+ isOut?: boolean | undefined;
38
+ type?: number | undefined;
39
+ children?: /*elided*/ any[] | undefined;
40
+ }[], MenuItem[] | {
41
+ menuCode: string;
42
+ menuName: string;
43
+ menuUrl: string;
44
+ icon?: string | undefined;
45
+ closable?: boolean | undefined;
46
+ isDefault?: boolean | undefined;
47
+ isOut?: boolean | undefined;
48
+ type?: number | undefined;
49
+ children?: /*elided*/ any[] | undefined;
50
+ }[]>;
51
+ permissions: import('vue').Ref<string[], string[]>;
52
+ hasMenu: import('vue').ComputedRef<boolean>;
53
+ setMenuList: (menus: MenuItem[]) => void;
54
+ clearMenu: () => void;
55
+ hasPermission: (permission: string | string[]) => boolean;
56
+ }, "hasMenu">, Pick<{
57
+ menuList: import('vue').Ref<{
58
+ menuCode: string;
59
+ menuName: string;
60
+ menuUrl: string;
61
+ icon?: string | undefined;
62
+ closable?: boolean | undefined;
63
+ isDefault?: boolean | undefined;
64
+ isOut?: boolean | undefined;
65
+ type?: number | undefined;
66
+ children?: /*elided*/ any[] | undefined;
67
+ }[], MenuItem[] | {
68
+ menuCode: string;
69
+ menuName: string;
70
+ menuUrl: string;
71
+ icon?: string | undefined;
72
+ closable?: boolean | undefined;
73
+ isDefault?: boolean | undefined;
74
+ isOut?: boolean | undefined;
75
+ type?: number | undefined;
76
+ children?: /*elided*/ any[] | undefined;
77
+ }[]>;
78
+ permissions: import('vue').Ref<string[], string[]>;
79
+ hasMenu: import('vue').ComputedRef<boolean>;
80
+ setMenuList: (menus: MenuItem[]) => void;
81
+ clearMenu: () => void;
82
+ hasPermission: (permission: string | string[]) => boolean;
83
+ }, "setMenuList" | "clearMenu" | "hasPermission">>;
@@ -0,0 +1,92 @@
1
+ import { UserInfo } from '../types/api';
2
+ export declare const useUserStore: import('pinia').StoreDefinition<"user", Pick<{
3
+ userInfo: import('vue').Ref<{
4
+ appId: string;
5
+ userId: string;
6
+ userName: string;
7
+ departmentName?: string | undefined;
8
+ email?: string | undefined;
9
+ mobilePhone?: string | undefined;
10
+ positionName?: string | undefined;
11
+ avatar?: string | undefined;
12
+ } | null, UserInfo | {
13
+ appId: string;
14
+ userId: string;
15
+ userName: string;
16
+ departmentName?: string | undefined;
17
+ email?: string | undefined;
18
+ mobilePhone?: string | undefined;
19
+ positionName?: string | undefined;
20
+ avatar?: string | undefined;
21
+ } | null>;
22
+ isLoggedIn: import('vue').ComputedRef<boolean>;
23
+ userId: import('vue').ComputedRef<string>;
24
+ userName: import('vue').ComputedRef<string>;
25
+ departmentName: import('vue').ComputedRef<string>;
26
+ email: import('vue').ComputedRef<string>;
27
+ mobilePhone: import('vue').ComputedRef<string>;
28
+ positionName: import('vue').ComputedRef<string>;
29
+ avatar: import('vue').ComputedRef<string>;
30
+ setUserInfo: (info: UserInfo) => void;
31
+ clearUserInfo: () => void;
32
+ }, "userInfo">, Pick<{
33
+ userInfo: import('vue').Ref<{
34
+ appId: string;
35
+ userId: string;
36
+ userName: string;
37
+ departmentName?: string | undefined;
38
+ email?: string | undefined;
39
+ mobilePhone?: string | undefined;
40
+ positionName?: string | undefined;
41
+ avatar?: string | undefined;
42
+ } | null, UserInfo | {
43
+ appId: string;
44
+ userId: string;
45
+ userName: string;
46
+ departmentName?: string | undefined;
47
+ email?: string | undefined;
48
+ mobilePhone?: string | undefined;
49
+ positionName?: string | undefined;
50
+ avatar?: string | undefined;
51
+ } | null>;
52
+ isLoggedIn: import('vue').ComputedRef<boolean>;
53
+ userId: import('vue').ComputedRef<string>;
54
+ userName: import('vue').ComputedRef<string>;
55
+ departmentName: import('vue').ComputedRef<string>;
56
+ email: import('vue').ComputedRef<string>;
57
+ mobilePhone: import('vue').ComputedRef<string>;
58
+ positionName: import('vue').ComputedRef<string>;
59
+ avatar: import('vue').ComputedRef<string>;
60
+ setUserInfo: (info: UserInfo) => void;
61
+ clearUserInfo: () => void;
62
+ }, "userId" | "userName" | "departmentName" | "email" | "mobilePhone" | "positionName" | "avatar" | "isLoggedIn">, Pick<{
63
+ userInfo: import('vue').Ref<{
64
+ appId: string;
65
+ userId: string;
66
+ userName: string;
67
+ departmentName?: string | undefined;
68
+ email?: string | undefined;
69
+ mobilePhone?: string | undefined;
70
+ positionName?: string | undefined;
71
+ avatar?: string | undefined;
72
+ } | null, UserInfo | {
73
+ appId: string;
74
+ userId: string;
75
+ userName: string;
76
+ departmentName?: string | undefined;
77
+ email?: string | undefined;
78
+ mobilePhone?: string | undefined;
79
+ positionName?: string | undefined;
80
+ avatar?: string | undefined;
81
+ } | null>;
82
+ isLoggedIn: import('vue').ComputedRef<boolean>;
83
+ userId: import('vue').ComputedRef<string>;
84
+ userName: import('vue').ComputedRef<string>;
85
+ departmentName: import('vue').ComputedRef<string>;
86
+ email: import('vue').ComputedRef<string>;
87
+ mobilePhone: import('vue').ComputedRef<string>;
88
+ positionName: import('vue').ComputedRef<string>;
89
+ avatar: import('vue').ComputedRef<string>;
90
+ setUserInfo: (info: UserInfo) => void;
91
+ clearUserInfo: () => void;
92
+ }, "setUserInfo" | "clearUserInfo">>;