@kevairy/template 0.1.5 → 0.1.7

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 (68) hide show
  1. package/package.json +1 -1
  2. package/template/.agents/skills/kevairy-ui/SKILL.md +4 -0
  3. package/template/.agents/skills/kevairy-ui/references/component-catalog.md +1 -0
  4. package/template/.agents/skills/kevairy-ui/references/form-drawer.md +22 -0
  5. package/template/AGENTS.md +12 -0
  6. package/template/README.md +14 -0
  7. package/template/package.json +3 -2
  8. package/template/public/licenses/noto-sans-sc-OFL.txt +93 -0
  9. package/template/src/assets/images/common/logo.webp +0 -0
  10. package/template/src/assets/images/favicon.ico +0 -0
  11. package/template/src/assets/styles/core/el-ui.scss +0 -3
  12. package/template/src/assets/styles/core/router-transition.scss +36 -4
  13. package/template/src/assets/styles/core/tailwind.css +3 -0
  14. package/template/src/assets/styles/custom/search-table.scss +8 -0
  15. package/template/src/assets/styles/custom/typography.scss +88 -0
  16. package/template/src/components/core/feedback/art-page-loading/index.vue +1 -1
  17. package/template/src/components/core/layouts/art-chat-window/index.vue +15 -24
  18. package/template/src/components/core/layouts/art-header-bar/index.vue +21 -1
  19. package/template/src/components/core/layouts/art-header-bar/widget/ArtUserMenu.vue +17 -8
  20. package/template/src/components/core/layouts/art-menus/art-horizontal-menu/widget/HorizontalSubmenu.vue +7 -1
  21. package/template/src/components/core/layouts/art-menus/art-sidebar-menu/index.vue +1 -0
  22. package/template/src/components/core/layouts/art-menus/art-sidebar-menu/style.scss +2 -1
  23. package/template/src/components/core/layouts/art-menus/art-sidebar-menu/theme.scss +7 -0
  24. package/template/src/components/core/layouts/art-menus/art-sidebar-menu/widget/SidebarSubmenu.vue +2 -2
  25. package/template/src/components/core/layouts/art-notification/index.vue +11 -21
  26. package/template/src/components/core/layouts/art-screen-lock/index.vue +6 -2
  27. package/template/src/components/core/layouts/art-work-tab/index.vue +8 -15
  28. package/template/src/components/core/views/exception/ArtException.vue +8 -5
  29. package/template/src/config/index.ts +1 -2
  30. package/template/src/hooks/core/useChart.ts +22 -2
  31. package/template/src/locales/langs/en.json +1 -1
  32. package/template/src/locales/langs/zh.json +1 -1
  33. package/template/src/main.ts +3 -0
  34. package/template/src/router/core/access.ts +11 -0
  35. package/template/src/types/config/index.ts +1 -1
  36. package/template/src/types/router/index.ts +2 -0
  37. package/template/src/utils/ui/loading.ts +7 -1
  38. package/template/src/views/examples/crud-workspace/index.vue +103 -30
  39. package/template/src/views/examples/search-table/index.vue +1 -1
  40. package/template/src/views/exception/500/index.vue +35 -32
  41. package/template/src/views/index/index.vue +58 -2
  42. package/template/src/views/index/style.scss +91 -13
  43. package/template/tests/e2e/drawer.spec.ts +85 -0
  44. package/template/tests/e2e/form-drawer.spec.ts +128 -0
  45. package/template/tests/e2e/layout-motion.spec.ts +189 -0
  46. package/template/tests/e2e/search-table.spec.ts +6 -5
  47. package/template/tests/e2e/session-recovery.spec.ts +6 -8
  48. package/template/tests/e2e/typography.spec.ts +118 -0
  49. package/template/tests/unit/permissions/rules.spec.ts +29 -0
  50. package/template/vite.config.ts +2 -0
  51. package/template/src/assets/images/avatar/avatar.webp +0 -0
  52. package/template/src/assets/images/avatar/avatar1.webp +0 -0
  53. package/template/src/assets/images/avatar/avatar10.webp +0 -0
  54. package/template/src/assets/images/avatar/avatar2.webp +0 -0
  55. package/template/src/assets/images/avatar/avatar3.webp +0 -0
  56. package/template/src/assets/images/avatar/avatar4.webp +0 -0
  57. package/template/src/assets/images/avatar/avatar5.webp +0 -0
  58. package/template/src/assets/images/avatar/avatar6.webp +0 -0
  59. package/template/src/assets/images/avatar/avatar7.webp +0 -0
  60. package/template/src/assets/images/avatar/avatar8.webp +0 -0
  61. package/template/src/assets/images/avatar/avatar9.webp +0 -0
  62. package/template/src/assets/images/ceremony/xc.png +0 -0
  63. package/template/src/assets/images/draw/draw1.png +0 -0
  64. package/template/src/assets/images/lock/bg_dark.webp +0 -0
  65. package/template/src/assets/images/lock/bg_light.webp +0 -0
  66. package/template/src/assets/images/login/lf_icon2.webp +0 -0
  67. package/template/src/assets/images/user/avatar.webp +0 -0
  68. package/template/src/assets/images/user/bg.webp +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevairy/template",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Project template consumed by @kevairy/cli",
5
5
  "keywords": [
6
6
  "vue",
@@ -19,6 +19,10 @@ description: Guide Vue 3 admin UI work toward @kevairy/components and establishe
19
19
  6. Keep `@kevairy/components/style.css` imported once in `src/main.ts`; do not import it in individual pages.
20
20
  7. Run focused tests and `pnpm typecheck`. Run `pnpm build` when changing dependencies, shared UI composition, or build-facing code.
21
21
 
22
+ ## Business forms
23
+
24
+ For a new business create form, or a shared create/edit form, read [the form drawer convention](references/form-drawer.md) and use `KvFormDrawer` by default without asking which container to use. Start from `src/views/examples/crud-workspace/index.vue`. Historical Dialog forms are not the default pattern. Explicit user instructions or an established design can override this default; record the reason. Confirmation dialogs are outside this rule.
25
+
22
26
  ## Source-of-truth rules
23
27
 
24
28
  - Treat the installed package exports and type declarations as authoritative for the project's pinned version.
@@ -19,6 +19,7 @@ Use this catalog to choose a capability before reading its exact API documentati
19
19
  | Base table rendering | `KvTable` | https://kevairy.top/components/api/kv-table |
20
20
  | Column visibility, density, refresh, and fullscreen controls | `KvTableToolbar` | https://kevairy.top/components/api/kv-table-toolbar |
21
21
  | Config-driven search form | `KvSearchBar` | https://kevairy.top/components/api/kv-search-bar |
22
+ | Business create form or shared create/edit form | `KvFormDrawer` | https://kevairy.top/components/api/kv-form-drawer |
22
23
  | Draggable or resizable dialog | `KvDialog` | https://kevairy.top/components/api/kv-dialog |
23
24
  | Dictionary value as a styled tag | `KvDictTag` | https://kevairy.top/components/api/kv-dict-tag |
24
25
  | Section heading with optional actions | `KvSectionTitle` | https://kevairy.top/components/api/kv-section-title |
@@ -0,0 +1,22 @@
1
+ # 业务表单抽屉规范
2
+
3
+ ## 适用范围
4
+
5
+ 新开发的业务新增表单默认使用 `@kevairy/components` 的 `KvFormDrawer`,从页面右侧滑出;新增与编辑共用同一表单时统一使用抽屉。没有指定容器时直接采用默认方案,无需询问。
6
+
7
+ 用户明确要求其他形式,或已有明确的产品设计时,遵循该要求并在交付说明中记录原因。删除确认、操作确认、消息提示、登录/注册页面和导航抽屉不属于本规范。历史业务表单仅在明确的迁移任务中调整。
8
+
9
+ ## 实现方式
10
+
11
+ - 以 [标准 CRUD 示例](../../../../src/views/examples/crud-workspace/index.vue) 为起点。不要模仿历史 `KvDialog` / `ElDialog` 新增表单,也不要自行拼装 `ElDrawer` 复制公共交互。
12
+ - 先核对当前组件版本和类型。组件不存在时说明版本差异,不要编造 API。组件 API:<https://kevairy.top/components/api/kv-form-drawer>。
13
+ - 默认桌面宽度 640px;复杂表单通过 `size` 加宽;视口宽度不超过 640px 时全宽显示。标题和底部操作区固定,内容独立滚动。
14
+ - 使用默认“取消 / 保存”按钮。需要附加操作时使用 `footer-extra`,不要自行关闭以绕过保护。
15
+ - 页面负责字段、校验、接口和错误提示。`submitting` 在校验开始前同步置为 true,通过 finally 恢复,并在提交函数入口判断以防重复提交;表单控件在提交期间禁用。
16
+ - 页面保存打开时的字段快照,计算 `dirty`;编辑数据应先加载并建立快照,再允许输入。取消、右上角关闭、Esc 统一触发未保存修改确认。需要程序化取消时调用实例的 `requestClose()`。
17
+ - 保存失败时保持抽屉打开、保留输入并展示错误;保存成功后才设置 v-model 为 false,然后刷新列表。父组件主动设置 false 会跳过放弃修改确认,只用于保存成功或明确的外部状态切换。
18
+ - 在 `closed` 后重置字段和校验;每次打开建立新的初始状态,防止新增与编辑之间残留数据。
19
+
20
+ ## 交付检查
21
+
22
+ 验证默认从右侧打开、小屏全宽、内容滚动时操作区可见;验证必填校验、重复提交保护、保存成功刷新、失败保留输入;验证有修改时取消/关闭/Esc 提示确认、继续编辑保留数据、放弃修改后重新打开无残留。
@@ -9,6 +9,18 @@
9
9
  - 在线文档与当前安装版本不一致时,以 `package.json` 中的版本及其类型声明为准。
10
10
  - `@kevairy/components/style.css` 只在应用入口导入一次,页面中不要重复导入。
11
11
 
12
+ ## 新增表单
13
+
14
+ - 新开发的业务新增表单默认使用从右侧滑出的 `KvFormDrawer`,无需再次询问交互形式。新增与编辑共用表单时统一使用抽屉。
15
+ - 表单开发前阅读 Skill 的 [表单抽屉规范](.agents/skills/kevairy-ui/references/form-drawer.md),优先参考 `src/views/examples/crud-workspace/index.vue`,不要沿用历史 Dialog 表单。
16
+ - 删除确认、操作确认等非表单交互继续使用确认对话框。用户明确指定其他交互或已有明确设计要求时按其要求实现,并在交付说明中记录例外原因。
17
+ - 历史业务表单按明确的迁移任务逐步调整,不因本规范批量改写。
18
+
19
+ ## Code Review Rules
20
+
21
+ - 检查新开发的业务新增表单是否使用 `KvFormDrawer`;使用其他容器时检查是否有明确的用户要求或设计依据。
22
+ - 检查取消、关闭按钮、Esc 是否保留未保存修改保护,提交是否防止重复操作,失败是否保留输入。
23
+
12
24
  ## 验证
13
25
 
14
26
  - 修改完成后运行与变更相称的检查,至少包含 `pnpm typecheck`。
@@ -21,6 +21,20 @@ __RUN_COMMAND__ test
21
21
  __RUN_COMMAND__ build
22
22
  ```
23
23
 
24
+ ## 布局动效
25
+
26
+ 首次进入或刷新时,菜单、工具栏和页面区块在全屏 Loading 结束后错峰入场;日常导航与页面内刷新只过渡右侧内容。
27
+
28
+ 内容外层只淡入,内部区块的位移在入场期间局部裁剪,避免短暂滚动条,长页面仍正常滚动。移动端菜单保留独立抽屉行为。设置面板的“页面切换动画”选择“无”,或系统开启“减少动态效果”时,布局入场不播放。
29
+
30
+ 布局入口为 src/views/index/index.vue 与同目录的 style.scss,路由过渡样式为 src/assets/styles/core/router-transition.scss。
31
+
32
+ ## 字体与搜索表格
33
+
34
+ 模板本地打包 Noto Sans SC Variable,统一排版入口为 src/assets/styles/custom/typography.scss,使用 --app-font-family 与 --app-font-mono。字体无需外部服务,OFL 许可证随 public/licenses 一同部署。
35
+
36
+ 搜索栏间距、表格标题显隐和工具栏尺寸由 @kevairy/components 维护;搜索栏和表格卡片四周内边距、搜索栏与卡片间距、工具栏到表格内容间距默认均为 12px,可通过公共组件间距 CSS 变量覆盖;搜索表格默认保留数量统计,不传 title 时不显示标题,传入非空 title 即显示;区域名称可用 aria-label 独立设置。表头配色由 src/assets/styles/custom/search-table.scss 配置,背景显隐仍由 appearance.headerBackground 控制。
37
+
24
38
  ## 版本与构建
25
39
 
26
40
  发布版本由项目根目录 package.json 的 version 管理。每次执行构建命令会自动生成独立的构建编号、UTC 构建时间、Git 提交和未提交状态,不修改版本文件。
@@ -12,7 +12,7 @@
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.2.1",
15
+ "@kevairy/components": "0.2.2",
16
16
  "@tailwindcss/vite": "4.3.3",
17
17
  "@vueuse/core": "13.9.0",
18
18
  "@wangeditor/editor": "5.1.23",
@@ -32,7 +32,8 @@
32
32
  "vue": "3.5.45",
33
33
  "vue-i18n": "11.4.18",
34
34
  "vue-router": "4.6.4",
35
- "xgplayer": "3.0.26"
35
+ "xgplayer": "3.0.26",
36
+ "@fontsource-variable/noto-sans-sc": "5.3.1"
36
37
  },
37
38
  "devDependencies": {
38
39
  "@eslint/js": "9.39.5",
@@ -0,0 +1,93 @@
1
+ Google Inc.
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -7,9 +7,6 @@
7
7
  --el-color-black: white !important;
8
8
  // 输入框边框颜色
9
9
  // --el-border-color: #E4E4E7 !important; // DCDFE6
10
- // 按钮粗度
11
- --el-font-weight-primary: 400 !important;
12
-
13
10
  --el-component-custom-height: 36px !important;
14
11
 
15
12
  --el-component-size: var(--el-component-custom-height) !important;
@@ -25,12 +25,16 @@ $fade-easing: transition-config('fade-easing');
25
25
 
26
26
  // === 动画类 ===
27
27
 
28
- // 淡入淡出动画
28
+ // 默认页面切换:轻微上移,退出更快;只作用于右侧路由内容。
29
29
  .fade {
30
- &-enter-active,
30
+ &-enter-active {
31
+ transition:
32
+ opacity 200ms $easing,
33
+ transform 200ms $easing;
34
+ }
35
+
31
36
  &-leave-active {
32
- transition: opacity $duration $fade-easing;
33
- will-change: opacity;
37
+ transition: opacity 120ms $fade-easing;
34
38
  }
35
39
 
36
40
  &-enter-from,
@@ -42,6 +46,14 @@ $fade-easing: transition-config('fade-easing');
42
46
  &-leave-from {
43
47
  opacity: 1;
44
48
  }
49
+
50
+ &-enter-from {
51
+ transform: translate3d(0, 6px, 0);
52
+ }
53
+
54
+ &-enter-to {
55
+ transform: none;
56
+ }
45
57
  }
46
58
 
47
59
  // 滑动动画通用样式
@@ -102,3 +114,23 @@ $fade-easing: transition-config('fade-easing');
102
114
  .slide-bottom {
103
115
  @include slide-transition('bottom');
104
116
  }
117
+
118
+ @media (prefers-reduced-motion: reduce) {
119
+ .fade,
120
+ .slide-left,
121
+ .slide-right,
122
+ .slide-top,
123
+ .slide-bottom {
124
+ &-enter-active,
125
+ &-leave-active {
126
+ transition: none;
127
+ will-change: auto;
128
+ }
129
+
130
+ &-enter-from,
131
+ &-leave-to {
132
+ opacity: 1;
133
+ transform: none;
134
+ }
135
+ }
136
+ }
@@ -97,6 +97,9 @@
97
97
 
98
98
  /* ==================== Tailwind Theme Configuration ==================== */
99
99
  @theme {
100
+ --font-sans: var(--app-font-family);
101
+ --font-mono: var(--app-font-mono);
102
+
100
103
  /* Box Color (Light: white / Dark: black) */
101
104
  --color-box: var(--default-box-color);
102
105
 
@@ -0,0 +1,8 @@
1
+ // 应用表头配色;是否显示背景由公共组件的 appearance.headerBackground 控制。
2
+ :root {
3
+ --kv-table-header-bg: var(--art-gray-200);
4
+ }
5
+
6
+ html.dark {
7
+ --kv-table-header-bg: #1f2937;
8
+ }
@@ -0,0 +1,88 @@
1
+ // 字体由 Fontsource 随应用打包;此入口在 Element Plus、Kevairy 样式之后加载。
2
+ :root {
3
+ --app-font-family:
4
+ 'Noto Sans SC Variable', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui,
5
+ sans-serif;
6
+ --app-font-mono: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
7
+ --app-font-size-small: 12px;
8
+ --app-font-size-secondary: 13px;
9
+ --app-font-size-base: 14px;
10
+ --app-font-size-title: 16px;
11
+ --app-font-weight-regular: 400;
12
+ --app-font-weight-medium: 500;
13
+ --app-font-weight-semibold: 600;
14
+ --app-line-height: 1.5;
15
+ --el-font-family: var(--app-font-family);
16
+ --el-font-size-base: var(--app-font-size-base);
17
+ --el-font-size-small: var(--app-font-size-secondary);
18
+ --el-font-size-extra-small: var(--app-font-size-small);
19
+ --el-font-size-medium: var(--app-font-size-title);
20
+ --el-font-weight-primary: var(--app-font-weight-medium);
21
+ }
22
+
23
+ html {
24
+ font-family: var(--app-font-family);
25
+ }
26
+
27
+ body {
28
+ font-size: var(--app-font-size-base);
29
+ font-weight: var(--app-font-weight-regular);
30
+ line-height: var(--app-line-height);
31
+ }
32
+
33
+ // 原生控件、浮层和 Teleport 内容均从同一字体入口继承。
34
+ button,
35
+ input,
36
+ optgroup,
37
+ select,
38
+ textarea {
39
+ font-family: inherit;
40
+ }
41
+
42
+ code,
43
+ kbd,
44
+ pre,
45
+ samp {
46
+ font-family: var(--app-font-mono);
47
+ }
48
+
49
+ .el-form-item__label,
50
+ .el-button,
51
+ .el-tabs__item {
52
+ font-weight: var(--app-font-weight-medium);
53
+ }
54
+
55
+ .el-table {
56
+ font-variant-numeric: tabular-nums;
57
+
58
+ th.el-table__cell {
59
+ font-weight: var(--app-font-weight-medium);
60
+ color: var(--el-text-color-primary);
61
+ }
62
+ }
63
+
64
+ .kv-search-table .table-summary {
65
+ span {
66
+ font-size: var(--app-font-size-secondary);
67
+ font-weight: var(--app-font-weight-regular);
68
+ font-variant-numeric: tabular-nums;
69
+ }
70
+ }
71
+
72
+ .el-dialog .el-dialog__title,
73
+ .el-drawer .el-drawer__title,
74
+ .el-message-box .el-message-box__title {
75
+ font-size: var(--app-font-size-title);
76
+ font-weight: var(--app-font-weight-semibold);
77
+ line-height: var(--app-line-height);
78
+ }
79
+
80
+ .el-pagination,
81
+ .el-statistic,
82
+ .el-date-editor {
83
+ font-variant-numeric: tabular-nums;
84
+ }
85
+
86
+ .el-menu-item.is-active {
87
+ font-weight: var(--app-font-weight-medium);
88
+ }
@@ -161,7 +161,7 @@
161
161
 
162
162
  &__text {
163
163
  max-width: 100%;
164
- font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
164
+ font-family: var(--app-font-family);
165
165
  font-size: clamp(14px, 4vw, 16px);
166
166
  font-weight: 400;
167
167
  line-height: 1.5;
@@ -32,7 +32,9 @@
32
32
  message.isMe ? 'flex-row-reverse' : 'flex-row'
33
33
  ]"
34
34
  >
35
- <ElAvatar :size="32" :src="message.avatar" class="shrink-0" />
35
+ <ElAvatar :size="32" :src="message.avatar" class="shrink-0">
36
+ <ArtSvgIcon :icon="AppConfig.assets.defaultAvatarIcon" class="text-lg" />
37
+ </ElAvatar>
36
38
  <div
37
39
  :class="['flex max-w-[70%] flex-col', message.isMe ? 'items-end' : 'items-start']"
38
40
  >
@@ -91,8 +93,7 @@
91
93
  <script setup lang="ts">
92
94
  import { Picture, Paperclip, Close } from '@element-plus/icons-vue'
93
95
  import { mittBus } from '@/utils/sys'
94
- import meAvatar from '@/assets/images/avatar/avatar5.webp'
95
- import aiAvatar from '@/assets/images/avatar/avatar10.webp'
96
+ import AppConfig from '@/config'
96
97
 
97
98
  defineOptions({ name: 'ArtChatWindow' })
98
99
 
@@ -103,7 +104,7 @@
103
104
  content: string
104
105
  time: string
105
106
  isMe: boolean
106
- avatar: string
107
+ avatar?: string
107
108
  }
108
109
 
109
110
  // 常量定义
@@ -132,72 +133,63 @@
132
133
  sender: BOT_NAME,
133
134
  content: '你好!我是你的AI助手,有什么我可以帮你的吗?',
134
135
  time: '10:00',
135
- isMe: false,
136
- avatar: aiAvatar
136
+ isMe: false
137
137
  },
138
138
  {
139
139
  id: 2,
140
140
  sender: USER_NAME,
141
141
  content: '我想了解一下系统的使用方法。',
142
142
  time: '10:01',
143
- isMe: true,
144
- avatar: meAvatar
143
+ isMe: true
145
144
  },
146
145
  {
147
146
  id: 3,
148
147
  sender: BOT_NAME,
149
148
  content: '好的,我来为您介绍系统的主要功能。首先,您可以通过左侧菜单访问不同的功能模块...',
150
149
  time: '10:02',
151
- isMe: false,
152
- avatar: aiAvatar
150
+ isMe: false
153
151
  },
154
152
  {
155
153
  id: 4,
156
154
  sender: USER_NAME,
157
155
  content: '听起来很不错,能具体讲讲数据分析部分吗?',
158
156
  time: '10:05',
159
- isMe: true,
160
- avatar: meAvatar
157
+ isMe: true
161
158
  },
162
159
  {
163
160
  id: 5,
164
161
  sender: BOT_NAME,
165
162
  content: '当然可以。数据分析模块可以帮助您实时监控关键指标,并生成详细的报表...',
166
163
  time: '10:06',
167
- isMe: false,
168
- avatar: aiAvatar
164
+ isMe: false
169
165
  },
170
166
  {
171
167
  id: 6,
172
168
  sender: USER_NAME,
173
169
  content: '太好了,那我如何开始使用呢?',
174
170
  time: '10:08',
175
- isMe: true,
176
- avatar: meAvatar
171
+ isMe: true
177
172
  },
178
173
  {
179
174
  id: 7,
180
175
  sender: BOT_NAME,
181
176
  content: '您可以先创建一个项目,然后在项目中添加相关的数据源,系统会自动进行分析。',
182
177
  time: '10:09',
183
- isMe: false,
184
- avatar: aiAvatar
178
+ isMe: false
185
179
  },
186
180
  {
187
181
  id: 8,
188
182
  sender: USER_NAME,
189
183
  content: '明白了,谢谢你的帮助!',
190
184
  time: '10:10',
191
- isMe: true,
192
- avatar: meAvatar
185
+ isMe: true
193
186
  },
194
187
  {
195
188
  id: 9,
196
189
  sender: BOT_NAME,
197
190
  content: '不客气,有任何问题随时联系我。',
198
191
  time: '10:11',
199
- isMe: false,
200
- avatar: aiAvatar
192
+ isMe: false
201
193
  }
202
194
  ]
203
195
 
@@ -231,8 +223,7 @@
231
223
  sender: USER_NAME,
232
224
  content: text,
233
225
  time: formatCurrentTime(),
234
- isMe: true,
235
- avatar: meAvatar
226
+ isMe: true
236
227
  }
237
228
 
238
229
  messages.value.push(newMessage)
@@ -18,7 +18,9 @@
18
18
  <!-- 系统信息 -->
19
19
  <div class="flex-c c-p" @click="toHome" v-if="isTopMenu">
20
20
  <ArtLogo class="pl-4.5" />
21
- <p v-if="width >= 1400" class="my-0 mx-2 ml-2 text-lg">{{ AppConfig.systemInfo.name }}</p>
21
+ <p v-if="width >= 1400" class="my-0 mx-2 ml-2 text-base font-semibold">{{
22
+ AppConfig.systemInfo.name
23
+ }}</p>
22
24
  </div>
23
25
 
24
26
  <ArtLogo
@@ -470,6 +472,24 @@
470
472
  animation: breathing 1.5s ease-in-out infinite;
471
473
  }
472
474
 
475
+ @media (prefers-reduced-motion: reduce) {
476
+ .refresh-btn,
477
+ .language-btn,
478
+ .setting-btn,
479
+ .full-screen-btn,
480
+ .exit-full-screen-btn,
481
+ .notice-button,
482
+ .chat-button {
483
+ &:hover :deep(.art-svg-icon) {
484
+ animation: none;
485
+ }
486
+ }
487
+
488
+ .breathing-dot {
489
+ animation: none;
490
+ }
491
+ }
492
+
473
493
  /* iPad breakpoint adjustments */
474
494
  @media screen and (width <= 768px) {
475
495
  .logo2 {
@@ -12,20 +12,29 @@
12
12
  popper-style="padding: 5px 16px;"
13
13
  >
14
14
  <template #reference>
15
- <img
16
- class="user-menu-avatar size-8.5 mr-5 c-p rounded-full max-sm:w-6.5 max-sm:h-6.5 max-sm:mr-[16px]"
17
- :src="userInfo.avatar || AppConfig.assets.defaultAvatar"
15
+ <ElAvatar
16
+ class="user-menu-avatar !size-8.5 mr-5 c-p max-sm:!size-6.5 max-sm:mr-[16px]"
17
+ :src="userInfo.avatar"
18
18
  :alt="userInfo.userName || '用户头像'"
19
- />
19
+ role="img"
20
+ :aria-label="userInfo.userName || '用户头像'"
21
+ >
22
+ <ArtSvgIcon :icon="AppConfig.assets.defaultAvatarIcon" class="text-xl max-sm:text-base" />
23
+ </ElAvatar>
20
24
  </template>
21
25
  <template #default>
22
26
  <div class="pt-3">
23
27
  <div class="flex-c pb-1 px-0">
24
- <img
25
- class="w-10 h-10 mr-3 ml-0 overflow-hidden rounded-full float-left"
26
- :src="userInfo.avatar || AppConfig.assets.defaultAvatar"
28
+ <ElAvatar
29
+ :size="40"
30
+ class="mr-3 shrink-0"
31
+ :src="userInfo.avatar"
27
32
  :alt="userInfo.userName || '用户头像'"
28
- />
33
+ role="img"
34
+ :aria-label="userInfo.userName || '用户头像'"
35
+ >
36
+ <ArtSvgIcon :icon="AppConfig.assets.defaultAvatarIcon" class="text-2xl" />
37
+ </ElAvatar>
29
38
  <div class="w-[calc(100%-60px)] h-full">
30
39
  <span class="block text-sm font-medium text-g-800 truncate">{{
31
40
  userInfo.userName
@@ -1,7 +1,12 @@
1
1
  <template>
2
2
  <ElSubMenu v-if="hasChildren" :index="item.path || item.meta.title" class="!p-0">
3
3
  <template #title>
4
- <ArtSvgIcon :icon="item.meta.icon" :color="theme?.iconColor" class="mr-1 text-lg" />
4
+ <ArtSvgIcon
5
+ v-if="level === 0 && item.meta.icon"
6
+ :icon="item.meta.icon"
7
+ :color="theme?.iconColor"
8
+ class="mr-1 text-lg"
9
+ />
5
10
  <span class="text-md">{{ formatMenuTitle(item.meta.title) }}</span>
6
11
  <div v-if="item.meta.showBadge" class="art-badge art-badge-horizontal" />
7
12
  <div v-if="item.meta.showTextBadge" class="art-text-badge">
@@ -27,6 +32,7 @@
27
32
  @click="goPage(item)"
28
33
  >
29
34
  <ArtSvgIcon
35
+ v-if="level === 0 && item.meta.icon"
30
36
  :icon="item.meta.icon"
31
37
  :color="theme?.iconColor"
32
38
  class="mr-1 text-lg"
@@ -101,6 +101,7 @@
101
101
  >
102
102
  <SidebarSubmenu
103
103
  :list="menuList"
104
+ :level="isTopLeftMenu || isDualMenu ? 1 : 0"
104
105
  :isMobile="isMobileMode"
105
106
  :theme="getMenuTheme"
106
107
  @close="handleMenuClose"
@@ -159,7 +159,8 @@
159
159
  left: 58px;
160
160
  box-sizing: border-box;
161
161
  margin-left: 10px;
162
- font-size: 18px;
162
+ font-size: var(--app-font-size-title);
163
+ font-weight: var(--app-font-weight-semibold);
163
164
 
164
165
  &.is-dual-menu-name {
165
166
  left: 25px;
@@ -15,6 +15,13 @@ $popup-menu-radius: 6px;
15
15
  width: calc(100% - 16px);
16
16
  margin-left: 8px;
17
17
  border-radius: 6px;
18
+ transition:
19
+ color 160ms ease,
20
+ background-color 160ms ease;
21
+
22
+ @media (prefers-reduced-motion: reduce) {
23
+ transition: none;
24
+ }
18
25
 
19
26
  .menu-icon {
20
27
  margin-left: -7px;