刘洋 il y a 11 mois
Parent
commit
4c9f1f1e11
1 fichiers modifiés avec 7 ajouts et 3 suppressions
  1. 7 3
      src/modules/question/components/GptQuestionDialog.vue

+ 7 - 3
src/modules/question/components/GptQuestionDialog.vue

@@ -113,7 +113,7 @@
           <el-form-item style="margin: 0">
             <el-button
               type="primary"
-              :loading="hasTaskRunning || loading"
+              :loading="hasTaskRunning || buildLoading"
               @click="toProduct"
               >生成试题</el-button
             >
@@ -280,6 +280,7 @@ export default {
       pageSize: 10,
       total: 0,
       curQuestion: {},
+      buildLoading: false,
     };
   },
   computed: {
@@ -347,12 +348,14 @@ export default {
       }, 3 * 1000);
     },
     async toProduct() {
-      this.loading = true;
+      // this.loading = true;
+      this.buildLoading = true;
 
       const res = await buildGptQuestionApi({ ...this.formModel }).catch(
         () => {}
       );
-      this.loading = false;
+      // this.loading = false;
+      this.buildLoading = false;
       if (!res) return;
 
       this.curTaskId = res.data;
@@ -374,6 +377,7 @@ export default {
         curPage: this.currentPage,
         pageSize: this.pageSize,
       };
+      this.loading = true;
       const res = await gptQuestionListApi(data).catch(() => {});
       this.loading = false;
       if (!res) return;