|
@@ -74,7 +74,8 @@
|
|
|
<div class="table-wrapper">
|
|
|
<el-table v-loading="loading" :data="list" border height="calc(100vh - 450px)">
|
|
|
<el-table-column type="index" label="序号" width="50" align="center" fixed/>
|
|
|
- <el-table-column prop="title" label="课程名称" align="center" min-width="150" fixed/>
|
|
|
+ <el-table-column prop="title" label="课程名称" align="center" min-width="250" fixed/>
|
|
|
+ <el-table-column prop="dayDate" label="营期日期" align="center" min-width="120" fixed/>
|
|
|
<el-table-column prop="countDetailsVO.courseWatchTimes" label="观看次数" align="center" min-width="100"/>
|
|
|
<el-table-column prop="countDetailsVO.courseCompleteTimes" label="完播次数" align="center" min-width="100"/>
|
|
|
<el-table-column prop="countDetailsVO.courseWatchNum" label="观看人数" align="center" min-width="100"/>
|
|
@@ -214,10 +215,10 @@ export default {
|
|
|
// 设置列表数据
|
|
|
this.list = response.rows;
|
|
|
this.total = response.total || 0;
|
|
|
-
|
|
|
+
|
|
|
// 计算总统计数据
|
|
|
this.calculateTotalStatistics();
|
|
|
-
|
|
|
+
|
|
|
console.log('列表数据:', this.list);
|
|
|
} else {
|
|
|
this.$message.error(response.msg || '获取数据失败');
|
|
@@ -241,16 +242,16 @@ export default {
|
|
|
answerRightTimes: 0,
|
|
|
redPacketAmount: 0
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
// 如果没有数据,直接返回
|
|
|
if (!this.list || this.list.length === 0) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 遍历列表数据,累加各项统计数据
|
|
|
this.list.forEach(item => {
|
|
|
const details = item.countDetailsVO || {};
|
|
|
-
|
|
|
+
|
|
|
// 累加各项数据
|
|
|
this.statistics.courseCompleteNum += details.courseCompleteNum || 0;
|
|
|
this.statistics.courseWatchNum += details.courseWatchNum || 0;
|
|
@@ -259,7 +260,7 @@ export default {
|
|
|
this.statistics.answerRightTimes += details.answerRightNum || 0;
|
|
|
this.statistics.redPacketAmount += details.redPacketAmount || 0;
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
// 计算完播率
|
|
|
if (this.statistics.courseWatchNum > 0) {
|
|
|
const rate = (this.statistics.courseCompleteNum / this.statistics.courseWatchNum * 100).toFixed(2);
|