Explorar o código

Merge branch 'master' of http://smartcost.f3322.net:3000/SmartCost/YangHuOperation

zhongzewei %!s(int64=6) %!d(string=hai) anos
pai
achega
0a2c5b037c

+ 5 - 3
Dockerfile

@@ -1,14 +1,16 @@
 FROM operationbase:2.0
 
-WORKDIR /ConstructionOperation
+RUN mv /ConstructionOperation /YangHuOperation
 
-COPY . /ConstructionOperation
+WORKDIR /YangHuOperation
+
+COPY . /YangHuOperation
 
 RUN mkdir tmp
 
 RUN cnpm install
 
-EXPOSE 6080
+EXPOSE 2080
 
 ENV NODE_ENV=prod
 

+ 5 - 3
Dockerfile_pp

@@ -1,14 +1,16 @@
 FROM operationbase:2.0
 
-WORKDIR /ConstructionOperation
+RUN mv /ConstructionOperation /YangHuOperation
 
-COPY . /ConstructionOperation
+WORKDIR /YangHuOperation
+
+COPY . /YangHuOperation
 
 RUN mkdir tmp
 
 RUN cnpm install
 
-EXPOSE 6080
+EXPOSE 2080
 
 ENV NODE_ENV=pp
 

+ 4 - 2
Dockerfile_qa

@@ -1,8 +1,10 @@
 FROM operationbase:2.0
 
-WORKDIR /ConstructionOperation
+RUN mv /ConstructionOperation /YangHuOperation
 
-COPY .  /ConstructionOperation
+WORKDIR /YangHuOperation
+
+COPY . /YangHuOperation
 
 RUN mkdir tmp
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 3 - 3
config/config.js


+ 51 - 2
modules/reports/rpt_component/jpc_flow_tab.js

@@ -737,10 +737,59 @@ JpcFlowTabSrv.prototype.createNew = function(){
             vIdx.push([-1, JV.DISPLAY_VAL_TYPE_NORMAL, JV.BLANK_VALUE_INDEX]);
         }
         let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
+        // me.multiCols = 1 * rptTpl[JV.NODE_FLOW_INFO][JV.PROP_MULTI_COLUMN];
+        let newMultiCols = 1 * rptTpl[JV.NODE_FLOW_INFO][JV.PROP_MULTI_COLUMN];
         // 2.2 Column tab
-        rst = rst.concat(me.outputColumn(rptTpl, null, 1, 0, bands, unitFactor, 0));
+        let private_colone_cells = function(orgCells) {
+            let newRst = [];
+            let newCopyCells = [];
+            newCopyCells.push(orgCells);
+            if (newMultiCols > 1) {
+                let minX = 10000, maxX = -10;
+                for (let cell of orgCells) {
+                    if (minX > parseInt(cell[JV.PROP_AREA][JV.PROP_LEFT])) minX = cell[JV.PROP_AREA][JV.PROP_LEFT];
+                    if (maxX < parseInt(cell[JV.PROP_AREA][JV.PROP_RIGHT])) maxX = cell[JV.PROP_AREA][JV.PROP_RIGHT];
+                }
+                let newW = maxX - minX, newSegW = newW / newMultiCols;
+                for (let i = 1; i < newMultiCols; i++) {
+                    let cells = [];
+                    for (let cell of orgCells) {
+                        let copyCell = {Value: cell.Value, area: {}, font: cell[JV.PROP_FONT], control: cell[JV.PROP_CONTROL], style: cell[JV.PROP_STYLE]};
+                        cells.push(copyCell);
+                        copyCell[JV.PROP_AREA][JV.PROP_LEFT] = cell[JV.PROP_AREA][JV.PROP_LEFT];
+                        copyCell[JV.PROP_AREA][JV.PROP_RIGHT] = cell[JV.PROP_AREA][JV.PROP_RIGHT];
+                        copyCell[JV.PROP_AREA][JV.PROP_TOP] = cell[JV.PROP_AREA][JV.PROP_TOP];
+                        copyCell[JV.PROP_AREA][JV.PROP_BOTTOM] = cell[JV.PROP_AREA][JV.PROP_BOTTOM];
+                    }
+                    newCopyCells.push(cells);
+                }
+                for (let ci = 0; ci < newCopyCells.length; ci++) {
+                    for (let cCell of newCopyCells[ci]) {
+                        cCell[JV.PROP_AREA][JV.PROP_LEFT] = Math.round(minX + newSegW * ci + (cCell[JV.PROP_AREA][JV.PROP_LEFT] - minX) / newMultiCols);
+                        cCell[JV.PROP_AREA][JV.PROP_RIGHT] = Math.round(minX + newSegW * ci + (cCell[JV.PROP_AREA][JV.PROP_RIGHT] - minX) / newMultiCols);
+                    }
+                }
+            }
+            for (let cCells of newCopyCells) {
+                for (let dCell of cCells) {
+                    newRst.push(dCell);
+                }
+            }
+            return newRst;
+        };
+        let tmpColCells = me.outputColumn(rptTpl, null, 1, 0, bands, unitFactor, 0);
+        if (newMultiCols > 1) {
+            tmpColCells = private_colone_cells(tmpColCells);
+        }
+        rst = rst.concat(tmpColCells);
         // 2.1 Content-Tab
-        rst = rst.concat(me.outputPreviewContent(rptTpl, bands, unitFactor, controls, pageStatus, maxRowRec));
+        let tmpContentCells = me.outputPreviewContent(rptTpl, bands, unitFactor, controls, pageStatus, maxRowRec);
+        if (newMultiCols > 1) {
+            tmpContentCells = private_colone_cells(tmpContentCells);
+        } else {
+            // rst = rst.concat(me.outputPreviewContent(rptTpl, bands, unitFactor, controls, pageStatus, maxRowRec));
+        }
+        rst = rst.concat(tmpContentCells);
         // 2.3 Sum Seg
         rst = rst.concat(me.outputPreviewSegSum(rptTpl, bands, unitFactor, controls, pageStatus));
         // 2.4 Sum Page

+ 39 - 1
public/web/treeDataHelper.js

@@ -18,7 +18,7 @@ let tree_Data_Helper = {
             return tmpNodeRst;
         };
         let private_buildNodeData = function(parentItem, idArr, treeLevel, tbID) {
-            let iter = [], nextNode = private_getStartNode(idArr);
+            let iter = [], nextNode = private_getStartNode(idArr), pushedIds = [];
             while (nextNode !== null && nextNode !== undefined ) {
                 if (parentItem) {
                     parentItem[CHILDREN_NODE].push(nextNode);
@@ -26,6 +26,7 @@ let tree_Data_Helper = {
                     rst.push(nextNode);
                 }
                 iter.push(nextNode);
+                pushedIds.push(nextNode[NODE_ID]);
                 nextNode[TOP_BILL_ID] = tbID;
                 if (parentItem === null) {
                     nextNode[TOP_BILL_ID] = nextNode[NODE_ID];
@@ -40,7 +41,44 @@ let tree_Data_Helper = {
                 }
                 if (addLevel) nextNode[TREE_LEVEL] = treeLevel;
                 nextNode = tmpNodes[prefix + nextNode[NEXT_ID]];
+                if (nextNode === null || nextNode === undefined) {
+                    //备注: 考虑到实际数据的健壮性,有些节点会掉链子,需要用 parentItem[SUB_ID] 比对已经加上的节点,如发现加上的节点数量不够,那就得在这里补充上去
+                    if (parentItem) {
+                        if (parentItem[SUB_ID].length > iter.length) {
+                            for (let subId of parentItem[SUB_ID]) {
+                                if (pushedIds.indexOf(subId) < 0) {
+                                    let restNode = tmpNodes[prefix + subId];
+                                    if (addLevel) restNode[TREE_LEVEL] = treeLevel;
+                                    restNode[TOP_BILL_ID] = tbID;
+                                    parentItem[CHILDREN_NODE].push(restNode);
+                                    iter.push(restNode);
+                                }
+                            }
+                        }
+                    } else {
+                        if (idArr.length > iter.length) {
+                            for (let topId of idArr) {
+                                if (pushedIds.indexOf(topId) < 0) {
+                                    let restNode = tmpNodes[prefix + topId];
+                                    if (addLevel) restNode[TREE_LEVEL] = treeLevel;
+                                    restNode[TOP_BILL_ID] = restNode[NODE_ID];
+                                    if (restNode.flags && restNode.flags.length > 0) {
+                                        for (let flag of restNode.flags) {
+                                            if (flag.fieldName === "fixed") {
+                                                restNode[TOP_BILL_ID] = flag.flag;
+                                                break;
+                                            }
+                                        }
+                                    }
+                                    rst.push(restNode);
+                                    iter.push(restNode);
+                                }
+                            }
+                        }
+                    }
+                }
             }
+            pushedIds = [];
             for (let i = 0; i < iter.length; i++) {
                 let rtbID = tbID;
                 if (parentItem === null) {

+ 1 - 0
web/maintain/report/js/rpt_tpl_helper.js

@@ -85,6 +85,7 @@ let tplHelper = {
             }
             if (rptTpl[JV.NODE_FLOW_INFO]) {
                 $("#multiColCnt")[0].style.display = "";
+                $("#rptTplMultiCols")[0].value = rptTpl[JV.NODE_FLOW_INFO][JV.PROP_MULTI_COLUMN];
             } else {
                 $("#multiColCnt")[0].style.display = "none";
             }