xiatian 4 년 전
부모
커밋
088f7dd933

+ 16 - 21
src/modules/questions/views/EditPaper.vue

@@ -999,7 +999,7 @@ export default {
         callback: (action) => {
           if (action == "confirm") {
             this.loading = true;
-            this.$http
+            this.$httpWithMsg
               .put(
                 QUESTION_API +
                   "/paperDetail/" +
@@ -1016,8 +1016,8 @@ export default {
                   message: vectorStr + "成功",
                   type: "success",
                 });
-                this.loading = false;
-              });
+              })
+              .finally(() => (this.loading = false));
           }
         },
       });
@@ -1219,7 +1219,8 @@ export default {
             }
           }
           setTimeout(() => {
-            document.documentElement.scrollTop = document.body.scrollTop = scrollPosition;
+            document.documentElement.scrollTop = document.body.scrollTop =
+              scrollPosition;
             console.log(scrollPosition);
           }, 1000);
           this.loading = false;
@@ -1251,7 +1252,7 @@ export default {
           callback: (action) => {
             if (action == "confirm") {
               this.loading = true;
-              this.$http
+              this.$httpWithMsg
                 .delete(
                   QUESTION_API +
                     "/paperDetail/" +
@@ -1266,8 +1267,8 @@ export default {
                     message: "删除成功",
                     type: "success",
                   });
-                  this.loading = false;
-                });
+                })
+                .finally(() => (this.loading = false));
             }
           },
         });
@@ -1643,7 +1644,7 @@ export default {
           type: "warning",
         }).then(() => {
           this.dialogLoading = true;
-          this.$http
+          this.$httpWithMsg
             .delete(
               QUESTION_API +
                 "/paper/deleteQuestion/" +
@@ -1667,8 +1668,8 @@ export default {
                   type: "success",
                 });
               }
-              this.dialogLoading = false;
-            });
+            })
+            .finally(() => (this.loading = false));
         });
       } else {
         this.dialogLoading = true;
@@ -1728,7 +1729,7 @@ export default {
           }
         }
         paperDetailUnitExp.question.quesAnswer = this.answer;
-        this.$http
+        this.$httpWithMsg
           .put(QUESTION_API + "/paperDetailUnit", paperDetailUnitExp)
           .then(() => {
             this.$notify({
@@ -1739,13 +1740,7 @@ export default {
             this.closeQuesDialog();
             this.initPaper();
           })
-          .catch((err) => {
-            this.dialogLoading = false;
-            this.$notify({
-              type: "error",
-              message: err.response.data.desc,
-            });
-          });
+          .finally(() => (this.dialogLoading = false));
       }
     },
     //在正确的option上设置isCorrect=1
@@ -1785,7 +1780,7 @@ export default {
         callback: (action) => {
           if (action == "confirm") {
             this.loading = true;
-            this.$http
+            this.$httpWithMsg
               .delete(QUESTION_API + "/paperDetailUnit/" + paperDetailUnitId)
               .then(() => {
                 this.initPaper();
@@ -1796,8 +1791,8 @@ export default {
                   message: "删除成功",
                   type: "success",
                 });
-                this.loading = false;
-              });
+              })
+              .finally(() => (this.loading = false));
           }
         },
       });

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

@@ -85,6 +85,20 @@
               ></el-input>
             </el-form-item>
           </el-col>
+          <el-col :span="6">
+            <el-form-item label="状态">
+              <el-select
+                v-model="formSearch.inUse"
+                class="search_width"
+                clearable
+                placeholder="请选择"
+                size="small"
+              >
+                <el-option value="1" label="已调用"> </el-option>
+                <el-option value="0" label="未调用"> </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
           <el-col :span="6">
             <div class="search_down">
               <el-button size="small" type="primary" @click="searchFrom"
@@ -192,6 +206,11 @@
           prop="paperDetailCount"
         >
         </el-table-column>
+        <el-table-column label="状态" width="150">
+          <template slot-scope="scope">
+            <span>{{ scope.row.inUse == 1 ? "已调用" : "未调用" }}</span>
+          </template>
+        </el-table-column>
         <el-table-column label="录入员" width="150">
           <template slot-scope="scope">
             <span>{{ scope.row.creator }}</span>
@@ -511,6 +530,7 @@ export default {
         lastModifyName: "",
         level: "",
         name: "",
+        inUse: "",
       },
       tableData: [],
       currentPage: 1,

+ 5 - 7
src/modules/questions/views/Question.vue

@@ -457,15 +457,13 @@ export default {
       this.searchQues();
     },
     searchQues() {
-      var pageNo = Number(this.currentPage | 1);
-      this.currentPage = 1;
       this.tableData = [];
-      var url = QUESTION_API + "/question/" + pageNo + "/" + this.pageSize;
+      var url =
+        QUESTION_API + "/question/" + this.currentPage + "/" + this.pageSize;
       this.loading = true;
       this.$http.get(url, { params: this.formSearch }).then((response) => {
         this.tableData = response.data.content;
         this.total = response.data.totalElements;
-        this.currentPage = Number(pageNo);
         this.loading = false;
       });
     },
@@ -640,9 +638,9 @@ export default {
                 subQuestionMultipleRightAnswer.push(orderNum2);
               }
             }
-            subQuestion[
-              "quesAnswer"
-            ] = subQuestionMultipleRightAnswer.sort().toString();
+            subQuestion["quesAnswer"] = subQuestionMultipleRightAnswer
+              .sort()
+              .toString();
           }
         }
       }

+ 4 - 10
src/modules/questions/views/SelectQuestion.vue

@@ -319,7 +319,7 @@ export default {
           cancelButtonText: "取消",
           type: "warning",
         }).then(() => {
-          this.$http
+          this.$httpWithMsg
             .post(
               QUESTION_API +
                 "/paper/selectQuestions/" +
@@ -336,12 +336,6 @@ export default {
               this.$router.push({
                 path: "/edit_paper/" + this.paperId + "/" + this.parentView,
               });
-            })
-            .catch(() => {
-              this.$notify({
-                type: "error",
-                message: "添加失败!",
-              });
             });
         });
       }
@@ -408,9 +402,9 @@ export default {
                 subQuestionMultipleRightAnswer.push(orderNum_k);
               }
             }
-            subQuestion[
-              "quesAnswer"
-            ] = subQuestionMultipleRightAnswer.sort().toString();
+            subQuestion["quesAnswer"] = subQuestionMultipleRightAnswer
+              .sort()
+              .toString();
           }
         }
       }