|
|
@@ -44,8 +44,8 @@ class JpcFlowTabClass {
|
|
|
segments: number[][];
|
|
|
dispValueIdxLst: number[][][];
|
|
|
page_seg_map: number[][];
|
|
|
- disp_fields_idx: any[];
|
|
|
- disp_fields_ex_idx: any[];
|
|
|
+ disp_fields_idx: number[];
|
|
|
+ disp_fields_ex_idx: number[];
|
|
|
seg_sum_fields_idx: any[];
|
|
|
seg_sum_tab_fields: any[];
|
|
|
page_sum_fields_idx: any[];
|
|
|
@@ -811,7 +811,7 @@ class JpcFlowTabClass {
|
|
|
return rst;
|
|
|
};
|
|
|
outputContent(rptTpl: IRptTpl, dataObj: IDataObj, page: number, bands: IBands, unitFactor: number, controls: IControlCollection, multiColIdx: number, $CURRENT_RPT: ICurrent_RPT, customizeCfg: ICustomizeCfg) {
|
|
|
- let me = this, rst: any[] = [], prepareObj = {};
|
|
|
+ let me = this, rst: any[] = [], prepareObj =<IPageAreaObj>{};
|
|
|
// let FLOW_NODE_STR = me.isEx?'流水式表_拓展信息':'流水式表_信息';
|
|
|
let flow_node_str = me.isEx ? rptTpl.流水式表_拓展信息 : rptTpl.流水式表_信息;
|
|
|
let tab = flow_node_str.流水式表_数据;
|
|
|
@@ -991,6 +991,8 @@ class JpcFlowTabClass {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ //合并自动换行的格子,直接把第一个格子的值一个一个递增为目标值,并且把被合并的格子的id纪录下来,准备在下面进行删除
|
|
|
+ //(本来是一行一个格子的,此处通过表示对值进行递增)
|
|
|
let eliminateCells = combineAutoHeightCells(prepareObj, page, controls);
|
|
|
for (let idIdx = eliminateCells.length - 1; idIdx >= 0; idIdx--) {
|
|
|
rst.splice(eliminateCells[idIdx], 1);
|
|
|
@@ -1439,7 +1441,7 @@ function _addPageValue(ValuedIdxLst: number[][][], sortedSequence: number[], grp
|
|
|
}
|
|
|
|
|
|
function push_cell(pageCellObj: IPageCellObj, cell: ICell, cellIdx: number) {
|
|
|
- let key = cell.area.Left; + '_' + cell.area.Right;
|
|
|
+ let key = cell.area.Left + '_' + cell.area.Right;
|
|
|
if (!pageCellObj[key]) {
|
|
|
pageCellObj[key] = [];
|
|
|
}
|
|
|
@@ -1461,7 +1463,7 @@ function setupControl(mergeCell: ICell, controls: IControlCollection) {
|
|
|
let orgCtrl = null;
|
|
|
if (typeof mergeCell.control === "string") {
|
|
|
orgCtrl = controls[mergeCell.control];
|
|
|
- mergeCell.control = {
|
|
|
+ mergeCell.control = <IControlSubCollection>{
|
|
|
"Shrink": "T",
|
|
|
"ShrinkFirst": orgCtrl.ShrinkFirst,
|
|
|
"CloseOutput": orgCtrl.CloseOutput,
|
|
|
@@ -1470,7 +1472,7 @@ function setupControl(mergeCell: ICell, controls: IControlCollection) {
|
|
|
"Vertical": orgCtrl.Vertical,
|
|
|
"Wrap": (mergeCell.isAutoHeight) ? 'T' : 'F',
|
|
|
"VerticalForExcel": "center"
|
|
|
- } as IControlSubCollection;
|
|
|
+ };
|
|
|
} else {
|
|
|
mergeCell.control.Shrink = "T";
|
|
|
mergeCell.control.Vertical = "top";
|
|
|
@@ -1488,22 +1490,25 @@ function setupControl(mergeCell: ICell, controls: IControlCollection) {
|
|
|
return orgCtrl;
|
|
|
}
|
|
|
|
|
|
-function combineAutoHeightCells(prepareObj: IPageAreaObj | {}, page: number, controls: IControlCollection) {
|
|
|
+function combineAutoHeightCells(prepareObj: IPageAreaObj , page: number, controls: IControlCollection) {
|
|
|
+ // 该方法主要是用来生成自动合并的格子的,本来是已经生成了一行一个格子的,但现在需要把可以自动合并的格子进行中整合,在这里进行这个动作
|
|
|
+ // 最后输出的是被合并的格子的index,在外面再剔除
|
|
|
let rst = [];
|
|
|
- if ((prepareObj as IPageAreaObj).cellsArr) {
|
|
|
+ if (prepareObj.cellsArr) {
|
|
|
//merge cells' value and area
|
|
|
//备注: 系统逻辑已经把Cell的顺序放好,无需再做排序。
|
|
|
- for (let mergeKey in (prepareObj as IPageAreaObj).pageCellObj) {
|
|
|
- let sameColCells = (prepareObj as IPageAreaObj).pageCellObj[mergeKey]; //左右位置相同的Cell先放在一起,统一处理
|
|
|
+ for (let mergeKey in prepareObj.pageCellObj) {
|
|
|
+ let sameColCells = prepareObj.pageCellObj[mergeKey]; //左右位置相同的Cell先放在一起,统一处理
|
|
|
if (sameColCells.length > 1) {
|
|
|
- //强转格式,此处是强制把本来是字符串的control属性转化为对象,by lish
|
|
|
- let firstMergeCell = { ...sameColCells[0].cell, control: {} as IControlSubCollection } as ICell;
|
|
|
+ // 这里获取第一个被合并的cell的数据
|
|
|
+ let firstMergeCell = sameColCells[0].cell ;
|
|
|
firstMergeCell.style = firstMergeCell.style.slice(0, firstMergeCell.style.indexOf("_AutoHeightMerge")); //首先还原original style
|
|
|
//生成原始对象,并且把对象中的control属性转化为对象
|
|
|
let orgCtrl = setupControl(firstMergeCell, controls);
|
|
|
let validValueAmt = 0, fullValidValueAmt = 0;
|
|
|
for (let i = 1; i < sameColCells.length; i++) {
|
|
|
let mergeCell = sameColCells[i].cell;
|
|
|
+ //含有“_AutoHeightMerge_Top”的都是每个自动合并的cell的第一行(项)
|
|
|
if (mergeCell.style.indexOf("_AutoHeightMerge_Top") < 0) {
|
|
|
fullValidValueAmt++;
|
|
|
//merge into the firstMergeCell! position & value
|
|
|
@@ -1528,8 +1533,7 @@ function combineAutoHeightCells(prepareObj: IPageAreaObj | {}, page: number, con
|
|
|
firstMergeCell.control.VerticalForExcel = 'center';
|
|
|
}
|
|
|
}
|
|
|
- //强制把已为对象的control属性还原成为字符串,by lish
|
|
|
- firstMergeCell = sameColCells[i].cell as unknown as ICell;
|
|
|
+ firstMergeCell = <ICell>sameColCells[i].cell;
|
|
|
firstMergeCell.style = firstMergeCell.style.slice(0, firstMergeCell.style.indexOf("_AutoHeightMerge"));
|
|
|
orgCtrl = setupControl(firstMergeCell, controls);
|
|
|
validValueAmt = 0;
|