jpc_ex.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. 'use strict';
  2. const JV = require('./jpc_value_define');
  3. const JpcBand = require('./jpc_band');
  4. const JpcFlowTab = require('./jpc_flow_tab');
  5. const JpcBillTab = require('./jpc_bill_tab');
  6. const JpcCrossTab = require('./jpc_cross_tab');
  7. const JpcField = require('./jpc_field');
  8. const JpcParam = require('./jpc_param');
  9. const JpcFunc = require('./jpc_function');
  10. const JpcEvent = require('./jpc_event');
  11. const JpcData = require('./jpc_data');
  12. const JpcCommonHelper = require('./helper/jpc_helper_common');
  13. const $JE = require('./jpc_rte'); // Important: for self-define function execution purpose
  14. const JpcExSrv = function() {};
  15. JpcExSrv.prototype.createNew = function() {
  16. function private_buildDftItems(rptTpl, dftCollection, propArray, nodeName) {
  17. const rst = {};
  18. if (dftCollection) {
  19. for (let i = 0; i < dftCollection.length; i++) {
  20. const item = {};
  21. for (let j = 0; j < propArray.length; j++) {
  22. item[propArray[j]] = dftCollection[i][propArray[j]];
  23. }
  24. rst[dftCollection[i][JV.PROP_ID]] = item;
  25. }
  26. if (rptTpl && rptTpl[nodeName] && rptTpl[nodeName].length > 0) {
  27. for (let i = 0; i < rptTpl[nodeName].length; i++) {
  28. const rptDftItem = rptTpl[nodeName][i];
  29. if (rst[rptDftItem[JV.PROP_ID]] === undefined) {
  30. const item = {};
  31. for (let j = 0; j < propArray.length; j++) {
  32. item[propArray[j]] = rptDftItem[propArray[j]];
  33. }
  34. rst[rptDftItem[JV.PROP_ID]] = item;
  35. }
  36. }
  37. }
  38. }
  39. return rst;
  40. }
  41. function private_buildDftControls(rptTpl, dftControlCollection) {
  42. return private_buildDftItems(rptTpl, dftControlCollection, JV.CONTROL_PROPS, JV.NODE_CONTROL_COLLECTION);
  43. }
  44. function private_buildDftFonts(rptTpl, dftFontCollection) {
  45. return private_buildDftItems(rptTpl, dftFontCollection, JV.FONT_PROPS, JV.NODE_FONT_COLLECTION);
  46. }
  47. function private_buildDftStyles(rptTpl, dftStyleCollection) {
  48. const rst = {};
  49. function private_CopyBorder(destItem, srcItem) {
  50. destItem[JV.PROP_LINE_WEIGHT] = srcItem[JV.PROP_LINE_WEIGHT];
  51. destItem[JV.PROP_DASH_STYLE] = srcItem[JV.PROP_DASH_STYLE];
  52. destItem[JV.PROP_COLOR] = srcItem[JV.PROP_COLOR];
  53. }
  54. if (dftStyleCollection) {
  55. for (let i = 0; i < dftStyleCollection.length; i++) {
  56. const item = {};
  57. if (dftStyleCollection[i][JV.PROP_BORDER_STYLE] && dftStyleCollection[i][JV.PROP_BORDER_STYLE].length > 0) {
  58. for (let j = 0; j < dftStyleCollection[i][JV.PROP_BORDER_STYLE].length; j++) {
  59. const borderItem = {};
  60. private_CopyBorder(borderItem, dftStyleCollection[i][JV.PROP_BORDER_STYLE][j]);
  61. item[dftStyleCollection[i][JV.PROP_BORDER_STYLE][j][JV.PROP_POSITION]] = borderItem;
  62. }
  63. }
  64. rst[dftStyleCollection[i][JV.PROP_ID]] = item;
  65. }
  66. if (rptTpl && rptTpl[JV.NODE_STYLE_COLLECTION] && rptTpl[JV.NODE_STYLE_COLLECTION].length > 0) {
  67. for (let i = 0; i < rptTpl[JV.NODE_STYLE_COLLECTION].length; i++) {
  68. const rptDftItem = rptTpl[JV.NODE_STYLE_COLLECTION][i];
  69. if (rst[rptDftItem[JV.PROP_ID]] === undefined) {
  70. if (rptDftItem[JV.PROP_ID].indexOf('_AutoHeightMerge_Top') > 0) {
  71. const key = rptDftItem[JV.PROP_ID].substr(0, rptDftItem[JV.PROP_ID].indexOf('_AutoHeightMerge_Top'));
  72. if (rst[key]) {
  73. const item = {};
  74. if (rst[key][JV.PROP_LEFT]) {
  75. item[JV.PROP_LEFT] = {};
  76. private_CopyBorder(item[JV.PROP_LEFT], rst[key][JV.PROP_LEFT]);
  77. }
  78. if (rst[key][JV.PROP_RIGHT]) {
  79. item[JV.PROP_RIGHT] = {};
  80. private_CopyBorder(item[JV.PROP_RIGHT], rst[key][JV.PROP_RIGHT]);
  81. }
  82. if (rst[key][JV.PROP_TOP]) {
  83. item[JV.PROP_TOP] = {};
  84. private_CopyBorder(item[JV.PROP_TOP], rst[key][JV.PROP_TOP]);
  85. }
  86. rst[rptDftItem[JV.PROP_ID]] = item;
  87. }
  88. } else if (rptDftItem[JV.PROP_ID].indexOf('_AutoHeightMerge_Middle') > 0) {
  89. const key = rptDftItem[JV.PROP_ID].substr(0, rptDftItem[JV.PROP_ID].indexOf('_AutoHeightMerge_Middle'));
  90. if (rst[key]) {
  91. const item = {};
  92. if (rst[key][JV.PROP_LEFT]) {
  93. item[JV.PROP_LEFT] = {};
  94. private_CopyBorder(item[JV.PROP_LEFT], rst[key][JV.PROP_LEFT]);
  95. }
  96. if (rst[key][JV.PROP_RIGHT]) {
  97. item[JV.PROP_RIGHT] = {};
  98. private_CopyBorder(item[JV.PROP_RIGHT], rst[key][JV.PROP_RIGHT]);
  99. }
  100. rst[rptDftItem[JV.PROP_ID]] = item;
  101. }
  102. } else if (rptDftItem[JV.PROP_ID].indexOf('_AutoHeightMerge_Bottom') > 0) {
  103. const key = rptDftItem[JV.PROP_ID].substr(0, rptDftItem[JV.PROP_ID].indexOf('_AutoHeightMerge_Bottom'));
  104. if (rst[key]) {
  105. const item = {};
  106. if (rst[key][JV.PROP_LEFT]) {
  107. item[JV.PROP_LEFT] = {};
  108. private_CopyBorder(item[JV.PROP_LEFT], rst[key][JV.PROP_LEFT]);
  109. }
  110. if (rst[key][JV.PROP_RIGHT]) {
  111. item[JV.PROP_RIGHT] = {};
  112. private_CopyBorder(item[JV.PROP_RIGHT], rst[key][JV.PROP_RIGHT]);
  113. }
  114. if (rst[key][JV.PROP_BOTTOM]) {
  115. item[JV.PROP_BOTTOM] = {};
  116. private_CopyBorder(item[JV.PROP_BOTTOM], rst[key][JV.PROP_BOTTOM]);
  117. }
  118. rst[rptDftItem[JV.PROP_ID]] = item;
  119. }
  120. } else {
  121. const item = {};
  122. for (let j = 0; j < rptDftItem[JV.PROP_BORDER_STYLE].length; j++) {
  123. const borderItem = {};
  124. private_CopyBorder(borderItem, rptDftItem[JV.PROP_BORDER_STYLE][j]);
  125. item[rptDftItem[JV.PROP_BORDER_STYLE][j][JV.PROP_POSITION]] = borderItem;
  126. }
  127. rst[rptDftItem[JV.PROP_ID]] = item;
  128. }
  129. }
  130. }
  131. }
  132. }
  133. return rst;
  134. }
  135. const JpcResult = {};
  136. JpcResult.initialize = function(rptTpl) {
  137. const me = this;
  138. if (rptTpl[JV.NODE_FLOW_INFO]) {
  139. me.flowTab = JpcFlowTab.createNew();
  140. me.flowTab.initialize(false);
  141. me.isFollowMode = false;
  142. }
  143. if (rptTpl[JV.NODE_FLOW_INFO_EX]) {
  144. me.flowTabEx = JpcFlowTab.createNew();
  145. me.flowTabEx.initialize(true);
  146. if (rptTpl[JV.NODE_FLOW_INFO_EX][JV.PROP_FLOW_EX_DISPLAY_MODE] === JV.DISPLAY_MODE_FOLLOW) {
  147. me.isFollowMode = true;
  148. }
  149. }
  150. if (rptTpl[JV.NODE_BILL_INFO]) {
  151. me.billTab = JpcBillTab.createNew();
  152. me.billTab.initialize();
  153. }
  154. if (rptTpl[JV.NODE_CROSS_INFO]) {
  155. me.crossTab = JpcCrossTab.createNew();
  156. me.crossTab.initialize();
  157. }
  158. me.totalPages = 0;
  159. me.exTotalPages = 0;
  160. me.runTimePageData = {};
  161. me.fields = JpcField.createNew(rptTpl);
  162. me.params = JpcParam.createNew(rptTpl);
  163. me.formulas = JpcFunc.createNew(rptTpl);
  164. me.events = JpcEvent.createNew(rptTpl);
  165. };
  166. JpcResult.analyzeData = function(rptTpl, dataObj, defProperties, option, outputType) {
  167. const me = this;
  168. const dftPagingOption = option || JV.PAGING_OPTION_NORMAL;
  169. // 1. data object
  170. let dataHelper = JpcData.createNew();
  171. me.executeFormulas(JV.RUN_TYPE_BEFORE_ANALYZING, rptTpl, dataObj, me); // 在分析前运行,主要是增加灵活性,比如:重新编排数据的主从关系
  172. if (me.crossTab) {
  173. me.executeFormulas(JV.RUN_TYPE_BEFORE_PAGING, rptTpl, dataObj, me);
  174. dataHelper.analyzeData(rptTpl, dataObj);
  175. me.crossTab.sorting(rptTpl, dataObj, dataHelper.dataSeq.slice(0), me);
  176. } else {
  177. dataHelper.analyzeData(rptTpl, dataObj);
  178. // 2. tab object
  179. // pre-condition: the data should be sorted in SQL/NoSQL level!
  180. // let dt1 = new Date();
  181. if (me.flowTab) {
  182. me.flowTab.sorting(rptTpl, dataObj, dataHelper.dataSeq.slice(0), me);
  183. if (me.flowTabEx) {
  184. me.flowTabEx.sorting(rptTpl, dataObj, dataHelper.exDataSeq.slice(0), me);
  185. }
  186. }
  187. if (me.billTab) {
  188. me.billTab.sorting(rptTpl, dataObj, dataHelper.dataSeq.slice(0), me);
  189. }
  190. // let dt2 = new Date();
  191. // alert(dt2 - dt1);
  192. // 3. formulas
  193. me.executeFormulas(JV.RUN_TYPE_BEFORE_PAGING, rptTpl, dataObj, me);
  194. }
  195. // 4. paging
  196. me.paging(rptTpl, dataObj, defProperties, dftPagingOption, outputType);
  197. // alert('analyzeData was completed!');
  198. // for garbage collection:
  199. dataHelper = null;
  200. };
  201. JpcResult.paging = function(rptTpl, dataObj, defProperties, option, outputType) {
  202. const me = this;
  203. const dftPagingOption = option || JV.PAGING_OPTION_NORMAL;
  204. if (me.flowTab) {
  205. if (me.isFollowMode) {
  206. me.totalPages = me.flowTab.preSetupPages(rptTpl, dataObj, defProperties, dftPagingOption, me, me.flowTabEx, outputType);
  207. } else {
  208. me.totalPages = me.flowTab.preSetupPages(rptTpl, dataObj, defProperties, dftPagingOption, me, null, outputType);
  209. if (me.flowTabEx) {
  210. me.exTotalPages = me.flowTabEx.preSetupPages(rptTpl, dataObj, defProperties, dftPagingOption, me, null, outputType);
  211. // console.log('ad-hoc flow pages: ' + me.exTotalPages);
  212. }
  213. me.totalPages += me.exTotalPages;
  214. }
  215. } else if (me.crossTab) {
  216. // me.totalPages = me.crossTab.preSetupPages(rptTpl, defProperties, dftPagingOption);
  217. me.totalPages = me.crossTab.preSetupPages(rptTpl, defProperties, JV.PAGING_OPTION_NORMAL); // infinity对交叉表来说无意义
  218. } else if (me.billTab) {
  219. me.totalPages = me.billTab.paging(rptTpl, dataObj);
  220. }
  221. };
  222. JpcResult.executeFormulas = function(runType, $CURRENT_TEMPLATE, $CURRENT_DATA, $CURRENT_RPT) {
  223. const execFmlMe = this;
  224. for (let execFmlIdx = 0; execFmlIdx < execFmlMe.formulas.length; execFmlIdx++) {
  225. // remark: 搞这么复杂的变量名是为了防止与表达式起冲突(如循环变量i,j,k,容易造成变量冲突且不容易看出问题)
  226. if (execFmlMe.formulas[execFmlIdx][JV.PROP_RUN_TYPE] === runType) {
  227. const expression = execFmlMe.formulas[execFmlIdx][JV.PROP_EXPRESSION];
  228. if (expression) {
  229. const $ME = execFmlMe.formulas[execFmlIdx];
  230. // console.log("current expression idx: " + execFmlIdx);
  231. // console.log(expression);
  232. try {
  233. eval(expression);
  234. } catch (ex) {
  235. console.log(ex);
  236. }
  237. }
  238. }
  239. }
  240. };
  241. JpcResult.outputAsPreviewPage = function(rptTpl, defProperties) {
  242. const me = this;
  243. const rst = {};
  244. rst[JV.NODE_CONTROL_COLLECTION] = private_buildDftControls(rptTpl, (defProperties === null) ? null : defProperties.ctrls);
  245. rst[JV.NODE_STYLE_COLLECTION] = private_buildDftStyles(rptTpl, (defProperties === null) ? null : defProperties.styles);
  246. rst[JV.NODE_FONT_COLLECTION] = private_buildDftFonts(rptTpl, (defProperties === null) ? null : defProperties.fonts);
  247. rst[JV.NODE_PAGE_INFO] = {};
  248. rst[JV.NODE_PAGE_INFO][JV.NODE_MAIN_INFO_RPT_NAME] = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MAIN_INFO_RPT_NAME];
  249. rst[JV.NODE_PAGE_INFO][JV.NODE_PAGE_SIZE] = JpcCommonHelper.getPageSize(rptTpl);
  250. rst[JV.NODE_PAGE_INFO][JV.NODE_MARGINS] = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS];
  251. rst.items = [];
  252. let bands = JpcBand.createNew(rptTpl, defProperties);
  253. function getPageMergeBorder() {
  254. let mergeRst = null;
  255. if (bands[JV.BAND_PROP_MERGE_BAND]) {
  256. const mergedBand = bands[JV.BAND_PROP_MERGE_BAND];
  257. mergeRst = {};
  258. mergeRst[JV.PROP_LEFT] = parseInt(mergedBand[JV.PROP_LEFT].toFixed(0));
  259. mergeRst[JV.PROP_RIGHT] = parseInt(mergedBand[JV.PROP_RIGHT].toFixed(0));
  260. mergeRst[JV.PROP_TOP] = parseInt(mergedBand[JV.PROP_TOP].toFixed(0));
  261. mergeRst[JV.PROP_BOTTOM] = parseInt(mergedBand[JV.PROP_BOTTOM].toFixed(0));
  262. }
  263. return mergeRst;
  264. }
  265. try {
  266. // 1.
  267. const rstPage = {};
  268. rstPage[JV.PROP_PAGE_SEQ] = 1;
  269. if (me.flowTab) {
  270. rstPage[JV.PROP_CELLS] = me.flowTab.outputAsPreviewPage(rptTpl, bands, rst[JV.NODE_CONTROL_COLLECTION], me);
  271. } else if (me.crossTab) {
  272. rstPage[JV.PROP_CELLS] = me.crossTab.outputAsPreviewPage(rptTpl, bands, rst[JV.NODE_CONTROL_COLLECTION], me);
  273. } else if (me.billTab) {
  274. rstPage[JV.PROP_CELLS] = me.billTab.outputAsPreviewPage(rptTpl, bands, rst[JV.NODE_CONTROL_COLLECTION], me);
  275. }
  276. const pageMergeBorder = getPageMergeBorder();
  277. if (pageMergeBorder) {
  278. rstPage[JV.PROP_PAGE_MERGE_BORDER] = pageMergeBorder;
  279. }
  280. rstPage[JV.PROP_SIGNATURE_CELLS] = [];
  281. rstPage[JV.PROP_SIGNATURE_DATE_CELLS] = [];
  282. rst.items.push(rstPage);
  283. // 2.
  284. if (bands[JV.BAND_PROP_MERGE_BAND]) {
  285. const mergedBand = {};
  286. const band = bands[JV.BAND_PROP_MERGE_BAND];
  287. mergedBand[JV.PROP_LEFT] = parseInt(band[JV.PROP_LEFT].toFixed(0));
  288. mergedBand[JV.PROP_RIGHT] = parseInt(band[JV.PROP_RIGHT].toFixed(0));
  289. mergedBand[JV.PROP_TOP] = parseInt(band[JV.PROP_TOP].toFixed(0));
  290. mergedBand[JV.PROP_BOTTOM] = parseInt(band[JV.PROP_BOTTOM].toFixed(0));
  291. mergedBand[JV.BAND_PROP_STYLE] = band[JV.BAND_PROP_STYLE];
  292. rst[JV.BAND_PROP_MERGE_BAND] = mergedBand;
  293. }
  294. } catch (exception) {
  295. console.log(exception);
  296. } finally {
  297. bands = null;
  298. }
  299. return rst;
  300. };
  301. JpcResult.outputAsSimpleJSONPageArray = function(rptTpl, dataObj, startPage, endPage, defProperties, customizeCfg) {
  302. const me = this;
  303. const rst = {};
  304. if ((startPage > 0) && (startPage <= endPage) && (endPage <= me.totalPages)) {
  305. rst[JV.NODE_CONTROL_COLLECTION] = private_buildDftControls(rptTpl, (defProperties === null) ? null : defProperties.ctrls);
  306. // console.log('controls: ');
  307. // console.log(rst[JV.NODE_CONTROL_COLLECTION]);
  308. rst[JV.NODE_STYLE_COLLECTION] = private_buildDftStyles(rptTpl, (defProperties === null) ? null : defProperties.styles);
  309. rst[JV.NODE_FONT_COLLECTION] = private_buildDftFonts(rptTpl, (defProperties === null) ? null : defProperties.fonts);
  310. rst[JV.NODE_PAGE_INFO] = {};
  311. rst[JV.NODE_PAGE_INFO][JV.NODE_MAIN_INFO_RPT_NAME] = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MAIN_INFO_RPT_NAME];
  312. rst[JV.NODE_PAGE_INFO][JV.NODE_PAGE_SIZE] = JpcCommonHelper.getPageSize(rptTpl);
  313. rst[JV.NODE_PAGE_INFO][JV.NODE_MARGINS] = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS];
  314. rst.items = [];
  315. let bands = JpcBand.createNew(rptTpl, defProperties);
  316. try {
  317. for (let page = startPage; page <= endPage; page++) {
  318. me.runTimePageData.currentPage = page;
  319. me.executeFormulas(JV.RUN_TYPE_BEFORE_OUTPUT, rptTpl, dataObj, me);
  320. rst.items.push(me.outputAsSimpleJSONPage(rptTpl, dataObj, bands, page, rst[JV.NODE_CONTROL_COLLECTION], customizeCfg));
  321. }
  322. if (bands[JV.BAND_PROP_MERGE_BAND]) {
  323. const mergedBand = {};
  324. const band = bands[JV.BAND_PROP_MERGE_BAND];
  325. mergedBand[JV.PROP_LEFT] = parseInt(band[JV.PROP_LEFT].toFixed(0));
  326. mergedBand[JV.PROP_RIGHT] = parseInt(band[JV.PROP_RIGHT].toFixed(0));
  327. mergedBand[JV.PROP_TOP] = parseInt(band[JV.PROP_TOP].toFixed(0));
  328. mergedBand[JV.PROP_BOTTOM] = parseInt(band[JV.PROP_BOTTOM].toFixed(0));
  329. mergedBand[JV.BAND_PROP_STYLE] = band[JV.BAND_PROP_STYLE];
  330. rst[JV.BAND_PROP_MERGE_BAND] = mergedBand;
  331. }
  332. } catch (exception) {
  333. console.log(exception);
  334. } finally {
  335. bands = null;
  336. }
  337. }
  338. return rst;
  339. };
  340. JpcResult.outputAsSimpleJSONPage = function(rptTpl, dataObj, bands, page, controls, customizeCfg) {
  341. const me = this;
  342. let rst = null;
  343. function getPageMergeBorder() {
  344. let mergeRst = null;
  345. if (bands[JV.BAND_PROP_MERGE_BAND]) {
  346. const mergedBand = bands[JV.BAND_PROP_MERGE_BAND];
  347. mergeRst = {};
  348. mergeRst[JV.PROP_LEFT] = parseInt(mergedBand[JV.PROP_LEFT].toFixed(0));
  349. mergeRst[JV.PROP_RIGHT] = parseInt(mergedBand[JV.PROP_RIGHT].toFixed(0));
  350. mergeRst[JV.PROP_TOP] = parseInt(mergedBand[JV.PROP_TOP].toFixed(0));
  351. mergeRst[JV.PROP_BOTTOM] = parseInt(mergedBand[JV.PROP_BOTTOM].toFixed(0));
  352. }
  353. return mergeRst;
  354. }
  355. if (me.totalPages >= page) {
  356. rst = {};
  357. rst[JV.PROP_PAGE_SEQ] = page;
  358. // rst.cells = [];
  359. let adHocMergePos = null;
  360. if (me.flowTab) {
  361. if (me.totalPages - me.exTotalPages >= page) {
  362. if (me.flowTab.paging_option === JV.PAGING_OPTION_INFINITY) {
  363. adHocMergePos = {};
  364. }
  365. rst[JV.PROP_CELLS] = me.flowTab.outputAsSimpleJSONPage(rptTpl, dataObj, page, bands, controls, adHocMergePos, me, customizeCfg);
  366. rst[JV.PROP_SIGNATURE_CELLS] = me.flowTab.signatureRst;
  367. rst[JV.PROP_SIGNATURE_DATE_CELLS] = me.flowTab.signatureDateRst;
  368. if (adHocMergePos) {
  369. adHocMergePos[JV.NODE_PAGE_SIZE] = JpcCommonHelper.getPageSize(rptTpl);
  370. rst[JV.PAGE_SPECIAL_MERGE_POS] = adHocMergePos;
  371. }
  372. } else {
  373. if (!me.isFollowMode) {
  374. rst[JV.PROP_CELLS] = me.flowTabEx.outputAsSimpleJSONPage(rptTpl, dataObj, page - (me.totalPages - me.exTotalPages), bands, controls, adHocMergePos, me, customizeCfg);
  375. rst[JV.PROP_SIGNATURE_CELLS] = me.flowTabEx.signatureRst;
  376. rst[JV.PROP_SIGNATURE_DATE_CELLS] = me.flowTabEx.signatureDateRst;
  377. }
  378. }
  379. } else if (me.crossTab) {
  380. rst[JV.PROP_CELLS] = me.crossTab.outputAsSimpleJSONPage(rptTpl, dataObj, page, bands, controls, me, customizeCfg);
  381. rst[JV.PROP_SIGNATURE_CELLS] = me.crossTab.signatureRst;
  382. rst[JV.PROP_SIGNATURE_DATE_CELLS] = me.crossTab.signatureDateRst;
  383. } else if (me.billTab) {
  384. rst[JV.PROP_CELLS] = me.billTab.outputAsSimpleJSONPage(rptTpl, dataObj, page, bands, controls, me, customizeCfg);
  385. rst[JV.PROP_SIGNATURE_CELLS] = me.billTab.signatureRst;
  386. rst[JV.PROP_SIGNATURE_DATE_CELLS] = me.billTab.signatureDateRst;
  387. }
  388. if (!(me.flowTab && me.flowTab.paging_option === JV.PAGING_OPTION_INFINITY)) {
  389. const pageMergeBorder = getPageMergeBorder();
  390. if (pageMergeBorder) {
  391. rst[JV.PROP_PAGE_MERGE_BORDER] = pageMergeBorder;
  392. }
  393. }
  394. } else {
  395. console.log('no page result was found!');
  396. }
  397. return rst;
  398. };
  399. // JpcEx.rte.currentRptObj = JpcResult;
  400. return JpcResult;
  401. };
  402. module.exports = new JpcExSrv();