dedsudiyu 1 dzień temu
rodzic
commit
ed5d2a8782

+ 19 - 3
src/api/safetyEducationExaminationNew/index.js

@@ -675,11 +675,11 @@ export function examUserCoursewareLearningConfirmCompletion(data) {
   })
 }
 //重新开始学习课件
-export function examUserCoursewareLearningRestart(data) {
+export function examUserCoursewareLearningRestart(query) {
   return request({
     url: '/exam/user/courseware/learning/restart',
-    method: 'post',
-    data: data
+    method: 'get',
+    params: query
   })
 }
 //上报课件学习进度
@@ -698,4 +698,20 @@ export function examUserPracticeTrainPanel(data) {
     data: data
   })
 }
+//根据课件ID查询课件信息
+export function examUserCoursewareLearningDetail(query) {
+  return request({
+    url: '/exam/user/courseware/learning/detail',
+    method: 'get',
+    params: query
+  })
+}
+//查询可用知识点列表
+export function examUserCoursewareLearningKnowledgePoints(query) {
+  return request({
+    url: '/exam/user/courseware/learning/knowledgePoints',
+    method: 'get',
+    params: query
+  })
+}
 

+ 8 - 2
src/views/safetyEducationExaminationNew/courseManagement/courseManagement/addPage.vue

@@ -4,8 +4,8 @@
     <div class="page-container-top-max-big-box-shadow">
       <p class="top-1-p">{{newData.id?'编辑课程':'新建课程'}}</p>
       <p class="top-2-p" @click="backPage()">返回</p>
-      <p class="top-3-p" v-if="newData.id" @click="resetButton()">重置</p>
-      <p class="top-4-p" @click="submitButton()">保存</p>
+      <p class="top-3-p" v-if="newData.id&&!showType" @click="resetButton()">重置</p>
+      <p class="top-4-p" v-if="!showType" @click="submitButton()">保存</p>
     </div>
     <div class="bottom-max-big-box">
       <div class="left-max-big-box">
@@ -49,6 +49,7 @@
           // {name:'课后考核',value:'3'},
         ],
         newData:{},
+        showType:false,
       }
     },
     created(){
@@ -120,6 +121,11 @@
             }
           }
           this.$refs.studyCourses.setDataInfo(list);
+          if(this.propsData.showType){
+            this.$set(this,'showType',true);
+            this.$refs.studyCourses.setShowType();
+            this.$refs.basicSettings.setShowType();
+          }
         });
       },
       //切换按钮

+ 13 - 4
src/views/safetyEducationExaminationNew/courseManagement/courseManagement/basicSettings.vue

@@ -6,7 +6,7 @@
           <div class="form-box">
             <div class="form-flex-box">
               <el-form-item label="专业类别" prop="disciplineTypeId">
-                <el-select v-model="newData.disciplineTypeId" placeholder="请选择专业类别" style="width: 160px">
+                <el-select v-model="newData.disciplineTypeId" :disabled="showType" placeholder="请选择专业类别" style="width: 160px">
                   <el-option
                     v-for="dict in optionListA"
                     :key="dict.id"
@@ -17,6 +17,7 @@
               </el-form-item>
               <el-form-item label="是否上架" prop="shelfStatus" label-width="200px">
                 <el-switch
+                  :disabled="showType"
                   :active-value="1"
                   :inactive-value="0"
                   v-model="newData.shelfStatus"
@@ -26,6 +27,7 @@
               </el-form-item>
               <el-form-item label="是否共享" prop="shareStatus" label-width="200px">
                 <el-switch
+                  :disabled="showType"
                   :active-value="1"
                   :inactive-value="0"
                   v-model="newData.shareStatus"
@@ -38,19 +40,20 @@
           </div>
           <div class="form-box">
             <el-form-item label="课程名称" prop="courseName">
-              <el-input v-model="newData.courseName" placeholder="请输入课程名称" maxLength="20" style="width:960px;"></el-input>
+              <el-input :disabled="showType" v-model="newData.courseName" placeholder="请输入课程名称" maxLength="20" style="width:960px;"></el-input>
             </el-form-item>
           </div>
           <div class="form-box">
             <el-form-item label="图形弹窗校验" prop="popupVerifyEnabled">
               <div class="switch-row">
-                <el-switch v-model="newData.popupVerifyEnabled" :active-value="1" :inactive-value="0"
+                <el-switch :disabled="showType" v-model="newData.popupVerifyEnabled" :active-value="1" :inactive-value="0"
                            active-color="#0183FB" inactive-color="#AAAAAA"
                 />
                 <template v-if="newData.popupVerifyEnabled==1">
                   <p class="tip-text" style="margin-left:12px;">开启后,每隔</p>
                   <div class="number-stepper" style="margin-left:8px;">
                     <el-input-number
+                      :disabled="showType"
                       class="form-input-number"
                       style="width:160px;"
                       :min="0"
@@ -70,6 +73,7 @@
             <div class="form-flex-box">
               <el-form-item label="课程封面" prop="coverAttachmentPath">
                 <el-upload
+                  :disabled="showType"
                   style="width:400px;"
                   drag
                   accept=".png, .jpg, .jpeg"
@@ -145,7 +149,8 @@
             { required: true, message: '请输入人图形弹窗校验间隔', trigger: 'change' },
             { validator: validateData5, trigger: 'blur' }
           ],
-        }
+        },
+        showType:false,
       }
     },
     created(){
@@ -155,6 +160,10 @@
       this.examElDisciplineTypeList();
     },
     methods:{
+      //查看模式
+      setShowType(){
+        this.$set(this,'showType',true);
+      },
       //写入详情
       setDataInfo(data){
         this.$set(this,'newData',data);

+ 4 - 0
src/views/safetyEducationExaminationNew/courseManagement/courseManagement/index.vue

@@ -269,6 +269,10 @@
           }).catch(() => {});
         }else if(type == 5){
           //预览课程
+          this.$set(this,'pageType',2);
+          let obj = JSON.parse(JSON.stringify(row))
+          obj.showType = true;
+          this.$set(this,'propsData',obj);
 
         }else if(type == 6){
           //返回并刷新

+ 30 - 7
src/views/safetyEducationExaminationNew/courseManagement/courseManagement/studyCourses.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="page-container courseManagement-studyCourses">
     <div class="top-button-box">
-      <p @click="addBigItem()">添加课件</p>
+      <p @click="addBigItem()" v-show="!showType">添加课件</p>
       <p>共计 {{num1}} 个知识点,{{num2}} 个课件,要求时长 {{num3}} 分钟,可得 {{num4}} 学时</p>
     </div>
     <div class="content-box scrollbar-box">
@@ -21,10 +21,10 @@
           <p @click="showButton(index)" :class="item.showType?'el-icon-arrow-up':'el-icon-arrow-down'"></p>
           <p>{{item.data1}}</p>
           <p>共 {{item.data2}} 个课件,要求时长 {{item.data3}} 分钟,可得 {{item.data4}} 学时</p>
-          <p class="el-icon-delete-solid" @click="delBigItem(index)"></p>
+          <p class="el-icon-delete-solid" v-show="!showType" @click="delBigItem(index)"></p>
           <!-- 大项拖拽手柄 -->
-          <p class="el-icon-rank drag-handle" title="拖动排序"></p>
-          <p class="el-icon-circle-plus" @click="addMinItem(item,index)"></p>
+          <p class="el-icon-rank drag-handle" v-show="!showType" title="拖动排序"></p>
+          <p class="el-icon-circle-plus" v-show="!showType" @click="addMinItem(item,index)"></p>
         </div>
 
         <div class="max-big-title-box" v-show="item.showType">
@@ -48,10 +48,10 @@
             <p>{{minItem.minData3==1?'视频':(minItem.minData3==3?'文档':(minItem.minData3==4?'文章':''))}}</p>
             <p>{{minItem.minData4}}</p>
             <p>{{minItem.minData5}}</p>
-            <p class="el-icon-delete-solid" @click="delItem(index, minIndex)"></p>
+            <p class="el-icon-delete-solid" v-show="!showType" @click="delItem(index, minIndex)"></p>
             <!-- 小项拖拽手柄 -->
-            <p class="el-icon-rank drag-handle" title="拖动排序"></p>
-            <p class="el-icon-view" @click="lookItem(minItem)"></p>
+            <p class="el-icon-rank drag-handle" v-show="!showType" title="拖动排序"></p>
+            <p class="el-icon-view" v-show="!showType" @click="lookItem(minItem)"></p>
           </div>
         </div>
       </div>
@@ -130,6 +130,7 @@
           knowledgePointId:null,
           checkIndex:null,
         },
+        showType:false,
       }
     },
     created(){
@@ -139,6 +140,10 @@
 
     },
     methods:{
+      //查看模式
+      setShowType(){
+        this.$set(this,'showType',true);
+      },
       //写入详情
       setDataInfo(list){
         this.$set(this,'dataList',list);
@@ -386,17 +391,26 @@
       },
       // ========== 大项拖拽逻辑 ==========
       onBigDragStart(e, index) {
+        if(this.showType){
+         return
+        }
         this.dragInfo = { type: 'big', bigIndex: index, smallIndex: null };
         // 给拖拽中的元素加个样式
         e.target.classList.add('dragging');
       },
       onBigDragOver(e, index) {
+        if(this.showType){
+          return
+        }
         // 只有当拖拽的是大项时才允许放置
         if (this.dragInfo.type === 'big') {
           e.currentTarget.classList.add('drag-over');
         }
       },
       onBigDrop(e, targetIndex) {
+        if(this.showType){
+          return
+        }
         if (this.dragInfo.type !== 'big') return;
         const sourceIndex = this.dragInfo.bigIndex;
         if (sourceIndex === targetIndex) return;
@@ -408,18 +422,27 @@
 
       // ========== 小项拖拽逻辑 ==========
       onSmallDragStart(e, bigIndex, smallIndex) {
+        if(this.showType){
+          return
+        }
         this.dragInfo = { type: 'small', bigIndex: bigIndex, smallIndex: smallIndex };
         e.target.classList.add('dragging');
         // 阻止事件冒泡,防止触发大项的拖拽
         e.stopPropagation();
       },
       onSmallDragOver(e, smallIndex) {
+        if(this.showType){
+          return
+        }
         // 只有当拖拽的是小项,且属于同一个大项时才允许放置
         if (this.dragInfo.type === 'small' && this.dragInfo.bigIndex === this.getCurrentBigIndex(e)) {
           e.currentTarget.classList.add('drag-over');
         }
       },
       onSmallDrop(e, targetBigIndex, targetSmallIndex) {
+        if(this.showType){
+          return
+        }
         if (this.dragInfo.type !== 'small') return;
         // 确保只能在同一个大项内拖拽
         if (this.dragInfo.bigIndex !== targetBigIndex) return;

+ 270 - 70
src/views/safetyEducationExaminationNew/featurePage/learningMaterials/index.vue

@@ -7,29 +7,30 @@
     </div>
     <div class="content-box">
       <div class="left-max-big-box">
-
+        <coursewareComponent ref="coursewareComponent"></coursewareComponent>
       </div>
       <div class="right-max-big-box">
-        <p class="title-p">{{learningData.data1}}</p>
-        <div class="text-p" style="color:#666;">{{learningData.data2}}分钟丨{{learningData.data3}}学时丨{{learningData.data4}}积分</div>
-        <div class="text-p">已学 {{learningData.data5}} / 总 {{learningData.data6}} 课件</div>
+        <p class="title-p">{{newData.coursewareName}}</p>
+        <div class="text-p" style="color:#666;">{{secondsToMinutes(newData.minLearningDuration)}}分钟丨{{newData.creditHours}}学时丨{{newData.points}}积分</div>
+        <!--<div class="text-p">已学 {{newData.learnedCoursewareCount}} / 总 {{newData.totalCoursewareCount}} 课件</div>-->
         <div class="progress-box">
           <p class="progress-title-box">学习进度</p>
           <div class="progress-min-box">
-            <el-progress :stroke-width="12" :percentage="learningData.data7"></el-progress>
+            <el-progress :stroke-width="12" :percentage="newData.progress?newData.progress:0"></el-progress>
           </div>
         </div>
         <div class="learning-for-max-big-box scrollbar-box">
           <div class="for-max-big-box"
-               v-for="(item,index) in learningData.dataList" :key="index">
-            <div class="for-big-box" @click="checkLearningButton(index)"
+               v-for="(item,index) in newData.coursewares" :key="index">
+            <div class="for-big-box"
                  :class="checkLearningIndex == index ?'check-for-box':''">
-              <p>{{item.listData1}}</p>
-              <p>已学习:{{formatTime(item.listData3)}} / {{formatTime(item.listData4)}}</p>
-              <p :class="item.listData5 ==1 ?'colorA':''">{{item.listData5==1?'已学完':'未学完'}}</p>
+              <!--<p>{{item.coursewareName}}</p>-->
+              <p></p>
+              <p>已学习:{{formatTime(item.learnedDuration)}} / {{formatTime(item.minLearningDuration)}}</p>
+              <p :class="item.learnStatus ==2 ?'colorA':(item.learnStatus ==1 ?'colorB':'')">{{item.learnStatus==2?'已学完':(item.learnStatus==1?'学习中':'未学完')}}</p>
             </div>
             <p class="for-button" @click="finishStudying(index)"
-               v-if="item.listData5 == 0 && item.listData3 == item.listData4 && checkLearningIndex == index">
+               v-if="item.learnStatus != 2 && item.learnedDuration == item.minLearningDuration && checkLearningIndex == index">
               若已完成学习,请点此确认
             </p>
           </div>
@@ -39,63 +40,145 @@
   </div>
 </template>
 <script>
+  import StudyTimer from '@/utils/timerUtils/StudyTimer';
+  import { VerifySlider } from 'vue-verify-slider';
+  import coursewareComponent from "@/views/safetyEducationExaminationNew/components/coursewareComponent.vue";
+  import {
+    examUserCoursewareLearningDetail,examUserCoursewareLearningReportProgress,
+    examUserCoursewareLearningConfirmCompletion,examUserCoursewareLearningRestart
+  } from "@/api/safetyEducationExaminationNew/index";
   export default {
     name: 'index',
+    components: {
+      VerifySlider,
+      coursewareComponent,
+    },
     data() {
       return {
-        learningData:{
-          data1:"课程名称",
-          data2:"20",
-          data3:"1",
-          data4:"3",
-          data5:"0",
-          data6:"2",
-          data7:"20",
-          dataList:[
-            {
-              listData1:'课件名称',
-              listData2:1,
-              listData3:320,
-              listData4:600,
-              listData5:0,
-            },
-            {
-              listData1:'课件名称',
-              listData2:1,
-              listData3:600,
-              listData4:600,
-              listData5:0,
-            },
-            {
-              listData1:'课件名称',
-              listData2:1,
-              listData3:600,
-              listData4:600,
-              listData5:1,
-            },
+        coursewareId:null,
+        newData:{
+          coursewareName:"",
+          minLearningDuration:0,
+          creditHours:0,
+          points:0,
+          learnedCoursewareCount:0,
+          totalCoursewareCount:0,
+          progress:0,
+          coursewares:[
+            // {
+            //   coursewareName:'视频课件名称',
+            //   listData2:1,
+            //   learnedDuration:590,
+            //   minLearningDuration:600,
+            //   learnStatus:2,
+            //   attachmentPath:'http://192.168.1.8/statics/bigFile/20260801/0731dbcb-622b-4468-ade2-e20820b122eb.mp4',
+            //   attachmentType:'mp4',
+            //   materialType:'1',
+            //   articleContent:'',
+            // },
+            // {
+            //   coursewareName:'docx课件名称',
+            //   listData2:1,
+            //   learnedDuration:600,
+            //   minLearningDuration:600,
+            //   learnStatus:0,
+            //   attachmentPath:'http://192.168.1.8/statics/2026/08/01/b68f1b1d-99ea-44e0-94b5-4bad4ac3ff1f.docx',
+            //   attachmentType:'.docx',
+            //   materialType:'3',
+            //   articleContent:'',
+            // },
+            // {
+            //   coursewareName:'xlsx课件名称',
+            //   listData2:1,
+            //   learnedDuration:600,
+            //   minLearningDuration:600,
+            //   learnStatus:1,
+            //   attachmentPath:'http://192.168.1.8/statics/2026/08/01/270eb79e-627b-4fdf-9f1a-397bd9784d39.xlsx',
+            //   attachmentType:'.xlsx',
+            //   materialType:'3',
+            //   articleContent:'',
+            // },
+            // {
+            //   coursewareName:'pdf课件名称',
+            //   listData2:1,
+            //   learnedDuration:600,
+            //   minLearningDuration:600,
+            //   learnStatus:1,
+            //   attachmentPath:'http://192.168.1.8/statics/2026/08/01/b251bd69-120c-48d5-b662-c28e308cd61b.pdf',
+            //   attachmentType:'.pdf',
+            //   materialType:'3',
+            //   articleContent:'',
+            // },
+            // {
+            //   coursewareName:'富文本课件名称',
+            //   listData2:1,
+            //   learnedDuration:600,
+            //   minLearningDuration:600,
+            //   learnStatus:1,
+            //   attachmentPath:'',
+            //   attachmentType:'',
+            //   materialType:'4',
+            //   articleContent:"<p><img style=\"max-width: 100%;\" src=\"../statics/2026/08/01/e2788e82-745c-4b49-82e0-ebb6f2a30713.jpeg\" alt=\"1.jpeg\">&nbsp;</p>"
+            // },
+            // {
+            //   coursewareName:'xlsx课件名称',
+            //   listData2:1,
+            //   learnedDuration:600,
+            //   minLearningDuration:600,
+            //   learnStatus:1,
+            //   attachmentPath:'http://192.168.1.8/statics/2026/08/01/270eb79e-627b-4fdf-9f1a-397bd9784d39.xlsx',
+            //   attachmentType:'.xlsx',
+            //   materialType:'3',
+            //   articleContent:'',
+            // },
           ],
         },
+        //当前选中
         checkLearningIndex:0,
-
+        //学习计时器
+        studyTimer: null,
+        //验证器弹窗状态
+        dialogVisible:false,
+        //验证器弹窗间隔时间
+        verificationTime:0,
+        //心跳回报时间
+        heartbeatValue:30,
       }
     },
     created() {
 
     },
     mounted() {
-
+      this.initialization();
     },
     methods: {
-      /*
-      this.$router.push({
-        name: 'Detail',
-        params: {
-          id: 1,
-          title: '消息标题'
-        }
-      })
-      this.$route.params.title
-      */
+      //初始化
+      initialization(){
+        this.$set(this,'coursewareId',this.$route.params.coursewareId)
+        this.$nextTick(()=>{
+          this.examUserCoursewareLearningDetail();
+        })
+      },
+      //根据课件ID查询课件信息
+      examUserCoursewareLearningDetail(){
+        examUserCoursewareLearningDetail({ coursewareId:this.coursewareId }).then(response => {
+          response.data.coursewares=[
+            {
+              coursewareName:response.data.coursewareName,
+              learnedDuration:response.data.learnedDuration,
+              minLearningDuration:response.data.minLearningDuration,
+              learnStatus:response.data.learnStatus,
+              attachmentPath:response.data.attachmentPath,
+              attachmentType:response.data.attachmentType,
+              materialType:response.data.materialType,
+              articleContent:response.data.articleContent,
+            },
+          ]
+          this.$set(this, 'newData', response.data)
+          this.initTimer();//学习计时器
+          this.courseRendering(this.checkLearningIndex);//课件渲染
+        })
+      },
       //返回
       backPage() {
         this.$router.back()
@@ -109,24 +192,62 @@
           type: "warning"
         }).then(function() {
         }).then(() => {
-
+          self.examUserCoursewareLearningConfirmCompletion();
         }).catch(() => {});
       },
-      //切换课件
-      checkLearningButton(index){
+      //课件渲染
+      courseRendering(index){
+        let name = this.newData.coursewares[index].coursewareName;
+        let url = '';
+        let type = '';
+        if(this.newData.coursewares[index].materialType == 1){
+          //视频
+          type = 'video'
+          url = this.newData.coursewares[index].attachmentPath;
+        }else if(this.newData.coursewares[index].materialType == 3){
+          //文档
+          if(this.newData.coursewares[index].attachmentType == '.docx'){
+            type = 'docx'
+          }else if(this.newData.coursewares[index].attachmentType == '.xlsx'){
+            type = 'excel'
+          }else if(this.newData.coursewares[index].attachmentType == '.pdf'){
+            type = 'pdf'
+          }
+          url = this.newData.coursewares[index].attachmentPath;
+        }else if(this.newData.coursewares[index].materialType == 4){
+          //文章
+          type = 'text'
+          url = this.newData.coursewares[index].articleContent;
+        }
+        this.$refs['coursewareComponent'].initialize(name,url,type);
+        if(this.newData.coursewares[this.checkLearningIndex].learnStatus == 0){
+          this.$set(this.newData.coursewares[this.checkLearningIndex],'learnStatus',1);
+        }
+      },
+      //学习完成
+      examUserCoursewareLearningConfirmCompletion(){
         let self = this;
-        if(this.checkLearningIndex != index){
-          this.$confirm('确认切换课件?', "警告", {
-            confirmButtonText: "确认",
-            cancelButtonText: "取消",
-            type: "warning"
-          }).then(function() {
-          }).then(() => {
-            self.$set(self,'checkLearningIndex',index);
-          }).catch(() => {});
+        let obj = {
+          coursewareId:this.coursewareId,
+          courseId:0,
+          examId:0,
+        }
+        examUserCoursewareLearningConfirmCompletion(obj).then(response => {
+          this.$set(this.newData.coursewares[this.checkLearningIndex],'learnStatus',2);
+          this.msgSuccess(response.message)
+        })
+      },
+      //心跳接口
+      examUserCoursewareLearningReportProgress(){
+        let obj = {
+          coursewareId:this.coursewareId,
+          courseId:0,
+          examId:0,
+          duration:this.heartbeatValue,
         }
+        examUserCoursewareLearningReportProgress(obj).then(response => {})
       },
-      //时间换算
+      //倒计时时间换算
       formatTime(totalSeconds) {
         if (typeof totalSeconds !== 'number' || totalSeconds <= 0) {
           return '0秒';
@@ -140,8 +261,72 @@
         } else {
           return `${seconds}秒`;
         }
+      },
+      //展示时间换算
+      secondsToMinutes(totalSeconds) {
+        if (typeof totalSeconds !== 'number' || totalSeconds <= 0) {
+          return 1;
+        }
+        return Math.ceil(totalSeconds / 60);
+      },
+      /*=================================== 学习定时器 ===================================*/
+      // 初始化定时器
+      initTimer() {
+        let self = this;
+        if(this.newData.coursewares[this.checkLearningIndex].learnedDuration == this.newData.coursewares[this.checkLearningIndex].minLearningDuration){
+          return
+        }
+        this.studyTimer = new StudyTimer({
+          initialSeconds: self.newData.coursewares[self.checkLearningIndex].learnedDuration,
+          maxSeconds: self.newData.coursewares[self.checkLearningIndex].minLearningDuration,
+          onTick: (elapsedSeconds) => {
+            //每次计时
+            this.$set(self.newData.coursewares[self.checkLearningIndex],'learnedDuration',elapsedSeconds);
+            //心跳判断
+            if (elapsedSeconds % this.heartbeatValue === 0) {
+              //调用心跳方法
+              this.examUserCoursewareLearningReportProgress();
+            }
+          },
+          onMaxTimeReached: (elapsedSeconds) => {
+            //达到最大值
+            this.$set(self.newData.coursewares[self.checkLearningIndex],'learnedDuration',elapsedSeconds);
+            //调用心跳方法
+            this.examUserCoursewareLearningReportProgress();
+          }
+        });
+        this.studyTimer.resume();
+      },
+      // 切换暂停/继续
+      handleToggle() {
+        if (!this.studyTimer) return;
+        if (this.studyTimer.isRunning) {
+          this.studyTimer.pause();
+        } else {
+          this.studyTimer.resume();
+        }
+      },
+      // 清除定时器
+      clearTimer() {
+        if (this.studyTimer) {
+          this.studyTimer.clear();
+          this.studyTimer = null;
+        }
+      },
+      //乘法
+      accMul(arg1,arg2){
+        var m=0,s1=arg1.toString(),s2=arg2.toString();
+        try{m+=s1.split(".")[1].length}catch(e){}
+        try{m+=s2.split(".")[1].length}catch(e){}
+        return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)
+      },
+    },
+    beforeDestroy() {
+      if (this.studyTimer) {
+        this.studyTimer.destroy();
+        this.studyTimer = null;
       }
-    }
+    },
   }
 </script>
 <style scoped lang="scss">
@@ -155,23 +340,32 @@
     padding:0;
     box-shadow: 0 0 8px 1px rgba(0, 0, 0, 0.1);
     margin:10px;
+    ::v-deep .el-progress .el-progress__text{
+      margin-left:10px;
+      margin-top:1px;
+    }
     .content-box{
       flex: 1;
       display: flex;
       overflow: hidden;
       .left-max-big-box{
         flex:1;
+        display: flex;
+        flex-direction: column;
         background-color: #dedede;
-        margin:40px 20px;
+        margin:20px 20px;
         border-radius:10px;
         overflow: hidden;
+        box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
+        border:1px solid #dedede;
       }
       .right-max-big-box{
-        padding:40px 0;
+        padding:20px 0;
         width:400px;
         display: flex;
         flex-direction: column;
         overflow: hidden;
+        border-left: 1px solid #dedede;
         .title-p{
           font-size:16px;
           font-weight:700;
@@ -235,7 +429,7 @@
                 position: absolute;
                 bottom: 16px;
                 right: 16px;
-                color:#fff!important;
+                color:#fff;
                 background-color: #999;
                 border-radius:4px;
                 width:60px;
@@ -244,6 +438,12 @@
               }
               .colorA{
                 background-color: #0183fa!important;
+                color:#fff!important;
+              }
+              .colorB{
+                background-color: #fff!important;
+                border:1px solid #0183fa!important;
+                color:#0183fa!important;
               }
             }
             .for-button{

+ 27 - 50
src/views/safetyEducationExaminationNew/safetyEducation/knowledgeLearning/index.vue

@@ -59,7 +59,7 @@
           <div class="page-content-box">
             <div class="for-max-big-box scrollbar-box">
               <p class="null-text-p" v-if="!dataList[0]">暂无数据</p>
-              <div class="for-big-box" v-for="(item,index) in dataList" :key="index">
+              <div class="for-big-box" v-for="(item,index) in dataList" :key="index" @click="tableButton(item)">
                 <img v-if="item.materialType == 1" :src="item.exampleImg">
                 <img v-else src="@/assets/ZDimages/basicsModules/image_986222064626770.png">
                 <div class="bottom-big-box">
@@ -87,7 +87,7 @@
   //import { systemUserSelect } from "@/api/commonality/permission";
   //import { getInfo } from "@/api/basicsModules/index";
   //import addPage from "./addPage.vue";
-  import { examUserCoursewareLearningList,examElKnowledgePointTreeList, } from "@/api/safetyEducationExaminationNew/index";
+  import { examUserCoursewareLearningList,examElKnowledgePointTreeList,examUserCoursewareLearningRestart, } from "@/api/safetyEducationExaminationNew/index";
   export default {
     name: 'index',
     //components: {
@@ -120,6 +120,9 @@
 
     },
     mounted() {
+      if(this.$route.params.skip){
+        this.$set(this,'topButtonIndex',2);
+      }
       this.examElKnowledgePointTreeList();
     },
     methods: {
@@ -177,57 +180,31 @@
         })
       },
       //操作按钮
-      tableButton(type, row) {
-        let self = this
-        if (type == 1) {
-          //新增
-          this.$set(this, 'pageType', 2)
-          this.$set(this, 'propsData', {})
-        } else if (type == 2) {
-          //详情
-          this.$set(this, 'pageType', 2)
-          let obj = JSON.parse(JSON.stringify(row))
-          obj.showType = true
-          this.$set(this, 'propsData', obj)
-        } else if (type == 3) {
-          //编辑
-          this.$set(this, 'pageType', 2)
-          let obj = JSON.parse(JSON.stringify(row))
-          obj.showType = false
-          this.$set(this, 'propsData', obj)
-        } else if (type == 4) {
-          //删除
-          this.$confirm('是否确认删除?', '警告', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          }).then(function() {
-          }).then(() => {
-            deleteFunction({ id: row.id }).then(response => {
-              self.msgSuccess(response.message)
-              self.getList()
-            })
-          }).catch(() => {
-          })
-        } else if (type == 5) {
-          //启用&停用
-          let text = row.state ? '停用' : '启用'
-          this.$confirm('是否确认' + text + '?', '警告', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
+      tableButton(item) {
+        let self = this;
+        if(item.learnStatus == 2){
+          this.$confirm('该课件已学完,是否重置进度重新学习?', "警告", {
+            confirmButtonText: "确认",
+            cancelButtonText: "取消",
+            type: "warning"
           }).then(function() {
           }).then(() => {
-            stateFunction({ id: row.id, state: !row.state }).then(response => {
-              self.msgSuccess(response.message)
-              self.getList()
-            })
-          }).catch(() => {
+            examUserCoursewareLearningRestart({coursewareId:item.coursewareId}).then(response => {
+              self.$router.push({
+                name: 'learningMaterials',
+                params: {
+                  coursewareId: item.coursewareId,
+                }
+              })
+            });
+          }).catch(() => {});
+        }else{
+          this.$router.push({
+            name: 'learningMaterials',
+            params: {
+              coursewareId: item.coursewareId,
+            }
           })
-        } else if (type == 6) {
-          //返回并刷新
-          this.$set(this, 'pageType', 1)
-          this.getList()
         }
       },
       examElKnowledgePointTreeList(){

+ 8 - 5
src/views/safetyEducationExaminationNew/safetyTest/mockExam/index.vue

@@ -57,7 +57,7 @@
               <p class="text-p">{{parseTime(item.startTime,"{y}-{m}-{d} {h}:{i}")}} 至 {{parseTime(item.endTime,"{y}-{m}-{d} {h}:{i}")}}</p>
               <p class="time-p">时长:{{item.answerDuration}}分钟 丨 总分:{{item.totalScore}}分 丨 及格分:{{item.passScore}}分 丨 可考试次数:{{item.attemptLimit==0?'无限':item.attemptLimit}}次</p>
             </div>
-            <p class="position-p-1" @click="tableButton(1,item)">{{item.conditionType!=4?'完成模拟考试练习后解锁':'开始模拟考试'}}</p>
+            <p class="position-p-1" :class="item.conditionType==4?'position-p-3':''" @click="tableButton(1,item)">{{item.conditionType!=4?'完成模拟考试练习后解锁':'开始模拟考试'}}</p>
             <!--<p class="position-p-2" @click="tableButton(2)">历史错题</p>-->
           </div>
         </div>
@@ -174,10 +174,10 @@
           //模拟考试
           if(item.attemptId){
             this.$router.push({
-              name: 'startTheExam',
+              name: 'mockExam',
               params: {
+                examId: item.examId,
                 attemptId: item.attemptId,
-                type: '1'
               }
             })
           }else{
@@ -188,7 +188,6 @@
                   params: {
                     examId: item.examId,
                     attemptId: response.data.attemptId,
-                    type: '1'
                   }
                 })
               }else{
@@ -357,7 +356,6 @@
             line-height:30px;
             width:180px;
             text-align: center;
-            cursor: pointer;
           }
           .position-p-2{
             position:absolute;
@@ -373,6 +371,11 @@
             text-align: center;
             cursor: pointer;
           }
+          .position-p-3{
+            cursor: pointer;
+            color:#fff!important;
+            background-color: #0183fa!important;
+          }
         }
       }
 

+ 9 - 35
src/views/safetyEducationExaminationNew/safetyTest/onlineExam/index.vue

@@ -57,7 +57,7 @@
               <p class="text-p">{{parseTime(item.startTime,"{y}-{m}-{d} {h}:{i}")}} 至 {{parseTime(item.endTime,"{y}-{m}-{d} {h}:{i}")}}</p>
               <p class="time-p">时长:{{item.answerDuration}}分钟 丨 总分:{{item.totalScore}}分 丨 及格分:{{item.passScore}}分 丨 可考试次数:{{item.attemptLimit===0?'无限':item.attemptLimit}}次</p>
             </div>
-            <p class="position-p-1" @click="tableButton(1,item)">
+            <p class="position-p-1" :class="item.conditionType==4?'position-p-3':''" @click="tableButton(1,item)">
               {{item.conditionType==1?'完成学时要求后解锁':(item.conditionType==2?'完成考前课程学习后解锁':(item.conditionType==3?'完成模拟考试练习后解锁':(item.conditionType==4?'开始考试':'')))}}
             </p>
           </div>
@@ -168,44 +168,15 @@
       tableButton(type, item) {
         let self = this
         if (type == 1) {
-          if(item.conditionType == 1){
-
-          }else if(item.conditionType == 2){
-
-          }else if(item.conditionType == 3){
-            //模拟考试
-            if(item.attemptId){
-              this.$router.push({
-                name: 'startTheExam',
-                params: {
-                  attemptId: item.attemptId,
-                  type: '1'
-                }
-              })
-            }else{
-              examUserExamStart({examId:item.examId,examScene:2,}).then(response => {
-                if(response.data.attemptId){
-                  this.$router.push({
-                    name: 'mockExam',
-                    params: {
-                      examId: item.examId,
-                      attemptId: response.data.attemptId,
-                      type: '1'
-                    }
-                  })
-                }else{
-                  this.msgError(response.message)
-                }
-              })
-            }
-          }else if(item.conditionType == 4){
+          if(item.conditionType == 4){
             //开始考试
             if(item.attemptId){
               this.$router.push({
                 name: 'startTheExam',
                 params: {
+                  examId: item.examId,
                   attemptId: item.attemptId,
-                  type: '1'
+                  examKind:item.examKind,
                 }
               })
             }else{
@@ -216,7 +187,7 @@
                     params: {
                       examId: item.examId,
                       attemptId: response.data.attemptId,
-                      type: '1'
+                      examKind:item.examKind,
                     }
                   })
                 }else{
@@ -225,7 +196,6 @@
               })
             }
           }
-
         } else if (type == 6) {
           //返回并刷新
           this.$set(this, 'pageType', 1)
@@ -387,7 +357,11 @@
             line-height:30px;
             width:180px;
             text-align: center;
+          }
+          .position-p-3{
             cursor: pointer;
+            color:#fff!important;
+            background-color: #0183fa!important;
           }
         }
       }

+ 178 - 155
src/views/safetyEducationExaminationNew/workbench/ResourceCard.vue

@@ -6,25 +6,24 @@
     <div class="tab-scroll-wrap">
       <div class="tab-bar">
         <p v-for="(item,index) in topList" :key="index"
-           :class="item.value == topIndex?'check-p':''"
-          @click="topButton(item.value)">{{ item.table }}</p>
+           :class="item.knowledgePointId == knowledgePointId?'check-p':''"
+          @click="topButton(item.knowledgePointId)">{{ item.knowledgePointName }}</p>
       </div>
     </div>
-
     <div class="resource-body">
       <div class="left-max-big-box">
         <!--知识学习-->
         <div class="left-top-big-box">
           <div class="big-title-box">
             <p>知识学习</p>
-            <p>查看更多</p>
+            <p @click="goPage(1)">查看更多</p>
           </div>
           <div class="big-content-box scrollbar-box">
             <p class="null-p" v-if="!leftTopList[0]">暂无数据</p>
-            <div class="for-big-box" v-for="(item,index) in leftTopList" :key="index">
-              <p>{{item.leftTopData1}}</p>
-              <p>{{item.leftTopData2}}分钟丨{{item.leftTopData3}}学时丨{{item.leftTopData4}}积分</p>
-              <p :class="item.leftTopData5==1?'colorA':''">{{item.leftTopData5==1?'学习中':'未学习'}}</p>
+            <div class="for-big-box" v-for="(item,index) in leftTopList" :key="index" @click="tableButton(1,item)">
+              <p>{{item.coursewareName}}</p>
+              <p>{{secondsToMinutes(item.minLearningDuration)}}分钟丨{{item.creditHours}}学时丨{{item.points}}积分</p>
+              <p :class="item.learnStatus==1?'colorA':(item.learnStatus==2?'colorB':'')">{{item.learnStatus==1?'学习中':(item.learnStatus==2?'已完成':'未学习')}}</p>
             </div>
           </div>
         </div>
@@ -32,21 +31,21 @@
         <div class="left-bottom-big-box">
           <div class="big-title-box">
             <p>刷题练习</p>
-            <p>查看更多</p>
+            <p @click="goPage(2)">查看更多</p>
           </div>
           <div class="big-content-box scrollbar-box">
             <p class="null-p" v-if="!leftBottomList[0]">暂无数据</p>
-            <div class="for-big-box" v-for="(item,index) in leftBottomList" :key="index">
+            <div class="for-big-box" v-for="(item,index) in leftBottomList" :key="index" @click="tableButton(2,item)">
               <div class="for-flex-box">
                 <p class="el-icon-time"></p>
-                <p>{{item.leftBottomData1}}</p>
+                <p :style="!item.lastAnswerTime?'font-size:14px;':''">{{item.lastAnswerTime?parseTime(item.lastAnswerTime,"{y}-{m}-{d} {h}:{i}"):'未练习'}}</p>
               </div>
-              <p class="text-p">练习进度:{{item.leftBottomData2}}/{{item.leftBottomData3}}</p>
-              <p class="text-p">正确数:{{item.leftBottomData4}}丨错题数:{{item.leftBottomData5}}丨正确率:{{item.leftBottomData6}}%</p>
+              <p class="text-p">练习进度:{{item.answeredCount}}/{{item.totalCount}}</p>
+              <p class="text-p">正确数:{{item.correctCount}}丨错题数:{{item.wrongCount}}丨正确率:{{item.correctRate}}%</p>
               <el-progress
                 class="num-p" type="circle"
                 :stroke-width="4"
-                :width="60" :percentage="item.leftBottomData6">
+                :width="60" :percentage="item.progress">
               </el-progress>
             </div>
           </div>
@@ -56,16 +55,16 @@
       <div class="right-max-big-box">
         <div class="big-title-box">
           <p>视频资源学习</p>
-          <p>查看更多</p>
+          <p @click="goPage(3)">查看更多</p>
         </div>
         <div class="big-content-box-1 scrollbar-box">
           <p class="null-p" v-if="!rightList[0]">暂无数据</p>
-          <div class="for-big-box" v-for="(item,index) in rightList" :key="index">
-            <img :src="item.rightData1">
+          <div class="for-big-box" v-for="(item,index) in rightList" :key="index" @click="tableButton(1,item)">
+            <img :src="item.exampleImg">
             <div class="text-box">
-              <p>{{item.rightData2}}</p>
-              <p>{{item.rightData3}}分钟丨{{item.rightData4}}学时丨{{item.rightData5}}积分</p>
-              <p :class="item.rightData6==1?'colorA':''">{{item.rightData6==1?'学习中':'未学习'}}</p>
+              <p>{{item.coursewareName}}</p>
+              <p>{{secondsToMinutes(item.minLearningDuration)}}分钟丨{{item.creditHours}}学时丨{{item.points}}积分</p>
+              <p :class="item.learnStatus==1?'colorA':(item.learnStatus==2?'colorB':'')">{{item.learnStatus==1?'学习中':(item.learnStatus==2?'已完成':'未学习')}}</p>
             </div>
           </div>
         </div>
@@ -75,140 +74,138 @@
 </template>
 
 <script>
+  import {
+    examUserCoursewareLearningKnowledgePoints,
+    examUserPracticeList,examUserCoursewareLearningList,
+  } from "@/api/safetyEducationExaminationNew/index";
 export default {
   name: 'ResourceCard',
   data() {
     return {
-      topList:[{value:'',table:'总览'},{value:'1',table:'生物类'},{value:'2',table:'辐射类'},{value:'3',table:'化学'}],
-      topIndex:'',
-      leftTopList:[
-        {
-          leftTopData1:'课件名称',
-          leftTopData2:'20',
-          leftTopData3:'1',
-          leftTopData4:'3',
-          leftTopData5:'1',
-        },
-        {
-          leftTopData1:'课件名称',
-          leftTopData2:'20',
-          leftTopData3:'1',
-          leftTopData4:'3',
-          leftTopData5:'2',
-        },
-        {
-          leftTopData1:'课件名称',
-          leftTopData2:'20',
-          leftTopData3:'1',
-          leftTopData4:'3',
-          leftTopData5:'1',
-        },
-        {
-          leftTopData1:'课件名称',
-          leftTopData2:'20',
-          leftTopData3:'1',
-          leftTopData4:'3',
-          leftTopData5:'1',
-        },
-      ],
-      leftBottomList:[
-        {
-          leftBottomData1:'2026-09-01 9:30:33',
-          leftBottomData2:'33',
-          leftBottomData3:'369',
-          leftBottomData4:'3',
-          leftBottomData5:'3',
-          leftBottomData6:'96',
-          leftBottomData7:'33',
-        },
-        {
-          leftBottomData1:'2026-09-01 9:30:33',
-          leftBottomData2:'33',
-          leftBottomData3:'369',
-          leftBottomData4:'3',
-          leftBottomData5:'3',
-          leftBottomData6:'96',
-          leftBottomData7:'33',
-        },
-        {
-          leftBottomData1:'2026-09-01 9:30:33',
-          leftBottomData2:'33',
-          leftBottomData3:'369',
-          leftBottomData4:'3',
-          leftBottomData5:'3',
-          leftBottomData6:'96',
-          leftBottomData7:'33',
-        },
-      ],
-      rightList:[
-        {
-          rightData1:'',
-          rightData2:'视频课件名称',
-          rightData3:'20',
-          rightData4:'1',
-          rightData5:'3',
-          rightData6:'1',
-        },
-        {
-          rightData1:'',
-          rightData2:'视频课件名称',
-          rightData3:'20',
-          rightData4:'1',
-          rightData5:'3',
-          rightData6:'2',
-        },
-        {
-          rightData1:'',
-          rightData2:'视频课件名称',
-          rightData3:'20',
-          rightData4:'1',
-          rightData5:'3',
-          rightData6:'1',
-        },
-        {
-          rightData1:'',
-          rightData2:'视频课件名称',
-          rightData3:'20',
-          rightData4:'1',
-          rightData5:'3',
-          rightData6:'1',
-        },
-        {
-          rightData1:'',
-          rightData2:'视频课件名称',
-          rightData3:'20',
-          rightData4:'1',
-          rightData5:'3',
-          rightData6:'2',
-        },
-        {
-          rightData1:'',
-          rightData2:'视频课件名称',
-          rightData3:'20',
-          rightData4:'1',
-          rightData5:'3',
-          rightData6:'1',
-        },
-      ],
+      topList:[],
+      knowledgePointId:'',
+      leftTopList:[],
+      leftBottomList:[],
+      rightList:[],
     }
   },
+  mounted(){
+    this.examUserCoursewareLearningKnowledgePoints();
+  },
   methods:{
+    tableButton(type,item){
+      if(type == 1){
+        //刷题练习
+        this.$router.push({
+          name: 'startPracticing',
+          params: {
+            knowledgePointId: item.knowledgePointId,
+            type: '1'
+          }
+        })
+      }else if(type == 2){
+        let self = this;
+        if(item.learnStatus == 2){
+          this.$confirm('该课件已学完,是否重置进度重新学习?', "警告", {
+            confirmButtonText: "确认",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(function() {
+          }).then(() => {
+            examUserCoursewareLearningRestart({coursewareId:item.coursewareId}).then(response => {
+              self.$router.push({
+                name: 'learningMaterials',
+                params: {
+                  coursewareId: item.coursewareId,
+                }
+              })
+            });
+          }).catch(() => {});
+        }else{
+          this.$router.push({
+            name: 'learningMaterials',
+            params: {
+              coursewareId: item.coursewareId,
+            }
+          })
+        }
+      }
+    },
     topButton(val){
-      if(this.topIndex != val){
-        this.$set(this,'topIndex',val);
-        this.leftTopGetData();
-        this.leftBottomGetData();
-        this.rightGetData();
+      if(this.knowledgePointId != val){
+        this.$set(this,'knowledgePointId',val);
+        this.leftExamUserCoursewareLearningList();
+        this.rightExamUserCoursewareLearningList();
+        this.examUserPracticeList();
       }
     },
-    leftTopGetData(){
-
+    goPage(type){
+      //1.文章文档 2.刷题 3.视频
+      if(type == 1){
+        this.$router.push({
+          name: 'knowledgeLearning',
+          params: {
+            skip: true,
+          }
+        })
+      }else if(type == 2){
+        this.$router.push({
+          name: 'practiceQuestions',
+          params: {}
+        })
+      }else if(type == 3){
+        this.$router.push({
+          name: 'knowledgeLearning',
+          params: {}
+        })
+      }
     },
-    leftBottomGetData(){
-
+    leftExamUserCoursewareLearningList(){
+      let obj = {
+        page:1,
+        pageSize:5,
+        materialType:2,
+        knowledgePointId:this.knowledgePointId,
+      }
+      examUserCoursewareLearningList(obj).then(response => {
+        this.$set(this, 'leftTopList', response.data.records)
+      })
     },
-    rightGetData(){
-
+    rightExamUserCoursewareLearningList(){
+      let obj = {
+        page:1,
+        pageSize:6,
+        materialType:1,
+        knowledgePointId:this.knowledgePointId,
+      }
+      examUserCoursewareLearningList(obj).then(response => {
+        this.$set(this, 'rightList', response.data.records)
+      })
+    },
+    examUserPracticeList(){
+      let obj = {
+        page:1,
+        pageSize:1,
+        knowledgePointId:this.knowledgePointId,
+      }
+      examUserPracticeList(obj).then(response => {
+        this.$set(this, 'leftBottomList', response.data.records)
+      })
+    },
+    examUserCoursewareLearningKnowledgePoints(){
+      examUserCoursewareLearningKnowledgePoints({}).then(response => {
+        this.$set(this, 'topList', [{knowledgePointName:'总览',knowledgePointId:''},...response.data])
+        this.leftExamUserCoursewareLearningList();
+        this.rightExamUserCoursewareLearningList();
+        this.examUserPracticeList();
+      })
+    },
+    //换算分钟
+    secondsToMinutes(totalSeconds) {
+      if (typeof totalSeconds !== 'number' || totalSeconds <= 0) {
+        return 1;
+      }
+      return Math.ceil(totalSeconds / 60);
     },
   },
 }
@@ -230,6 +227,7 @@ export default {
   }
 
   .tab-scroll-wrap {
+    height:60px;
     overflow-x: auto;
     padding-bottom: 4px;
     margin:20px 0 0 20px;
@@ -262,16 +260,16 @@ export default {
   }
 
   .resource-body {
-    height:800px;
+    height:910px;
     display: flex;
     .left-max-big-box{
       flex:1;
       display: flex;
       flex-direction: column;
       overflow: hidden;
-      padding:20px 0 20px 20px;
+      padding:15px 0 20px 20px;
       .left-top-big-box{
-        height:400px;
+        height:620px;
         display: flex;
         flex-direction: column;
         overflow: hidden;
@@ -280,11 +278,17 @@ export default {
         margin-bottom:20px;
         margin-right:20px;
         padding-bottom:20px;
+        .null-p{
+          text-align: center;
+          line-height:400px;
+          color:#999;
+          font-size:14px;
+        }
         .for-big-box{
           margin:12px 14px 0 20px;
           background-color: rgba(1, 131, 250, 0.1);
           border-radius:6px;
-          padding:18px 20px;
+          padding:24px 20px;
           position: relative;
           cursor: pointer;
           p:nth-child(1){
@@ -311,13 +315,18 @@ export default {
             color:#fff;
           }
           .colorA{
+            border:1px solid #0183fa;
+            background-color: #fff!important;
+            color:#0183fa!important;
+          }
+          .colorB{
             background-color: #0183fa!important;
             color:#fff!important;
           }
         }
       }
       .left-bottom-big-box{
-        height:400px;
+        height:235px;
         display: flex;
         flex-direction: column;
         overflow: hidden;
@@ -325,12 +334,19 @@ export default {
         margin-right:20px;
         box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
         padding-bottom:20px;
+        .null-p{
+          text-align: center;
+          line-height:140px;
+          color:#999;
+          font-size:14px;
+        }
         .for-big-box{
           margin:12px 14px 0 20px;
           background-color: rgba(1, 131, 250, 0.1);
           border-radius:6px;
           padding:16px 20px;
           position: relative;
+          cursor: pointer;
           .for-flex-box{
             display: flex;
             color:#0183fa;
@@ -376,9 +392,15 @@ export default {
       width:740px;
       border-radius:10px;
       box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
-      margin:20px 20px 20px 0;
+      margin:15px 20px 20px 0;
       .big-content-box-1{
         flex:1;
+        .null-p{
+          text-align: center;
+          line-height:400px;
+          color:#999;
+          font-size:14px;
+        }
         .for-big-box{
           margin:12px 0 0 20px;
           display: inline-block;
@@ -386,6 +408,7 @@ export default {
           border-radius:6px;
           overflow: hidden;
           position: relative;
+          cursor: pointer;
           img{
             width:346px;
             height:180px;
@@ -423,6 +446,11 @@ export default {
               text-align: center;
             }
             .colorA{
+              border:1px solid #0183fa;
+              background-color: #fff!important;
+              color:#0183fa!important;
+            }
+            .colorB{
               background-color: #0183fa!important;
               color:#fff!important;
             }
@@ -437,26 +465,21 @@ export default {
       p{
         line-height:60px;
         font-size:16px;
-        font-weight: 700;
       }
       p:nth-child(1){
         flex:1;
+        font-weight: 700;
       }
       p:nth-child(2){
         cursor: pointer;
         color:#0183fa;
+        font-size:15px;
       }
     }
     .big-content-box{
       flex:1;
       display: flex;
       flex-direction: column;
-      .null-p{
-        text-align: center;
-        line-height:200px;
-        color:#999;
-        font-size:14px;
-      }
     }
   }
 }

+ 164 - 106
src/views/safetyEducationExaminationNew/workbench/TaskCard.vue

@@ -24,9 +24,9 @@
           <p>待完成的学习任务</p>
         </div>
         <div class="bottom-content-box scrollbar-box">
-          <div class="bottom-big-box-2" v-for="(item,index) in studyMinList">
-            <p>{{item.studyMinListData1}}</p>
-            <p >{{item.studyMinListData2}}丨{{item.studyMinListData2==1?'待完成':(item.studyMinListData3==2?'进行中':(item.studyMinListData3==3?'已完成':''))}}</p>
+          <div class="bottom-big-box-2" v-for="(item,index) in studyMinList" @click="tableButton(2,item)">
+            <p>{{item.courseName}}</p>
+            <p >{{item.deptName}}丨{{item.learnStatus==0?'待完成':(item.learnStatus==1?'进行中':(item.learnStatus==2?'已完成':''))}}</p>
           </div>
         </div>
       </div>
@@ -36,41 +36,41 @@
           <p>待完成的考前模拟练习</p>
         </div>
         <div class="bottom-content-box scrollbar-box">
-          <div class="bottom-big-box-3" v-for="(item,index) in examinationMinList">
-            <p>{{item.examinationMinListData1}}</p>
-            <p >最高成绩 {{item.examinationMinListData2}}</p>
+          <div class="bottom-big-box-3" v-for="(item,index) in examinationMinList" @click="tableButton(3,item)">
+            <p>{{item.examName}}</p>
+            <p >最高成绩 {{item.maxScore}}</p>
           </div>
         </div>
       </div>
       <div class="for-max-big-box" v-for="(item,index) in dataList" :key="index">
         <div class="year-card-top-title-box">
-          <p>{{item.minListName}}</p>
+          <p>{{item.examTypeName}}</p>
           <p>满足前置条件后可参加考试</p>
         </div>
         <div class="bottom-content-box scrollbar-box">
-          <div class="bottom-big-box-4" v-if="item.minListType1 == 0">
+          <div class="bottom-big-box-4" v-if="item.needStudy">
             <p>学时要求</p>
-            <p class="colorA">开始学习</p>
+            <p class="colorA" @click="tableButton(1,item)">开始学习</p>
           </div>
-          <div class="bottom-big-box-4" v-if="item.minListType2 == 0">
+          <div class="bottom-big-box-4" v-if="item.examStudy">
             <p>考前学习</p>
-            <p class="colorA">开始学习</p>
+            <p class="colorA" v-if="!item.needStudy" @click="tableButton(2,item)">开始学习</p>
+            <p class="colorC" v-if="item.needStudy">待满足学时要求后解锁</p>
           </div>
-          <div class="bottom-big-box-4" v-if="item.minListType3 == 0">
+          <div class="bottom-big-box-4" v-if="item.mockExam">
             <p>模拟考试</p>
-            <p class="colorC" v-if="item.minListType1 == 0||item.minListType2 == 0">待完成学习任务后解锁</p>
-            <p class="colorA" v-if="item.minListType1 == 1&&item.minListType2 == 1">开始考试</p>
+            <p class="colorA" v-if="!item.examStudy" @click="tableButton(3,item)">开始考试</p>
+            <p class="colorC" v-if="item.examStudy">待完成学习任务后解锁</p>
           </div>
           <div class="bottom-big-box-4">
             <p>考试状态</p>
-            <p class="colorC" v-if="item.minListType3 == 0">待通过模拟考试后解锁</p>
-            <p class="colorA" v-if="item.minListType3 == 1 && item.minListType4 == 0">开始考试</p>
-            <p class="colorB" v-if="item.minListType4 == 2">考试未通过</p>
+            <p class="colorA" v-if="item.examKind==1&&item.conditionType == 4" @click="tableButton(4,item)">开始考试</p>
+            <p class="colorC" v-if="item.examKind==1&&item.conditionType != 4">待通过模拟考试后解锁</p>
+            <p class="colorB" v-if="item.examKind==2">考试未通过</p>
           </div>
-          <div class="bottom-big-box-4" v-if="item.minListType4 == 2">
+          <div class="bottom-big-box-4" v-if="item.examKind == 2">
             <p>参加补考</p>
-            <p class="colorA" v-if="item.minListType5 == 0">开始考试</p>
-            <p class="colorB" v-if="item.minListType5 == 2">考试未通过</p>
+            <p class="colorA" @click="tableButton(4,item)">开始考试</p>
           </div>
         </div>
       </div>
@@ -79,6 +79,10 @@
 </template>
 
 <script>
+  import {
+    examUserCoursewareLearningRestart,
+    examUserCourseLearningList,examUserExamMockList,examUserExamList,examUserExamStart,
+  } from "@/api/safetyEducationExaminationNew/index";
 export default {
   name: 'TaskCard',
   data() {
@@ -102,93 +106,147 @@ export default {
           yearMinListData3:'99',
         },
       ],
-      studyMinList:[
-        {
-          studyMinListData1:'课程任务名称',
-          studyMinListData2:'来源单位',
-          studyMinListData3:'1',
-        },
-        {
-          studyMinListData1:'课程任务名称',
-          studyMinListData2:'来源单位',
-          studyMinListData3:'2',
-        },
-        {
-          studyMinListData1:'课程任务名称',
-          studyMinListData2:'来源单位',
-          studyMinListData3:'3',
-        },
-      ],
-      examinationMinList:[
-        {
-          examinationMinListData1:'试卷名称',
-          examinationMinListData2:'40',
-        },
-        {
-          examinationMinListData1:'试卷名称2',
-          examinationMinListData2:'60',
-        },
-      ],
-      dataList:[
-        {
-          minListName:'常规考试',
-          minListType1:0,
-          minListType2:0,
-          minListType3:0,
-          minListType4:0,
-          minListType5:0,
-        },
-        {
-          minListName:'常规考试',
-          minListType1:0,
-          minListType2:1,
-          minListType3:1,
-          minListType4:0,
-          minListType5:0,
-        },
-        {
-          minListName:'常规考试',
-          minListType1:1,
-          minListType2:0,
-          minListType3:0,
-          minListType4:0,
-          minListType5:0,
-        },
-        {
-          minListName:'常规考试',
-          minListType1:1,
-          minListType2:1,
-          minListType3:0,
-          minListType4:0,
-          minListType5:0,
-        },
-        {
-          minListName:'常规考试',
-          minListType1:1,
-          minListType2:1,
-          minListType3:1,
-          minListType4:0,
-          minListType5:0,
-        },
-        {
-          minListName:'常规考试',
-          minListType1:1,
-          minListType2:1,
-          minListType3:1,
-          minListType4:2,
-          minListType5:0,
-        },
-        {
-          minListName:'常规考试',
-          minListType1:1,
-          minListType2:1,
-          minListType3:1,
-          minListType4:2,
-          minListType5:2,
-        },
-      ],
+      studyMinList:[],
+      examinationMinList:[],
+      dataList:[],
     }
-  }
+  },
+  created() {
+
+  },
+  mounted() {
+    this.initialization();
+  },
+  methods: {
+    initialization(){
+      this.examUserCourseLearningList();
+      this.examUserExamMockList();
+      this.examUserExamList();
+    },
+    //考试跳转
+    tableButton(type,item){
+      let self = this;
+      if(type == 1){
+        //刷题
+        if(item.learnStatus == 2){
+          this.$confirm('该课件已学完,是否重置进度重新学习?', "警告", {
+            confirmButtonText: "确认",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(function() {
+          }).then(() => {
+            examUserCoursewareLearningRestart({coursewareId:item.coursewareId}).then(response => {
+              self.$router.push({
+                name: 'learningMaterials',
+                params: {
+                  coursewareId: item.coursewareId,
+                }
+              })
+            });
+          }).catch(() => {});
+        }else{
+          this.$router.push({
+            name: 'learningMaterials',
+            params: {
+              coursewareId: item.coursewareId,
+            }
+          })
+        }
+      }else if(type == 2){
+        //学习课程
+        this.$router.push({
+          name: 'learningCourse',
+          params: {
+            courseId: item.courseId,
+            examId: item.examId,
+          }
+        })
+      }else if(type == 3){
+        //模拟考试
+        if(item.attemptId){
+          this.$router.push({
+            name: 'mockExam',
+            params: {
+              examId: item.examId,
+              attemptId: item.attemptId,
+            }
+          })
+        }else{
+          examUserExamStart({examId:item.examId,examScene:2,}).then(response => {
+            if(response.data.attemptId){
+              this.$router.push({
+                name: 'mockExam',
+                params: {
+                  examId: item.examId,
+                  attemptId: response.data.attemptId,
+                }
+              })
+            }else{
+              this.msgError(response.message)
+            }
+          })
+        }
+      }else if(type == 4){
+        //在线考试//补考
+        if(item.attemptId){
+          this.$router.push({
+            name: 'startTheExam',
+            params: {
+              attemptId: item.attemptId,
+              type: '1',
+              examKind:item.examKind,
+            }
+          })
+        }else{
+          examUserExamStart({examId:item.examId,examScene:1,}).then(response => {
+            if(response.data.attemptId){
+              this.$router.push({
+                name: 'startTheExam',
+                params: {
+                  examId: item.examId,
+                  attemptId: response.data.attemptId,
+                  type: '1',
+                  examKind:item.examKind,
+                }
+              })
+            }else{
+              this.msgError(response.message)
+            }
+          })
+        }
+      }
+    },
+    //学习任务
+    examUserCourseLearningList(){
+      let obj = {
+        page:1,
+        pageSize:20,
+      }
+      examUserCourseLearningList(obj).then(response => {
+        this.$set(this, 'studyMinList', response.data.records)
+      })
+    },
+    //模拟考试
+    examUserExamMockList(){
+      let obj = {
+        page:1,
+        pageSize:20,
+      }
+      examUserExamMockList(obj).then(response => {
+        this.$set(this, 'examinationMinList', response.data.records)
+      })
+    },
+    //在线考试
+    examUserExamList(){
+      let obj = {
+        page:1,
+        pageSize:5,
+      }
+      examUserExamList(obj).then(response => {
+        this.$set(this, 'dataList', response.data.records)
+      })
+    },
+  },
 }
 </script>