Skip to content

Commit 9ca855e

Browse files
author
zhangtao
committed
feat(home): bring component showcase back onto the home page
- remove the separate /dashboard/components route and page - restore the carousel, image cards, banners, new-user table, quick links, todo and timeline demos into a labeled Mock section at the bottom of Home - keep the top of Home on live data and retain FaStatusTag/FaEmptyState
1 parent 30c37ea commit 9ca855e

11 files changed

Lines changed: 108 additions & 98 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
## 🖥️ 界面一览
6767

68-
> 组件示例:`/dashboard/components`(mock 数据,展示 Fa 组件组合方式;首页使用真实数据)
68+
> 组件示例位于首页底部(Mock 数据,展示 Fa 组件组合方式)。
6969
7070
**Web 端**
7171

‎frontend/web/src/router/routes.ts‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { $t } from "@/locales";
1616
import LayoutComponent from "@/layouts/index.vue";
1717
import DashboardWorkplace from "@views/dashboard/workplace/index.vue";
1818
import DashboardAnalysis from "@views/dashboard/analysis/index.vue";
19-
import DashboardComponents from "@views/dashboard/components/index.vue";
2019
import RedirectView from "@views/redirect/index.vue";
2120
import LoginView from "@views/module_system/auth/login/index.vue";
2221
import Exception401 from "@views/exception/401/index.vue";
@@ -121,12 +120,6 @@ export const dashboardLayoutChildren: AppRouteRecordRaw[] = [
121120
component: DashboardWorkplace,
122121
meta: { title: "menus.dashboard.workplace", icon: "ri:bar-chart-box-line", keepAlive: true },
123122
},
124-
{
125-
path: "components",
126-
name: "DashboardComponents",
127-
component: DashboardComponents,
128-
meta: { title: "组件示例", icon: "ri:apps-2-line", keepAlive: true },
129-
},
130123
{
131124
path: "analysis",
132125
name: "DashboardAnalysis",

‎frontend/web/src/views/dashboard/components/index.vue‎

Lines changed: 0 additions & 90 deletions
This file was deleted.

‎frontend/web/src/views/dashboard/home/index.vue‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
</ElCol>
1919
</ElRow>
2020

21+
<HomeComponentShowcase />
22+
2123
<ElRow :gutter="16">
2224
<ElCol :span="24" class="mb-4">
2325
<AboutProject />
@@ -36,4 +38,5 @@ import HomeActivity from "./modules/home-activity.vue";
3638
import HomeQuickStart from "./modules/home-quick-start.vue";
3739
import CardList from "./modules/card-list.vue";
3840
import AboutProject from "./modules/about-project.vue";
41+
import HomeComponentShowcase from "./modules/home-component-showcase.vue";
3942
</script>

frontend/web/src/views/dashboard/components/modules/banner.vue renamed to frontend/web/src/views/dashboard/home/modules/banner.vue

File renamed without changes.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<template>
2+
<section class="home-component-showcase">
3+
<div class="home-component-showcase__head">
4+
<div>
5+
<span class="home-component-showcase__eyebrow">COMPONENT SHOWCASE</span>
6+
<h2>组件示例</h2>
7+
<p>Mock 数据仅用于展示 Fa 组件组合方式;上方首页数据来自真实接口。</p>
8+
</div>
9+
<FaStatusTag type="info" effect="plain" label="Mock data" />
10+
</div>
11+
12+
<Banner class="mb-4" />
13+
14+
<ElRow :gutter="16">
15+
<ElCol :xs="24" :lg="12">
16+
<ImageCards />
17+
</ElCol>
18+
<ElCol :xs="24" :lg="12">
19+
<ItBanners />
20+
</ElCol>
21+
</ElRow>
22+
23+
<ElRow :gutter="16">
24+
<ElCol :xs="24" :lg="12">
25+
<NewUser />
26+
</ElCol>
27+
<ElCol :xs="24" :lg="6">
28+
<QuickLinks />
29+
</ElCol>
30+
<ElCol :xs="24" :lg="6">
31+
<TodoList />
32+
</ElCol>
33+
</ElRow>
34+
35+
<FaTimelineListCard
36+
:list="timelineData"
37+
title="最近交易"
38+
subtitle="2024年12月20日"
39+
class="home-component-showcase__timeline"
40+
/>
41+
</section>
42+
</template>
43+
44+
<script setup lang="ts">
45+
import { getDashboardMock } from "@/mock/dashboard";
46+
import Banner from "./banner.vue";
47+
import ImageCards from "./image-cards.vue";
48+
import ItBanners from "./it-banners.vue";
49+
import NewUser from "./new-user.vue";
50+
import QuickLinks from "./quick-links.vue";
51+
import TodoList from "./todo-list.vue";
52+
53+
defineOptions({ name: "HomeComponentShowcase" });
54+
55+
const timelineData = getDashboardMock().timeline;
56+
</script>
57+
58+
<style scoped lang="scss">
59+
.home-component-showcase {
60+
margin-top: 24px;
61+
padding-top: 20px;
62+
border-top: 1px solid var(--el-border-color-lighter);
63+
}
64+
65+
.home-component-showcase__head {
66+
display: flex;
67+
gap: 16px;
68+
align-items: flex-start;
69+
justify-content: space-between;
70+
margin-bottom: 14px;
71+
}
72+
73+
.home-component-showcase__eyebrow {
74+
font-family: var(--fa-font-mono, ui-monospace, monospace);
75+
font-size: 9px;
76+
letter-spacing: 0.12em;
77+
color: var(--el-text-color-placeholder);
78+
}
79+
80+
.home-component-showcase__head h2 {
81+
margin: 5px 0 0;
82+
font-size: 18px;
83+
font-weight: 650;
84+
letter-spacing: -0.02em;
85+
color: var(--el-text-color-primary);
86+
}
87+
88+
.home-component-showcase__head p {
89+
margin: 4px 0 0;
90+
font-size: 11px;
91+
color: var(--el-text-color-secondary);
92+
}
93+
94+
.home-component-showcase__timeline {
95+
height: 432px;
96+
margin-top: 16px;
97+
}
98+
99+
@media (width <= 640px) {
100+
.home-component-showcase__head {
101+
flex-direction: column;
102+
}
103+
}
104+
</style>

frontend/web/src/views/dashboard/components/modules/image-cards.vue renamed to frontend/web/src/views/dashboard/home/modules/image-cards.vue

File renamed without changes.

frontend/web/src/views/dashboard/components/modules/it-banners.vue renamed to frontend/web/src/views/dashboard/home/modules/it-banners.vue

File renamed without changes.

frontend/web/src/views/dashboard/components/modules/new-user.vue renamed to frontend/web/src/views/dashboard/home/modules/new-user.vue

File renamed without changes.

frontend/web/src/views/dashboard/components/modules/quick-links.vue renamed to frontend/web/src/views/dashboard/home/modules/quick-links.vue

File renamed without changes.

0 commit comments

Comments
 (0)