|
|
@@ -50,7 +50,24 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
- <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange" show-summary>
|
|
|
+ <el-table v-if="'济南联志健康' == this.signProjectName" border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange" show-summary :summary-method="getSummaries">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
|
|
|
+ <el-table-column label="发课时间" align="center" prop="createTime"/>
|
|
|
+ <el-table-column label="课程名称" align="center" prop="courseName" />
|
|
|
+ <el-table-column label="小节名称" align="center" prop="videoName" />
|
|
|
+ <el-table-column label="待看课" align="center" prop="type3" />
|
|
|
+ <el-table-column label="看课中" align="center" prop="type1" />
|
|
|
+ <el-table-column label="已完课" align="center" prop="type2" />
|
|
|
+ <el-table-column label="看课中断" align="center" prop="type4" />
|
|
|
+ <el-table-column label="注册用户待看课数" align="center" prop="isUserWaitNumber" />
|
|
|
+ <el-table-column label="未注册用户待看课数" align="center" prop="noUserWaitNumber" />
|
|
|
+ <el-table-column label="上线率" align="center" prop="onLineRate" />
|
|
|
+ <el-table-column label="完课率" align="center" prop="finishedRate" />
|
|
|
+ <el-table-column label="消耗红包金额" align="center" prop="redAmount" />
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <el-table v-else border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange" show-summary>
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
<el-table-column label="企微员工名称" align="center" prop="qwUserName" />
|
|
|
<el-table-column label="发课时间" align="center" prop="createTime"/>
|
|
|
@@ -79,13 +96,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog,statisticsList } from "@/api/course/qw/courseWatchLog";
|
|
|
+import { listCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog,statisticsList,getSignProjectName } from "@/api/course/qw/courseWatchLog";
|
|
|
import { courseList,videoList } from '@/api/course/courseRedPacketLog'
|
|
|
import {getCompanyList} from "@/api/company/company";
|
|
|
export default {
|
|
|
name: "CourseWatchLog",
|
|
|
data() {
|
|
|
return {
|
|
|
+ signProjectName:"",
|
|
|
companys:[],
|
|
|
activeName:"00",
|
|
|
createTime:null,
|
|
|
@@ -140,6 +158,11 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
+ getSignProjectName().then(res=>{
|
|
|
+ this.signProjectName = res.signProjectName;
|
|
|
+ console.log(this.signProjectName);
|
|
|
+ }).catch(res=>{});
|
|
|
+
|
|
|
getCompanyList().then(response => {
|
|
|
this.companys = response.data;
|
|
|
if(this.companys!=null&&this.companys.length>0){
|
|
|
@@ -156,6 +179,37 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ getSummaries(param) {
|
|
|
+ const { columns, data } = param;
|
|
|
+ const sums = [];
|
|
|
+ // 关键改动:创建一个不包含最后一行的新数据数组
|
|
|
+ // 如果数据长度大于1,则截取掉最后一行;否则,使用空数组避免错误
|
|
|
+ const dataToSum = data.length > 1 ? data.slice(0, -1) : [];
|
|
|
+ columns.forEach((column, index) => {
|
|
|
+
|
|
|
+ if (index === 0) {
|
|
|
+ sums[index] = '页总计';
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const values = dataToSum.map(item => Number(item[column.property]));
|
|
|
+
|
|
|
+ if (!values.every(value => isNaN(value))) {
|
|
|
+ sums[index] = values.reduce((prev, curr) => {
|
|
|
+ const value = Number(curr);
|
|
|
+ if (!isNaN(value)) {
|
|
|
+ return prev + curr;
|
|
|
+ } else {
|
|
|
+ return prev;
|
|
|
+ }
|
|
|
+ }, 0);
|
|
|
+ sums[index] += ' ';
|
|
|
+ } else {
|
|
|
+ sums[index] = 'N/A';
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return sums;
|
|
|
+ },
|
|
|
courseChange(row){
|
|
|
this.queryParams.videoId=null;
|
|
|
if(row === ''){
|