Browse Source

fix(report): 报表数据导出,修改文件格式

lishihao 3 months ago
parent
commit
db05125751
1 changed files with 32 additions and 4 deletions
  1. 32 4
      modules/reports/controllers/rpt_tpl_controller.js

+ 32 - 4
modules/reports/controllers/rpt_tpl_controller.js

@@ -511,10 +511,38 @@ let mExport = {
       });
 
       var zip = new JSZip();
-      zip.file("报表模板备份.json", JSON.stringify(rptTemplate));
-      zip.file("报表树备份.json", JSON.stringify(rptTplTree));
-      zip.file("报表配置备份.json", JSON.stringify(rptConfig));
-      zip.file("报表指标备份.json", JSON.stringify(rptField));
+      zip.file(
+        "报表模板备份.json",
+        JSON.stringify({
+          type: `highWay`,
+          name: `reportTemplate`,
+          data: rptTemplate,
+        })
+      );
+      zip.file(
+        "报表树备份.json",
+        JSON.stringify({
+          type: `highWay`,
+          name: `reportTree`,
+          data: rptTplTree,
+        })
+      );
+      zip.file(
+        "报表配置备份.json",
+        JSON.stringify({
+          type: `highWay`,
+          name: `reportConfig`,
+          data: rptConfig,
+        })
+      );
+      zip.file(
+        "报表指标备份.json",
+        JSON.stringify({
+          type: `highWay`,
+          name: `reportField`,
+          data: rptField,
+        })
+      );
       // 将Zip打包成Blob对象
       zip
         .generateNodeStream({ type: "nodebuffer", streamFiles: true })