|
@@ -361,6 +361,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
};
|
|
|
let private_get_max_lines_of_the_record = function(theRecIdx) {
|
|
|
let rst = 1;
|
|
|
+ let maxAmt = 1;
|
|
|
for (let loop = 0; loop < me.auto_height_fields_idx.length; loop++) {
|
|
|
/*
|
|
|
let data_field = null;
|
|
@@ -396,16 +397,8 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
}
|
|
|
JpcFieldHelper.setValue(data_field, theRecIdx, value);
|
|
|
let values = value.split('|');
|
|
|
- if (values.length > rst) rst = values.length;
|
|
|
+ // if (values.length > rst) rst = values.length; // 考虑到紧凑输出,不能那么快设置rst
|
|
|
let font = private_get_font(tab_field[JV.PROP_FONT]);
|
|
|
- // if (font) {
|
|
|
- // let fontFile = __dirname.slice(0, __dirname.length - 14) + '/util/pdf_base_files/' + fontUtil.getActualFont(font[JV.FONT_PROPS[0]], (font[JV.FONT_PROPS[3]] === 'T'), (font[JV.FONT_PROPS[4]] === 'T')) + '.ttf';
|
|
|
- // doc.font(fontFile);
|
|
|
- // doc.fontSize(parseInt(font[JV.FONT_PROPS[JV.FONT_PROP_IDX_HEIGHT]]));
|
|
|
- // } else {
|
|
|
- // doc.font(__dirname.slice(0, __dirname.length - 14) + '/util/pdf_base_files/Smart.ttf');
|
|
|
- // doc.fontSize(12);
|
|
|
- // }
|
|
|
let chkFontName = '宋体';
|
|
|
let chkFontHeight = 12;
|
|
|
if (font) {
|
|
@@ -424,20 +417,17 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
splitStrArr.push(i);
|
|
|
}
|
|
|
}
|
|
|
- if (accAmt > rst) rst = accAmt;
|
|
|
- if (rst > 3) {
|
|
|
+ if (accAmt > 3) {
|
|
|
// 新优化,计算实际能显示完的真正行数
|
|
|
const rowHeight = JpcFlowTabHelper.getRowHeight(bands, rptTpl, me.isEx);
|
|
|
- let tmpFV = ((chkFontHeight + JV.CLOSE_OUTPUT_ROW_BUFFER) * rst) / rowHeight;
|
|
|
+ let tmpFV = ((chkFontHeight + JV.CLOSE_OUTPUT_ROW_BUFFER) * accAmt) / rowHeight;
|
|
|
let tmpAmt = Math.floor(tmpFV);
|
|
|
- // tmpAmt += Math.ceil((tmpFV - tmpAmt) / 0.5);
|
|
|
- // if (tmpFV - tmpAmt >= 0.5 && rst > 6) {
|
|
|
- // tmpAmt++;
|
|
|
- // }
|
|
|
if (Math.ceil(tmpFV) > tmpAmt) {
|
|
|
tmpAmt++;
|
|
|
}
|
|
|
- rst = tmpAmt;
|
|
|
+ if (maxAmt < tmpAmt) maxAmt = tmpAmt;
|
|
|
+ } else {
|
|
|
+ if (maxAmt < accAmt) maxAmt = accAmt;
|
|
|
}
|
|
|
// if (hasSplitStr && outputType !== JV.OUTPUT_TYPE_EXCEL) {
|
|
|
if (hasSplitStr) {
|
|
@@ -457,6 +447,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
// 根据最新需求,暂时不考虑excel类型输出,换回原来逻辑
|
|
|
}
|
|
|
}
|
|
|
+ if (rst < maxAmt) rst = maxAmt; // 最后才设置最大结果
|
|
|
return rst;
|
|
|
};
|
|
|
for (let tabField of tab_fields) {
|
|
@@ -1337,8 +1328,11 @@ JpcFlowTabSrv.prototype.createNew = function(){
|
|
|
}
|
|
|
} else {
|
|
|
//这里不管是不是附属autoheight指标,有足够的条件单独处理
|
|
|
+ // console.log(`ACT_ROWS: ${ACT_ROWS}`);
|
|
|
+ // console.log(`QUOTA_Rate: ${QUOTA_Rate}`);
|
|
|
if (QUOTA_Rate >= 2) {
|
|
|
//压缩超过一半空间的话,说明给的行高度太高了,需要另外一些特殊处理,后期有需要再加
|
|
|
+ console.log('压缩率异常!!!!!');
|
|
|
} else {
|
|
|
//正常的压缩比例
|
|
|
let startIdx = 0, endIdx = 0;
|