From db7b0541b3fbecaeda7b44129b7af3215296ec6d Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Wed, 06 Nov 2024 13:55:27 +0800
Subject: [PATCH] 修改
---
src/views/onlineEducation/studentSupervision/compontents/learningRecord.vue | 163 ++++++++++-----------------
src/views/onlineEducation/studentSupervision/compontents/examlRecord.vue | 91 +++++++++++++++
src/views/onlineEducation/studentSupervision/index.vue | 13 +-
src/views/onlineEducation/learnRecord/components/detailDialog.vue | 31 +++++
src/views/onlineEducation/learnRecord/index.vue | 40 ++++--
src/components/Pagination/index.vue | 2
6 files changed, 214 insertions(+), 126 deletions(-)
diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue
index 56f5a6b..d839f90 100644
--- a/src/components/Pagination/index.vue
+++ b/src/components/Pagination/index.vue
@@ -36,7 +36,7 @@
pageSizes: {
type: Array,
default() {
- return [10, 20, 30, 50]
+ return [ 10, 20, 30, 50]
}
},
// 移动端页码按钮的数量端默认值5
diff --git a/src/views/onlineEducation/learnRecord/components/detailDialog.vue b/src/views/onlineEducation/learnRecord/components/detailDialog.vue
index 7e800f3..479aeac 100644
--- a/src/views/onlineEducation/learnRecord/components/detailDialog.vue
+++ b/src/views/onlineEducation/learnRecord/components/detailDialog.vue
@@ -58,6 +58,11 @@
label="结束位置"
prop="finishPositionDesc" align="center">
</el-table-column>
+ <el-table-column
+ label="自然时间差"
+ prop="differenceDesc" align="center">
+ </el-table-column>
+
</el-table>
<div style="margin: 30px 20px ">
<span style="font-size: 20px;font-weight: 550">认证纪录集合</span>
@@ -157,13 +162,37 @@
startTime: data.startTime,
finishTime: data.finishTime,
finishPositionDesc: data.finishPositionDesc,
- startPositionDesc: data.startPositionDesc
+ startPositionDesc: data.startPositionDesc,
+ differenceDesc: data.differenceDesc
})
+ // this.tableData.forEach(item => {
+ // item.timeDiff = this.getTimeDifferenceInSeconds(item.startTime,item.finishTime)
+ // })
this.trackList = data.trackList
this.authList = data.authList
},
+ getTimeDifferenceInSeconds(dateStr1, dateStr2) {
+ const date1 = new Date(dateStr1);
+ const date2 = new Date(dateStr2);
+ const timeDiff = Math.abs(date2 - date1); // 计算时间差
+
+ const seconds = Math.floor(timeDiff / 1000)
+ const hour = Math.floor(seconds / 3600)
+ const hours = hour ==0 ? '' : hour>=10 ? hour: '0' + hour
+ const minute = Math.floor((seconds % 3600) / 60);
+ const minutes = minute == 0 ? '' : minute>= 10 ? minute: '0' + minute
+ const sec = seconds % 60;
+ const secs = sec == 0 ? '' : sec >= 10 ? sec: '0' + sec
+
+ return [
+ hours ? hours + '时' : '',
+ minutes ? minutes + '分' : '',
+ secs + '秒'
+ ].filter(Boolean);
+
+ },
handleClose() {
this.tableData = [];
this.dataForm = {}
diff --git a/src/views/onlineEducation/learnRecord/index.vue b/src/views/onlineEducation/learnRecord/index.vue
index 2280bc9..23d7d25 100644
--- a/src/views/onlineEducation/learnRecord/index.vue
+++ b/src/views/onlineEducation/learnRecord/index.vue
@@ -1,6 +1,11 @@
<template>
<div class="app-container">
- <el-table v-loading="loading" :data="expertList">
+ <el-radio-group v-model="queryParams.status" style="margin-bottom: 10px;" @change="changeTimeStatus">
+ <el-radio-button label="0">全部</el-radio-button>
+ <el-radio-button label="2">异常记录</el-radio-button>
+ <el-radio-button label="1">正常记录</el-radio-button>
+ </el-radio-group>
+ <el-table v-loading="loading" :data="expertList" :row-class-name="tableAddClass">
<el-table-column label="记录编号" align="center" prop="id" />
<el-table-column label="身份证号" align="center" prop="idcard" :show-overflow-tooltip="true" />
<el-table-column label="上报平台" align="center" prop="institutionName" />
@@ -46,6 +51,7 @@
components: { detailDialog},
data() {
return {
+
loading: false,
single: true,
multiple: true,
@@ -56,25 +62,16 @@
expertList: [],
queryParams: {
pageNum: 1,
- pageSize: 10
+ pageSize: 10,
+ status: 0,
},
};
},
created() {
- if(Cookies.get('learnRecord')){
-
- }else{
- this.getList({});
- }
-
+ this.getList();
},
methods: {
- getList(data){
- console.log('data',data)
- if(data){
- this.queryParams.idcard = data.idcard
- this.expertList = []
- }
+ getList(){
this.loading = true;
listRecord( this.queryParams).then((res) => {
if (res.code == 200) {
@@ -83,6 +80,15 @@
this.loading = false;
}
})
+ },
+ changeTimeStatus(val) {
+ this.getList()
+ },
+ tableAddClass({ row, rowIndex }) {
+ if (row.difference < row.duration) {
+ return "tr-red";
+ }
+ return "";
},
handleChange(){
@@ -99,3 +105,9 @@
}
};
</script>
+
+<style scoped>
+.app-container /deep/ .el-table .tr-red {
+ color: red !important;
+}
+</style>
diff --git a/src/views/onlineEducation/studentSupervision/compontents/examlRecord.vue b/src/views/onlineEducation/studentSupervision/compontents/examlRecord.vue
new file mode 100644
index 0000000..7b0597c
--- /dev/null
+++ b/src/views/onlineEducation/studentSupervision/compontents/examlRecord.vue
@@ -0,0 +1,91 @@
+<template>
+ <div class="app-container">
+ <el-table v-loading="loading" :data="expertList">
+ <el-table-column label="记录ID" align="center" prop="id" />
+ <el-table-column label="姓名" align="center" prop="name" />
+ <el-table-column label="身份证号" align="center" prop="idcard" :show-overflow-tooltip="true" />
+ <el-table-column label="上报平台" align="center" prop="institutionName" />
+ <el-table-column label="所属培训机构" align="center" prop="trainOrgName" />
+ <el-table-column label="班级批次" align="center" prop="batchName" />
+ <!-- <el-table-column label="课程名称" align="center" prop="courseName" />-->
+ <el-table-column label="考试名称" align="center" prop="examName" />
+ <el-table-column label="开考时间" align="center" prop="examStartTime" width="100" />
+ <el-table-column label="结束时间" align="center" prop="examSubmitTime" width="100"/>
+ <el-table-column label="学员成绩" align="center" prop="examUserScore" />
+ <el-table-column label="试卷总分" align="center" prop="examTotalScore" />
+ <el-table-column label="合格分数" align="center" prop="examPassScore" />
+ <el-table-column label="是否通过" align="center" prop="examIsPass" >
+ <template #default="scope">
+ <span>{{scope.row.examIsPass == 1 ? '是' : '否'}}</span>
+ </template>
+ </el-table-column>
+ <!-- <el-table-column label="考试次数" align="center" prop="examNum" />-->
+ </el-table>
+ <pagination
+ v-show="total>0"
+ :total="total"
+ :page.sync="queryParams.pageNum"
+ :limit.sync="queryParams.pageSize"
+ @pagination="getList"
+ />
+ </div>
+</template>
+
+<script>
+import { listExam, listStudent } from '@/api/onlineEducation/student'
+import Cookies from 'js-cookie'
+
+export default {
+ name: "nPeopleManage",
+ dicts: [],
+ components: {},
+ data() {
+ return {
+ loading: false,
+ single: true,
+ multiple: true,
+ showSearch: true,
+ addForm: false,
+ total: 0,
+ expertTypes: [],
+ expertList: [],
+ queryParams: {
+ pageNum: 1,
+ pageSize: 10,
+ name: '',
+ idcard: ''
+ },
+ };
+ },
+ created() {
+ },
+ methods: {
+ getList(data){
+ if(data && data.idcard){
+ this.queryParams.idcard = data.idcard
+ this.expertList = []
+ }
+ this.loading = true;
+ listExam( this.queryParams).then((res) => {
+ if (res.code == 200) {
+ this.expertList = res.rows
+ this.total = res.total
+ this.loading = false;
+ }
+ })
+ },
+ handleChange(){
+
+ },
+ handleQuery(){
+
+ },
+ resetQuery(){
+
+ },
+ handleView(){
+
+ }
+ }
+};
+</script>
diff --git a/src/views/onlineEducation/studentSupervision/compontents/learningRecord.vue b/src/views/onlineEducation/studentSupervision/compontents/learningRecord.vue
index 3a9bed9..8d17f9e 100644
--- a/src/views/onlineEducation/studentSupervision/compontents/learningRecord.vue
+++ b/src/views/onlineEducation/studentSupervision/compontents/learningRecord.vue
@@ -1,138 +1,95 @@
<template>
- <el-dialog
- title="学习记录"
- :visible.sync="dialogVisible"
- :modal-append-to-body="false"
- :close-on-click-modal="false"
- width="50%"
- :before-close="handleClose"
- append-to-body
- >
- <el-table
- :data="learningTable"
- style="width: 100%;">
- <el-table-column
- prop="startTime"
- label="开始时间"
- width="160"
- >
+ <div class="app-container">
+ <el-table v-loading="loading" :data="expertList">
+ <el-table-column label="记录编号" align="center" prop="id" />
+ <el-table-column label="身份证号" align="center" prop="idcard" :show-overflow-tooltip="true" />
+ <el-table-column label="上报平台" align="center" prop="institutionName" />
+ <el-table-column label="所属培训机构" align="center" prop="trainOrgName" />
+ <el-table-column label="班级批次" align="center" prop="batchName" />
+ <el-table-column label="课程" align="center" prop="courseName" />
+ <el-table-column label="章节" align="center" prop="chapterName" />
+ <el-table-column label="学习时长" align="center" prop="durationDesc" />
+ <el-table-column label="是否彻底完成" align="center" prop="finishStatus" >
+ <template #default="scope">
+ {{scope.row.finishStatus == 0 ? '未完成' : '已完成' }}
+ </template>
</el-table-column>
- <el-table-column
- label="结束时间"
- prop="endTime"
- width="160">
- </el-table-column>
- <el-table-column
- prop="trainingInstitutions"
- label="培训机构"
- >
- </el-table-column>
- <el-table-column
- prop="platform"
- label="线上平台"
- >
- </el-table-column>
- <el-table-column
- prop="courseName"
- label="课程名称"
- >
- </el-table-column>
- <el-table-column
- prop="courseTime"
- label="课程时长"
- >
- </el-table-column>
- <el-table-column
- prop="learningTime"
- label="学习时长"
- >
- </el-table-column>
- <el-table-column
- prop="isComplete"
- label="是否已完成"
- >
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+ <template #default="scope">
+ <el-button
+ size="mini"
+ type="text"
+ style="color: #1890ff"
+ @click="handleView(scope.row)"
+ >查看详细记录</el-button>
+ </template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
- :page.sync="queryParams.pageIndex"
+ :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
- </el-dialog>
+ <detail-dialog ref="detailDialogRef" @getList = "getList"></detail-dialog>
+ </div>
</template>
-<script >
+<script>
+import detailDialog from '../../learnRecord/components/detailDialog.vue'
import { listRecord, listStudent } from '@/api/onlineEducation/student'
-
+import Cookies from 'js-cookie'
export default {
- name: 'addUser',
- components: {
- },
+ name: "nPeopleManage",
+ dicts: [],
+ components: { detailDialog},
data() {
return {
- dialogVisible: false,
- dialogStatus: '',
- dataForm: {},
- total: 2,
+ loading: false,
+ single: true,
+ multiple: true,
+ showSearch: true,
+ addForm: false,
+ total: 0,
+ expertTypes: [],
+ expertList: [],
queryParams: {
- pageIndex: 1,
+ pageNum: 1,
pageSize: 10,
- idcard: '',
- name: ''
+ idcard: null
},
- learningTable: [
- {
- startTime: '2024-6-11 10:33:00',
- endTime: '2024-6-11 12:33:00',
- trainingInstitutions: 'xxx',
- platform: 'xxx',
- courseName: '课程1',
- courseTime: '2h',
- learningTime: '1h',
- isComplete: '否'
- },
- {
- startTime: '2024-6-11 10:33:00',
- endTime: '2024-6-11 12:33:00',
- trainingInstitutions: 'xxx',
- platform: 'xxx',
- courseName: '课程1',
- courseTime: '2h',
- learningTime: '1h',
- isComplete: '否'
- }
- ]
- }
+ };
},
created() {
},
methods: {
- getList(){
+ getList(data){
+ if(data && data.idcard){
+ this.queryParams.idcard = data.idcard
+ this.expertList = []
+ }
this.loading = true;
listRecord( this.queryParams).then((res) => {
if (res.code == 200) {
- this.learningTable = res.rows
+ this.expertList = res.rows
this.total = res.total
this.loading = false;
}
})
},
- openDialog (data) {
- this.dialogVisible = true;
- this.queryParams.idcard = data.idcard
- this.getList();
- },
+ handleChange(){
- handleClose() {
- this.dialogVisible = false;
- this.$emit("getList");
},
+ handleQuery(){
+
+ },
+ resetQuery(){
+
+ },
+ handleView(data){
+ this.$refs.detailDialogRef.openDialog(data);
+ }
}
-}
-
+};
</script>
-<style scoped>
-
-</style>
diff --git a/src/views/onlineEducation/studentSupervision/index.vue b/src/views/onlineEducation/studentSupervision/index.vue
index 00eff9d..555b8da 100644
--- a/src/views/onlineEducation/studentSupervision/index.vue
+++ b/src/views/onlineEducation/studentSupervision/index.vue
@@ -72,7 +72,7 @@
width="900px"
append-to-body
:before-close="handleCloseLearning">
- <learning-record ref="learnRef" ></learning-record>
+ <learning ref="learnRef" ></learning>
</el-dialog>
<el-dialog
title="考试记录"
@@ -81,15 +81,15 @@
:close-on-click-modal="false"
width="900px"
:before-close="handleClose">
- <exam-manage ref="examRef" ></exam-manage>
+ <examRecord ref="examRef" ></examRecord>
</el-dialog>
</div>
</template>
<script>
-import examManage from '@/views/onlineEducation/examManage/index.vue'
-import learningRecord from '@/views/onlineEducation/learnRecord/index.vue'
+import examRecord from '../studentSupervision/compontents/examlRecord.vue'
+import learning from '../studentSupervision/compontents/learningRecord.vue'
import { listStudent } from '@/api/onlineEducation/student'
import noPic from '@/assets/images/none.png'
import Cookies from 'js-cookie'
@@ -97,7 +97,7 @@
export default {
name: "nPeopleManage",
dicts: [],
- components: {learningRecord,examManage},
+ components: {learning,examRecord},
data() {
return {
loading: false,
@@ -130,8 +130,7 @@
this.expertList = res.rows.map(item => {
return {
...item,
- authPhoto: item.authPhoto !='-' ? item.authPhoto : noPic
-
+ authPhoto: item.authPhoto !='-' ? item.authPhoto : noPic,
}
})
this.total = res.total
--
Gitblit v1.9.2