This commit is contained in:
parent
13c2b978c7
commit
81f38874c8
|
|
@ -60,7 +60,7 @@
|
|||
<el-table-column label="学生信息" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<div>{{ row.name }}</div>
|
||||
<div class="sub-text">{{ row.genderName }} / {{ row.gradeName }}</div>
|
||||
<div class="sub-text">{{ row.gradeName }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="100" align="center">
|
||||
|
|
@ -113,7 +113,6 @@
|
|||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预约日期">{{ formatBookingDateTime(detailData.bookingDate, detailData.bookingTime) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学生姓名">{{ detailData.name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="性别">{{ detailData.genderName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="学生年级">{{ detailData.gradeName }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ detailData.phone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="专业名称">{{ detailData.majorName || '-' }}</el-descriptions-item>
|
||||
|
|
|
|||
|
|
@ -23,15 +23,26 @@ else
|
|||
<!-- 左侧:雷达图 -->
|
||||
<div class="la-chart-panel">
|
||||
<div class="la-chart-title">学习的关键能力</div>
|
||||
<canvas id="radarChart" width="520" height="480"></canvas>
|
||||
<canvas id="radarChart" width="520" height="400"></canvas>
|
||||
</div>
|
||||
|
||||
<!-- 右侧:竖向柱状图 -->
|
||||
<div class="la-chart-panel">
|
||||
<div class="la-chart-title">学习的关键能力排名</div>
|
||||
<canvas id="barChart" width="560" height="480"></canvas>
|
||||
<canvas id="barChart" width="560" height="400"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 结论区域 -->
|
||||
@if (!string.IsNullOrEmpty(Model.ConclusionContent))
|
||||
{
|
||||
<div class="la-conclusion">
|
||||
<div class="la-conclusion-badge">学习关键能力</div>
|
||||
<div class="la-conclusion-content">
|
||||
@Html.Raw(Model.ConclusionContent.Replace("\\n", "<br/>").Replace("\n", "<br/>"))
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
using MiAssessment.Core.Interfaces;
|
||||
using MiAssessment.Model.Data;
|
||||
using MiAssessment.Model.Models.Report;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace MiAssessment.Api.Pages.Report;
|
||||
|
||||
|
|
@ -20,18 +22,31 @@ public class LearningAbilitiesModel : ReportPageModelBase
|
|||
/// </summary>
|
||||
public List<CategoryResultDataDto> ItemsByScore { get; set; } = new();
|
||||
|
||||
public LearningAbilitiesModel(IReportDataService reportDataService)
|
||||
/// <summary>
|
||||
/// 最弱能力名称
|
||||
/// </summary>
|
||||
public string WeakestName { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// 结论内容
|
||||
/// </summary>
|
||||
public string ConclusionContent { get; set; } = "";
|
||||
|
||||
private readonly MiAssessmentDbContext _dbContext;
|
||||
|
||||
public LearningAbilitiesModel(IReportDataService reportDataService, MiAssessmentDbContext dbContext)
|
||||
: base(reportDataService)
|
||||
{
|
||||
_dbContext = dbContext;
|
||||
}
|
||||
|
||||
protected override Task OnDataLoadedAsync()
|
||||
protected override async Task OnDataLoadedAsync()
|
||||
{
|
||||
if (ReportData?.ResultsByType == null ||
|
||||
!ReportData.ResultsByType.TryGetValue(5, out var allItems))
|
||||
{
|
||||
ErrorMessage = "缺少学习关键能力数据";
|
||||
return Task.CompletedTask;
|
||||
return;
|
||||
}
|
||||
|
||||
Items = allItems.OrderBy(x => x.CategoryId).ToList();
|
||||
|
|
@ -39,10 +54,28 @@ public class LearningAbilitiesModel : ReportPageModelBase
|
|||
if (Items.Count == 0)
|
||||
{
|
||||
ErrorMessage = "未找到学习关键能力数据";
|
||||
return Task.CompletedTask;
|
||||
return;
|
||||
}
|
||||
|
||||
ItemsByScore = Items.OrderByDescending(x => x.Score).ToList();
|
||||
return Task.CompletedTask;
|
||||
|
||||
// 加载最弱能力结论
|
||||
var weakest = ItemsByScore.Last();
|
||||
WeakestName = weakest.CategoryName;
|
||||
|
||||
if (ReportData.ConclusionsByCategory.TryGetValue(weakest.CategoryId, out var wc) && wc.Content != null)
|
||||
{
|
||||
ConclusionContent = wc.Content;
|
||||
}
|
||||
else
|
||||
{
|
||||
var template = await _dbContext.ReportConclusions
|
||||
.AsNoTracking()
|
||||
.FirstOrDefaultAsync(t =>
|
||||
t.CategoryId == weakest.CategoryId &&
|
||||
t.ConclusionType == 4 &&
|
||||
!t.IsDeleted);
|
||||
ConclusionContent = template?.Content ?? "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
border-radius: 12px;
|
||||
padding: 50px 50px 40px;
|
||||
position: relative;
|
||||
margin: 0 60px;
|
||||
}
|
||||
|
||||
/* 顶部红色 badge */
|
||||
|
|
@ -58,7 +57,7 @@
|
|||
border: 3px solid #C0392B;
|
||||
border-radius: 12px;
|
||||
padding: 16px 40px;
|
||||
margin: 0 20px;
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: #333;
|
||||
|
|
|
|||
|
|
@ -42,3 +42,28 @@
|
|||
margin-bottom: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* ---- 结论区域 ---- */
|
||||
.la-conclusion {
|
||||
background: #FFF5F5;
|
||||
border-radius: 12px;
|
||||
padding: 16px 20px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.la-conclusion-badge {
|
||||
display: inline-block;
|
||||
background: #E67E73;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
padding: 4px 16px;
|
||||
border-radius: 20px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.la-conclusion-content {
|
||||
font-size: 13px;
|
||||
line-height: 1.8;
|
||||
color: #444;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -124,6 +124,7 @@
|
|||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { useUserStore } from '@/store/user.js'
|
||||
import { useNavbar } from '@/composables/useNavbar.js'
|
||||
import { getBannerList, getNavigationList } from '@/api/home.js'
|
||||
|
|
@ -274,6 +275,14 @@ async function onRefresh() {
|
|||
isRefreshing.value = false
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
// 解析分享链接中的邀请人参数
|
||||
if (options && options.inviterId) {
|
||||
console.log('[Index] 从页面参数获取inviterId:', options.inviterId)
|
||||
uni.setStorageSync('inviterId', options.inviterId)
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
initPageData()
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user