This commit is contained in:
itcsx committed 2026-09-18 17:45:56 +08:00
1 parent 61869f1af0
commit 9344b56334
5 files changed
+626 -10

No files matched your search

+42 -10
View File
@@ -7,8 +7,8 @@
<!-- 功能分组:卡片外壳 / 标题字号沿用 ft-page 体系 -->
<div class="page-main ft-page">
<DashboardGroupCard v-for="grp in groups" :id="'grp-' + grp.key" :key="grp.key" :name="grp.name"
:color="grp.color" :soft="grp.soft" :icon="grp.icon" :layout="grp.layout" :items="grp.items"
@navigate="onpush" />
:color="grp.color" :soft="grp.soft" :icon="grp.icon" :layout="grp.layout" :cover="grp.cover"
:badge="grp.badge" :items="grp.items" @navigate="onpush" />
<a-empty v-if="!groups.length && !loading" description="没有匹配的功能" />
</div>
@@ -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<string, GroupKey> = {
const resolveGroup = (it: SecurityFunctionDisplayData): GroupKey =>
GROUP_OF[it.FunctionName] ?? "other";
/* ==================== 自定义副标题 ==================== */
/** 留空时卡片会自动回退到 FunctionEngName */
const SUBTITLE_OF: Record<string, string> = {
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<string>();
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 });
}