zhouwx
2025-06-10 c8c99bf1f753e27c4d99a0ff6058ce16f973f9c4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<template>
  <div class="notice">
    <el-dialog
        v-model="dialogVisible"
        title="培训考试记录"
        width="50%"
        :before-close="handleClose"
        :close-on-press-escape="false"
        :close-on-click-modal="false"
    >
      <el-table v-loading="state.loading" :data="state.dataList" :border="true">
        <el-table-column label="序号" type="index" align="center" width="80" />
<!--        <el-table-column label="学生姓名" prop="stuName" align="center"  />-->
        <el-table-column label="培训名称" prop="name" align="center" >
          <template #default="scope">
            {{scope.row.trainType == 1 ? scope.row.name : ''}}
          </template>
        </el-table-column>
        <el-table-column label="考试名称" prop="name" align="center" >
          <template #default="scope">
            {{scope.row.trainType == 2 ? scope.row.name : ''}}
          </template>
        </el-table-column>
        <el-table-column label="所在公司" prop="companyName" align="center"/>
      </el-table>
    </el-dialog>
  </div>
</template>
<script setup>
import {reactive, ref, toRefs} from 'vue'
import {ElMessage} from "element-plus";
 
import {
  getClassification
} from "@/api/onlineEducation/courseClass";
import {addCourse, checkCourseName, editCourse, getCourseById} from "@/api/onlineEducation/courseManage";
import {getToken} from "@/utils/auth";
import {delPic, getBannerById} from "@/api/onlineEducation/banner";
import Cookies from "js-cookie";
import {addQuestionBank, checkQuestionBankName, editQuestionBank} from "@/api/onlineEducation/questionBank";
import {getStudent, getStuTrainRecord} from "@/api/onlineEducation/student";
 
const dialogVisible = ref(false);
const title = ref("");
const busRef = ref();
const length = ref()
const emit = defineEmits(["getList"]);
const state = reactive({
  loading: false,
  dataList: []
})
 
const openDialog = async (value) => {
  state.loading = true
  const param = {
    studentId: value.id
  }
  const res = await getStuTrainRecord(param)
  if(res.code == 200){
    state.dataList = res.data.map(item => {
      return{
        ...item,
        stuName: value.name
      }
    })
    state.loading = false
    console.log(state.dataList,'state.dataList')
  }else{
    ElMessage.warning(res.message)
  }
 
  dialogVisible.value = true;
}
 
const handleClose = () => {
  dialogVisible.value = false;
  emit("getList")
 
}
 
defineExpose({
  openDialog
});
 
</script>
 
<style scoped lang="scss">
.notice{
  :deep(.el-form .el-form-item__label) {
    font-size: 15px;
  }
  .file {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
}
</style>