zhouwx
2024-07-18 026b72ee0218e9cf93c2ba2d4f944e7a7d3b56ae
bug修改
已修改8个文件
已添加2个文件
440 ■■■■ 文件已修改
src/api/onlineEducation/student.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/onlineEducation/count/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/onlineEducation/courseManage/courseResource/componets/viewVideo.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/onlineEducation/courseManage/index.vue 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/onlineEducation/groupExams/components/examDialog.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/onlineEducation/groupExams/components/viewExamQuestion.vue 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/onlineEducation/groupExams/index.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/onlineEducation/people/components/stuDialog.vue 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/onlineEducation/people/components/trainRecord.vue 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/onlineEducation/people/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/onlineEducation/student.js
@@ -65,3 +65,20 @@
    })
}
export function changeCompany(data) {
    return request({
        url: '/student/changeStudentCompany',
        method: 'post',
        data: data
    })
}
export function getStuTrainRecord(param) {
    return request({
        url: '/student/trainRecord',
        method: 'get',
        params: param
    })
}
src/views/onlineEducation/count/index.vue
@@ -34,7 +34,7 @@
          <el-radio-group v-model="state.queryParams.type">
            <el-radio :label="1">线上教育</el-radio>
            <el-radio :label="2">线下教育</el-radio>
            <el-radio :label="null">全部</el-radio>
<!--            <el-radio :label="null">全部</el-radio>-->
          </el-radio-group>
        </el-form-item>
        <el-form-item>
src/views/onlineEducation/courseManage/courseResource/componets/viewVideo.vue
@@ -9,8 +9,8 @@
        :close-on-press-escape="false"
        :close-on-click-modal="false"
    >
      <div style="text-align: center">
        <video v-if="showVideo" ref="videoPlayer" class="video-js" style="margin: auto auto"></video>
      <div style="text-align: center" v-if="showVideo">
        <video  ref="videoPlayer" class="video-js" style="margin: auto auto"></video>
      </div>
    </el-dialog>
  </div>
@@ -81,9 +81,13 @@
  getVideo();
}
const handleClose = () => {
  // if(myPlayer.value){
  //   myPlayer.value.dispose();
  //   resourcePath.value = ''
  // }
  showVideo.value = false;
  resourcePath.value = '';
  dialogVisible.value = false;
  emit("getList")
src/views/onlineEducation/courseManage/index.vue
@@ -66,8 +66,8 @@
        <template #default="scope">
          <div v-if="data.isAdmin">
            <div v-if="scope.row.state !== 3">
              <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button>
              <el-button link type="primary" v-if="scope.row.state == 1" @click="openApprove(scope.row)">审核</el-button>
              <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button>
              <el-button link type="primary" @click="toChapters(scope.row)">章节</el-button>
              <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
            </div>
@@ -76,10 +76,10 @@
          <div v-else-if="!data.isAdmin">
            <div v-if="scope.row.state !== 2">
              <el-button link type="primary" v-if="scope.row.state == 0 || scope.row.state == 3" @click="submitApprove(scope.row)">提交审核</el-button>
              <el-button link type="primary" v-if="scope.row.state == 1" @click="submitApprove(scope.row)">取消审批</el-button>
              <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button>
              <el-button link type="primary" @click="toChapters(scope.row)">章节</el-button>
              <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
              <el-button link type="primary" v-if="scope.row.state == 1" @click="submitApprove(scope.row)">取消审核</el-button>
              <el-button link type="primary" v-if="scope.row.state !== 1" @click="openDialog('edit',scope.row)" >编辑</el-button>
              <el-button link type="primary" v-if="scope.row.state !== 1" @click="toChapters(scope.row)">章节</el-button>
              <el-button link type="danger" v-if="scope.row.state !== 1" @click="handleDelete(scope.row)">删除</el-button>
            </div>
            <div v-else>--</div>
@@ -269,6 +269,7 @@
}
const submitApprove = async (val) => {
  let param = {
    companyId: val.companyId,
    id: val.id,
    state: null
  }
src/views/onlineEducation/groupExams/components/examDialog.vue
@@ -65,7 +65,7 @@
            <el-radio :label="2" style="max-width: 30px">顺序</el-radio>
          </el-radio-group >
            <el-radio-group v-model="state.form.singleRebuild" style="margin-left: 30px" >
              <el-radio :label="3" v-if="title === '编辑'" style="max-width: 30px">重新出题</el-radio>
              <el-radio :label="1" v-if="title === '编辑'" style="max-width: 30px">重新出题</el-radio>
            </el-radio-group>
          </div>
        </div>
@@ -106,7 +106,7 @@
              <el-radio :label="2" style="max-width: 30px">顺序</el-radio>
            </el-radio-group>
            <el-radio-group v-model="state.form.multiRebuild" style="margin-left: 30px" >
              <el-radio :label="3" v-if="title === '编辑'" style="max-width: 30px">重新出题</el-radio>
              <el-radio :label="1" v-if="title === '编辑'" style="max-width: 30px">重新出题</el-radio>
            </el-radio-group>
          </div>
        </div>
@@ -147,7 +147,7 @@
              <el-radio :label="2" style="max-width: 30px">顺序</el-radio>
            </el-radio-group>
            <el-radio-group v-model="state.form.judgeRebuild" style="margin-left: 30px" >
              <el-radio :label="3" v-if="title === '编辑'" style="max-width: 30px">重新出题</el-radio>
              <el-radio :label="1" v-if="title === '编辑'" style="max-width: 30px">重新出题</el-radio>
            </el-radio-group>
          </div>
        </div>
@@ -162,15 +162,28 @@
            <el-input v-model="state.form.limitTime" style="max-width: 200px"  :disabled="state.form.limited === 0">
              <template #append>分钟</template>
            </el-input>
          </el-form-item>
        </div>
        <div style="display: flex;justify-content: space-between;align-items: center">
        <el-form-item label="是否限制考试时长:" prop="limited" style="margin-left: 60px">
          <el-radio-group v-model="state.form.limited" @change="changeLimit" >
            <el-radio :label="0" style="max-width: 30px">否</el-radio>
            <el-radio :label="1">是</el-radio>
          </el-radio-group>
        </el-form-item>
          <el-form-item label="考试截止时间:" prop="deadline" style="margin-left: 60px">
            <el-date-picker
                v-model="state.form.deadline"
                type="date"
                placeholder="请选择截止时间"
                format="YYYY-MM-DD"
                value-format="YYYY-MM-DD 23:59:59"
            />
          </el-form-item>
        </div>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
@@ -260,9 +273,10 @@
    limited: 1,
    limitTime: null,
    passScore: null,
    judgeRebuild: null,
    multiRebuild: null,
    singleRebuild: null,
    judgeRebuild: 0,
    multiRebuild: 0,
    singleRebuild: 0,
    deadline: ''
  },
  formRules: {
@@ -270,7 +284,8 @@
    categoryId: [{required: true, message: '请选择课程分类', trigger: 'blur'}],
    limited: [{required: true, message: '请选择课程分类', trigger: 'blur'}],
    limitTime: [{required: true, message: '请选择课程分类', trigger: 'blur'}],
    passScore: [{required: true, message: '请选择课程分类', trigger: 'blur'}]
    passScore: [{required: true, message: '请选择课程分类', trigger: 'blur'}],
    deadline: [{required: true, message: '请选择考试截止时间', trigger: 'blur'}]
  },
  classifyList: [],
  isAdmin: false,
@@ -417,9 +432,10 @@
    limited: 0,
    limitTime: null,
    passScore: null,
    judgeRebuild: null,
    multiRebuild: null,
    singleRebuild: null,
    judgeRebuild: 0,
    multiRebuild: 0,
    singleRebuild: 0,
    deadline: ''
  }
}
const handleScroll = () => {
src/views/onlineEducation/groupExams/components/viewExamQuestion.vue
对比新文件
@@ -0,0 +1,174 @@
<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-card style="height: 500px;overflow: scroll">
        <div style="display: flex;flex-direction: column;margin: 0 30px" >
          <div v-if="state.singleList && state.singleList.length >0">
            <span style="font-size: 18px;font-weight: 600">单选题</span>
            <div v-for="(item,index) in state.singleList" :key="index" style="margin-left: 15px;margin-top: 10px">
              <div style="display: flex;flex-direction: column;">
                <div style="margin-top: 10px;display: flex">
                  <span style="font-size: 15px">题目{{index+1}}:</span>
                  <span style="margin-left: 10px;font-size: 16px">{{item.title}}</span>
                </div>
                <div style="display: flex;margin-left: 10%;margin-top: 15px">
                  <div v-for="single in item.content.items">
                    <span style="font-size: 15px;margin-right: 5px">{{single.prefix}}</span>
                    <span style="font-size: 15px;margin-right: 20px">{{single.content}}</span>
                  </div>
                </div>
                <el-divider />
              </div>
            </div>
          </div>
        </div>
        <div style="display: flex;flex-direction: column;margin: 30px 30px" >
          <div v-if="state.multiList && state.multiList.length >0">
            <span style="font-size: 18px;font-weight: 600">多选题</span>
            <div v-for="(item,index) in state.multiList" :key="index" style="margin-left: 15px;margin-top: 10px">
              <div style="display: flex;flex-direction: column;">
                <div style="margin-top: 10px;display: flex">
                  <span style="font-size: 15px">题目{{index+1}}:</span>
                  <span style="margin-left: 10px;font-size: 16px">{{item.title}}</span>
                </div>
                <div style="display: flex;margin-left: 10%;margin-top: 15px">
                  <div v-for="single in item.content.items">
                    <span style="font-size: 15px;margin-right: 5px">{{single.prefix}}</span>
                    <span style="font-size: 15px;margin-right: 20px">{{single.content}}</span>
                  </div>
                </div>
                <el-divider />
              </div>
            </div>
          </div>
        </div>
        <div style="display: flex;flex-direction: column;margin: 0 30px" >
          <div v-if="state.judgeList && state.judgeList.length >0">
            <span style="font-size: 18px;font-weight: 600">判断题</span>
            <div v-for="(item,index) in state.judgeList" :key="index" style="margin-left: 15px;margin-top: 10px">
              <div style="display: flex;flex-direction: column;">
                <div style="margin-top: 10px;display: flex">
                  <span style="font-size: 15px">题目{{index+1}}:</span>
                  <span style="margin-left: 10px;font-size: 16px">{{item.title}}</span>
                </div>
                <div style="display: flex;margin-left: 10%;margin-top: 15px">
                  <div v-for="single in item.content.items">
                    <span style="font-size: 15px;margin-right: 5px">{{single.prefix}}</span>
                    <span style="font-size: 15px;margin-right: 20px">{{single.content}}</span>
                  </div>
                </div>
                <el-divider />
              </div>
            </div>
          </div>
        </div>
      </el-card>
    </el-dialog>
  </div>
</template>
<script setup>
import {reactive, ref, toRefs} from 'vue'
import {ElMessage} from "element-plus";
const dialogVisible = ref(false);
const title = ref("");
const busRef = ref();
const length = ref()
const emit = defineEmits(["getList"]);
const startUsername = ref('');
const state = reactive({
  form: {
    id: '',
    name: '',
    categoryId: null,
    companyName: '',
    companyId: null
  },
  questionList: [],
  singleList:[],
  judgeList: [],
  multiList:[]
})
const openDialog = async (value) => {
console.log('111',value)
  dialogVisible.value = true;
  let result = value.questions.reduce((a, b) => {
    if (a[b.questionType]) {
      a[b.questionType].push(b);
    } else {
      a[b.questionType] = [b];
    }
    return a;
  }, {});
  for (const resultKey in result) {
    if(resultKey == 1){
      state.singleList.push(result[resultKey])
    }else if(resultKey == 2){
      state.multiList.push(result[resultKey])
    }else {
      state.judgeList.push(result[resultKey])
    }
  }
  state.singleList = JSON.parse(JSON.stringify(state.singleList[0])).map(item => {
    return {
      ...item,
      content: JSON.parse(item.content)
    }
  })
  state.judgeList = JSON.parse(JSON.stringify(state.judgeList[0])).map(item => {
    return {
      ...item,
      content: JSON.parse(item.content)
    }
  })
  state.multiList = JSON.parse(JSON.stringify(state.multiList[0])).map(item => {
    return {
      ...item,
      content: JSON.parse(item.content)
    }
  })
  console.log('state.singleList',state.singleList)
}
const handleClose = () => {
  state.singleList = [];
  state.multiList = [];
  state.judgeList = [];
  dialogVisible.value = false;
  emit("getList")
}
const reset = () => {
}
defineExpose({
  openDialog
});
</script>
<style scoped lang="scss">
.notice{
  :deep(.el-form .el-form-item__label) {
    font-size: 15px;
  }
  :deep(  .el-divider--horizontal) {
    margin: 15px 0;
  }
  .file {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
}
</style>
src/views/onlineEducation/groupExams/index.vue
@@ -30,14 +30,17 @@
        </template>
      </el-table-column>
      <el-table-column label="合格率" prop="passRate" align="center" />
      <el-table-column label="限制时长" prop="limitTime" align="center"  >
      <el-table-column label="限制时长/分钟" prop="limitTime" align="center"  width="120" >
        <template #default="scope">
          <span v-if="scope.row.limitTime == 0">不限时</span>
          <span v-else>{{scope.row.limitTime}}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width"  width="180">
      <el-table-column label="考试截止时间" prop="deadlineNum" align="center"  width="120" >
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width"  width="260">
        <template #default="scope">
          <el-button link type="primary" @click="viewQuestion(scope.row)">预览</el-button>
          <el-button link type="primary" @click="toStuChoose(scope.row)">学生数据</el-button>
          <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button>
          <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
@@ -53,7 +56,8 @@
        @pagination="getList"
    />
    <exam-dialog ref="dialogRef" @getList=getList></exam-dialog>
<!--    <class-hour-change ref="classHourRef" @getList=getList></class-hour-change>-->
    <exam-question ref="questionRef" @getList=getList></exam-question>
  </div>
</template>
@@ -61,7 +65,7 @@
import {getCurrentInstance, onMounted, onUnmounted, reactive, ref, toRefs} from "vue";
import {ElMessage, ElMessageBox} from "element-plus";
import examDialog from './components/examDialog.vue'
// import classHourChange from './components/classHourChange.vue'
import examQuestion from './components/viewExamQuestion.vue'
import Cookies from "js-cookie";
import {useRouter} from 'vue-router'
const router = useRouter()
@@ -73,7 +77,7 @@
const { proxy } = getCurrentInstance();
const loading = ref(false);
const dialogRef = ref();
const classHourRef = ref();
const questionRef = ref();
const data = reactive({
  queryParams: {
    pageNum: 1,
@@ -111,7 +115,8 @@
    data.dataList = res.data.list.map(item => {
      return {
        ...item,
        passRate: item.paperStudentInfoVO.passStudentCount ===0 && item.paperStudentInfoVO.studentCount ===0  ? '0%': (item.paperStudentInfoVO.passStudentCount / item.paperStudentInfoVO.studentCount).toFixed(2) *100 + '%'
        passRate: item.paperStudentInfoVO.passStudentCount ===0 && item.paperStudentInfoVO.studentCount ===0  ? '0%': (item.paperStudentInfoVO.passStudentCount / item.paperStudentInfoVO.studentCount).toFixed(2) *100 + '%',
        deadlineNum: item.deadline ? item.deadline.slice(0,10) : ''
      }
    })
@@ -153,8 +158,7 @@
  const v = JSON.stringify(val)
  router.push({ path: "/examStu", query: { val: v } });
}
const openDetail = () => {
  classHourRef.value.openDialog()
const viewQuestion = (val) => {
  questionRef.value.openDialog(val)
}
</script>
src/views/onlineEducation/people/components/stuDialog.vue
@@ -59,7 +59,7 @@
import {ElMessage, ElMessageBox} from "element-plus";
import {verifyPhone, verifyPwd, verifyUsername} from "@/utils/validate";
import { checkUserName, checkPhone } from "@/api/login"
import {resetPwd} from "@/api/onlineEducation/student"
import {changeCompany, resetPwd} from "@/api/onlineEducation/student"
import {Base64} from "js-base64"
import Cookies from "js-cookie";
import {addStudent, checkStuIdNo, checkStuPhone, editStudent} from "@/api/onlineEducation/student";
@@ -136,27 +136,45 @@
      }
    }
    checkStuIdNo(param).then((res)=>{
      if(res.data == false){
        callback(new Error('身份证号已被占用,请更换其他身份证号'))
        // ElMessageBox.confirm(
        //     `该人员${state.form.name}(身份证号:${state.form.idNo})与${state.form.idNo}已经绑定,确定将该人员的责任归属变更到贵公企业?`,
        //     '提示',
        //     {
        //       confirmButtonText: '确认',
        //       cancelButtonText: '取消',
        //       type: 'warning',
        //       icon: ''
        //     }
        // )
        //     .then(() => {
        //       ElMessage({
        //         type: 'success',
        //         message: 'Delete completed',
        //       })
        //     })
        //     .catch(() => {
        //       callback(new Error('身份证号已被占用,请更换其他身份证号'))
        //     })
      if(res.data.status == 0){
        callback(new Error('身份证号不存在'))
      }else if(res.data.status == 1){
        callback(new Error('身份证号在该企业已被占用,请更换其他身份证号'))
      }else if(res.data.status == 2){
        if(state.title == '新增'){
          ElMessageBox.confirm(
              `该人员 ${state.form.name} (身份证号: ${state.form.idNo} )与 ${res.data.companyName} 已经绑定,确定将该人员的责任归属变更到贵公企业?`,
              '提示',
              {
                confirmButtonText: '确认',
                cancelButtonText: '取消',
                type: 'warning',
                icon: ''
              }
          )
          .then(() => {
            const param = {
              companyId: state.form.companyId,
              studentId: res.data.studentId
            }
            changeCompany(param).then((res) => {
              if(res.code == 200){
                ElMessage({
                  type: 'success',
                  message: '变更成功',
                })
                emit('getList')
                handleClose()
                callback()
              }else {
                ElMessage.warning(res.message)
              }
            })
          })
        }else {
          callback(new Error('身份证号在其他企业已被占用,请更换身份证号'))
        }
      }else{
        callback()
      }
src/views/onlineEducation/people/components/trainRecord.vue
对比新文件
@@ -0,0 +1,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>
src/views/onlineEducation/people/index.vue
@@ -25,7 +25,7 @@
      <el-table-column label="职务" prop="duty" align="center"/>
      <el-table-column label="一人一档" prop="duty" align="center" width="120">
        <template #default="scope">
          <el-button link type="primary">培训考试记录</el-button>
          <el-button link type="primary" @click="openRecord(scope.row)">培训考试记录</el-button>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width"  width="180">
@@ -46,6 +46,7 @@
    />
    <stu-dialog ref="dialogRef" @getList=getList></stu-dialog>
    <record ref="recordRef" @getList=getList></record>
  </div>
</template>
@@ -54,6 +55,7 @@
import {ElMessage, ElMessageBox} from "element-plus";
import {delCompany, getCompany} from "@/api/onlineEducation/company";
import stuDialog from "./components/stuDialog.vue"
import record from './components/trainRecord.vue'
import {delUser, getUser} from "@/api/onlineEducation/user";
import Cookies from "js-cookie";
import {delStudent, getStudent} from "@/api/onlineEducation/student";
@@ -62,6 +64,7 @@
const { proxy } = getCurrentInstance();
const loading = ref(false);
const dialogRef = ref();
const recordRef  =ref();
const data = reactive({
  queryParams: {
    pageNum: 1,
@@ -134,5 +137,8 @@
        }
      })
}
const openRecord = (val) => {
  recordRef.value.openDialog(val)
}
</script>