zhangjie 11 сар өмнө
parent
commit
60b4a45109

+ 8 - 5
src/modules/mark/components/ScoreReportPreview.vue

@@ -68,11 +68,14 @@ export default {
 
 
       const filename = `${this.title}.pdf`;
       const filename = `${this.title}.pdf`;
       const res = await downloadByApi(() => {
       const res = await downloadByApi(() => {
-        return scoreReportExport({
+        const formData = new FormData();
-          // examId: this.instance.examId,
+        const htmlFile = new File(
-          // paperNumber: this.instance.paperNumber,
+          [this.$refs.reportRef.getTemp()],
-          htmlContent: this.$refs.reportRef.getTemp(),
+          `${Date.now()}.html`,
-        });
+          { type: "text/html" }
+        );
+        formData.append("file", htmlFile);
+        return scoreReportExport(formData);
       }, filename).catch((e) => {
       }, filename).catch((e) => {
         this.$message.error(e || "下载失败,请重新尝试!");
         this.$message.error(e || "下载失败,请重新尝试!");
       });
       });