@kevairy/template 0.1.0
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/LICENSE +21 -0
- package/README.md +14 -0
- package/package.json +37 -0
- package/template/.env +22 -0
- package/template/.env.development +13 -0
- package/template/.env.production +10 -0
- package/template/.prettierignore +3 -0
- package/template/.prettierrc +20 -0
- package/template/.stylelintignore +9 -0
- package/template/.stylelintrc.cjs +84 -0
- package/template/LICENSE +21 -0
- package/template/README.md +22 -0
- package/template/_gitignore +19 -0
- package/template/eslint-auto-import.json +324 -0
- package/template/eslint.config.mjs +83 -0
- package/template/index.html +25 -0
- package/template/package.json +79 -0
- package/template/playwright.config.ts +25 -0
- package/template/public/favicon.ico +0 -0
- package/template/src/App.vue +39 -0
- package/template/src/adapters/auth/index.ts +9 -0
- package/template/src/adapters/auth/mock.ts +10 -0
- package/template/src/adapters/auth/types.ts +11 -0
- package/template/src/adapters/navigation/index.ts +13 -0
- package/template/src/adapters/navigation/types.ts +6 -0
- package/template/src/api/auth.ts +23 -0
- package/template/src/assets/images/avatar/avatar.webp +0 -0
- package/template/src/assets/images/avatar/avatar1.webp +0 -0
- package/template/src/assets/images/avatar/avatar10.webp +0 -0
- package/template/src/assets/images/avatar/avatar2.webp +0 -0
- package/template/src/assets/images/avatar/avatar3.webp +0 -0
- package/template/src/assets/images/avatar/avatar4.webp +0 -0
- package/template/src/assets/images/avatar/avatar5.webp +0 -0
- package/template/src/assets/images/avatar/avatar6.webp +0 -0
- package/template/src/assets/images/avatar/avatar7.webp +0 -0
- package/template/src/assets/images/avatar/avatar8.webp +0 -0
- package/template/src/assets/images/avatar/avatar9.webp +0 -0
- package/template/src/assets/images/ceremony/hb.png +0 -0
- package/template/src/assets/images/ceremony/sd.png +0 -0
- package/template/src/assets/images/ceremony/xc.png +0 -0
- package/template/src/assets/images/ceremony/yd.png +0 -0
- package/template/src/assets/images/common/logo.webp +0 -0
- package/template/src/assets/images/draw/draw1.png +0 -0
- package/template/src/assets/images/favicon.ico +0 -0
- package/template/src/assets/images/lock/bg_dark.webp +0 -0
- package/template/src/assets/images/lock/bg_light.webp +0 -0
- package/template/src/assets/images/login/kylin-hero-source.png +0 -0
- package/template/src/assets/images/login/lf_icon2.webp +0 -0
- package/template/src/assets/images/settings/menu_layouts/dual_column.png +0 -0
- package/template/src/assets/images/settings/menu_layouts/horizontal.png +0 -0
- package/template/src/assets/images/settings/menu_layouts/mixed.png +0 -0
- package/template/src/assets/images/settings/menu_layouts/vertical.png +0 -0
- package/template/src/assets/images/settings/menu_styles/dark.png +0 -0
- package/template/src/assets/images/settings/menu_styles/design.png +0 -0
- package/template/src/assets/images/settings/menu_styles/light.png +0 -0
- package/template/src/assets/images/settings/theme_styles/dark.png +0 -0
- package/template/src/assets/images/settings/theme_styles/light.png +0 -0
- package/template/src/assets/images/settings/theme_styles/system.png +0 -0
- package/template/src/assets/images/svg/403.svg +1 -0
- package/template/src/assets/images/svg/404.svg +1 -0
- package/template/src/assets/images/svg/500.svg +5 -0
- package/template/src/assets/images/svg/login_icon.svg +1 -0
- package/template/src/assets/images/user/avatar.webp +0 -0
- package/template/src/assets/images/user/bg.webp +0 -0
- package/template/src/assets/styles/core/app.scss +227 -0
- package/template/src/assets/styles/core/dark.scss +93 -0
- package/template/src/assets/styles/core/el-dark.scss +2 -0
- package/template/src/assets/styles/core/el-light.scss +34 -0
- package/template/src/assets/styles/core/el-ui.scss +519 -0
- package/template/src/assets/styles/core/md.scss +1036 -0
- package/template/src/assets/styles/core/mixin.scss +157 -0
- package/template/src/assets/styles/core/reset.scss +41 -0
- package/template/src/assets/styles/core/router-transition.scss +104 -0
- package/template/src/assets/styles/core/tailwind.css +219 -0
- package/template/src/assets/styles/core/theme-animation.scss +63 -0
- package/template/src/assets/styles/core/theme-change.scss +11 -0
- package/template/src/assets/styles/custom/one-dark-pro.scss +98 -0
- package/template/src/assets/styles/index.scss +23 -0
- package/template/src/assets/svg/loading.ts +32 -0
- package/template/src/bootstrap/initializeApp.ts +30 -0
- package/template/src/components/core/banners/art-basic-banner/index.vue +343 -0
- package/template/src/components/core/banners/art-card-banner/index.vue +114 -0
- package/template/src/components/core/base/art-back-to-top/index.vue +40 -0
- package/template/src/components/core/base/art-logo/index.vue +34 -0
- package/template/src/components/core/base/art-svg-icon/index.vue +24 -0
- package/template/src/components/core/cards/art-bar-chart-card/index.vue +103 -0
- package/template/src/components/core/cards/art-data-list-card/index.vue +74 -0
- package/template/src/components/core/cards/art-donut-chart-card/index.vue +124 -0
- package/template/src/components/core/cards/art-image-card/index.vue +89 -0
- package/template/src/components/core/cards/art-line-chart-card/index.vue +126 -0
- package/template/src/components/core/cards/art-progress-card/index.vue +86 -0
- package/template/src/components/core/cards/art-stats-card/index.vue +67 -0
- package/template/src/components/core/cards/art-timeline-list-card/index.vue +69 -0
- package/template/src/components/core/charts/art-bar-chart/index.vue +203 -0
- package/template/src/components/core/charts/art-dual-bar-compare-chart/index.vue +195 -0
- package/template/src/components/core/charts/art-h-bar-chart/index.vue +208 -0
- package/template/src/components/core/charts/art-k-line-chart/index.vue +152 -0
- package/template/src/components/core/charts/art-line-chart/index.vue +371 -0
- package/template/src/components/core/charts/art-radar-chart/index.vue +105 -0
- package/template/src/components/core/charts/art-ring-chart/index.vue +133 -0
- package/template/src/components/core/charts/art-scatter-chart/index.vue +115 -0
- package/template/src/components/core/feedback/art-page-loading/index.vue +281 -0
- package/template/src/components/core/forms/art-button-more/index.vue +71 -0
- package/template/src/components/core/forms/art-button-table/index.vue +59 -0
- package/template/src/components/core/forms/art-drag-verify/index.vue +430 -0
- package/template/src/components/core/forms/art-excel-export/index.vue +390 -0
- package/template/src/components/core/forms/art-excel-import/index.vue +62 -0
- package/template/src/components/core/forms/art-form/index.vue +507 -0
- package/template/src/components/core/forms/art-wang-editor/index.vue +261 -0
- package/template/src/components/core/forms/art-wang-editor/style.scss +273 -0
- package/template/src/components/core/layouts/art-breadcrumb/index.vue +142 -0
- package/template/src/components/core/layouts/art-chat-window/index.vue +262 -0
- package/template/src/components/core/layouts/art-fast-enter/index.vue +113 -0
- package/template/src/components/core/layouts/art-fireworks-effect/index.vue +633 -0
- package/template/src/components/core/layouts/art-global-component/index.vue +14 -0
- package/template/src/components/core/layouts/art-global-search/index.vue +431 -0
- package/template/src/components/core/layouts/art-header-bar/index.vue +485 -0
- package/template/src/components/core/layouts/art-header-bar/widget/ArtUserMenu.vue +118 -0
- package/template/src/components/core/layouts/art-menus/art-horizontal-menu/index.vue +110 -0
- package/template/src/components/core/layouts/art-menus/art-horizontal-menu/widget/HorizontalSubmenu.vue +106 -0
- package/template/src/components/core/layouts/art-menus/art-mixed-menu/index.vue +279 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/index.vue +354 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/style.scss +251 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/theme.scss +258 -0
- package/template/src/components/core/layouts/art-menus/art-sidebar-menu/widget/SidebarSubmenu.vue +190 -0
- package/template/src/components/core/layouts/art-notification/index.vue +456 -0
- package/template/src/components/core/layouts/art-page-content/index.vue +137 -0
- package/template/src/components/core/layouts/art-settings-panel/composables/useSettingsConfig.ts +248 -0
- package/template/src/components/core/layouts/art-settings-panel/composables/useSettingsHandlers.ts +167 -0
- package/template/src/components/core/layouts/art-settings-panel/composables/useSettingsPanel.ts +233 -0
- package/template/src/components/core/layouts/art-settings-panel/composables/useSettingsState.ts +37 -0
- package/template/src/components/core/layouts/art-settings-panel/index.vue +72 -0
- package/template/src/components/core/layouts/art-settings-panel/style.scss +92 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/BasicSettings.vue +77 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/BoxStyleSettings.vue +38 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/ColorSettings.vue +35 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/ContainerSettings.vue +33 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/MenuLayoutSettings.vue +31 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/MenuStyleSettings.vue +44 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SectionTitle.vue +17 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SettingActions.vue +236 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SettingDrawer.vue +51 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SettingHeader.vue +18 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/SettingItem.vue +101 -0
- package/template/src/components/core/layouts/art-settings-panel/widget/ThemeSettings.vue +28 -0
- package/template/src/components/core/layouts/art-work-tab/index.vue +584 -0
- package/template/src/components/core/media/art-cutter-img/index.vue +350 -0
- package/template/src/components/core/media/art-video-player/index.vue +111 -0
- package/template/src/components/core/others/art-menu-right/index.vue +415 -0
- package/template/src/components/core/others/art-watermark/index.vue +64 -0
- package/template/src/components/core/text-effect/art-count-to/index.vue +310 -0
- package/template/src/components/core/text-effect/art-festival-text-scroll/index.vue +32 -0
- package/template/src/components/core/text-effect/art-text-scroll/index.vue +285 -0
- package/template/src/components/core/theme/theme-svg/index.vue +100 -0
- package/template/src/components/core/views/exception/ArtException.vue +55 -0
- package/template/src/components/core/views/login/AuthTopBar.vue +149 -0
- package/template/src/components/core/views/login/LoginLeftView.vue +602 -0
- package/template/src/components/core/views/result/ArtResultPage.vue +43 -0
- package/template/src/components/core/widget/art-icon-button/index.vue +23 -0
- package/template/src/config/assets/images.ts +61 -0
- package/template/src/config/index.ts +170 -0
- package/template/src/config/modules/component.ts +98 -0
- package/template/src/config/modules/fastEnter.ts +16 -0
- package/template/src/config/modules/festival.ts +51 -0
- package/template/src/config/modules/headerBar.ts +64 -0
- package/template/src/config/setting.ts +109 -0
- package/template/src/directives/core/auth.ts +66 -0
- package/template/src/directives/core/highlight-loader.ts +37 -0
- package/template/src/directives/core/highlight.ts +253 -0
- package/template/src/directives/core/ripple.ts +116 -0
- package/template/src/directives/core/roles.ts +87 -0
- package/template/src/directives/index.ts +14 -0
- package/template/src/enums/appEnum.ts +81 -0
- package/template/src/enums/formEnum.ts +17 -0
- package/template/src/env.d.ts +32 -0
- package/template/src/hooks/core/useAppMode.ts +45 -0
- package/template/src/hooks/core/useAuth.ts +74 -0
- package/template/src/hooks/core/useCeremony.ts +184 -0
- package/template/src/hooks/core/useChart.ts +745 -0
- package/template/src/hooks/core/useCommon.ts +87 -0
- package/template/src/hooks/core/useFastEnter.ts +55 -0
- package/template/src/hooks/core/useHeaderBar.ts +201 -0
- package/template/src/hooks/core/useLayoutHeight.ts +148 -0
- package/template/src/hooks/core/useTableColumns.ts +313 -0
- package/template/src/hooks/core/useTheme.ts +174 -0
- package/template/src/hooks/index.ts +29 -0
- package/template/src/locales/index.ts +123 -0
- package/template/src/locales/langs/en.json +283 -0
- package/template/src/locales/langs/zh.json +283 -0
- package/template/src/main.ts +29 -0
- package/template/src/mock/auth.ts +46 -0
- package/template/src/plugins/echarts.ts +76 -0
- package/template/src/plugins/index.ts +6 -0
- package/template/src/router/core/ComponentLoader.ts +82 -0
- package/template/src/router/core/IframeRouteManager.ts +78 -0
- package/template/src/router/core/MenuProcessor.ts +280 -0
- package/template/src/router/core/RoutePermissionValidator.ts +161 -0
- package/template/src/router/core/RouteRegistry.ts +90 -0
- package/template/src/router/core/RouteTransformer.ts +132 -0
- package/template/src/router/core/RouteValidator.ts +187 -0
- package/template/src/router/core/index.ts +14 -0
- package/template/src/router/guards/afterEach.ts +34 -0
- package/template/src/router/guards/beforeEach.ts +442 -0
- package/template/src/router/index.ts +24 -0
- package/template/src/router/modules/dashboard.ts +23 -0
- package/template/src/router/modules/examples.ts +109 -0
- package/template/src/router/modules/exception.ts +46 -0
- package/template/src/router/modules/index.ts +12 -0
- package/template/src/router/modules/result.ts +32 -0
- package/template/src/router/routes/asyncRoutes.ts +9 -0
- package/template/src/router/routes/staticRoutes.ts +60 -0
- package/template/src/router/routesAlias.ts +8 -0
- package/template/src/services/auth.ts +15 -0
- package/template/src/store/index.ts +52 -0
- package/template/src/store/modules/menu.ts +109 -0
- package/template/src/store/modules/setting.ts +450 -0
- package/template/src/store/modules/user.ts +218 -0
- package/template/src/store/modules/worktab.ts +568 -0
- package/template/src/types/api/api.d.ts +86 -0
- package/template/src/types/common/index.ts +95 -0
- package/template/src/types/common/response.ts +32 -0
- package/template/src/types/component/chart.ts +324 -0
- package/template/src/types/component/index.ts +86 -0
- package/template/src/types/config/index.ts +253 -0
- package/template/src/types/directive/directive.d.ts +15 -0
- package/template/src/types/import/auto-imports.d.ts +319 -0
- package/template/src/types/import/components.d.ts +126 -0
- package/template/src/types/index.ts +22 -0
- package/template/src/types/router/index.ts +80 -0
- package/template/src/types/store/index.ts +157 -0
- package/template/src/utils/form/index.ts +9 -0
- package/template/src/utils/form/validator.ts +316 -0
- package/template/src/utils/http/contract.ts +39 -0
- package/template/src/utils/http/error.ts +182 -0
- package/template/src/utils/http/index.ts +226 -0
- package/template/src/utils/http/status.ts +18 -0
- package/template/src/utils/index.ts +31 -0
- package/template/src/utils/navigation/index.ts +10 -0
- package/template/src/utils/navigation/jump.ts +68 -0
- package/template/src/utils/navigation/route.ts +85 -0
- package/template/src/utils/navigation/worktab.ts +67 -0
- package/template/src/utils/router.ts +63 -0
- package/template/src/utils/socket/index.ts +423 -0
- package/template/src/utils/storage/index.ts +7 -0
- package/template/src/utils/storage/storage-config.ts +127 -0
- package/template/src/utils/storage/storage-key-manager.ts +97 -0
- package/template/src/utils/storage/storage.ts +250 -0
- package/template/src/utils/sys/console.ts +9 -0
- package/template/src/utils/sys/error-handle.ts +143 -0
- package/template/src/utils/sys/index.ts +2 -0
- package/template/src/utils/sys/mittBus.ts +61 -0
- package/template/src/utils/ui/animation.ts +80 -0
- package/template/src/utils/ui/colors.ts +273 -0
- package/template/src/utils/ui/emojo.ts +24 -0
- package/template/src/utils/ui/iconify-loader.ts +31 -0
- package/template/src/utils/ui/index.ts +11 -0
- package/template/src/utils/ui/loading.ts +158 -0
- package/template/src/utils/ui/tabs.ts +60 -0
- package/template/src/views/auth/forget-password/index.vue +62 -0
- package/template/src/views/auth/login/index.vue +166 -0
- package/template/src/views/auth/login/style.css +38 -0
- package/template/src/views/auth/register/index.vue +240 -0
- package/template/src/views/dashboard/console/index.vue +173 -0
- package/template/src/views/examples/analytics/index.vue +389 -0
- package/template/src/views/examples/complex-form/index.vue +395 -0
- package/template/src/views/examples/crud-workspace/index.vue +412 -0
- package/template/src/views/examples/navigation/detail/index.vue +151 -0
- package/template/src/views/examples/navigation/state/index.vue +226 -0
- package/template/src/views/examples/overview/index.vue +309 -0
- package/template/src/views/examples/permissions/index.vue +303 -0
- package/template/src/views/examples/search-table/index.vue +182 -0
- package/template/src/views/examples/search-table/search.config.ts +81 -0
- package/template/src/views/examples/search-table/service.ts +116 -0
- package/template/src/views/examples/search-table/table.config.ts +37 -0
- package/template/src/views/exception/403/index.vue +16 -0
- package/template/src/views/exception/404/index.vue +16 -0
- package/template/src/views/exception/500/index.vue +16 -0
- package/template/src/views/index/index.vue +29 -0
- package/template/src/views/index/style.scss +93 -0
- package/template/src/views/outside/Iframe.vue +42 -0
- package/template/src/views/result/fail/index.vue +28 -0
- package/template/src/views/result/success/index.vue +21 -0
- package/template/tests/e2e/auth.spec.ts +14 -0
- package/template/tests/e2e/search-table.spec.ts +154 -0
- package/template/tests/unit/adapters/auth.spec.ts +38 -0
- package/template/tests/unit/config/app-config.spec.ts +17 -0
- package/template/tests/unit/directives/highlight.spec.ts +20 -0
- package/template/tests/unit/http/contract.spec.ts +47 -0
- package/template/tests/unit/mock/search-table.spec.ts +62 -0
- package/template/tests/unit/router/examples.spec.ts +52 -0
- package/template/tsconfig.json +28 -0
- package/template/vite.config.ts +181 -0
- package/template/vitest.config.ts +27 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<main class="state-demo" aria-labelledby="state-demo-title">
|
|
3
|
+
<section class="state-demo__intro art-card">
|
|
4
|
+
<span>NAVIGATION / KEEP ALIVE</span>
|
|
5
|
+
<h1 id="state-demo-title">页面状态保留演示</h1>
|
|
6
|
+
<p>
|
|
7
|
+
输入任意内容,然后打开详情页并返回。由于当前路由启用了
|
|
8
|
+
<code>keepAlive</code>,输入内容和计数器不会重置。
|
|
9
|
+
</p>
|
|
10
|
+
</section>
|
|
11
|
+
|
|
12
|
+
<section class="state-demo__workspace art-card" aria-labelledby="workspace-title">
|
|
13
|
+
<div class="section-heading">
|
|
14
|
+
<div>
|
|
15
|
+
<h2 id="workspace-title">本地页面状态</h2>
|
|
16
|
+
<p>这些值只保存在当前组件实例中,没有写入 Pinia 或浏览器存储。</p>
|
|
17
|
+
</div>
|
|
18
|
+
<ElTag type="success" effect="light">KeepAlive 已开启</ElTag>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<div class="state-grid">
|
|
22
|
+
<div class="field-group">
|
|
23
|
+
<label for="keep-alive-note">临时备注</label>
|
|
24
|
+
<ElInput
|
|
25
|
+
id="keep-alive-note"
|
|
26
|
+
v-model="note"
|
|
27
|
+
type="textarea"
|
|
28
|
+
:rows="5"
|
|
29
|
+
resize="none"
|
|
30
|
+
placeholder="例如:切换页面后这段内容仍应保留"
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="counter-card">
|
|
35
|
+
<span>本地计数器</span>
|
|
36
|
+
<strong>{{ count }}</strong>
|
|
37
|
+
<div class="counter-card__actions" aria-label="计数器操作">
|
|
38
|
+
<ElButton aria-label="计数减一" @click="count--">
|
|
39
|
+
<ArtSvgIcon icon="ri:subtract-line" aria-hidden="true" />
|
|
40
|
+
</ElButton>
|
|
41
|
+
<ElButton aria-label="计数加一" type="primary" @click="count++">
|
|
42
|
+
<ArtSvgIcon icon="ri:add-line" aria-hidden="true" />
|
|
43
|
+
</ElButton>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<ElDivider />
|
|
49
|
+
|
|
50
|
+
<div class="state-demo__actions">
|
|
51
|
+
<p>详情页不会出现在菜单中,但刷新和深链访问仍然有效。</p>
|
|
52
|
+
<ElButton type="primary" size="large" @click="openDetail">
|
|
53
|
+
打开隐藏详情页
|
|
54
|
+
<ArtSvgIcon icon="ri:arrow-right-line" aria-hidden="true" />
|
|
55
|
+
</ElButton>
|
|
56
|
+
</div>
|
|
57
|
+
</section>
|
|
58
|
+
</main>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
defineOptions({ name: 'NavigationState' })
|
|
63
|
+
|
|
64
|
+
const router = useRouter()
|
|
65
|
+
const note = ref('')
|
|
66
|
+
const count = ref(0)
|
|
67
|
+
|
|
68
|
+
const openDetail = () => router.push({ name: 'NavigationDetail', params: { id: 'demo-42' } })
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<style scoped lang="scss">
|
|
72
|
+
.state-demo {
|
|
73
|
+
display: grid;
|
|
74
|
+
gap: 16px;
|
|
75
|
+
|
|
76
|
+
&__intro,
|
|
77
|
+
&__workspace {
|
|
78
|
+
padding: 28px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&__intro {
|
|
82
|
+
span {
|
|
83
|
+
font-size: 12px;
|
|
84
|
+
font-weight: 700;
|
|
85
|
+
color: var(--el-color-primary);
|
|
86
|
+
letter-spacing: 0.12em;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
h1 {
|
|
90
|
+
margin-top: 10px;
|
|
91
|
+
font-size: clamp(24px, 3vw, 34px);
|
|
92
|
+
font-weight: 650;
|
|
93
|
+
color: var(--art-gray-900);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
p {
|
|
97
|
+
max-width: 720px;
|
|
98
|
+
margin-top: 12px;
|
|
99
|
+
font-size: 15px;
|
|
100
|
+
line-height: 1.75;
|
|
101
|
+
color: var(--art-gray-700);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
code {
|
|
105
|
+
font-weight: 600;
|
|
106
|
+
color: var(--el-color-primary);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&__actions {
|
|
111
|
+
display: flex;
|
|
112
|
+
gap: 20px;
|
|
113
|
+
align-items: center;
|
|
114
|
+
justify-content: space-between;
|
|
115
|
+
|
|
116
|
+
p {
|
|
117
|
+
font-size: 14px;
|
|
118
|
+
line-height: 1.6;
|
|
119
|
+
color: var(--art-gray-600);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:deep(.el-button) {
|
|
123
|
+
min-height: 44px;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.section-heading {
|
|
129
|
+
display: flex;
|
|
130
|
+
gap: 16px;
|
|
131
|
+
align-items: flex-start;
|
|
132
|
+
justify-content: space-between;
|
|
133
|
+
|
|
134
|
+
h2 {
|
|
135
|
+
font-size: 20px;
|
|
136
|
+
font-weight: 600;
|
|
137
|
+
color: var(--art-gray-900);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
p {
|
|
141
|
+
margin-top: 6px;
|
|
142
|
+
font-size: 14px;
|
|
143
|
+
line-height: 1.6;
|
|
144
|
+
color: var(--art-gray-600);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.state-grid {
|
|
149
|
+
display: grid;
|
|
150
|
+
grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.5fr);
|
|
151
|
+
gap: 20px;
|
|
152
|
+
margin-top: 24px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.field-group {
|
|
156
|
+
label {
|
|
157
|
+
display: block;
|
|
158
|
+
margin-bottom: 8px;
|
|
159
|
+
font-size: 14px;
|
|
160
|
+
font-weight: 600;
|
|
161
|
+
color: var(--art-gray-800);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.counter-card {
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
align-items: center;
|
|
169
|
+
justify-content: center;
|
|
170
|
+
min-height: 180px;
|
|
171
|
+
padding: 20px;
|
|
172
|
+
background: color-mix(in srgb, var(--el-color-primary) 7%, var(--default-box-color));
|
|
173
|
+
border: 1px solid color-mix(in srgb, var(--el-color-primary) 18%, transparent);
|
|
174
|
+
border-radius: 12px;
|
|
175
|
+
|
|
176
|
+
> span {
|
|
177
|
+
font-size: 13px;
|
|
178
|
+
color: var(--art-gray-600);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
strong {
|
|
182
|
+
margin: 10px 0 14px;
|
|
183
|
+
font-size: 36px;
|
|
184
|
+
font-variant-numeric: tabular-nums;
|
|
185
|
+
color: var(--art-gray-900);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&__actions {
|
|
189
|
+
display: flex;
|
|
190
|
+
gap: 8px;
|
|
191
|
+
|
|
192
|
+
:deep(.el-button) {
|
|
193
|
+
width: 44px;
|
|
194
|
+
min-height: 44px;
|
|
195
|
+
margin-left: 0;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
@media (width <= 720px) {
|
|
201
|
+
.state-demo {
|
|
202
|
+
&__intro,
|
|
203
|
+
&__workspace {
|
|
204
|
+
padding: 20px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&__actions {
|
|
208
|
+
flex-direction: column;
|
|
209
|
+
align-items: stretch;
|
|
210
|
+
|
|
211
|
+
:deep(.el-button) {
|
|
212
|
+
width: 100%;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.section-heading {
|
|
218
|
+
flex-direction: column;
|
|
219
|
+
align-items: flex-start;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.state-grid {
|
|
223
|
+
grid-template-columns: 1fr;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
</style>
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<main class="example-page" aria-labelledby="example-overview-title">
|
|
3
|
+
<section class="example-hero art-card">
|
|
4
|
+
<div>
|
|
5
|
+
<span class="example-hero__eyebrow">ROUTING FOUNDATION</span>
|
|
6
|
+
<h1 id="example-overview-title">通用路由与菜单基线</h1>
|
|
7
|
+
<p>
|
|
8
|
+
菜单、面包屑和标签页统一由路由元数据驱动。业务项目只需新增模块化路由,不需要修改布局组件。
|
|
9
|
+
</p>
|
|
10
|
+
</div>
|
|
11
|
+
<ArtSvgIcon class="example-hero__icon" icon="ri:route-line" aria-hidden="true" />
|
|
12
|
+
</section>
|
|
13
|
+
|
|
14
|
+
<section class="capability-grid" aria-label="路由能力">
|
|
15
|
+
<article v-for="item in capabilities" :key="item.title" class="capability-card art-card">
|
|
16
|
+
<div class="capability-card__icon" aria-hidden="true">
|
|
17
|
+
<ArtSvgIcon :icon="item.icon" />
|
|
18
|
+
</div>
|
|
19
|
+
<div>
|
|
20
|
+
<h2>{{ item.title }}</h2>
|
|
21
|
+
<p>{{ item.description }}</p>
|
|
22
|
+
</div>
|
|
23
|
+
</article>
|
|
24
|
+
</section>
|
|
25
|
+
|
|
26
|
+
<section class="metadata art-card" aria-labelledby="metadata-title">
|
|
27
|
+
<div class="section-heading">
|
|
28
|
+
<div>
|
|
29
|
+
<span>APP ROUTE META</span>
|
|
30
|
+
<h2 id="metadata-title">推荐元数据</h2>
|
|
31
|
+
</div>
|
|
32
|
+
<ElTag effect="plain">单一数据源</ElTag>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<dl class="metadata__list">
|
|
36
|
+
<div v-for="item in metadata" :key="item.name">
|
|
37
|
+
<dt
|
|
38
|
+
><code>{{ item.name }}</code></dt
|
|
39
|
+
>
|
|
40
|
+
<dd>{{ item.description }}</dd>
|
|
41
|
+
</div>
|
|
42
|
+
</dl>
|
|
43
|
+
</section>
|
|
44
|
+
|
|
45
|
+
<section class="next-actions art-card" aria-labelledby="next-actions-title">
|
|
46
|
+
<div>
|
|
47
|
+
<h2 id="next-actions-title">验证导航行为</h2>
|
|
48
|
+
<p>在缓存演示页输入内容,进入隐藏详情页后再返回,确认页面状态仍然保留。</p>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="next-actions__buttons">
|
|
51
|
+
<ElButton type="primary" size="large" @click="openStateDemo">
|
|
52
|
+
打开缓存演示
|
|
53
|
+
<ArtSvgIcon icon="ri:arrow-right-line" aria-hidden="true" />
|
|
54
|
+
</ElButton>
|
|
55
|
+
<ElButton size="large" @click="openResultDemo">查看结果页</ElButton>
|
|
56
|
+
</div>
|
|
57
|
+
</section>
|
|
58
|
+
</main>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script setup lang="ts">
|
|
62
|
+
defineOptions({ name: 'ExampleOverview' })
|
|
63
|
+
|
|
64
|
+
const router = useRouter()
|
|
65
|
+
|
|
66
|
+
const capabilities = [
|
|
67
|
+
{
|
|
68
|
+
title: '模块化配置',
|
|
69
|
+
description: '每个功能域维护独立路由文件,由统一入口组合和注册。',
|
|
70
|
+
icon: 'ri:node-tree'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
title: '统一导航',
|
|
74
|
+
description: '菜单、面包屑、全局搜索和标签页共享同一套路由元数据。',
|
|
75
|
+
icon: 'ri:navigation-line'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: '状态保留',
|
|
79
|
+
description: '通过 keepAlive 保留列表、筛选和滚动等页面上下文。',
|
|
80
|
+
icon: 'ri:history-line'
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
title: '深链访问',
|
|
84
|
+
description: '隐藏详情页仍支持刷新和直接访问,并保持父级菜单高亮。',
|
|
85
|
+
icon: 'ri:links-line'
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
|
|
89
|
+
const metadata = [
|
|
90
|
+
{ name: 'title', description: '菜单、面包屑、标签页和页面标题使用的国际化键。' },
|
|
91
|
+
{ name: 'icon', description: '顶级菜单或关键页面使用的 Iconify 图标。' },
|
|
92
|
+
{ name: 'keepAlive', description: '是否在标签页切换时保留组件实例和局部状态。' },
|
|
93
|
+
{ name: 'fixedTab', description: '是否将页面固定在工作标签栏中。' },
|
|
94
|
+
{ name: 'isHide', description: '从菜单隐藏路由,但仍注册并允许通过 URL 访问。' },
|
|
95
|
+
{ name: 'activePath', description: '隐藏详情页进入后需要保持高亮的菜单路径。' }
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
const openStateDemo = () => router.push({ name: 'NavigationState' })
|
|
99
|
+
const openResultDemo = () => router.push({ name: 'ResultSuccess' })
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<style scoped lang="scss">
|
|
103
|
+
.example-page {
|
|
104
|
+
display: grid;
|
|
105
|
+
gap: 16px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.example-hero {
|
|
109
|
+
display: flex;
|
|
110
|
+
gap: 24px;
|
|
111
|
+
align-items: center;
|
|
112
|
+
justify-content: space-between;
|
|
113
|
+
min-height: 210px;
|
|
114
|
+
padding: 32px;
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
background:
|
|
117
|
+
radial-gradient(circle at 88% 18%, rgb(59 130 246 / 20%), transparent 34%),
|
|
118
|
+
var(--default-box-color);
|
|
119
|
+
|
|
120
|
+
&__eyebrow,
|
|
121
|
+
.section-heading span {
|
|
122
|
+
font-size: 12px;
|
|
123
|
+
font-weight: 700;
|
|
124
|
+
color: var(--el-color-primary);
|
|
125
|
+
letter-spacing: 0.12em;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
h1 {
|
|
129
|
+
margin-top: 12px;
|
|
130
|
+
font-size: clamp(26px, 3vw, 38px);
|
|
131
|
+
font-weight: 650;
|
|
132
|
+
line-height: 1.25;
|
|
133
|
+
color: var(--art-gray-900);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
p {
|
|
137
|
+
max-width: 680px;
|
|
138
|
+
margin-top: 14px;
|
|
139
|
+
font-size: 15px;
|
|
140
|
+
line-height: 1.75;
|
|
141
|
+
color: var(--art-gray-700);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&__icon {
|
|
145
|
+
flex: 0 0 auto;
|
|
146
|
+
width: clamp(80px, 10vw, 132px);
|
|
147
|
+
height: clamp(80px, 10vw, 132px);
|
|
148
|
+
color: color-mix(in srgb, var(--el-color-primary) 76%, transparent);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.capability-grid {
|
|
153
|
+
display: grid;
|
|
154
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
155
|
+
gap: 16px;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.capability-card {
|
|
159
|
+
display: flex;
|
|
160
|
+
gap: 14px;
|
|
161
|
+
padding: 20px;
|
|
162
|
+
|
|
163
|
+
&__icon {
|
|
164
|
+
display: grid;
|
|
165
|
+
flex: 0 0 42px;
|
|
166
|
+
place-items: center;
|
|
167
|
+
width: 42px;
|
|
168
|
+
height: 42px;
|
|
169
|
+
color: var(--el-color-primary);
|
|
170
|
+
background: color-mix(in srgb, var(--el-color-primary) 12%, transparent);
|
|
171
|
+
border-radius: 10px;
|
|
172
|
+
|
|
173
|
+
svg {
|
|
174
|
+
width: 22px;
|
|
175
|
+
height: 22px;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
h2 {
|
|
180
|
+
font-size: 16px;
|
|
181
|
+
font-weight: 600;
|
|
182
|
+
color: var(--art-gray-900);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
p {
|
|
186
|
+
margin-top: 6px;
|
|
187
|
+
font-size: 13px;
|
|
188
|
+
line-height: 1.65;
|
|
189
|
+
color: var(--art-gray-600);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.metadata,
|
|
194
|
+
.next-actions {
|
|
195
|
+
padding: 24px;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.section-heading {
|
|
199
|
+
display: flex;
|
|
200
|
+
align-items: center;
|
|
201
|
+
justify-content: space-between;
|
|
202
|
+
|
|
203
|
+
h2 {
|
|
204
|
+
margin-top: 4px;
|
|
205
|
+
font-size: 20px;
|
|
206
|
+
font-weight: 600;
|
|
207
|
+
color: var(--art-gray-900);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.metadata__list {
|
|
212
|
+
display: grid;
|
|
213
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
214
|
+
gap: 0 24px;
|
|
215
|
+
margin-top: 20px;
|
|
216
|
+
|
|
217
|
+
> div {
|
|
218
|
+
display: grid;
|
|
219
|
+
grid-template-columns: 120px minmax(0, 1fr);
|
|
220
|
+
gap: 16px;
|
|
221
|
+
align-items: start;
|
|
222
|
+
padding: 14px 0;
|
|
223
|
+
border-top: 1px solid var(--art-gray-200);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
code {
|
|
227
|
+
font-size: 13px;
|
|
228
|
+
font-weight: 600;
|
|
229
|
+
color: var(--el-color-primary);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
dd {
|
|
233
|
+
font-size: 14px;
|
|
234
|
+
line-height: 1.6;
|
|
235
|
+
color: var(--art-gray-700);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.next-actions {
|
|
240
|
+
display: flex;
|
|
241
|
+
gap: 24px;
|
|
242
|
+
align-items: center;
|
|
243
|
+
justify-content: space-between;
|
|
244
|
+
|
|
245
|
+
h2 {
|
|
246
|
+
font-size: 20px;
|
|
247
|
+
font-weight: 600;
|
|
248
|
+
color: var(--art-gray-900);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
p {
|
|
252
|
+
margin-top: 6px;
|
|
253
|
+
font-size: 14px;
|
|
254
|
+
line-height: 1.6;
|
|
255
|
+
color: var(--art-gray-600);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
&__buttons {
|
|
259
|
+
display: flex;
|
|
260
|
+
flex: 0 0 auto;
|
|
261
|
+
gap: 8px;
|
|
262
|
+
|
|
263
|
+
:deep(.el-button) {
|
|
264
|
+
min-height: 44px;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
@media (width <= 1100px) {
|
|
270
|
+
.capability-grid {
|
|
271
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
@media (width <= 720px) {
|
|
276
|
+
.example-hero {
|
|
277
|
+
min-height: auto;
|
|
278
|
+
padding: 24px 20px;
|
|
279
|
+
|
|
280
|
+
&__icon {
|
|
281
|
+
display: none;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.capability-grid,
|
|
286
|
+
.metadata__list {
|
|
287
|
+
grid-template-columns: 1fr;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.metadata,
|
|
291
|
+
.next-actions {
|
|
292
|
+
padding: 20px;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.next-actions {
|
|
296
|
+
flex-direction: column;
|
|
297
|
+
align-items: stretch;
|
|
298
|
+
|
|
299
|
+
&__buttons {
|
|
300
|
+
flex-direction: column;
|
|
301
|
+
|
|
302
|
+
:deep(.el-button) {
|
|
303
|
+
width: 100%;
|
|
304
|
+
margin-left: 0;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
</style>
|