xiatian 4 년 전
부모
커밋
43919ff3dd
1개의 변경된 파일20개의 추가작업 그리고 0개의 파일을 삭제
  1. 20 0
      src/modules/questions/views/GenPaperDetail.vue

+ 20 - 0
src/modules/questions/views/GenPaperDetail.vue

@@ -360,6 +360,13 @@
                 </el-form-item>
               </el-form>
               <el-table :data="tempPapers" border>
+                <el-table-column label="冻结" width="90">
+                  <template slot-scope="scope">
+                    <el-checkbox
+                      @change="checked => frozenChange(checked, scope.row.id)"
+                    ></el-checkbox>
+                  </template>
+                </el-table-column>
                 <el-table-column label="名称" width="140">
                   <template slot-scope="scope">
                     <div>
@@ -738,7 +745,9 @@ export default {
       tabs: "first",
       genType: "SIMPLE",
       genModelType: "A-Type",
+      frozenPaperSet: new Set(),
       genPaper: {
+        frozenPaperIds: [],
         courseNo: "",
         courseName: "",
         level: "",
@@ -774,6 +783,13 @@ export default {
     };
   },
   methods: {
+    frozenChange(val, paperId) {
+      if (val) {
+        this.frozenPaperSet.add(paperId);
+      } else {
+        this.frozenPaperSet.delete(paperId);
+      }
+    },
     setName() {
       if (this.genPaper.simpleGenPaperPolicy == "BY_QUESTIONNUM") {
         return "抽取数量";
@@ -1013,6 +1029,10 @@ export default {
         }
         this.fullscreenLoading = true;
         this.genPaper.paperIds = this.selectedIds;
+        this.genPaper.frozenPaperIds = [];
+        this.frozenPaperSet.forEach(element => {
+          this.genPaper.frozenPaperIds.push(element);
+        });
         this.$http.post(url, this.genPaper).then(
           response => {
             this.$notify({