jpc_report.js 21 KB

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