feat: expand user growth record view

This commit is contained in:
2026-07-31 16:25:50 +08:00
parent a84650bb9e
commit 763c78bd7e
2 changed files with 28 additions and 1 deletions

View File

@@ -30,6 +30,8 @@ const helpCard = ref<TeacherHelpCard | null>(null);
const helpCardContent = ref("");
const shareDraft = ref<ShareDraft | null>(null);
const shareDraftContent = ref("");
const helpCardHistory = ref<TeacherHelpCard[]>([]);
const shareDraftHistory = ref<ShareDraft[]>([]);
const profileLoading = ref(false);
const finishingTopic = ref(false);
const generatingHelpCard = ref(false);
@@ -292,7 +294,14 @@ async function openGrowthProfile() {
profileDialogOpen.value = true;
profileLoading.value = true;
try {
growthProfile.value = await api.growthProfile();
const [profileResult, helpCards, shareDrafts] = await Promise.all([
api.growthProfile(),
api.helpCards(10),
api.shareDrafts(10),
]);
growthProfile.value = profileResult;
helpCardHistory.value = helpCards;
shareDraftHistory.value = shareDrafts;
} catch (error) {
handleError(error, "成长档案加载失败");
} finally {
@@ -482,6 +491,20 @@ async function copyText(text: string) {
<p>{{ item.summary }}</p>
</article>
</div>
<div v-if="helpCardHistory.length" class="recent-topic-summaries">
<h3>最近老师求助卡</h3>
<article v-for="item in helpCardHistory" :key="`help-${item.id}`">
<time>{{ item.createdAt }} · {{ item.copied ? '已复制' : '未复制' }}</time>
<p>{{ item.content.slice(0, 140) }}{{ item.content.length > 140 ? '…' : '' }}</p>
</article>
</div>
<div v-if="shareDraftHistory.length" class="recent-topic-summaries">
<h3>最近班级分享稿</h3>
<article v-for="item in shareDraftHistory" :key="`share-${item.id}`">
<time>{{ item.createdAt }} · {{ item.copied ? '已复制' : '未复制' }}</time>
<p>{{ item.content.slice(0, 140) }}{{ item.content.length > 140 ? '…' : '' }}</p>
</article>
</div>
</section>
</AppDialog>