jpc_report.js 21 KB

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