style: 复习总览统一样式并补全字段名

This commit is contained in:
2026-08-02 11:59:47 +08:00
parent 81f91b320a
commit b8b0b73cd8
+23 -91
View File
@@ -84,56 +84,24 @@ onMounted(() => {
</article> </article>
</div> </div>
<article class="surface-card table-card"> <div v-if="tasks.length > 0" v-loading="loading" class="task-list">
<el-table v-loading="loading" :data="tasks" stripe @row-click="openTaskReview">
<el-table-column prop="taskName" label="任务名" min-width="180" />
<el-table-column prop="effectiveTime" label="累计有效学习时长" min-width="150">
<template #default="{ row }">
{{ formatEffectiveTime(row.effectiveTime) }}
</template>
</el-table-column>
<el-table-column prop="reportCount" label="学习报告数" min-width="120" />
<el-table-column prop="fragmentCount" label="学习残片数" min-width="120" />
<el-table-column label="操作" width="200">
<template #default="{ row }">
<el-button
text
type="success"
size="small"
:loading="openingTaskNum === row.taskNum"
@click.stop="openTaskReview(row)"
>
查看记录
</el-button>
<el-button
text
type="success"
size="small"
@click.stop="router.push(`/review/recall/${row.taskNum}`)"
>
回忆复习
</el-button>
</template>
</el-table-column>
</el-table>
</article>
<div v-if="tasks.length > 0" v-loading="loading" class="mobile-task-list">
<article <article
v-for="row in tasks" v-for="row in tasks"
:key="row.taskNum" :key="row.taskNum"
class="surface-card mobile-task-card" class="surface-card task-card"
@click="openTaskReview(row)" @click="openTaskReview(row)"
> >
<div class="mobile-task-head"> <div class="task-head">
<strong>{{ row.taskName }}</strong> <strong>{{ row.taskName }}</strong>
<span class="mobile-task-time">{{ formatEffectiveTime(row.effectiveTime) }}</span>
</div> </div>
<div class="mobile-task-stats"> <div class="task-meta">
<span>报告 {{ row.reportCount || 0 }}</span> <span>累计有效学习时长{{ formatEffectiveTime(row.effectiveTime) }}</span>
<span>残片 {{ row.fragmentCount || 0 }}</span>
</div> </div>
<div class="mobile-task-actions"> <div class="task-stats">
<span>学习报告数量{{ row.reportCount || 0 }}</span>
<span>学习残片数量{{ row.fragmentCount || 0 }}</span>
</div>
<div class="task-actions">
<el-button <el-button
text text
type="success" type="success"
@@ -154,11 +122,7 @@ onMounted(() => {
</div> </div>
</article> </article>
</div> </div>
<el-empty <el-empty v-if="!loading && tasks.length === 0" description="暂无复习任务" />
v-if="!loading && tasks.length === 0"
class="mobile-empty"
description="暂无复习任务"
/>
</section> </section>
</template> </template>
@@ -197,20 +161,13 @@ onMounted(() => {
color: var(--green-900); color: var(--green-900);
} }
.table-card { .task-list {
padding: 10px; display: flex;
flex-direction: column;
gap: 10px;
} }
.table-card :deep(.el-table__row) { .task-card {
cursor: pointer;
}
.mobile-task-list,
.mobile-empty {
display: none;
}
.mobile-task-card {
padding: 14px 16px; padding: 14px 16px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -218,34 +175,23 @@ onMounted(() => {
cursor: pointer; cursor: pointer;
} }
.mobile-task-head { .task-head strong {
display: flex; display: block;
align-items: center;
justify-content: space-between;
gap: 10px;
}
.mobile-task-head strong {
min-width: 0;
color: var(--green-900); color: var(--green-900);
font-size: 15px; font-size: 15px;
overflow-wrap: anywhere; overflow-wrap: anywhere;
} }
.mobile-task-time { .task-meta,
flex-shrink: 0; .task-stats {
color: var(--text-secondary);
font-size: 13px;
}
.mobile-task-stats {
display: flex; display: flex;
gap: 14px; flex-wrap: wrap;
gap: 8px 14px;
color: var(--text-secondary); color: var(--text-secondary);
font-size: 13px; font-size: 13px;
} }
.mobile-task-actions { .task-actions {
display: flex; display: flex;
gap: 4px; gap: 4px;
} }
@@ -254,19 +200,5 @@ onMounted(() => {
.summary-grid { .summary-grid {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
.table-card {
display: none;
}
.mobile-task-list {
display: flex;
flex-direction: column;
gap: 10px;
}
.mobile-empty {
display: block;
}
} }
</style> </style>