|
@@ -993,11 +993,15 @@ JpcFlowTabSrv.prototype.createNew = function() {
|
|
const rstCells = [];
|
|
const rstCells = [];
|
|
const tmpCells = [];
|
|
const tmpCells = [];
|
|
me.pageBlankCellsForErase = [];
|
|
me.pageBlankCellsForErase = [];
|
|
|
|
+ let minLeft = 10000,
|
|
|
|
+ maxRight = -1;
|
|
// 1. 首先收集所有空cell
|
|
// 1. 首先收集所有空cell
|
|
contentCells.forEach(cell => {
|
|
contentCells.forEach(cell => {
|
|
- if (cell.Value === '') {
|
|
|
|
|
|
+ if (cell.Value === '' || cell.Value === null) {
|
|
tmpCells.push(cell);
|
|
tmpCells.push(cell);
|
|
}
|
|
}
|
|
|
|
+ if (cell.area[JV.PROP_LEFT] < minLeft) minLeft = cell.area[JV.PROP_LEFT];
|
|
|
|
+ if (cell.area[JV.PROP_RIGHT] > maxRight) maxRight = cell.area[JV.PROP_RIGHT];
|
|
});
|
|
});
|
|
if (tmpCells.length > 0) {
|
|
if (tmpCells.length > 0) {
|
|
// 2. 以top为基准归类所有同top位置的cells
|
|
// 2. 以top为基准归类所有同top位置的cells
|
|
@@ -1047,19 +1051,31 @@ JpcFlowTabSrv.prototype.createNew = function() {
|
|
rstCells.push(...cellCache[propKey]);
|
|
rstCells.push(...cellCache[propKey]);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ // 3.4 还真的出现需要判断是否贴边的情况(3.3),从数据来看,这种情况还真的出现几率较大,反而带竖行输出的几率极少,这必须得认真考虑
|
|
|
|
+ if (rstCells.length > 0) {
|
|
|
|
+ let hasLeft = false,
|
|
|
|
+ hasRight = false;
|
|
|
|
+ rstCells.forEach(cell => {
|
|
|
|
+ if (cell.area[JV.PROP_LEFT] === minLeft) hasLeft = true;
|
|
|
|
+ if (cell.area[JV.PROP_RIGHT] === maxRight) hasRight = true;
|
|
|
|
+ });
|
|
|
|
+ if (!hasLeft || !hasRight) {
|
|
|
|
+ rstCells.splice(0, rstCells.length);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// console.log(rstCells);
|
|
// console.log(rstCells);
|
|
me.pageBlankCellsForErase.push(...rstCells);
|
|
me.pageBlankCellsForErase.push(...rstCells);
|
|
};
|
|
};
|
|
JpcFlowTabResult.eraseBlankCells = function(rptTpl, pageItem) {
|
|
JpcFlowTabResult.eraseBlankCells = function(rptTpl, pageItem) {
|
|
const me = this;
|
|
const me = this;
|
|
- const liftUpCells = (cells, maxBottom, upHeight) => {
|
|
|
|
|
|
+ const liftUpCells = (cells, maxBottom, upHeight, forceToAdjust = false) => {
|
|
if (cells && cells.length > 0) {
|
|
if (cells && cells.length > 0) {
|
|
cells.forEach(cell => {
|
|
cells.forEach(cell => {
|
|
- if (cell.area[JV.PROP_TOP] >= maxBottom) {
|
|
|
|
|
|
+ if (forceToAdjust || cell.area[JV.PROP_TOP] >= maxBottom) {
|
|
cell.area[JV.PROP_TOP] -= upHeight;
|
|
cell.area[JV.PROP_TOP] -= upHeight;
|
|
cell.area[JV.PROP_BOTTOM] -= upHeight;
|
|
cell.area[JV.PROP_BOTTOM] -= upHeight;
|
|
- } else if (cell.area[JV.PROP_BOTTOM] > maxBottom) {
|
|
|
|
|
|
+ } else if (forceToAdjust || cell.area[JV.PROP_BOTTOM] > maxBottom) {
|
|
// 未来可能会有那种特殊cell(如左右竖行): top在maxBottom之上,bottom在maxBottom之下,那么需要的是align bottom,减upHeight高度
|
|
// 未来可能会有那种特殊cell(如左右竖行): top在maxBottom之上,bottom在maxBottom之下,那么需要的是align bottom,减upHeight高度
|
|
cell.area[JV.PROP_BOTTOM] -= upHeight;
|
|
cell.area[JV.PROP_BOTTOM] -= upHeight;
|
|
}
|
|
}
|
|
@@ -1086,7 +1102,7 @@ JpcFlowTabSrv.prototype.createNew = function() {
|
|
// 2.3 cells其他位置提上
|
|
// 2.3 cells其他位置提上
|
|
liftUpCells(pageItem[JV.PROP_CELLS], cBottom, cHeight);
|
|
liftUpCells(pageItem[JV.PROP_CELLS], cBottom, cHeight);
|
|
// 2.4 签名位置调整(签名、日期、意见等)
|
|
// 2.4 签名位置调整(签名、日期、意见等)
|
|
- liftUpCells(pageItem[JV.PROP_SIGNATURE_CELLS], cBottom, cHeight);
|
|
|
|
|
|
+ liftUpCells(pageItem[JV.PROP_SIGNATURE_CELLS], cBottom, cHeight, true);
|
|
liftUpCells(pageItem[JV.PROP_SIGNATURE_DATE_CELLS], cBottom, cHeight);
|
|
liftUpCells(pageItem[JV.PROP_SIGNATURE_DATE_CELLS], cBottom, cHeight);
|
|
liftUpCells(pageItem[JV.PROP_SIGNATURE_AUDIT_CELLS], cBottom, cHeight);
|
|
liftUpCells(pageItem[JV.PROP_SIGNATURE_AUDIT_CELLS], cBottom, cHeight);
|
|
liftUpCells(pageItem[JV.PROP_INTERACT_CELLS], cBottom, cHeight);
|
|
liftUpCells(pageItem[JV.PROP_INTERACT_CELLS], cBottom, cHeight);
|