heyang hace 1 año
padre
commit
2bb7619cea

+ 7 - 7
src/api/safetyEducationExam/index.js

@@ -106,21 +106,21 @@ export function listQu(query) {
   })
 }
 
-// 新增题目类型
-export function list_option(data) {
+// 题目类型列表
+export function examElClassifyQueryOption(data) {
   return request({
-    url: '/exam/el_classify/queryOption',
+    url: '/exam/elClassify/queryOption',
     method: 'post',
     data: data
   })
 }
 
 // 查询课件资源列表
-export function listEl_resources(query) {
+export function examElResourcesList(data) {
   return request({
-    url: '/exam/el_resources/list',
-    method: 'get',
-    params: query
+    url: '/exam/elResources/list',
+    method: 'post',
+    data: data
   })
 }
 // 新增学习资源

+ 12 - 11
src/views/safetyEducationExam/safeLearning/el_course/edit.vue

@@ -451,9 +451,11 @@
 </template>
 
 <script>
-  import { listQu,list_option,listEl_resources,getEl_course,addEl_course, updateEl_course,add_el_chapter,
-    edit_el_chapter, del_el_chapter,queryChapterQu,listEl_category } from "@/api/safetyEducationExam/index";
-  import { getDeptNoAuthList } from "@/api/commonality/permission";
+import {
+  listQu, list_option, examElResourcesList, getEl_course, addEl_course, updateEl_course, add_el_chapter,
+  edit_el_chapter, del_el_chapter, queryChapterQu, listEl_category, examElCategoryTreeList
+} from "@/api/safetyEducationExam/index";
+import {getDeptDropList, getDeptNoAuthList} from "@/api/commonality/permission";
   import { getToken } from "@/utils/auth";
   import { videoPlayer } from 'vue-video-player'
   import 'video.js/dist/video-js.css'
@@ -672,9 +674,8 @@
       /******************基本信息-开始******************/
       /* 查询学院列表 */
       getDeptList(){
-        getDeptNoAuthList().then(response => {
-          // this.deptOptions = response.data;
-          this.$set(this, 'deptOptions', response.data)
+        getDeptDropList({deptType:1}).then(response => {
+          this.$set(this,'deptOptions',response.data);
         });
       },
       //步骤条下一步按钮
@@ -735,14 +736,14 @@
       },
       /** 查询课程分类树 */
       getTreeData() {
-        listEl_category({},2).then( response => {
+        examElCategoryTreeList({},2).then( response => {
           this.classTree = JSON.parse(JSON.stringify(response.data));
 
         });
       },
       /** 查询资源分类树 */
       getResourceTreeData(){
-        listEl_category({},1).then( response => {
+        examElCategoryTreeList({},2).then( response => {
           //this.classTree = JSON.parse(JSON.stringify(response.data));
           let list = [];
           let obj = {
@@ -883,21 +884,21 @@
       //搜索查询课件
       queryResources() {
         this.queryParams.title=this.resourceName;
-        listEl_resources(this.queryParams).then( response => {
+        examElResourcesList(this.queryParams).then( response => {
           this.el_resourcesList =  response.rows;
           this.total =  response.total;
         });
       },
       //获取课件
       getResources() {
-        listEl_resources(this.queryParams).then( response => {
+        examElResourcesList(this.queryParams).then( response => {
           this.el_resourcesList =  response.rows;
           this.total =  response.total;
         });
       },
       //获取题目分类
       getList_option(){
-        list_option({}).then(response => {
+        examElClassifyQueryOption({}).then(response => {
           this.optionList = response.data;
         });
       },

+ 2 - 2
src/views/safetyEducationExam/safeLearning/el_resources/index.vue

@@ -341,7 +341,7 @@
 <script>
   import {
     listEl_category,
-    listEl_resources,
+    examElResourcesList,
     getEl_resources,
     delEl_resources,
     addEl_resources,
@@ -803,7 +803,7 @@ export default {
     /** 查询课件资源列表 */
     getList() {
       this.loading = true;
-      listEl_resources(this.queryParams).then( response => {
+      examElResourcesList(this.queryParams).then( response => {
         this.el_resourcesList =  response.rows;
         this.total =  response.total;
         this.loading = false;

+ 2 - 2
src/views/safetyEducationExam/securityExam/exam/addExamPage.vue

@@ -380,7 +380,7 @@
 
 <script>
 import { Message } from 'element-ui'
-import { listQu,list_option,optionRepo,
+import { listQu,examElClassifyQueryOption,optionRepo,
   addExam,getRepoInfo,upExam  } from "@/api/safetyEducationExam/index";
 import { treeselect } from "@/api/commonality/permission";
 import Treeselect from "@riophae/vue-treeselect";
@@ -779,7 +779,7 @@ export default {
     },
     /** 查询题目分类 */
     getClassifys(){
-      list_option({}).then(response => {
+      examElClassifyQueryOption({}).then(response => {
         for(let i=0;i<response.data.length;i++){
           response.data[i].classifyId = response.data[i].id;
         }

+ 2 - 2
src/views/safetyEducationExam/securityExam/myExercise/index.vue

@@ -17,7 +17,7 @@
 </template>
 
 <script>
-  import { getQueryOption,el_practiseStart } from "@/api/safetyEducationExam/index";
+  import { examElClassifyQueryOption,el_practiseStart } from "@/api/safetyEducationExam/index";
   import playExercise from "./playExercise.vue";
 
   export default {
@@ -67,7 +67,7 @@
       },
       //获取选项列表
       getQueryOption(){
-        getQueryOption({}).then( res => {
+        examElClassifyQueryOption({}).then( res => {
           this.checkList =  res.data;
         });
       },

+ 1 - 1
src/views/safetyEducationExam/securityExam/qu/addTopic.vue

@@ -391,7 +391,7 @@ export default {
     },
     /** 查询题目分类 */
     getClassifys(){
-      list_option({}).then(response => {
+      examElClassifyQueryOption({}).then(response => {
         this.classifys = response.data;
       });
     },

+ 2 - 2
src/views/safetyEducationExam/securityExam/qu/index.vue

@@ -160,7 +160,7 @@
 
 <script>
 import { listQu, getQu, delQu, addQu, updateQu,
-  optionRepo,list_option } from "@/api/safetyEducationExam/index";
+  optionRepo,examElClassifyQueryOption } from "@/api/safetyEducationExam/index";
 import addTopic from "./addTopic.vue";
 
 export default {
@@ -300,7 +300,7 @@ export default {
       this.pageType = 0;
     },
     getList_option(){
-      list_option({}).then(response => {
+      examElClassifyQueryOption({}).then(response => {
         this.optionList = response.data;
       });
     },

+ 31 - 36
src/views/safetyEducationExam/trainingCourse/addDialog.vue

@@ -317,6 +317,9 @@ import {
           lecturerId: [
             { required: true, message: "请选择主讲老师", trigger: "blur" },
           ],
+          tutorId: [
+            { required: true, message: "请选择辅导老师", trigger: "blur" },
+          ],
           userIds: [
             { required: true, message: "请选择上课人员", trigger: "blur" },
           ],
@@ -389,6 +392,7 @@ import {
             lecturerId:this.addDialogData.lecturerId,
             lecturerName:this.addDialogData.lecturerName,
             tutorId:'',
+            tutorName:'',
             placeId:this.addDialogData.placeId,
             place:this.addDialogData.place,
             content:this.addDialogData.content,
@@ -400,15 +404,18 @@ import {
           let mainTeacherList = [{userId:this.addDialogData.lecturerId,userName:this.addDialogData.lecturerName}];
           this.$set(this,'mainTeacherOptions',mainTeacherList);
           //处理辅助老师列表
-          if(this.addDialogData.tutorIds){
-            let userIdList = this.addDialogData.tutorIds.split(',');
-            let userNameList = this.addDialogData.tutorName.split(',');
+          if(this.addDialogData.tutorName){
+            let list=this.addDialogData.tutorName.split(',');
+            let tutorIdList=[];
+            let tutorNameList=[];
             let secondaryTeacherList = [];
-            for(let i=0;i<userIdList.length;i++){
-              userIdList[i] = parseInt(userIdList[i])
-              secondaryTeacherList.push({userId:userIdList[i],userName:userNameList[i]})
-            }
-            obj.tutorId = JSON.parse(JSON.stringify(userIdList));
+            list.forEach(function(item){
+              tutorIdList.push(item.split('@')[0])
+              tutorNameList.push(item.split('@')[1])
+              secondaryTeacherList.push({userId:item.split('@')[0],userName:item.split('@')[1]})
+            })
+            obj.tutorId = JSON.parse(JSON.stringify(tutorIdList));
+            obj.tutorName = JSON.parse(JSON.stringify(tutorNameList));
             this.$set(this,'secondaryTeacherOptions',secondaryTeacherList);
           }
           //处理实验室数据&手动输入场地
@@ -483,26 +490,16 @@ import {
                 }
                 //处理学生数据
                 for(let i=0;i<self.dialogForm.userIds.length;i++){
-                  for(let t=0;t<self.addDialogData.userList.length;t++){
-                    if(self.dialogForm.userIds[i].userId==self.addDialogData.userList[t].userId){
-                      obj.userList.push(self.addDialogData.userList[t])
-                    }else{
-                      obj.userList.push({'userId':self.dialogForm.userIds[i].userId,'userName':self.dialogForm.userIds[i].jobNum,'userImg':self.dialogForm.userIds[i].avatar,})
-                    }
-                  }
-                }
-                console.log(self.dialogForm.userIds)
-
-                //根据id获取辅导老师姓名
-                let tutorNamelist=[]
-                for(let i=0;i<this.dialogForm.tutorId.length;i++){
-                  for(let t=0;t<this.secondaryTeacherOptionsArr.length;t++){
-                    if(this.dialogForm.tutorId[i]==this.secondaryTeacherOptionsArr[t].userId){
-                      tutorNamelist.push(this.secondaryTeacherOptionsArr[t].userName)
+                  if(self.dialogForm.userIds[i].jobNum){
+                    obj.userList.push({'userId':self.dialogForm.userIds[i].userId,'userName':self.dialogForm.userIds[i].jobNum,'userImg':self.dialogForm.userIds[i].avatar,})
+                  }else{
+                    for(let t=0;t<self.addDialogData.userList.length;t++){
+                      if(self.dialogForm.userIds[i].userId==self.addDialogData.userList[t].userId){
+                        obj.userList.push(self.addDialogData.userList[t])
+                      }
                     }
                   }
                 }
-                obj.tutorName=tutorNamelist+'';
                 securitycourseEdit(obj).then(response => {
                   this.msgSuccess(response.msg)
                   this.$parent.controlsButton(6)
@@ -536,21 +533,20 @@ import {
                   obj.userList.push({'userId':self.dialogForm.userIds[i].userId,'userName':self.dialogForm.userIds[i].jobNum,'userImg':self.dialogForm.userIds[i].avatar,})
                 }
                 //根据id获取辅导老师姓名
-                let tutorNamelist=[]
-                for(let i=0;i<this.dialogForm.tutorId.length;i++){
-                  for(let t=0;t<this.secondaryTeacherOptionsArr.length;t++){
-                      if(this.dialogForm.tutorId[i]==this.secondaryTeacherOptionsArr[t].userId){
-                        tutorNamelist.push(this.secondaryTeacherOptionsArr[t].userName)
-                      }
-                  }
-                }
-                obj.tutorName=tutorNamelist+'';
+                // let tutorNamelist=[]
+                // for(let i=0;i<this.dialogForm.tutorId.length;i++){
+                //   for(let t=0;t<this.secondaryTeacherOptionsArr.length;t++){
+                //       if(this.dialogForm.tutorId[i]==this.secondaryTeacherOptionsArr[t].userId){
+                //         tutorNamelist.push(this.secondaryTeacherOptionsArr[t].userName)
+                //       }
+                //   }
+                // }
+                // obj.tutorName=tutorNamelist+'';
                 examSecuritycourseAdd(obj).then(response => {
                   this.msgSuccess(response.msg)
                   this.$parent.controlsButton(6)
                 });
               }
-              console.log('dialogForm',this.dialogForm)
 
             }
           })
@@ -626,7 +622,6 @@ import {
       },
       //获取实验室列表
       getSubList(val,deptId){
-        console.log(val,deptId)
         if(val == '' && deptId){
           systemSubjectGetlist({deptId:deptId,name:val}).then(response => {
             this.$set(this,'subOptions',response.data);

+ 17 - 1
src/views/safetyEducationExam/trainingCourse/index.vue

@@ -48,7 +48,11 @@
           </template>
         </el-table-column>
         <el-table-column label="主讲老师" prop="lecturerName" width="100" show-overflow-tooltip/>
-        <el-table-column label="辅导老师" prop="tutorName" width="100" show-overflow-tooltip/>
+        <el-table-column label="辅导老师" prop="tutorName" width="100" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span>{{scope.row.tutorName | tutorNameFilters}}</span>
+            </template>
+        </el-table-column>
         <el-table-column label="人数" prop="peopleCount" width="80" show-overflow-tooltip/>
         <el-table-column label="上课时间" prop="coStartDate" width="150" show-overflow-tooltip>
           <template slot-scope="scope">
@@ -105,6 +109,18 @@
   import { getDeptDropList } from "@/api/commonality/permission";
   export default {
     name: 'trainingCourse',
+
+    filters: {
+      tutorNameFilters(params){
+          let list=params.split(',');
+          let tutorNameList=[];
+          let secondaryTeacherList = [];
+          list.forEach(function(item){
+            tutorNameList.push(item.split('@')[1])
+          })
+          return  tutorNameList.join(',')
+      }
+    },
     components: {
       addDialog,
       infoDialog