dedsudiyu 5 days ago
parent
commit
ad007b8f4e
22 changed files with 294 additions and 280 deletions
  1. 8 0
      src/api/safetyEducationExaminationNew/index.js
  2. 2 0
      src/main.js
  3. 21 0
      src/utils/index.js
  4. 0 12
      src/views/safetyEducationExaminationNew/components/historyOfIncorrectQuestions.vue
  5. 51 9
      src/views/safetyEducationExaminationNew/courseManagement/courseManagement/addPage.vue
  6. 37 23
      src/views/safetyEducationExaminationNew/courseManagement/courseManagement/drawerItem.vue
  7. 25 29
      src/views/safetyEducationExaminationNew/courseManagement/courseManagement/index.vue
  8. 24 6
      src/views/safetyEducationExaminationNew/courseManagement/courseManagement/studyCourses.vue
  9. 12 16
      src/views/safetyEducationExaminationNew/courseManagement/coursewareManagement/addPage.vue
  10. 25 29
      src/views/safetyEducationExaminationNew/courseManagement/coursewareManagement/index.vue
  11. 23 19
      src/views/safetyEducationExaminationNew/examManagement/examinationArrange/selectCourse.vue
  12. 23 19
      src/views/safetyEducationExaminationNew/examManagement/examinationArrange/selectTestPaper.vue
  13. 0 12
      src/views/safetyEducationExaminationNew/examManagement/testPaperManagement/addPage.vue
  14. 43 10
      src/views/safetyEducationExaminationNew/examManagement/testPaperManagement/drawerItem.vue
  15. 0 12
      src/views/safetyEducationExaminationNew/examManagement/testPaperManagement/index.vue
  16. 0 12
      src/views/safetyEducationExaminationNew/publicConfiguration/knowledgePointManagement/index.vue
  17. 0 12
      src/views/safetyEducationExaminationNew/questionBankManagement/practiceSolvingProblems/index.vue
  18. 0 12
      src/views/safetyEducationExaminationNew/questionBankManagement/questionBankManagement/addPage.vue
  19. 0 12
      src/views/safetyEducationExaminationNew/questionBankManagement/questionBankManagement/index.vue
  20. 0 12
      src/views/safetyEducationExaminationNew/safetyEducation/knowledgeLearning/index.vue
  21. 0 12
      src/views/safetyEducationExaminationNew/safetyEducation/learningTasks/index.vue
  22. 0 12
      src/views/safetyEducationExaminationNew/safetyTest/practiceQuestions/index.vue

+ 8 - 0
src/api/safetyEducationExaminationNew/index.js

@@ -185,6 +185,14 @@ export function examElCoursewareEdit(data) {
     data: data
   })
 }
+//学时换算方法
+export function examElCoursewareCalculateLearningReward(data) {
+  return request({
+    url: '/exam/elCourseware/calculateLearningReward',
+    method: 'post',
+    data: data
+  })
+}
 //课件详情
 export function examElCoursewareDetail(query) {
   return request({

+ 2 - 0
src/main.js

@@ -21,6 +21,7 @@ import { getConfigKey,getDicts } from "@/api/commonality/noPermission";
 import { parseTime, timeToTimestamp, resetForm, addDateRange, selectDictLabel, selectDictLabels,
         handleTree, spaceJudgment, spaceJudgmentHTML, isNum, urlJudge, uploadUrl,
         judgmentNetworkReturnAddress, clickCopy } from "@/utils/ruoyi";
+import { formatTreeData } from "@/utils/index";
 import Pagination from "@/components/Pagination";
 // 自定义表格工具组件
 import RightToolbar from "@/components/RightToolbar"
@@ -72,6 +73,7 @@ Vue.prototype.spaceJudgmentHTML = spaceJudgmentHTML
 Vue.prototype.isNum = isNum
 Vue.prototype.urlJudge = urlJudge
 Vue.prototype.judgmentNetworkReturnAddress = judgmentNetworkReturnAddress
+Vue.prototype.formatTreeData = formatTreeData
 
 Vue.prototype.msgSuccess = function (msg) {
   this.$message({ showClose: true, message: msg, type: "success", offset:100 });

+ 21 - 0
src/utils/index.js

@@ -2,6 +2,27 @@ import { parseTime } from './ruoyi'
 import user from '../store/modules/user'
 
 /**
+ * 树形数据去除空子项
+ */
+export function formatTreeData(data) {
+  data.forEach(item => {
+    if(item.children){
+      if (Array.isArray(item.children) && item.children.length === 0) {
+        item.children = undefined;
+      } else if (item.children && item.children.length > 0) {
+        this.formatTreeData(item.children);
+      }
+    }else if(item.child){
+      if (Array.isArray(item.child) && item.child.length === 0) {
+        item.child = undefined;
+      } else if (item.child && item.child.length > 0) {
+        this.formatTreeData(item.child);
+      }
+    }
+  });
+}
+
+/**
  * 表格时间格式化
  */
 export function formatDate(cellValue) {

+ 0 - 12
src/views/safetyEducationExaminationNew/components/historyOfIncorrectQuestions.vue

@@ -208,18 +208,6 @@
           this.$set(this, 'optionListA', list);
         });
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
-        });
-      },
     }
   }
 </script>

+ 51 - 9
src/views/safetyEducationExaminationNew/courseManagement/courseManagement/addPage.vue

@@ -24,7 +24,7 @@
   //import { getDicts } from "@/api/commonality/noPermission";
   //import { systemUserSelect } from "@/api/commonality/permission";
   //import { getInfo } from "@/api/basicsModules/index";
-  import { examElCourseAdd,examElCourseDetail } from "@/api/safetyEducationExaminationNew/index";
+  import { examElCourseAdd,examElCourseEdit,examElCourseDetail } from "@/api/safetyEducationExaminationNew/index";
   import basicSettings from "./basicSettings.vue";
   import studyCourses from "./studyCourses.vue";
   import afterClassEvaluation from "./afterClassEvaluation.vue";
@@ -68,17 +68,56 @@
       //课程详情
       examElCourseDetail(){
         examElCourseDetail({id:this.newData.id}).then(response => {
-          console.log('1111')
           this.$refs.basicSettings.setDataInfo({
-            disciplineTypeId:'',
+            disciplineTypeId:response.data.disciplineTypeId,
             shelfStatus:response.data.shelfStatus,
             shareStatus:response.data.shareStatus,
             courseName:response.data.courseName,
             coverAttachmentPath:response.data.coverAttachmentPath,
           })
-          this.$refs.studyCourses.setDataInfo({
-
-          })
+          let list = [];
+          for(let i=0;i<response.data.coursewares.length;i++){
+            let index = null
+            for(let x=0;x<list.length;x++){
+              if(list[x].knowledgePointId == response.data.coursewares[i].knowledgePointId){
+                index = x;
+              }
+            }
+            if(index != null){
+              for(let o=0;o<response.data.coursewares[i].coursewares.length;o++){
+                list[index].minList.push({
+                  id:response.data.coursewares[i].coursewares[o].coursewareId,
+                  minData1:response.data.coursewares[i].coursewares[o].coursewareName,
+                  minData2:response.data.coursewares[i].coursewares[o].deptName,
+                  minData3:response.data.coursewares[i].coursewares[o].materialType,
+                  minData4:response.data.coursewares[i].coursewares[o].minLearningDuration,
+                  minData5:response.data.coursewares[i].coursewares[o].creditHours,
+                })
+              }
+            }else{
+              let obj = {
+                showType:true,
+                data1:response.data.coursewares[i].knowledgePointName,
+                data2:0,
+                data3:0,
+                data4:0,
+                knowledgePointId:response.data.coursewares[i].knowledgePointId,
+                minList:[],
+              };
+              for(let o=0;o<response.data.coursewares[i].coursewares.length;o++){
+                obj.minList.push({
+                  id:response.data.coursewares[i].coursewares[o].coursewareId,
+                  minData1:response.data.coursewares[i].coursewares[o].coursewareName,
+                  minData2:response.data.coursewares[i].coursewares[o].deptName,
+                  minData3:response.data.coursewares[i].coursewares[o].materialType,
+                  minData4:response.data.coursewares[i].coursewares[o].minLearningDuration,
+                  minData5:response.data.coursewares[i].coursewares[o].creditHours,
+                })
+              }
+              list.push(obj)
+            }
+          }
+          this.$refs.studyCourses.setDataInfo(list);
         });
       },
       //切换按钮
@@ -103,10 +142,10 @@
           this.$refs.basicSettings.checkTheData()
         }
       },
-      pageDataA(data){
+      pageDataA(){
         this.$refs.studyCourses.checkTheData()
       },
-      pageDataB(data){
+      pageDataB(){
         let self = this;
         this.$confirm('是否确认保存?', "警告", {
           confirmButtonText: "确定",
@@ -127,12 +166,15 @@
             assessmentPassScore:0,
             assessmentAnswerDuration:0,
             coursewareIds:[],
+            assessmentConfigs:[],
           }
           for(let i=0;i<studyData.length;i++){
             for(let o=0;o<studyData[i].minList.length;o++){
               obj.coursewareIds.push(studyData[i].minList[o].id)
             }
           }
+          console.log('self.newData',self.newData)
+          console.log('self.newData.id',self.newData.id)
           if(self.newData.id){
             self.examElCourseEdit(obj);
           }else{
@@ -148,7 +190,7 @@
       },
       examElCourseEdit(obj){
         obj.id = this.newData.id
-        examElCourseAdd(obj).then(response => {
+        examElCourseEdit(obj).then(response => {
           this.msgSuccess(response.message);
           this.$parent.tableButton(6);
         });

+ 37 - 23
src/views/safetyEducationExaminationNew/courseManagement/courseManagement/drawerItem.vue

@@ -1,3 +1,4 @@
+<!--课程管理 - 选择课件-->
 <template>
   <div class="page-container studyCourses-drawerItem">
     <div class="drawerItem-left-box" v-if="!newData.knowledgePointId">
@@ -18,15 +19,14 @@
     </div>
     <div class="drawerItem-right-box">
       <el-form class="drawerItem-right-form" :model="queryParams" ref="form">
-        <div class="table-top-button-box">
-          <div>
-            <p :class="queryParams.shareStatus == ''?'check-table-button':''" @click="tableTypeButton('')">全部</p>
-            <p :class="queryParams.shareStatus == '1'?'check-table-button':''" @click="tableTypeButton('1')">共享</p>
-            <p :class="queryParams.shareStatus == '0'?'check-table-button':''" @click="tableTypeButton('0')">不共享</p>
-          </div>
-        </div>
-        <el-form-item label="" prop="queryParamsData1">
-          <el-select v-model="queryParams.queryParamsData1" placeholder="课件类型" style="width: 200px">
+        <el-form-item label="" prop="shareStatus">
+          <el-select v-model="queryParams.shareStatus" placeholder="是否共享" style="width: 120px">
+            <el-option label="共享" value="1"/>
+            <el-option label="不共享" value="0"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="" prop="materialType">
+          <el-select v-model="queryParams.materialType" placeholder="课件类型" style="width: 200px">
             <el-option
               v-for="dict in optionListA"
               :key="dict.value"
@@ -35,20 +35,27 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="" prop="queryParamsData2">
-          <el-select v-model="queryParams.queryParamsData2" placeholder="来源" style="width: 200px">
-            <el-option
-              v-for="dict in optionListB"
-              :key="dict.deptId"
-              :label="dict.deptName"
-              :value="dict.deptId"
-            />
-          </el-select>
+        <el-form-item label="" prop="deptId">
+          <el-cascader
+            style="width: 180px"
+            v-model="queryParams.deptId"
+            :options="optionListB"
+            :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="queryParamsData3">
+        <el-form-item label="" prop="searchValue">
           <el-input
             maxLength="30"
-            v-model="queryParams.queryParamsData3"
+            v-model="queryParams.searchValue"
             placeholder="搜索名称"
             style="width: 200px"
           />
@@ -207,8 +214,8 @@
         let numA = 0
         let numB = 0
         for(let i=0;i<self.multipleSelection.length;i++){
-          numA = numA + parseInt(self.multipleSelection[i].minLearningDuration, 10)
-          numB = numB + parseInt(self.multipleSelection[i].creditHours, 10)
+          numA = self.addAndFormat(numA,self.multipleSelection[i].minLearningDuration)
+          numB = self.addAndFormat(numB,self.multipleSelection[i].creditHours)
           list.push({
             id:self.multipleSelection[i].id,
             minData1:self.multipleSelection[i].coursewareName,
@@ -313,9 +320,16 @@
       //学院列表
       systemDeptCurrentDept(){
         systemDeptCurrentDept({}).then(response => {
-          this.$set(this,'optionListB',response.data);
+          const list = response.data || [];
+          this.formatTreeData(list);
+          this.$set(this,'optionListB',list);
         });
       },
+      addAndFormat(val1, val2) {
+        const num1 = parseFloat(val1) || 0;
+        const num2 = parseFloat(val2) || 0;
+        return parseFloat((num1 + num2).toFixed(1));
+      },
     },
   }
 </script>

+ 25 - 29
src/views/safetyEducationExaminationNew/courseManagement/courseManagement/index.vue

@@ -5,13 +5,12 @@
       <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="queryParams.shareStatus == ''?'check-table-button':''" @click="tableTypeButton('')">全部</p>
-              <p :class="queryParams.shareStatus == '1'?'check-table-button':''" @click="tableTypeButton('1')">共享</p>
-              <p :class="queryParams.shareStatus == '0'?'check-table-button':''" @click="tableTypeButton('0')">不共享</p>
-            </div>
-          </div>
+          <el-form-item label="" prop="shareStatus">
+            <el-select v-model="queryParams.shareStatus" placeholder="是否共享" style="width: 120px">
+              <el-option label="共享" value="1"/>
+              <el-option label="不共享" value="0"/>
+            </el-select>
+          </el-form-item>
           <el-form-item label="" prop="shelfStatus">
             <el-select v-model="queryParams.shelfStatus" placeholder="状态" style="width: 200px">
               <el-option
@@ -50,14 +49,21 @@
             </el-select>
           </el-form-item>
           <el-form-item label="" prop="deptId">
-            <el-select v-model="queryParams.deptId" placeholder="来源" style="width: 200px">
-              <el-option
-                v-for="dict in optionListD"
-                :key="dict.deptId"
-                :label="dict.deptName"
-                :value="dict.deptId"
-              />
-            </el-select>
+            <el-cascader
+              style="width: 180px"
+              v-model="queryParams.deptId"
+              :options="optionListD"
+              :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="searchValue">
             <el-input
@@ -102,7 +108,7 @@
           <el-table-column label="来源" prop="deptName" width="120" show-overflow-tooltip/>
           <el-table-column label="最近更新" prop="updateTime" width="200" show-overflow-tooltip>
             <template slot-scope="scope">
-              <span>{{ parseTime(scope.row.updateTime,"{y}-{m}-{d} {h}:{i}") }}</span>
+              <span>{{ scope.row.updateTime?parseTime(scope.row.updateTime,"{y}-{m}-{d} {h}:{i}"):parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
             </template>
           </el-table-column>
           <el-table-column label="操作" width="200" show-overflow-tooltip>
@@ -284,7 +290,9 @@
       //学院列表
       systemDeptCurrentDept(){
         systemDeptCurrentDept({}).then(response => {
-          this.$set(this,'optionListD',response.data);
+          const list = response.data || [];
+          this.formatTreeData(list);
+          this.$set(this,'optionListD',list);
         });
       },
       //查询全部专业类别
@@ -293,18 +301,6 @@
           this.$set(this,'optionListC',response.data);
         });
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
-        });
-      },
     },
   }
 </script>

+ 24 - 6
src/views/safetyEducationExaminationNew/courseManagement/courseManagement/studyCourses.vue

@@ -140,8 +140,10 @@
     },
     methods:{
       //写入详情
-      setDataInfo(){
-
+      setDataInfo(list){
+        console.log('setDataInfo2',list);
+        this.$set(this,'dataList',list);
+        this.statisticalCalculation();
       },
       //查看课件
       lookItem(item){
@@ -194,8 +196,8 @@
               let numC = 0;
               for(let o=0;o<self.dataList[i].minList.length;o++){
                 numA++
-                numB = numB + parseInt(self.dataList[i].minList[o].minData4, 10)
-                numC = numC + parseInt(self.dataList[i].minList[o].minData5, 10)
+                numB = self.addAndFormat(numB,self.dataList[i].minList[o].minData4)
+                numC = self.addAndFormat(numC,self.dataList[i].minList[o].minData5)
               }
               self.dataList[i].data2 = numA
               self.dataList[i].data3 = numB
@@ -221,12 +223,21 @@
         let numC = 0;
         let numD = 0;
         for(let i=0;i<self.dataList.length;i++){
+          let data2 = 0;
+          let data3 = 0;
+          let data4 = 0;
           numA++
           for(let o=0;o<self.dataList[i].minList.length;o++){
+            data2++
+            data3 = self.addAndFormat(data3,self.dataList[i].minList[o].minData4)
+            data4 = self.addAndFormat(data4,self.dataList[i].minList[o].minData5)
             numB++
-            numC = numC + parseInt(self.dataList[i].minList[o].minData4, 10)
-            numD = numD + parseInt(self.dataList[i].minList[o].minData5, 10)
+            numC = self.addAndFormat(numC,self.dataList[i].minList[o].minData4)
+            numD = self.addAndFormat(numD,self.dataList[i].minList[o].minData5)
           }
+          self.dataList[i].data2 = data2;
+          self.dataList[i].data3 = data3;
+          self.dataList[i].data4 = data4;
         }
         this.$set(this,'num1',numA);
         this.$set(this,'num2',numB);
@@ -264,6 +275,7 @@
         }).then(function() {
         }).then(() => {
           self.dataList.splice(index,1);
+          self.statisticalCalculation();
         }).catch(() => {});
       },
       //小项删除
@@ -277,6 +289,7 @@
         }).then(function() {
         }).then(() => {
           self.dataList[index].minList.splice(minIndex,1);
+          self.statisticalCalculation();
         }).catch(() => {});
       },
       // ========== 大项拖拽逻辑 ==========
@@ -353,6 +366,11 @@
         }
         this.$parent.pageDataB();
       },
+      addAndFormat(val1, val2) {
+        const num1 = parseFloat(val1) || 0;
+        const num2 = parseFloat(val2) || 0;
+        return parseFloat((num1 + num2).toFixed(1));
+      },
     },
   }
 </script>

+ 12 - 16
src/views/safetyEducationExaminationNew/courseManagement/coursewareManagement/addPage.vue

@@ -168,6 +168,7 @@
           <div class="form-box">
             <el-form-item label="要求时长" prop="minLearningDuration">
               <el-input-number  class="form-input-number"
+                                @change="examElCoursewareCalculateLearningReward"
                                 style="width:200px"
                                 :min="0"
                                 :max="9999"
@@ -195,10 +196,10 @@
                                   style="width:120px"
                                   :min="0"
                                   :max="9999"
-                                  :step="1" :precision="0" step-strictly
+                                  :step="0.1" :precision="1" step-strictly
                                   v-model="newData.creditHours">
                 </el-input-number>
-                <span style="margin-left:15px;">分钟</span>
+                <span style="margin-left:15px;">学时</span>
               </el-form-item>
               <el-form-item label="可得积分" prop="autoPoints" style="width:410px;" label-width="150px">
                 <el-switch
@@ -216,7 +217,7 @@
                                   style="width:120px"
                                   :min="0"
                                   :max="9999"
-                                  :step="1" :precision="0" step-strictly
+                                  :step="0.1" :precision="1" step-strictly
                                   v-model="newData.points">
                 </el-input-number>
                 <span style="margin-left:15px;">积分</span>
@@ -233,7 +234,7 @@
   //import { getDicts } from "@/api/commonality/noPermission";
   //import { systemUserSelect } from "@/api/commonality/permission";
   import {
-    examElKnowledgePointTreeList,examElDisciplineTypeList,
+    examElKnowledgePointTreeList,examElDisciplineTypeList,examElCoursewareCalculateLearningReward,
     examElCoursewareAdd,examElCoursewareEdit,examElCoursewareDetail,
   } from "@/api/safetyEducationExaminationNew/index";
   import { getToken } from "@/utils/auth";
@@ -431,6 +432,13 @@
           }
         })
       },
+      //计算时长
+      examElCoursewareCalculateLearningReward(num){
+        examElCoursewareCalculateLearningReward({minLearningDuration:num}).then(response => {
+          this.$set(this.newData,'creditHours',response.data.creditHours);
+          this.$set(this.newData,'points',response.data.points);
+        });
+      },
       //新增课件
       examElCoursewareAdd(){
         let obj = this.newData;
@@ -615,18 +623,6 @@
           this.$set(this,'optionListC',response.data);
         });
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
-        });
-      },
     },
   }
 </script>

+ 25 - 29
src/views/safetyEducationExaminationNew/courseManagement/coursewareManagement/index.vue

@@ -5,13 +5,12 @@
       <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="queryParams.shareStatus == ''?'check-table-button':''" @click="tableTypeButton('')">全部</p>
-              <p :class="queryParams.shareStatus == '1'?'check-table-button':''" @click="tableTypeButton('1')">共享</p>
-              <p :class="queryParams.shareStatus == '0'?'check-table-button':''" @click="tableTypeButton('0')">不共享</p>
-            </div>
-          </div>
+          <el-form-item label="" prop="shareStatus">
+            <el-select v-model="queryParams.shareStatus" placeholder="是否共享" style="width: 120px">
+              <el-option label="共享" value="1"/>
+              <el-option label="不共享" value="0"/>
+            </el-select>
+          </el-form-item>
           <el-form-item label="" prop="materialType">
             <el-select v-model="queryParams.materialType" placeholder="课件类型" style="width: 200px">
               <el-option
@@ -36,18 +35,25 @@
                   }"
               :show-all-levels="false"
               filterable
-              placeholder="请选择知识点"
+              placeholder="知识点"
             ></el-cascader>
           </el-form-item>
           <el-form-item label="" prop="deptId">
-            <el-select v-model="queryParams.deptId" placeholder="来源" style="width: 200px">
-              <el-option
-                v-for="dict in optionListC"
-                :key="dict.deptId"
-                :label="dict.deptName"
-                :value="dict.deptId"
-              />
-            </el-select>
+            <el-cascader
+              style="width: 180px"
+              v-model="queryParams.deptId"
+              :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="searchValue">
             <el-input
@@ -291,19 +297,9 @@
       //学院列表
       systemDeptCurrentDept(){
         systemDeptCurrentDept({}).then(response => {
-          this.$set(this,'optionListC',response.data);
-        });
-      },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
+          const list = response.data || [];
+          this.formatTreeData(list);
+          this.$set(this,'optionListC',list);
         });
       },
     },

+ 23 - 19
src/views/safetyEducationExaminationNew/examManagement/examinationArrange/selectCourse.vue

@@ -38,14 +38,21 @@
           </el-select>
         </el-form-item>
         <el-form-item label="" prop="queryParamsData4">
-          <el-select v-model="queryParams.queryParamsData4" placeholder="来源" style="width: 120px">
-            <el-option
-              v-for="dict in optionListB"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
-            />
-          </el-select>
+          <el-cascader
+            style="width: 180px"
+            v-model="queryParams.deptId"
+            :options="optionListB"
+            :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="queryParamsData5">
           <el-input
@@ -98,7 +105,7 @@
 </template>
 
 <script>
-  import { examElDisciplineTypeList,examElKnowledgePointTreeList, } from "@/api/safetyEducationExaminationNew/index";
+  import { examElDisciplineTypeList,examElKnowledgePointTreeList,systemDeptCurrentDept } from "@/api/safetyEducationExaminationNew/index";
   export default {
     name: 'addPage',
     props: {
@@ -134,6 +141,7 @@
     mounted() {
       this.examElKnowledgePointTreeList();
       this.examElDisciplineTypeList();
+      this.systemDeptCurrentDept();
     },
     methods: {
       // 提交按钮
@@ -182,16 +190,12 @@
           this.$set(this,'optionListD',response.data);
         });
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
+      //学院列表
+      systemDeptCurrentDept(){
+        systemDeptCurrentDept({}).then(response => {
+          const list = response.data || [];
+          this.formatTreeData(list);
+          this.$set(this,'optionListB',list);
         });
       },
     }

+ 23 - 19
src/views/safetyEducationExaminationNew/examManagement/examinationArrange/selectTestPaper.vue

@@ -38,14 +38,21 @@
           </el-select>
         </el-form-item>
         <el-form-item label="" prop="queryParamsData4">
-          <el-select v-model="queryParams.queryParamsData4" placeholder="来源" style="width: 120px">
-            <el-option
-              v-for="dict in optionListB"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
-            />
-          </el-select>
+          <el-cascader
+            style="width: 180px"
+            v-model="queryParams.deptId"
+            :options="optionListB"
+            :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="queryParamsData5">
           <el-select v-model="queryParams.queryParamsData5" placeholder="组卷方式" style="width: 140px">
@@ -102,7 +109,7 @@
 </template>
 
 <script>
-  import { examElDisciplineTypeList,examElKnowledgePointTreeList, } from "@/api/safetyEducationExaminationNew/index";
+  import { examElDisciplineTypeList,examElKnowledgePointTreeList,systemDeptCurrentDept } from "@/api/safetyEducationExaminationNew/index";
   export default {
     name: 'addPage',
     props: {
@@ -139,6 +146,7 @@
     mounted() {
       this.examElKnowledgePointTreeList();
       this.examElDisciplineTypeList();
+      this.systemDeptCurrentDept();
     },
     methods: {
       // 提交按钮
@@ -188,16 +196,12 @@
           this.$set(this,'optionListD',response.data);
         });
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
+      //学院列表
+      systemDeptCurrentDept(){
+        systemDeptCurrentDept({}).then(response => {
+          const list = response.data || [];
+          this.formatTreeData(list);
+          this.$set(this,'optionListB',list);
         });
       },
     }

+ 0 - 12
src/views/safetyEducationExaminationNew/examManagement/testPaperManagement/addPage.vue

@@ -554,18 +554,6 @@
           this.$set(this, 'optionListKnowledge', list)
         })
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children)
-          }
-        })
-      }
     }
   }
 </script>

+ 43 - 10
src/views/safetyEducationExaminationNew/examManagement/testPaperManagement/drawerItem.vue

@@ -11,9 +11,21 @@
       <div class="panel left-panel">
         <div class="panel-inner">
           <div class="filter-bar">
-            <el-select v-model="leftQuery.source" placeholder="来源" size="small" style="width:90px;" clearable>
-              <el-option v-for="item in optionSource" :key="item.value" :label="item.label" :value="item.value" />
-            </el-select>
+            <el-cascader
+              style="width: 180px"
+              v-model="leftQuery.source"
+              :options="optionSource"
+              :props="{
+                    emitPath:false,
+                    checkStrictly: true,
+                    value: 'deptId',
+                    label: 'deptName',
+                    children: 'child',
+                  }"
+              :show-all-levels="false"
+              filterable
+              placeholder="来源"
+            ></el-cascader>
             <el-select v-model="leftQuery.type" placeholder="题型" size="small" style="width:90px;" clearable>
               <el-option v-for="item in optionType" :key="item.value" :label="item.label" :value="item.value" />
             </el-select>
@@ -73,9 +85,21 @@
             </span>
           </div>
           <div class="filter-bar">
-            <el-select v-model="rightQuery.source" placeholder="来源" size="small" style="width:90px;" clearable>
-              <el-option v-for="item in optionSource" :key="item.value" :label="item.label" :value="item.value" />
-            </el-select>
+            <el-cascader
+              style="width: 180px"
+              v-model="rightQuery.source"
+              :options="optionSource"
+              :props="{
+                    emitPath:false,
+                    checkStrictly: true,
+                    value: 'deptId',
+                    label: 'deptName',
+                    children: 'child',
+                  }"
+              :show-all-levels="false"
+              filterable
+              placeholder="来源"
+            ></el-cascader>
             <el-select v-model="rightQuery.type" placeholder="题型" size="small" style="width:90px;" clearable>
               <el-option v-for="item in optionType" :key="item.value" :label="item.label" :value="item.value" />
             </el-select>
@@ -124,6 +148,9 @@
 </template>
 
 <script>
+  import {
+    systemDeptCurrentDept,
+  } from "@/api/safetyEducationExaminationNew/index";
   export default {
     name: 'drawerItem',
     props: {
@@ -141,10 +168,7 @@
         rightTableData: [],
         leftSelected: [],
         rightSelected: [],
-        optionSource: [
-          { label: '系统', value: 1 },
-          { label: '导入', value: 2 },
-        ],
+        optionSource: [],
         optionType: [
           { label: '单选题', value: 1 },
           { label: '多选题', value: 2 },
@@ -189,6 +213,7 @@
     },
     mounted() {
       this.fetchLeftData()
+      this.systemDeptCurrentDept()
     },
     methods: {
       fetchLeftData() {
@@ -227,6 +252,14 @@
       confirmSelect() {
         this.$emit('confirm', [...this.rightTableData])
       },
+      //学院列表
+      systemDeptCurrentDept(){
+        systemDeptCurrentDept({}).then(response => {
+          const list = response.data || [];
+          this.formatTreeData(list);
+          this.$set(this,'optionSource',list);
+        });
+      },
     },
   }
 </script>

+ 0 - 12
src/views/safetyEducationExaminationNew/examManagement/testPaperManagement/index.vue

@@ -309,18 +309,6 @@
           this.$set(this,'optionListD',response.data);
         });
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
-        });
-      },
     },
   }
 </script>

+ 0 - 12
src/views/safetyEducationExaminationNew/publicConfiguration/knowledgePointManagement/index.vue

@@ -221,18 +221,6 @@
           this.$set(this, 'options', list);
         });
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
-        });
-      },
       //操作按钮
       tableButton(type,row){
         console.log('row',row)

+ 0 - 12
src/views/safetyEducationExaminationNew/questionBankManagement/practiceSolvingProblems/index.vue

@@ -238,18 +238,6 @@
           this.$set(this, 'optionListC', list);
         });
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
-        });
-      },
     },
   }
 </script>

+ 0 - 12
src/views/safetyEducationExaminationNew/questionBankManagement/questionBankManagement/addPage.vue

@@ -369,18 +369,6 @@
           this.$set(this, 'optionListB', list);
         });
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
-        });
-      },
       /**
        * 将下标转换为字母
        */

+ 0 - 12
src/views/safetyEducationExaminationNew/questionBankManagement/questionBankManagement/index.vue

@@ -277,18 +277,6 @@
           this.$set(this, 'optionListB', list);
         });
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
-        });
-      },
     },
   }
 </script>

+ 0 - 12
src/views/safetyEducationExaminationNew/safetyEducation/knowledgeLearning/index.vue

@@ -255,18 +255,6 @@
           this.$set(this, 'optionListB', list);
         });
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
-        });
-      },
     }
   }
 </script>

+ 0 - 12
src/views/safetyEducationExaminationNew/safetyEducation/learningTasks/index.vue

@@ -221,18 +221,6 @@
           this.$set(this, 'optionListB', list);
         });
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
-        });
-      },
     }
   }
 </script>

+ 0 - 12
src/views/safetyEducationExaminationNew/safetyTest/practiceQuestions/index.vue

@@ -218,18 +218,6 @@
           this.$set(this, 'optionListB', list);
         });
       },
-      formatTreeData(data) {
-        data.forEach(item => {
-          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
-          if (Array.isArray(item.children) && item.children.length === 0) {
-            // 将 children 设为 undefined(或直接 delete item.children;)
-            item.children = undefined;
-          } else if (item.children && item.children.length > 0) {
-            // 如果还有下一级,继续递归处理
-            this.formatTreeData(item.children);
-          }
-        });
-      },
     }
   }
 </script>