@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,389 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<main class="analytics-page" aria-labelledby="analytics-title">
|
|
3
|
+
<header class="analytics-header">
|
|
4
|
+
<div
|
|
5
|
+
><span>PAGE PATTERN / ANALYTICS</span><h1 id="analytics-title">运营分析看板</h1
|
|
6
|
+
><p>趋势、对比和目标进度使用不同信息表达,并提供文字数据摘要。</p></div
|
|
7
|
+
>
|
|
8
|
+
<ElSegmented v-model="period" :options="periodOptions" aria-label="统计周期" />
|
|
9
|
+
</header>
|
|
10
|
+
|
|
11
|
+
<section class="metric-grid" aria-label="核心指标">
|
|
12
|
+
<article v-for="metric in metrics" :key="metric.label" class="metric-card art-card">
|
|
13
|
+
<div class="metric-card__heading"
|
|
14
|
+
><span>{{ metric.label }}</span
|
|
15
|
+
><span class="metric-card__icon"
|
|
16
|
+
><ArtSvgIcon :icon="metric.icon" aria-hidden="true" /></span
|
|
17
|
+
></div>
|
|
18
|
+
<strong>{{ metric.value }}</strong>
|
|
19
|
+
<p :class="metric.positive ? 'is-positive' : 'is-warning'"
|
|
20
|
+
><ArtSvgIcon
|
|
21
|
+
:icon="metric.positive ? 'ri:arrow-up-line' : 'ri:arrow-down-line'"
|
|
22
|
+
aria-hidden="true"
|
|
23
|
+
/>{{ metric.change }} <span>较上一周期</span></p
|
|
24
|
+
>
|
|
25
|
+
</article>
|
|
26
|
+
</section>
|
|
27
|
+
|
|
28
|
+
<section class="chart-grid">
|
|
29
|
+
<article class="chart-card art-card" aria-labelledby="trend-title">
|
|
30
|
+
<div class="card-heading"
|
|
31
|
+
><div><h2 id="trend-title">请求趋势</h2><p>成功请求与全部请求,单位:千次</p></div
|
|
32
|
+
><ElTag effect="plain">{{ periodLabel }}</ElTag></div
|
|
33
|
+
>
|
|
34
|
+
<ArtLineChart
|
|
35
|
+
:key="period"
|
|
36
|
+
height="300px"
|
|
37
|
+
:loading="loading"
|
|
38
|
+
:x-axis-data="labels"
|
|
39
|
+
:data="trendData"
|
|
40
|
+
show-legend
|
|
41
|
+
legend-position="top"
|
|
42
|
+
/>
|
|
43
|
+
<p class="sr-summary"
|
|
44
|
+
>数据摘要:全部请求从 12.4 千次增长至 19.1 千次,成功请求始终保持在全部请求的 94%
|
|
45
|
+
以上。</p
|
|
46
|
+
>
|
|
47
|
+
</article>
|
|
48
|
+
<article class="chart-card art-card" aria-labelledby="channel-title">
|
|
49
|
+
<div class="card-heading"
|
|
50
|
+
><div><h2 id="channel-title">资源使用量</h2><p>按资源类型对比,单位:千次</p></div></div
|
|
51
|
+
>
|
|
52
|
+
<ArtBarChart
|
|
53
|
+
:key="`${period}-bar`"
|
|
54
|
+
height="300px"
|
|
55
|
+
:loading="loading"
|
|
56
|
+
:x-axis-data="channelLabels"
|
|
57
|
+
:data="channelData"
|
|
58
|
+
/>
|
|
59
|
+
<p class="sr-summary">数据摘要:API 调用量最高,为 86 千次;任务执行量最低,为 31 千次。</p>
|
|
60
|
+
</article>
|
|
61
|
+
</section>
|
|
62
|
+
|
|
63
|
+
<section class="bottom-grid">
|
|
64
|
+
<article class="target-card art-card" aria-labelledby="target-title">
|
|
65
|
+
<div class="card-heading"
|
|
66
|
+
><div
|
|
67
|
+
><h2 id="target-title">目标完成度</h2><p>明确展示数值,不仅依靠颜色表达状态</p></div
|
|
68
|
+
></div
|
|
69
|
+
>
|
|
70
|
+
<div v-for="target in targets" :key="target.label" class="target-row">
|
|
71
|
+
<div
|
|
72
|
+
><strong>{{ target.label }}</strong
|
|
73
|
+
><span>{{ target.value }} / {{ target.goal }}</span></div
|
|
74
|
+
>
|
|
75
|
+
<ElProgress
|
|
76
|
+
:percentage="target.percent"
|
|
77
|
+
:status="target.percent >= 90 ? 'success' : undefined"
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
</article>
|
|
81
|
+
<article class="activity-card art-card" aria-labelledby="activity-title">
|
|
82
|
+
<div class="card-heading"
|
|
83
|
+
><div><h2 id="activity-title">最近动态</h2><p>关键事件按时间排序</p></div></div
|
|
84
|
+
>
|
|
85
|
+
<ol>
|
|
86
|
+
<li v-for="activity in activities" :key="activity.time"
|
|
87
|
+
><span class="activity-dot" aria-hidden="true"></span
|
|
88
|
+
><div
|
|
89
|
+
><strong>{{ activity.title }}</strong
|
|
90
|
+
><p>{{ activity.description }}</p></div
|
|
91
|
+
><time>{{ activity.time }}</time></li
|
|
92
|
+
>
|
|
93
|
+
</ol>
|
|
94
|
+
</article>
|
|
95
|
+
</section>
|
|
96
|
+
</main>
|
|
97
|
+
</template>
|
|
98
|
+
|
|
99
|
+
<script setup lang="ts">
|
|
100
|
+
defineOptions({ name: 'AnalyticsDashboardExample' })
|
|
101
|
+
const periodOptions = [
|
|
102
|
+
{ label: '近 7 天', value: '7d' },
|
|
103
|
+
{ label: '近 30 天', value: '30d' },
|
|
104
|
+
{ label: '本季度', value: 'quarter' }
|
|
105
|
+
]
|
|
106
|
+
const period = ref('7d')
|
|
107
|
+
const loading = ref(false)
|
|
108
|
+
const periodLabel = computed(
|
|
109
|
+
() => periodOptions.find((item) => item.value === period.value)?.label
|
|
110
|
+
)
|
|
111
|
+
const labelsByPeriod: Record<string, string[]> = {
|
|
112
|
+
'7d': ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
|
|
113
|
+
'30d': ['第 1 周', '第 2 周', '第 3 周', '第 4 周'],
|
|
114
|
+
quarter: ['6 月', '7 月', '8 月']
|
|
115
|
+
}
|
|
116
|
+
const totalsByPeriod: Record<string, number[]> = {
|
|
117
|
+
'7d': [12.4, 13.8, 13.1, 16.2, 17.5, 16.8, 19.1],
|
|
118
|
+
'30d': [58, 66, 72, 81],
|
|
119
|
+
quarter: [216, 248, 286]
|
|
120
|
+
}
|
|
121
|
+
const labels = computed(() => labelsByPeriod[period.value])
|
|
122
|
+
const trendData = computed(() => [
|
|
123
|
+
{ name: '全部请求', data: totalsByPeriod[period.value], showAreaColor: true },
|
|
124
|
+
{
|
|
125
|
+
name: '成功请求',
|
|
126
|
+
data: totalsByPeriod[period.value].map((value) => Number((value * 0.952).toFixed(1)))
|
|
127
|
+
}
|
|
128
|
+
])
|
|
129
|
+
const channelLabels = ['API', '消息', '文件', '任务']
|
|
130
|
+
const channelData = computed(() =>
|
|
131
|
+
period.value === '7d'
|
|
132
|
+
? [86, 64, 47, 31]
|
|
133
|
+
: period.value === '30d'
|
|
134
|
+
? [328, 242, 181, 126]
|
|
135
|
+
: [924, 716, 538, 391]
|
|
136
|
+
)
|
|
137
|
+
const metrics = computed(() => [
|
|
138
|
+
{
|
|
139
|
+
label: '总请求量',
|
|
140
|
+
value: period.value === '7d' ? '108.9k' : period.value === '30d' ? '427k' : '1.24m',
|
|
141
|
+
change: '12.6%',
|
|
142
|
+
positive: true,
|
|
143
|
+
icon: 'ri:pulse-line'
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
label: '活跃资源',
|
|
147
|
+
value: '1,286',
|
|
148
|
+
change: '8.2%',
|
|
149
|
+
positive: true,
|
|
150
|
+
icon: 'ri:database-2-line'
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
label: '成功率',
|
|
154
|
+
value: '95.2%',
|
|
155
|
+
change: '1.4%',
|
|
156
|
+
positive: true,
|
|
157
|
+
icon: 'ri:checkbox-circle-line'
|
|
158
|
+
},
|
|
159
|
+
{ label: '平均延迟', value: '186ms', change: '4.8%', positive: false, icon: 'ri:timer-line' }
|
|
160
|
+
])
|
|
161
|
+
const targets = [
|
|
162
|
+
{ label: '稳定性目标', value: '99.92%', goal: '99.95%', percent: 96 },
|
|
163
|
+
{ label: '资源接入', value: '86 项', goal: '100 项', percent: 86 },
|
|
164
|
+
{ label: '自动化覆盖', value: '72%', goal: '90%', percent: 80 }
|
|
165
|
+
]
|
|
166
|
+
const activities = [
|
|
167
|
+
{ title: '指标服务恢复正常', description: '告警已自动关闭', time: '10:24' },
|
|
168
|
+
{ title: '新增 4 项资源', description: '由平台团队完成接入', time: '09:18' },
|
|
169
|
+
{ title: '周报生成完成', description: '报表已进入下载队列', time: '08:40' }
|
|
170
|
+
]
|
|
171
|
+
watch(period, async () => {
|
|
172
|
+
loading.value = true
|
|
173
|
+
await new Promise((resolve) => window.setTimeout(resolve, 360))
|
|
174
|
+
loading.value = false
|
|
175
|
+
})
|
|
176
|
+
</script>
|
|
177
|
+
|
|
178
|
+
<style scoped lang="scss">
|
|
179
|
+
.analytics-page {
|
|
180
|
+
display: grid;
|
|
181
|
+
gap: 16px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.analytics-header {
|
|
185
|
+
display: flex;
|
|
186
|
+
gap: 24px;
|
|
187
|
+
align-items: end;
|
|
188
|
+
justify-content: space-between;
|
|
189
|
+
padding: 8px 4px 4px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.analytics-header span {
|
|
193
|
+
font-size: 12px;
|
|
194
|
+
font-weight: 700;
|
|
195
|
+
color: var(--el-color-primary);
|
|
196
|
+
letter-spacing: 0.12em;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.analytics-header h1 {
|
|
200
|
+
margin-top: 6px;
|
|
201
|
+
font-size: clamp(25px, 3vw, 34px);
|
|
202
|
+
font-weight: 650;
|
|
203
|
+
color: var(--art-gray-900);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.analytics-header p {
|
|
207
|
+
margin-top: 5px;
|
|
208
|
+
color: var(--art-gray-600);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.metric-grid {
|
|
212
|
+
display: grid;
|
|
213
|
+
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
214
|
+
gap: 16px;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.metric-card {
|
|
218
|
+
padding: 20px;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.metric-card__heading {
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
justify-content: space-between;
|
|
225
|
+
color: var(--art-gray-600);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.metric-card__icon {
|
|
229
|
+
display: grid;
|
|
230
|
+
place-items: center;
|
|
231
|
+
width: 40px;
|
|
232
|
+
height: 40px;
|
|
233
|
+
color: var(--el-color-primary);
|
|
234
|
+
background: var(--el-color-primary-light-9);
|
|
235
|
+
border-radius: 10px;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.metric-card > strong {
|
|
239
|
+
display: block;
|
|
240
|
+
margin-top: 14px;
|
|
241
|
+
font-size: 28px;
|
|
242
|
+
font-variant-numeric: tabular-nums;
|
|
243
|
+
color: var(--art-gray-900);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.metric-card > p {
|
|
247
|
+
display: flex;
|
|
248
|
+
gap: 3px;
|
|
249
|
+
align-items: center;
|
|
250
|
+
margin-top: 6px;
|
|
251
|
+
font-size: 13px;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.metric-card > p span {
|
|
255
|
+
margin-left: 3px;
|
|
256
|
+
color: var(--art-gray-500);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.is-positive {
|
|
260
|
+
color: var(--el-color-success);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.is-warning {
|
|
264
|
+
color: var(--el-color-warning);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.chart-grid,
|
|
268
|
+
.bottom-grid {
|
|
269
|
+
display: grid;
|
|
270
|
+
grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
|
|
271
|
+
gap: 16px;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.chart-card,
|
|
275
|
+
.target-card,
|
|
276
|
+
.activity-card {
|
|
277
|
+
min-width: 0;
|
|
278
|
+
padding: 22px;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.card-heading {
|
|
282
|
+
display: flex;
|
|
283
|
+
align-items: flex-start;
|
|
284
|
+
justify-content: space-between;
|
|
285
|
+
margin-bottom: 12px;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.card-heading h2 {
|
|
289
|
+
font-size: 18px;
|
|
290
|
+
font-weight: 600;
|
|
291
|
+
color: var(--art-gray-900);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.card-heading p {
|
|
295
|
+
margin-top: 4px;
|
|
296
|
+
color: var(--art-gray-500);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.sr-summary {
|
|
300
|
+
position: absolute;
|
|
301
|
+
width: 1px;
|
|
302
|
+
height: 1px;
|
|
303
|
+
padding: 0;
|
|
304
|
+
overflow: hidden;
|
|
305
|
+
white-space: nowrap;
|
|
306
|
+
border: 0;
|
|
307
|
+
clip-path: inset(50%);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.target-row {
|
|
311
|
+
margin-top: 20px;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.target-row > div {
|
|
315
|
+
display: flex;
|
|
316
|
+
justify-content: space-between;
|
|
317
|
+
margin-bottom: 8px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.target-row strong {
|
|
321
|
+
color: var(--art-gray-800);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.target-row span {
|
|
325
|
+
font-variant-numeric: tabular-nums;
|
|
326
|
+
color: var(--art-gray-600);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.activity-card ol {
|
|
330
|
+
list-style: none;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.activity-card li {
|
|
334
|
+
display: grid;
|
|
335
|
+
grid-template-columns: 10px minmax(0, 1fr) auto;
|
|
336
|
+
gap: 12px;
|
|
337
|
+
align-items: start;
|
|
338
|
+
padding: 14px 0;
|
|
339
|
+
border-top: 1px solid var(--art-gray-200);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.activity-dot {
|
|
343
|
+
width: 8px;
|
|
344
|
+
height: 8px;
|
|
345
|
+
margin-top: 6px;
|
|
346
|
+
background: var(--el-color-primary);
|
|
347
|
+
border-radius: 50%;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.activity-card strong {
|
|
351
|
+
color: var(--art-gray-800);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.activity-card p,
|
|
355
|
+
.activity-card time {
|
|
356
|
+
margin-top: 4px;
|
|
357
|
+
color: var(--art-gray-500);
|
|
358
|
+
}
|
|
359
|
+
@media (width <= 1080px) {
|
|
360
|
+
.metric-grid {
|
|
361
|
+
grid-template-columns: repeat(2, 1fr);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.chart-grid,
|
|
365
|
+
.bottom-grid {
|
|
366
|
+
grid-template-columns: 1fr;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
@media (width <= 640px) {
|
|
370
|
+
.analytics-header {
|
|
371
|
+
flex-direction: column;
|
|
372
|
+
align-items: stretch;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.metric-grid {
|
|
376
|
+
grid-template-columns: 1fr;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.chart-card,
|
|
380
|
+
.target-card,
|
|
381
|
+
.activity-card {
|
|
382
|
+
padding: 18px;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
:deep(.el-segmented) {
|
|
386
|
+
width: 100%;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
</style>
|