merge store overview and home for wide mode

This commit is contained in:
Timi
2026-11-03 15:42:49 +08:00
parent d3879c9c77
commit 1a0cdd2181
17 changed files with 991 additions and 625 deletions
+114 -62
View File
@@ -1,69 +1,73 @@
<template>
<t-navbar fixed :z-index="20" title="管理" />
<main class="tui-page-content scroll column management-tab">
<t-cell-group class="user-card" theme="card" v-entrance-transition>
<t-cell
v-if="currentUser"
class="info"
arrow
hover
@click="go('/management/profile')"
>
<template #description>
<div v-if="currentUser?.phoneNo" v-text="currentUser.phoneNo" />
</template>
<template #title>
<div class="header">
<div class="name" v-text="currentUser.nick || currentUser.name" />
<gender-icon :value="currentUser.gender" />
<div class="roles">
<t-tag
v-for="role in currentUserRoleList"
:key="getRoleKey(role)"
size="small"
theme="success"
variant="outline"
:content="getRoleName(role)"
<div class="tab-body">
<div class="menu-grid">
<t-cell-group class="user-card" theme="card" v-entrance-transition>
<t-cell
v-if="currentUser"
class="info"
arrow
hover
@click="go('/management/profile')"
>
<template #description>
<div v-if="currentUser?.phoneNo" v-text="currentUser.phoneNo" />
</template>
<template #title>
<div class="header">
<div class="name" v-text="currentUser.nick || currentUser.name" />
<gender-icon :value="currentUser.gender" />
<div class="roles">
<t-tag
v-for="role in currentUserRoleList"
:key="getRoleKey(role)"
size="small"
theme="success"
variant="outline"
:content="getRoleName(role)"
/>
<span v-if="!currentUserRoleList.length && !isRoleLoading" class="muted" v-text="'未配置角色'" />
</div>
</div>
</template>
<template #leftIcon>
<t-image
class="avatar"
:src="currentUserAvatar"
:alt="currentUser.nick || currentUser.name"
fit="cover"
/>
<span v-if="!currentUserRoleList.length && !isRoleLoading" class="muted" v-text="'未配置角色'" />
</div>
</div>
</template>
<template #leftIcon>
<t-image
class="avatar"
:src="currentUserAvatar"
:alt="currentUser.nick || currentUser.name"
fit="cover"
/>
</template>
</t-cell>
</t-cell-group>
<t-cell-group
v-for="group in visibleMenuGroupList"
:key="group.title"
:title="group.title"
theme="card"
v-entrance-transition="{ step: 30 }"
>
<t-cell
v-for="item in group.items"
:key="item.path"
class="item"
:title="item.title"
arrow
hover
@click="go(item)"
>
<template #leftIcon>
<t-icon :name="item.icon" size="1.75rem" />
</template>
</t-cell>
</t-cell-group>
<footer class="footer">
<p>技术支持:夜雨</p>
<p>Copyright © 2026 imyeyu.com</p>
</footer>
</template>
</t-cell>
</t-cell-group>
<t-cell-group
v-for="group in visibleMenuGroupList"
:key="group.title"
:title="group.title"
theme="card"
v-entrance-transition="{ step: 30 }"
>
<t-cell
v-for="item in group.items"
:key="item.path"
class="item"
:title="item.title"
arrow
hover
@click="go(item)"
>
<template #leftIcon>
<t-icon :name="item.icon" size="1.75rem" />
</template>
</t-cell>
</t-cell-group>
</div>
<footer class="footer">
<p>技术支持:夜雨</p>
<p>Copyright © 2026 imyeyu.com</p>
</footer>
</div>
</main>
</template>
@@ -333,6 +337,54 @@ onBeforeRouteLeave(() => {
.management-tab {
gap: .5rem;
.tab-body {
--tab-body-max: 72rem;
}
/**
* 平板起分组卡片并排,同一行的卡片拉伸等高(默认 stretch),
* 账户卡片独占一行当页头——它只有一条 cell,
* 和分组卡片并排会在下面留下一大块空白。
* 手机上仍是单列,间距保持 .5rem。
*/
.menu-grid {
gap: .5rem;
display: grid;
padding: 0 1rem;
grid-template-columns: minmax(0, 1fr);
// 卡片自带 16px 外边距,进栅格后间距交给容器的 padding 和 gap
:deep(.t-cell-group--card) {
margin: 0;
}
@media (min-width: 48rem) {
gap: .75rem;
grid-template-columns: repeat(2, minmax(0, 1fr));
.user-card {
grid-column: 1 / -1;
}
/**
* cell-group 的白色在 cell 上,根节点被拉伸后下半截是透明的,
* 同行的卡片看起来还是高矮不一;把容器色补到根上才是真正等高。
* 标题自带的灰底在卡片里会变成一条灰带,一并清掉。
*/
:deep(.t-cell-group--card) {
background: var(--td-bg-color-container, #fff);
.t-cell-group__title {
background: transparent;
}
}
}
@media (min-width: 80rem) {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
.user-card {
.info {