|
|
@@ -48,7 +48,7 @@
|
|
|
<div class="stat-label">总观看人数</div>
|
|
|
<div class="stat-number">{{ stats.alreadyUserCount }}</div>
|
|
|
<div class="stat-label">完成观看人数</div>
|
|
|
- <div class="completion-rate">{{tool.formatValue(stats.finishRate) }}</div>
|
|
|
+ <div class="completion-rate">{{tool.formatValue(stats.docFinishRate) }}</div>
|
|
|
<div class="stat-label">完成率</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -56,7 +56,7 @@
|
|
|
<h3>🚪 文档跳出分析</h3>
|
|
|
<div class="stat-number">{{ stats.allHourCount }}</div>
|
|
|
<div class="stat-label">总跳出次数</div>
|
|
|
- <div class="stat-number">{{tool.formatValue(stats.allHourCount) }}</div>
|
|
|
+ <div class="stat-number">{{tool.formatValue(stats.finishRate) }}</div>
|
|
|
<div class="stat-label">跳出率</div>
|
|
|
<div class="stat-number">{{ stats.jumpAvgTime }}</div>
|
|
|
<div class="stat-label">平均跳出时间</div>
|
|
|
@@ -64,11 +64,11 @@
|
|
|
|
|
|
<div class="stat-card" v-if="forumType">
|
|
|
<h3>💬 讨论互动统计</h3>
|
|
|
- <div class="stat-number">{{ stats.totalDiscussions }}</div>
|
|
|
+ <div class="stat-number">{{ stats.postCount }}</div>
|
|
|
<div class="stat-label">讨论总数</div>
|
|
|
- <div class="stat-number">{{ stats.totalReplies }}</div>
|
|
|
+ <div class="stat-number">{{ stats.replyCount }}</div>
|
|
|
<div class="stat-label">回帖总数</div>
|
|
|
- <div class="stat-number">{{ stats.avgRepliesPerDiscussion }}</div>
|
|
|
+ <div class="stat-number">{{ stats.avgReplyCount }}</div>
|
|
|
<div class="stat-label">平均回帖数</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -83,21 +83,21 @@
|
|
|
<div class="weekly-stats" v-if="forumType">
|
|
|
<div class="weekly-card">
|
|
|
<h4>👨🎓 学员每周发帖统计</h4>
|
|
|
- <div class="weekly-number">{{ weeklyStats.studentWeeklyPosts }}</div>
|
|
|
+ <div class="weekly-number">{{ weeklyStats.weekPostCount }}</div>
|
|
|
<div class="weekly-label">本周发帖数</div>
|
|
|
- <div class="weekly-number">{{ weeklyStats.studentWeeklyReplies }}</div>
|
|
|
+ <div class="weekly-number">{{ weeklyStats.weekReplyCount }}</div>
|
|
|
<div class="weekly-label">本周回帖数</div>
|
|
|
- <div class="weekly-number">{{ weeklyStats.studentAvgPostsPerDay }}</div>
|
|
|
+ <div class="weekly-number">{{ weeklyStats.weekAvgPostCount }}</div>
|
|
|
<div class="weekly-label">日均发帖数</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="weekly-card">
|
|
|
<h4>👨🏫 教员每周发帖统计</h4>
|
|
|
- <div class="weekly-number">{{ weeklyStats.teacherWeeklyPosts }}</div>
|
|
|
+ <div class="weekly-number">{{ teachweeklyStats.weekPostCount }}</div>
|
|
|
<div class="weekly-label">本周发帖数</div>
|
|
|
- <div class="weekly-number">{{ weeklyStats.teacherWeeklyReplies }}</div>
|
|
|
+ <div class="weekly-number">{{ teachweeklyStats.weekReplyCount }}</div>
|
|
|
<div class="weekly-label">本周回帖数</div>
|
|
|
- <div class="weekly-number">{{ weeklyStats.teacherAvgPostsPerDay }}</div>
|
|
|
+ <div class="weekly-number">{{ teachweeklyStats.weekAvgPostCount }}</div>
|
|
|
<div class="weekly-label">日均发帖数</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -133,15 +133,17 @@
|
|
|
<script setup>
|
|
|
import {ref, reactive, onMounted, nextTick, h, computed} from 'vue'
|
|
|
import * as echarts from 'echarts'
|
|
|
- import {
|
|
|
- getCourseOptions,
|
|
|
- getTeachingStats,
|
|
|
- documentJumpStatistic,
|
|
|
- getWeeklyStats,
|
|
|
- getDailyVisits,
|
|
|
- getDiscussionData,
|
|
|
- getDocumentStats
|
|
|
- } from '@/api/statisticalAnalysis/analysisTeachingActivities'
|
|
|
+import {
|
|
|
+ getCourseOptions,
|
|
|
+ getTeachingStats,
|
|
|
+ documentJumpStatistic,
|
|
|
+ getDiscussInteractionAnalyse,
|
|
|
+ getWeeklyStats,
|
|
|
+ getteachWeeklyStats,
|
|
|
+ getDailyVisits,
|
|
|
+ getDiscussionData,
|
|
|
+ getDocumentStats, getDocumentDetailStatistic
|
|
|
+} from '@/api/statisticalAnalysis/analysisTeachingActivities'
|
|
|
import tool from '@/utils/tool'
|
|
|
import dayjs from "dayjs";
|
|
|
// 课程选项
|
|
|
@@ -170,6 +172,15 @@ const times = ref([])
|
|
|
teacherAvgPostsPerDay: 0
|
|
|
})
|
|
|
|
|
|
+ const teachweeklyStats = reactive({
|
|
|
+ studentWeeklyPosts: 0,
|
|
|
+ studentWeeklyReplies: 0,
|
|
|
+ studentAvgPostsPerDay: 0,
|
|
|
+ teacherWeeklyPosts: 0,
|
|
|
+ teacherWeeklyReplies: 0,
|
|
|
+ teacherAvgPostsPerDay: 0
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
|
|
|
// 图表引用
|
|
|
@@ -180,28 +191,23 @@ const times = ref([])
|
|
|
const discussionColumns = [
|
|
|
{
|
|
|
title: '讨论主题',
|
|
|
- dataIndex: 'title',
|
|
|
- key: 'title'
|
|
|
+ dataIndex: 'postTitle',
|
|
|
+ key: 'postTitle'
|
|
|
},
|
|
|
{
|
|
|
- title: '发起人',
|
|
|
- dataIndex: 'author',
|
|
|
- key: 'author'
|
|
|
+ title: '回帖数',
|
|
|
+ dataIndex: 'postCount',
|
|
|
+ key: 'postCount'
|
|
|
},
|
|
|
{
|
|
|
title: '发起时间',
|
|
|
- dataIndex: 'createTime',
|
|
|
- key: 'createTime'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '回帖数',
|
|
|
- dataIndex: 'replyCount',
|
|
|
- key: 'replyCount'
|
|
|
+ dataIndex: 'postCreateTime',
|
|
|
+ key: 'postCreateTime'
|
|
|
},
|
|
|
{
|
|
|
title: '最后回复',
|
|
|
- dataIndex: 'lastReplyTime',
|
|
|
- key: 'lastReplyTime'
|
|
|
+ dataIndex: 'postLastReplyTime',
|
|
|
+ key: 'postLastReplyTime'
|
|
|
}
|
|
|
]
|
|
|
|
|
|
@@ -220,54 +226,59 @@ const times = ref([])
|
|
|
dataIndex: 'fileName',
|
|
|
key: 'fileName'
|
|
|
},
|
|
|
+ {
|
|
|
+ title: '所属课程',
|
|
|
+ dataIndex: 'courseHourName',
|
|
|
+ key: 'courseHourName'
|
|
|
+ },
|
|
|
{
|
|
|
title: '文档类型',
|
|
|
- dataIndex: 'extendName',
|
|
|
- key: 'extendName',
|
|
|
+ dataIndex: 'suffix',
|
|
|
+ key: 'suffix',
|
|
|
width: '100px'
|
|
|
},
|
|
|
{
|
|
|
title: '观看人数',
|
|
|
- dataIndex: 'seeNum',
|
|
|
- key: 'seeNum',
|
|
|
+ dataIndex: 'watchUserCount',
|
|
|
+ key: 'watchUserCount',
|
|
|
width: '100px'
|
|
|
},
|
|
|
{
|
|
|
title: '完成人数',
|
|
|
- dataIndex: 'finishNum',
|
|
|
- key: 'finishNum',
|
|
|
+ dataIndex: 'completeUserCount',
|
|
|
+ key: 'completeUserCount',
|
|
|
width: '100px'
|
|
|
},
|
|
|
{
|
|
|
title: '完成率',
|
|
|
- dataIndex: 'finishRate',
|
|
|
- key: 'finishRate',
|
|
|
+ dataIndex: 'completeRate',
|
|
|
+ key: 'completeRate',
|
|
|
customRender: ({ text }) => {
|
|
|
const rate = parseFloat(text)
|
|
|
const className = rate >= 70 ? 'completion-rate' : rate < 50 ? 'low-engagement' : ''
|
|
|
- return h('span', { class: className }, `${text}%`)
|
|
|
+ return h('span', { class: className }, `${tool.formatValue(text)}`)
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
title: '平均阅读时长',
|
|
|
- dataIndex: 'jumpAvgTime',
|
|
|
- key: 'jumpAvgTime',
|
|
|
+ dataIndex: 'readAvgTime',
|
|
|
+ key: 'readAvgTime',
|
|
|
width: '130px'
|
|
|
},
|
|
|
{
|
|
|
title: '跳出率',
|
|
|
- dataIndex: 'jumpRate',
|
|
|
- key: 'jumpRate',
|
|
|
+ dataIndex: 'jumpOutRate',
|
|
|
+ key: 'jumpOutRate',
|
|
|
customRender: ({ text }) => {
|
|
|
const rate = parseFloat(text)
|
|
|
const className = rate > 30 ? 'low-engagement' : ''
|
|
|
- return h('span', { class: className }, `${text}%`)
|
|
|
+ return h('span', { class: className }, `${tool.formatValue(text)}`)
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
title: '下载次数',
|
|
|
- dataIndex: 'downNum',
|
|
|
- key: 'downNum',
|
|
|
+ dataIndex: 'downloadCount',
|
|
|
+ key: 'downloadCount',
|
|
|
width: '100px'
|
|
|
}
|
|
|
]
|
|
|
@@ -444,8 +455,14 @@ const times = ref([])
|
|
|
startTime: filters.startTime,
|
|
|
endTime: filters.endTime,
|
|
|
})
|
|
|
+ const analyse = await getDiscussInteractionAnalyse({
|
|
|
+ courseId: filters.courseId,
|
|
|
+ startTime: filters.startTime,
|
|
|
+ endTime: filters.endTime,
|
|
|
+ })
|
|
|
|
|
|
- Object.assign(stats, response, statistic)
|
|
|
+ Object.assign(stats, response, statistic,analyse)
|
|
|
+ console.log('上面呢',stats)
|
|
|
} catch (error) {
|
|
|
console.error('获取统计数据失败:', error)
|
|
|
}
|
|
|
@@ -458,6 +475,11 @@ const times = ref([])
|
|
|
courseId: filters.courseId
|
|
|
})
|
|
|
Object.assign(weeklyStats, response)
|
|
|
+
|
|
|
+ const responseteach = await getteachWeeklyStats({
|
|
|
+ courseId: filters.courseId
|
|
|
+ })
|
|
|
+ Object.assign(teachweeklyStats, responseteach)
|
|
|
} catch (error) {
|
|
|
console.error('获取每周统计数据失败:', error)
|
|
|
}
|
|
|
@@ -480,14 +502,14 @@ const times = ref([])
|
|
|
// 获取讨论数据
|
|
|
const loadDiscussionData = async () => {
|
|
|
try {
|
|
|
- const response = await getDiscussionData({
|
|
|
+ const response = await getDocumentStats({
|
|
|
courseId: filters.courseId,
|
|
|
startTime: filters.startTime,
|
|
|
endTime: filters.endTime,
|
|
|
page: discussionPagination.current,
|
|
|
pageSize: discussionPagination.pageSize
|
|
|
})
|
|
|
- discussionData.value = response.list
|
|
|
+ discussionData.value = response.records
|
|
|
discussionPagination.total = response.total
|
|
|
} catch (error) {
|
|
|
console.error('获取讨论数据失败:', error)
|
|
|
@@ -497,15 +519,17 @@ const times = ref([])
|
|
|
// 获取文档数据
|
|
|
const loadDocumentData = async () => {
|
|
|
try {
|
|
|
- const response = await getDocumentStats({
|
|
|
+ const response = await getDocumentDetailStatistic({
|
|
|
courseId: filters.courseId,
|
|
|
- page: documentPagination.current,
|
|
|
- pageSize: documentPagination.pageSize,
|
|
|
+ current: documentPagination.current,
|
|
|
+ size: documentPagination.pageSize,
|
|
|
startTime: filters.startTime,
|
|
|
endTime: filters.endTime,
|
|
|
})
|
|
|
- documentData.value = response
|
|
|
+ documentData.value = response.records
|
|
|
documentPagination.total = response.total
|
|
|
+ documentPagination.pageSize = response.size
|
|
|
+ documentPagination.current = response.current
|
|
|
} catch (error) {
|
|
|
console.error('获取文档数据失败:', error)
|
|
|
}
|