|
|
@@ -5,10 +5,15 @@
|
|
|
<span class="admin-page-title">家庭工作台</span>
|
|
|
<span class="admin-page-subtitle">{{ family.name }}({{ family.inviteCode }})</span>
|
|
|
</div>
|
|
|
- <el-button size="mini" @click="goBack">返回家庭列表</el-button>
|
|
|
+ <div class="header-actions">
|
|
|
+ <button type="button" class="stats-toggle" @click="toggleStatsCollapsed">
|
|
|
+ {{ statsCollapsed ? "展开统计" : "收起统计" }}
|
|
|
+ </button>
|
|
|
+ <el-button size="mini" @click="goBack">返回家庭列表</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
- <el-row :gutter="16">
|
|
|
+ <el-row v-if="!statsCollapsed" :gutter="16">
|
|
|
<el-col v-for="(card, idx) in cards" :key="card.key" :span="8" class="wb-col">
|
|
|
<div class="wb-card" :class="cardStaticClass(card.key)" @click="openModule(card.key)">
|
|
|
<div class="wb-card-label">{{ card.label }}</div>
|
|
|
@@ -201,6 +206,7 @@ export default {
|
|
|
return {
|
|
|
familyId: Number(this.$route.params.id),
|
|
|
activeTab: 'children',
|
|
|
+ statsCollapsed: false,
|
|
|
family: {},
|
|
|
loading: false,
|
|
|
cards: [],
|
|
|
@@ -240,6 +246,17 @@ export default {
|
|
|
goBack() {
|
|
|
this.$router.push("/families")
|
|
|
},
|
|
|
+ toggleStatsCollapsed() {
|
|
|
+ this.statsCollapsed = !this.statsCollapsed
|
|
|
+ if (this.statsCollapsed) {
|
|
|
+ this.chartInstances.forEach((c) => c && c.dispose())
|
|
|
+ this.chartInstances = []
|
|
|
+ } else {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.renderCharts()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
async loadWorkbench() {
|
|
|
this.loading = true
|
|
|
try {
|
|
|
@@ -405,17 +422,20 @@ export default {
|
|
|
<style scoped>
|
|
|
.page-container { padding: 24px; }
|
|
|
.mb-12 { margin-bottom: 12px; }
|
|
|
-.admin-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-shrink: 0; }
|
|
|
+.admin-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-shrink: 0; }
|
|
|
.admin-page-title { font-size: 20px; font-weight: 600; color: var(--adm-text-88); }
|
|
|
.admin-page-subtitle { font-size: 12px; color: var(--adm-text-45); margin-left: 12px; font-weight: 400; }
|
|
|
+.header-actions { display: flex; align-items: center; gap: 8px; }
|
|
|
+.stats-toggle { border: none; background: transparent; padding: 0; font-size: 12px; color: #409eff; cursor: pointer; line-height: 1; }
|
|
|
+.stats-toggle:hover { text-decoration: underline; }
|
|
|
.wb-col { margin-bottom: 0; }
|
|
|
-.wb-card { background: #fff; border-radius: 8px; padding: 14px 16px 8px; margin-bottom: 16px; cursor: pointer; border: 1px solid #ebeef5; transition: box-shadow 0.2s; }
|
|
|
+.wb-card { background: #fff; border-radius: 8px; padding: 8px 12px 4px; margin-bottom: 8px; cursor: pointer; border: 1px solid #ebeef5; transition: box-shadow 0.2s; }
|
|
|
.wb-card:hover { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); }
|
|
|
.wb-card-static { cursor: default; }
|
|
|
.wb-card-static:hover { box-shadow: none; }
|
|
|
-.wb-card-label { font-size: 13px; color: var(--adm-text-65); }
|
|
|
-.wb-card-total { font-size: 28px; font-weight: 600; color: var(--adm-text-88); margin: 4px 0 6px; }
|
|
|
-.wb-card-chart { height: 48px; }
|
|
|
+.wb-card-label { font-size: 12px; color: var(--adm-text-65); line-height: 18px; }
|
|
|
+.wb-card-total { font-size: 18px; font-weight: 600; color: var(--adm-text-88); margin: 0 0 2px; line-height: 24px; }
|
|
|
+.wb-card-chart { height: 24px; }
|
|
|
.message-timeline { max-height: 60vh; overflow: auto; }
|
|
|
.message-item { padding: 8px 0; border-bottom: 1px dashed #ebeef5; }
|
|
|
.message-meta { font-size: 12px; color: var(--adm-text-45); }
|