@kevairy/template 0.1.0 → 0.1.2
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.
- package/package.json +10 -8
- package/template/.agents/skills/kevairy-ui/SKILL.md +36 -0
- package/template/.agents/skills/kevairy-ui/agents/openai.yaml +4 -0
- package/template/.agents/skills/kevairy-ui/references/component-catalog.md +45 -0
- package/template/.env +0 -0
- package/template/.env.development +0 -0
- package/template/.env.production +0 -3
- package/template/AGENTS.md +15 -0
- package/template/LICENSE +0 -0
- package/template/_gitignore +1 -0
- package/template/index.html +0 -0
- package/template/package.json +1 -7
- package/template/public/favicon.ico +0 -0
- package/template/src/App.vue +0 -0
- package/template/src/assets/styles/core/app.scss +0 -0
- package/template/src/assets/styles/core/dark.scss +0 -0
- package/template/src/assets/styles/core/mixin.scss +0 -0
- package/template/src/assets/styles/core/reset.scss +0 -0
- package/template/src/assets/styles/core/tailwind.css +2 -1
- package/template/src/assets/styles/core/theme-change.scss +0 -0
- package/template/src/components/core/layouts/art-breadcrumb/index.vue +0 -0
- package/template/src/components/core/layouts/art-header-bar/index.vue +0 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/index.vue +0 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/style.scss +0 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/widget/SidebarSubmenu.vue +0 -0
- package/template/src/components/core/layouts/art-notification/index.vue +0 -0
- package/template/src/components/core/layouts/art-settings-panel/index.vue +0 -0
- package/template/src/components/core/layouts/art-settings-panel/style.scss +0 -0
- package/template/src/components/core/layouts/art-work-tab/index.vue +0 -0
- package/template/src/components/core/views/login/AuthTopBar.vue +56 -6
- package/template/src/components/core/views/login/LoginLeftView.vue +24 -42
- package/template/src/directives/core/auth.ts +0 -0
- package/template/src/directives/core/highlight.ts +1 -0
- package/template/src/directives/index.ts +0 -0
- package/template/src/enums/appEnum.ts +0 -0
- package/template/src/env.d.ts +0 -0
- package/template/src/main.ts +1 -6
- package/template/src/router/index.ts +0 -0
- package/template/src/store/index.ts +0 -0
- package/template/src/store/modules/menu.ts +0 -0
- package/template/src/store/modules/setting.ts +0 -0
- package/template/src/store/modules/user.ts +0 -0
- package/template/src/store/modules/worktab.ts +0 -0
- package/template/src/utils/http/status.ts +0 -0
- package/template/src/utils/ui/colors.ts +0 -0
- package/template/src/views/auth/login/index.vue +4 -4
- package/template/src/views/auth/login/style.css +74 -14
- package/template/src/views/exception/403/index.vue +0 -0
- package/template/src/views/exception/404/index.vue +0 -0
- package/template/src/views/exception/500/index.vue +0 -0
- package/template/src/views/index/index.vue +0 -0
- package/template/src/views/result/fail/index.vue +0 -0
- package/template/src/views/result/success/index.vue +0 -0
- package/template/tests/e2e/auth.spec.ts +32 -0
- package/template/tests/e2e/search-table.spec.ts +9 -1
- package/template/tsconfig.json +0 -0
- package/template/vite.config.ts +20 -50
- package/template/src/assets/images/login/kylin-hero-source.png +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kevairy/template",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Project template consumed by @kevairy/cli",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vue",
|
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
"README.md",
|
|
17
17
|
"LICENSE"
|
|
18
18
|
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"sync:template": "node scripts/sync-template.js",
|
|
21
|
+
"check:template": "node scripts/check-template-sync.js",
|
|
22
|
+
"prepack": "pnpm check:template",
|
|
23
|
+
"prepublishOnly": "pnpm test",
|
|
24
|
+
"test": "vitest run tests/sync-template.spec.js",
|
|
25
|
+
"typecheck": "tsc --noEmit --allowJs --checkJs --module NodeNext --moduleResolution NodeNext --target ES2022 scripts/*.js"
|
|
26
|
+
},
|
|
19
27
|
"engines": {
|
|
20
28
|
"node": ">=20.19.0"
|
|
21
29
|
},
|
|
@@ -27,11 +35,5 @@
|
|
|
27
35
|
"@types/node": "^24.13.3",
|
|
28
36
|
"typescript": "~5.6.3",
|
|
29
37
|
"vitest": "^4.1.10"
|
|
30
|
-
},
|
|
31
|
-
"scripts": {
|
|
32
|
-
"sync:template": "node scripts/sync-template.js",
|
|
33
|
-
"check:template": "node scripts/check-template-sync.js",
|
|
34
|
-
"test": "vitest run tests/sync-template.spec.js",
|
|
35
|
-
"typecheck": "tsc --noEmit --allowJs --checkJs --module NodeNext --moduleResolution NodeNext --target ES2022 scripts/*.js"
|
|
36
38
|
}
|
|
37
|
-
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kevairy-ui
|
|
3
|
+
description: Guide Vue 3 admin UI work toward @kevairy/components and established Kevairy template patterns. Use when creating, changing, reviewing, or refactoring pages, forms, tables, search and filter flows, dialogs, statuses, cards, data display, composables, or shared UI in a project generated from the Kevairy template.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kevairy UI
|
|
7
|
+
|
|
8
|
+
## Workflow
|
|
9
|
+
|
|
10
|
+
1. Read [the component catalog](references/component-catalog.md) before choosing shared UI building blocks.
|
|
11
|
+
2. Inspect `package.json` for the installed `@kevairy/components` version.
|
|
12
|
+
3. Search the project for an existing page pattern or component before adding a new abstraction. Prefer examples under `src/views/examples` and existing components under `src/components`.
|
|
13
|
+
4. Select implementations in this order:
|
|
14
|
+
- Use `@kevairy/components` for reusable business UI, tables, search, dialogs, status, and shared data-display patterns.
|
|
15
|
+
- Reuse existing `Art*` components for template-specific layout, navigation, authentication, and application shell behavior.
|
|
16
|
+
- Compose Element Plus primitives only when the first two layers do not provide the required behavior.
|
|
17
|
+
- Create a local component only for project-specific behavior or a documented capability gap.
|
|
18
|
+
5. Verify exact APIs in the [online component documentation](https://kevairy.top/components/) or the installed package types. Do not guess props, slots, events, exposed methods, or request contracts.
|
|
19
|
+
6. Keep `@kevairy/components/style.css` imported once in `src/main.ts`; do not import it in individual pages.
|
|
20
|
+
7. Run focused tests and `pnpm typecheck`. Run `pnpm build` when changing dependencies, shared UI composition, or build-facing code.
|
|
21
|
+
|
|
22
|
+
## Source-of-truth rules
|
|
23
|
+
|
|
24
|
+
- Treat the installed package exports and type declarations as authoritative for the project's pinned version.
|
|
25
|
+
- Treat `https://kevairy.top/components/` as the usage and API guide for the latest published documentation.
|
|
26
|
+
- When documentation and installed types differ, implement against the installed version and state the mismatch.
|
|
27
|
+
- Import UI components and their types from `@kevairy/components`.
|
|
28
|
+
- Import non-UI composables, contracts, and pure utilities from `@kevairy/components/core` when the module should avoid UI dependencies.
|
|
29
|
+
- Avoid wrappers that merely rename a Kevairy component without adding project-specific behavior.
|
|
30
|
+
|
|
31
|
+
## Documentation routing
|
|
32
|
+
|
|
33
|
+
- Components: `https://kevairy.top/components/`
|
|
34
|
+
- Template architecture and project patterns: `https://kevairy.top/template/`
|
|
35
|
+
- Scaffold usage: `https://kevairy.top/scaffold/`
|
|
36
|
+
- Use the local catalog for selection, then open only the relevant online API page.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Kevairy component catalog
|
|
2
|
+
|
|
3
|
+
Use this catalog to choose a capability before reading its exact API documentation. Check the installed `@kevairy/components` version before implementation.
|
|
4
|
+
|
|
5
|
+
## Selection order
|
|
6
|
+
|
|
7
|
+
1. Prefer a complete Kevairy page or pattern component.
|
|
8
|
+
2. Compose lower-level Kevairy components when the complete pattern is too opinionated.
|
|
9
|
+
3. Reuse existing template `Art*` components for application-shell concerns.
|
|
10
|
+
4. Use Element Plus primitives for uncovered low-level behavior.
|
|
11
|
+
5. Add a local component only for project-specific behavior or a documented gap.
|
|
12
|
+
|
|
13
|
+
## Components
|
|
14
|
+
|
|
15
|
+
| Need | Prefer | Documentation |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| Complete searchable and pageable list page | `KvSearchTablePage` | https://kevairy.top/components/api/kv-search-table-page |
|
|
18
|
+
| Search and table composition with custom state control | `KvSearchTable` | https://kevairy.top/components/api/kv-search-table |
|
|
19
|
+
| Base table rendering | `KvTable` | https://kevairy.top/components/api/kv-table |
|
|
20
|
+
| Column visibility, density, refresh, and fullscreen controls | `KvTableToolbar` | https://kevairy.top/components/api/kv-table-toolbar |
|
|
21
|
+
| Config-driven search form | `KvSearchBar` | https://kevairy.top/components/api/kv-search-bar |
|
|
22
|
+
| Draggable or resizable dialog | `KvDialog` | https://kevairy.top/components/api/kv-dialog |
|
|
23
|
+
| Dictionary value as a styled tag | `KvDictTag` | https://kevairy.top/components/api/kv-dict-tag |
|
|
24
|
+
| Section heading with optional actions | `KvSectionTitle` | https://kevairy.top/components/api/kv-section-title |
|
|
25
|
+
| Loading, empty, error, or other feedback state | `KvStatus` | https://kevairy.top/components/api/kv-status |
|
|
26
|
+
| Expandable card collection | `KvExpandableCardList` | https://kevairy.top/components/api/kv-expandable-card-list |
|
|
27
|
+
| Inline text difference display | `KvInlineDiff` | https://kevairy.top/components/api/kv-inline-diff |
|
|
28
|
+
|
|
29
|
+
## Composables and utilities
|
|
30
|
+
|
|
31
|
+
| Need | Prefer | Documentation |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| Pageable request state without the complete page UI | `usePagedTable` | https://kevairy.top/components/composables/use-paged-table |
|
|
34
|
+
| Normalize or remove empty search values | Search parameter utilities | https://kevairy.top/components/utilities/search-params |
|
|
35
|
+
| Calculate responsive form or grid spans | Responsive utilities | https://kevairy.top/components/utilities/responsive |
|
|
36
|
+
|
|
37
|
+
Import non-UI capabilities from `@kevairy/components/core` when the consumer should not resolve UI and drag dependencies.
|
|
38
|
+
|
|
39
|
+
## Page patterns
|
|
40
|
+
|
|
41
|
+
- Search-table page organization: https://kevairy.top/template/page-patterns/search-table
|
|
42
|
+
- Template architecture and extension boundaries: https://kevairy.top/template/architecture
|
|
43
|
+
- Component installation and imports: https://kevairy.top/components/getting-started
|
|
44
|
+
|
|
45
|
+
For a standard list page, start with `KvSearchTablePage` and split business configuration into search configuration, table-column configuration, and a service adapter. Preserve the request result contract `{ records, total }` unless the installed API says otherwise.
|
package/template/.env
CHANGED
|
File without changes
|
|
File without changes
|
package/template/.env.production
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Kevairy 项目开发指南
|
|
2
|
+
|
|
3
|
+
## UI 开发
|
|
4
|
+
|
|
5
|
+
- 创建、修改、审查或重构页面、表单、表格、搜索、弹窗、状态展示和公共 UI 时,必须使用 `$kevairy-ui` Skill。
|
|
6
|
+
- 开始实现前先检查 `@kevairy/components` 是否已有对应能力,不要重复实现通用组件。
|
|
7
|
+
- 通用业务 UI 优先使用 `@kevairy/components`;布局、导航、认证等模板框架能力优先复用现有 `Art*` 组件;两者均不满足时才直接组合 Element Plus 或创建项目级组件。
|
|
8
|
+
- 不要凭记忆猜测 Props、Slots、Events、Expose 或类型。先查看 [Kevairy 组件文档](https://kevairy.top/components/),再核对当前安装版本导出的类型。
|
|
9
|
+
- 在线文档与当前安装版本不一致时,以 `package.json` 中的版本及其类型声明为准。
|
|
10
|
+
- `@kevairy/components/style.css` 只在应用入口导入一次,页面中不要重复导入。
|
|
11
|
+
|
|
12
|
+
## 验证
|
|
13
|
+
|
|
14
|
+
- 修改完成后运行与变更相称的检查,至少包含 `pnpm typecheck`。
|
|
15
|
+
- 涉及构建、依赖或公共组件组合时,同时运行相关测试和 `pnpm build`。
|
package/template/LICENSE
CHANGED
|
File without changes
|
package/template/_gitignore
CHANGED
package/template/index.html
CHANGED
|
File without changes
|
package/template/package.json
CHANGED
|
@@ -12,9 +12,8 @@
|
|
|
12
12
|
"@e965/xlsx": "0.20.3",
|
|
13
13
|
"@element-plus/icons-vue": "2.3.2",
|
|
14
14
|
"@iconify/vue": "5.0.1",
|
|
15
|
-
"@kevairy/components": "0.1
|
|
15
|
+
"@kevairy/components": "0.2.1",
|
|
16
16
|
"@tailwindcss/vite": "4.3.3",
|
|
17
|
-
"@vue/reactivity": "3.5.41",
|
|
18
17
|
"@vueuse/core": "13.9.0",
|
|
19
18
|
"@wangeditor/editor": "5.1.23",
|
|
20
19
|
"@wangeditor/editor-for-vue": "5.1.12",
|
|
@@ -25,13 +24,11 @@
|
|
|
25
24
|
"highlight.js": "11.12.0",
|
|
26
25
|
"mitt": "3.0.1",
|
|
27
26
|
"nprogress": "0.2.0",
|
|
28
|
-
"ohash": "2.0.12",
|
|
29
27
|
"pinia": "3.0.4",
|
|
30
28
|
"pinia-plugin-persistedstate": "4.7.1",
|
|
31
29
|
"qrcode.vue": "3.10.0",
|
|
32
30
|
"tailwindcss": "4.3.3",
|
|
33
31
|
"vue": "3.5.41",
|
|
34
|
-
"vue-draggable-plus": "0.6.1",
|
|
35
32
|
"vue-i18n": "11.4.8",
|
|
36
33
|
"vue-router": "4.6.4",
|
|
37
34
|
"xgplayer": "3.0.26"
|
|
@@ -63,14 +60,11 @@
|
|
|
63
60
|
"happy-dom": "20.11.2",
|
|
64
61
|
"rollup-plugin-visualizer": "5.14.0",
|
|
65
62
|
"sass": "1.102.0",
|
|
66
|
-
"terser": "5.50.0",
|
|
67
63
|
"typescript": "5.6.3",
|
|
68
64
|
"unplugin-auto-import": "20.3.0",
|
|
69
65
|
"unplugin-element-plus": "0.10.0",
|
|
70
66
|
"unplugin-vue-components": "29.2.0",
|
|
71
67
|
"vite": "7.3.6",
|
|
72
|
-
"vite-plugin-compression": "0.5.1",
|
|
73
|
-
"vite-plugin-vue-devtools": "8.2.1",
|
|
74
68
|
"vitest": "4.1.10",
|
|
75
69
|
"vue-demi": "0.14.10",
|
|
76
70
|
"vue-img-cutter": "3.1.1",
|
|
File without changes
|
package/template/src/App.vue
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/template/src/components/core/layouts/art-menus/art-sidebar-menu/widget/SidebarSubmenu.vue
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
<!-- 授权页右上角组件 -->
|
|
2
2
|
<template>
|
|
3
|
-
<div
|
|
4
|
-
class="
|
|
5
|
-
>
|
|
6
|
-
<div class="flex-cc !hidden max-[1180px]:!flex ml-2 max-sm:ml-6">
|
|
3
|
+
<div class="auth-top-bar">
|
|
4
|
+
<div class="auth-top-brand">
|
|
7
5
|
<ArtLogo class="icon" size="46" />
|
|
8
|
-
<h1
|
|
6
|
+
<h1>{{ AppConfig.systemInfo.name }}</h1>
|
|
9
7
|
</div>
|
|
10
8
|
|
|
11
|
-
<div class="
|
|
9
|
+
<div class="auth-top-actions">
|
|
12
10
|
<div class="color-picker-expandable relative flex-c max-sm:!hidden">
|
|
13
11
|
<div
|
|
14
12
|
class="color-dots absolute right-0 rounded-full flex-c gap-2 rounded-5 px-2.5 py-2 pr-9 pl-2.5 opacity-0"
|
|
@@ -105,6 +103,36 @@
|
|
|
105
103
|
</script>
|
|
106
104
|
|
|
107
105
|
<style scoped>
|
|
106
|
+
.auth-top-bar {
|
|
107
|
+
position: absolute;
|
|
108
|
+
top: 18px;
|
|
109
|
+
z-index: 10;
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
justify-content: flex-end;
|
|
113
|
+
width: 100%;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.auth-top-brand {
|
|
117
|
+
display: none;
|
|
118
|
+
align-items: center;
|
|
119
|
+
margin-left: 8px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.auth-top-brand h1 {
|
|
123
|
+
margin-left: 8px;
|
|
124
|
+
font-size: 20px;
|
|
125
|
+
font-weight: 500;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.auth-top-actions {
|
|
129
|
+
display: flex;
|
|
130
|
+
gap: 6px;
|
|
131
|
+
align-items: center;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
margin-right: 8px;
|
|
134
|
+
}
|
|
135
|
+
|
|
108
136
|
.color-dots {
|
|
109
137
|
pointer-events: none;
|
|
110
138
|
box-shadow: 0 2px 12px var(--art-gray-300);
|
|
@@ -146,4 +174,26 @@
|
|
|
146
174
|
.color-picker-expandable:hover .palette-btn :deep(.art-svg-icon) {
|
|
147
175
|
color: v-bind(color);
|
|
148
176
|
}
|
|
177
|
+
|
|
178
|
+
/* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
|
|
179
|
+
@media (max-width: 1180px) {
|
|
180
|
+
.auth-top-bar {
|
|
181
|
+
justify-content: space-between;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.auth-top-brand {
|
|
185
|
+
display: flex;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
|
|
190
|
+
@media (max-width: 639px) {
|
|
191
|
+
.auth-top-brand {
|
|
192
|
+
margin-left: 24px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.auth-top-actions {
|
|
196
|
+
margin-right: 20px;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
149
199
|
</style>
|
|
@@ -86,13 +86,6 @@
|
|
|
86
86
|
$primary-light-7: var(--el-color-primary-light-7);
|
|
87
87
|
$primary-light-8: var(--el-color-primary-light-8);
|
|
88
88
|
$primary-light-9: var(--el-color-primary-light-9);
|
|
89
|
-
$primary-base: var(--el-color-primary);
|
|
90
|
-
$main-bg: var(--default-box-color);
|
|
91
|
-
|
|
92
|
-
// 混合颜色函数
|
|
93
|
-
$bg-mix-light-9: color-mix(in srgb, $primary-light-9 100%, $main-bg);
|
|
94
|
-
$bg-mix-light-8: color-mix(in srgb, $primary-light-8 80%, $main-bg);
|
|
95
|
-
$bg-mix-light-7: color-mix(in srgb, $primary-light-7 80%, $main-bg);
|
|
96
89
|
|
|
97
90
|
.login-left-view {
|
|
98
91
|
position: relative;
|
|
@@ -101,7 +94,7 @@
|
|
|
101
94
|
height: 100%;
|
|
102
95
|
padding: 15px;
|
|
103
96
|
overflow: hidden;
|
|
104
|
-
background-color: $
|
|
97
|
+
background-color: $primary-light-9;
|
|
105
98
|
|
|
106
99
|
.logo {
|
|
107
100
|
position: relative;
|
|
@@ -327,7 +320,7 @@
|
|
|
327
320
|
left: 16%;
|
|
328
321
|
width: 60px;
|
|
329
322
|
height: 60px;
|
|
330
|
-
background-color: $
|
|
323
|
+
background-color: $primary-light-8;
|
|
331
324
|
|
|
332
325
|
&.animate-fade-in-left {
|
|
333
326
|
animation-name: fadeInLeftRotated;
|
|
@@ -351,7 +344,7 @@
|
|
|
351
344
|
width: 50px;
|
|
352
345
|
height: 50px;
|
|
353
346
|
cursor: pointer;
|
|
354
|
-
background: $
|
|
347
|
+
background: $primary-light-7;
|
|
355
348
|
border-radius: 50%;
|
|
356
349
|
transition: all 0.3s;
|
|
357
350
|
|
|
@@ -396,7 +389,7 @@
|
|
|
396
389
|
right: -120px;
|
|
397
390
|
width: 360px;
|
|
398
391
|
height: 360px;
|
|
399
|
-
background-color: $
|
|
392
|
+
background-color: $primary-light-8;
|
|
400
393
|
border-radius: 50%;
|
|
401
394
|
}
|
|
402
395
|
|
|
@@ -445,7 +438,7 @@
|
|
|
445
438
|
z-index: 2;
|
|
446
439
|
width: 50px;
|
|
447
440
|
height: 50px;
|
|
448
|
-
background-color:
|
|
441
|
+
background-color: var(--el-color-primary-light-7);
|
|
449
442
|
}
|
|
450
443
|
|
|
451
444
|
&.square-pink {
|
|
@@ -454,7 +447,7 @@
|
|
|
454
447
|
z-index: 1;
|
|
455
448
|
width: 70px;
|
|
456
449
|
height: 70px;
|
|
457
|
-
background-color:
|
|
450
|
+
background-color: var(--el-color-primary-light-8);
|
|
458
451
|
}
|
|
459
452
|
|
|
460
453
|
&.square-purple {
|
|
@@ -463,7 +456,7 @@
|
|
|
463
456
|
z-index: 3;
|
|
464
457
|
width: 32px;
|
|
465
458
|
height: 32px;
|
|
466
|
-
background-color:
|
|
459
|
+
background-color: var(--el-color-primary-light-6);
|
|
467
460
|
}
|
|
468
461
|
}
|
|
469
462
|
|
|
@@ -484,7 +477,8 @@
|
|
|
484
477
|
}
|
|
485
478
|
}
|
|
486
479
|
|
|
487
|
-
|
|
480
|
+
/* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
|
|
481
|
+
@media only screen and (max-width: 1600px) {
|
|
488
482
|
width: 60vw;
|
|
489
483
|
|
|
490
484
|
.text-wrap {
|
|
@@ -492,39 +486,27 @@
|
|
|
492
486
|
}
|
|
493
487
|
}
|
|
494
488
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
padding: 0;
|
|
499
|
-
// 隐藏背景和其他内容,只保留 logo
|
|
500
|
-
background: transparent;
|
|
501
|
-
|
|
502
|
-
.left-img,
|
|
503
|
-
.text-wrap,
|
|
504
|
-
.geometric-decorations {
|
|
505
|
-
display: none;
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
.logo {
|
|
509
|
-
display: none;
|
|
510
|
-
}
|
|
489
|
+
/* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
|
|
490
|
+
@media only screen and (max-width: 1180px) {
|
|
491
|
+
display: none;
|
|
511
492
|
}
|
|
512
493
|
}
|
|
513
494
|
|
|
514
495
|
// 暗色主题
|
|
515
496
|
.dark .login-left-view {
|
|
516
|
-
background-color: color-
|
|
497
|
+
background-color: var(--el-bg-color-page, #070707);
|
|
517
498
|
|
|
518
|
-
|
|
519
|
-
|
|
499
|
+
/* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
|
|
500
|
+
@media only screen and (max-width: 1180px) {
|
|
501
|
+
display: none;
|
|
520
502
|
}
|
|
521
503
|
|
|
522
504
|
.geometric-decorations {
|
|
523
505
|
// 月亮效果
|
|
524
506
|
.circle-top-right {
|
|
525
|
-
background-color: $
|
|
507
|
+
background-color: $primary-light-8;
|
|
526
508
|
box-shadow: 0 0 25px #333 inset;
|
|
527
|
-
|
|
509
|
+
transform: rotate(-48deg);
|
|
528
510
|
transition: all 0.3s ease-in-out 0.1s;
|
|
529
511
|
|
|
530
512
|
&::before {
|
|
@@ -534,7 +516,7 @@
|
|
|
534
516
|
width: 50px;
|
|
535
517
|
height: 50px;
|
|
536
518
|
content: '';
|
|
537
|
-
background-color: $
|
|
519
|
+
background-color: $primary-light-9;
|
|
538
520
|
border-radius: 50%;
|
|
539
521
|
transition: all 0.3s ease-in-out;
|
|
540
522
|
}
|
|
@@ -554,12 +536,12 @@
|
|
|
554
536
|
}
|
|
555
537
|
|
|
556
538
|
.bg-bubble {
|
|
557
|
-
background-color: $
|
|
539
|
+
background-color: $primary-light-9;
|
|
558
540
|
}
|
|
559
541
|
|
|
560
542
|
// 其他元素颜色调整
|
|
561
543
|
.square-rotated {
|
|
562
|
-
background-color: $
|
|
544
|
+
background-color: $primary-light-9;
|
|
563
545
|
}
|
|
564
546
|
|
|
565
547
|
.circle-small,
|
|
@@ -582,15 +564,15 @@
|
|
|
582
564
|
box-shadow: none;
|
|
583
565
|
|
|
584
566
|
&.square-blue {
|
|
585
|
-
background-color:
|
|
567
|
+
background-color: var(--el-color-primary-light-8);
|
|
586
568
|
}
|
|
587
569
|
|
|
588
570
|
&.square-pink {
|
|
589
|
-
background-color:
|
|
571
|
+
background-color: var(--el-color-primary-light-9);
|
|
590
572
|
}
|
|
591
573
|
|
|
592
574
|
&.square-purple {
|
|
593
|
-
background-color:
|
|
575
|
+
background-color: var(--el-color-primary-light-7);
|
|
594
576
|
}
|
|
595
577
|
}
|
|
596
578
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/template/src/env.d.ts
CHANGED
|
File without changes
|
package/template/src/main.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { initStore } from './store' // Store
|
|
|
4
4
|
import { initRouter } from './router' // Router
|
|
5
5
|
import language from './locales' // 国际化
|
|
6
6
|
import '@styles/core/tailwind.css' // tailwind
|
|
7
|
+
import 'element-plus/dist/index.css' // Element Plus 基础样式(覆盖组件包内部依赖)
|
|
7
8
|
import '@styles/index.scss' // 样式
|
|
8
9
|
import '@kevairy/components/style.css' // 公共组件样式
|
|
9
10
|
import '@utils/sys/console.ts' // 控制台输出内容
|
|
@@ -13,12 +14,6 @@ import { initializeApp } from './bootstrap/initializeApp'
|
|
|
13
14
|
|
|
14
15
|
initializeApp()
|
|
15
16
|
|
|
16
|
-
document.addEventListener(
|
|
17
|
-
'touchstart',
|
|
18
|
-
function () {},
|
|
19
|
-
{ passive: false }
|
|
20
|
-
)
|
|
21
|
-
|
|
22
17
|
const app = createApp(App)
|
|
23
18
|
initStore(app)
|
|
24
19
|
initRouter(app)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<!-- 通用模板登录页面:当前使用本地 Mock,后续项目只需替换认证适配层。 -->
|
|
2
2
|
<template>
|
|
3
|
-
<
|
|
3
|
+
<main class="auth-page">
|
|
4
4
|
<LoginLeftView />
|
|
5
5
|
|
|
6
|
-
<
|
|
6
|
+
<section class="auth-right-panel">
|
|
7
7
|
<AuthTopBar />
|
|
8
8
|
|
|
9
9
|
<div class="auth-right-wrap">
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
</ElForm>
|
|
65
65
|
</div>
|
|
66
66
|
</div>
|
|
67
|
-
</
|
|
68
|
-
</
|
|
67
|
+
</section>
|
|
68
|
+
</main>
|
|
69
69
|
</template>
|
|
70
70
|
|
|
71
71
|
<script setup lang="ts">
|
|
@@ -1,26 +1,86 @@
|
|
|
1
|
-
|
|
1
|
+
/* 授权页布局:保留 vh 回退,避免旧 Chromium 忽略新视口单位。 */
|
|
2
|
+
.auth-page {
|
|
3
|
+
display: flex;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100vh;
|
|
6
|
+
min-height: 100vh;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.auth-right-panel {
|
|
11
|
+
position: relative;
|
|
12
|
+
flex: 1 1 0;
|
|
13
|
+
min-width: 0;
|
|
14
|
+
height: 100%;
|
|
15
|
+
}
|
|
2
16
|
|
|
3
|
-
/* 授权页右侧区域 */
|
|
4
17
|
.auth-right-wrap {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
width: 100%;
|
|
23
|
+
height: 100%;
|
|
24
|
+
padding: 72px 32px 32px;
|
|
25
|
+
overflow-x: hidden;
|
|
26
|
+
/* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties -- Keep an old Chromium-compatible overflow fallback. */
|
|
27
|
+
overflow-y: auto;
|
|
28
|
+
animation: slideInRight 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.auth-right-wrap .form {
|
|
32
|
+
width: 100%;
|
|
33
|
+
max-width: 440px;
|
|
34
|
+
padding: 40px 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.auth-right-wrap .title {
|
|
38
|
+
font-size: 36px;
|
|
39
|
+
font-weight: 600;
|
|
40
|
+
color: var(--art-gray-900);
|
|
41
|
+
}
|
|
9
42
|
|
|
10
|
-
|
|
11
|
-
|
|
43
|
+
.auth-right-wrap .sub-title {
|
|
44
|
+
margin-top: 10px;
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
color: var(--art-gray-600);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.auth-right-wrap .custom-height {
|
|
50
|
+
height: 40px !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
|
|
54
|
+
@media (max-width: 767px) {
|
|
55
|
+
.auth-right-wrap {
|
|
56
|
+
padding-right: 28px;
|
|
57
|
+
padding-left: 28px;
|
|
58
|
+
animation: none;
|
|
12
59
|
}
|
|
13
60
|
|
|
14
|
-
.title {
|
|
15
|
-
|
|
61
|
+
.auth-right-wrap .title {
|
|
62
|
+
font-size: 30px;
|
|
16
63
|
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
|
|
67
|
+
@media (max-width: 639px) {
|
|
68
|
+
.auth-right-wrap {
|
|
69
|
+
padding-right: 28px;
|
|
70
|
+
padding-left: 28px;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
17
73
|
|
|
18
|
-
|
|
19
|
-
|
|
74
|
+
/* stylelint-disable-next-line media-feature-range-notation -- Support legacy Chromium. */
|
|
75
|
+
@media (max-height: 720px) {
|
|
76
|
+
.auth-right-wrap {
|
|
77
|
+
align-items: flex-start;
|
|
78
|
+
padding-top: 56px;
|
|
20
79
|
}
|
|
21
80
|
|
|
22
|
-
.
|
|
23
|
-
|
|
81
|
+
.auth-right-wrap .form {
|
|
82
|
+
padding-top: 24px;
|
|
83
|
+
padding-bottom: 24px;
|
|
24
84
|
}
|
|
25
85
|
}
|
|
26
86
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -12,3 +12,35 @@ test('redirects anonymous users and signs in to the configured home page', async
|
|
|
12
12
|
await expect(page.getByRole('heading', { name: __DISPLAY_NAME_LITERAL__ })).toBeVisible()
|
|
13
13
|
await expect(page).toHaveTitle(/__DISPLAY_NAME_REGEX__/)
|
|
14
14
|
})
|
|
15
|
+
|
|
16
|
+
test('keeps the login form usable in a short compatibility viewport', async ({ page }) => {
|
|
17
|
+
await page.setViewportSize({ width: 1024, height: 600 })
|
|
18
|
+
await page.goto('/#/auth/login')
|
|
19
|
+
|
|
20
|
+
const metrics = await page.evaluate(() => {
|
|
21
|
+
const pageRoot = document.querySelector<HTMLElement>('.auth-page')
|
|
22
|
+
const panel = document.querySelector<HTMLElement>('.auth-right-panel')
|
|
23
|
+
const scroller = document.querySelector<HTMLElement>('.auth-right-wrap')
|
|
24
|
+
const form = document.querySelector<HTMLElement>('.auth-right-wrap .form')
|
|
25
|
+
const leftView = document.querySelector<HTMLElement>('.login-left-view')
|
|
26
|
+
const formRect = form?.getBoundingClientRect()
|
|
27
|
+
|
|
28
|
+
return {
|
|
29
|
+
pageWidth: pageRoot?.getBoundingClientRect().width ?? 0,
|
|
30
|
+
panelWidth: panel?.getBoundingClientRect().width ?? 0,
|
|
31
|
+
formWidth: formRect?.width ?? 0,
|
|
32
|
+
formLeft: formRect?.left ?? -1,
|
|
33
|
+
formRight: formRect?.right ?? Number.POSITIVE_INFINITY,
|
|
34
|
+
scrollable: (scroller?.scrollHeight ?? 0) >= (scroller?.clientHeight ?? 0),
|
|
35
|
+
leftViewDisplay: leftView ? getComputedStyle(leftView).display : null
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
expect(metrics.leftViewDisplay).toBe('none')
|
|
40
|
+
expect(metrics.panelWidth).toBe(metrics.pageWidth)
|
|
41
|
+
expect(metrics.formWidth).toBeLessThanOrEqual(440)
|
|
42
|
+
expect(metrics.formLeft).toBeGreaterThanOrEqual(0)
|
|
43
|
+
expect(metrics.formRight).toBeLessThanOrEqual(metrics.pageWidth)
|
|
44
|
+
expect(metrics.scrollable).toBe(true)
|
|
45
|
+
await expect(page.getByRole('button', { name: '进入系统(Mock)' })).toBeVisible()
|
|
46
|
+
})
|
|
@@ -22,6 +22,8 @@ test('supports search, reset, pagination, errors, selection and keyboard toolbar
|
|
|
22
22
|
const searchTablePage = document.querySelector<HTMLElement>('.search-table-page')
|
|
23
23
|
const pagination = document.querySelector<HTMLElement>('.kv-table .pagination')
|
|
24
24
|
const toolbarButton = document.querySelector<HTMLElement>('.toolbar-button')
|
|
25
|
+
const elementTable = document.querySelector<HTMLElement>('.kv-table .el-table')
|
|
26
|
+
const elementPagination = document.querySelector<HTMLElement>('.kv-table .el-pagination')
|
|
25
27
|
const toolbarButtonRect = toolbarButton?.getBoundingClientRect()
|
|
26
28
|
|
|
27
29
|
return {
|
|
@@ -37,7 +39,11 @@ test('supports search, reset, pagination, errors, selection and keyboard toolbar
|
|
|
37
39
|
paginationClientWidth: pagination?.clientWidth ?? 0,
|
|
38
40
|
paginationScrollWidth: pagination?.scrollWidth ?? 0,
|
|
39
41
|
toolbarButtonWidth: toolbarButtonRect?.width ?? 0,
|
|
40
|
-
toolbarButtonHeight: toolbarButtonRect?.height ?? 0
|
|
42
|
+
toolbarButtonHeight: toolbarButtonRect?.height ?? 0,
|
|
43
|
+
elementTablePosition: elementTable ? getComputedStyle(elementTable).position : null,
|
|
44
|
+
elementPaginationDisplay: elementPagination
|
|
45
|
+
? getComputedStyle(elementPagination).display
|
|
46
|
+
: null
|
|
41
47
|
}
|
|
42
48
|
})
|
|
43
49
|
|
|
@@ -48,6 +54,8 @@ test('supports search, reset, pagination, errors, selection and keyboard toolbar
|
|
|
48
54
|
expect(layout.paginationScrollWidth).toBeLessThanOrEqual(layout.paginationClientWidth)
|
|
49
55
|
expect(layout.toolbarButtonWidth).toBe(32)
|
|
50
56
|
expect(layout.toolbarButtonHeight).toBe(32)
|
|
57
|
+
expect(layout.elementTablePosition).toBe('relative')
|
|
58
|
+
expect(layout.elementPaginationDisplay).toBe('flex')
|
|
51
59
|
|
|
52
60
|
const keyword = page.getByPlaceholder('服务名称或编码')
|
|
53
61
|
await keyword.fill('SERVICE_001')
|
package/template/tsconfig.json
CHANGED
|
File without changes
|
package/template/vite.config.ts
CHANGED
|
@@ -2,11 +2,8 @@ import { defineConfig, loadEnv } from 'vite'
|
|
|
2
2
|
import vue from '@vitejs/plugin-vue'
|
|
3
3
|
import path from 'path'
|
|
4
4
|
import { fileURLToPath } from 'url'
|
|
5
|
-
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
6
|
-
import viteCompression from 'vite-plugin-compression'
|
|
7
5
|
import Components from 'unplugin-vue-components/vite'
|
|
8
6
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
9
|
-
import ElementPlus from 'unplugin-element-plus/vite'
|
|
10
7
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
|
11
8
|
import tailwindcss from '@tailwindcss/vite'
|
|
12
9
|
// import { visualizer } from 'rollup-plugin-visualizer'
|
|
@@ -54,16 +51,8 @@ export default ({ mode }: { mode: string }) => {
|
|
|
54
51
|
build: {
|
|
55
52
|
target: 'es2015',
|
|
56
53
|
outDir: 'dist',
|
|
57
|
-
chunkSizeWarningLimit:
|
|
58
|
-
minify: '
|
|
59
|
-
terserOptions: {
|
|
60
|
-
compress: {
|
|
61
|
-
// 生产环境去除 console
|
|
62
|
-
drop_console: true,
|
|
63
|
-
// 生产环境去除 debugger
|
|
64
|
-
drop_debugger: true
|
|
65
|
-
}
|
|
66
|
-
},
|
|
54
|
+
chunkSizeWarningLimit: 700,
|
|
55
|
+
minify: 'esbuild',
|
|
67
56
|
rollupOptions: {
|
|
68
57
|
output: {
|
|
69
58
|
manualChunks: splitVendorChunk
|
|
@@ -82,7 +71,7 @@ export default ({ mode }: { mode: string }) => {
|
|
|
82
71
|
AutoImport({
|
|
83
72
|
imports: ['vue', 'vue-router', 'pinia', '@vueuse/core'],
|
|
84
73
|
dts: 'src/types/import/auto-imports.d.ts',
|
|
85
|
-
resolvers: [ElementPlusResolver()],
|
|
74
|
+
resolvers: [ElementPlusResolver({ importStyle: false })],
|
|
86
75
|
eslintrc: {
|
|
87
76
|
enabled: true,
|
|
88
77
|
filepath: './eslint-auto-import.json',
|
|
@@ -92,22 +81,8 @@ export default ({ mode }: { mode: string }) => {
|
|
|
92
81
|
// 自动按需导入组件
|
|
93
82
|
Components({
|
|
94
83
|
dts: 'src/types/import/components.d.ts',
|
|
95
|
-
resolvers: [ElementPlusResolver()]
|
|
96
|
-
})
|
|
97
|
-
// 按需定制主题配置
|
|
98
|
-
ElementPlus({
|
|
99
|
-
useSource: true
|
|
100
|
-
}),
|
|
101
|
-
// 压缩
|
|
102
|
-
viteCompression({
|
|
103
|
-
verbose: false, // 是否在控制台输出压缩结果
|
|
104
|
-
disable: false, // 是否禁用
|
|
105
|
-
algorithm: 'gzip', // 压缩算法
|
|
106
|
-
ext: '.gz', // 压缩后的文件名后缀
|
|
107
|
-
threshold: 10240, // 只有大小大于该值的资源会被处理 10240B = 10KB
|
|
108
|
-
deleteOriginFile: false // 压缩后是否删除原文件
|
|
109
|
-
}),
|
|
110
|
-
vueDevTools()
|
|
84
|
+
resolvers: [ElementPlusResolver({ importStyle: false })]
|
|
85
|
+
})
|
|
111
86
|
// 打包分析
|
|
112
87
|
// visualizer({
|
|
113
88
|
// open: true,
|
|
@@ -116,32 +91,27 @@ export default ({ mode }: { mode: string }) => {
|
|
|
116
91
|
// filename: 'dist/stats.html' // 分析图生成的文件名及路径
|
|
117
92
|
// }),
|
|
118
93
|
],
|
|
119
|
-
//
|
|
94
|
+
// 只预构建首屏稳定依赖,重型功能在实际访问时再按需处理。
|
|
120
95
|
optimizeDeps: {
|
|
121
96
|
include: [
|
|
122
|
-
'
|
|
123
|
-
'
|
|
124
|
-
'
|
|
125
|
-
'
|
|
126
|
-
'
|
|
127
|
-
'xgplayer',
|
|
128
|
-
'file-saver',
|
|
129
|
-
'vue-img-cutter',
|
|
97
|
+
'vue',
|
|
98
|
+
'vue-router',
|
|
99
|
+
'pinia',
|
|
100
|
+
'vue-i18n',
|
|
101
|
+
'axios',
|
|
130
102
|
'element-plus/es',
|
|
131
|
-
'element-plus/es/components
|
|
132
|
-
'element-plus/es/components
|
|
103
|
+
'element-plus/es/components/base/style/css',
|
|
104
|
+
'element-plus/es/components/config-provider/style/css',
|
|
105
|
+
'element-plus/es/components/message/style/css'
|
|
133
106
|
]
|
|
134
107
|
},
|
|
108
|
+
esbuild:
|
|
109
|
+
mode === 'production'
|
|
110
|
+
? {
|
|
111
|
+
drop: ['console', 'debugger']
|
|
112
|
+
}
|
|
113
|
+
: undefined,
|
|
135
114
|
css: {
|
|
136
|
-
preprocessorOptions: {
|
|
137
|
-
// sass variable and mixin
|
|
138
|
-
scss: {
|
|
139
|
-
additionalData: `
|
|
140
|
-
@use "@styles/core/el-light.scss" as *;
|
|
141
|
-
@use "@styles/core/mixin.scss" as *;
|
|
142
|
-
`
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
115
|
postcss: {
|
|
146
116
|
plugins: [
|
|
147
117
|
{
|
|
Binary file
|