jpc_report.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. 'use strict';
  2. /**
  3. * Created by Tony on 2023/4/14.
  4. */
  5. const BaseService = require('../base/base_service');
  6. const JpcEx = require('../reports/rpt_component/jpc_ex');
  7. const JV = require('../reports/rpt_component/jpc_value_define');
  8. const rpt_xl_util = require('../reports/util/rpt_excel_util');
  9. const rptDataExtractor = require('../reports/util/rpt_calculation_data_util');
  10. const RPT_DEF_PROPERTIES = require('../const/report_defined_properties');
  11. const needCustomTables = [
  12. 'mem_custom_select',
  13. 'mem_gather_stage_bills', 'mem_gather_deal_bills', 'mem_gather_stage_pay', 'mem_gather_tender_info',
  14. 'mem_stage_sum_bills', 'mem_stage_sum_pay',
  15. 'mem_jh_gather_im_change', 'mem_jh_im_change', 'mem_jh_gather_stage_bills_compare',
  16. 'mem_material_sum_gl',
  17. ];
  18. module.exports = app => {
  19. class JpcReport extends BaseService {
  20. /**
  21. * 构造函数
  22. *
  23. * @param {Object} ctx - egg全局变量
  24. * @return {void}
  25. */
  26. constructor(ctx) {
  27. super(ctx);
  28. this.tableName = '';
  29. this.dataId = '';
  30. }
  31. async getAllPagesCommon(ctx, rptTpl, params, option, outputType, baseDir, customSelect) {
  32. const rptDataUtil = new rptDataExtractor();
  33. rptDataUtil.initialize(rptTpl);
  34. const filter = rptDataUtil.getDataRequestFilter();
  35. const rawDataObj = await ctx.service.report.getReportData(params, filter.tables, filter.memFieldKeys,
  36. rptTpl[JV.NODE_CUSTOM_DEFINE], customSelect);
  37. // console.log(rawDataObj);
  38. try {
  39. const printCom = JpcEx.createNew();
  40. if (params.pageSize) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = params.pageSize;
  41. if (params.orientation && (params.orientation !== 'null')) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] = params.orientation;
  42. const defProperties = RPT_DEF_PROPERTIES;
  43. const tplData = rptDataUtil.assembleData(ctx, rawDataObj, baseDir, printCom, customSelect);
  44. if (params.custCfg) {
  45. setupCustomizeCfg(params.custCfg, rptTpl, defProperties);
  46. } else {
  47. // setupCustomizeCfg(defProperties, rptTpl, defProperties);
  48. }
  49. const dftOption = params.option || JV.PAGING_OPTION_NORMAL;
  50. printCom.initialize(rptTpl);
  51. printCom.analyzeData(ctx.helper, rptTpl, tplData, defProperties, dftOption, outputType, customSelect);
  52. const maxPages = printCom.totalPages;
  53. let pageRst = null;
  54. if (maxPages > 0) {
  55. pageRst = printCom.outputAsSimpleJSONPageArray(ctx.helper, rptTpl, tplData, 1, maxPages, defProperties, params.custCfg, customSelect);
  56. } else {
  57. pageRst = printCom.outputAsPreviewPage(rptTpl, defProperties);
  58. }
  59. pageRst.id = params.rpt_tpl_id;
  60. return pageRst;
  61. } catch (ex) {
  62. console.log('报表数据异常, tender id: ' + params.tender_id);
  63. console.log(ex);
  64. }
  65. }
  66. async getMultiRptsCommon(ctx, params, outputType, baseDir) {
  67. for (let idx = 0; idx < params.rpt_ids.length; idx++) {
  68. params.rpt_ids[idx] = parseInt(params.rpt_ids[idx]); // 转换一下,以防万一
  69. }
  70. const rptTpls = await ctx.service.rptTpl.getAllTplByIds(params.rpt_ids);
  71. rptTpls.sort(function(rpt1, rpt2) {
  72. return params.rpt_ids.indexOf(rpt1.id) - params.rpt_ids.indexOf(rpt2.id);
  73. });
  74. for (let rtIdx = 0; rtIdx < rptTpls.length; rtIdx++) {
  75. const id = rptTpls[rtIdx].id;
  76. rptTpls[rtIdx] = JSON.parse(rptTpls[rtIdx].rpt_content);
  77. rptTpls[rtIdx].id = id;
  78. }
  79. const rptDataUtil = new rptDataExtractor();
  80. const filterTables = [];
  81. const memFieldKeys = {};
  82. let customSelect = {};
  83. let customDefine = {};
  84. for (const rptTpl of rptTpls) {
  85. rptDataUtil.initialize(rptTpl);
  86. const filter = rptDataUtil.getDataRequestFilter();
  87. // console.log(filter);
  88. for (const table of filter.tables) {
  89. if (filterTables.indexOf(table) < 0 && needCustomTables.indexOf(table) < 0) {
  90. filterTables.push(table);
  91. }
  92. // memFieldKeys[table] = [];
  93. }
  94. for (const tableKeyProp in filter.memFieldKeys) {
  95. if (needCustomTables.indexOf(tableKeyProp) >= 0) continue;
  96. if (!memFieldKeys.hasOwnProperty(tableKeyProp)) {
  97. memFieldKeys[tableKeyProp] = [];
  98. }
  99. for (const mfKey of filter.memFieldKeys[tableKeyProp]) {
  100. if (memFieldKeys[tableKeyProp].indexOf(mfKey) < 0) {
  101. memFieldKeys[tableKeyProp].push(mfKey);
  102. }
  103. }
  104. }
  105. // 输出报表的时候要把客户选择的数据的参数加进来
  106. let finCustomSelect = {};
  107. if (rptTpl[JV.NODE_CUSTOM_DEFINE]) {
  108. finCustomSelect = rptTpl[JV.NODE_CUSTOM_DEFINE] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_AUDIT_SELECT].enable
  109. ? await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, params.stage_id, rptTpl.id)
  110. : await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, -1, rptTpl.id);
  111. }
  112. if (finCustomSelect) {
  113. customDefine = rptTpl[JV.NODE_CUSTOM_DEFINE];
  114. customSelect = finCustomSelect;
  115. }
  116. }
  117. const rawDataObj = await ctx.service.report.getReportData(params, filterTables, memFieldKeys, customDefine, customSelect);
  118. // const rawDataObj = await ctx.service.report.getReportData(params, filterTables, memFieldKeys, {}, {});
  119. try {
  120. const rptPageRstArray = [];
  121. // 2. 一个一个模板创建数据
  122. // let defProperties = await ctx.service.rptPreDefineCfg.getCfgById('Administrator');
  123. // defProperties = JSON.parse(defProperties[0].defined_content);
  124. const defProperties = RPT_DEF_PROPERTIES;
  125. for (let tplIdx = 0; tplIdx < rptTpls.length; tplIdx++) {
  126. const rptTpl = (rptTpls[tplIdx]._doc) ? rptTpls[tplIdx]._doc : rptTpls[tplIdx];
  127. rptDataUtil.initialize(rptTpl);
  128. let customSelect = rptTpl[JV.NODE_CUSTOM_DEFINE] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_AUDIT_SELECT].enable
  129. ? await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, params.stage_id, rptTpl.id)
  130. : await ctx.service.rptCustomDefine.getCustomDefine(params.tender_id, -1, rptTpl.id);
  131. if (rptTpl[JV.NODE_CUSTOM_DEFINE] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_CHANGE_SELECT] && rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_CHANGE_SELECT].enable) {
  132. customSelect = { tid: params.tender_id, rid: params.rpt_tpl_id, sid: -1, change_select: params.customSelect[tplIdx].change_select };
  133. }
  134. // 从汇总的rawDataObj中拷贝所需数据表至curRawDataObj,以供后续使用
  135. const curRawDataObj = {};
  136. const filter = rptDataUtil.getDataRequestFilter();
  137. for (const table of filter.tables) {
  138. curRawDataObj[table] = ctx.helper.clone(rawDataObj[table]);
  139. }
  140. // 如果是用户交互类型的表,则应该单独获取数据
  141. if ((params.customSelect && params.customSelect[tplIdx]) || rptTpl[JV.NODE_CUSTOM_DEFINE][JV.NODE_CUS_OPTION]) {
  142. const cfTables = [],
  143. cmFieldKeys = [];
  144. const curFilter = rptDataUtil.getDataRequestFilter();
  145. for (const table of curFilter.tables) {
  146. if (needCustomTables.indexOf(table) >= 0) {
  147. cfTables.push(table);
  148. }
  149. }
  150. for (const tableKeyProp in filter.memFieldKeys) {
  151. if (needCustomTables.indexOf(tableKeyProp) < 0) continue;
  152. if (!cmFieldKeys.hasOwnProperty(tableKeyProp)) {
  153. cmFieldKeys[tableKeyProp] = [];
  154. }
  155. for (const mfKey of filter.memFieldKeys[tableKeyProp]) {
  156. if (cmFieldKeys[tableKeyProp].indexOf(mfKey) < 0) {
  157. cmFieldKeys[tableKeyProp].push(mfKey);
  158. }
  159. }
  160. }
  161. const customRawDataObj = await ctx.service.report.getReportData(params, cfTables, cmFieldKeys,
  162. rptTpl[JV.NODE_CUSTOM_DEFINE], customSelect);
  163. for (const prop in customRawDataObj) {
  164. curRawDataObj[prop] = customRawDataObj[prop];
  165. }
  166. }
  167. const tplData = rptDataUtil.assembleData(ctx, curRawDataObj, baseDir, null, customSelect);
  168. const printCom = JpcEx.createNew();
  169. rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = params.pageSize;
  170. if (params.pageSize) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = params.pageSize;
  171. if (params.orientation && (params.orientation !== 'null')) rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] = params.orientation;
  172. if (params.custCfg) setupCustomizeCfg(params.custCfg, rptTpl, defProperties);
  173. const dftOption = params.option || JV.PAGING_OPTION_NORMAL;
  174. printCom.initialize(rptTpl);
  175. // console.log(rptTpl);
  176. printCom.analyzeData(ctx.helper, rptTpl, tplData, defProperties, dftOption, outputType, customSelect);
  177. const maxPages = printCom.totalPages;
  178. let pageRst = null;
  179. // console.log(maxPages);
  180. if (maxPages > 0) {
  181. pageRst = printCom.outputAsSimpleJSONPageArray(ctx.helper, rptTpl, tplData, 1, maxPages, defProperties, params.custCfg, customSelect);
  182. } else {
  183. pageRst = printCom.outputAsPreviewPage(rptTpl, defProperties);
  184. }
  185. pageRst.id = rptTpl.id;
  186. rptPageRstArray.push(pageRst);
  187. }
  188. return rptPageRstArray;
  189. } catch (ex) {
  190. console.log(`'报表数据异常(getMultiRptsCommon): project_id ${params.project_id}, tender_id: ${params.tender_id}, stage_id: ${params.stage_id}`);
  191. console.log(ex);
  192. } finally {
  193. //
  194. }
  195. }
  196. getAllPreviewPagesCommon(rawRptTpl, pageSize) {
  197. const printCom = JpcEx.createNew();
  198. const defProperties = RPT_DEF_PROPERTIES;
  199. const rptTpl = JSON.parse(rawRptTpl.rpt_content);
  200. rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = pageSize;
  201. setupSomeDftCustomizeCfg(rptTpl);
  202. printCom.initialize(rptTpl);
  203. const pageRst = printCom.outputAsPreviewPage(rptTpl, defProperties);
  204. return pageRst;
  205. }
  206. }
  207. return JpcReport;
  208. };
  209. function setupCustomizeCfg(customizeCfg, rptTpl, defProperties) {
  210. const tmpObj = {};
  211. // 1. 字体
  212. const newFonts = [];
  213. for (const font of defProperties.fonts) {
  214. const copyFont = {};
  215. copyFont.ID = font.ID;
  216. for (const fontProp of JV.FONT_PROPS) {
  217. copyFont[fontProp] = font[fontProp];
  218. }
  219. newFonts.push(copyFont);
  220. tmpObj[font.ID] = copyFont;
  221. }
  222. const private_setup_font = function(propStr, newFont) {
  223. if (tmpObj[propStr]) {
  224. tmpObj[propStr].Name = newFont.Name;
  225. tmpObj[propStr].FontHeight = String(newFont.FontHeight);
  226. tmpObj[propStr].FontBold = newFont.FontBold;
  227. tmpObj[propStr].FontItalic = newFont.FontItalic;
  228. tmpObj[propStr].FontUnderline = newFont.FontUnderline;
  229. }
  230. };
  231. for (const custFont of customizeCfg.fonts) {
  232. switch (custFont.CfgDispName) {
  233. case '表标题':
  234. private_setup_font('ReportTitle_Main', custFont);
  235. break;
  236. case '列标题':
  237. private_setup_font('HeaderColumn', custFont);
  238. private_setup_font('FooterColumn', custFont);
  239. break;
  240. case '正文内容':
  241. private_setup_font('Content', custFont);
  242. break;
  243. case '合计':
  244. private_setup_font('GrandTotal', custFont);
  245. private_setup_font('SectionTotal', custFont);
  246. break;
  247. case '表眉/表脚':
  248. private_setup_font('Header', custFont);
  249. private_setup_font('Footer', custFont);
  250. break;
  251. default:
  252. break;
  253. }
  254. }
  255. // 1.1 窄体
  256. if (tmpObj.Content_Narrow) {
  257. if (customizeCfg.isNarrow) {
  258. tmpObj.Content_Narrow.Name = 'Arial Narrow';
  259. } else {
  260. if (tmpObj.Content) {
  261. tmpObj.Content_Narrow.Name = tmpObj.Content.Name;
  262. } else {
  263. tmpObj.Content_Narrow.Name = '宋体';
  264. }
  265. }
  266. }
  267. defProperties.fonts = newFonts;
  268. // 2. 页边距
  269. rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT] = customizeCfg.margins[JV.PROP_LEFT] / 10;
  270. rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT] = customizeCfg.margins[JV.PROP_RIGHT] / 10;
  271. rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_TOP] = customizeCfg.margins[JV.PROP_TOP] / 10;
  272. rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_BOTTOM] = customizeCfg.margins[JV.PROP_BOTTOM] / 10;
  273. // 3. 边框宽度
  274. if (customizeCfg.hasOwnProperty('borderThick')) {
  275. for (let i = 0; i < defProperties.styles.length; i++) {
  276. const style = defProperties.styles[i];
  277. if (style.ID === 'BORDER_ALL_AROUND') {
  278. for (const border of style.border_style) {
  279. border.LineWeight = customizeCfg.borderThick;
  280. }
  281. }
  282. }
  283. }
  284. // 4. 边框竖线
  285. if (!(customizeCfg.showVerticalLine)) {
  286. const private_copy_border = function(src) {
  287. const rst = {};
  288. rst.Position = src.Position;
  289. rst.LineWeight = src.LineWeight;
  290. rst.DashStyle = src.DashStyle;
  291. rst.Color = src.Color;
  292. return rst;
  293. };
  294. const newStyles = [];
  295. for (let i = 0; i < defProperties.styles.length; i++) {
  296. const style = defProperties.styles[i];
  297. newStyles.push(style);
  298. if (style.ID === 'BORDER_ALL_AROUND') {
  299. const newStyle = {};
  300. newStyle.ID = style.ID;
  301. newStyle.CfgDispName = style.CfgDispName;
  302. newStyle.border_style = [];
  303. for (const border of style.border_style) {
  304. const newBorder = private_copy_border(border);
  305. newStyle.border_style.push(newBorder);
  306. if (border.Position === 'Left' || border.Position === 'Right') {
  307. newBorder.LineWeight = 0;
  308. }
  309. }
  310. newStyles[newStyles.length - 1] = newStyle;
  311. }
  312. }
  313. defProperties.styles = newStyles;
  314. }
  315. // 5. 补0
  316. const private_Setup_Format = function(tabFields) {
  317. if (tabFields) {
  318. for (const tabField of tabFields) {
  319. if (tabField[JV.PROP_FORMAT]) {
  320. tabField[JV.PROP_FORMAT] = tabField[JV.PROP_FORMAT].replace(new RegExp('#', 'gm'), '0');
  321. }
  322. }
  323. }
  324. };
  325. if (customizeCfg.fillZero) {
  326. if (rptTpl[JV.NODE_FLOW_INFO]) {
  327. if (rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_CONTENT]) private_Setup_Format(rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_CONTENT][JV.PROP_FLOW_FIELDS]);
  328. if (rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_PAGE_SUM]) private_Setup_Format(rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_PAGE_SUM][JV.PROP_SUM_FIELDS]);
  329. if (rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_SEG_SUM]) private_Setup_Format(rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_SEG_SUM][JV.PROP_SUM_FIELDS]);
  330. if (rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_GROUP] && rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_GROUP][JV.PROP_GROUP_LINES]) private_Setup_Format(rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_GROUP][JV.PROP_GROUP_LINES][JV.PROP_SUM_FIELDS]);
  331. if (rptTpl[JV.NODE_FLOW_INFO][JV.NODE_DISCRETE_INFO]) {
  332. for (const discrete of rptTpl[JV.NODE_FLOW_INFO][JV.NODE_DISCRETE_INFO]) {
  333. private_Setup_Format(discrete[JV.PROP_DISCRETE_FIELDS]);
  334. }
  335. }
  336. if (rptTpl[JV.NODE_FLOW_INFO_EX]) {
  337. if (rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_FLOW_CONTENT]) private_Setup_Format(rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_FLOW_CONTENT][JV.PROP_FLOW_FIELDS]);
  338. if (rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_FLOW_PAGE_SUM]) private_Setup_Format(rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_FLOW_PAGE_SUM][JV.PROP_SUM_FIELDS]);
  339. if (rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_FLOW_SEG_SUM]) private_Setup_Format(rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_FLOW_SEG_SUM][JV.PROP_SUM_FIELDS]);
  340. if (rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_FLOW_GROUP]) private_Setup_Format(rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_FLOW_GROUP][JV.PROP_SUM_FIELDS]);
  341. if (rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_FLOW_GROUP] && rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_FLOW_GROUP][JV.PROP_GROUP_LINES]) private_Setup_Format(rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_FLOW_GROUP][JV.PROP_GROUP_LINES][JV.PROP_SUM_FIELDS]);
  342. if (rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_DISCRETE_INFO]) {
  343. for (const discrete of rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_DISCRETE_INFO]) {
  344. private_Setup_Format(discrete[JV.PROP_DISCRETE_FIELDS]);
  345. }
  346. }
  347. }
  348. } else if (rptTpl[JV.NODE_BILL_INFO]) {
  349. if (rptTpl[JV.NODE_BILL_INFO][JV.NODE_BILL_CONTENT]) private_Setup_Format(rptTpl[JV.NODE_BILL_INFO][JV.NODE_BILL_CONTENT][JV.PROP_BILL_FIELDS]);
  350. if (rptTpl[JV.NODE_BILL_INFO][JV.NODE_DISCRETE_INFO]) {
  351. for (const discrete of rptTpl[JV.NODE_BILL_INFO][JV.NODE_DISCRETE_INFO]) {
  352. private_Setup_Format(discrete[JV.PROP_DISCRETE_FIELDS]);
  353. }
  354. }
  355. } else if (rptTpl[JV.NODE_CROSS_INFO]) {
  356. if (rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_CONTENT]) private_Setup_Format(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_CONTENT][JV.TAB_CROSS_FIELDS]);
  357. if (rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW]) private_Setup_Format(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW][JV.TAB_CROSS_FIELDS]);
  358. if (rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_COL]) private_Setup_Format(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_COL][JV.TAB_CROSS_FIELDS]);
  359. if (rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_COL_SUM]) private_Setup_Format(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_COL_SUM][JV.TAB_CROSS_FIELDS]);
  360. if (rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_EXT]) private_Setup_Format(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_EXT][JV.TAB_CROSS_FIELDS]);
  361. if (rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_SUM_EXT]) private_Setup_Format(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_SUM_EXT][JV.TAB_CROSS_FIELDS]);
  362. if (rptTpl[JV.NODE_CROSS_INFO][JV.NODE_DISCRETE_INFO]) {
  363. for (const discrete of rptTpl[JV.NODE_CROSS_INFO][JV.NODE_DISCRETE_INFO]) {
  364. private_Setup_Format(discrete[JV.PROP_DISCRETE_FIELDS]);
  365. }
  366. }
  367. }
  368. }
  369. }
  370. function setupSomeDftCustomizeCfg(rptTpl) {
  371. rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT] = 1.5;
  372. rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT] = 1.5;
  373. rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_TOP] = 1.5;
  374. rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_BOTTOM] = 1.5;
  375. }