TonyKang 5 vuotta sitten
vanhempi
commit
6b760cb943
2 muutettua tiedostoa jossa 549 lisäystä ja 2 poistoa
  1. 545 0
      app/const/report_defined_properties.js
  2. 4 2
      app/controller/report_controller.js

+ 545 - 0
app/const/report_defined_properties.js

@@ -0,0 +1,545 @@
+/**
+ * Created by Tony on 2019/12/26.
+ */
+
+module.exports = {
+    "ctrls": [{
+        "ID": "Default",
+        "Wrap": "T",
+        "Shrink": "F",
+        "Horizon": "left",
+        "ShowZero": "T",
+        "Vertical": "bottom",
+        "CfgDispName": "默认",
+        "CloseOutput": "F",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "Title",
+        "Wrap": "T",
+        "Shrink": "F",
+        "Horizon": "center",
+        "ShowZero": "T",
+        "Vertical": "center",
+        "CfgDispName": "标题",
+        "CloseOutput": "F",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "Header",
+        "Wrap": "F",
+        "Shrink": "F",
+        "Horizon": "left",
+        "ShowZero": "T",
+        "Vertical": "center",
+        "CfgDispName": "表头",
+        "CloseOutput": "F",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "Header_Right",
+        "Wrap": "F",
+        "Shrink": "F",
+        "Horizon": "right",
+        "ShowZero": "T",
+        "Vertical": "center",
+        "CfgDispName": "表头_右",
+        "CloseOutput": "F",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "Footer",
+        "Wrap": "F",
+        "Shrink": "F",
+        "Horizon": "left",
+        "ShowZero": "T",
+        "Vertical": "center",
+        "CfgDispName": "表尾",
+        "CloseOutput": "F",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "Footer_Right",
+        "Wrap": "F",
+        "Shrink": "F",
+        "Horizon": "right",
+        "ShowZero": "T",
+        "Vertical": "center",
+        "CfgDispName": "表尾_右",
+        "CloseOutput": "F",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "Column",
+        "Wrap": "T",
+        "Shrink": "F",
+        "Horizon": "center",
+        "ShowZero": "F",
+        "Vertical": "center",
+        "CfgDispName": "表栏",
+        "CloseOutput": "F",
+        "ShrinkFirst": "F",
+        "FillAfterWrap": "T"
+    }, {
+        "ID": "Column_Left",
+        "Wrap": "T",
+        "Shrink": "F",
+        "Horizon": "left",
+        "ShowZero": "F",
+        "Vertical": "center",
+        "CfgDispName": "表栏_左",
+        "CloseOutput": "F",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "Column_Right",
+        "Wrap": "T",
+        "Shrink": "F",
+        "Horizon": "right",
+        "ShowZero": "F",
+        "Vertical": "center",
+        "CfgDispName": "表栏_右",
+        "CloseOutput": "F",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "Content_Left",
+        "Wrap": "F",
+        "Shrink": "T",
+        "Horizon": "left",
+        "ShowZero": "F",
+        "Vertical": "bottom",
+        "CfgDispName": "正文内容",
+        "CloseOutput": "T",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "Content_Right",
+        "Wrap": "F",
+        "Shrink": "T",
+        "Horizon": "right",
+        "ShowZero": "F",
+        "Vertical": "bottom",
+        "CfgDispName": "正文内容_右",
+        "CloseOutput": "T",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "Content_Center",
+        "Wrap": "F",
+        "Shrink": "T",
+        "Horizon": "center",
+        "ShowZero": "F",
+        "Vertical": "bottom",
+        "CfgDispName": "正文内容_中",
+        "CloseOutput": "T",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "NewContent_Left",
+        "Wrap": "F",
+        "Shrink": "T",
+        "Horizon": "left",
+        "ShowZero": "F",
+        "Vertical": "center",
+        "CfgDispName": "正文内容(新)",
+        "CloseOutput": "T",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "NewContent_Right",
+        "Wrap": "F",
+        "Shrink": "T",
+        "Horizon": "right",
+        "ShowZero": "F",
+        "Vertical": "center",
+        "CfgDispName": "正文内容(新)_右",
+        "CloseOutput": "T",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "NewContent_Center",
+        "Wrap": "F",
+        "Shrink": "T",
+        "Horizon": "center",
+        "ShowZero": "F",
+        "Vertical": "center",
+        "CfgDispName": "正文内容(新)_中",
+        "CloseOutput": "T",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "Currency",
+        "Wrap": "F",
+        "Shrink": "T",
+        "Horizon": "right",
+        "ShowZero": "F",
+        "Vertical": "center",
+        "CfgDispName": "金额型",
+        "CloseOutput": "F",
+        "ShrinkFirst": "T"
+    }, {
+        "ID": "Left_Top",
+        "Wrap": "T",
+        "Shrink": "F",
+        "Horizon": "left",
+        "ShowZero": "T",
+        "Vertical": "top",
+        "CfgDispName": "上靠_左",
+        "CloseOutput": "T",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "Center_Top",
+        "Wrap": "T",
+        "Shrink": "F",
+        "Horizon": "center",
+        "ShowZero": "T",
+        "Vertical": "top",
+        "CfgDispName": "上靠_中",
+        "CloseOutput": "T",
+        "ShrinkFirst": "F"
+    }, {
+        "ID": "Right_Top",
+        "Wrap": "T",
+        "Shrink": "F",
+        "Horizon": "right",
+        "ShowZero": "T",
+        "Vertical": "top",
+        "CfgDispName": "上靠_右",
+        "CloseOutput": "T",
+        "ShrinkFirst": "F"
+    }
+    ],
+    "fonts": [{
+        "ID": "ReportTitle_Main",
+        "Name": "宋体",
+        "FontBold": "T",
+        "FontAngle": "0",
+        "FontColor": "BLACK",
+        "FontHeight": "32",
+        "FontItalic": "F",
+        "CfgDispName": "主标题",
+        "FontStrikeOut": "F",
+        "FontUnderline": "F"
+    }, {
+        "ID": "ReportTitle_Vice_1",
+        "Name": "宋体",
+        "FontBold": "T",
+        "FontAngle": "0",
+        "FontColor": "BLACK",
+        "FontHeight": "22",
+        "FontItalic": "F",
+        "CfgDispName": "副标题",
+        "FontStrikeOut": "F",
+        "FontUnderline": "F"
+    }, {
+        "ID": "ReportTitle_Vice_2",
+        "Name": "宋体",
+        "FontBold": "T",
+        "FontAngle": "0",
+        "FontColor": "BLACK",
+        "FontHeight": "18",
+        "FontItalic": "F",
+        "CfgDispName": "副标题2",
+        "FontStrikeOut": "F",
+        "FontUnderline": "F"
+    }, {
+        "ID": "HeaderColumn",
+        "Name": "宋体",
+        "FontBold": "F",
+        "FontAngle": "0",
+        "FontColor": "BLACK",
+        "FontHeight": "12",
+        "FontItalic": "F",
+        "CfgDispName": "栏头",
+        "FontStrikeOut": "F",
+        "FontUnderline": "F"
+    }, {
+        "ID": "Header",
+        "Name": "宋体",
+        "FontBold": "F",
+        "FontAngle": "0",
+        "FontColor": "BLACK",
+        "FontHeight": "12",
+        "FontItalic": "F",
+        "CfgDispName": "表头",
+        "FontStrikeOut": "F",
+        "FontUnderline": "F"
+    }, {
+        "ID": "FooterColumn",
+        "Name": "宋体",
+        "FontBold": "F",
+        "FontAngle": "0",
+        "FontColor": "BLACK",
+        "FontHeight": "12",
+        "FontItalic": "F",
+        "CfgDispName": "栏尾",
+        "FontStrikeOut": "F",
+        "FontUnderline": "F"
+    }, {
+        "ID": "Footer",
+        "Name": "宋体",
+        "FontBold": "F",
+        "FontAngle": "0",
+        "FontColor": "BLACK",
+        "FontHeight": "12",
+        "FontItalic": "F",
+        "CfgDispName": "表尾",
+        "FontStrikeOut": "F",
+        "FontUnderline": "F"
+    }, {
+        "ID": "GrandTotal",
+        "Name": "宋体",
+        "FontBold": "F",
+        "FontAngle": "0",
+        "FontColor": "BLACK",
+        "FontHeight": "12",
+        "FontItalic": "F",
+        "CfgDispName": "总合计",
+        "FontStrikeOut": "F",
+        "FontUnderline": "F"
+    }, {
+        "ID": "SectionTotal",
+        "Name": "宋体",
+        "FontBold": "F",
+        "FontAngle": "0",
+        "FontColor": "BLACK",
+        "FontHeight": "12",
+        "FontItalic": "F",
+        "CfgDispName": "章合计",
+        "FontStrikeOut": "F",
+        "FontUnderline": "F"
+    }, {
+        "ID": "Content",
+        "Name": "宋体",
+        "FontBold": "F",
+        "FontAngle": "0",
+        "FontColor": "BLACK",
+        "FontHeight": "12",
+        "FontItalic": "F",
+        "CfgDispName": "正文内容",
+        "FontStrikeOut": "F",
+        "FontUnderline": "F"
+    }, {
+        "ID": "Content_Narrow",
+        "Name": "Arial Narrow",
+        "FontBold": "F",
+        "FontAngle": "0",
+        "FontColor": "BLACK",
+        "FontHeight": "12",
+        "FontItalic": "F",
+        "CfgDispName": "正文内容-窄体",
+        "FontStrikeOut": "F",
+        "FontUnderline": "F"
+    }, {
+        "ID": "Header_V1",
+        "Name": "宋体",
+        "FontBold": "F",
+        "FontAngle": "90",
+        "FontColor": "BLACK",
+        "FontHeight": "12",
+        "FontItalic": "F",
+        "FontStrikeOut": "F",
+        "FontUnderline": "F"
+    }, {
+        "ID": "Header_V2",
+        "Name": "宋体",
+        "FontBold": "F",
+        "FontAngle": "-90",
+        "FontColor": "BLACK",
+        "FontHeight": "12",
+        "FontItalic": "F",
+        "FontStrikeOut": "F",
+        "FontUnderline": "F"
+    }
+    ],
+    "styles": [{
+        "ID": "Default_None",
+        "CfgDispName": "空白",
+        "border_style": [{
+            "Color": "BLACK",
+            "Position": "Left",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Right",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Top",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Bottom",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }
+        ]
+    }, {
+        "ID": "Default",
+        "CfgDispName": "默认",
+        "border_style": [{
+            "Color": "BLACK",
+            "Position": "Left",
+            "DashStyle": "SOLID",
+            "LineWeight": "1"
+        }, {
+            "Color": "BLACK",
+            "Position": "Right",
+            "DashStyle": "SOLID",
+            "LineWeight": "1"
+        }, {
+            "Color": "BLACK",
+            "Position": "Top",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Bottom",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }
+        ]
+    }, {
+        "ID": "Default_Normal",
+        "CfgDispName": "正常",
+        "border_style": [{
+            "Color": "BLACK",
+            "Position": "Left",
+            "DashStyle": "SOLID",
+            "LineWeight": "1"
+        }, {
+            "Color": "BLACK",
+            "Position": "Right",
+            "DashStyle": "SOLID",
+            "LineWeight": "1"
+        }, {
+            "Color": "BLACK",
+            "Position": "Top",
+            "DashStyle": "SOLID",
+            "LineWeight": "1"
+        }, {
+            "Color": "BLACK",
+            "Position": "Bottom",
+            "DashStyle": "SOLID",
+            "LineWeight": "1"
+        }
+        ]
+    }, {
+        "ID": "Label_Underline",
+        "CfgDispName": "字符底线",
+        "border_style": [{
+            "Color": "BLACK",
+            "Position": "Left",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Right",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Top",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Bottom",
+            "DashStyle": "SOLID",
+            "LineWeight": "1"
+        }
+        ]
+    }, {
+        "ID": "Label_Left",
+        "CfgDispName": "左边线",
+        "border_style": [{
+            "Color": "BLACK",
+            "Position": "Left",
+            "DashStyle": "SOLID",
+            "LineWeight": "1"
+        }, {
+            "Color": "BLACK",
+            "Position": "Right",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Top",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Bottom",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }
+        ]
+    }, {
+        "ID": "Label_Right",
+        "CfgDispName": "右边线",
+        "border_style": [{
+            "Color": "BLACK",
+            "Position": "Left",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Right",
+            "DashStyle": "SOLID",
+            "LineWeight": "1"
+        }, {
+            "Color": "BLACK",
+            "Position": "Top",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Bottom",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }
+        ]
+    }, {
+        "ID": "Label_Top",
+        "CfgDispName": "上边线",
+        "border_style": [{
+            "Color": "BLACK",
+            "Position": "Left",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Right",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Top",
+            "DashStyle": "SOLID",
+            "LineWeight": "1"
+        }, {
+            "Color": "BLACK",
+            "Position": "Bottom",
+            "DashStyle": "SOLID",
+            "LineWeight": "0"
+        }
+        ]
+    }, {
+        "ID": "BORDER_ALL_AROUND",
+        "CfgDispName": "报表边框",
+        "border_style": [{
+            "Color": "BLACK",
+            "Position": "Left",
+            "DashStyle": "SOLID",
+            "LineWeight": "2.0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Right",
+            "DashStyle": "SOLID",
+            "LineWeight": "2.0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Top",
+            "DashStyle": "SOLID",
+            "LineWeight": "2.0"
+        }, {
+            "Color": "BLACK",
+            "Position": "Bottom",
+            "DashStyle": "SOLID",
+            "LineWeight": "2.0"
+        }
+        ]
+    }
+    ]
+};
+

+ 4 - 2
app/controller/report_controller.js

@@ -14,6 +14,7 @@ const rptDataExtractor = require('../reports/util/rpt_calculation_data_util');
 const fsUtil = require('../public/js/fsUtil');
 const fs = require('fs');
 const rptCronJob = require('../reports/util/rpt_tmp_file_sweep');
+const RPT_DEF_PROPERTIES = require('../const/report_defined_properties');
 
 module.exports = app => {
     class ReportController extends app.BaseController {
@@ -415,10 +416,11 @@ async function getAllPagesCommon(ctx, rptTpl, params, option, outputType, baseDi
         const printCom = JpcEx.createNew();
         if (params.pageSize) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = params.pageSize;
         if (params.orientation && (params.orientation !== 'null')) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] = params.orientation;
-        let defProperties = await ctx.service.rptPreDefineCfg.getCfgById('Administrator');
+        // let defProperties = await ctx.service.rptPreDefineCfg.getCfgById('Administrator');
         // console.log('defProperties: ');
         // console.log(defProperties[0].defined_content);
-        defProperties = JSON.parse(defProperties[0].defined_content);
+        // defProperties = JSON.parse(defProperties[0].defined_content);
+        const defProperties = RPT_DEF_PROPERTIES;
         if (params.custCfg) {
             setupCustomizeCfg(params.custCfg, rptTpl, defProperties);
         } else {