浏览代码

自动组卷bug

zhangjie 2 年之前
父节点
当前提交
dc9cd7af31
共有 1 个文件被更改,包括 10 次插入2 次删除
  1. 10 2
      src/modules/paper/components/QuestionGroupStruct.vue

+ 10 - 2
src/modules/paper/components/QuestionGroupStruct.vue

@@ -210,7 +210,14 @@ export default {
       this.classifyTree[0].children = res.data || [];
     },
     async resetDataList() {
-      await this.getOriginList();
+      if (!this.useClassify && !this.useDifficult && !this.useProperty) {
+        this.originList = [];
+        this.dataList = [];
+        this.tableData = [];
+        return;
+      }
+      const res = await this.getOriginList().catch(() => {});
+      if (!res) return;
 
       if (this.useProperty) {
         this.parsePropertyInfo();
@@ -220,7 +227,7 @@ export default {
     async getOriginList() {
       if (this.useClassify && !this.selectedFolderIds.length) {
         this.$message.error("请选择选择文件夹!");
-        return;
+        return Promise.reject();
       }
       let data = {
         ...this.filterData,
@@ -232,6 +239,7 @@ export default {
 
       const res = await questionGroupStructListApi(data);
       this.originList = res.data || [];
+      return true;
     },
     parsePropertyInfo() {
       if (!this.useProperty) {