From 9344b56334577dbc7f6030ac81fbd952801b1d30 Mon Sep 17 00:00:00 2001 From: owen Date: Fri, 18 Sep 2026 17:45:56 +0800 Subject: [PATCH] ow --- .../dashboard/DashboardBottomNav.vue | 59 ++++ .../dashboard/DashboardGroupCard.vue | 208 +++++++++++++++ .../components/dashboard/DashboardHero.vue | 252 ++++++++++++++++++ WebVue/src/layout/home.vue | 65 +++++ WebVue/src/views/dashboard.vue | 52 +++- 5 files changed, 626 insertions(+), 10 deletions(-) create mode 100644 WebVue/src/components/dashboard/DashboardBottomNav.vue create mode 100644 WebVue/src/components/dashboard/DashboardGroupCard.vue create mode 100644 WebVue/src/components/dashboard/DashboardHero.vue create mode 100644 WebVue/src/layout/home.vue diff --git a/WebVue/src/components/dashboard/DashboardBottomNav.vue b/WebVue/src/components/dashboard/DashboardBottomNav.vue new file mode 100644 index 0000000..afcaf4e --- /dev/null +++ b/WebVue/src/components/dashboard/DashboardBottomNav.vue @@ -0,0 +1,59 @@ + + + + + \ No newline at end of file diff --git a/WebVue/src/components/dashboard/DashboardGroupCard.vue b/WebVue/src/components/dashboard/DashboardGroupCard.vue new file mode 100644 index 0000000..12e8d6b --- /dev/null +++ b/WebVue/src/components/dashboard/DashboardGroupCard.vue @@ -0,0 +1,208 @@ + + + + + \ No newline at end of file diff --git a/WebVue/src/components/dashboard/DashboardHero.vue b/WebVue/src/components/dashboard/DashboardHero.vue new file mode 100644 index 0000000..19f5e8e --- /dev/null +++ b/WebVue/src/components/dashboard/DashboardHero.vue @@ -0,0 +1,252 @@ + + + + + \ No newline at end of file diff --git a/WebVue/src/layout/home.vue b/WebVue/src/layout/home.vue new file mode 100644 index 0000000..55f1f8b --- /dev/null +++ b/WebVue/src/layout/home.vue @@ -0,0 +1,65 @@ + + + + + \ No newline at end of file diff --git a/WebVue/src/views/dashboard.vue b/WebVue/src/views/dashboard.vue index 6230ce7..b0097e8 100644 --- a/WebVue/src/views/dashboard.vue +++ b/WebVue/src/views/dashboard.vue @@ -7,8 +7,8 @@
+ :color="grp.color" :soft="grp.soft" :icon="grp.icon" :layout="grp.layout" :cover="grp.cover" + :badge="grp.badge" :items="grp.items" @navigate="onpush" />
@@ -27,7 +27,7 @@ import { useRouter } from "vue-router"; import securityUserService from "@/service/security/securityUserService"; import type { SecurityFunctionDisplayData } from "@/data/auto/securityFunctionDisplayData"; import DashboardHero from "@/components/dashboard/DashboardHero.vue"; -import DashboardGroupCard from "@/components/dashboard/DashboardGroupCard.vue"; +import DashboardGroupCard, { type GroupCardItem } from "@/components/dashboard/DashboardGroupCard.vue"; import DashboardBottomNav from "@/components/dashboard/DashboardBottomNav.vue"; interface NavItem { @@ -51,13 +51,18 @@ const groupDefs: { soft: string; icon: string; layout: 2 | 3; + /** 封面图片地址(可选),缺省时由卡片用主题色渐变占位 */ + cover?: string; + /** 封面左上角标签(可选),缺省时显示分组名称 */ + badge?: string; }[] = [ - { key: "disk", name: "网盘", color: "#1677ff", soft: "#e6f4ff", icon: "dbank", layout: 2 }, - { key: "share", name: "共享中心", color: "#fa8c16", soft: "#fff7e6", icon: "dgroup", layout: 2 }, + { key: "disk", name: "网盘", color: "#1677ff", soft: "#e6f4ff", icon: "dbank", layout: 2}, + { key: "share", name: "共享中心", color: "#fa8c16", soft: "#fff7e6", icon: "dgroup", layout: 2}, + // { key: "photo", name: "相册", color: "#722ed1", soft: "#f9f0ff", icon: "picture", layout: 3, cover: "/images/main/p4.png" }, { key: "photo", name: "相册", color: "#722ed1", soft: "#f9f0ff", icon: "picture", layout: 3 }, - { key: "audio", name: "音乐", color: "#eb2f96", soft: "#fff0f6", icon: "foldermp3", layout: 3 }, + { key: "audio", name: "音乐", color: "#eb2f96", soft: "#fff0f6", icon: "foldermp3", layout: 3}, { key: "video", name: "视频", color: "#13c2c2", soft: "#e6fffb", icon: "foldervideo", layout: 3 }, - { key: "family", name: "族谱管理", color: "#52c41a", soft: "#f6ffed", icon: "family", layout: 2 }, + { key: "family", name: "族谱管理", color: "#52c41a", soft: "#f6ffed", icon: "family", layout: 2}, { key: "other", name: "更多", color: "#8a919f", soft: "#f5f6f8", icon: "gailan", layout: 3 }, ]; @@ -86,19 +91,46 @@ const GROUP_OF: Record = { const resolveGroup = (it: SecurityFunctionDisplayData): GroupKey => GROUP_OF[it.FunctionName] ?? "other"; +/* ==================== 自定义副标题 ==================== */ +/** 留空时卡片会自动回退到 FunctionEngName */ +const SUBTITLE_OF: Record = { + DmsFileEnquiry: "上传、下载", + DmsFileDeleteEnquiry: "", + FamilyGroupShare: "", + FamilyShareOperation: "", + FamilyGroupOperation: "", + FamilyGroupEnquiry: "", + Preview: "", + PublishPhotoOperation: "", + PublishPhotoEnquiry: "", + PreviewAudio: "播放从默认专辑", + PublishAudioOperation: "", + PublishAudioEnquiry: "", + PreviewVideo: "", + PublishVideoOperation: "", + PublishVideoEnquiry: "", + FamilyPersonEnquiry: "", + FamilyPersonOperation: "", + FamilyTreeEnquiry: "", + FamilyTreeOperation: "", +}; + +const resolveSubtitle = (it: SecurityFunctionDisplayData): string => + SUBTITLE_OF[it.FunctionName] ?? ""; + /* ==================== 分组结果 ==================== */ const groups = computed(() => { const taken = new Set(); - const result: { key: GroupKey; name: string; color: string; soft: string; icon: string; layout: 2 | 3; items: SecurityFunctionDisplayData[] }[] = []; + const result: { key: GroupKey; name: string; color: string; soft: string; icon: string; layout: 2 | 3; cover?: string; badge?: string; items: GroupCardItem[] }[] = []; for (const g of groupDefs) { - const items: SecurityFunctionDisplayData[] = []; + const items: GroupCardItem[] = []; for (const it of allItems.value) { if (resolveGroup(it) !== g.key) continue; const label = it.FunctionLocalName || it.FunctionName; if (taken.has(label)) continue; taken.add(label); - items.push(it); + items.push({ ...it, subtitle: resolveSubtitle(it) }); } if (items.length) result.push({ ...g, items }); }