zhangjie 2 年之前
父節點
當前提交
595a5c5ae7

+ 2 - 2
src/modules/question/api.js

@@ -283,8 +283,8 @@ export function questionImportFileUpload(data, headData) {
     headers: headData,
     headers: headData,
   });
   });
 }
 }
-export function questionImportParseRichText(richText) {
-  return $httpWithMsg.post(`${QUESTION_API}/word/parse/identify`, richText);
+export function questionImportParseRichText(datas) {
+  return $httpWithMsg.post(`${QUESTION_API}/word/parse/identify`, datas);
 }
 }
 export function questionImportPaperSave(paperData) {
 export function questionImportPaperSave(paperData) {
   return $httpWithMsg.post(`${QUESTION_API}/word/parse/save`, paperData);
   return $httpWithMsg.post(`${QUESTION_API}/word/parse/save`, paperData);

+ 1 - 0
src/modules/question/components/QuestionImportDialog.vue

@@ -213,6 +213,7 @@ export default {
       // Object.entries(this.modalForm).forEach(([key, val]) => {
       // Object.entries(this.modalForm).forEach(([key, val]) => {
       //   if (val !== null) formData.append(key, val);
       //   if (val !== null) formData.append(key, val);
       // });
       // });
+      formData.append("courseId", this.modalForm.courseId);
       formData.append("file", this.fileData.file);
       formData.append("file", this.fileData.file);
 
 
       const res = await questionImportFileUpload(formData, {
       const res = await questionImportFileUpload(formData, {

+ 4 - 3
src/modules/question/components/QuestionImportEdit.vue

@@ -205,9 +205,10 @@ export default {
       if (this.loading) return;
       if (this.loading) return;
       this.loading = true;
       this.loading = true;
 
 
-      const res = await questionImportParseRichText(this.paperRichJson).catch(
-        () => {}
-      );
+      const res = await questionImportParseRichText({
+        ...this.paperRichJson,
+        courseId: this.data.importData.courseId,
+      }).catch(() => {});
       this.loading = false;
       this.loading = false;
       if (!res) return;
       if (!res) return;