zhouwx
2025-01-06 c3bb35b20d6e076f73a1cad50fd6b9b94ca399a7
src/views/onlineEducation/learnRecord/index.vue
@@ -1,15 +1,24 @@
<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="platformName" />
      <el-table-column label="所属培训机构" align="center" prop="trainingInstitution" />
      <el-table-column label="班级批次" align="center" prop="classBatch" />
      <el-table-column label="课程" align="center" prop="course" />
      <el-table-column label="章节" align="center" prop="chapter" />
      <el-table-column label="学习时长" align="center" prop="learningTime" />
      <el-table-column label="是否彻底完成" align="center" prop="isComplete" />
      <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="操作" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-button
@@ -24,7 +33,7 @@
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageIndex"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
@@ -34,12 +43,15 @@
<script>
import detailDialog from './components/detailDialog.vue'
import { listRecord, listStudent } from '@/api/onlineEducation/student'
import Cookies from 'js-cookie'
export default {
  name: "nPeopleManage",
  dicts: [],
  components: { detailDialog},
  data() {
    return {
      loading: false,
      single: true,
      multiple: true,
@@ -49,44 +61,34 @@
      expertTypes: [],
      expertList: [],
      queryParams: {
        pageIndex: 1,
        pageSize: 10
        pageNum: 1,
        pageSize: 10,
        status: 0,
      },
    };
  },
  created() {
    this.getList();
      this.getList();
  },
  methods: {
    getList(){
      this.loading = true;
      this.expertList = [
        {
          id: '2024060600001',
          idCard: '321154874512225541',
          platformName:'测试数据1',
          trainingInstitution:'测试机构1',
          classBatch: '批次1',
          course:'测试课程1',
          chapter:'测试章节1',
          learningTime:'2h',
          isComplete: '是'
        },
        {
          id: '2024060600002',
          idCard: '321154874512441141',
          platformName:'测试数据2',
          trainingInstitution:'测试机构2',
          classBatch: '批次2',
          course:'测试课程2',
          chapter:'测试章节2',
          learningTime:'2h',
          isComplete: '否'
        },
      ]
      this.total = 2
      this.loading = false;
      listRecord( this.queryParams).then((res) => {
        if (res.code == 200) {
          this.expertList = res.rows
          this.total = res.total
          this.loading = false;
        }
      })
    },
    changeTimeStatus(val) {
      this.getList()
    },
    tableAddClass({ row, rowIndex }) {
      if (row.difference < row.duration) {
        return "tr-red";
      }
      return "";
    },
    handleChange(){
@@ -103,3 +105,9 @@
  }
};
</script>
<style scoped>
.app-container /deep/ .el-table .tr-red {
  color: red !important;
}
</style>