dedsudiyu пре 1 дан
родитељ
комит
cec501596f

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

@@ -24,6 +24,7 @@
           <el-form-item label="" prop="knowledgePointIds">
           <el-form-item label="" prop="knowledgePointIds">
             <el-cascader
             <el-cascader
               style="width: 180px"
               style="width: 180px"
+              @change="knowledgePointIdsChange"
               v-model="queryParams.knowledgePointIds"
               v-model="queryParams.knowledgePointIds"
               :options="optionListB"
               :options="optionListB"
               :props="{
               :props="{
@@ -307,6 +308,10 @@
           this.$set(this,'optionListC',response.data);
           this.$set(this,'optionListC',response.data);
         });
         });
       },
       },
+      //知识点选中变更为数组
+      knowledgePointIdsChange(val){
+        this.$set(this.queryParams,'knowledgePointIds',[val]);
+      },
     },
     },
   }
   }
 </script>
 </script>

+ 35 - 9
src/views/safetyEducationExaminationNew/courseManagement/courseManagement/studyCourses.vue

@@ -11,11 +11,10 @@
         class="for-max-box"
         class="for-max-box"
         v-for="(item, index) in dataList"
         v-for="(item, index) in dataList"
         :key="index"
         :key="index"
-        draggable="true"
         @dragstart="onBigDragStart($event, index)"
         @dragstart="onBigDragStart($event, index)"
         @dragover.prevent="onBigDragOver($event, index)"
         @dragover.prevent="onBigDragOver($event, index)"
         @drop="onBigDrop($event, index)"
         @drop="onBigDrop($event, index)"
-        @dragend="onDragEnd"
+        @dragend="onDragEndBig"
       >
       >
         <div class="max-big-name-box">
         <div class="max-big-name-box">
           <p @click="showButton(index)" :class="item.showType?'el-icon-arrow-up':'el-icon-arrow-down'"></p>
           <p @click="showButton(index)" :class="item.showType?'el-icon-arrow-up':'el-icon-arrow-down'"></p>
@@ -23,7 +22,7 @@
           <p>共 {{item.data2}} 个课件,要求时长 {{item.data3}} 分钟,可得 {{item.data4}} 学时</p>
           <p>共 {{item.data2}} 个课件,要求时长 {{item.data3}} 分钟,可得 {{item.data4}} 学时</p>
           <p class="el-icon-delete-solid" v-show="!showType" @click="delBigItem(index)"></p>
           <p class="el-icon-delete-solid" v-show="!showType" @click="delBigItem(index)"></p>
           <!-- 大项拖拽手柄 -->
           <!-- 大项拖拽手柄 -->
-          <p class="el-icon-rank drag-handle" v-show="!showType" title="拖动排序"></p>
+          <p class="el-icon-rank drag-handle" draggable="true" v-show="!showType" title="拖动排序"></p>
           <p class="el-icon-circle-plus" v-show="!showType" @click="addMinItem(item,index)"></p>
           <p class="el-icon-circle-plus" v-show="!showType" @click="addMinItem(item,index)"></p>
         </div>
         </div>
 
 
@@ -37,7 +36,6 @@
             class="for-text-box"
             class="for-text-box"
             v-for="(minItem, minIndex) in item.minList"
             v-for="(minItem, minIndex) in item.minList"
             :key="minIndex"
             :key="minIndex"
-            draggable="true"
             @dragstart="onSmallDragStart($event, index, minIndex)"
             @dragstart="onSmallDragStart($event, index, minIndex)"
             @dragover.prevent="onSmallDragOver($event, minIndex)"
             @dragover.prevent="onSmallDragOver($event, minIndex)"
             @drop="onSmallDrop($event, index, minIndex)"
             @drop="onSmallDrop($event, index, minIndex)"
@@ -50,7 +48,7 @@
             <p>{{minItem.minData5}}</p>
             <p>{{minItem.minData5}}</p>
             <p class="el-icon-delete-solid" v-show="!showType" @click="delItem(index, minIndex)"></p>
             <p class="el-icon-delete-solid" v-show="!showType" @click="delItem(index, minIndex)"></p>
             <!-- 小项拖拽手柄 -->
             <!-- 小项拖拽手柄 -->
-            <p class="el-icon-rank drag-handle" v-show="!showType" title="拖动排序"></p>
+            <p class="el-icon-rank drag-handle" draggable="true" v-show="!showType" title="拖动排序"></p>
             <p class="el-icon-view" v-show="!showType" @click="lookItem(minItem)"></p>
             <p class="el-icon-view" v-show="!showType" @click="lookItem(minItem)"></p>
           </div>
           </div>
         </div>
         </div>
@@ -395,8 +393,14 @@
          return
          return
         }
         }
         this.dragInfo = { type: 'big', bigIndex: index, smallIndex: null };
         this.dragInfo = { type: 'big', bigIndex: index, smallIndex: null };
+        //拖拽优化相关
+        const rowEl = e.target.closest('.for-max-box');
+        if (rowEl) {
+          rowEl.classList.add('dragging');
+          e.dataTransfer.setDragImage(rowEl, 1148, 18);
+        }
         // 给拖拽中的元素加个样式
         // 给拖拽中的元素加个样式
-        e.target.classList.add('dragging');
+        // e.target.classList.add('dragging');
       },
       },
       onBigDragOver(e, index) {
       onBigDragOver(e, index) {
         if(this.showType){
         if(this.showType){
@@ -426,7 +430,13 @@
           return
           return
         }
         }
         this.dragInfo = { type: 'small', bigIndex: bigIndex, smallIndex: smallIndex };
         this.dragInfo = { type: 'small', bigIndex: bigIndex, smallIndex: smallIndex };
-        e.target.classList.add('dragging');
+        //拖拽优化相关
+        const rowEl = e.target.closest('.for-text-box');
+        if (rowEl) {
+          rowEl.classList.add('dragging');
+          e.dataTransfer.setDragImage(rowEl, 1148, 18);
+        }
+        // e.target.classList.add('dragging');
         // 阻止事件冒泡,防止触发大项的拖拽
         // 阻止事件冒泡,防止触发大项的拖拽
         e.stopPropagation();
         e.stopPropagation();
       },
       },
@@ -456,8 +466,24 @@
       },
       },
 
 
       // 拖拽结束,清理样式
       // 拖拽结束,清理样式
+      onDragEndBig(e) {
+        //拖拽优化相关
+        const rowEl = e.target.closest('.for-max-box');
+        if (rowEl) {
+          rowEl.classList.remove('dragging');
+        }
+        // e.target.classList.remove('dragging');
+        document.querySelectorAll('.drag-over').forEach(el => el.classList.remove('drag-over'));
+        this.dragInfo = { type: null, bigIndex: null, smallIndex: null };
+      },
+      // 拖拽结束,清理样式
       onDragEnd(e) {
       onDragEnd(e) {
-        e.target.classList.remove('dragging');
+        //拖拽优化相关
+        const rowEl = e.target.closest('.for-text-box');
+        if (rowEl) {
+          rowEl.classList.remove('dragging');
+        }
+        // e.target.classList.remove('dragging');
         document.querySelectorAll('.drag-over').forEach(el => el.classList.remove('drag-over'));
         document.querySelectorAll('.drag-over').forEach(el => el.classList.remove('drag-over'));
         this.dragInfo = { type: null, bigIndex: null, smallIndex: null };
         this.dragInfo = { type: null, bigIndex: null, smallIndex: null };
       },
       },
@@ -698,7 +724,7 @@
       background-color: #f5f7fa;
       background-color: #f5f7fa;
     }
     }
     .drag-over {
     .drag-over {
-      border-top: 2px solid #409EFF !important; /* 放置位置的指示线 */
+      /*border-top: 2px solid #409EFF !important; !* 放置位置的指示线 *!*/
     }
     }
   }
   }
 </style>
 </style>

+ 19 - 9
src/views/safetyEducationExaminationNew/examManagement/testPaperManagement/addPage.vue

@@ -153,7 +153,6 @@
                 class="table-row"
                 class="table-row"
                 v-for="(item, index) in fixedKnowledgePointConfigs"
                 v-for="(item, index) in fixedKnowledgePointConfigs"
                 :key="index"
                 :key="index"
-                draggable="true"
                 @dragstart="onBigDragStart($event, index)"
                 @dragstart="onBigDragStart($event, index)"
                 @dragover.prevent="onBigDragOver($event, index)"
                 @dragover.prevent="onBigDragOver($event, index)"
                 @drop="onBigDrop($event, index)"
                 @drop="onBigDrop($event, index)"
@@ -186,7 +185,7 @@
                   <span class="col-fixed">
                   <span class="col-fixed">
                     <span class="item-num-span" v-if="newData.assemblyMode==1">{{item.questionIds.length}}</span>
                     <span class="item-num-span" v-if="newData.assemblyMode==1">{{item.questionIds.length}}</span>
                     <span class="el-icon-circle-plus" v-if="newData.assemblyMode==1&&!showType" @click="addFixed(index)"></span>
                     <span class="el-icon-circle-plus" v-if="newData.assemblyMode==1&&!showType" @click="addFixed(index)"></span>
-                    <span class="el-icon-rank" v-if="!showType"></span>
+                    <span class="el-icon-rank" draggable="true" v-if="!showType"></span>
                   </span>
                   </span>
                 </div>
                 </div>
                 <div  v-if="newData.assemblyMode==2 && item.rollerType" class="table-min-row">
                 <div  v-if="newData.assemblyMode==2 && item.rollerType" class="table-min-row">
@@ -432,8 +431,8 @@
             });
             });
           }
           }
         },
         },
-        deep: true, // 关键:必须开启深度监听
-        immediate: false // 初始化时不触发,防止默认值超限误报
+        deep: false,
+        immediate: false
       }
       }
     },
     },
     mounted() {
     mounted() {
@@ -537,7 +536,6 @@
             this.$set(this,'newData',obj);
             this.$set(this,'newData',obj);
             this.$set(this,'fixedKnowledgePointConfigs',list);
             this.$set(this,'fixedKnowledgePointConfigs',list);
             this.calculationMaxData();
             this.calculationMaxData();
-            this.$forceUpdate();
           })
           })
         }
         }
       },
       },
@@ -690,7 +688,7 @@
         this.$set(this,'drawerPropsData',{
         this.$set(this,'drawerPropsData',{
           titleName:this.fixedKnowledgePointConfigs[index].name,
           titleName:this.fixedKnowledgePointConfigs[index].name,
           knowledgePointId:this.fixedKnowledgePointConfigs[index].id,
           knowledgePointId:this.fixedKnowledgePointConfigs[index].id,
-          maxScore:this.remainScore,
+          questionScore:this.fixedKnowledgePointConfigs[index].questionScore,
           questionIds:this.fixedKnowledgePointConfigs[index].questionIds,
           questionIds:this.fixedKnowledgePointConfigs[index].questionIds,
           index:index
           index:index
         });
         });
@@ -702,8 +700,15 @@
           return
           return
         }
         }
         this.dragInfo = { type: 'big', bigIndex: index, smallIndex: null }
         this.dragInfo = { type: 'big', bigIndex: index, smallIndex: null }
+
+        //拖拽优化相关
+        const rowEl = e.target.closest('.table-row');
+        if (rowEl) {
+          rowEl.classList.add('dragging');
+          e.dataTransfer.setDragImage(rowEl, 1177, 30);
+        }
         // 给拖拽中的元素加个样式
         // 给拖拽中的元素加个样式
-        e.target.classList.add('dragging')
+        // e.target.classList.add('dragging')
       },
       },
       onBigDragOver(e, index) {
       onBigDragOver(e, index) {
         if(this.showType){
         if(this.showType){
@@ -731,7 +736,12 @@
         if(this.showType){
         if(this.showType){
           return
           return
         }
         }
-        e.target.classList.remove('dragging')
+        //拖拽优化相关
+        const rowEl = e.target.closest('.table-row');
+        if (rowEl) {
+          rowEl.classList.remove('dragging');
+        }
+        // e.target.classList.remove('dragging')
         document.querySelectorAll('.drag-over').forEach(el => el.classList.remove('drag-over'))
         document.querySelectorAll('.drag-over').forEach(el => el.classList.remove('drag-over'))
         this.dragInfo = { type: null, bigIndex: null, smallIndex: null }
         this.dragInfo = { type: null, bigIndex: null, smallIndex: null }
       },
       },
@@ -1138,7 +1148,7 @@
     }
     }
 
 
     .drag-over {
     .drag-over {
-      border-top: 2px solid #409EFF !important; /* 放置位置的指示线 */
+      /*border-top: 2px solid #409EFF !important; !* 放置位置的指示线 *!*/
     }
     }
   }
   }
 </style>
 </style>

+ 14 - 1
src/views/safetyEducationExaminationNew/examManagement/testPaperManagement/drawerItem.vue

@@ -200,6 +200,7 @@
         knowledgePointId:'',
         knowledgePointId:'',
         maxNum:0,
         maxNum:0,
         maxScore:0,
         maxScore:0,
+        questionScore:0,
         checkIndex:null,
         checkIndex:null,
         // gapScore:0,
         // gapScore:0,
         optionListA:[],
         optionListA:[],
@@ -234,9 +235,10 @@
     mounted() {
     mounted() {
       this.$set(this,'titleName',this.drawerPropsData.name);
       this.$set(this,'titleName',this.drawerPropsData.name);
       this.$set(this,'knowledgePointId',this.drawerPropsData.knowledgePointId);
       this.$set(this,'knowledgePointId',this.drawerPropsData.knowledgePointId);
-      this.$set(this,'maxScore',this.drawerPropsData.maxScore);
+      this.$set(this,'questionScore',this.drawerPropsData.questionScore);
       this.$set(this,'checkIndex',this.drawerPropsData.index);
       this.$set(this,'checkIndex',this.drawerPropsData.index);
       this.$set(this,'questionIds',this.drawerPropsData.questionIds?this.drawerPropsData.questionIds:[]);
       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.leftGetList()
       this.rightGetList()
       this.rightGetList()
       this.systemDeptCurrentDept()
       this.systemDeptCurrentDept()
@@ -335,6 +337,7 @@
         if(!this.questionIds[0]){
         if(!this.questionIds[0]){
           this.$set(this,'rightDataList',[]);
           this.$set(this,'rightDataList',[]);
           this.$set(this,'rightTotal',0);
           this.$set(this,'rightTotal',0);
+          this.$set(this,'maxScore',0);
           return
           return
         }
         }
         let obj = JSON.parse(JSON.stringify(this.rightQueryParams))
         let obj = JSON.parse(JSON.stringify(this.rightQueryParams))
@@ -344,6 +347,9 @@
           this.$set(this,'rightDataList',response.data.records);
           this.$set(this,'rightDataList',response.data.records);
           this.$set(this,'rightTotal',response.data.total);
           this.$set(this,'rightTotal',response.data.total);
           this.$set(this,'maxNum',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) {
       rightGetRowKey(row) {
@@ -392,6 +398,13 @@
         }
         }
         this.$parent.$parent.drawerConfirmButton(JSON.parse(JSON.stringify(obj)))
         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>
 </script>

+ 1 - 0
src/views/safetyEducationExaminationNew/featurePage/learningMaterials/index.vue

@@ -167,6 +167,7 @@
         }
         }
         examUserCoursewareLearningConfirmCompletion(obj).then(response => {
         examUserCoursewareLearningConfirmCompletion(obj).then(response => {
           this.$set(this.newData.coursewares[this.checkLearningIndex],'learnStatus',2);
           this.$set(this.newData.coursewares[this.checkLearningIndex],'learnStatus',2);
+          this.$set(this.newData,'progress',100);
           this.msgSuccess(response.message)
           this.msgSuccess(response.message)
         })
         })
       },
       },

+ 15 - 5
src/views/safetyEducationExaminationNew/questionBankManagement/questionBankManagement/addPage.vue

@@ -86,7 +86,6 @@
           <p class="position-p" @click="addItem()">添加选项</p>
           <p class="position-p" @click="addItem()">添加选项</p>
           <div class="for-editor-form-box"
           <div class="for-editor-form-box"
                v-for="(item,index) in newData.options" :index="index"
                v-for="(item,index) in newData.options" :index="index"
-               draggable="true"
                @dragstart="onBigDragStart($event, index)"
                @dragstart="onBigDragStart($event, index)"
                @dragover.prevent="onBigDragOver($event, index)"
                @dragover.prevent="onBigDragOver($event, index)"
                @drop="onBigDrop($event, index)"
                @drop="onBigDrop($event, index)"
@@ -106,7 +105,7 @@
             </div>
             </div>
             <div class="editor-right-button-box">
             <div class="editor-right-button-box">
               <p class="el-icon-delete-solid" v-if="newData.options[4]" @click="delItem(index)"></p>
               <p class="el-icon-delete-solid" v-if="newData.options[4]" @click="delItem(index)"></p>
-              <p class="el-icon-rank"></p>
+              <p class="el-icon-rank" draggable="true"></p>
             </div>
             </div>
           </div>
           </div>
         </div>
         </div>
@@ -464,8 +463,14 @@
       // ========== 大项拖拽逻辑 ==========
       // ========== 大项拖拽逻辑 ==========
       onBigDragStart(e, index) {
       onBigDragStart(e, index) {
         this.dragInfo = { type: 'big', bigIndex: index, smallIndex: null };
         this.dragInfo = { type: 'big', bigIndex: index, smallIndex: null };
+        //拖拽优化相关
+        const rowEl = e.target.closest('.for-editor-form-box');
+        if (rowEl) {
+          rowEl.classList.add('dragging');
+          e.dataTransfer.setDragImage(rowEl, 1373, 95);
+        }
         // 给拖拽中的元素加个样式
         // 给拖拽中的元素加个样式
-        e.target.classList.add('dragging');
+        // e.target.classList.add('dragging');
       },
       },
       onBigDragOver(e, index) {
       onBigDragOver(e, index) {
         // 只有当拖拽的是大项时才允许放置
         // 只有当拖拽的是大项时才允许放置
@@ -486,7 +491,12 @@
       },
       },
       // 拖拽结束,清理样式
       // 拖拽结束,清理样式
       onDragEnd(e) {
       onDragEnd(e) {
-        e.target.classList.remove('dragging');
+        //拖拽优化相关
+        const rowEl = e.target.closest('.for-editor-form-box');
+        if (rowEl) {
+          rowEl.classList.remove('dragging');
+        }
+        // e.target.classList.remove('dragging');
         document.querySelectorAll('.drag-over').forEach(el => el.classList.remove('drag-over'));
         document.querySelectorAll('.drag-over').forEach(el => el.classList.remove('drag-over'));
         this.dragInfo = { type: null, bigIndex: null, smallIndex: null };
         this.dragInfo = { type: null, bigIndex: null, smallIndex: null };
       },
       },
@@ -660,7 +670,7 @@
       background-color: #f5f7fa;
       background-color: #f5f7fa;
     }
     }
     .drag-over {
     .drag-over {
-      border-top: 2px solid #409EFF !important; /* 放置位置的指示线 */
+      /*border-top: 2px solid #409EFF !important; !* 放置位置的指示线 *!*/
     }
     }
   }
   }
 </style>
 </style>