dedsudiyu 6 dias atrás
pai
commit
76dce2bfa2

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

@@ -15,7 +15,7 @@
       </div>
       <basicSettings ref="basicSettings" class="right-max-big-box" v-show="buttonType == 1"></basicSettings>
       <studyCourses ref="studyCourses" class="right-max-big-box" v-show="buttonType == 2"></studyCourses>
-      <afterClassEvaluation class="right-max-big-box" v-show="buttonType == 3"></afterClassEvaluation>
+      <afterClassEvaluation ref="afterClassEvaluation" class="right-max-big-box" v-show="buttonType == 3"></afterClassEvaluation>
     </div>
   </div>
 </template>
@@ -46,7 +46,7 @@
         buttonList:[
           {name:'基本设置',value:'1'},
           {name:'学习课件',value:'2'},
-          // {name:'课后考核',value:'3'},
+          {name:'课后考核',value:'3'},
         ],
         newData:{},
         showType:false,
@@ -131,9 +131,25 @@
       //切换按钮
       tableButton(val){
         if(this.buttonType != val){
+          if(val == 3){
+            this.$refs.afterClassEvaluation.syncDataList(this.processData(JSON.parse(JSON.stringify(this.$refs.studyCourses.dataList))))
+          }
           this.$set(this,'buttonType',val);
         }
       },
+      processData(rawList) {
+        if (!Array.isArray(rawList)) return []
+
+        return rawList.map(item => ({
+          data1: item.data1,
+          knowledgePointId: item.knowledgePointId,
+          nameText: (item.minList || [])
+            .map(min => min.minData1)
+            .join(','),
+          questionScore:0,
+          questionIds:[]
+        }))
+      },
       //重置
       resetButton(){
         let self = this;
@@ -211,6 +227,7 @@
           this.$parent.tableButton(6);
         });
       },
+      //课后考核页面获取获取
     },
   }
 </script>

+ 97 - 4
src/views/safetyEducationExaminationNew/courseManagement/courseManagement/afterClassEvaluation.vue

@@ -2,11 +2,56 @@
   <div class="page-container courseManagement-afterClassEvaluation">
     <div class="content-box scrollbar-box">
       <el-form class="add-form-box" :model="newData" ref="form" :rules="rules" label-width="120px">
-        <el-form-item label="名称" prop="name">
-          <el-input v-model="newData.name" placeholder="请输入名称" maxLength="20" style="width:500px;"></el-input>
+        <el-form-item label="考核配置" prop="name">
+          <el-switch
+            :active-value="1"
+            :inactive-value="0"
+            v-model="newData.switchType"
+            active-color="#0183FB"
+            inactive-color="#AAAAAA">
+          </el-switch>
+          <span style="line-height:40px;margin-left:10px;color:#666;">课后考核启用后,学员完成课程课件学习后,需答完全部考核题目</span>
+        </el-form-item>
+        <el-form-item label="选题配置" prop="name" v-if="newData.switchType == 1">
+          <p style="line-height:40px;color:#666;">按课件所属知识点手动配置题目</p>
+          <div style="width:1140px;min-height:400px;max-height:580px;display: flex;">
+            <el-table class="table-box"  border :data="newData.dataList">
+              <el-table-column label="知识点" prop="data1" width="200"  show-overflow-tooltip/>
+              <el-table-column label="课件名称" prop="nameText" show-overflow-tooltip/>
+              <el-table-column label="已选题目" prop="questionScore" width="200" show-overflow-tooltip>
+                <template slot-scope="scope">
+                  <span>{{ scope.row.questionScore }}道</span>
+                </template>
+              </el-table-column>
+              <el-table-column label="操作" width="140" show-overflow-tooltip>
+                <template slot-scope="scope">
+                  <div class="table-button-box">
+                    <p class="table-button-null"></p>
+                    <p class="table-button-p"
+                       @click="addFixed(scope.row,scope.$index)"
+                    >配置选题</p>
+                    <p class="table-button-null"></p>
+                  </div>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
         </el-form-item>
       </el-form>
     </div>
+    <!--选择试题-->
+    <el-drawer
+      size="100%"
+      custom-class="course-select-drawer"
+      :append-to-body="true"
+      :show-close="false"
+      title="固定选题"
+      ref="drawer"
+      :visible.sync="drawer"
+      direction="rtl"
+    >
+      <courseDrawerItem v-if="drawer" :drawerPropsData="drawerPropsData"/>
+    </el-drawer>
   </div>
 </template>
 
@@ -14,15 +59,23 @@
   //import { getDicts } from "@/api/commonality/noPermission";
   //import { systemUserSelect } from "@/api/commonality/permission";
   //import { getInfo } from "@/api/basicsModules/index";
+  import courseDrawerItem from './courseDrawerItem.vue'
   export default {
     name: 'afterClassEvaluation',
+    components: { courseDrawerItem },
     props:{
       propsData:{},
     },
     data(){
       return{
-        newData:{},
-        rules:{}
+        newData:{
+          switchType:0,
+          dataList:[],
+        },
+        rules:{},
+        //弹窗相关
+        drawer: false,
+        drawerPropsData:{},
       }
     },
     created(){
@@ -32,6 +85,36 @@
 
     },
     methods:{
+      //更新父级数据
+      syncDataList(incoming) {
+        if (!Array.isArray(incoming)) return
+        const localMap = new Map(
+          this.newData.dataList.map(item => [item.knowledgePointId, item])
+        )
+        this.newData.dataList = incoming.map(
+          item => localMap.get(item.knowledgePointId) || item
+        )
+      },
+      addFixed(row,index) {
+        this.$set(this,'drawerPropsData',{
+          titleName:row.name,
+          knowledgePointId:row.id,
+          questionScore:row.questionScore,
+          questionIds:row.questionIds,
+          index:index
+        });
+        this.drawer = true
+      },
+      //弹窗返回
+      drawerReturnButton(){
+        this.$refs.drawer.closeDrawer();
+      },
+      //弹窗确定
+      drawerConfirmButton(obj){
+        this.newData.dataList[obj.index].questionScore = obj.questionIds.length;
+        this.newData.dataList[obj.index].questionIds = [...obj.questionIds];
+        this.$refs.drawer.closeDrawer();
+      },
       // 返回按钮
       backPage(){
         this.$parent.tableButton(6);
@@ -57,3 +140,13 @@
     }
   }
 </style>
+<style lang="scss">
+  .course-select-drawer{
+    .el-drawer__body{
+      padding:0;
+    }
+    .el-drawer__header{
+      margin:0;
+    }
+  }
+</style>

+ 531 - 0
src/views/safetyEducationExaminationNew/courseManagement/courseManagement/courseDrawerItem.vue

@@ -0,0 +1,531 @@
+<!-- 固定选题 Drawer 内容 -->
+<template>
+  <div class="courseDrawerItem-container">
+    <div class="left-max-big-box">
+      <div class="left-title-p">{{titleName}}</div>
+      <div class="page-form-title-box">
+        <el-form :model="leftQueryParams" class="form-box" ref="queryForm"
+                 :inline="true" style="width:100%;">
+          <el-form-item label="" prop="deptId">
+            <el-cascader
+              style="width: 180px"
+              v-model="leftQueryParams.deptId"
+              :options="optionListA"
+              :props="{
+                    emitPath:false,
+                    checkStrictly: true,
+                    value: 'deptId',
+                    label: 'deptName',
+                    children: 'child',
+                  }"
+              :show-all-levels="false"
+              filterable
+              placeholder="来源"
+            ></el-cascader>
+          </el-form-item>
+          <el-form-item label="" prop="questionType">
+            <el-select v-model="leftQueryParams.questionType" placeholder="题型" style="width: 140px">
+              <el-option
+                v-for="dict in optionListB"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="difficulty">
+            <el-select v-model="leftQueryParams.difficulty" placeholder="难度" style="width: 140px">
+              <el-option
+                v-for="dict in optionListC"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="questionContent">
+            <el-input
+              maxLength="30"
+              v-model="leftQueryParams.questionContent"
+              placeholder="搜索试题"
+              style="width: 140px"
+            />
+          </el-form-item>
+          <p class="page-inquire-common-style-button" @click="leftHandleQuery">查询</p>
+          <p class="page-reset-common-style-button" @click="leftResetQuery">重置</p>
+        </el-form>
+      </div>
+      <div class="page-content-box">
+        <el-table class="table-box" border :data="leftDataList"
+                  ref="leftMultipleTable" :row-key="leftGetRowKey" @selection-change="leftHandleSelectionChange">
+          <el-table-column type="selection" width="55" :reserve-selection="true"></el-table-column>
+          <el-table-column label="题干" prop="questionContent"  show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span style="color:#0183fa;cursor: pointer;" @click="tableButton(2,scope.row)">{{ cleanRichText(scope.row.questionContent) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="题型" prop="questionType" width="140" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span>{{ scope.row.questionType == 1?'单选题':(scope.row.questionType == 2?'多选题':(scope.row.questionType == 3?'判断题':'')) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="难度" prop="content" width="140" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span>{{ scope.row.difficulty == 1?'简单':(scope.row.difficulty == 2?'一般':(scope.row.difficulty == 3?'较难':(scope.row.difficulty == 4?'极难':''))) }}</span>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination :page-sizes="[20, 30, 40, 50]"
+                    v-show="leftTotal>0"
+                    :total="leftTotal"
+                    :page.sync="leftQueryParams.page"
+                    :limit.sync="leftQueryParams.pageSize"
+                    @pagination="leftGetList"
+        />
+      </div>
+    </div>
+    <div class="center-max-big-box">
+      <p></p>
+      <p class="el-icon-arrow-right" @click="addButton()"></p>
+      <p class="el-icon-arrow-left" @click="delButton()"></p>
+      <p></p>
+    </div>
+    <div class="right-max-big-box">
+      <div class="right-title-box">
+        <p>总题目数:{{maxNum}}</p>
+        <!--<p>总分:{{maxScore}}</p>-->
+        <!--<p>还需设置 {{gapScore}} 分的题目</p>-->
+      </div>
+      <div class="page-form-title-box">
+        <el-form :model="rightQueryParams" class="form-box" ref="queryForm"
+                 :inline="true" style="width:100%;">
+          <el-form-item label="" prop="deptId">
+            <el-cascader
+              style="width: 180px"
+              v-model="rightQueryParams.deptId"
+              :options="optionListA"
+              :props="{
+                    emitPath:false,
+                    checkStrictly: true,
+                    value: 'deptId',
+                    label: 'deptName',
+                    children: 'child',
+                  }"
+              :show-all-levels="false"
+              filterable
+              placeholder="来源"
+            ></el-cascader>
+          </el-form-item>
+          <el-form-item label="" prop="questionType">
+            <el-select v-model="rightQueryParams.questionType" placeholder="题型" style="width: 140px">
+              <el-option
+                v-for="dict in optionListB"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="difficulty">
+            <el-select v-model="rightQueryParams.difficulty" placeholder="难度" style="width: 140px">
+              <el-option
+                v-for="dict in optionListC"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="questionContent">
+            <el-input
+              maxLength="30"
+              v-model="rightQueryParams.questionContent"
+              placeholder="搜索试题"
+              style="width: 140px"
+            />
+          </el-form-item>
+          <p class="page-inquire-common-style-button" @click="rightHandleQuery">查询</p>
+          <p class="page-reset-common-style-button" @click="rightResetQuery">重置</p>
+        </el-form>
+      </div>
+      <div class="page-content-box">
+        <el-table class="table-box" border :data="rightDataList"
+                  ref="rightMultipleTable" :row-key="rightGetRowKey" @selection-change="rightHandleSelectionChange">
+          <el-table-column type="selection" width="55" :reserve-selection="true"></el-table-column>
+          <el-table-column label="题干" prop="questionContent"  show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span style="color:#0183fa;cursor: pointer;" @click="tableButton(2,scope.row)">{{ cleanRichText(scope.row.questionContent) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="题型" prop="questionType" width="140" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span>{{ scope.row.questionType == 1?'单选题':(scope.row.questionType == 2?'多选题':(scope.row.questionType == 3?'判断题':'')) }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="难度" prop="content" width="140" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span>{{ scope.row.difficulty == 1?'简单':(scope.row.difficulty == 2?'一般':(scope.row.difficulty == 3?'较难':(scope.row.difficulty == 4?'极难':''))) }}</span>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination :page-sizes="[20, 30, 40, 50]"
+                    v-show="rightTotal>0"
+                    :total="rightTotal"
+                    :page.sync="rightQueryParams.page"
+                    :limit.sync="rightQueryParams.pageSize"
+                    @pagination="rightGetList"
+        />
+      </div>
+    </div>
+    <div class="button-position-box">
+      <p class="button-1" @click="outButton()">返回</p>
+      <!--<p class="button-2" @click="resetButton()">重置</p>-->
+      <p class="button-3" @click="saveButton()">保存</p>
+    </div>
+  </div>
+</template>
+
+<script>
+  import {
+    systemDeptCurrentDept,examElQuestionBankList,
+  } from "@/api/safetyEducationExaminationNew/index";
+  export default {
+    name: 'drawerItem',
+    props: {
+      drawerPropsData:{},
+    },
+    data() {
+      return {
+        titleName:'',
+        knowledgePointId:'',
+        maxNum:0,
+        maxScore:0,
+        questionScore:0,
+        checkIndex:null,
+        // gapScore:0,
+        optionListA:[],
+        optionListB:[{value:1,label:'单选'},{value:2,label:'多选'},{value:3,label:'判断'}],
+        optionListC:[{value:1,label:'简单'},{value:2,label:'一般'},{value:3,label:'较难'},{value:4,label:'极难'}],
+        leftQueryParams:{
+          page:1,
+          pageSize:20,
+          questionContent:'',
+          difficulty:null,
+          questionType:null,
+          deptId:null,
+        },
+        leftDataList:[],
+        leftTotal:0,
+        rightQueryParams:{
+          page:1,
+          pageSize:20,
+          questionContent:'',
+          difficulty:null,
+          questionType:null,
+          deptId:null,
+        },
+        rightDataList:[],
+        rightTotal:0,
+        //过滤/显示的题目ids
+        questionIds:[],
+        leftMultipleSelection:[],
+        rightMultipleSelection:[],
+      }
+    },
+    mounted() {
+      this.$set(this,'titleName',this.drawerPropsData.name);
+      this.$set(this,'knowledgePointId',this.drawerPropsData.knowledgePointId);
+      this.$set(this,'questionScore',this.drawerPropsData.questionScore);
+      this.$set(this,'checkIndex',this.drawerPropsData.index);
+      this.$set(this,'questionIds',this.drawerPropsData.questionIds?this.drawerPropsData.questionIds:[]);
+      this.$set(this,'maxScore',this.accMul(this.drawerPropsData.questionScore,this.drawerPropsData.questionIds.length));
+      this.leftGetList()
+      this.rightGetList()
+      this.systemDeptCurrentDept()
+    },
+    methods: {
+      addButton(){
+        let self = this;
+        if(!self.leftMultipleSelection[0]){
+          this.msgError('请勾选左侧题目')
+          return
+        }
+        if(self.leftMultipleSelection.length + this.questionIds.length > 1000){
+          this.msgError('最多添加1000道题目')
+          return
+        }
+        let list = [];
+        for(let i=0;i<self.leftMultipleSelection.length;i++){
+          list.push(self.leftMultipleSelection[i].id)
+        }
+        this.$set(this,'questionIds',JSON.parse(JSON.stringify([...this.questionIds,...list])));
+        this.$set(this,'leftMultipleSelection',[]);
+        this.$set(this,'rightMultipleSelection',[]);
+        this.$refs.leftMultipleTable.clearSelection();
+        this.$refs.rightMultipleTable.clearSelection();
+        this.leftHandleQuery();
+        this.rightHandleQuery();
+      },
+      delButton(){
+        let self = this;
+        if(!self.rightMultipleSelection[0]){
+          this.msgError('请勾选右侧题目')
+          return
+        }
+        let list = [];
+        for(let i=0;i<self.rightMultipleSelection.length;i++){
+          list.push(self.rightMultipleSelection[i].id)
+        }
+        this.$set(this,'questionIds',JSON.parse(JSON.stringify(this.questionIds.filter(item => !list.includes(item)))));
+        this.$set(this,'leftMultipleSelection',[]);
+        this.$set(this,'rightMultipleSelection',[]);
+        this.$refs.leftMultipleTable.clearSelection();
+        this.$refs.rightMultipleTable.clearSelection();
+        this.leftHandleQuery();
+        this.rightHandleQuery();
+      },
+      //查询按钮
+      leftHandleQuery(){
+        this.$set(this.leftQueryParams,'page',1);
+        this.leftGetList();
+      },
+      //重置按钮
+      leftResetQuery(){
+        this.$set(this,'leftQueryParams',{
+          page:1,
+          pageSize:20,
+          questionContent:'',
+          difficulty:null,
+          questionType:null,
+          deptId:null,
+        });
+        this.leftGetList();
+      },
+      leftGetList(){
+        let obj = JSON.parse(JSON.stringify(this.leftQueryParams))
+        obj.knowledgePointId = this.knowledgePointId;
+        obj.excludeQuestionIds = this.questionIds;
+        examElQuestionBankList(obj).then(response => {
+          this.$set(this,'leftDataList',response.data.records);
+          this.$set(this,'leftTotal',response.data.total);
+        });
+      },
+      leftGetRowKey(row) {
+        return row.id;
+      },
+      leftHandleSelectionChange(val) {
+        this.leftMultipleSelection = val;
+      },
+      //查询按钮
+      rightHandleQuery(){
+        this.$set(this.rightQueryParams,'page',1);
+        this.rightGetList();
+      },
+      //重置按钮
+      rightResetQuery(){
+        this.$set(this,'rightQueryParams',{
+          page:1,
+          pageSize:20,
+          questionContent:'',
+          difficulty:null,
+          questionType:null,
+          deptId:null,
+        });
+        this.rightGetList();
+      },
+      rightGetList(){
+        if(!this.questionIds[0]){
+          this.$set(this,'rightDataList',[]);
+          this.$set(this,'rightTotal',0);
+          this.$set(this,'maxScore',0);
+          return
+        }
+        let obj = JSON.parse(JSON.stringify(this.rightQueryParams))
+        obj.knowledgePointId = this.knowledgePointId;
+        obj.includeQuestionIds = this.questionIds;
+        examElQuestionBankList(obj).then(response => {
+          this.$set(this,'rightDataList',response.data.records);
+          this.$set(this,'rightTotal',response.data.total);
+          this.$set(this,'maxNum',response.data.total);
+          console.log('this.drawerPropsData.questionScore',this.drawerPropsData.questionScore)
+          console.log('response.data.total',response.data.total)
+          this.$set(this,'maxScore',this.accMul(this.drawerPropsData.questionScore,response.data.total));
+        });
+      },
+      rightGetRowKey(row) {
+        return row.id;
+      },
+      rightHandleSelectionChange(val) {
+        this.rightMultipleSelection = val;
+      },
+      //学院列表
+      systemDeptCurrentDept(){
+        systemDeptCurrentDept({}).then(response => {
+          const list = response.data || [];
+          this.formatTreeData(list);
+          this.$set(this,'optionListA',list);
+        });
+      },
+      //清洗富文本
+      cleanRichText(htmlStr, maxLength = 50) {
+        if (!htmlStr) return '';
+        const tempDiv = document.createElement('div');
+        tempDiv.innerHTML = htmlStr;
+        let text = tempDiv.textContent || tempDiv.innerText || '';
+        text = text.replace(/\s+/g, ' ').trim();
+        if (maxLength && text.length > maxLength) {
+          return text.substring(0, maxLength) + '...';
+        }
+        return text;
+      },
+      //返回
+      outButton(){
+        this.$parent.$parent.drawerReturnButton();
+      },
+      //重置
+      resetButton(){
+
+      },
+      //保存
+      saveButton(){
+        if(!this.questionIds[0]){
+          this.msgError('请选择题目')
+          return
+        }
+        let obj = {
+          index:this.checkIndex,
+          questionIds:this.questionIds
+        }
+        this.$parent.$parent.drawerConfirmButton(JSON.parse(JSON.stringify(obj)))
+      },
+      //乘法
+      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)
+      },
+    },
+  }
+</script>
+
+<style scoped lang="scss">
+  .courseDrawerItem-container {
+    flex:1;
+    display: flex;
+    overflow: hidden;
+    .left-max-big-box{
+      flex:1;
+      display: flex;
+      flex-direction: column;
+      overflow: hidden;
+      border-right:1px solid #dedede;
+      .left-title-p{
+        height:50px;
+        border-bottom:1px solid #dedede;
+        line-height:50px;
+        padding: 0 20px;
+        color:#0183fa;
+        font-size:16px;
+      }
+    }
+    .center-max-big-box{
+      width:60px;
+      display: flex;
+      flex-direction: column;
+      overflow: hidden;
+      p:nth-child(1){
+        flex: 1;
+      }
+      p:nth-child(2){
+        width:40px;
+        height:40px;
+        line-height:40px;
+        text-align: center;
+        background-color: #0183fa;
+        color:#fff;
+        border-radius:50%;
+        margin:0 0 0 10px;
+        cursor: pointer;
+      }
+      p:nth-child(3){
+        width:40px;
+        height:40px;
+        line-height:40px;
+        text-align: center;
+        background-color: #0183fa;
+        color:#fff;
+        border-radius:50%;
+        margin:40px 0 0 10px;
+        cursor: pointer;
+      }
+      p:nth-child(4){
+        flex: 1;
+      }
+    }
+    .right-max-big-box{
+      flex:1;
+      display: flex;
+      flex-direction: column;
+      overflow: hidden;
+      border-left:1px solid #dedede;
+      .right-title-box{
+        display: flex;
+        height:50px;
+        border-bottom:1px solid #dedede;
+        line-height:50px;
+        padding: 0 20px;
+        p{
+          margin-right:40px;
+          color:#0183fa;
+          font-size:14px;
+          font-weight:700;
+        }
+      }
+    }
+    .button-position-box{
+      position: absolute;
+      top:0;
+      right:10px;
+      display: flex;
+      .button-1{
+        border:1px solid #999;
+        color:#999;
+        font-size:14px;
+        text-align: center;
+        line-height:40px;
+        height:40px;
+        width:80px;
+        border-radius:4px;
+        margin:10px 10px 0 0;
+        cursor: pointer;
+      }
+      .button-2{
+        border:1px solid #999;
+        background-color: #999;
+        color:#fff;
+        font-size:14px;
+        text-align: center;
+        line-height:40px;
+        height:40px;
+        width:80px;
+        border-radius:4px;
+        margin:10px 10px 0 0;
+        cursor: pointer;
+      }
+      .button-3{
+        border:1px solid #0183fa;
+        background-color: #0183fa;
+        color:#fff;
+        font-size:14px;
+        text-align: center;
+        line-height:40px;
+        height:40px;
+        width:80px;
+        border-radius:4px;
+        margin:10px 0 0 0;
+        cursor: pointer;
+      }
+    }
+  }
+</style>

+ 27 - 6
src/views/safetyEducationExaminationNew/publicConfiguration/basicConfiguration/examinationConfiguration.vue

@@ -21,7 +21,17 @@
         </div>
         <div class="text-box" v-else>
           <p>{{item.examTypeName}}</p>
-          <p @click="editorButton(index)" v-if="item.examTypeCode != 'CLASSIFIED'&&item.examTypeCode != 'yzyh'&&item.examTypeCode != 'STUDENT'">修改</p>
+          <div>
+            <el-switch
+              :active-value="1"
+              :inactive-value="0"
+              v-model="item.switchType"
+              active-color="#0183FB"
+              inactive-color="#AAAAAA">
+            </el-switch>
+          </div>
+          <p>{{item.examTypeName}}</p>
+          <p @click="editorButton(index)">修改</p>
           <p @click="delButton(index)" v-if="item.examTypeCode != 'CLASSIFIED'&&item.examTypeCode != 'yzyh'&&item.examTypeCode != 'STUDENT'">删除</p>
         </div>
       </div>
@@ -158,7 +168,7 @@
       }
     }
     .title-p{
-      width:600px;
+      width:800px;
       line-height:60px;
       //background-color: #dedede;
       border-bottom:1px solid #dedede;
@@ -170,7 +180,7 @@
       flex:1;
       padding:0 20px 0 20px;
       .for-box{
-        width:600px;
+        width:800px;
         border-bottom:1px solid #dedede;
         padding:0 20px 0 0;
         margin-left:20px;
@@ -180,12 +190,23 @@
             font-size:14px;
           }
           p:nth-child(1){
-            flex:1;
+            width:380px;
             line-height:60px;
             font-weight:600;
             margin-left:20px;
           }
-          p:nth-child(2){
+          div:nth-child(2){
+            width:60px;
+            padding-top:17px;
+            padding-left:10px;
+          }
+          p:nth-child(3){
+            width:160px;
+            text-align: center;
+            line-height:60px;
+            font-weight:600;
+          }
+          p:nth-child(4){
             height:40px;
             line-height:38px;
             margin:10px 0 0 10px;
@@ -196,7 +217,7 @@
             color:#fff;
             cursor: pointer;
           }
-          p:nth-child(3){
+          p:nth-child(5){
             height:40px;
             line-height:38px;
             margin:10px 0 0 10px;

+ 11 - 0
src/views/safetyEducationExaminationNew/publicConfiguration/basicConfiguration/otherConfiguration.vue

@@ -34,6 +34,16 @@
           </el-form-item>
           <p class="form-text-p" style="margin:0 0 0 20px;">天,未处理则自动审批通过</p>
         </div>
+        <div class="form-big-box">
+          <p class="form-text-p" style="margin:0 36px 0 0;">通知推送方式</p>
+          <el-form-item label="" prop="autoApprovalDays" label-width="0">
+            <el-checkbox-group v-model="newData.checkList">
+              <el-checkbox label="站内信(系统默认)" value="1"></el-checkbox>
+              <el-checkbox label="企业微信" value="2"></el-checkbox>
+              <el-checkbox label="短信" value="3"></el-checkbox>
+            </el-checkbox-group>
+          </el-form-item>
+        </div>
       </el-form>
     </div>
   </div>
@@ -54,6 +64,7 @@
         newData:{
           uploadMaxSize:0,
           autoApprovalDays:0,
+          checkList:[],
         },
         rules:{
           uploadMaxSize: [

+ 12 - 4
src/views/safetyEducationExaminationNew/publicConfiguration/basicConfiguration/trainingConfiguration.vue

@@ -21,6 +21,7 @@
         </div>
         <div class="text-box" v-else>
           <p>{{item.categoryName}}</p>
+          <p>{{item.categoryName}}</p>
           <p @click="editorButton(index)">修改</p>
           <p @click="delButton(index)">删除</p>
         </div>
@@ -149,7 +150,7 @@
       }
     }
     .title-p{
-      width:600px;
+      width:800px;
       line-height:60px;
       //background-color: #dedede;
       border-bottom:1px solid #dedede;
@@ -161,7 +162,7 @@
       flex:1;
       padding:0 20px 0 20px;
       .for-box{
-        width:600px;
+        width:800px;
         border-bottom:1px solid #dedede;
         padding:0 20px 0 0;
         margin-left:20px;
@@ -171,12 +172,19 @@
             font-size:14px;
           }
           p:nth-child(1){
-            flex:1;
+            width:480px;
             line-height:60px;
             font-weight:600;
             margin-left:20px;
           }
           p:nth-child(2){
+            width:100px;
+            text-align: center;
+            line-height:60px;
+            font-weight:600;
+            margin-left:20px;
+          }
+          p:nth-child(3){
             height:40px;
             line-height:38px;
             margin:10px 0 0 10px;
@@ -187,7 +195,7 @@
             color:#fff;
             cursor: pointer;
           }
-          p:nth-child(3){
+          p:nth-child(4){
             height:40px;
             line-height:38px;
             margin:10px 0 0 10px;

+ 33 - 341
src/views/safetyEducationExaminationNew/safetyEducation/learningTasks/index.vue

@@ -2,230 +2,49 @@
 <template>
   <div class="app-container learningTasks">
     <div class="page-container learningTasksPage">
-      <p class="pageTitle">学习任务</p>
-      <div class="page-form-title-box">
-        <el-form :model="queryParams" class="form-box" ref="queryForm"
-                 :inline="true" style="width:100%;">
-          <div class="table-top-button-box">
-            <div>
-              <p :class="learnStatus === ''?'check-table-button':''" @click="tableTypeButton('')">全部</p>
-              <p :class="learnStatus === 0?'check-table-button':''" @click="tableTypeButton(0)">未学习</p>
-              <p :class="learnStatus === 1?'check-table-button':''" @click="tableTypeButton(1)">学习中</p>
-              <p :class="learnStatus === 2?'check-table-button':''" @click="tableTypeButton(2)">已学完</p>
-            </div>
-          </div>
-          <el-form-item label="" prop="knowledgePointId">
-            <el-cascader
-              v-model="queryParams.knowledgePointId"
-              :options="optionListB"
-              :props="{
-                emitPath:false,
-                checkStrictly: true,
-                value: 'id',
-                label: 'knowledgePointName',
-                children: 'children',
-              }"
-              style="width: 180px"
-              :show-all-levels="false"
-              filterable
-              placeholder="知识点"
-            ></el-cascader>
-          </el-form-item>
-          <el-form-item label="" prop="disciplineTypeId">
-            <el-select v-model="queryParams.disciplineTypeId" placeholder="课程分类" style="width: 200px">
-              <el-option
-                v-for="dict in disciplineOptionList"
-                :key="dict.id"
-                :label="dict.disciplineName"
-                :value="dict.id"
-              />
-            </el-select>
-          </el-form-item>
-          <el-form-item label="" prop="courseName">
-            <el-input
-              maxLength="30"
-              v-model="queryParams.courseName"
-              placeholder="搜索名称"
-              style="width: 200px"
-            />
-          </el-form-item>
-          <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
-          <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
-        </el-form>
-      </div>
-      <div class="page-content-box">
-        <div class="for-max-big-box scrollbar-box">
-          <div class="for-big-box" v-for="(item,index) in dataList" :key="index" @click="tableButton(item)">
-            <img :src="item.coverAttachmentPath">
-            <div class="bottom-big-box">
-              <p class="name-p">{{item.courseName}}</p>
-              <p class="time-p">{{secondsToMinutes(item.totalDuration)}}分钟 丨 {{item.totalCreditHours}}学时 丨 {{item.totalPoints}}积分</p>
-              <div class="text-box">
-                <p>已学 {{item.learnedCoursewareCount}} <span> / 总 {{item.totalCoursewareCount}} 课件</span></p>
-              </div>
-            </div>
-            <p class="type-p" :class="item.learnStatus=='0'?'type-p-1':(item.learnStatus=='1'?'type-p-2':(item.learnStatus=='2'?'type-p-3':''))">{{item.learnStatus=='0'?'未学习':(item.learnStatus=='1'?'学习中':(item.learnStatus=='2'?'已学完':''))}}</p>
-            <el-progress
-              class="num-p" type="circle"
-              :stroke-width="4"
-              :width="60" :percentage="item.progress">
-            </el-progress>
-            <p class="position-p-1">{{item.examName}}</p>
-          </div>
-          <p class="null-text-p" v-if="!dataList[0]">暂无数据</p>
-        </div>
-        <pagination :page-sizes="[20, 30, 40, 50]"
-                    v-show="total>0"
-                    :total="total"
-                    :page.sync="queryParams.page"
-                    :limit.sync="queryParams.pageSize"
-                    @pagination="getList"
-        />
+      <!--<p class="pageTitle">学习任务</p>-->
+      <div class="top-title-button-box">
+        <p :class="pageType == 1?'check-button':''" @click="checkButton(1)">考前课程</p>
+        <p :class="pageType == 2?'check-button':''" @click="checkButton(2)">学习资料</p>
+        <p :class="pageType == 3?'check-button':''" @click="checkButton(3)">违规学习</p>
+        <p style="flex:1;"></p>
       </div>
+      <learningTasksPage v-if="pageType == 1"></learningTasksPage>
+      <knowledgeLearningPage v-if="pageType == 2"></knowledgeLearningPage>
+      <violationStudyPage v-if="pageType == 3"></violationStudyPage>
     </div>
   </div>
 </template>
 <script>
-  //import { getDicts } from "@/api/commonality/noPermission";
-  //import { systemUserSelect } from "@/api/commonality/permission";
-  import { examUserCourseLearningList,examElKnowledgePointTreeList,examElDisciplineTypeList, } from "@/api/safetyEducationExaminationNew/index";
+  import learningTasksPage from "./learningTasksPage.vue";
+  import knowledgeLearningPage from "./knowledgeLearningPage.vue";
+  import violationStudyPage from "./violationStudyPage.vue";
   export default {
     name: 'index',
+    components: {
+      learningTasksPage,
+      knowledgeLearningPage,
+      violationStudyPage,
+    },
     data() {
       return {
-        //下拉列表数据
-        optionListB: [],
-        disciplineOptionList:[],
-        //查询条件
-        learnStatus:'',
-        queryParams: {
-          page: 1,
-          pageSize: 20,
-          knowledgePointId: '',
-          disciplineTypeId: '',
-          courseName: null
-        },
-        //列表数据
-        dataList: [],
-        //数据数量
-        total: 0,
+        pageType:1,
       }
     },
     created() {
 
     },
     mounted() {
-      if(sessionStorage.getItem('skipQueryParamsData')){
-        let skipQueryParamsData = JSON.parse(sessionStorage.getItem('skipQueryParamsData'))
-        this.$set(this,'queryParams',skipQueryParamsData.queryParams);
-        this.$set(this,'learnStatus',skipQueryParamsData.learnStatus);
-        sessionStorage.removeItem('skipQueryParamsData');
-      }
-      this.getList();
-      this.examElKnowledgePointTreeList();
-      this.examElDisciplineTypeList();
+
     },
     methods: {
       //切换按钮
-      tableTypeButton(val){
-        if(this.learnStatus !== val){
-          this.$set(this,'learnStatus',val);
-          this.handleQuery();
-        }
-      },
-      //查询按钮
-      handleQuery() {
-        this.$set(this.queryParams, 'page', 1)
-        this.getList()
-      },
-      //重置按钮
-      resetQuery() {
-        this.$set(this,'learnStatus','');
-        this.$set(this, 'queryParams', {
-          page: 1,
-          pageSize: 20,
-          knowledgePointId: '',
-          disciplineTypeId: '',
-          courseName: null
-        })
-        this.getList()
-      },
-      //获取数据列表
-      getList() {
-        let obj = JSON.parse(JSON.stringify(this.queryParams))
-        obj.learnStatus = this.learnStatus;
-        examUserCourseLearningList(obj).then(response => {
-          this.$set(this, 'dataList', response.data.records)
-          this.$set(this, 'total', response.data.total)
-        })
-      },
-      //操作按钮
-      tableButton(item) {
-        let self = this;
-        //学习课程
-        this.$router.push({
-          path: '/learningCourse',
-          query: {
-            courseId: item.courseId,
-            examId: item.examId,
-          }
-        })
-        // if(item.conditionType == 1){
-        //   this.$confirm('还未达到学时要求,是否现在去学习?', "提示", {
-        //     confirmButtonText: "确认",
-        //     cancelButtonText: "取消",
-        //     type: "warning"
-        //   }).then(function() {
-        //   }).then(() => {
-        //     //学时要求
-        //     self.$router.push({
-        //       path: '/safetyEducationExaminationNew/safetyEducation/knowledgeLearning',
-        //       query: {}
-        //     })
-        //   }).catch(() => {});
-        // }else{
-        //   //学习课程
-        //   this.$router.push({
-        //     path: '/learningCourse',
-        //     query: {
-        //       courseId: item.courseId,
-        //       examId: item.examId,
-        //     }
-        //   })
-        // }
-      },
-      examElKnowledgePointTreeList(){
-        examElKnowledgePointTreeList({}).then(response => {
-          const list = response.data || [];
-          this.formatTreeData(list);
-          this.$set(this, 'optionListB', list);
-        });
-      },
-      //查询全部专业类别
-      examElDisciplineTypeList(){
-        examElDisciplineTypeList({}).then(response => {
-          this.$set(this,'disciplineOptionList',response.data);
-        });
-      },
-      //换算分钟
-      secondsToMinutes(totalSeconds) {
-        if (typeof totalSeconds !== 'number' || totalSeconds <= 0) {
-          return 1;
+      checkButton(val){
+        if(this.pageType !== val){
+          this.$set(this,'pageType',val);
         }
-        return Math.ceil(totalSeconds / 60);
       },
-    },
-    beforeRouteLeave(to, from, next) {
-      if (to.name === 'learningCourse') {
-        const skipQueryParamsData = {
-          queryParams: this.queryParams,
-          learnStatus: this.learnStatus,
-        };
-        sessionStorage.setItem('skipQueryParamsData', JSON.stringify(skipQueryParamsData));
-      } else {
-        sessionStorage.removeItem('skipQueryParamsData');
-      }
-      next(); // 必须调用 next() 放行路由
+
     },
   }
 </script>
@@ -238,144 +57,17 @@
         padding:0 20px;
         border-bottom:1px solid #dedede;
       }
-      .table-top-button-box{
-        display: inline-block;
-        vertical-align: top;
-        margin-right:10px;
-        div{
-          display: flex;
-          p{
-            border:1px solid #DCDFE6;
-            width:80px;
-            text-align: center;
-            height:40px;
-            line-height:40px;
-            cursor: pointer;
-            font-size:14px;
-          }
-          p:nth-child(1){
-            border-top-left-radius:4px;
-            border-bottom-left-radius:4px;
-          }
-          p:nth-child(2){
-            border-left:none;
-          }
-          p:nth-child(3){
-            border-left:none;
-            border-right:none;
-          }
-          p:nth-child(4){
-            border-top-right-radius:4px;
-            border-bottom-right-radius:4px;
-          }
-          .check-table-button{
-            border:1px solid #0183fa;
-            background-color: #0183fa;
-            color:#fff;
-          }
-        }
-      }
-      .page-content-box{
-        padding:20px 0;
-      }
-      .for-max-big-box{
-        flex:1;
-        .null-text-p{
-          line-height:200px;
-          text-align: center;
-          color:#999;
-          font-size:14px;
-        }
-        .for-big-box{
+      .top-title-button-box{
+        display: flex;
+        p{
+          line-height:50px;
+          padding:0 20px;
           cursor: pointer;
-          display: inline-block;
-          width:370px;
-          margin:0 0 20px 20px;
-          border-radius:6px;
-          overflow: hidden;
-          box-shadow: 0 2px 8px rgba(37, 50, 74, 0.12);
-          position: relative;
-          img{
-            display: inline-block;
-            width:370px;
-            height:180px;
-          }
-          .bottom-big-box{
-            padding:10px 0 10px 10px;
-            .name-p{
-              line-height:30px;
-              font-size:16px;
-              font-weight:700;
-              display:block;
-              overflow:hidden;
-              text-overflow:ellipsis;
-              white-space:nowrap;
-            }
-            .time{
-              line-height:30px;
-              font-size:14px;
-            }
-            .text-box{
-              display: flex;
-              p{
-                line-height:30px;
-                font-size:14px;
-                font-weight:700;
-                span{
-                  color:#666;
-                  font-weight:500;
-                }
-              }
-            }
-          }
-          .type-p{
-            position: absolute;
-            right:20px;
-            top:15px;
-            padding:5px 10px;
-            border-radius:4px;
-            font-size:14px;
-          }
-          .type-p-1{
-            color:#fff;
-            background-color: #999;
-          }
-          .type-p-2{
-            color:#fff;
-            background-color: #7CCD7C;
-          }
-          .type-p-3{
-            color:#fff;
-            background-color: #0183fa;
-          }
-          .num-p{
-            position: absolute;
-            right:20px;
-            bottom:20px;
-          }
-          .num-p ::v-deep .el-progress__text {
-            margin-left:0!important;
-            font-size:12px!important;
-          }
-          .position-p-1{
-            position: absolute;
-            top:140px;
-            left:10px;
-            /*单行省略号*/
-            display:block;
-            overflow:hidden;
-            text-overflow:ellipsis;
-            white-space:nowrap;
-            line-height:20px;
-            border:1px solid #0183fa;
-            max-width:350px;
-            border-radius:4px;
-            padding:4px 10px;
-            font-size:14px;
-            /*background-color: rgba(1, 131, 250,0.2);*/
-            background-color: #0183fa;
-            color:#fff;
-          }
+          border-bottom:1px solid #dedede;
+        }
+        .check-button{
+          color:#0183FA;
+          border-bottom:2px solid #0183FA;
         }
       }
     }

+ 499 - 0
src/views/safetyEducationExaminationNew/safetyEducation/learningTasks/knowledgeLearningPage.vue

@@ -0,0 +1,499 @@
+<!-- 知识学习 -->
+<template>
+  <div class="page-container knowledgeLearning">
+    <div class="page-container knowledgeLearningPage">
+      <!--<p class="pageTitle" v-if="!examName">知识学习</p>-->
+      <!--<p class="pageTitle" v-if="examName"><span style="font-weight:700;margin-right:40px;">{{examName}}学时任务</span><span style="font-size:14px;color:#0183fa;">当前学时完成进度  {{completedStudyHours}} / {{studyHoursRequirement}} 学时</span></p>-->
+      <div class="max-big-box">
+        <div class="left-box scrollbar-box">
+          <p @click="leftCheckButton(knowledgeLearningPage)"
+            v-for="(item,index) in letDataList" :key="knowledgeLearningPage"
+            class="left-for-p" :class="knowledgeLearningPage==leftDataIndex?'leftCheck':''">
+            {{item.knowledgePointName}}
+          </p>
+        </div>
+        <div class="right-box">
+          <div class="page-form-title-box">
+            <el-form :model="queryParams" class="form-box" ref="queryForm"
+                     :inline="true" style="width:100%;">
+              <div class="table-top-button-box-2">
+                <div>
+                  <p :class="topButtonIndex == 1?'check-table-button':''" @click="topCheckButton(1)">视频资源</p>
+                  <p :class="topButtonIndex == 2?'check-table-button':''" @click="topCheckButton(2)">文档文章</p>
+                </div>
+              </div>
+              <div class="table-top-button-box">
+                <div>
+                  <p :class="learnStatus === ''?'check-table-button':''" @click="tableTypeButton('')">全部</p>
+                  <p :class="learnStatus === 0?'check-table-button':''" @click="tableTypeButton(0)">未学习</p>
+                  <p :class="learnStatus === 1?'check-table-button':''" @click="tableTypeButton(1)">学习中</p>
+                  <p :class="learnStatus === 2?'check-table-button':''" @click="tableTypeButton(2)">已学完</p>
+                </div>
+              </div>
+              <el-form-item label="" prop="knowledgePointId" v-if="!this.knowledgePointIds[0]">
+                <el-cascader
+                  v-model="queryParams.knowledgePointId"
+                  :options="optionListB"
+                  :props="{
+                emitPath:false,
+                checkStrictly: true,
+                value: 'id',
+                label: 'knowledgePointName',
+                children: 'children',
+              }"
+                  style="width: 180px"
+                  :show-all-levels="false"
+                  filterable
+                  placeholder="知识点"
+                ></el-cascader>
+              </el-form-item>
+              <el-form-item label="" prop="disciplineTypeId">
+                <el-select v-model="queryParams.disciplineTypeId" placeholder="知识分类" style="width: 200px">
+                  <el-option
+                    v-for="dict in disciplineOptionList"
+                    :key="dict.id"
+                    :label="dict.disciplineName"
+                    :value="dict.id"
+                  />
+                </el-select>
+              </el-form-item>
+              <el-form-item label="" prop="coursewareName">
+                <el-input
+                  maxLength="30"
+                  v-model="queryParams.coursewareName"
+                  placeholder="搜索名称"
+                  style="width: 200px"
+                />
+              </el-form-item>
+              <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
+              <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
+            </el-form>
+          </div>
+          <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="knowledgeLearningPage" @click="tableButton(item)">
+                <img v-if="item.materialType == 1&&item.exampleImg" :src="item.exampleImg">
+                <img v-else src="@/assets/ZDimages/basicsModules/image_986222064626770.png">
+                <div class="bottom-big-box">
+                  <p class="name-p">{{item.coursewareName}}</p>
+                  <p class="time-p">{{secondsToMinutes(item.minLearningDuration)}}分钟 丨 {{item.creditHours}}学时 丨 {{item.points}}积分</p>
+                </div>
+                <p class="type-p" :class="item.learnStatus=='0'?'type-p-1':(item.learnStatus=='1'?'type-p-2':(item.learnStatus=='2'?'type-p-3':''))">{{item.learnStatus=='0'?'未学习':(item.learnStatus=='1'?'学习中':(item.learnStatus=='2'?'已学完':''))}}</p>
+              </div>
+            </div>
+            <pagination :page-sizes="[20, 30, 40, 50]"
+                        v-show="total>0"
+                        :total="total"
+                        :page.sync="queryParams.page"
+                        :limit.sync="queryParams.pageSize"
+                        @pagination="getList"
+            />
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  import { Encrypt,Decrypt} from '@/utils/secret'
+  //import { getDicts } from "@/api/commonality/noPermission";
+  //import { systemUserSelect } from "@/api/commonality/permission";
+  //import { getInfo } from "@/api/basicsModules/index";
+  //import addPage from "./addPage.vue";
+  import {
+    examUserCoursewareLearningList,examElKnowledgePointTreeList,
+    examUserCoursewareLearningRestart,examElDisciplineTypeList,
+  } from "@/api/safetyEducationExaminationNew/index";
+  export default {
+    name: 'index',
+    //components: {
+    //  addPage
+    //},
+    data() {
+      return {
+        letDataList:[],
+        leftDataIndex:0,
+        topButtonIndex:1,
+        //下拉列表数据
+        optionListB: [],
+        disciplineOptionList:[],
+        //查询条件
+        learnStatus:'',
+        queryParams: {
+          page: 1,
+          pageSize: 20,
+          knowledgePointId: '',
+          disciplineTypeId: '',
+          coursewareName: null
+        },
+        //列表数据
+        dataList: [],
+        //数据数量
+        total: 0,
+        //跳转逻辑数据
+        examName:'',
+        knowledgePointIds:[],
+        completedStudyHours:0,
+        studyHoursRequirement:0,
+      }
+    },
+    created() {
+
+    },
+    mounted() {
+      if(this.$route.query.skipType){
+        this.$set(this,'topButtonIndex',this.$route.query.skipType);
+        this.$set(this.queryParams,'disciplineTypeId',this.$route.query.disciplineId);
+      }
+      if(this.$route.query.text){
+        let obj = JSON.parse(Decrypt(this.$route.query.text));
+        this.$set(this,'examName',obj.examName);
+        this.$set(this,'knowledgePointIds',obj.knowledgePointIds);
+        this.$set(this,'completedStudyHours',obj.completedStudyHours);
+        this.$set(this,'studyHoursRequirement',obj.studyHoursRequirement);
+      }
+      if(sessionStorage.getItem('skipQueryParamsData')){
+        let skipQueryParamsData = JSON.parse(sessionStorage.getItem('skipQueryParamsData'))
+        this.$set(this,'queryParams',skipQueryParamsData.queryParams);
+        this.$set(this,'leftDataIndex',skipQueryParamsData.leftDataIndex);
+        this.$set(this,'topButtonIndex',skipQueryParamsData.topButtonIndex);
+        this.$set(this,'learnStatus',skipQueryParamsData.learnStatus);
+        sessionStorage.removeItem('skipQueryParamsData');
+      }
+      this.examElKnowledgePointTreeList();
+      this.examElDisciplineTypeList();
+    },
+    methods: {
+      //左侧列表切换
+      leftCheckButton(index){
+        if(this.leftDataIndex != knowledgeLearningPage){
+          this.$set(this,'leftDataIndex',knowledgeLearningPage);
+          this.$set(this.queryParams, 'knowledgePointId', null);
+          this.$set(this, 'optionListB', this.letDataList[knowledgeLearningPage].children?this.letDataList[knowledgeLearningPage].children:[]);
+          this.handleQuery();
+        }
+      },
+      //顶部切换
+      topCheckButton(index){
+        if(this.topButtonIndex != knowledgeLearningPage){
+          this.$set(this,'topButtonIndex',knowledgeLearningPage);
+          this.handleQuery();
+        }
+      },
+      //切换按钮
+      tableTypeButton(val){
+        if(this.learnStatus !== val){
+          this.$set(this,'learnStatus',val);
+          this.handleQuery();
+        }
+      },
+      //查询按钮
+      handleQuery() {
+        this.$set(this.queryParams, 'page', 1)
+        this.getList()
+      },
+      //重置按钮
+      resetQuery() {
+        this.$set(this,'learnStatus','');
+        this.$set(this,'topButtonIndex',1);
+        this.$set(this, 'queryParams', {
+          page: 1,
+          pageSize: 20,
+          knowledgePointId: '',
+          disciplineTypeId: '',
+          coursewareName: null
+        })
+        this.getList()
+      },
+      //获取数据列表
+      getList() {
+        let obj = JSON.parse(JSON.stringify(this.queryParams))
+        if(!this.queryParams.knowledgePointId){
+          obj.knowledgePointId = this.letDataList[this.leftDataIndex].id
+        }
+        obj.materialType = this.topButtonIndex;
+        obj.learnStatus = this.learnStatus;
+        examUserCoursewareLearningList(obj).then(response => {
+          this.$set(this, 'dataList', response.data.records)
+          this.$set(this, 'total', response.data.total)
+        })
+      },
+      //操作按钮
+      tableButton(item) {
+        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({
+                path: '/learningMaterials',
+                query: {
+                  coursewareId: item.coursewareId,
+                }
+              })
+            });
+          }).catch(() => {});
+        }else{
+          this.$router.push({
+            path: '/learningMaterials',
+            query: {
+              coursewareId: item.coursewareId,
+            }
+          })
+        }
+      },
+      examElKnowledgePointTreeList(){
+        let obj = {
+          knowledgePointIds : this.knowledgePointIds,
+          dataScope:1,
+        };
+        examElKnowledgePointTreeList(obj).then(response => {
+          const list = response.data || [];
+          this.formatTreeData(list);
+          if(this.knowledgePointIds[0]){
+            this.$set(this, 'letDataList', list);
+            this.$set(this, 'optionListB', list[0].children?list[0].children:[]);
+          }else{
+            this.$set(this, 'letDataList', [{knowledgePointName:'全部',id:''},...list]);
+          }
+          this.getList();
+        });
+      },
+      //查询全部专业类别
+      examElDisciplineTypeList(){
+        examElDisciplineTypeList({}).then(response => {
+          this.$set(this,'disciplineOptionList',response.data);
+        });
+      },
+      //换算分钟
+      secondsToMinutes(totalSeconds) {
+        if (typeof totalSeconds !== 'number' || totalSeconds <= 0) {
+          return 1;
+        }
+        return Math.ceil(totalSeconds / 60);
+      },
+    },
+    beforeRouteLeave(to, from, next) {
+      if (to.name === 'learningMaterials') {
+        const skipQueryParamsData = {
+          queryParams: this.queryParams,
+          leftDataIndex: this.leftDataIndex,
+          topButtonIndex: this.topButtonIndex,
+          learnStatus: this.learnStatus,
+        };
+        sessionStorage.setItem('skipQueryParamsData', JSON.stringify(skipQueryParamsData));
+      } else {
+        sessionStorage.removeItem('skipQueryParamsData');
+      }
+      next(); // 必须调用 next() 放行路由
+    },
+  }
+</script>
+<style scoped lang="scss">
+  .knowledgeLearning {
+    .knowledgeLearningPage {
+      .pageTitle{
+        height:60px;
+        line-height:60px;
+        padding:0 20px;
+        border-bottom:1px solid #dedede;
+      }
+      .max-big-box{
+        flex:1;
+        display: flex;
+        overflow: hidden;
+        .left-box{
+          width:200px;
+          border-right:1px solid #dedede;
+          padding:20px 0 ;
+          .left-for-p{
+            margin:5px 0;
+            padding:0 20px;
+            text-align: center;
+            border-left:6px solid #ffffff;
+            cursor: pointer;
+            font-weight:700;
+            font-size:16px;
+            line-height:40px;
+            /*单行省略号*/
+            display:block;
+            overflow:hidden;
+            text-overflow:ellipsis;
+            white-space:nowrap;
+          }
+          .left-for-p:hover{
+            background-color: #0183fa;
+            color: #ffffff;
+          }
+          .leftCheck{
+            color: #fff;
+            background-color: #0183fa;
+            /*border-right:4px solid #0183fa;*/
+          }
+        }
+        .right-box{
+          flex:1;
+          display: flex;
+          flex-direction: column;
+          overflow: hidden;
+          .top-max-button-box{
+            display: flex;
+            margin:20px 0 0 20px;
+            p{
+              width:120px;
+              line-height:40px;
+              border-radius:4px;
+              color:#333;
+              border:1px solid #333;
+              text-align: center;
+              margin-right:20px;
+              cursor: pointer;
+            }
+            .top-check-button{
+              border:1px solid #0183fa;
+              background-color: #0183fa;
+              color:#fff;
+            }
+          }
+          .table-top-button-box-2{
+            display: inline-block;
+            vertical-align: top;
+            margin-right:10px;
+            div{
+              display: flex;
+              p{
+                border:1px solid #DCDFE6;
+                width:100px;
+                text-align: center;
+                height:40px;
+                line-height:40px;
+                cursor: pointer;
+                font-size:14px;
+              }
+              p:nth-child(1){
+                border-top-left-radius:4px;
+                border-bottom-left-radius:4px;
+                border-right:none;
+              }
+              p:nth-child(2){
+                border-left:none;
+                border-top-right-radius:4px;
+                border-bottom-right-radius:4px;
+              }
+              .check-table-button{
+                border:1px solid #0183fa;
+                background-color: #0183fa;
+                color:#fff;
+              }
+            }
+          }
+          .table-top-button-box{
+            display: inline-block;
+            vertical-align: top;
+            margin-right:10px;
+            div{
+              display: flex;
+              p{
+                border:1px solid #DCDFE6;
+                width:80px;
+                text-align: center;
+                height:40px;
+                line-height:40px;
+                cursor: pointer;
+                font-size:14px;
+              }
+              p:nth-child(1){
+                border-top-left-radius:4px;
+                border-bottom-left-radius:4px;
+              }
+              p:nth-child(2){
+                border-left:none;
+              }
+              p:nth-child(3){
+                border-left:none;
+                border-right:none;
+              }
+              p:nth-child(4){
+                border-top-right-radius:4px;
+                border-bottom-right-radius:4px;
+              }
+              .check-table-button{
+                border:1px solid #0183fa;
+                background-color: #0183fa;
+                color:#fff;
+              }
+            }
+          }
+          .page-content-box{
+            padding: 0 0 10px 0;
+          }
+          .for-max-big-box{
+            flex:1;
+            .null-text-p{
+              line-height:200px;
+              text-align: center;
+              color:#999;
+              font-size:14px;
+            }
+            .for-big-box{
+              cursor: pointer;
+              display: inline-block;
+              width:320px;
+              margin:20px 0 0 20px;
+              border-radius:6px;
+              overflow: hidden;
+              box-shadow: 0 2px 8px rgba(37, 50, 74, 0.12);
+              position: relative;
+              img{
+                display: inline-block;
+                width:320px;
+                height:180px;
+              }
+              .bottom-big-box{
+                padding:10px 0 10px 10px;
+                .name-p{
+                  line-height:30px;
+                  font-size:16px;
+                  font-weight:700;
+                  display:block;
+                  overflow:hidden;
+                  text-overflow:ellipsis;
+                  white-space:nowrap;
+                }
+                .time{
+                  line-height:30px;
+                  font-size:14px;
+                }
+              }
+              .type-p{
+                position: absolute;
+                right:5px;
+                bottom:5px;
+                padding:2px 8px;
+                border-radius:4px;
+                font-size:14px;
+              }
+              .type-p-1{
+                color:#fff;
+                background-color: #999;
+              }
+              .type-p-2{
+                color:#fff;
+                background-color: #7CCD7C;
+              }
+              .type-p-3{
+                color:#fff;
+                background-color: #0183fa;
+              }
+            }
+          }
+        }
+      }
+    }
+  }
+</style>

+ 383 - 0
src/views/safetyEducationExaminationNew/safetyEducation/learningTasks/learningTasksPage.vue

@@ -0,0 +1,383 @@
+<!-- 学习任务 -->
+<template>
+  <div class="page-container learningTasks">
+    <div class="page-container learningTasksPage">
+      <!--<p class="pageTitle">学习任务</p>-->
+      <div class="page-form-title-box">
+        <el-form :model="queryParams" class="form-box" ref="queryForm"
+                 :inline="true" style="width:100%;">
+          <div class="table-top-button-box">
+            <div>
+              <p :class="learnStatus === ''?'check-table-button':''" @click="tableTypeButton('')">全部</p>
+              <p :class="learnStatus === 0?'check-table-button':''" @click="tableTypeButton(0)">未学习</p>
+              <p :class="learnStatus === 1?'check-table-button':''" @click="tableTypeButton(1)">学习中</p>
+              <p :class="learnStatus === 2?'check-table-button':''" @click="tableTypeButton(2)">已学完</p>
+            </div>
+          </div>
+          <el-form-item label="" prop="knowledgePointId">
+            <el-cascader
+              v-model="queryParams.knowledgePointId"
+              :options="optionListB"
+              :props="{
+                emitPath:false,
+                checkStrictly: true,
+                value: 'id',
+                label: 'knowledgePointName',
+                children: 'children',
+              }"
+              style="width: 180px"
+              :show-all-levels="false"
+              filterable
+              placeholder="知识点"
+            ></el-cascader>
+          </el-form-item>
+          <el-form-item label="" prop="disciplineTypeId">
+            <el-select v-model="queryParams.disciplineTypeId" placeholder="课程分类" style="width: 200px">
+              <el-option
+                v-for="dict in disciplineOptionList"
+                :key="dict.id"
+                :label="dict.disciplineName"
+                :value="dict.id"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="courseName">
+            <el-input
+              maxLength="30"
+              v-model="queryParams.courseName"
+              placeholder="搜索名称"
+              style="width: 200px"
+            />
+          </el-form-item>
+          <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
+          <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
+        </el-form>
+      </div>
+      <div class="page-content-box">
+        <div class="for-max-big-box scrollbar-box">
+          <div class="for-big-box" v-for="(item,index) in dataList" :key="learningTasksPage" @click="tableButton(item)">
+            <img :src="item.coverAttachmentPath">
+            <div class="bottom-big-box">
+              <p class="name-p">{{item.courseName}}</p>
+              <p class="time-p">{{secondsToMinutes(item.totalDuration)}}分钟 丨 {{item.totalCreditHours}}学时 丨 {{item.totalPoints}}积分</p>
+              <div class="text-box">
+                <p>已学 {{item.learnedCoursewareCount}} <span> / 总 {{item.totalCoursewareCount}} 课件</span></p>
+              </div>
+            </div>
+            <p class="type-p" :class="item.learnStatus=='0'?'type-p-1':(item.learnStatus=='1'?'type-p-2':(item.learnStatus=='2'?'type-p-3':''))">{{item.learnStatus=='0'?'未学习':(item.learnStatus=='1'?'学习中':(item.learnStatus=='2'?'已学完':''))}}</p>
+            <el-progress
+              class="num-p" type="circle"
+              :stroke-width="4"
+              :width="60" :percentage="item.progress">
+            </el-progress>
+            <p class="position-p-1">{{item.examName}}</p>
+          </div>
+          <p class="null-text-p" v-if="!dataList[0]">暂无数据</p>
+        </div>
+        <pagination :page-sizes="[20, 30, 40, 50]"
+                    v-show="total>0"
+                    :total="total"
+                    :page.sync="queryParams.page"
+                    :limit.sync="queryParams.pageSize"
+                    @pagination="getList"
+        />
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  //import { getDicts } from "@/api/commonality/noPermission";
+  //import { systemUserSelect } from "@/api/commonality/permission";
+  import { examUserCourseLearningList,examElKnowledgePointTreeList,examElDisciplineTypeList, } from "@/api/safetyEducationExaminationNew/index";
+  export default {
+    name: 'index',
+    data() {
+      return {
+        //下拉列表数据
+        optionListB: [],
+        disciplineOptionList:[],
+        //查询条件
+        learnStatus:'',
+        queryParams: {
+          page: 1,
+          pageSize: 20,
+          knowledgePointId: '',
+          disciplineTypeId: '',
+          courseName: null
+        },
+        //列表数据
+        dataList: [],
+        //数据数量
+        total: 0,
+      }
+    },
+    created() {
+
+    },
+    mounted() {
+      if(sessionStorage.getItem('skipQueryParamsData')){
+        let skipQueryParamsData = JSON.parse(sessionStorage.getItem('skipQueryParamsData'))
+        this.$set(this,'queryParams',skipQueryParamsData.queryParams);
+        this.$set(this,'learnStatus',skipQueryParamsData.learnStatus);
+        sessionStorage.removeItem('skipQueryParamsData');
+      }
+      this.getList();
+      this.examElKnowledgePointTreeList();
+      this.examElDisciplineTypeList();
+    },
+    methods: {
+      //切换按钮
+      tableTypeButton(val){
+        if(this.learnStatus !== val){
+          this.$set(this,'learnStatus',val);
+          this.handleQuery();
+        }
+      },
+      //查询按钮
+      handleQuery() {
+        this.$set(this.queryParams, 'page', 1)
+        this.getList()
+      },
+      //重置按钮
+      resetQuery() {
+        this.$set(this,'learnStatus','');
+        this.$set(this, 'queryParams', {
+          page: 1,
+          pageSize: 20,
+          knowledgePointId: '',
+          disciplineTypeId: '',
+          courseName: null
+        })
+        this.getList()
+      },
+      //获取数据列表
+      getList() {
+        let obj = JSON.parse(JSON.stringify(this.queryParams))
+        obj.learnStatus = this.learnStatus;
+        examUserCourseLearningList(obj).then(response => {
+          this.$set(this, 'dataList', response.data.records)
+          this.$set(this, 'total', response.data.total)
+        })
+      },
+      //操作按钮
+      tableButton(item) {
+        let self = this;
+        //学习课程
+        this.$router.push({
+          path: '/learningCourse',
+          query: {
+            courseId: item.courseId,
+            examId: item.examId,
+          }
+        })
+        // if(item.conditionType == 1){
+        //   this.$confirm('还未达到学时要求,是否现在去学习?', "提示", {
+        //     confirmButtonText: "确认",
+        //     cancelButtonText: "取消",
+        //     type: "warning"
+        //   }).then(function() {
+        //   }).then(() => {
+        //     //学时要求
+        //     self.$router.push({
+        //       path: '/safetyEducationExaminationNew/safetyEducation/knowledgeLearning',
+        //       query: {}
+        //     })
+        //   }).catch(() => {});
+        // }else{
+        //   //学习课程
+        //   this.$router.push({
+        //     path: '/learningCourse',
+        //     query: {
+        //       courseId: item.courseId,
+        //       examId: item.examId,
+        //     }
+        //   })
+        // }
+      },
+      examElKnowledgePointTreeList(){
+        examElKnowledgePointTreeList({}).then(response => {
+          const list = response.data || [];
+          this.formatTreeData(list);
+          this.$set(this, 'optionListB', list);
+        });
+      },
+      //查询全部专业类别
+      examElDisciplineTypeList(){
+        examElDisciplineTypeList({}).then(response => {
+          this.$set(this,'disciplineOptionList',response.data);
+        });
+      },
+      //换算分钟
+      secondsToMinutes(totalSeconds) {
+        if (typeof totalSeconds !== 'number' || totalSeconds <= 0) {
+          return 1;
+        }
+        return Math.ceil(totalSeconds / 60);
+      },
+    },
+    beforeRouteLeave(to, from, next) {
+      if (to.name === 'learningCourse') {
+        const skipQueryParamsData = {
+          queryParams: this.queryParams,
+          learnStatus: this.learnStatus,
+        };
+        sessionStorage.setItem('skipQueryParamsData', JSON.stringify(skipQueryParamsData));
+      } else {
+        sessionStorage.removeItem('skipQueryParamsData');
+      }
+      next(); // 必须调用 next() 放行路由
+    },
+  }
+</script>
+<style scoped lang="scss">
+  .learningTasks {
+    .learningTasksPage {
+      .pageTitle{
+        height:60px;
+        line-height:60px;
+        padding:0 20px;
+        border-bottom:1px solid #dedede;
+      }
+      .table-top-button-box{
+        display: inline-block;
+        vertical-align: top;
+        margin-right:10px;
+        div{
+          display: flex;
+          p{
+            border:1px solid #DCDFE6;
+            width:80px;
+            text-align: center;
+            height:40px;
+            line-height:40px;
+            cursor: pointer;
+            font-size:14px;
+          }
+          p:nth-child(1){
+            border-top-left-radius:4px;
+            border-bottom-left-radius:4px;
+          }
+          p:nth-child(2){
+            border-left:none;
+          }
+          p:nth-child(3){
+            border-left:none;
+            border-right:none;
+          }
+          p:nth-child(4){
+            border-top-right-radius:4px;
+            border-bottom-right-radius:4px;
+          }
+          .check-table-button{
+            border:1px solid #0183fa;
+            background-color: #0183fa;
+            color:#fff;
+          }
+        }
+      }
+      .page-content-box{
+        padding:20px 0;
+      }
+      .for-max-big-box{
+        flex:1;
+        .null-text-p{
+          line-height:200px;
+          text-align: center;
+          color:#999;
+          font-size:14px;
+        }
+        .for-big-box{
+          cursor: pointer;
+          display: inline-block;
+          width:370px;
+          margin:0 0 20px 20px;
+          border-radius:6px;
+          overflow: hidden;
+          box-shadow: 0 2px 8px rgba(37, 50, 74, 0.12);
+          position: relative;
+          img{
+            display: inline-block;
+            width:370px;
+            height:180px;
+          }
+          .bottom-big-box{
+            padding:10px 0 10px 10px;
+            .name-p{
+              line-height:30px;
+              font-size:16px;
+              font-weight:700;
+              display:block;
+              overflow:hidden;
+              text-overflow:ellipsis;
+              white-space:nowrap;
+            }
+            .time{
+              line-height:30px;
+              font-size:14px;
+            }
+            .text-box{
+              display: flex;
+              p{
+                line-height:30px;
+                font-size:14px;
+                font-weight:700;
+                span{
+                  color:#666;
+                  font-weight:500;
+                }
+              }
+            }
+          }
+          .type-p{
+            position: absolute;
+            right:20px;
+            top:15px;
+            padding:5px 10px;
+            border-radius:4px;
+            font-size:14px;
+          }
+          .type-p-1{
+            color:#fff;
+            background-color: #999;
+          }
+          .type-p-2{
+            color:#fff;
+            background-color: #7CCD7C;
+          }
+          .type-p-3{
+            color:#fff;
+            background-color: #0183fa;
+          }
+          .num-p{
+            position: absolute;
+            right:20px;
+            bottom:20px;
+          }
+          .num-p ::v-deep .el-progress__text {
+            margin-left:0!important;
+            font-size:12px!important;
+          }
+          .position-p-1{
+            position: absolute;
+            top:140px;
+            left:10px;
+            /*单行省略号*/
+            display:block;
+            overflow:hidden;
+            text-overflow:ellipsis;
+            white-space:nowrap;
+            line-height:20px;
+            border:1px solid #0183fa;
+            max-width:350px;
+            border-radius:4px;
+            padding:4px 10px;
+            font-size:14px;
+            /*background-color: rgba(1, 131, 250,0.2);*/
+            background-color: #0183fa;
+            color:#fff;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 383 - 0
src/views/safetyEducationExaminationNew/safetyEducation/learningTasks/violationStudyPage.vue

@@ -0,0 +1,383 @@
+<!-- 违规学习 -->
+<template>
+  <div class="page-container violationStudyPage">
+    <div class="page-container violationStudyPage-Page">
+      <!--<p class="pageTitle">学习任务</p>-->
+      <div class="page-form-title-box">
+        <el-form :model="queryParams" class="form-box" ref="queryForm"
+                 :inline="true" style="width:100%;">
+          <div class="table-top-button-box">
+            <div>
+              <p :class="learnStatus === ''?'check-table-button':''" @click="tableTypeButton('')">全部</p>
+              <p :class="learnStatus === 0?'check-table-button':''" @click="tableTypeButton(0)">未学习</p>
+              <p :class="learnStatus === 1?'check-table-button':''" @click="tableTypeButton(1)">学习中</p>
+              <p :class="learnStatus === 2?'check-table-button':''" @click="tableTypeButton(2)">已学完</p>
+            </div>
+          </div>
+          <el-form-item label="" prop="knowledgePointId">
+            <el-cascader
+              v-model="queryParams.knowledgePointId"
+              :options="optionListB"
+              :props="{
+                emitPath:false,
+                checkStrictly: true,
+                value: 'id',
+                label: 'knowledgePointName',
+                children: 'children',
+              }"
+              style="width: 180px"
+              :show-all-levels="false"
+              filterable
+              placeholder="知识点"
+            ></el-cascader>
+          </el-form-item>
+          <el-form-item label="" prop="disciplineTypeId">
+            <el-select v-model="queryParams.disciplineTypeId" placeholder="课程分类" style="width: 200px">
+              <el-option
+                v-for="dict in disciplineOptionList"
+                :key="dict.id"
+                :label="dict.disciplineName"
+                :value="dict.id"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="courseName">
+            <el-input
+              maxLength="30"
+              v-model="queryParams.courseName"
+              placeholder="搜索名称"
+              style="width: 200px"
+            />
+          </el-form-item>
+          <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
+          <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
+        </el-form>
+      </div>
+      <div class="page-content-box">
+        <div class="for-max-big-box scrollbar-box">
+          <div class="for-big-box" v-for="(item,index) in dataList" :key="violationStudyPage-Page" @click="tableButton(item)">
+            <img :src="item.coverAttachmentPath">
+            <div class="bottom-big-box">
+              <p class="name-p">{{item.courseName}}</p>
+              <p class="time-p">{{secondsToMinutes(item.totalDuration)}}分钟 丨 {{item.totalCreditHours}}学时 丨 {{item.totalPoints}}积分</p>
+              <div class="text-box">
+                <p>已学 {{item.learnedCoursewareCount}} <span> / 总 {{item.totalCoursewareCount}} 课件</span></p>
+              </div>
+            </div>
+            <p class="type-p" :class="item.learnStatus=='0'?'type-p-1':(item.learnStatus=='1'?'type-p-2':(item.learnStatus=='2'?'type-p-3':''))">{{item.learnStatus=='0'?'未学习':(item.learnStatus=='1'?'学习中':(item.learnStatus=='2'?'已学完':''))}}</p>
+            <el-progress
+              class="num-p" type="circle"
+              :stroke-width="4"
+              :width="60" :percentage="item.progress">
+            </el-progress>
+            <p class="position-p-1">{{item.examName}}</p>
+          </div>
+          <p class="null-text-p" v-if="!dataList[0]">暂无数据</p>
+        </div>
+        <pagination :page-sizes="[20, 30, 40, 50]"
+                    v-show="total>0"
+                    :total="total"
+                    :page.sync="queryParams.page"
+                    :limit.sync="queryParams.pageSize"
+                    @pagination="getList"
+        />
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+  //import { getDicts } from "@/api/commonality/noPermission";
+  //import { systemUserSelect } from "@/api/commonality/permission";
+  import { examUserCourseLearningList,examElKnowledgePointTreeList,examElDisciplineTypeList, } from "@/api/safetyEducationExaminationNew/index";
+  export default {
+    name: 'index',
+    data() {
+      return {
+        //下拉列表数据
+        optionListB: [],
+        disciplineOptionList:[],
+        //查询条件
+        learnStatus:'',
+        queryParams: {
+          page: 1,
+          pageSize: 20,
+          knowledgePointId: '',
+          disciplineTypeId: '',
+          courseName: null
+        },
+        //列表数据
+        dataList: [],
+        //数据数量
+        total: 0,
+      }
+    },
+    created() {
+
+    },
+    mounted() {
+      if(sessionStorage.getItem('skipQueryParamsData')){
+        let skipQueryParamsData = JSON.parse(sessionStorage.getItem('skipQueryParamsData'))
+        this.$set(this,'queryParams',skipQueryParamsData.queryParams);
+        this.$set(this,'learnStatus',skipQueryParamsData.learnStatus);
+        sessionStorage.removeItem('skipQueryParamsData');
+      }
+      this.getList();
+      this.examElKnowledgePointTreeList();
+      this.examElDisciplineTypeList();
+    },
+    methods: {
+      //切换按钮
+      tableTypeButton(val){
+        if(this.learnStatus !== val){
+          this.$set(this,'learnStatus',val);
+          this.handleQuery();
+        }
+      },
+      //查询按钮
+      handleQuery() {
+        this.$set(this.queryParams, 'page', 1)
+        this.getList()
+      },
+      //重置按钮
+      resetQuery() {
+        this.$set(this,'learnStatus','');
+        this.$set(this, 'queryParams', {
+          page: 1,
+          pageSize: 20,
+          knowledgePointId: '',
+          disciplineTypeId: '',
+          courseName: null
+        })
+        this.getList()
+      },
+      //获取数据列表
+      getList() {
+        let obj = JSON.parse(JSON.stringify(this.queryParams))
+        obj.learnStatus = this.learnStatus;
+        examUserCourseLearningList(obj).then(response => {
+          this.$set(this, 'dataList', response.data.records)
+          this.$set(this, 'total', response.data.total)
+        })
+      },
+      //操作按钮
+      tableButton(item) {
+        let self = this;
+        //学习课程
+        this.$router.push({
+          path: '/learningCourse',
+          query: {
+            courseId: item.courseId,
+            examId: item.examId,
+          }
+        })
+        // if(item.conditionType == 1){
+        //   this.$confirm('还未达到学时要求,是否现在去学习?', "提示", {
+        //     confirmButtonText: "确认",
+        //     cancelButtonText: "取消",
+        //     type: "warning"
+        //   }).then(function() {
+        //   }).then(() => {
+        //     //学时要求
+        //     self.$router.push({
+        //       path: '/safetyEducationExaminationNew/safetyEducation/knowledgeLearning',
+        //       query: {}
+        //     })
+        //   }).catch(() => {});
+        // }else{
+        //   //学习课程
+        //   this.$router.push({
+        //     path: '/learningCourse',
+        //     query: {
+        //       courseId: item.courseId,
+        //       examId: item.examId,
+        //     }
+        //   })
+        // }
+      },
+      examElKnowledgePointTreeList(){
+        examElKnowledgePointTreeList({}).then(response => {
+          const list = response.data || [];
+          this.formatTreeData(list);
+          this.$set(this, 'optionListB', list);
+        });
+      },
+      //查询全部专业类别
+      examElDisciplineTypeList(){
+        examElDisciplineTypeList({}).then(response => {
+          this.$set(this,'disciplineOptionList',response.data);
+        });
+      },
+      //换算分钟
+      secondsToMinutes(totalSeconds) {
+        if (typeof totalSeconds !== 'number' || totalSeconds <= 0) {
+          return 1;
+        }
+        return Math.ceil(totalSeconds / 60);
+      },
+    },
+    beforeRouteLeave(to, from, next) {
+      if (to.name === 'learningCourse') {
+        const skipQueryParamsData = {
+          queryParams: this.queryParams,
+          learnStatus: this.learnStatus,
+        };
+        sessionStorage.setItem('skipQueryParamsData', JSON.stringify(skipQueryParamsData));
+      } else {
+        sessionStorage.removeItem('skipQueryParamsData');
+      }
+      next(); // 必须调用 next() 放行路由
+    },
+  }
+</script>
+<style scoped lang="scss">
+  .violationStudyPage {
+    .violationStudyPage-Page {
+      .pageTitle{
+        height:60px;
+        line-height:60px;
+        padding:0 20px;
+        border-bottom:1px solid #dedede;
+      }
+      .table-top-button-box{
+        display: inline-block;
+        vertical-align: top;
+        margin-right:10px;
+        div{
+          display: flex;
+          p{
+            border:1px solid #DCDFE6;
+            width:80px;
+            text-align: center;
+            height:40px;
+            line-height:40px;
+            cursor: pointer;
+            font-size:14px;
+          }
+          p:nth-child(1){
+            border-top-left-radius:4px;
+            border-bottom-left-radius:4px;
+          }
+          p:nth-child(2){
+            border-left:none;
+          }
+          p:nth-child(3){
+            border-left:none;
+            border-right:none;
+          }
+          p:nth-child(4){
+            border-top-right-radius:4px;
+            border-bottom-right-radius:4px;
+          }
+          .check-table-button{
+            border:1px solid #0183fa;
+            background-color: #0183fa;
+            color:#fff;
+          }
+        }
+      }
+      .page-content-box{
+        padding:20px 0;
+      }
+      .for-max-big-box{
+        flex:1;
+        .null-text-p{
+          line-height:200px;
+          text-align: center;
+          color:#999;
+          font-size:14px;
+        }
+        .for-big-box{
+          cursor: pointer;
+          display: inline-block;
+          width:370px;
+          margin:0 0 20px 20px;
+          border-radius:6px;
+          overflow: hidden;
+          box-shadow: 0 2px 8px rgba(37, 50, 74, 0.12);
+          position: relative;
+          img{
+            display: inline-block;
+            width:370px;
+            height:180px;
+          }
+          .bottom-big-box{
+            padding:10px 0 10px 10px;
+            .name-p{
+              line-height:30px;
+              font-size:16px;
+              font-weight:700;
+              display:block;
+              overflow:hidden;
+              text-overflow:ellipsis;
+              white-space:nowrap;
+            }
+            .time{
+              line-height:30px;
+              font-size:14px;
+            }
+            .text-box{
+              display: flex;
+              p{
+                line-height:30px;
+                font-size:14px;
+                font-weight:700;
+                span{
+                  color:#666;
+                  font-weight:500;
+                }
+              }
+            }
+          }
+          .type-p{
+            position: absolute;
+            right:20px;
+            top:15px;
+            padding:5px 10px;
+            border-radius:4px;
+            font-size:14px;
+          }
+          .type-p-1{
+            color:#fff;
+            background-color: #999;
+          }
+          .type-p-2{
+            color:#fff;
+            background-color: #7CCD7C;
+          }
+          .type-p-3{
+            color:#fff;
+            background-color: #0183fa;
+          }
+          .num-p{
+            position: absolute;
+            right:20px;
+            bottom:20px;
+          }
+          .num-p ::v-deep .el-progress__text {
+            margin-left:0!important;
+            font-size:12px!important;
+          }
+          .position-p-1{
+            position: absolute;
+            top:140px;
+            left:10px;
+            /*单行省略号*/
+            display:block;
+            overflow:hidden;
+            text-overflow:ellipsis;
+            white-space:nowrap;
+            line-height:20px;
+            border:1px solid #0183fa;
+            max-width:350px;
+            border-radius:4px;
+            padding:4px 10px;
+            font-size:14px;
+            /*background-color: rgba(1, 131, 250,0.2);*/
+            background-color: #0183fa;
+            color:#fff;
+          }
+        }
+      }
+    }
+  }
+</style>

+ 72 - 19
src/views/safetyEducationExaminationNew/trainingManagement/trainingTask/index.vue

@@ -6,17 +6,44 @@
         <el-form :model="queryParams" class="form-box" ref="queryForm"
                  :inline="true" style="width:100%;"
         >
-          <el-form-item label="" prop="trainingMode">
-            <div class="table-top-button-box">
-              <div>
-                <p :class="queryParams.trainingMode === ''?'check-table-button':''" @click="tableTypeButton('')">全部</p>
-                <p :class="queryParams.trainingMode === 2?'check-table-button':''" @click="tableTypeButton(2)">线下培训</p>
-                <p :class="queryParams.trainingMode === 1?'check-table-button':''" @click="tableTypeButton(1)">线上培训</p>
-              </div>
-            </div>
+          <el-form-item label="" prop="categoryId">
+            <el-select v-model="queryParams.categoryId" placeholder="培训分类" style="width: 160px">
+              <el-option
+                v-for="dict in optionListB"
+                :key="dict.id"
+                :label="dict.categoryName"
+                :value="dict.id"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="orgDeptId">
+            <el-cascader
+              style="width: 180px"
+              v-model="queryParams.orgDeptId"
+              :options="optionListC"
+              :props="{
+                    emitPath:false,
+                    checkStrictly: true,
+                    value: 'deptId',
+                    label: 'deptName',
+                    children: 'child',
+                  }"
+              :show-all-levels="false"
+              filterable
+              placeholder="培训单位"
+            ></el-cascader>
           </el-form-item>
+          <!--<el-form-item label="" prop="trainingMode">-->
+            <!--<div class="table-top-button-box">-->
+              <!--<div>-->
+                <!--<p :class="queryParams.trainingMode === ''?'check-table-button':''" @click="tableTypeButton('')">全部</p>-->
+                <!--<p :class="queryParams.trainingMode === 2?'check-table-button':''" @click="tableTypeButton(2)">线下培训</p>-->
+                <!--<p :class="queryParams.trainingMode === 1?'check-table-button':''" @click="tableTypeButton(1)">线上培训</p>-->
+              <!--</div>-->
+            <!--</div>-->
+          <!--</el-form-item>-->
           <el-form-item label="" prop="status">
-            <el-select v-model="queryParams.status" placeholder="状态" style="width: 160px">
+            <el-select v-model="queryParams.status" placeholder="培训状态" style="width: 160px">
               <el-option
                 v-for="dict in optionListA"
                 :key="dict.value"
@@ -29,19 +56,22 @@
             <el-input
               maxLength="30"
               v-model="queryParams.searchValue"
-              placeholder="搜索培训名称、主讲人"
+              placeholder="模糊搜索培训名称/导师姓名或工号"
               style="width: 400px"
             />
           </el-form-item>
-          <el-form-item label="" prop="categoryId">
-            <el-select v-model="queryParams.categoryId" placeholder="分类" style="width: 160px">
-              <el-option
-                v-for="dict in optionListB"
-                :key="dict.id"
-                :label="dict.categoryName"
-                :value="dict.id"
-              />
-            </el-select>
+          <el-form-item label="" prop="state">
+            <el-date-picker
+              :clearable="false"
+              v-model="dateRange"
+              size="small"
+              style="width: 240px"
+              value-format="yyyy-MM-dd"
+              type="daterange"
+              range-separator="-"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期"
+            ></el-date-picker>
           </el-form-item>
           <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
           <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
@@ -99,6 +129,7 @@
 <script>
   import {
     examElTrainingCategorySimpleList,examUserTrainingList,
+    systemDeptCurrentDept,
   } from "@/api/safetyEducationExaminationNew/index";
   //import { getDicts } from "@/api/commonality/noPermission";
   //import { systemUserSelect } from "@/api/commonality/permission";
@@ -117,15 +148,19 @@
         //下拉列表数据
         optionListA: [{ value: 1, label: '未开始' }, { value: 2, label: '进行中' }, { value: 3, label: '已结束' }],
         optionListB: [],
+        optionListC:[],
         //查询条件
         queryParams: {
           page: 1,
           pageSize: 8,
           trainingMode: '',
+          orgDeptId: '',
           status: null,
           searchValue: '',
           categoryId: null,
         },
+        //时间数据
+        dateRange: [],
         //列表数据
         dataList: [],
         //数据数量
@@ -141,6 +176,7 @@
 
     },
     mounted() {
+      this.systemDeptCurrentDept();
       this.examElTrainingCategorySimpleList();
       this.getList();
     },
@@ -158,10 +194,12 @@
       },
       //重置按钮
       resetQuery() {
+        this.$set(this, 'dateRange', [])
         this.$set(this, 'queryParams', {
           page: 1,
           pageSize: 8,
           trainingMode: '',
+          orgDeptId: '',
           status: null,
           searchValue: '',
           categoryId: null,
@@ -171,6 +209,13 @@
       //获取数据列表
       getList() {
         let obj = JSON.parse(JSON.stringify(this.queryParams))
+        if (this.dateRange[0]) {
+          obj.startTime = this.dateRange[0] + 'T00:00:00'
+          obj.endTime = this.dateRange[1] + 'T23:59:59'
+        } else {
+          obj.startTime = ''
+          obj.endTime = ''
+        }
         examUserTrainingList(obj).then(response => {
           this.$set(this, 'dataList', response.data.records)
           this.$set(this, 'total', response.data.total)
@@ -195,6 +240,14 @@
           this.$set(this,'optionListB',response.data);
         });
       },
+      //学院列表
+      systemDeptCurrentDept(){
+        systemDeptCurrentDept({}).then(response => {
+          const list = response.data || [];
+          this.formatTreeData(list);
+          this.$set(this,'optionListC',list);
+        });
+      },
     }
   }
 </script>