|
@@ -15,6 +15,7 @@ const fsUtil = require('../public/fsUtil');
|
|
|
const strUtil = require('../public/stringUtil');
|
|
|
const fontWidthMap = require('./helper/jpc_helper_font_width');
|
|
|
const bc = require('../../lib/base_calc.js');
|
|
|
+const SEG_PAGE_SPLIT_STR = '`';
|
|
|
|
|
|
const JpcFlowTabSrv = function() {};
|
|
|
JpcFlowTabSrv.prototype.createNew = function() {
|
|
@@ -184,6 +185,8 @@ JpcFlowTabSrv.prototype.createNew = function() {
|
|
|
me.signatureRst = [];
|
|
|
me.signatureDateRst = [];
|
|
|
me.signatureAuditRst = [];
|
|
|
+
|
|
|
+ me.hasBreakFlowArr = [];
|
|
|
};
|
|
|
JpcFlowTabResult.sorting = function(rptTpl, dataObj, dataSeq, $CURRENT_RPT) {
|
|
|
const me = this;
|
|
@@ -515,13 +518,42 @@ JpcFlowTabSrv.prototype.createNew = function() {
|
|
|
followTabEx.setupGroupingData(rptTpl, dataObj, $CURRENT_RPT);
|
|
|
}
|
|
|
me.sumSeg(dataObj, $CURRENT_RPT); // 考虑到实际会有离散指标的汇总,这些离散指标数据是通过计算式后得来的,这种情况下,不适宜在sorting阶段进行汇总统计,现统一挪到这里处理
|
|
|
+ // const _chkHasBreakFlow = function(segIdx, pageIdx) {
|
|
|
+ // if (rptTpl[JV.NODE_FLOW_INFO][JV.NODE_DISCRETE_INFO]) {
|
|
|
+ // for (const discrete of rptTpl[JV.NODE_FLOW_INFO][JV.NODE_DISCRETE_INFO]) {
|
|
|
+ // if (discrete[JV.PROP_DISCRETE_FIELDS] && discrete[JV.PROP_DISCRETE_FIELDS].length > 0) {
|
|
|
+ // for (const df of discrete[JV.PROP_DISCRETE_FIELDS]) {
|
|
|
+ // const map_data_field = JE.F(df[JV.PROP_FIELD_ID], $CURRENT_RPT);
|
|
|
+ // if (map_data_field) {
|
|
|
+ // const val = JE.getFieldValue(map_data_field, dataObj, segIdx, '');
|
|
|
+ // if (typeof val === 'string') {
|
|
|
+ // if (val.indexOf(SEG_PAGE_SPLIT_STR) >= 0) {
|
|
|
+ // me.hasBreakFlowArr[pageIdx][0] = true;
|
|
|
+ // break;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (me.hasBreakFlowArr[pageIdx][0]) break;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (me.hasBreakFlowArr[pageIdx][0]) break;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // };
|
|
|
const bands = JpcBand.createNew(rptTpl, defProperties);
|
|
|
if (me.paging_option === JV.PAGING_OPTION_INFINITY) {
|
|
|
rst = me.segments.length;
|
|
|
- // const pageStatus = [true, true, false, true, true, true, false, false];
|
|
|
const pageStatus = [true, true, false, true, true, true, true, true];
|
|
|
const grpPageInfo = {};
|
|
|
+ let pageIdx = 0;
|
|
|
for (let segIdx = 0; segIdx < me.segments.length; segIdx++) {
|
|
|
+ /*
|
|
|
+ me.hasBreakFlowArr[pageIdx] = [];
|
|
|
+ me.hasBreakFlowArr[pageIdx][0] = false;
|
|
|
+ me.hasBreakFlowArr[pageIdx][1] = segIdx;
|
|
|
+ _chkHasBreakFlow(segIdx, pageIdx);
|
|
|
+ //*/
|
|
|
+ // 备注:有break flow的情况下 连续输出 要考虑段(seg)的多页输出问题
|
|
|
if (segIdx === me.segments.length - 1) {
|
|
|
pageStatus[JV.STATUS_REPORT_END] = true;
|
|
|
}
|
|
@@ -546,6 +578,23 @@ JpcFlowTabSrv.prototype.createNew = function() {
|
|
|
me.pageStatusLst.push(pageStatus.slice(0));
|
|
|
pageIdx++;
|
|
|
const rowAmt = Math.max(maxRowRec, me.segments[segIdx].length + adHocAutoHeightAmt);
|
|
|
+ /*
|
|
|
+ if (me.hasBreakFlowArr[pageIdx][0]) {
|
|
|
+ let accAmt = 0;
|
|
|
+ rowAmt = maxRowRec;
|
|
|
+ while (accAmt < me.segments[segIdx].length + adHocAutoHeightAmt) {
|
|
|
+ me.hasBreakFlowArr[pageIdx][0] = true;
|
|
|
+ me.hasBreakFlowArr[pageIdx][1] = segIdx;
|
|
|
+ private_addPageValue(me.dispValueIdxLst, me.segments[segIdx], grpSeqInfo, 0, rowAmt, me.page_seg_map, segIdx, pageIdx, grpPageInfo, false, me.auto_height_info, 0);
|
|
|
+ pageIdx++;
|
|
|
+ accAmt += maxRowRec;
|
|
|
+ // remark: 需要再细化
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ private_addPageValue(me.dispValueIdxLst, me.segments[segIdx], grpSeqInfo, 0, rowAmt, me.page_seg_map, segIdx, pageIdx, grpPageInfo, false, me.auto_height_info, 0);
|
|
|
+ pageIdx++;
|
|
|
+ }
|
|
|
+ //*/
|
|
|
private_addPageValue(me.dispValueIdxLst, me.segments[segIdx], grpSeqInfo, 0, rowAmt, me.page_seg_map, segIdx, pageIdx, grpPageInfo, false, me.auto_height_info, 0);
|
|
|
}
|
|
|
// 目前不支持flowTabEx
|
|
@@ -827,11 +876,10 @@ JpcFlowTabSrv.prototype.createNew = function() {
|
|
|
}
|
|
|
}
|
|
|
const rowAmt = Math.max(maxRowRec, me.segments[segIdx].length + adHocAutoHeightAmt); // 如不满一页,则需要填充满一页
|
|
|
+ // if (me.hasBreakFlowArr[segIdx]) {
|
|
|
+ // rowAmt = maxRowRec;
|
|
|
+ // }
|
|
|
const actH = JpcFlowTabHelper.getActualContentAreaHeight(bands, rptTpl, me.segments, rowAmt, page, me.isEx);
|
|
|
- // console.log('page:' + page);
|
|
|
- // console.log('maxRowRec:' + maxRowRec);
|
|
|
- // console.log('me.segments[segIdx].length:' + me.segments[segIdx].length);
|
|
|
- // console.log('actH:' + actH);
|
|
|
const offsetY = actH - (flowContentBand.Bottom - flowContentBand.Top);
|
|
|
JpcBandHelper.resetBandPos(rptTpl[JV.NODE_BAND_COLLECTION], bands, flowContentBand, 0, offsetY);
|
|
|
// 2.1 Content-Tab
|