@campus-admin/core 1.0.0 → 2.0.1

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 (65) hide show
  1. package/README.md +24 -159
  2. package/dist/app.d.ts +2 -0
  3. package/dist/context.d.ts +29 -15
  4. package/dist/copyright.d.ts +2 -0
  5. package/dist/i18n.d.ts +352 -0
  6. package/dist/index.d.ts +23 -32
  7. package/dist/index.js +2475 -424
  8. package/dist/layout/CaCopyright.vue.d.ts +3 -0
  9. package/dist/layout/CaLayout.vue.d.ts +3 -0
  10. package/dist/layout/HeaderBar.vue.d.ts +3 -0
  11. package/dist/layout/PageHeader.vue.d.ts +3 -0
  12. package/dist/layout/PageTitle.vue.d.ts +3 -0
  13. package/dist/layout/SideMenu.vue.d.ts +3 -0
  14. package/dist/layout/TabsBar.vue.d.ts +3 -0
  15. package/dist/layout/breakpoints.d.ts +21 -0
  16. package/dist/{components/overlay/ca-loading-overlay.vue.d.ts → pages/AuthPreview.vue.d.ts} +2 -6
  17. package/dist/{components/overlay/ca-toast-list.vue.d.ts → pages/ExceptionPage.vue.d.ts} +2 -5
  18. package/dist/{components/overlay/ca-overlay-list.vue.d.ts → pages/ForgotPage.vue.d.ts} +2 -5
  19. package/dist/pages/LoginPage.vue.d.ts +3 -0
  20. package/dist/pages/LoginSplit.vue.d.ts +6 -0
  21. package/dist/pages/RegisterPage.vue.d.ts +6 -0
  22. package/dist/pages/auth/AuthIcon.vue.d.ts +10 -0
  23. package/dist/pages/auth/AuthShell.vue.d.ts +29 -0
  24. package/dist/pages/auth/CaptchaField.vue.d.ts +20 -0
  25. package/dist/pages/auth/ForgotForm.vue.d.ts +6 -0
  26. package/dist/pages/auth/LoginForm.vue.d.ts +6 -0
  27. package/dist/pages/auth/RegisterForm.vue.d.ts +6 -0
  28. package/dist/pages/auth/SmsField.vue.d.ts +14 -0
  29. package/dist/pages/auth/WechatPane.vue.d.ts +3 -0
  30. package/dist/pages/auth/options.d.ts +15 -0
  31. package/dist/router.d.ts +15 -0
  32. package/dist/security.d.ts +15 -0
  33. package/dist/services/auth.d.ts +11 -0
  34. package/dist/services/ca.d.ts +48 -0
  35. package/dist/services/feedback.d.ts +54 -0
  36. package/dist/storage.d.ts +12 -0
  37. package/dist/stores/layout.d.ts +41 -0
  38. package/dist/stores/session.d.ts +53 -0
  39. package/dist/stores/tabs.d.ts +49 -0
  40. package/dist/stores/theme.d.ts +280 -0
  41. package/dist/style.css +2 -0
  42. package/dist/tabs-policy.d.ts +4 -0
  43. package/dist/types.d.ts +224 -0
  44. package/package.json +23 -61
  45. package/dist/application.d.ts +0 -51
  46. package/dist/campus.d.ts +0 -9
  47. package/dist/components/overlay/index.d.ts +0 -6
  48. package/dist/components/overlay/style/index.d.ts +0 -10
  49. package/dist/container.d.ts +0 -21
  50. package/dist/contracts/config.d.ts +0 -13
  51. package/dist/contracts/provider.d.ts +0 -24
  52. package/dist/core.css +0 -2
  53. package/dist/facade.d.ts +0 -15
  54. package/dist/index.umd.cjs +0 -1
  55. package/dist/plugin.d.ts +0 -49
  56. package/dist/services/index.d.ts +0 -7
  57. package/dist/services/loading.d.ts +0 -21
  58. package/dist/services/modal.d.ts +0 -47
  59. package/dist/services/store.d.ts +0 -20
  60. package/dist/services/toast.d.ts +0 -19
  61. package/dist/services/use-store.d.ts +0 -9
  62. package/dist/vue-application.d.ts +0 -21
  63. package/dist/vue.d.ts +0 -8
  64. package/types/ca.d.ts +0 -22
  65. /package/dist/{components/overlay/ca-overlay-host.vue.d.ts → CampusRoot.vue.d.ts} +0 -0
@@ -0,0 +1,280 @@
1
+ import { type ThemeLayers, type ThemeMode } from '@campus-admin/theme';
2
+ /** 盒子样式:卡片类容器用阴影还是描边;用户层设置,默认阴影 */
3
+ export type BoxStyle = 'border' | 'shadow';
4
+ export declare const useThemeStore: import("pinia").StoreDefinition<"campus-theme", Pick<{
5
+ layers: import("vue").Ref<{
6
+ tenantDefault?: {
7
+ locks?: import("@campus-admin/theme").ThemeField[] | undefined;
8
+ style?: string | undefined;
9
+ primary?: string | undefined;
10
+ headerBg?: string | undefined;
11
+ login?: {
12
+ type: "color";
13
+ value: string;
14
+ } | {
15
+ type: "gradient";
16
+ value: string;
17
+ } | {
18
+ type: "image";
19
+ value: string;
20
+ } | undefined;
21
+ logo?: string | undefined;
22
+ siteName?: string | undefined;
23
+ } | undefined;
24
+ tenant?: {
25
+ locks?: import("@campus-admin/theme").ThemeField[] | undefined;
26
+ style?: string | undefined;
27
+ primary?: string | undefined;
28
+ headerBg?: string | undefined;
29
+ login?: {
30
+ type: "color";
31
+ value: string;
32
+ } | {
33
+ type: "gradient";
34
+ value: string;
35
+ } | {
36
+ type: "image";
37
+ value: string;
38
+ } | undefined;
39
+ logo?: string | undefined;
40
+ siteName?: string | undefined;
41
+ } | undefined;
42
+ }, ThemeLayers | {
43
+ tenantDefault?: {
44
+ locks?: import("@campus-admin/theme").ThemeField[] | undefined;
45
+ style?: string | undefined;
46
+ primary?: string | undefined;
47
+ headerBg?: string | undefined;
48
+ login?: {
49
+ type: "color";
50
+ value: string;
51
+ } | {
52
+ type: "gradient";
53
+ value: string;
54
+ } | {
55
+ type: "image";
56
+ value: string;
57
+ } | undefined;
58
+ logo?: string | undefined;
59
+ siteName?: string | undefined;
60
+ } | undefined;
61
+ tenant?: {
62
+ locks?: import("@campus-admin/theme").ThemeField[] | undefined;
63
+ style?: string | undefined;
64
+ primary?: string | undefined;
65
+ headerBg?: string | undefined;
66
+ login?: {
67
+ type: "color";
68
+ value: string;
69
+ } | {
70
+ type: "gradient";
71
+ value: string;
72
+ } | {
73
+ type: "image";
74
+ value: string;
75
+ } | undefined;
76
+ logo?: string | undefined;
77
+ siteName?: string | undefined;
78
+ } | undefined;
79
+ }>;
80
+ mode: import("vue").Ref<ThemeMode, ThemeMode>;
81
+ boxStyle: import("vue").Ref<BoxStyle, BoxStyle>;
82
+ setBoxStyle: (next: BoxStyle) => void;
83
+ userPrimary: import("vue").Ref<string | undefined, string | undefined>;
84
+ primaryLocked: import("vue").ComputedRef<boolean>;
85
+ setPrimary: (color: string | undefined) => void;
86
+ theme: import("vue").ComputedRef<import("@campus-admin/theme").ResolvedTheme>;
87
+ issues: import("vue").ComputedRef<import("@campus-admin/theme").ThemeIssue[]>;
88
+ effectiveMode: import("vue").ComputedRef<"light" | "dark">;
89
+ cssVars: import("vue").ComputedRef<Record<string, string>>;
90
+ setMode: (next: ThemeMode, origin?: {
91
+ x: number;
92
+ y: number;
93
+ }) => void;
94
+ setLayers: (next: ThemeLayers, persist?: boolean) => void;
95
+ boot: () => Promise<void>;
96
+ }, "mode" | "layers" | "boxStyle" | "userPrimary">, Pick<{
97
+ layers: import("vue").Ref<{
98
+ tenantDefault?: {
99
+ locks?: import("@campus-admin/theme").ThemeField[] | undefined;
100
+ style?: string | undefined;
101
+ primary?: string | undefined;
102
+ headerBg?: string | undefined;
103
+ login?: {
104
+ type: "color";
105
+ value: string;
106
+ } | {
107
+ type: "gradient";
108
+ value: string;
109
+ } | {
110
+ type: "image";
111
+ value: string;
112
+ } | undefined;
113
+ logo?: string | undefined;
114
+ siteName?: string | undefined;
115
+ } | undefined;
116
+ tenant?: {
117
+ locks?: import("@campus-admin/theme").ThemeField[] | undefined;
118
+ style?: string | undefined;
119
+ primary?: string | undefined;
120
+ headerBg?: string | undefined;
121
+ login?: {
122
+ type: "color";
123
+ value: string;
124
+ } | {
125
+ type: "gradient";
126
+ value: string;
127
+ } | {
128
+ type: "image";
129
+ value: string;
130
+ } | undefined;
131
+ logo?: string | undefined;
132
+ siteName?: string | undefined;
133
+ } | undefined;
134
+ }, ThemeLayers | {
135
+ tenantDefault?: {
136
+ locks?: import("@campus-admin/theme").ThemeField[] | undefined;
137
+ style?: string | undefined;
138
+ primary?: string | undefined;
139
+ headerBg?: string | undefined;
140
+ login?: {
141
+ type: "color";
142
+ value: string;
143
+ } | {
144
+ type: "gradient";
145
+ value: string;
146
+ } | {
147
+ type: "image";
148
+ value: string;
149
+ } | undefined;
150
+ logo?: string | undefined;
151
+ siteName?: string | undefined;
152
+ } | undefined;
153
+ tenant?: {
154
+ locks?: import("@campus-admin/theme").ThemeField[] | undefined;
155
+ style?: string | undefined;
156
+ primary?: string | undefined;
157
+ headerBg?: string | undefined;
158
+ login?: {
159
+ type: "color";
160
+ value: string;
161
+ } | {
162
+ type: "gradient";
163
+ value: string;
164
+ } | {
165
+ type: "image";
166
+ value: string;
167
+ } | undefined;
168
+ logo?: string | undefined;
169
+ siteName?: string | undefined;
170
+ } | undefined;
171
+ }>;
172
+ mode: import("vue").Ref<ThemeMode, ThemeMode>;
173
+ boxStyle: import("vue").Ref<BoxStyle, BoxStyle>;
174
+ setBoxStyle: (next: BoxStyle) => void;
175
+ userPrimary: import("vue").Ref<string | undefined, string | undefined>;
176
+ primaryLocked: import("vue").ComputedRef<boolean>;
177
+ setPrimary: (color: string | undefined) => void;
178
+ theme: import("vue").ComputedRef<import("@campus-admin/theme").ResolvedTheme>;
179
+ issues: import("vue").ComputedRef<import("@campus-admin/theme").ThemeIssue[]>;
180
+ effectiveMode: import("vue").ComputedRef<"light" | "dark">;
181
+ cssVars: import("vue").ComputedRef<Record<string, string>>;
182
+ setMode: (next: ThemeMode, origin?: {
183
+ x: number;
184
+ y: number;
185
+ }) => void;
186
+ setLayers: (next: ThemeLayers, persist?: boolean) => void;
187
+ boot: () => Promise<void>;
188
+ }, "primaryLocked" | "theme" | "issues" | "effectiveMode" | "cssVars">, Pick<{
189
+ layers: import("vue").Ref<{
190
+ tenantDefault?: {
191
+ locks?: import("@campus-admin/theme").ThemeField[] | undefined;
192
+ style?: string | undefined;
193
+ primary?: string | undefined;
194
+ headerBg?: string | undefined;
195
+ login?: {
196
+ type: "color";
197
+ value: string;
198
+ } | {
199
+ type: "gradient";
200
+ value: string;
201
+ } | {
202
+ type: "image";
203
+ value: string;
204
+ } | undefined;
205
+ logo?: string | undefined;
206
+ siteName?: string | undefined;
207
+ } | undefined;
208
+ tenant?: {
209
+ locks?: import("@campus-admin/theme").ThemeField[] | undefined;
210
+ style?: string | undefined;
211
+ primary?: string | undefined;
212
+ headerBg?: string | undefined;
213
+ login?: {
214
+ type: "color";
215
+ value: string;
216
+ } | {
217
+ type: "gradient";
218
+ value: string;
219
+ } | {
220
+ type: "image";
221
+ value: string;
222
+ } | undefined;
223
+ logo?: string | undefined;
224
+ siteName?: string | undefined;
225
+ } | undefined;
226
+ }, ThemeLayers | {
227
+ tenantDefault?: {
228
+ locks?: import("@campus-admin/theme").ThemeField[] | undefined;
229
+ style?: string | undefined;
230
+ primary?: string | undefined;
231
+ headerBg?: string | undefined;
232
+ login?: {
233
+ type: "color";
234
+ value: string;
235
+ } | {
236
+ type: "gradient";
237
+ value: string;
238
+ } | {
239
+ type: "image";
240
+ value: string;
241
+ } | undefined;
242
+ logo?: string | undefined;
243
+ siteName?: string | undefined;
244
+ } | undefined;
245
+ tenant?: {
246
+ locks?: import("@campus-admin/theme").ThemeField[] | undefined;
247
+ style?: string | undefined;
248
+ primary?: string | undefined;
249
+ headerBg?: string | undefined;
250
+ login?: {
251
+ type: "color";
252
+ value: string;
253
+ } | {
254
+ type: "gradient";
255
+ value: string;
256
+ } | {
257
+ type: "image";
258
+ value: string;
259
+ } | undefined;
260
+ logo?: string | undefined;
261
+ siteName?: string | undefined;
262
+ } | undefined;
263
+ }>;
264
+ mode: import("vue").Ref<ThemeMode, ThemeMode>;
265
+ boxStyle: import("vue").Ref<BoxStyle, BoxStyle>;
266
+ setBoxStyle: (next: BoxStyle) => void;
267
+ userPrimary: import("vue").Ref<string | undefined, string | undefined>;
268
+ primaryLocked: import("vue").ComputedRef<boolean>;
269
+ setPrimary: (color: string | undefined) => void;
270
+ theme: import("vue").ComputedRef<import("@campus-admin/theme").ResolvedTheme>;
271
+ issues: import("vue").ComputedRef<import("@campus-admin/theme").ThemeIssue[]>;
272
+ effectiveMode: import("vue").ComputedRef<"light" | "dark">;
273
+ cssVars: import("vue").ComputedRef<Record<string, string>>;
274
+ setMode: (next: ThemeMode, origin?: {
275
+ x: number;
276
+ y: number;
277
+ }) => void;
278
+ setLayers: (next: ThemeLayers, persist?: boolean) => void;
279
+ boot: () => Promise<void>;
280
+ }, "setBoxStyle" | "setPrimary" | "setMode" | "setLayers" | "boot">>;
package/dist/style.css ADDED
@@ -0,0 +1,2 @@
1
+ .ca-auth[data-v-47cc63eb]{container:ca-auth/inline-size}.ca-auth__stage[data-v-47cc63eb]{box-sizing:border-box;justify-content:center;align-items:center;min-height:100vh;padding:32px 16px;display:flex;position:relative}.ca-auth--preview .ca-auth__stage[data-v-47cc63eb]{border-radius:var(--ca-radius-lg);min-height:680px;overflow:hidden}.ca-auth__card[data-v-47cc63eb]{box-sizing:border-box;width:min(920px,100%);min-height:600px;color:var(--ca-text);background:var(--ca-bg-card);border-radius:var(--ca-radius-lg);grid-template-columns:45% 1fr;display:grid;overflow:hidden;box-shadow:0 12px 40px #00000038}.ca-auth__panel[data-v-47cc63eb]{color:var(--ca-color-on-primary);text-align:center;background:radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--ca-color-on-primary) 18%, transparent), transparent 55%), linear-gradient(160deg, color-mix(in srgb, var(--ca-color-primary) 88%, white), color-mix(in srgb, var(--ca-color-primary) 62%, black));flex-direction:column;justify-content:center;align-items:center;gap:22px;padding:32px;display:flex}.ca-auth__logo[data-v-47cc63eb]{object-fit:contain;max-width:160px;max-height:64px}.ca-auth__qrcode[data-v-47cc63eb]{box-sizing:border-box;border-radius:var(--ca-radius);background:#fff;width:168px;height:168px;padding:10px}.ca-auth__qrcode img[data-v-47cc63eb]{width:100%;height:100%;display:block}.ca-auth__site[data-v-47cc63eb]{margin:0;font-size:24px;font-weight:600}.ca-auth__caption[data-v-47cc63eb]{letter-spacing:1px;margin:0;font-size:14px;line-height:22px}.ca-auth__main[data-v-47cc63eb]{box-sizing:border-box;flex-direction:column;min-width:0;padding:36px 48px 16px;display:flex}.ca-auth__brand[data-v-47cc63eb]{justify-content:center;align-items:center;gap:10px;margin-bottom:20px;font-size:18px;font-weight:600;display:none}.ca-auth__brand img[data-v-47cc63eb]{max-height:36px}.ca-auth__tabs[data-v-47cc63eb]{border-bottom:1px solid var(--ca-border);gap:32px;margin-bottom:24px;display:flex}.ca-auth__tab[data-v-47cc63eb]{color:var(--ca-text-secondary);font:inherit;cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;margin-bottom:-1px;padding:0 2px 12px;font-size:18px;text-decoration:none}.ca-auth__tab[data-v-47cc63eb]:hover{color:var(--ca-color-primary-text)}.ca-auth__tab[data-v-47cc63eb]:focus-visible{outline:2px solid var(--ca-color-primary);outline-offset:2px}.ca-auth__tab--active[data-v-47cc63eb]{color:var(--ca-color-primary-text);border-bottom-color:var(--ca-color-primary)}.ca-auth__body[data-v-47cc63eb]{flex:1}.ca-auth__footer[data-v-47cc63eb]{color:var(--ca-text-secondary);text-align:center;padding-top:16px;font-size:12px;line-height:20px}.ca-auth__footer p[data-v-47cc63eb]{margin:0}.ca-auth__version[data-v-47cc63eb]{color:var(--ca-text-secondary);background:color-mix(in srgb, var(--ca-bg-card) 92%, transparent);border-radius:var(--ca-radius);padding:0 8px;font-size:12px;line-height:20px;position:absolute;bottom:10px;right:12px}@container ca-auth (width<=1200px){.ca-auth__card[data-v-47cc63eb]{grid-template-columns:40% 1fr;width:min(720px,100%)}.ca-auth__panel[data-v-47cc63eb]{padding:24px 20px}.ca-auth__qrcode[data-v-47cc63eb]{width:132px;height:132px}.ca-auth__main[data-v-47cc63eb]{padding:32px 32px 12px}}@container ca-auth (width<=768px){.ca-auth__stage[data-v-47cc63eb]{align-items:flex-start;padding:16px}.ca-auth__card[data-v-47cc63eb]{grid-template-columns:1fr;width:100%;min-height:0}.ca-auth__panel[data-v-47cc63eb]{display:none}.ca-auth__brand[data-v-47cc63eb]{display:flex}.ca-auth__main[data-v-47cc63eb]{padding:28px 20px 12px}.ca-auth__tabs[data-v-47cc63eb]{gap:24px}.ca-auth__version[data-v-47cc63eb]{width:fit-content;margin:12px auto 0;display:block;position:static}.ca-auth__stage[data-v-47cc63eb]{flex-direction:column}}.ca-auth-form{--el-component-size-large:46px}.ca-auth-form .ca-auth-row{gap:10px;width:100%;display:flex}.ca-auth-form .ca-auth-row>:first-child{flex:1;min-width:0}.ca-auth-alert{margin-bottom:16px}.ca-auth-captcha,.ca-auth-sms{height:46px;color:var(--ca-color-primary-text);font:inherit;cursor:pointer;background:var(--ca-color-primary-soft);border-radius:var(--ca-radius);border:1px solid #0000;flex:none;font-size:14px}.ca-auth-captcha{justify-content:center;align-items:center;width:120px;padding:0;font-size:12px;line-height:16px;display:flex;overflow:hidden}.ca-auth-captcha img{object-fit:cover;width:100%;height:100%;display:block}.ca-auth-sms{min-width:112px;padding:0 12px}.ca-auth-sms:disabled{color:var(--ca-text-secondary);cursor:not-allowed;background:var(--ca-bg-page);border-color:var(--ca-border)}.ca-auth-captcha:focus-visible,.ca-auth-sms:focus-visible{outline:2px solid var(--ca-color-primary);outline-offset:2px}.ca-auth-hint{color:var(--ca-text-secondary);margin:4px 0 0;font-size:12px;line-height:18px}.ca-auth-agreements{flex-wrap:wrap;gap:0 8px;display:inline-flex}.ca-auth-agreements a{color:var(--ca-color-primary-text);text-decoration:none}.ca-auth-agreements a:hover{text-decoration:underline}.ca-auth-form .ca-auth-submit{border-radius:5px;width:100%;height:50px;font-size:20px}.ca-auth-form .ca-auth-submit--off,.ca-auth-form .ca-auth-submit--off:hover{color:var(--ca-text-secondary);background:var(--ca-bg-page);border-color:var(--ca-border)}.ca-auth-links{justify-content:space-between;margin-top:14px;font-size:14px;display:flex}.ca-auth-links a,.ca-auth-help a{color:var(--ca-color-primary-text);text-decoration:none}.ca-auth-links a:hover,.ca-auth-help a:hover{text-decoration:underline}.ca-auth-help{color:var(--ca-text-secondary);margin-top:22px;font-size:13px;line-height:21px}.ca-auth-help h3{color:var(--ca-text);margin:0 0 6px;font-size:14px;font-weight:600}.ca-auth-help ol{margin:0;padding-left:18px}.ca-auth-off{text-align:center;padding:48px 0}.ca-auth-off h3{margin:0 0 8px;font-size:18px}.ca-auth-off p{color:var(--ca-text-secondary);margin:0}.ca-auth-wechat{flex-direction:column;align-items:center;gap:12px;padding:12px 0;display:flex}.ca-auth-wechat__code{box-sizing:border-box;color:#1f2937;border:1px solid var(--ca-border);border-radius:var(--ca-radius);background:#fff;width:180px;height:180px;padding:12px}.ca-auth-wechat__code img,.ca-auth-wechat__code svg{width:100%;height:100%;display:block}.ca-auth-wechat__hint{margin:0;font-size:16px}.ca-auth-wechat__note{color:var(--ca-text-secondary);margin:0;font-size:12px}.ca-auth-icon{color:var(--ca-text-secondary)}.ca-header[data-v-534bb61b]{height:var(--ca-header-height);background:var(--ca-header-bg);color:var(--ca-header-fg);flex:none;align-items:center;gap:32px;padding:0 20px;display:flex}.ca-header__hamburger.ca-header__icon[data-v-534bb61b]{display:none}.ca-header__brand[data-v-534bb61b]{width:calc(var(--ca-rail-width,84px) + var(--ca-side-panel-width,200px) + 6px - 20px - 32px);flex:none;align-items:center;gap:12px;display:flex;overflow:hidden}.ca-header__logo[data-v-534bb61b]{flex:none;width:40px;height:40px}.ca-header__titles[data-v-534bb61b]{flex-direction:column;line-height:1.25;display:flex}.ca-header__name[data-v-534bb61b]{font-size:20px;font-weight:700}.ca-header__subtitle[data-v-534bb61b]{color:var(--ca-header-fg-muted);font-size:12px}.ca-header__nav[data-v-534bb61b]{flex:1;gap:4px;min-width:0;display:flex}.ca-header__nav-item[data-v-534bb61b]{color:var(--ca-header-fg-muted);font:inherit;cursor:pointer;border-radius:var(--ca-radius);background:0 0;border:0;align-items:center;gap:6px;padding:8px 16px;font-size:16px;display:inline-flex}.ca-header__nav-item[data-v-534bb61b]:hover{background:var(--ca-header-hover);color:var(--ca-header-fg)}.ca-header__nav-item.is-active[data-v-534bb61b]{background:var(--ca-header-active);color:var(--ca-header-fg);font-weight:600}.ca-header__tools[data-v-534bb61b]{align-items:center;gap:6px;display:flex}.ca-header__search[data-v-534bb61b]{border:1px solid var(--ca-header-control);border-radius:var(--ca-radius);width:180px;height:34px;color:var(--ca-header-fg-muted);font:inherit;cursor:pointer;background:0 0;align-items:center;gap:8px;margin-right:8px;padding:0 8px 0 12px;font-size:13px;display:inline-flex}.ca-header__search[data-v-534bb61b]:hover{background:var(--ca-header-hover)}.ca-header__search-text[data-v-534bb61b]{text-align:left;flex:1}.ca-header__kbd[data-v-534bb61b]{border:1px solid var(--ca-header-control);font:inherit;border-radius:6px;padding:1px 6px;font-size:12px}.ca-header__icon[data-v-534bb61b]{border-radius:var(--ca-radius);width:36px;height:36px;color:var(--ca-header-fg);font:inherit;cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;display:inline-flex;position:relative}.ca-header__icon[data-v-534bb61b]:hover{background:var(--ca-header-hover)}.ca-header__icon-text[data-v-534bb61b]{font-size:13px;font-weight:600}.ca-header__dot[data-v-534bb61b]{border-radius:50%;width:7px;height:7px;position:absolute;top:6px;right:6px}.ca-header__dot.is-danger[data-v-534bb61b]{background:var(--ca-danger)}.ca-header__dot.is-success[data-v-534bb61b]{background:var(--ca-success)}.ca-header__user[data-v-534bb61b]{color:var(--ca-header-fg);cursor:pointer;background:0 0;border:0;align-items:center;gap:4px;margin-left:4px;padding:0;display:inline-flex}.ca-header__avatar[data-v-534bb61b]{background:var(--ca-header-control);border-radius:50%;justify-content:center;align-items:center;width:32px;height:32px;font-size:13px;font-weight:600;display:inline-flex}.ca-settings__group[data-v-534bb61b]{flex-direction:column;gap:16px;display:flex}.ca-settings__group+.ca-settings__group[data-v-534bb61b]{margin-top:28px}.ca-settings__title[data-v-534bb61b]{color:var(--ca-text);align-items:center;gap:12px;margin:0;font-size:14px;font-weight:600;display:flex}.ca-settings__title[data-v-534bb61b]:before,.ca-settings__title[data-v-534bb61b]:after{content:"";background:var(--ca-border);flex:1;height:1px}.ca-settings__segment[data-v-534bb61b]{border:1px solid var(--ca-border);border-radius:var(--ca-radius);background:var(--ca-bg-page);grid-template-columns:1fr 1fr;padding:3px;display:grid}.ca-settings__swatches[data-v-534bb61b]{flex-wrap:wrap;gap:10px;display:flex}.ca-settings__swatch[data-v-534bb61b]{cursor:pointer;border:2px solid #0000;border-radius:50%;width:28px;height:28px;padding:0;position:relative;box-shadow:inset 0 0 0 1px #00000026}.ca-settings__swatch.is-active[data-v-534bb61b]{border-color:var(--ca-bg-card);box-shadow:0 0 0 2px var(--ca-color-primary)}.ca-settings__swatch[data-v-534bb61b]:focus-visible{outline:2px solid var(--ca-color-primary);outline-offset:2px}.ca-settings__swatch.is-custom[data-v-534bb61b]{background:conic-gradient(red,#ff0,#0f0,#0ff,#00f,#f0f,red);overflow:hidden}.ca-settings__swatch.is-custom input[data-v-534bb61b]{opacity:0;cursor:pointer;width:44px;height:44px;position:absolute;inset:-6px}.ca-settings__reset[data-v-534bb61b]{color:var(--ca-color-primary-text);font:inherit;cursor:pointer;background:0 0;border:0;align-self:flex-start;padding:0}.ca-settings__reset[data-v-534bb61b]:disabled{color:var(--ca-text-secondary);cursor:default;opacity:.6}.ca-settings__segment.is-three[data-v-534bb61b]{grid-template-columns:repeat(3,1fr)}.ca-settings__segment button[data-v-534bb61b]{border-radius:calc(var(--ca-radius) - 2px);min-height:36px;color:var(--ca-text-secondary);font:inherit;cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;gap:6px;display:inline-flex}.ca-settings__segment button.is-active[data-v-534bb61b]{background:var(--ca-bg-card);color:var(--ca-color-primary-text);font-weight:600;box-shadow:0 1px 4px #0000001f}.ca-settings__segment button[data-v-534bb61b]:focus-visible{outline:2px solid var(--ca-color-primary);outline-offset:1px}@media (width>=769px) and (width<=1200px){.ca-header[data-v-534bb61b]{gap:16px;min-width:0;padding:0 12px}.ca-header__brand[data-v-534bb61b]{flex:none;width:auto;min-width:0}.ca-header__nav[data-v-534bb61b]{overflow:hidden}.ca-header__search[data-v-534bb61b]{border:0;justify-content:center;width:36px;height:36px;margin:0;padding:0}.ca-header__search-text[data-v-534bb61b],.ca-header__kbd[data-v-534bb61b]{display:none}}@media (width<=768px){.ca-header[data-v-534bb61b]{gap:8px;min-width:0;padding:0 12px}.ca-header__hamburger.ca-header__icon[data-v-534bb61b]{flex:none;display:inline-flex}.ca-header__brand[data-v-534bb61b]{flex:1;gap:6px;width:auto;min-width:0}.ca-header__logo[data-v-534bb61b]{width:32px;height:32px}.ca-header__titles[data-v-534bb61b]{min-width:0}.ca-header__name[data-v-534bb61b]{white-space:nowrap;text-overflow:ellipsis;font-size:16px;overflow:hidden}.ca-header__subtitle[data-v-534bb61b],.ca-header__nav[data-v-534bb61b],.ca-header__desktop-tool[data-v-534bb61b]{display:none}.ca-header__tools[data-v-534bb61b]{flex:none;gap:0}.ca-header__search[data-v-534bb61b]{border:0;justify-content:center;width:36px;height:36px;margin:0;padding:0}.ca-header__search-text[data-v-534bb61b],.ca-header__kbd[data-v-534bb61b],.ca-header__user .ca-icon[data-v-534bb61b]{display:none}.ca-header__user[data-v-534bb61b]{margin-left:0}}.ca-page-header[data-v-e0f9b42f]{padding:12px 16px}.ca-page-header__top[data-v-e0f9b42f]{color:var(--ca-text-secondary);justify-content:space-between;align-items:center;gap:12px;font-size:13px;display:flex}.ca-page-header__crumb[data-v-e0f9b42f]{align-items:center;gap:6px;display:flex}.ca-page-header__refresh[data-v-e0f9b42f]{border-radius:var(--ca-radius);color:var(--ca-text-secondary);cursor:pointer;background:0 0;border:0;align-items:center;margin-left:4px;padding:2px;display:inline-flex}.ca-page-header__refresh[data-v-e0f9b42f]:hover{background:var(--ca-color-primary-soft);color:var(--ca-color-primary-text)}.ca-page-header__icon[data-v-e0f9b42f]{color:var(--ca-color-primary-text)}@media (height<=720px){.ca-page-header[data-v-e0f9b42f]{padding-top:8px}}@media (width<=768px){.ca-page-header[data-v-e0f9b42f]{padding:8px 12px}.ca-page-header__date[data-v-e0f9b42f]{display:none}.ca-page-header__crumb[data-v-e0f9b42f]{white-space:nowrap;min-width:0;overflow:hidden}.ca-page-header__refresh[data-v-e0f9b42f]{justify-content:center;min-width:36px;min-height:36px}}.ca-page-header__main[data-v-e63e651d]{flex:none;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px;display:flex}.ca-page-header__titles[data-v-e63e651d]{align-items:baseline;gap:12px;min-width:0;display:flex;position:relative;top:-10px}.ca-page-header__title[data-v-e63e651d]{color:var(--ca-text);flex:none;margin:0;font-size:20px;font-weight:700;line-height:1.4}.ca-page-header__desc[data-v-e63e651d]{min-width:0;color:var(--ca-text-secondary);text-overflow:ellipsis;white-space:nowrap;margin:0;font-size:13px;overflow:hidden}.ca-page-header__actions[data-v-e63e651d]{flex:none;gap:8px;display:flex}@media (height<=720px){.ca-page-header__desc[data-v-e63e651d]{display:none}}@media (width<=768px){.ca-page-header__desc[data-v-e63e651d]{display:none}.ca-page-header__main[data-v-e63e651d]{flex-direction:column;align-items:stretch;gap:8px;margin-bottom:12px}.ca-page-header__titles[data-v-e63e651d]{flex-wrap:wrap}.ca-page-header__title[data-v-e63e651d]{overflow-wrap:anywhere;flex:1;min-width:0}.ca-page-header__actions[data-v-e63e651d]{flex-wrap:wrap}}.ca-side[data-v-4ddc6313]{border-radius:0 var(--ca-radius-lg) 0 0;background:var(--ca-bg-sidebar);flex:none;display:flex;overflow:hidden}.ca-side__shortcuts[data-v-4ddc6313]{display:none}.ca-side__rail[data-v-4ddc6313]{box-sizing:border-box;width:var(--ca-rail-width,84px);border-right:1px solid var(--ca-border);flex-direction:column;gap:4px;padding:8px 4px;display:flex}.ca-side__rail-list[data-v-4ddc6313]{scrollbar-width:none;flex-direction:column;flex:1;gap:4px;min-height:0;display:flex;overflow-y:auto}.ca-side__rail.is-compact[data-v-4ddc6313]{width:56px}.ca-side__rail-item[data-v-4ddc6313]{border-radius:var(--ca-radius);color:var(--ca-text-secondary);font:inherit;cursor:pointer;background:0 0;border:0;flex-direction:column;align-items:center;gap:4px;padding:8px 0;font-size:12px;display:flex;position:relative}.ca-side__rail-item[data-v-4ddc6313]:hover{background:var(--ca-color-primary-soft)}.ca-side__rail-item.is-active[data-v-4ddc6313]{background:var(--ca-color-primary-soft);color:var(--ca-color-primary-text)}.ca-side__rail-text[data-v-4ddc6313]{-webkit-line-clamp:2;text-align:center;overflow-wrap:break-word;-webkit-box-orient:vertical;max-width:100%;line-height:1.25;display:-webkit-box;overflow:hidden}.ca-side__tools[data-v-4ddc6313]{border-top:1px solid var(--ca-border);flex-direction:column;align-items:center;gap:4px;margin-top:auto;padding-top:8px;display:flex}.ca-side__tool[data-v-4ddc6313]{border-radius:var(--ca-radius);width:40px;height:36px;color:var(--ca-text-secondary);font:inherit;cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center;display:inline-flex}.ca-side__tool[data-v-4ddc6313]:hover{background:var(--ca-color-primary-soft);color:var(--ca-color-primary-text)}.ca-side__avatar[data-v-4ddc6313]{background:var(--ca-color-primary-soft);width:26px;height:26px;color:var(--ca-color-primary-text);border-radius:50%;justify-content:center;align-items:center;font-size:12px;font-weight:600;display:inline-flex}.ca-side__group-badge[data-v-4ddc6313]{background:var(--ca-danger);color:#fff;border-radius:999px;margin-left:8px;padding:0 6px;font-size:11px;line-height:16px}.ca-side__panel[data-v-4ddc6313]{width:var(--ca-side-panel-width,200px);transition:width .2s;overflow:hidden}.ca-side__panel.is-hidden[data-v-4ddc6313]{width:0}.ca-side__panel-inner[data-v-4ddc6313]{width:var(--ca-side-panel-width,200px);height:100%;overflow-y:auto}@media (prefers-reduced-motion:reduce){.ca-side__panel[data-v-4ddc6313]{transition:none}}.ca-side__title[data-v-4ddc6313]{color:var(--ca-text);padding:16px 16px 8px;font-size:15px;font-weight:600}.ca-side__menu[data-v-4ddc6313]{padding:0 8px 8px}.ca-side__badge[data-v-4ddc6313]{background:var(--ca-danger);color:#fff;border-radius:999px;padding:0 5px;font-size:11px;line-height:16px;position:absolute;top:2px;right:6px}@media (width>=769px) and (width<=1200px){.ca-side[data-v-4ddc6313]{z-index:21;position:relative;overflow:visible}.ca-side__tool--collapse[data-v-4ddc6313]{display:none}.ca-side__panel[data-v-4ddc6313]{background:var(--ca-bg-sidebar);border-radius:0 var(--ca-radius-lg) 0 0;clip-path:inset(0 -32px 0 0);position:absolute;top:0;bottom:0;left:100%;box-shadow:6px 0 16px #00000024}.ca-side[data-v-4ddc6313]{transition:border-radius 0s linear .2s}.ca-side__rail[data-v-4ddc6313]{border-right:0}.ca-side.is-pad-open[data-v-4ddc6313]{border-radius:0;transition:none}.ca-side__panel.is-hidden[data-v-4ddc6313]{box-shadow:none}}@media (width>=769px) and (width<=1200px) and (prefers-reduced-motion:reduce){.ca-side[data-v-4ddc6313]{transition:none}}@media (width<=768px){.ca-side[data-v-4ddc6313]{grid-template-columns:var(--ca-rail-width) minmax(0, 1fr);border-radius:0 var(--ca-radius-lg) var(--ca-radius-lg) 0;grid-template-rows:auto minmax(0,1fr);width:min(320px,100vw - 40px);height:100%;display:grid}.ca-side__shortcuts[data-v-4ddc6313]{border-bottom:1px solid var(--ca-border);flex-wrap:wrap;grid-column:1/-1;gap:4px;padding:12px;display:flex}.ca-side__shortcuts button[data-v-4ddc6313]{border-radius:var(--ca-radius);min-height:36px;color:var(--ca-text);font:inherit;background:0 0;border:0;padding:4px 10px}.ca-side__shortcuts button.is-active[data-v-4ddc6313]{background:var(--ca-color-primary-soft);color:var(--ca-color-primary-text)}.ca-side__rail[data-v-4ddc6313],.ca-side__rail.is-compact[data-v-4ddc6313]{width:var(--ca-rail-width)}.ca-side__rail-item[data-v-4ddc6313]{min-height:44px}.ca-side__tools[data-v-4ddc6313]{display:none}.ca-side__panel[data-v-4ddc6313],.ca-side__panel.is-hidden[data-v-4ddc6313],.ca-side__panel-inner[data-v-4ddc6313]{width:100%}}.ca-copyright[data-v-c51879e8]{color:var(--ca-text-secondary);text-align:center;flex-wrap:wrap;justify-content:center;gap:0 6px;padding:16px 0;font-size:12px;line-height:18px;display:flex}.ca-copyright>span[data-v-c51879e8]:first-child{white-space:pre-line}.ca-copyright a[data-v-c51879e8]{color:inherit;text-decoration:none}.ca-copyright a[data-v-c51879e8]:hover{color:var(--ca-color-primary-text);text-decoration:underline}.ca-tabs[data-v-1d7ba823]{height:var(--ca-tabs-height);box-sizing:border-box;flex:none;align-items:center;gap:8px;padding:10px 16px 0;display:flex}.ca-tabs__fixed[data-v-1d7ba823]{flex:none;gap:6px;display:flex}.ca-tabs__list[data-v-1d7ba823]{scrollbar-width:none;flex:1;gap:6px;min-width:0;display:flex;overflow-x:auto}.ca-tabs__item[data-v-1d7ba823]{border:1px solid var(--ca-border);border-radius:var(--ca-radius);background:var(--ca-bg-card);color:var(--ca-text-secondary);cursor:pointer;flex:none;align-items:center;gap:6px;padding:6px 12px;font-size:13px;display:inline-flex}.ca-tabs__item.is-active[data-v-1d7ba823]{border-color:var(--ca-color-primary);background:var(--ca-color-primary-soft);color:var(--ca-color-primary-text)}.ca-tabs__close[data-v-1d7ba823]{border-radius:50%;font-size:12px}.ca-tabs__close[data-v-1d7ba823]:hover{background:var(--ca-border)}.ca-tabs__more[data-v-1d7ba823]{border:1px solid var(--ca-border);border-radius:var(--ca-radius);background:var(--ca-bg-card);cursor:pointer;outline:none;flex:none;justify-content:center;align-items:center;width:30px;height:30px;display:inline-flex}@media (width<=768px){.ca-tabs[data-v-1d7ba823]{gap:4px;padding:8px 12px 0}.ca-tabs__item[data-v-1d7ba823]{box-sizing:border-box;min-height:36px;padding:6px 8px}.ca-tabs__more[data-v-1d7ba823]{width:36px;height:36px}.ca-tabs__fullscreen[data-v-1d7ba823]{display:none}}.ca-shell[data-v-3a849ce7]{--ca-header-height:64px;--ca-tabs-height:42px;--ca-rail-width:84px;--ca-side-panel-width:200px;background:linear-gradient(to bottom, var(--ca-header-bg) calc(var(--ca-header-height) + var(--ca-tabs-height)), var(--ca-bg-page) calc(var(--ca-header-height) + var(--ca-tabs-height)));flex-direction:column;height:100vh;display:flex}.ca-shell.is-fullscreen[data-v-3a849ce7]{--ca-header-height:0px}.ca-body[data-v-3a849ce7]{flex:1;gap:6px;min-height:0;margin:0 6px 0 0;display:flex}.ca-body.is-fullscreen[data-v-3a849ce7]{gap:0;margin:0}.ca-body.is-fullscreen .ca-main[data-v-3a849ce7]{border-radius:0}.ca-main[data-v-3a849ce7]{border-radius:var(--ca-radius-lg) var(--ca-radius-lg) 0 0;background:var(--ca-bg-page);flex-direction:column;flex:1;min-width:0;display:flex;overflow:hidden}.ca-content[data-v-3a849ce7]{flex-direction:column;flex:1;min-height:0;padding:16px;display:flex;position:relative;overflow-y:auto}.ca-content__page[data-v-3a849ce7]{flex:1 0 auto;min-width:0}.ca-mobile-scrim[data-v-3a849ce7]{display:none}@media (width>=769px) and (width<=1200px){.ca-shell[data-v-3a849ce7]{width:100%;min-width:0;height:100dvh;overflow:hidden}.ca-body[data-v-3a849ce7]{position:relative}.ca-main[data-v-3a849ce7]{min-width:0}.ca-content[data-v-3a849ce7]{overflow-x:hidden}.ca-pad-scrim[data-v-3a849ce7]{z-index:20;background:color-mix(in srgb, var(--ca-text) 35%, transparent);border:0;width:100%;position:absolute;inset:0}}@media (width<=768px){.ca-shell[data-v-3a849ce7]{--ca-tabs-height:44px;width:100%;min-width:0;height:100dvh;overflow:hidden}.ca-body[data-v-3a849ce7],.ca-body.is-fullscreen[data-v-3a849ce7]{gap:0;margin:0}.ca-main[data-v-3a849ce7]{border-radius:0;min-width:0}.ca-content[data-v-3a849ce7]{padding:12px;overflow-x:hidden}.ca-mobile-scrim[data-v-3a849ce7]{z-index:20;background:color-mix(in srgb, var(--ca-text) 45%, transparent);border:0;width:100%;display:block;position:fixed;inset:0}.ca-side[data-v-3a849ce7]{z-index:21;visibility:hidden;transition:transform .2s,visibility .2s;position:fixed;inset:0 auto 0 0;transform:translate(-100%)}.ca-side.is-mobile-open[data-v-3a849ce7]{visibility:visible;transform:translate(0)}}@media (width<=768px) and (prefers-reduced-motion:reduce){.ca-side[data-v-3a849ce7]{transition:none}}.ca-exception[data-v-ffcb23b0]{flex-direction:column;justify-content:center;align-items:center;gap:12px;min-height:60vh;display:flex}.ca-exception__code[data-v-ffcb23b0]{color:var(--ca-color-primary-text);font-size:72px;font-weight:700;line-height:1}.ca-exception__text[data-v-ffcb23b0]{color:var(--ca-text-secondary);margin:0 0 8px}.ca-login[data-v-ddf636fd]{background:var(--ca-login-bg);flex-direction:column;min-height:100vh;display:flex}.ca-login__main[data-v-ddf636fd]{flex:1;justify-content:center;align-items:center;padding:16px 0;display:flex}.ca-login .ca-login__copyright[data-v-ddf636fd]{box-sizing:border-box;width:fit-content;max-width:calc(100vw - 32px);color:var(--ca-text-secondary);background:color-mix(in srgb, var(--ca-bg-card) 92%, transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border:1px solid var(--ca-border);border-radius:var(--ca-radius-lg);margin:0 auto 16px;padding:4px 14px}.ca-login__card[data-v-ddf636fd]{box-sizing:border-box;background:color-mix(in srgb, var(--ca-bg-card) 92%, transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border:1px solid var(--ca-border);border-radius:var(--ca-radius-lg);width:min(380px,100vw - 32px);padding:36px 32px 28px;box-shadow:0 12px 40px #0000002e}.ca-login__brand[data-v-ddf636fd]{text-align:center;margin-bottom:24px}.ca-login__logo[data-v-ddf636fd]{height:44px;margin-bottom:10px}.ca-login__name[data-v-ddf636fd]{margin:0;font-size:22px;font-weight:600}.ca-login__subtitle[data-v-ddf636fd]{color:var(--ca-text-secondary);margin:6px 0 0;font-size:13px}.ca-login__error[data-v-ddf636fd]{margin-bottom:16px}.ca-login__submit[data-v-ddf636fd]{width:100%}
2
+ /*$vite$:1*/
@@ -0,0 +1,4 @@
1
+ /** 记录最后活跃时间;同一毫秒内切页也保持严格顺序。 */
2
+ export declare function markActive(times: Record<string, number>, key: string, now?: number): Record<string, number>;
3
+ /** 只从非固定、非当前标签中选最久未活跃者;并列时按标签顺序。 */
4
+ export declare function evictionCandidate(visited: string[], times: Record<string, number>, current: string, affix: readonly string[], maxTabs: number): string | undefined;
@@ -0,0 +1,224 @@
1
+ /**
2
+ * core 对平台公开的类型。
3
+ *
4
+ * 平台与框架之间的“契约”集中在这里:平台只需要提供菜单数据、登录适配、品牌信息,
5
+ * 框架负责怎么渲染、怎么缓存、怎么换肤。这样框架升级(改布局、改样式)时,
6
+ * 只要这份契约保持兼容,平台代码就不用动。
7
+ */
8
+ import type { Component } from 'vue';
9
+ import type { LocaleCode } from '@campus-admin/locale';
10
+ import type { ThemeLayers } from '@campus-admin/theme';
11
+ import type { IconName } from '@campus-admin/ui';
12
+ /** 菜单里的一个页面(最底层) */
13
+ export interface MenuPage {
14
+ /** 全局唯一的页面键:用于路由名、标签页、KeepAlive 缓存,不能重复 */
15
+ key: string;
16
+ /** 标题:可以是词条键(如 demo.menu.home),也可以直接是文本;框架会按当前语言翻译 */
17
+ title: string;
18
+ /** 路由路径,全局唯一,以 / 开头 */
19
+ path: string;
20
+ /** 页面组件的懒加载函数,框架负责包装成可被 KeepAlive 精确缓存的组件 */
21
+ component: () => Promise<{
22
+ default: Component;
23
+ }>;
24
+ icon?: IconName;
25
+ /** 页面说明:显示在页面标题下面;词条键或直接文本,可选 */
26
+ description?: string;
27
+ /** 访问该页面所需的权限码;不填表示登录即可访问 */
28
+ permission?: string;
29
+ /** 固定标签页:不可关闭,始终排在最前 */
30
+ affix?: boolean;
31
+ }
32
+ /** 菜单组(二级菜单):在第二栏里可展开,展开后是三级菜单(页面) */
33
+ export interface MenuGroup {
34
+ key: string;
35
+ title: string;
36
+ icon?: IconName;
37
+ /** 角标数字;可以是函数,便于平台返回实时数据(如待办数量) */
38
+ badge?: number | (() => number);
39
+ children: MenuPage[];
40
+ }
41
+ /**
42
+ * 菜单应用(一级场景):侧栏第一栏的一项。
43
+ * 二级菜单可以是菜单组(带 children,可展开出三级页面),也可以直接是页面(没有三级)。
44
+ * 数据形状与常见的后端菜单树一致:key / title / path / icon / badge / children。
45
+ */
46
+ export interface MenuApp {
47
+ key: string;
48
+ title: string;
49
+ icon?: IconName;
50
+ children: (MenuGroup | MenuPage)[];
51
+ }
52
+ /** 二级菜单是菜单组还是直接的页面:有 children 的是菜单组 */
53
+ export declare function isMenuGroup(item: MenuGroup | MenuPage): item is MenuGroup;
54
+ /** 便捷菜单:头部的快捷入口,点击直接打开某个页面,不影响侧栏 */
55
+ export interface ShortcutItem {
56
+ key: string;
57
+ /** 标题:词条键或直接文本 */
58
+ title: string;
59
+ /** 目标页面路径,应是菜单里已有的页面 */
60
+ path: string;
61
+ /** 与目标页面一致的权限码;用户没有权限时不显示该入口 */
62
+ permission?: string;
63
+ }
64
+ /** 当前登录用户 */
65
+ export interface SessionUser {
66
+ name: string;
67
+ avatar?: string;
68
+ /** 权限码列表;'*' 表示拥有全部权限 */
69
+ permissions?: string[] | '*';
70
+ }
71
+ /**
72
+ * 登录适配:框架不关心后端怎么登录,只要平台把结果翻译成 token + 用户即可。
73
+ * 登录失败请抛出带可读信息的 Error,框架会把 message 展示给用户。
74
+ */
75
+ export interface AuthProvider {
76
+ login(form: {
77
+ username: string;
78
+ password: string;
79
+ /** 提供了 captcha() 时带上:key 是 captcha() 返回的,code 是用户输入的 */
80
+ captcha?: {
81
+ key: string;
82
+ code: string;
83
+ };
84
+ }): Promise<{
85
+ token: string;
86
+ user: SessionUser;
87
+ }>;
88
+ /** 退出时的服务端清理(可选),失败不阻止本地退出 */
89
+ logout?(): Promise<void> | void;
90
+ /**
91
+ * 图形验证码(可选):提供了才在登录、注册、找回密码页显示验证码输入框和图片,点图片刷新,登录失败自动刷新。
92
+ * image 是图片地址(可以是 data URL);scene 告诉后端用在哪一页,方便出不同类型的题(如找回密码出计算题),可以忽略。
93
+ */
94
+ captcha?(scene?: 'login' | 'register' | 'forgot'): Promise<{
95
+ key: string;
96
+ image: string;
97
+ }>;
98
+ /** 注册(可选):不提供则登录页没有“注册账号”入口,直接访问 /register 显示“该功能未开通”。失败请抛带可读信息的 Error */
99
+ register?(form: {
100
+ phone: string;
101
+ code: string;
102
+ password: string;
103
+ captcha?: {
104
+ key: string;
105
+ code: string;
106
+ };
107
+ }): Promise<void>;
108
+ /** 发送短信验证码(可选):注册、找回密码页的“获取验证码”按钮调用;不提供这两页都不可用 */
109
+ sendSmsCode?(target: {
110
+ phone?: string;
111
+ username?: string;
112
+ scene: 'register' | 'forgot';
113
+ captcha?: {
114
+ key: string;
115
+ code: string;
116
+ };
117
+ }): Promise<void>;
118
+ /** 重置密码(可选):不提供则没有“忘记密码”入口,直接访问 /forgot 显示“该功能未开通” */
119
+ resetPassword?(form: {
120
+ account: string;
121
+ code: string;
122
+ password: string;
123
+ captcha?: {
124
+ key: string;
125
+ code: string;
126
+ };
127
+ }): Promise<void>;
128
+ }
129
+ /**
130
+ * 登录页配置(可选)。不配置时是居中卡片登录页,与之前完全一致。
131
+ * 注册页、找回密码页与“左右分栏”登录页共用同一套壳和这里的配置。
132
+ */
133
+ export interface LoginOptions {
134
+ /** 登录页样式:card 居中卡片(默认);split 左右分栏(左面板 + 右表单) */
135
+ style?: 'card' | 'split';
136
+ /** 页面背景:图片地址、渐变或颜色;不填用主题的登录背景 */
137
+ background?: string;
138
+ /** 左栏面板(split 样式):Logo、二维码图片地址、二维码下的说明文字;Logo 不填用站点 Logo */
139
+ panel?: {
140
+ logo?: string;
141
+ qrcode?: string;
142
+ caption?: string;
143
+ };
144
+ /** 登录页的标签,按顺序显示;默认 ['account', 'wechat']。微信标签只是界面占位,账号登录是唯一能登录的方式 */
145
+ tabs?: ('account' | 'wechat')[];
146
+ /** 登录按钮下的帮助说明,每条是词条键或文本;其中的 `{forgot}` 会变成“找回密码”链接。不填用框架默认四条 */
147
+ helps?: string[];
148
+ /** 卡片底部的小字,每行一条(词条键或文本,`{year}` 替换为年份);不填用 brand.copyright(其中的换行按行显示) */
149
+ footer?: string[];
150
+ /** 页面右下角的小字版本号 */
151
+ version?: string;
152
+ /** 注册时“已阅读并同意”的协议链接;不填则没有勾选项 */
153
+ agreements?: {
154
+ text: string;
155
+ href: string;
156
+ }[];
157
+ /** 短信验证码输入框下的小字提示(词条键或文本),如演示环境的固定验证码;生产环境不要填 */
158
+ smsHint?: string;
159
+ }
160
+ /** 品牌信息:站点主题里有同名字段时,以主题为准(学校可自定义) */
161
+ export interface BrandOptions {
162
+ name: string;
163
+ subtitle?: string;
164
+ logo?: string;
165
+ /**
166
+ * 版权文字,显示在内容区最底部和登录页底部;不填则不显示。
167
+ * 可以是词条键或直接文本(同其他文案),其中的 `{year}` 会替换为当前年份,
168
+ * 例如 `© {year} 众校通 版权所有`;文字里的换行(\n)会显示为换行;演示站直接写固定年份。
169
+ */
170
+ copyright?: string;
171
+ /** 版权文字后面的链接(如备案号),和版权文字同一行用分隔点隔开;新窗口打开;为空则不显示 */
172
+ copyrightLinks?: {
173
+ text: string;
174
+ href: string;
175
+ }[];
176
+ }
177
+ /** 主题加载配置 */
178
+ export interface ThemeOptions {
179
+ /**
180
+ * 取站点的主题配置(上级默认层 + 站点层)。
181
+ * 应当是无需登录即可访问的接口,因为登录页也要换肤。
182
+ */
183
+ load: () => Promise<ThemeLayers>;
184
+ /**
185
+ * 本地缓存的键后缀。缓存用于“先用上次的主题渲染,再异步更新”,避免首屏闪烁;
186
+ * 同一个浏览器访问不同站点时,键必须不同,否则会先闪出别的站点的颜色。
187
+ */
188
+ cacheKey?: string;
189
+ }
190
+ /** 创建应用时的全部配置 */
191
+ export interface CampusOptions {
192
+ menus: MenuApp[];
193
+ /** 非固定标签的上限,默认 20;至少保留当前页 */
194
+ maxTabs?: number;
195
+ /** 头部便捷菜单(快捷入口),可选 */
196
+ shortcuts?: ShortcutItem[];
197
+ /**
198
+ * 账户页路径:点击头部或侧栏头像菜单里的“我的账户”时跳转到这个页面(如 `/my`)。
199
+ * 必须是菜单里某个页面的路径,创建应用时会检查,写错直接报错而不是点了才跳到 404;
200
+ * 不填则头像菜单里不显示“我的账户”,避免出现点了没反应的菜单项。
201
+ */
202
+ accountPath?: string;
203
+ /**
204
+ * 运行环境:test 不限制验证码和密码强度;production 强制图形验证码、新密码至少 8 位且含字母和数字。
205
+ * 不填按构建模式判断(生产构建为 production)。
206
+ */
207
+ environment?: 'test' | 'production';
208
+ /**
209
+ * 头部“搜索 / 通知 / 助手”按钮的点击回调,由平台自己实现(打开搜索面板、通知中心等);
210
+ * 没有配置的按钮点击后不做任何事。“外观”由框架自带,不在此列。
211
+ */
212
+ headerTools?: Partial<Record<'search' | 'notifications' | 'assistant', () => void>>;
213
+ auth: AuthProvider;
214
+ /** 登录页配置:样式、背景、左栏、标签、帮助说明、底部小字等;不配置则为居中卡片 */
215
+ login?: LoginOptions;
216
+ brand: BrandOptions;
217
+ /** 平台自己的词条,按语言提供;与框架词条合并,同键以平台为准 */
218
+ messages?: Partial<Record<LocaleCode, Record<string, unknown>>>;
219
+ /** 默认语言,缺省为中文;用户选择过会以用户选择为准 */
220
+ defaultLocale?: LocaleCode;
221
+ theme?: ThemeOptions;
222
+ /** 路由模式:hash 适合静态托管(默认),web 需要服务端回退到 index.html */
223
+ history?: 'hash' | 'web';
224
+ }
package/package.json CHANGED
@@ -1,82 +1,44 @@
1
1
  {
2
2
  "name": "@campus-admin/core",
3
- "version": "1.0.0",
4
- "description": "Campus Admin 框架层与装配入口:应用生命周期、服务容器、Vue 适配、命令式 API 与组件装配",
3
+ "version": "2.0.1",
4
+ "description": "应用壳:布局、菜单、路由、权限、多标签、主题运行时、反馈服务。平台只安装这个包。",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
- "author": "UnionSchool",
8
- "homepage": "https://campus.zhongxiaotong.com",
9
7
  "repository": {
10
8
  "type": "git",
11
9
  "url": "git+https://github.com/UnionSchool/campus-admin.git",
12
10
  "directory": "packages/core"
13
11
  },
14
- "keywords": [
15
- "vue",
16
- "vue3",
17
- "campus",
18
- "school",
19
- "admin",
20
- "framework",
21
- "dashboard"
22
- ],
23
- "sideEffects": [
24
- "**/*.css"
25
- ],
26
12
  "files": [
27
- "LICENSE",
28
13
  "dist",
29
- "README.md",
30
- "types"
14
+ "LICENSE",
15
+ "README.md"
31
16
  ],
32
- "main": "./dist/index.umd.cjs",
33
- "module": "./dist/index.js",
34
- "types": "./dist/index.d.ts",
35
- "typesVersions": {
36
- "*": {
37
- "ca": [
38
- "./types/ca.d.ts"
39
- ]
40
- }
41
- },
42
17
  "exports": {
43
18
  ".": {
44
19
  "types": "./dist/index.d.ts",
45
- "import": "./dist/index.js",
46
- "require": "./dist/index.umd.cjs",
47
- "source": "./src/index.ts"
20
+ "import": "./dist/index.js"
48
21
  },
49
- "./style.css": {
50
- "import": "./dist/core.css",
51
- "default": "./dist/core.css"
52
- }
53
- },
54
- "publishConfig": {
55
- "access": "public",
56
- "provenance": true
57
- },
58
- "engines": {
59
- "node": ">=20.19.0"
60
- },
61
- "peerDependencies": {
62
- "@lucide/vue": "^1.44.0",
63
- "vue": "^3.5.42"
22
+ "./style.css": "./dist/style.css"
64
23
  },
24
+ "sideEffects": [
25
+ "**/*.css",
26
+ "./dist/index.js"
27
+ ],
65
28
  "dependencies": {
66
- "@campus-admin/icon": "^1.0.0",
67
- "@campus-admin/ui": "^1.0.0",
68
- "@campus-admin/locale": "^1.0.0"
29
+ "@campus-admin/locale": "^2.0.1",
30
+ "@campus-admin/ui": "^2.0.1",
31
+ "@campus-admin/theme": "^2.0.1",
32
+ "element-plus": "^2.14.7",
33
+ "pinia": "^3.0.3",
34
+ "vue-i18n": "^11.1.0",
35
+ "vue-router": "^4.6.4"
69
36
  },
70
- "devDependencies": {
71
- "@lucide/vue": "^1.44.0",
72
- "@vitejs/plugin-vue": "^6.0.8",
73
- "typescript": "^5.9.3",
74
- "vite": "^8.3.0",
75
- "vue": "^3.5.42",
76
- "vue-tsc": "^3.3.11"
37
+ "peerDependencies": {
38
+ "vue": "^3.5.0"
77
39
  },
78
- "scripts": {
79
- "typecheck": "vue-tsc --noEmit -p tsconfig.json",
80
- "build": "node ../../scripts/clean.mjs dist:packages/core && vue-tsc --declaration --emitDeclarationOnly -p tsconfig.build.json && vite build"
40
+ "publishConfig": {
41
+ "access": "public",
42
+ "provenance": false
81
43
  }
82
- }
44
+ }