Bläddra i källkod

修复部分bug

lideyin 5 år sedan
förälder
incheckning
4474cd462c

+ 6 - 0
src/components/ckeditor.vue

@@ -34,6 +34,9 @@ export default {
     extraplugins: {
     extraplugins: {
       type: String,
       type: String,
       default: ""
       default: ""
+    },
+    readonly: {
+      type: Boolean
     }
     }
   },
   },
   computed: {
   computed: {
@@ -57,6 +60,9 @@ export default {
         "Underline,Subscript,Superscript,Image,HorizontalRule,Unlink,Link,Scayt,Cut,Copy,Paste,PasteText,PasteFromWord,Maximize,Italic,Bold,NumberedList,BulletedList,Indent,Outdent,Blockquote,Styles,Format,About,RemoveFormat,Strike"
         "Underline,Subscript,Superscript,Image,HorizontalRule,Unlink,Link,Scayt,Cut,Copy,Paste,PasteText,PasteFromWord,Maximize,Italic,Bold,NumberedList,BulletedList,Indent,Outdent,Blockquote,Styles,Format,About,RemoveFormat,Strike"
     };
     };
     window.CKEDITOR.replace(this.id, config);
     window.CKEDITOR.replace(this.id, config);
+    this.instance.on("instanceReady", ev => {
+      ev.editor.setReadOnly(this.readonly);
+    });
     this.instance.on("change", () => {
     this.instance.on("change", () => {
       let html = this.instance.getData();
       let html = this.instance.getData();
       if (html !== this.value) {
       if (html !== this.value) {

+ 27 - 8
src/modules/examwork/view/examInfo.vue

@@ -49,6 +49,13 @@
               @click="addExamInfoDialog"
               @click="addExamInfoDialog"
               >新增
               >新增
             </el-button>
             </el-button>
+            <el-button
+              size="mini"
+              type="primary"
+              icon="el-icon-document"
+              @click="toCopyExam()"
+              >复制</el-button
+            >
           </el-form-item>
           </el-form-item>
         </el-form>
         </el-form>
 
 
@@ -198,14 +205,7 @@
                       >
                       >
                         学习中心设置
                         学习中心设置
                       </el-button>
                       </el-button>
-                      <el-button
-                        size="mini"
-                        type="primary"
-                        icon="el-icon-edit"
-                        @click="showCopyExam(scope.row)"
-                        >复制</el-button
-                      ></el-dropdown-item
-                    >
+                    </el-dropdown-item>
                   </el-dropdown-menu></el-dropdown
                   </el-dropdown-menu></el-dropdown
                 >
                 >
               </div>
               </div>
@@ -350,6 +350,25 @@ export default {
   },
   },
 
 
   methods: {
   methods: {
+    toCopyExam() {
+      if (this.selectedExamIds.length == 0) {
+        this.$notify({
+          type: "warning",
+          message: "请勾选一个考试"
+        });
+        return;
+      }
+      if (this.selectedExamIds.length > 1) {
+        this.$notify({
+          type: "warning",
+          message: "只能勾选一个考试"
+        });
+        return;
+      }
+      this.showCopyExam(
+        this.tableData.filter(v => v.id === this.selectedExamIds[0])[0]
+      );
+    },
     showCopyExam(row) {
     showCopyExam(row) {
       this.examCopyTitle = "复制考试:" + row.name;
       this.examCopyTitle = "复制考试:" + row.name;
       this.examCopyForm.srcExamId = row.id;
       this.examCopyForm.srcExamId = row.id;

+ 2 - 8
src/modules/examwork/view/notice.vue

@@ -268,15 +268,9 @@
               </el-col>
               </el-col>
             </el-row>
             </el-row>
             <el-form-item label="公告内容" prop="content">
             <el-form-item label="公告内容" prop="content">
-              <div v-if="this.operateType == 'view'">
-                <div
-                  v-html="noticeForm.content"
-                  class="ckeditor-readOnly"
-                ></div>
-              </div>
-              <div v-else>
+              <div>
                 <ckeditor
                 <ckeditor
-                  :readOnly="this.operateType == 'view'"
+                  :readonly="this.operateType == 'view'"
                   width="650px"
                   width="650px"
                   v-model="noticeForm.content"
                   v-model="noticeForm.content"
                 ></ckeditor>
                 ></ckeditor>

+ 29 - 4
src/modules/marking/views/TpScoreBoard.vue

@@ -372,16 +372,16 @@ export default {
         this.$notify({
         this.$notify({
           message: "分数不能为空",
           message: "分数不能为空",
           type: "error",
           type: "error",
-          duration: 1000
+          duration: 2000
         });
         });
         return false;
         return false;
       } else {
       } else {
         let regex = "^\\d+(\\.[\\d])?$";
         let regex = "^\\d+(\\.[\\d])?$";
         if (!score.match(regex)) {
         if (!score.match(regex)) {
           this.$notify({
           this.$notify({
-            message: "分数必须为数字",
+            message: "分数必须为数字且最多一位小数",
             type: "error",
             type: "error",
-            duration: 1000
+            duration: 2000
           });
           });
           return false;
           return false;
         } else {
         } else {
@@ -389,12 +389,29 @@ export default {
             this.$notify({
             this.$notify({
               message: "分数不能超过" + maxScore + "分",
               message: "分数不能超过" + maxScore + "分",
               type: "error",
               type: "error",
-              duration: 1000
+              duration: 2000
             });
             });
             return false;
             return false;
           }
           }
         }
         }
       }
       }
+      //校验分数是否是间隔的倍数
+      var scoreInterval = resultItem.markItem.scoreInterval;
+      if (this.scoreStep != null) {
+        scoreInterval = this.scoreStep;
+      }
+      if (
+        parseFloat(score) != 0 &&
+        parseFloat(score) != parseFloat(maxScore) &&
+        (parseFloat(score) * 10) % (scoreInterval * 10) != 0
+      ) {
+        this.$notify({
+          message: "分数必须是给分间隔的倍数或者零分、满分",
+          type: "error",
+          duration: 2000
+        });
+        return false;
+      }
       return true;
       return true;
     },
     },
     scoreClick(score, index1) {
     scoreClick(score, index1) {
@@ -519,9 +536,17 @@ export default {
             message: itemName + "没有打分,请打分",
             message: itemName + "没有打分,请打分",
             type: "warning"
             type: "warning"
           });
           });
+          if (!this.isMouseMode) {
+            let curItemInput = "item" + resultItem.markItem.id;
+            document.getElementById(curItemInput).focus();
+          }
           return false;
           return false;
         } else {
         } else {
           if (!this.checkScore(resultItem)) {
           if (!this.checkScore(resultItem)) {
+            if (!this.isMouseMode) {
+              let curItemInput = "item" + resultItem.markItem.id;
+              document.getElementById(curItemInput).focus();
+            }
             return false;
             return false;
           }
           }
         }
         }