|
@@ -49,11 +49,11 @@
|
|
|
<div class="stats-grid">
|
|
<div class="stats-grid">
|
|
|
<div class="stat-card">
|
|
<div class="stat-card">
|
|
|
<h3>📚 课程访问统计</h3>
|
|
<h3>📚 课程访问统计</h3>
|
|
|
- <div class="stat-number">{{ collegeStats.totalCourses }}</div>
|
|
|
|
|
|
|
+ <div class="stat-number">{{ collegeStats.allCourseCount }}</div>
|
|
|
<div class="stat-label">总课程数</div>
|
|
<div class="stat-label">总课程数</div>
|
|
|
- <div class="stat-number">{{ collegeStats.activeCourses }}</div>
|
|
|
|
|
|
|
+ <div class="stat-number">{{ collegeStats.activeCourseCount }}</div>
|
|
|
<div class="stat-label">活跃课程数</div>
|
|
<div class="stat-label">活跃课程数</div>
|
|
|
- <div class="stat-number">{{ collegeStats.courseAccessRate }}%</div>
|
|
|
|
|
|
|
+ <div class="stat-number">{{ collegeStats.courseVisitCount }}%</div>
|
|
|
<div class="stat-label">课程访问率</div>
|
|
<div class="stat-label">课程访问率</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -205,7 +205,10 @@
|
|
|
avgLoginPerUser: 3.85,
|
|
avgLoginPerUser: 3.85,
|
|
|
totalOnlineTime: 2456,
|
|
totalOnlineTime: 2456,
|
|
|
avgSessionTime: 45.2,
|
|
avgSessionTime: 45.2,
|
|
|
- peakOnlineUsers: 234
|
|
|
|
|
|
|
+ peakOnlineUsers: 234,
|
|
|
|
|
+ activeCourseCount : 0,
|
|
|
|
|
+ allCourseCount : 0,
|
|
|
|
|
+ courseVisitCount : 0
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 图表引用
|
|
// 图表引用
|
|
@@ -218,8 +221,8 @@
|
|
|
const collegeColumns = [
|
|
const collegeColumns = [
|
|
|
{
|
|
{
|
|
|
title: '学院名称',
|
|
title: '学院名称',
|
|
|
- dataIndex: 'name',
|
|
|
|
|
- key: 'name'
|
|
|
|
|
|
|
+ dataIndex: 'collegeIdName',
|
|
|
|
|
+ key: 'collegeIdName'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '课程数量',
|
|
title: '课程数量',
|
|
@@ -228,37 +231,37 @@
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '总访问量',
|
|
title: '总访问量',
|
|
|
- dataIndex: 'totalVisits',
|
|
|
|
|
- key: 'totalVisits'
|
|
|
|
|
|
|
+ dataIndex: 'watchCount',
|
|
|
|
|
+ key: 'watchCount'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '平均完成率',
|
|
title: '平均完成率',
|
|
|
- dataIndex: 'avgCompletionRate',
|
|
|
|
|
- key: 'avgCompletionRate',
|
|
|
|
|
|
|
+ dataIndex: 'completeRate',
|
|
|
|
|
+ key: 'completeRate',
|
|
|
customRender: ({ text }) => `${text}%`
|
|
customRender: ({ text }) => `${text}%`
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
title: '作业提交率',
|
|
title: '作业提交率',
|
|
|
- dataIndex: 'assignmentSubmissionRate',
|
|
|
|
|
- key: 'assignmentSubmissionRate',
|
|
|
|
|
|
|
+ dataIndex: 'homeworkFinishRate',
|
|
|
|
|
+ key: 'homeworkFinishRate',
|
|
|
customRender: ({ text }) => `${text}%`
|
|
customRender: ({ text }) => `${text}%`
|
|
|
},
|
|
},
|
|
|
- {
|
|
|
|
|
- title: '退课率',
|
|
|
|
|
- dataIndex: 'dropoutRate',
|
|
|
|
|
- key: 'dropoutRate',
|
|
|
|
|
- customRender: ({ text }) => `${text}%`
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // {
|
|
|
|
|
+ // title: '退课率',
|
|
|
|
|
+ // dataIndex: 'homeworkFinishRate',
|
|
|
|
|
+ // key: 'homeworkFinishRate',
|
|
|
|
|
+ // customRender: ({ text }) => `${text}%`
|
|
|
|
|
+ // }
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
// 学院表格数据
|
|
// 学院表格数据
|
|
|
const collegeTableData = ref([
|
|
const collegeTableData = ref([
|
|
|
{
|
|
{
|
|
|
- id: 1,
|
|
|
|
|
- name: '计算机学院',
|
|
|
|
|
|
|
+ collegeId: 1,
|
|
|
|
|
+ collegeIdName: '计算机学院',
|
|
|
courseCount: 45,
|
|
courseCount: 45,
|
|
|
totalVisits: 5234,
|
|
totalVisits: 5234,
|
|
|
- avgCompletionRate: 78.5,
|
|
|
|
|
|
|
+ completeRate: 78.5,
|
|
|
assignmentSubmissionRate: 85.2,
|
|
assignmentSubmissionRate: 85.2,
|
|
|
dropoutRate: 10.2
|
|
dropoutRate: 10.2
|
|
|
},
|
|
},
|
|
@@ -414,23 +417,34 @@
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ const formatDateWithDays = (days = 0) => {
|
|
|
|
|
+ const date = new Date();
|
|
|
|
|
+ date.setDate(date.getDate() + days); // 设置天数偏移
|
|
|
|
|
|
|
|
|
|
+ const year = date.getFullYear();
|
|
|
|
|
+ const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
|
|
+ const day = String(date.getDate()).padStart(2, '0');
|
|
|
|
|
+
|
|
|
|
|
+ return `${year}-${month}-${day}`;
|
|
|
|
|
+ }
|
|
|
// 更新学院数据
|
|
// 更新学院数据
|
|
|
const updateCollegeData = async () => {
|
|
const updateCollegeData = async () => {
|
|
|
try {
|
|
try {
|
|
|
// 获取学院统计数据 船锚
|
|
// 获取学院统计数据 船锚
|
|
|
const statsResponse = await getCollegeStats({
|
|
const statsResponse = await getCollegeStats({
|
|
|
- collegeId: collegeFilters.collegeId,
|
|
|
|
|
- timeRange: collegeFilters.timeRange
|
|
|
|
|
|
|
+ orgId: collegeFilters.collegeId,
|
|
|
|
|
+ startTime : formatDateWithDays(0),
|
|
|
|
|
+ endTime : formatDateWithDays(collegeFilters.timeRange)
|
|
|
})
|
|
})
|
|
|
- Object.assign(collegeStats, statsResponse)
|
|
|
|
|
|
|
+ Object.assign(collegeStats, statsResponse.data)
|
|
|
|
|
|
|
|
// 获取课程详细统计
|
|
// 获取课程详细统计
|
|
|
const detailsResponse = await getCollegeCourseDetails({
|
|
const detailsResponse = await getCollegeCourseDetails({
|
|
|
- collegeId: collegeFilters.collegeId,
|
|
|
|
|
- timeRange: collegeFilters.timeRange
|
|
|
|
|
|
|
+ orgId: collegeFilters.collegeId,
|
|
|
|
|
+ startTime : formatDateWithDays(0),
|
|
|
|
|
+ endTime : formatDateWithDays(collegeFilters.timeRange)
|
|
|
})
|
|
})
|
|
|
- collegeTableData.value = detailsResponse
|
|
|
|
|
|
|
+ collegeTableData.value = detailsResponse.data
|
|
|
|
|
|
|
|
// 重新初始化图表
|
|
// 重新初始化图表
|
|
|
await initCollegeCharts()
|
|
await initCollegeCharts()
|
|
@@ -482,10 +496,13 @@
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
const response = await getLoginTimeDistribution({
|
|
const response = await getLoginTimeDistribution({
|
|
|
- collegeId: collegeFilters.collegeId,
|
|
|
|
|
- timeRange: collegeFilters.timeRange
|
|
|
|
|
|
|
+ orgId: collegeFilters.collegeId,
|
|
|
|
|
+ startTime : formatDateWithDays(0),
|
|
|
|
|
+ endTime : formatDateWithDays(1),
|
|
|
|
|
+ current : 1,
|
|
|
|
|
+ size : 24
|
|
|
})
|
|
})
|
|
|
-
|
|
|
|
|
|
|
+ console.log('结果呢',response)
|
|
|
const { hours, loginCounts } = response
|
|
const { hours, loginCounts } = response
|
|
|
|
|
|
|
|
const option = {
|
|
const option = {
|
|
@@ -590,8 +607,11 @@
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
const response = await getCourseHeat({
|
|
const response = await getCourseHeat({
|
|
|
- collegeId: collegeFilters.collegeId,
|
|
|
|
|
- timeRange: collegeFilters.timeRange
|
|
|
|
|
|
|
+ orgId: collegeFilters.collegeId,
|
|
|
|
|
+ startTime : formatDateWithDays(0),
|
|
|
|
|
+ endTime : formatDateWithDays(1),
|
|
|
|
|
+ current : 1,
|
|
|
|
|
+ size : 8
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const { courses, visits } = response
|
|
const { courses, visits } = response
|