소스 검색

excel download

TonyKang 5 년 전
부모
커밋
1b9641d824
9개의 변경된 파일3158개의 추가작업 그리고 3050개의 파일을 삭제
  1. 1 0
      .gitignore
  2. 46 1
      app/controller/report_controller.js
  3. 5 6
      app/public/report/js/rpt_main.js
  4. 130 133
      app/reports/util/rpt_excel_util.js
  5. 3 0
      app/router.js
  6. 0 1
      app/view/report/index.ejs
  7. 129 129
      config/web.js
  8. 2843 2780
      package-lock.json
  9. 1 0
      package.json

+ 1 - 0
.gitignore

@@ -5,6 +5,7 @@ coverage/
 .idea/
 config/config.local.js
 run/
+app/public/download/
 .DS_Store
 *.swp
 package-lock.json

+ 46 - 1
app/controller/report_controller.js

@@ -8,8 +8,10 @@ const tenderMenu = require('../../config/menu').tenderMenu;
 const measureType = require('../const/tender').measureType;
 const JpcEx = require('../reports/rpt_component/jpc_ex');
 const JV = require('../reports/rpt_component/jpc_value_define');
+const rpt_xl_util = require('../reports/util/rpt_excel_util');
 const rptDataExtractor = require('../reports/util/rpt_calculation_data_util');
 const fsUtil = require('../public/js/fsUtil');
+const fs = require('fs');
 
 module.exports = app => {
     class ReportController extends app.BaseController {
@@ -143,11 +145,54 @@ module.exports = app => {
             ctx.status = 201;
         }
 
-        async createExcelFiles(ctx) {
+        async createExcelFilesEx(ctx) {
             const params = JSON.parse(ctx.request.body.params);
+            function getExcelByPageData(pageRst, rpt_name) {
+                return new Promise(function(resolve, reject) {
+                    rpt_xl_util.exportExcel(pageRst, params.pageSize, rpt_name, params.isOneSheet, null, null, (err, uuidName) => {
+                        if (err) return reject(err);
+                        const fileRst = { uuid: uuidName, reportName: rpt_name };
+                        resolve(fileRst);
+                    });
+                });
+            }
             const pageRstArr = await getMultiRptsCommon(ctx, params, JV.OUTPUT_TYPE_NORMAL);
+            const runnableRst = [];
+            for (let idx = 0; idx < pageRstArr.length; idx++) {
+                runnableRst.push(getExcelByPageData(pageRstArr[idx], params.rpt_names[idx]));
+            }
+            const uuidRst = await Promise.all(runnableRst);
+            ctx.body = { data: uuidRst };
+            ctx.status = 201;
         }
 
+        async getFileByUUID(ctx) {
+            // console.log('downloading : ' + ctx.params.uuid);
+            const uuid = ctx.params.uuid;
+            const rptName = ctx.params.rptName;
+            const suffix = '.' + ctx.params.suffix;
+            function getUuidFile(filestream) {
+                return new Promise(function(resolve, reject) {
+                    filestream.on('data', function(chunk) {
+                        resolve(chunk);
+                    });
+                });
+            }
+            try {
+                const rptNameURI = encodeURI(rptName);
+                const filePath = this.app.baseDir + '/app/public/download/';
+                const filestream = fs.createReadStream(filePath + uuid + suffix);
+                const chunk = await getUuidFile(filestream);
+                ctx.set({
+                    'Content-Type': 'application/vnd.openxmlformats',
+                    'Content-Disposition': 'attachment; filename="' + rptNameURI + suffix + "\"; filename*=utf-8''" + rptNameURI + suffix,
+                    'Content-Length': chunk.length,
+                });
+                ctx.body = chunk;
+            } catch (e) {
+                console.log(e);
+            }
+        }
     }
     return ReportController;
 };

+ 5 - 6
app/public/report/js/rpt_main.js

@@ -498,12 +498,11 @@ let rptControlObj = {
             params.isOneSheet = true;
             params.rpt_names = rpt_names;
             params.rptName = 'All';
-            // CommonAjax.postXsrfEx("/tender/report_api/getMultiReports", params, 60000, true, getCookie('csrfToken'),
-            CommonAjax.postEx("report_api/createExcelFiles", params, WAIT_TIME_EXPORT, true, function(result){
+            CommonAjax.postXsrfEx("/tender/report_api/createExcelFiles", params, 60000, true, getCookie('csrfToken'), function(result){
                     if (result) {
                         let uuIdUrls = [];
-                        for (let uuIdObj of result) {
-                            let uuIdUrl =  "/report_api/getFileByUUID/" + uuIdObj.uuid + "/" + stringUtil.replaceAll(uuIdObj.reportName, "#", "_") + "/xlsx";
+                        for (let uuIdObj of result.data) {
+                            let uuIdUrl =  "/getFileByUUID/" + uuIdObj.uuid + "/" + stringUtil.replaceAll(uuIdObj.reportName, "#", "_") + "/xlsx";
                             uuIdUrls.push(uuIdUrl);
                         }
                         downloadReport(uuIdUrls);
@@ -661,12 +660,12 @@ function downloadReport(urls) {
     //考虑到多个报表下载,一些浏览器(如chrome)不允许一下子下载多个文件,得缓缓处理,统一在这处理
     rptControlObj.currentDownloadUrl = null;
     rptControlObj.currentDownloadIdx = 0;
-    let private_download = function() {
+    const private_download = function() {
         if (rptControlObj.currentDownloadIdx >= 0 && rptControlObj.currentDownloadIdx < urls.length) {
             rptControlObj.currentDownloadUrl = urls[rptControlObj.currentDownloadIdx];
             rptControlObj.currentDownloadIdx++;
             window.location = rptControlObj.currentDownloadUrl;
-            setTimeout(private_download, 2000);
+            if (rptControlObj.currentDownloadIdx < urls.length) setTimeout(private_download, 2000);
         }
     }
     private_download();

+ 130 - 133
app/reports/util/rpt_excel_util.js

@@ -1,21 +1,21 @@
+'use strict';
 /**
  * Created by Tony on 2017/4/1.
  */
-let JV = require('../rpt_component/jpc_value_define');
-let fs = require('fs');
-let JSZip = require("jszip");
-let strUtil = require('../public/stringUtil');
-let jpcCmnHelper = require('../rpt_component/helper/jpc_helper_common');
-let DPI = jpcCmnHelper.getScreenDPI()[0];
-let fsUtil = require('../public/fsUtil');
+const JV = require('../rpt_component/jpc_value_define');
+const fs = require('fs');
+const JSZip = require('jszip');
+const strUtil = require('../public/stringUtil');
+const jpcCmnHelper = require('../rpt_component/helper/jpc_helper_common');
+const DPI = jpcCmnHelper.getScreenDPI()[0];
+const fsUtil = require('../public/fsUtil');
 const dftHeadXml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
 const uuidV1 = require('uuid/v1');
 
 function writeContentTypes(sheets, isSinglePage) {
-    let rst = [];
+    const rst = [];
     rst.push(dftHeadXml + '\r\n');
     rst.push('<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">');
-    //...
     rst.push('<Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>');
     rst.push('<Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>');
     rst.push('<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>');
@@ -34,8 +34,8 @@ function writeContentTypes(sheets, isSinglePage) {
     rst.push('</Types>');
     return rst;
 }
-function writeRootRels(){
-    let rst = [];
+function writeRootRels() {
+    const rst = [];
     rst.push(dftHeadXml + '\r\n');
     rst.push('<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">');
     rst.push('<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>');
@@ -45,7 +45,7 @@ function writeRootRels(){
     return rst;
 }
 function writeApp(sheets, isSinglePage) {
-    let rst = [];
+    const rst = [];
     rst.push(dftHeadXml + '\r\n');
     rst.push('<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">');
     rst.push('<Application>Microsoft Excel</Application>');
@@ -54,7 +54,7 @@ function writeApp(sheets, isSinglePage) {
     rst.push('<HeadingPairs>');
     rst.push('<vt:vector size="2" baseType="variant">');
     rst.push('<vt:variant><vt:lpstr>工作表</vt:lpstr></vt:variant>');
-    if (isSinglePage) rst.push('<vt:variant><vt:i4>1</vt:i4></vt:variant>')
+    if (isSinglePage) rst.push('<vt:variant><vt:i4>1</vt:i4></vt:variant>');
     else rst.push('<vt:variant><vt:i4>' + sheets.length + '</vt:i4></vt:variant>');
     rst.push('</vt:vector>');
     rst.push('</HeadingPairs>');
@@ -79,8 +79,8 @@ function writeApp(sheets, isSinglePage) {
     return rst;
 }
 function writeCore() {
-    let rst = [];
-    let p_fillZero = function(val){
+    const rst = [];
+    const p_fillZero = function(val) {
         let rst = val;
         if (val < 10) {
             rst = '0' + val;
@@ -91,18 +91,17 @@ function writeCore() {
     rst.push('<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">');
     rst.push('<dc:creator>SmartCost</dc:creator>');
     rst.push('<cp:lastModifiedBy>SmartCost</cp:lastModifiedBy>');
-    let dt = new Date();
-    dt.setDate(dt.getDate() - 8/24); //it's GMT time, so please add the server offset time ( -8 hours )
-    let dtStr = dt.getFullYear() + '-' + p_fillZero(dt.getMonth()+1) + '-' + p_fillZero(dt.getDate()) + 'T' +
+    const dt = new Date();
+    dt.setDate(dt.getDate() - 8 / 24); // it's GMT time, so please add the server offset time ( -8 hours )
+    const dtStr = dt.getFullYear() + '-' + p_fillZero(dt.getMonth() + 1) + '-' + p_fillZero(dt.getDate()) + 'T' +
         p_fillZero(dt.getHours()) + ':' + p_fillZero(dt.getMinutes()) + ':' + p_fillZero(dt.getSeconds()) + 'Z';
     rst.push('<dcterms:created xsi:type="dcterms:W3CDTF">' + dtStr + '</dcterms:created>');
     rst.push('<dcterms:modified xsi:type="dcterms:W3CDTF">' + dtStr + '</dcterms:modified>');
-    //rst.push('');
     rst.push('</cp:coreProperties>');
     return rst;
 }
-function writeXlWorkBook(sheets, isSinglePage){
-    let rst = [];
+function writeXlWorkBook(sheets, isSinglePage) {
+    const rst = [];
     rst.push(dftHeadXml + '\r\n');
     rst.push('<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">');
     rst.push('<fileVersion appName="xl" lastEdited="4" lowestEdited="4" rupBuild="4505"/>');
@@ -121,8 +120,9 @@ function writeXlWorkBook(sheets, isSinglePage){
     rst.push('</workbook>');
     return rst;
 }
-function writeXlRels(sheets, isSinglePage){
-    let rst = [], idx = 1;
+function writeXlRels(sheets, isSinglePage) {
+    const rst = [];
+    let idx = 1;
     rst.push(dftHeadXml + '\r\n');
     rst.push('<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">');
     if (isSinglePage) {
@@ -142,51 +142,51 @@ function writeXlRels(sheets, isSinglePage){
     rst.push('</Relationships>');
     return rst;
 }
-function writeTheme(){
-    let rst = fs.readFileSync(__dirname + '/excel_base_files/theme1.xml', 'utf8', 'r');
+function writeTheme() {
+    const rst = fs.readFileSync(__dirname + '/excel_base_files/theme1.xml', 'utf8', 'r');
     return rst;
 }
-function writeStyles(stylesObj){
-    let rst = [];
+function writeStyles(stylesObj) {
+    const rst = [];
     rst.push(dftHeadXml + '\r\n');
     rst.push('<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">');
-    //1. push fonts
+    // 1. push fonts
     rst.push('<fonts count="' + stylesObj.fonts.length + '">');
     for (let i = 0; i < stylesObj.fonts.length; i++) {
-        let font = stylesObj.fonts[i];
+        const font = stylesObj.fonts[i];
         rst.push('<font>');
-        if (strUtil.convertStrToBoolean(font[JV.FONT_PROPS[3]])) {
+        if (strUtil.convertStrToBoolean(font[JV.FONT_PROPS[JV.FONT_PROP_IDX_BOLD]])) {
             rst.push('<b/>');
         }
-        if (strUtil.convertStrToBoolean(font[JV.FONT_PROPS[4]])) {
+        if (strUtil.convertStrToBoolean(font[JV.FONT_PROPS[JV.FONT_PROP_IDX_ITALIC]])) {
             rst.push('<i/>');
         }
-        if (strUtil.convertStrToBoolean(font[JV.FONT_PROPS[5]])) {
+        if (strUtil.convertStrToBoolean(font[JV.FONT_PROPS[JV.FONT_PROP_IDX_UNDERLINE]])) {
             rst.push('<u/>');
         }
         rst.push('<sz val="' + font.size + '"/>');
         rst.push('<color indexed="' + font.colorIdx + '"/>');
-        rst.push('<name val="' + font[JV.FONT_PROPS[0]] + '"/>');
+        rst.push('<name val="' + font[JV.FONT_PROPS[JV.FONT_PROP_IDX_NAME]] + '"/>');
         rst.push('<charset val="' + font.charset + '"/>');
         rst.push('</font>');
     }
     rst.push('</fonts>');
-    //2. push default fills
+    // 2. push default fills
     rst.push('<fills count="2"><fill><patternFill patternType="none" /></fill><fill><patternFill patternType="gray125" /></fill></fills>');
-    //3. push borders
+    // 3. push borders
     rst.push('<borders count="' + stylesObj.borders.length + '">');
-    let private_setBorder = function(border, borderDirection) {
+    const private_setBorder = function(border, borderDirection) {
         if (parseInt(border[borderDirection][JV.PROP_LINE_WEIGHT]) === 0) {
             rst.push('<' + borderDirection.toLowerCase() + '/>');
         } else {
             let bW = 'thin';
             if (parseInt(border[borderDirection][JV.PROP_LINE_WEIGHT]) === 2) bW = 'medium';
             if (parseInt(border[borderDirection][JV.PROP_LINE_WEIGHT]) > 2) bW = 'thick';
-            rst.push('<' + borderDirection.toLowerCase() + ' style="' + bW + '">' + '<color indexed="64"/>' + '</' + borderDirection.toLowerCase() + '>');
+            rst.push('<' + borderDirection.toLowerCase() + ' style="' + bW + '"><color indexed="64"/></' + borderDirection.toLowerCase() + '>');
         }
     };
     for (let i = 0; i < stylesObj.borders.length; i++) {
-        let border = stylesObj.borders[i];
+        const border = stylesObj.borders[i];
         rst.push('<border>');
         private_setBorder(border, JV.PROP_LEFT);
         private_setBorder(border, JV.PROP_RIGHT);
@@ -196,15 +196,15 @@ function writeStyles(stylesObj){
         rst.push('</border>');
     }
     rst.push('</borders>');
-    //4. push cellStyleXfs
+    // 4. push cellStyleXfs
     rst.push('<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"><alignment vertical="center"/></xf></cellStyleXfs>');
-    //5. push cellXfs
+    // 5. push cellXfs
     rst.push('<cellXfs count="' + stylesObj.cellXfs.length + '">');
     for (let i = 0; i < stylesObj.cellXfs.length; i++) {
-        let excelStyle = stylesObj.cellXfs[i];
+        const excelStyle = stylesObj.cellXfs[i];
         rst.push('<xf numFmtId="0" fontId="' + excelStyle.fontId + '" fillId="0" borderId="' + excelStyle.borderId + '" xfId="0">');
-        //pageData[JV.NODE_FONT_COLLECTION] excelStyle.fontId
-        let alignStr = "<alignment";
+        // pageData[JV.NODE_FONT_COLLECTION] excelStyle.fontId
+        let alignStr = '<alignment';
         let textRotation = 0;
         let newHorizontal = excelStyle[JV.CONTROL_PROPS[2]];
         let newVertical = excelStyle[JV.CONTROL_PROPS[3]];
@@ -212,37 +212,38 @@ function writeStyles(stylesObj){
             newVertical = excelStyle[JV.CONTROL_PROPS[5]];
         }
         if (parseInt(excelStyle.fontAngle) !== 0) {
-            let tmpH = newHorizontal, tmpV = newVertical;
+            let tmpH = newHorizontal;
+            let tmpV = newVertical;
             if (excelStyle.fontAngle > 0) {
                 textRotation = 180;
-                if (newHorizontal === "left") {
+                if (newHorizontal === 'left') {
                     tmpV = 'top';
-                } else if (newHorizontal === "right") {
+                } else if (newHorizontal === 'right') {
                     tmpV = 'bottom';
                 } else {
                     tmpV = 'center';
                 }
-                if (newVertical === "top") {
+                if (newVertical === 'top') {
                     tmpH = 'right';
-                } else if (newVertical === "bottom") {
+                } else if (newVertical === 'bottom') {
                     tmpH = 'left';
-                } else if (newVertical === "justify") {
+                } else if (newVertical === 'justify') {
                     tmpH = 'justify';
                 } else {
                     tmpH = 'center';
                 }
             } else {
                 textRotation = 90;
-                if (newHorizontal === "left") {
+                if (newHorizontal === 'left') {
                     tmpV = 'bottom';
-                } else if (newHorizontal === "right") {
+                } else if (newHorizontal === 'right') {
                     tmpV = 'top';
                 } else {
                     tmpV = 'center';
                 }
-                if (newVertical === "top") {
+                if (newVertical === 'top') {
                     tmpH = 'left';
-                } else if (newVertical === "bottom") {
+                } else if (newVertical === 'bottom') {
                     tmpH = 'right';
                 } else {
                     tmpH = 'center';
@@ -266,16 +267,16 @@ function writeStyles(stylesObj){
         rst.push('</xf>');
     }
     rst.push('</cellXfs>');
-    //6. others (xfl style / dxfs / tableStyles)
+    // 6. others (xfl style / dxfs / tableStyles)
     rst.push('<cellStyles count="1"><cellStyle name="常规" xfId="0" builtinId="0"/></cellStyles>');
     rst.push('<dxfs count="0"/>');
     rst.push('<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleLight16"/>');
     rst.push('</styleSheet>');
     return rst;
 }
-function writeSharedString(sharedStrList){
-    let rst = [];
-    let pri_func_write = function(cellVal) {
+function writeSharedString(sharedStrList) {
+    const rst = [];
+    const pri_func_write = function(cellVal) {
         if (cellVal !== null) {
             if ((typeof cellVal === 'string') && cellVal.indexOf(' ') === 0) {
                 rst.push('<si><t xml:space="preserve">' + cellVal + '</t></si>');
@@ -287,13 +288,13 @@ function writeSharedString(sharedStrList){
     if (sharedStrList && sharedStrList.length > 0) {
         rst.push(dftHeadXml + '\r\n');
         rst.push('<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="' + sharedStrList.length + '" uniqueCount="' + sharedStrList.length + '">');
-        let regExp = new RegExp("<", "gm");
+        const regExp = new RegExp('<', 'gm');
         for (let i = 0; i < sharedStrList.length; i++) {
             if (typeof sharedStrList[i] === 'string') {
-                //转换特殊字符,如 < , 则需要转义一下
-                sharedStrList[i] = sharedStrList[i].replace(regExp, "&lt;");
+                // 转换特殊字符,如 < , 则需要转义一下
+                sharedStrList[i] = sharedStrList[i].replace(regExp, '&lt;');
                 if (sharedStrList[i].indexOf('|') >= 0) {
-                    //rst.push('<si><t>' + sharedStrList[i].split('|').join('\r\n') + '</t></si>');
+                    // rst.push('<si><t>' + sharedStrList[i].split('|').join('\r\n') + '</t></si>');
                     // rst.push('<si><t>' + sharedStrList[i].split('|').join('\n') + '</t></si>');
                     pri_func_write(sharedStrList[i].split('|').join('\n'));
                 } else {
@@ -310,25 +311,25 @@ function writeSharedString(sharedStrList){
     }
     return rst;
 }
-function writeSheets(pageData, paperSize, sharedStrList, stylesObj, isSinglePage, custSheetMergeBands){
-    let rst = [];
-    let private_pushDftFont = function(){
-        let font = {};
+function writeSheets(pageData, paperSize, sharedStrList, stylesObj, isSinglePage, custSheetMergeBands) {
+    const rst = [];
+    const private_pushDftFont = function() {
+        const font = {};
         if (!(stylesObj.fonts)) {
             stylesObj.fonts = [];
         }
-        font[JV.FONT_PROPS[0]] = "宋体"; //font name
+        font[JV.FONT_PROPS[JV.FONT_PROP_IDX_NAME]] = '宋体'; // font name
         font.size = 12;
         font.charset = 134;
-        font.colorIdx = "8";
+        font.colorIdx = '8';
         stylesObj.fonts.push(font);
     };
-    let private_buildFirstDftStyle = function () {
+    const private_buildFirstDftStyle = function() {
         stylesObj.cellXfs = [];
         stylesObj.borders = [];
-        let fontId = 0;
-        let borderId = 0;
-        let border = {};
+        const fontId = 0;
+        const borderId = 0;
+        const border = {};
         border[JV.PROP_LEFT] = {};
         border[JV.PROP_LEFT][JV.PROP_LINE_WEIGHT] = 0;
         border[JV.PROP_RIGHT] = {};
@@ -339,8 +340,8 @@ function writeSheets(pageData, paperSize, sharedStrList, stylesObj, isSinglePage
         border[JV.PROP_BOTTOM][JV.PROP_LINE_WEIGHT] = 0;
         stylesObj.borders.push(border);
 
-        let cellControl = pageData[JV.NODE_CONTROL_COLLECTION].Default;
-        let sheetControl = {};
+        const cellControl = pageData[JV.NODE_CONTROL_COLLECTION].Default;
+        const sheetControl = {};
         sheetControl.fontId = fontId;
         sheetControl.borderId = borderId;
         sheetControl.fontAngle = 0;
@@ -348,7 +349,7 @@ function writeSheets(pageData, paperSize, sharedStrList, stylesObj, isSinglePage
             sheetControl[JV.CONTROL_PROPS[i]] = cellControl[JV.CONTROL_PROPS[i]];
         }
         stylesObj.cellXfs.push(sheetControl);
-    }
+    };
     private_pushDftFont();
     private_buildFirstDftStyle();
     if (isSinglePage) {
@@ -364,28 +365,24 @@ function writeSheets(pageData, paperSize, sharedStrList, stylesObj, isSinglePage
     }
     return rst;
 }
-function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, appointedMergeBand){
-    let rst = [], xPos = [], yPos = [], yMultiPos = [], currentMergeBorder = null,
-        headerStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
-    let currentPageMergePos = null; //在 JV.PAGING_OPTION_INFINITY 场合应用
-    let private_pre_analyze_pos = function(){
-        let cell, pos;
-        let self_analyze_sheet_pos = function (theShtData, theXPos, theYPos) {
-            // theShtData.cells.sort(function(cell1, cell2) {
-            //     let rst = 0;
-            //     if (cell1[JV.PROP_AREA][JV.PROP_TOP] > cell2[JV.PROP_AREA][JV.PROP_TOP]) {
-            //         rst = 1;
-            //     } else if (cell1[JV.PROP_AREA][JV.PROP_TOP] < cell2[JV.PROP_AREA][JV.PROP_TOP]) {
-            //         rst = -1;
-            //     } else {
-            //         if (cell1[JV.PROP_AREA][JV.PROP_LEFT] > cell2[JV.PROP_AREA][JV.PROP_LEFT]) {
-            //             rst = 1;
-            //         } else if (cell1[JV.PROP_AREA][JV.PROP_LEFT] < cell2[JV.PROP_AREA][JV.PROP_LEFT]) {
-            //             rst = -1;
-            //         }
-            //     }
-            //     return rst;
-            // });
+function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, appointedMergeBand) {
+    const rst = [];
+    const xPos = [];
+    let yPos = [];
+    const yMultiPos = [];
+    let currentMergeBorder = null;
+    const headerStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    let currentPageMergePos = null; // 在 JV.PAGING_OPTION_INFINITY 场合应用
+    const private_pre_analyze_pos = function() {
+        let cell;
+        let pos;
+        const private_array_sort = function(i1, i2) {
+            let rst = 0;
+            if (i1 > i2) { rst = 1; } else
+            if (i1 < i2) rst = -1;
+            return rst;
+        };
+        const self_analyze_sheet_pos = function(theShtData, theXPos, theYPos) {
             for (let i = 0; i < theShtData.cells.length; i++) {
                 cell = theShtData.cells[i];
                 pos = cell[JV.PROP_AREA][JV.PROP_LEFT];
@@ -400,21 +397,21 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, ap
         };
         xPos.push(0);
         if (sheetData) {
-            //current sheet data
+            // current sheet data
             yPos.push(0);
             self_analyze_sheet_pos(sheetData, xPos, yPos);
             xPos.sort(private_array_sort);
             yPos.sort(private_array_sort);
         } else {
-            //total data in one sheet
-            let marginBottomPos = Math.round( (pageData[JV.NODE_PAGE_INFO][JV.NODE_PAGE_SIZE][1] - parseFloat(pageData[JV.NODE_PAGE_INFO][JV.NODE_MARGINS][JV.PROP_BOTTOM]) / 2.54 ) * DPI);
-            for (let shtItemData of pageData.items) {
-                let tmpPos = [];
+            // total data in one sheet
+            const marginBottomPos = Math.round((pageData[JV.NODE_PAGE_INFO][JV.NODE_PAGE_SIZE][1] - parseFloat(pageData[JV.NODE_PAGE_INFO][JV.NODE_MARGINS][JV.PROP_BOTTOM]) / 2.54) * DPI);
+            for (const shtItemData of pageData.items) {
+                const tmpPos = [];
                 tmpPos.push(0);
                 self_analyze_sheet_pos(shtItemData, xPos, tmpPos);
                 tmpPos.sort(private_array_sort);
                 if (marginBottomPos - tmpPos[tmpPos.length - 1] > 10) {
-                    //此逻辑是为了防止打印跨页(假设有些报表模板高度设置离底部margin还好远,导出excel后预览时会发现跨页现象(即下一页的某几行数据会挪到前一页来预览))
+                    // 此逻辑是为了防止打印跨页(假设有些报表模板高度设置离底部margin还好远,导出excel后预览时会发现跨页现象(即下一页的某几行数据会挪到前一页来预览))
                     tmpPos.push(marginBottomPos - 10);
                 }
                 yMultiPos.push(tmpPos);
@@ -423,29 +420,26 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, ap
             yPos = yMultiPos[0];
         }
     };
-    let private_array_sort = function(i1, i2){
-        let rst = 0;
-        if (i1 > i2) {rst = 1} else
-        if (i1 < i2) rst = -1;
-        return rst;
-    };
-    let private_getCellIdxStr = function(idx){
+    const private_getCellIdxStr = function(idx) {
         let rst = 'A';
         if (idx < 26) {
             rst = headerStr[idx];
-        } else if (idx < 26*26+26) {
-            let ti = Math.floor(idx / 26), tj = idx % 26;
+        } else if (idx < 26 * 26 + 26) {
+            const ti = Math.floor(idx / 26);
+            const tj = idx % 26;
             rst = headerStr[ti - 1] + headerStr[tj];
-        } else if (idx < 26*26*26+26) {
-            let ti = Math.floor(idx / (26*26)), tj = Math.floor((idx - ti * 26*26) / 26), tk = idx % 26;
-            rst = headerStr[ti - 1] + headerStr[tj-1] + headerStr[tk];
+        } else if (idx < 26 * 26 * 26 + 26) {
+            const ti = Math.floor(idx / (26 * 26));
+            const tj = Math.floor((idx - ti * 26 * 26) / 26);
+            const tk = idx % 26;
+            rst = headerStr[ti - 1] + headerStr[tj - 1] + headerStr[tk];
         }
         return rst;
     };
-    let private_getSharedStrIdx = function(val) {
+    const private_getSharedStrIdx = function(val) {
         let strVal = val;
         if (val === null || val === undefined || (typeof val === 'number' && isNaN(val))) {
-            strVal = "";
+            strVal = '';
         }
         let rst = sharedStrList.indexOf(strVal);
         if (rst < 0) {
@@ -454,25 +448,25 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, ap
         }
         return rst;
     };
-    let private_getFontId = function(cell) {
-        let rst = 0, hasFont = false;
+    const private_getFontId = function(cell) {
+        let rst = 0;
+        let hasFont = false;
         if (!(stylesObj.fonts)) {
             stylesObj.fonts = [];
-            //for (let i = 0; i < sheetData.font_collection)
+            // for (let i = 0; i < sheetData.font_collection)
         }
         let sheetFont = null;
-        if (typeof cell[JV.PROP_FONT] === "string") {
+        if (typeof cell[JV.PROP_FONT] === 'string') {
             sheetFont = pageData[JV.NODE_FONT_COLLECTION][cell[JV.PROP_FONT]];
         } else {
             sheetFont = cell[JV.PROP_FONT];
         }
         for (let i = 0; i < stylesObj.fonts.length; i++) {
-            let font = stylesObj.fonts[i];
+            const font = stylesObj.fonts[i];
             if (sheetFont) {
-                // if (font[JV.FONT_PROPS[0]] === sheetFont[JV.FONT_PROPS[0]] && font.size === Math.round(sheetFont[JV.FONT_PROPS[1]] * 3 / 4)
-                if (font[JV.FONT_PROPS[0]] === sheetFont[JV.FONT_PROPS[0]] && font.size === Math.floor(sheetFont[JV.FONT_PROPS[1]] * 3 / 4)
-                    && font[JV.FONT_PROPS[3]] === sheetFont[JV.FONT_PROPS[3]] && font[JV.FONT_PROPS[4]] === sheetFont[JV.FONT_PROPS[4]]
-                    && font[JV.FONT_PROPS[5]] === sheetFont[JV.FONT_PROPS[5]] ) {
+                if (font[JV.FONT_PROPS[JV.FONT_PROP_IDX_NAME]] === sheetFont[JV.FONT_PROPS[JV.FONT_PROP_IDX_NAME]] && font.size === Math.floor(sheetFont[JV.FONT_PROPS[1]] * 3 / 4)
+                    && font[JV.FONT_PROPS[JV.FONT_PROP_IDX_BOLD]] === sheetFont[JV.FONT_PROPS[JV.FONT_PROP_IDX_BOLD]] && font[JV.FONT_PROPS[JV.FONT_PROP_IDX_ITALIC]] === sheetFont[JV.FONT_PROPS[JV.FONT_PROP_IDX_ITALIC]]
+                    && font[JV.FONT_PROPS[JV.FONT_PROP_IDX_UNDERLINE]] === sheetFont[JV.FONT_PROPS[JV.FONT_PROP_IDX_UNDERLINE]]) {
                     hasFont = true;
                     rst = i;
                     break;
@@ -482,15 +476,15 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, ap
             }
         }
         if (!hasFont) {
-            let font = {};
-            font[JV.FONT_PROPS[0]] = sheetFont[JV.FONT_PROPS[0]]; //font name
+            const font = {};
+            font[JV.FONT_PROPS[JV.FONT_PROP_IDX_NAME]] = sheetFont[JV.FONT_PROPS[JV.FONT_PROP_IDX_NAME]]; // font name
             // font.size = Math.round(sheetFont[JV.FONT_PROPS[1]] * 3 / 4);
             font.size = Math.floor(sheetFont[JV.FONT_PROPS[1]] * 3 / 4);
             font.charset = 134;
-            font.colorIdx = "8";
-            font[JV.FONT_PROPS[3]] = sheetFont[JV.FONT_PROPS[3]]; //font bold
-            font[JV.FONT_PROPS[4]] = sheetFont[JV.FONT_PROPS[4]]; //font italic
-            font[JV.FONT_PROPS[5]] = sheetFont[JV.FONT_PROPS[5]]; //font underline
+            font.colorIdx = '8';
+            font[JV.FONT_PROPS[JV.FONT_PROP_IDX_BOLD]] = sheetFont[JV.FONT_PROPS[JV.FONT_PROP_IDX_BOLD]]; // font bold
+            font[JV.FONT_PROPS[JV.FONT_PROP_IDX_ITALIC]] = sheetFont[JV.FONT_PROPS[JV.FONT_PROP_IDX_ITALIC]]; // font italic
+            font[JV.FONT_PROPS[JV.FONT_PROP_IDX_UNDERLINE]] = sheetFont[JV.FONT_PROPS[JV.FONT_PROP_IDX_UNDERLINE]]; // font underline
             stylesObj.fonts.push(font);
             rst = stylesObj.fonts.length - 1;
         }
@@ -928,13 +922,16 @@ module.exports = {
             // let newName = '' + (new Date()).valueOf();
             let newName = uuidV1();
 
+            // console.log('current path: ' + __dirname);
+            // const filePath = this.app.baseDir + '/app/public/download/';
+
             zip.generateNodeStream({type:'nodebuffer',streamFiles:true})
-                .pipe(fs.createWriteStream(__dirname.slice(0, __dirname.length - 21) + '/tmp/' + newName + '.xlsx'))
+                .pipe(fs.createWriteStream(__dirname.slice(0, __dirname.length - 13) + '/public/download/' + newName + '.xlsx'))
                 .on('finish', function () {
                         // JSZip generates a readable stream with a "end" event,
                         // but is piped here in a writable stream which emits a "finish" event.
                         console.log(newName + ".xlsx was written.");
-                        if (callback) callback(newName);
+                        if (callback) callback(null, newName);
                     }
                 );
         } else {

+ 3 - 0
app/router.js

@@ -174,6 +174,9 @@ module.exports = app => {
     app.get('/printReport/:size', sessionAuth, 'reportController.showPrintPage');
     app.post('/tender/report_api/getReport', sessionAuth, 'reportController.getReport');
     app.post('/tender/report_api/getMultiReports', sessionAuth, 'reportController.getMultiReportsEx');
+    app.post('/tender/report_api/createExcelFiles', sessionAuth, 'reportController.createExcelFilesEx');
+    app.get('/getFileByUUID/:uuid/:rptName/:suffix', sessionAuth, 'reportController.getFileByUUID');
+    // rptRouter.get('/getFileByUUID/:uuid/:rptName/:suffix', reportController.getFileByUUID);
     app.post('/tender/report_api/createSignatureRole', sessionAuth, 'signatureController.createSignatureRole');
     app.post('/tender/report_api/updateRoleRelationship', sessionAuth, 'signatureController.updateRoleRel');
     // 计量附件

+ 0 - 1
app/view/report/index.ejs

@@ -188,7 +188,6 @@
     CUST_CFG = JSON.parse(CUST_CFG[0].cfg_content);
     const PROJECT_ID = <%- project_id %>;
     const TENDER_ID = <%- tender_id %>;
-    const TENDER_INFO = <%- tenderInfo %>;
     const STAGE_ID = <%- stg_id %>;
     const STAGE_ORDER = <%- stg_order %>;
     const STAGE_TIMES = <%- stg_times %>;

+ 129 - 129
config/web.js

@@ -32,237 +32,237 @@
  * @version
  */
 const JsFiles = {
-    webPath: "/public/js/web/",
+    webPath: '/public/js/web/',
     commonFiles: [
-        "/public/js/jquery/jquery-3.2.1.min.js",
-        "/public/js/jquery/jquery-ui.js",
-        "/public/js/jquery/jquery.validate.js",
-        "/public/js/messages_zh.js",
-        "/public/js/popper/popper.min.js",
-        "/public/js/bootstrap/bootstrap.min.js",
-        "/public/js/vue/vue.js",
-        "/public/js/component/input.js",
-        "/public/js/cookies.js",
-        "/public/js/jquery-contextmenu/jquery.ui.position.min.js",
-        "/public/js/jquery-contextmenu/jquery.contextMenu.min.js",
-        "/public/js/lodash.js",
-        "/public/js/lz-string/lz-string.js",
-        "/public/js/number-precision.js",
-        "/public/js/global.js",
+        '/public/js/jquery/jquery-3.2.1.min.js',
+        '/public/js/jquery/jquery-ui.js',
+        '/public/js/jquery/jquery.validate.js',
+        '/public/js/messages_zh.js',
+        '/public/js/popper/popper.min.js',
+        '/public/js/bootstrap/bootstrap.min.js',
+        '/public/js/vue/vue.js',
+        '/public/js/component/input.js',
+        '/public/js/cookies.js',
+        '/public/js/jquery-contextmenu/jquery.ui.position.min.js',
+        '/public/js/jquery-contextmenu/jquery.contextMenu.min.js',
+        '/public/js/lodash.js',
+        '/public/js/lz-string/lz-string.js',
+        '/public/js/number-precision.js',
+        '/public/js/global.js',
     ],
     controller: {
         tender: {
             list: {
                 files: [
-                    "/public/js/ztree/jquery.ztree.core.js",
-                    "/public/js/ztree/jquery.ztree.exedit.js",
+                    '/public/js/ztree/jquery.ztree.core.js',
+                    '/public/js/ztree/jquery.ztree.exedit.js',
                 ],
                 mergeFiles: [
-                    "/public/js/tender_list.js"
+                    '/public/js/tender_list.js',
                 ],
                 mergeFile: 'tender_list',
             },
             progress: {
                 files: [
-                    "/public/js/ztree/jquery.ztree.core.js",
-                    "/public/js/ztree/jquery.ztree.exedit.js",
+                    '/public/js/ztree/jquery.ztree.core.js',
+                    '/public/js/ztree/jquery.ztree.exedit.js',
                 ],
-                mergeFiles: ["/public/js/tender_list_progress.js"],
+                mergeFiles: ['/public/js/tender_list_progress.js'],
                 mergeFile: 'tender_list_progress',
             },
             manage: {
                 files: [
-                    "/public/js/ztree/jquery.ztree.core.js",
-                    "/public/js/ztree/jquery.ztree.exedit.js",
-                    "/public/js/moment/moment.min.js",
+                    '/public/js/ztree/jquery.ztree.core.js',
+                    '/public/js/ztree/jquery.ztree.exedit.js',
+                    '/public/js/moment/moment.min.js',
                 ],
-                mergeFiles: ["/public/js/tender_list_manage.js"],
+                mergeFiles: ['/public/js/tender_list_manage.js'],
                 mergeFile: 'tender_list_manage',
             },
             info: {
                 files: [
-                    "/public/js/echarts/echarts.min.js",
-                    "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
+                    '/public/js/echarts/echarts.min.js',
+                    '/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js',
                 ],
                 mergeFiles: [
-                    "/public/js/spreadjs_rela/spreadjs_zh.js",
-                    "/public/js/change_calculation.js",
-                    "/public/js/tender.js",
+                    '/public/js/spreadjs_rela/spreadjs_zh.js',
+                    '/public/js/change_calculation.js',
+                    '/public/js/tender.js',
                 ],
                 mergeFile: 'tender',
-            }
+            },
         },
         ledger: {
             explode: {
                 files: [
-                    "/public/js/js-xlsx/xlsx.full.min.js",
-                    "/public/js/js-xlsx/xlsx.utils.js",
-                    "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
-                    "/public/js/decimal.min.js",
+                    '/public/js/js-xlsx/xlsx.full.min.js',
+                    '/public/js/js-xlsx/xlsx.utils.js',
+                    '/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js',
+                    '/public/js/decimal.min.js',
                 ],
                 mergeFiles: [
-                    "/public/js/sub_menu.js",
-                    "/public/js/div_resizer.js",
-                    "/public/js/spreadjs_rela/spreadjs_zh.js",
-                    "/public/js/ledger_search.js",
-                    "/public/js/zh_calc.js",
-                    "/public/js/path_tree.js",
-                    "/public/js/ledger_tree_col.js",
-                    "/public/js/ledger.js",
+                    '/public/js/sub_menu.js',
+                    '/public/js/div_resizer.js',
+                    '/public/js/spreadjs_rela/spreadjs_zh.js',
+                    '/public/js/ledger_search.js',
+                    '/public/js/zh_calc.js',
+                    '/public/js/path_tree.js',
+                    '/public/js/ledger_tree_col.js',
+                    '/public/js/ledger.js',
                 ],
                 mergeFile: 'explode',
             },
             audit: {
                 files: [
-                    "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
-                    "/public/js/decimal.min.js",
+                    '/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js',
+                    '/public/js/decimal.min.js',
                 ],
                 mergeFiles: [
-                    "/public/js/sub_menu.js",
-                    "/public/js/div_resizer.js",
-                    "/public/js/spreadjs_rela/spreadjs_zh.js",
-                    "/public/js/ledger_search.js",
-                    "/public/js/zh_calc.js",
-                    "/public/js/path_tree.js",
-                    "/public/js/ledger_audit.js",
+                    '/public/js/sub_menu.js',
+                    '/public/js/div_resizer.js',
+                    '/public/js/spreadjs_rela/spreadjs_zh.js',
+                    '/public/js/ledger_search.js',
+                    '/public/js/zh_calc.js',
+                    '/public/js/path_tree.js',
+                    '/public/js/ledger_audit.js',
                 ],
                 mergeFile: 'ledger_audit',
             },
             revise: {
                 files: [
-                    "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
-                    "/public/js/decimal.min.js",
-                    "/public/js/toastr.min.js",
+                    '/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js',
+                    '/public/js/decimal.min.js',
+                    '/public/js/toastr.min.js',
                 ],
                 mergeFiles: [
-                    "/public/js/sub_menu.js",
-                    "/public/js/div_resizer.js",
-                    "/public/js/spreadjs_rela/spreadjs_zh.js",
-                    "/public/js/ledger_search.js",
-                    "/public/js/zh_calc.js",
-                    "/public/js/path_tree.js",
-                    "/public/js/revise.js",
+                    '/public/js/sub_menu.js',
+                    '/public/js/div_resizer.js',
+                    '/public/js/spreadjs_rela/spreadjs_zh.js',
+                    '/public/js/ledger_search.js',
+                    '/public/js/zh_calc.js',
+                    '/public/js/path_tree.js',
+                    '/public/js/revise.js',
                 ],
                 mergeFile: 'revise',
-            }
+            },
         },
         stage: {
             // 本期计量台账
             index: {
                 files: [
-                    "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
-                    "/public/js/decimal.min.js",
-                    "/public/js/toastr.min.js",
+                    '/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js',
+                    '/public/js/decimal.min.js',
+                    '/public/js/toastr.min.js',
                 ],
                 mergeFiles: [
-                    "/public/js/sub_menu.js",
-                    "/public/js/div_resizer.js",
-                    "/public/js/spreadjs_rela/spreadjs_zh.js",
-                    "/public/js/zh_calc.js",
-                    "/public/js/path_tree.js",
-                    "/public/js/stage.js",
-                    "/public/js/stage_audit.js",
+                    '/public/js/sub_menu.js',
+                    '/public/js/div_resizer.js',
+                    '/public/js/spreadjs_rela/spreadjs_zh.js',
+                    '/public/js/zh_calc.js',
+                    '/public/js/path_tree.js',
+                    '/public/js/stage.js',
+                    '/public/js/stage_audit.js',
                 ],
                 mergeFile: 'stage',
             },
             detail: {
                 files: [
-                    "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
-                    "/public/js/decimal.min.js",
-                    "/public/js/html2canvas/html2canvas.min.js",
-                    "/public/js/html2canvas/canvas2image.js",
+                    '/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js',
+                    '/public/js/decimal.min.js',
+                    '/public/js/html2canvas/html2canvas.min.js',
+                    '/public/js/html2canvas/canvas2image.js',
                 ],
                 mergeFiles: [
-                    "/public/js/sub_menu.js",
-                    "/public/js/spreadjs_rela/spreadjs_zh.js",
-                    "/public/js/zh_calc.js",
-                    "/public/js/path_tree.js",
-                    "/public/js/stage_im.js",
-                    "/public/js/stage_detail.js",
-                    "/public/js/stage_audit.js",
+                    '/public/js/sub_menu.js',
+                    '/public/js/spreadjs_rela/spreadjs_zh.js',
+                    '/public/js/zh_calc.js',
+                    '/public/js/path_tree.js',
+                    '/public/js/stage_im.js',
+                    '/public/js/stage_detail.js',
+                    '/public/js/stage_audit.js',
                 ],
                 mergeFile: 'stage_detail',
             },
             pay: {
                 files: [
-                    "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
+                    '/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js',
                 ],
                 mergeFiles: [
-                    "/public/js/sub_menu.js",
-                    "/public/js/spreadjs_rela/spreadjs_zh.js",
-                    "/public/js/stage_pay.js",
-                    "/public/js/stage_audit.js",
+                    '/public/js/sub_menu.js',
+                    '/public/js/spreadjs_rela/spreadjs_zh.js',
+                    '/public/js/stage_pay.js',
+                    '/public/js/stage_audit.js',
                 ],
                 mergeFile: 'stage_pay',
             },
             change: {
                 files: [
-                    "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
-                    "/public/js/decimal.min.js",
+                    '/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js',
+                    '/public/js/decimal.min.js',
                 ],
                 mergeFiles: [
-                    "/public/js/sub_menu.js",
-                    "/public/js/div_resizer.js",
-                    "/public/js/spreadjs_rela/spreadjs_zh.js",
-                    "/public/js/zh_calc.js",
-                    "/public/js/path_tree.js",
-                    "/public/js/stage_change.js",
-                    "/public/js/stage_audit.js",
+                    '/public/js/sub_menu.js',
+                    '/public/js/div_resizer.js',
+                    '/public/js/spreadjs_rela/spreadjs_zh.js',
+                    '/public/js/zh_calc.js',
+                    '/public/js/path_tree.js',
+                    '/public/js/stage_change.js',
+                    '/public/js/stage_audit.js',
                 ],
                 mergeFile: 'stage_change',
             },
             gather: {
                 files: [
-                    "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
-                    "/public/js/decimal.min.js",
+                    '/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js',
+                    '/public/js/decimal.min.js',
                 ],
                 mergeFiles: [
-                    "/public/js/sub_menu.js",
-                    "/public/js/div_resizer.js",
-                    "/public/js/spreadjs_rela/spreadjs_zh.js",
-                    "/public/js/zh_calc.js",
-                    "/public/js/path_tree.js",
-                    "/public/js/gcl_gather.js",
-                    "/public/js/stage_gather.js",
-                    "/public/js/stage_audit.js",
+                    '/public/js/sub_menu.js',
+                    '/public/js/div_resizer.js',
+                    '/public/js/spreadjs_rela/spreadjs_zh.js',
+                    '/public/js/zh_calc.js',
+                    '/public/js/path_tree.js',
+                    '/public/js/gcl_gather.js',
+                    '/public/js/stage_gather.js',
+                    '/public/js/stage_audit.js',
                 ],
                 mergeFile: 'stage_gather',
             },
             compare: {
                 files: [
-                    "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
-                    "/public/js/decimal.min.js",
+                    '/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js',
+                    '/public/js/decimal.min.js',
                 ],
                 mergeFiles: [
-                    "/public/js/sub_menu.js",
-                    "/public/js/div_resizer.js",
-                    "/public/js/spreadjs_rela/spreadjs_zh.js",
-                    "/public/js/zh_calc.js",
-                    "/public/js/path_tree.js",
-                    "/public/js/stage_compare.js",
-                    "/public/js/stage_audit.js",
+                    '/public/js/sub_menu.js',
+                    '/public/js/div_resizer.js',
+                    '/public/js/spreadjs_rela/spreadjs_zh.js',
+                    '/public/js/zh_calc.js',
+                    '/public/js/path_tree.js',
+                    '/public/js/stage_compare.js',
+                    '/public/js/stage_audit.js',
                 ],
                 mergeFile: 'stage_compare',
-            }
+            },
         },
         measure: {
             compare: {
                 files: [
-                    "/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js",
-                    "/public/js/decimal.min.js",
+                    '/public/js/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js',
+                    '/public/js/decimal.min.js',
                 ],
                 mergeFiles: [
-                    "/public/js/sub_menu.js",
-                    "/public/js/div_resizer.js",
-                    "/public/js/spreadjs_rela/spreadjs_zh.js",
-                    "/public/js/zh_calc.js",
-                    "/public/js/path_tree.js",
-                    "/public/js/measure_compare.js"
+                    '/public/js/sub_menu.js',
+                    '/public/js/div_resizer.js',
+                    '/public/js/spreadjs_rela/spreadjs_zh.js',
+                    '/public/js/zh_calc.js',
+                    '/public/js/path_tree.js',
+                    '/public/js/measure_compare.js',
                 ],
                 mergeFile: 'measure_compare',
-            }
+            },
         },
-    }
+    },
 
 };
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2843 - 2780
package-lock.json


+ 1 - 0
package.json

@@ -19,6 +19,7 @@
     "egg-view-ejs": "^1.1.0",
     "gt3-sdk": "^2.0.0",
     "gulp": "^4.0.0",
+    "jszip": "^3.1.3",
     "js-xlsx": "^0.8.22",
     "koa-is-json": "^1.0.0",
     "lodash": "^4.17.11",