فهرست منبع

html目录结构改变 + 模板update调整

TonyKang 6 سال پیش
والد
کامیت
2fb3911686
30فایلهای تغییر یافته به همراه569 افزوده شده و 222 حذف شده
  1. 3 2
      modules/reports/controllers/rpt_tpl_controller.js
  2. 1 1
      modules/reports/routes/report_router_operation.js
  3. 1 1
      modules/reports/routes/rpt_tpl_router.js
  4. 0 58
      modules/reports/rpt_component/jpc_flow_tab.js
  5. 0 0
      web/maintain/report/html/rpt_test.html
  6. 0 0
      web/maintain/report/html/rpt_tpl_detail.html
  7. 0 0
      web/maintain/report/html/rpt_tpl_detail_bands.html
  8. 0 0
      web/maintain/report/html/rpt_tpl_detail_calculation.html
  9. 8 38
      web/maintain/report/rpt_tpl_detail_field_location.html
  10. 0 0
      web/maintain/report/html/rpt_tpl_detail_info.html
  11. 0 0
      web/maintain/report/html/rpt_tpl_detail_mapping_fields.html
  12. 0 0
      web/maintain/report/html/rpt_tpl_detail_pre_handle.html
  13. 0 0
      web/maintain/report/html/rpt_tpl_detail_pre_handle_adddummy.html
  14. 0 0
      web/maintain/report/html/rpt_tpl_detail_pre_handle_adjust.html
  15. 0 0
      web/maintain/report/html/rpt_tpl_detail_pre_handle_filter.html
  16. 0 0
      web/maintain/report/html/rpt_tpl_detail_pre_handle_sort.html
  17. 0 0
      web/maintain/report/html/rpt_tpl_detail_pre_handle_summary.html
  18. 37 0
      web/maintain/report/html/rpt_tpl_detail_virtual_column.html
  19. 25 0
      web/maintain/report/html/rpt_tpl_detail_virtual_discrete.html
  20. 28 0
      web/maintain/report/html/rpt_tpl_detail_virtual_summary.html
  21. 2 0
      web/maintain/report/rpt_tpl_main.html
  22. 0 0
      web/maintain/report/html/rpt_tpl_popup.html
  23. 0 0
      web/maintain/report/html/rpt_tpl_preview.html
  24. 0 0
      web/maintain/report/html/rpt_tpl_script_text.html
  25. 0 0
      web/maintain/report/html/rpt_tpl_tree.html
  26. 21 3
      web/maintain/report/js/rpt_tpl_cfg_helper.js
  27. 3 1
      web/maintain/report/js/rpt_tpl_data_map.js
  28. 13 118
      web/maintain/report/js/rpt_tpl_field_location.js
  29. 121 0
      web/maintain/report/js/rpt_tpl_virtual_common.js
  30. 306 0
      web/maintain/report/js/rpt_tpl_virtual_summary.js

+ 3 - 2
modules/reports/controllers/rpt_tpl_controller.js

@@ -348,8 +348,9 @@ let mExport = {
     updateRptTpl: function (req, res) {
         let params = JSON.parse(req.body.params),
             rptTpl = JSON.parse(params.rptTpl);
-        let filter = {"ID": parseInt(rptTpl[JV.PROP_ID])};
-        RptTplModel.update(filter, rptTpl, function (err, rst) {
+        let filter = {"ID": parseInt(rptTpl[JV.PROP_ID])},
+            options = {"overwrite": true};
+        RptTplModel.update(filter, rptTpl, options, function (err, rst) {
             if (err) {
                 callback(req, res, true, 'The report template was updated failed!', false);
             } else {

+ 1 - 1
modules/reports/routes/report_router_operation.js

@@ -12,7 +12,7 @@ module.exports =function (app) {
             res.redirect('/login');
         }
         else {
-            res.render('maintain/report/rpt_test.html',
+            res.render('maintain/report/html/rpt_test.html',
                 {userAccount: req.session.userAccount,
                     userID: req.session.managerData.userID});
         }

+ 1 - 1
modules/reports/routes/rpt_tpl_router.js

@@ -10,7 +10,7 @@ module.exports = function (app) {
             res.redirect('/login');
         }
         else {
-            res.render('maintain/report/rpt_tpl_main.html',
+            res.render('maintain/report/html/rpt_tpl_main.html',
                 {   userAccount: req.session.managerData.username,
                     userID: req.session.managerData.userID,
                     LicenseKey:config.getLicenseKey(process.env.NODE_ENV)

+ 0 - 58
modules/reports/rpt_component/jpc_flow_tab.js

@@ -1124,25 +1124,17 @@ function combineAutoHeightCells(prepareObj, page, controls) {
                         if (mergeCell[JV.PROP_VALUE]) {
                             firstMergeCell[JV.PROP_VALUE] = firstMergeCell[JV.PROP_VALUE] + "|" + mergeCell[JV.PROP_VALUE];
                             validValueAmt++;
-                        } else {
-                            // firstMergeCell[JV.PROP_VALUE] = firstMergeCell[JV.PROP_VALUE] + "|" ;
                         }
                         rst.push(sameColCells[i].cellIdx); //记下Cell的位置,在函数外消除
                         //如果到了最后一条数据,得判断firstMergeCell是否满格(即数据是满的,有可能有些格数据也有折行但不是自动行高判断指标)
                         //不满格的cell的Vertical强制设置为 'center'
                         if (i === sameColCells.length - 1 && validValueAmt !== fullValidValueAmt) {
-                            // firstMergeCell[JV.PROP_CONTROL].Shrink = orgCtrl.Shrink;
-                            // firstMergeCell[JV.PROP_CONTROL].Wrap = "F";
-                            // firstMergeCell[JV.PROP_CONTROL].VerticalForExcel = null;
                             firstMergeCell[JV.PROP_CONTROL].VerticalForExcel = 'center';
                         }
                     } else {
                         //碰到新开始的自动行高行,判断原先的firstMergeCell是否满格(即数据是满的,有可能有些格数据也有折行但不是自动行高判断指标)
                         //不满格的cell的Vertical强制设置为 'center'
                         if (validValueAmt !== fullValidValueAmt) {
-                            // firstMergeCell[JV.PROP_CONTROL].Shrink = orgCtrl.Shrink;
-                            // firstMergeCell[JV.PROP_CONTROL].Wrap = "F";
-                            // firstMergeCell[JV.PROP_CONTROL].VerticalForExcel = null;
                             firstMergeCell[JV.PROP_CONTROL].VerticalForExcel = 'center';
                         }
                         firstMergeCell = sameColCells[i].cell;
@@ -1161,54 +1153,4 @@ function combineAutoHeightCells(prepareObj, page, controls) {
     return rst;
 }
 
-function combineAutoHeightCellsBk(prepareObj, page, controls) {
-    let rst = [];
-    if (prepareObj.cellsArr) {
-        //merge cells' value and area
-        //备注: 系统逻辑已经把Cell的顺序放好,无需再做排序。
-        for (let mergeKey in prepareObj.pageCellObj) {
-            let sameColCells = prepareObj.pageCellObj[mergeKey]; //左右位置相同的Cell先放在一起,统一处理
-            if (sameColCells.length > 1) {
-                let firstMergeCell = sameColCells[0].cell;
-                firstMergeCell[JV.PROP_STYLE] = firstMergeCell[JV.PROP_STYLE].slice(0, firstMergeCell[JV.PROP_STYLE].indexOf("_AutoHeightMerge"));
-                let orgCtrl = setupControl(firstMergeCell, controls);
-                let validValueAmt = 0;
-                for (let i = 1; i < sameColCells.length; i++) {
-                    let mergeCell = sameColCells[i].cell;
-                    if (mergeCell[JV.PROP_STYLE].indexOf("_AutoHeightMerge_Top") < 0) {
-                        //merge into the firstMergeCell!
-                        firstMergeCell[JV.PROP_AREA][JV.PROP_BOTTOM] = mergeCell[JV.PROP_AREA][JV.PROP_BOTTOM];
-                        firstMergeCell[JV.PROP_VALUE] = firstMergeCell[JV.PROP_VALUE] + "|" + mergeCell[JV.PROP_VALUE];
-                        if (mergeCell[JV.PROP_VALUE]) validValueAmt++;
-                        rst.push(sameColCells[i].cellIdx);
-                        if (i === sameColCells.length - 1 && validValueAmt === 0) {
-                            firstMergeCell[JV.PROP_CONTROL].Shrink = orgCtrl.Shrink;
-                            firstMergeCell[JV.PROP_CONTROL].Wrap = "F";
-                            firstMergeCell[JV.PROP_CONTROL].VerticalForExcel = null;
-                            // firstMergeCell[JV.PROP_CONTROL].VerticalForExcel = 'center';
-                        }
-                    } else {
-                        if (validValueAmt === 0) {
-                            firstMergeCell[JV.PROP_CONTROL].Shrink = orgCtrl.Shrink;
-                            firstMergeCell[JV.PROP_CONTROL].Wrap = "F";
-                            firstMergeCell[JV.PROP_CONTROL].VerticalForExcel = null;
-                            // firstMergeCell[JV.PROP_CONTROL].VerticalForExcel = 'center';
-                        }
-                        firstMergeCell = sameColCells[i].cell;
-                        firstMergeCell[JV.PROP_STYLE] = firstMergeCell[JV.PROP_STYLE].slice(0, firstMergeCell[JV.PROP_STYLE].indexOf("_AutoHeightMerge"));
-                        orgCtrl = setupControl(firstMergeCell, controls);
-                        validValueAmt = 0;
-                    }
-                }
-            }
-        }
-        rst.sort(function (i1, i2) {
-            return (i1 > i2)?1:-1;
-        });
-    }
-    // fsUtil.writeObjToFile(prepareObj, "D:/GitHome/ConstructionCost/tmp/afterMergeCellsPrepareObj_" + page + ".jsp");
-    // fsUtil.writeObjToFile(rst, "D:/GitHome/ConstructionCost/tmp/eliminateCells_" + page + ".jsp");
-    return rst;
-}
-
 module.exports = new JpcFlowTabSrv();

web/maintain/report/rpt_test.html → web/maintain/report/html/rpt_test.html


web/maintain/report/rpt_tpl_detail.html → web/maintain/report/html/rpt_tpl_detail.html


web/maintain/report/rpt_tpl_detail_bands.html → web/maintain/report/html/rpt_tpl_detail_bands.html


web/maintain/report/rpt_tpl_detail_calculation.html → web/maintain/report/html/rpt_tpl_detail_calculation.html


+ 8 - 38
web/maintain/report/rpt_tpl_detail_field_location.html

@@ -163,44 +163,14 @@
                     <input class="form-control" id="eleDftValue" value="" onkeyup="rpt_tpl_cfg_helper.changeDftValue(this)">
                 </div>
             </div>
-            <div class="row" id="element_visual_div" style="display: none">
-                <div class="input-group col-12">
-                    <div style="width:97%; height: 300px;">
-                        <h5>表栏</h5>
-                        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.applyColumnBack()">应用</button>
-                        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.restoreColumn()">恢复</button>
-                        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.addCol((zTreeOprObj.currentNode)?zTreeOprObj.currentNode.rptTpl:null)">新增列</button>
-                        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.deleteCol()">删除列</button>
-                        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.addRow()">新增行</button>
-                        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.deleteRow()">删除行</button>
-                        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.mergeCells()">合并单元格</button>
-                        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.dismergeCells()">拆解单元格</button>
-                        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.fitTheWidth(1.0)">X 1.0</button>
-                        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.fitTheWidth(1.5)">X 1.5</button>
-                        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.fitTheWidth(2.0)">X 2.0</button>
-                        <label id="id_column_setup_lbl" style="color:yellowgreen;font-weight:bold">...</label>
-                        <div style="height: 5px"></div>
-                        <div class='row' id="fieldControlDiv" style="cursor: not-allowed">
-                            <div class="form-group col-md-3">
-                                <label ><input type="radio" name="horizonOptions" id="hOptionLeft" onchange="fieldLocationOprObj.changeCtrl(this)" checked="true" disabled>左</label>&nbsp
-                                <label ><input type="radio" name="horizonOptions" id="hOptionCenter" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>中</label>&nbsp
-                                <label ><input type="radio" name="horizonOptions" id="hOptionRight" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>右</label>&nbsp&nbsp
-                                <label>|</label>&nbsp&nbsp
-                                <label style="display:none" ><input type="radio" name="verticalOptions" id="vOptionUp" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>上</label>
-                                <label ><input type="radio" name="verticalOptions" id="vOptionCenter" onchange="fieldLocationOprObj.changeCtrl(this)" checked="true" disabled>中</label>&nbsp
-                                <label ><input type="radio" name="verticalOptions" id="vOptionDown" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>下</label>
-                            </div>
-                            <div class="form-group col-md-2">
-                                <label style="display:none" class="form-check-label"><input type="checkbox" class="form-check-input" id="eleShrinkEx" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>自动缩放</label>
-                                <label style="display:none" class="form-check-label"><input type="checkbox" class="form-check-input" id="eleShowZeroEx" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>显示0</label>
-                                <label style="display:none" class="form-check-label"><input type="checkbox" class="form-check-input" id="eleAutoWrapEx" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>自动折行</label>
-                                <label class="form-check-label"><input type="checkbox" class="form-check-input" id="eleIsNarrowEx" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>窄体</label>&nbsp&nbsp
-                                <label class="form-check-label"><input type="checkbox" class="form-check-input" id="eleIsAutoHeightEx" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>自动行高</label>
-                            </div>
-                        </div>
-                        <div id="rptTplColumnWorkbook"></div>
-                    </div>
-                </div>
+            <div class="row" id="element_visual_div1" style="display: none">
+                <%include ./rpt_tpl_detail_virtual_column.html %>
+            </div>
+            <div class="row" id="element_visual_div2" style="display: none">
+                <%include ./rpt_tpl_detail_virtual_summary.html %>
+            </div>
+            <div class="row" id="element_visual_div3" style="display: none">
+                <%include ./rpt_tpl_detail_virtual_discrete.html %>
             </div>
         </div>
     </div>

web/maintain/report/rpt_tpl_detail_info.html → web/maintain/report/html/rpt_tpl_detail_info.html


web/maintain/report/rpt_tpl_detail_mapping_fields.html → web/maintain/report/html/rpt_tpl_detail_mapping_fields.html


web/maintain/report/rpt_tpl_detail_pre_handle.html → web/maintain/report/html/rpt_tpl_detail_pre_handle.html


web/maintain/report/rpt_tpl_detail_pre_handle_adddummy.html → web/maintain/report/html/rpt_tpl_detail_pre_handle_adddummy.html


web/maintain/report/rpt_tpl_detail_pre_handle_adjust.html → web/maintain/report/html/rpt_tpl_detail_pre_handle_adjust.html


web/maintain/report/rpt_tpl_detail_pre_handle_filter.html → web/maintain/report/html/rpt_tpl_detail_pre_handle_filter.html


web/maintain/report/rpt_tpl_detail_pre_handle_sort.html → web/maintain/report/html/rpt_tpl_detail_pre_handle_sort.html


web/maintain/report/rpt_tpl_detail_pre_handle_summary.html → web/maintain/report/html/rpt_tpl_detail_pre_handle_summary.html


+ 37 - 0
web/maintain/report/html/rpt_tpl_detail_virtual_column.html

@@ -0,0 +1,37 @@
+<div class="input-group col-12">
+    <div style="width:97%; height: 300px;">
+        <h5>表栏</h5>
+        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.applyColumnBack()">应用</button>
+        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.restoreColumn()">恢复</button>
+        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.addCol((zTreeOprObj.currentNode)?zTreeOprObj.currentNode.rptTpl:null)">新增列</button>
+        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.deleteCol()">删除列</button>
+        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.addRow()">新增行</button>
+        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.deleteRow()">删除行</button>
+        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.mergeCells()">合并单元格</button>
+        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.disMergeCells()">拆解单元格</button>
+        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.fitTheWidth(1.0)">X 1.0</button>
+        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.fitTheWidth(1.5)">X 1.5</button>
+        <button class="btn btn-primary btn-sm" onclick="fieldLocationOprObj.fitTheWidth(2.0)">X 2.0</button>
+        <label id="id_column_setup_lbl" style="color:yellowgreen;font-weight:bold">...</label>
+        <div style="height: 5px"></div>
+        <div class='row' id="fieldControlDiv" style="cursor: not-allowed">
+            <div class="form-group col-md-3">
+                <label ><input type="radio" name="horizonOptions" id="hOptionLeft" onchange="fieldLocationOprObj.changeCtrl(this)" checked="true" disabled>左</label>&nbsp
+                <label ><input type="radio" name="horizonOptions" id="hOptionCenter" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>中</label>&nbsp
+                <label ><input type="radio" name="horizonOptions" id="hOptionRight" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>右</label>&nbsp&nbsp
+                <label>|</label>&nbsp&nbsp
+                <label style="display:none" ><input type="radio" name="verticalOptions" id="vOptionUp" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>上</label>
+                <label ><input type="radio" name="verticalOptions" id="vOptionCenter" onchange="fieldLocationOprObj.changeCtrl(this)" checked="true" disabled>中</label>&nbsp
+                <label ><input type="radio" name="verticalOptions" id="vOptionDown" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>下</label>
+            </div>
+            <div class="form-group col-md-2">
+                <label style="display:none" class="form-check-label"><input type="checkbox" class="form-check-input" id="eleShrinkEx" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>自动缩放</label>
+                <label style="display:none" class="form-check-label"><input type="checkbox" class="form-check-input" id="eleShowZeroEx" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>显示0</label>
+                <label style="display:none" class="form-check-label"><input type="checkbox" class="form-check-input" id="eleAutoWrapEx" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>自动折行</label>
+                <label class="form-check-label"><input type="checkbox" class="form-check-input" id="eleIsNarrowEx" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>窄体</label>&nbsp&nbsp
+                <label class="form-check-label"><input type="checkbox" class="form-check-input" id="eleIsAutoHeightEx" onchange="fieldLocationOprObj.changeCtrl(this)" disabled>自动行高</label>
+            </div>
+        </div>
+        <div id="rptTplColumnWorkbook"></div>
+    </div>
+</div>

+ 25 - 0
web/maintain/report/html/rpt_tpl_detail_virtual_discrete.html

@@ -0,0 +1,25 @@
+<div class="input-group col-12">
+    <div style="width:97%; height: 300px;">
+        <h5>离散信息</h5>
+        <button class="btn btn-primary btn-sm" onclick="">应用</button>
+        <button class="btn btn-primary btn-sm" onclick="">恢复</button>
+        <button class="btn btn-primary btn-sm" onclick="">合并单元格</button>
+        <button class="btn btn-primary btn-sm" onclick="">拆解单元格</button>
+        <div style="height: 5px"></div>
+        <div class='row' id="discreteFieldControlDiv" style="cursor: not-allowed">
+            <div class="form-group col-md-3">
+                <label ><input type="radio" name="horizonOptions" id="hOptionLeftDiscrete" onchange="" checked="true" disabled>左</label>&nbsp
+                <label ><input type="radio" name="horizonOptions" id="hOptionCenterDiscrete" onchange="" disabled>中</label>&nbsp
+                <label ><input type="radio" name="horizonOptions" id="hOptionRightDiscrete" onchange="" disabled>右</label>&nbsp&nbsp
+                <label>|</label>&nbsp&nbsp
+                <label ><input type="radio" name="verticalOptions" id="vOptionUpDiscrete" onchange="" disabled>上</label>
+                <label ><input type="radio" name="verticalOptions" id="vOptionCenterDiscrete" onchange="" checked="true" disabled>中</label>&nbsp
+                <label ><input type="radio" name="verticalOptions" id="vOptionDownDiscrete" onchange="" disabled>下</label>
+            </div>
+            <div class="form-group col-md-2">
+                <label class="form-check-label"><input type="checkbox" class="form-check-input" id="eleIsNarrowDiscreteEx" onchange="" disabled>窄体</label>
+            </div>
+        </div>
+        <div id="rptTplDiscreteWorkbook"></div>
+    </div>
+</div>

+ 28 - 0
web/maintain/report/html/rpt_tpl_detail_virtual_summary.html

@@ -0,0 +1,28 @@
+<div class="input-group col-12">
+    <div style="width:97%; height: 300px;">
+        <h5>统计信息</h5>
+        <button class="btn btn-primary btn-sm" onclick="virtualSummaryOprObj.applySummaryBack()">应用</button>
+        <button class="btn btn-primary btn-sm" onclick="virtualSummaryOprObj.restoreSummary()">恢复</button>
+        <button class="btn btn-primary btn-sm" onclick="virtualSummaryOprObj.addRow()">新增行</button>
+        <button class="btn btn-primary btn-sm" onclick="virtualSummaryOprObj.deleteRow()">删除行</button>
+        <button class="btn btn-primary btn-sm" onclick="virtualSummaryOprObj.mergeCells()">合并单元格</button>
+        <button class="btn btn-primary btn-sm" onclick="virtualSummaryOprObj.disMergeCells()">拆解单元格</button>
+        <label id="id_summary_setup_lbl" style="color:yellowgreen;font-weight:bold">...</label>
+        <div style="height: 5px"></div>
+        <div class='row' id="sumFieldControlDiv" style="cursor: not-allowed">
+            <div class="form-group col-md-3">
+                <label ><input type="radio" name="horizonOptions" id="hOptionLeftSum" onchange="" checked="true" disabled>左</label>&nbsp
+                <label ><input type="radio" name="horizonOptions" id="hOptionCenterSum" onchange="" disabled>中</label>&nbsp
+                <label ><input type="radio" name="horizonOptions" id="hOptionRightSum" onchange="" disabled>右</label>&nbsp&nbsp
+                <label>|</label>&nbsp&nbsp
+                <label ><input type="radio" name="verticalOptions" id="vOptionUpSum" onchange="" disabled>上</label>
+                <label ><input type="radio" name="verticalOptions" id="vOptionCenterSum" onchange="" checked="true" disabled>中</label>&nbsp
+                <label ><input type="radio" name="verticalOptions" id="vOptionDownSum" onchange="" disabled>下</label>
+            </div>
+            <div class="form-group col-md-2">
+                <label class="form-check-label"><input type="checkbox" class="form-check-input" id="eleIsNarrowSumEx" onchange="" disabled>窄体</label>
+            </div>
+        </div>
+        <div id="rptTplSummaryWorkbook"></div>
+    </div>
+</div>

+ 2 - 0
web/maintain/report/rpt_tpl_main.html

@@ -92,7 +92,9 @@
     <script src="/web/maintain/report/js/rpt_tpl_calculation.js"></script>
     <script src="/web/maintain/report/js/rpt_tpl_helper.js"></script>
     <script src="/web/maintain/report/js/rpt_tpl_data_map.js"></script>
+    <script src="/web/maintain/report/js/rpt_tpl_virtual_common.js"></script>
     <script src="/web/maintain/report/js/rpt_tpl_field_location.js"></script>
+    <script src="/web/maintain/report/js/rpt_tpl_virtual_summary.js"></script>
     <script src="/web/maintain/report/js/rpt_tpl_pre_handle.js"></script>
     <script src="/web/maintain/report/js/cfg_const.js"></script>
     <script src="/web/maintain/report/js/rpt_tpl_preview_util.js"></script>

web/maintain/report/rpt_tpl_popup.html → web/maintain/report/html/rpt_tpl_popup.html


web/maintain/report/rpt_tpl_preview.html → web/maintain/report/html/rpt_tpl_preview.html


web/maintain/report/rpt_tpl_script_text.html → web/maintain/report/html/rpt_tpl_script_text.html


web/maintain/report/rpt_tpl_tree.html → web/maintain/report/html/rpt_tpl_tree.html


+ 21 - 3
web/maintain/report/js/rpt_tpl_cfg_helper.js

@@ -73,7 +73,9 @@ let rpt_tpl_cfg_helper = {
             $("#element_border")[0].style.display = "";
             $("#element_control")[0].style.display = "";
             $("#element_area_1")[0].style.display = "";
-            $("#element_visual_div")[0].style.display = "none";
+            $("#element_visual_div1")[0].style.display = "none";
+            $("#element_visual_div2")[0].style.display = "none";
+            $("#element_visual_div3")[0].style.display = "none";
             // $("#element_area_2")[0].style.display = "";
             if (treeNode[JV.PROP_FIELD_ID] || treeNode[JV.PROP_PARAM_ID]) {
                 $("#element_pre_suff")[0].style.display = "";
@@ -140,7 +142,9 @@ let rpt_tpl_cfg_helper = {
             $("#element_pre_suff")[0].style.display = "none";
             if (treeNode[JV.PROP_NAME] === JV.NODE_FLOW_COLUMN || treeNode[JV.PROP_NAME] === JV.NODE_FLOW_CONTENT) {
                 //一些可视化操作
-                $("#element_visual_div")[0].style.display = "";
+                $("#element_visual_div1")[0].style.display = "";
+                $("#element_visual_div2")[0].style.display = "none";
+                $("#element_visual_div3")[0].style.display = "none";
                 let columnParentNode = null;
                 let contentParentNode = null;
                 if (treeNode[JV.PROP_NAME] === JV.NODE_FLOW_CONTENT) {
@@ -153,8 +157,22 @@ let rpt_tpl_cfg_helper = {
                 let rptTpl = (zTreeOprObj.currentNode)?zTreeOprObj.currentNode.rptTpl:null;
                 fieldLocationOprObj.iniSpreadJs(columnParentNode, contentParentNode);
                 fieldLocationOprObj.setupColumn(rptTpl, columnParentNode, contentParentNode);
+            } else if (treeNode[JV.PROP_NAME].indexOf("统计信息") > 0) {
+                $("#element_visual_div1")[0].style.display = "none";
+                $("#element_visual_div2")[0].style.display = "";
+                $("#element_visual_div3")[0].style.display = "none";
+                let rptTpl = (zTreeOprObj.currentNode)?zTreeOprObj.currentNode.rptTpl:null;
+                virtualSummaryOprObj.iniSpreadJs(treeNode);
+                virtualSummaryOprObj.setupSummary(rptTpl, treeNode);
+
+            } else if (treeNode[JV.PROP_NAME] === `子项`) {
+                $("#element_visual_div1")[0].style.display = "none";
+                $("#element_visual_div2")[0].style.display = "none";
+                $("#element_visual_div3")[0].style.display = "";
             } else {
-                $("#element_visual_div")[0].style.display = "none";
+                $("#element_visual_div1")[0].style.display = "none";
+                $("#element_visual_div2")[0].style.display = "none";
+                $("#element_visual_div3")[0].style.display = "none";
             }
         }
     },

+ 3 - 1
web/maintain/report/js/rpt_tpl_data_map.js

@@ -26,7 +26,9 @@ let dataInfoMapTreeOprObj = {
         $("#element_area_1")[0].style.display = "none";
         // $("#element_area_2")[0].style.display = "none";
         $("#element_pre_suff")[0].style.display = "none";
-        $("#element_visual_div")[0].style.display = "none";
+        $("#element_visual_div1")[0].style.display = "none";
+        $("#element_visual_div2")[0].style.display = "none";
+        $("#element_visual_div3")[0].style.display = "none";
     },
     iniDataMap: function () {
         let me = this, bandList = bandTreeOprObj.copyBandList(false);

+ 13 - 118
web/maintain/report/js/rpt_tpl_field_location.js

@@ -36,30 +36,7 @@ let fieldLocationOprObj = {
     setupColumn: function (rptTpl, columnParentNode, contentParentNode) {
         let me = this, yPos = [], xPos = [];
         me.columnFieldCtrls = [];
-        let bandName = columnParentNode[JV.PROP_BAND_NAME];
-        let private_getBand = function(parentBand) {
-            let rst = null;
-            if (parentBand[JV.PROP_NAME] === bandName) {
-                rst = parentBand;
-            } else {
-                if (parentBand[JV.BAND_PROP_SUB_BANDS] && parentBand[JV.BAND_PROP_SUB_BANDS].length > 0) {
-                    for (let subBand of parentBand[JV.BAND_PROP_SUB_BANDS]) {
-                        rst = private_getBand(subBand);
-                        if (rst !== null) {
-                            break;
-                        }
-                    }
-                }
-            }
-            return rst;
-        };
-        let selectedBand;
-        for (let band of rptTpl[JV.NODE_BAND_COLLECTION]) {
-            selectedBand = private_getBand(band);
-            if (selectedBand !== null) {
-                break;
-            }
-        }
+        let selectedBand = virtualCommonOprObj.getBandEx(columnParentNode[JV.PROP_BAND_NAME], rptTpl);
         if (selectedBand !== null) {
             let sheet = me.columnWorkBook.getActiveSheet();
             sheet.suspendPaint();
@@ -83,10 +60,10 @@ let fieldLocationOprObj = {
             }
             if (columnParentNode.items && columnParentNode.items.length > 0) {
                 for (let itemNode of columnParentNode.items) {
-                    me.private_pushPos(itemNode, itemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_LEFT, bandW, xPos);
-                    me.private_pushPos(itemNode, itemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_RIGHT, bandW, xPos);
-                    me.private_pushPos(itemNode, itemNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_TOP, bandH, yPos);
-                    me.private_pushPos(itemNode, itemNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_BOTTOM, bandH, yPos);
+                    virtualCommonOprObj.pushPos(itemNode, itemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_LEFT, bandW, xPos);
+                    virtualCommonOprObj.pushPos(itemNode, itemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_RIGHT, bandW, xPos);
+                    virtualCommonOprObj.pushPos(itemNode, itemNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_TOP, bandH, yPos);
+                    virtualCommonOprObj.pushPos(itemNode, itemNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_BOTTOM, bandH, yPos);
                 }
 
                 sheet.setRowCount(yPos.length, GC.Spread.Sheets.SheetArea.viewport);
@@ -113,7 +90,7 @@ let fieldLocationOprObj = {
                     return (y1 - y2);
                 });
                 for (let contentItemNode of contentParentNode.items) {
-                    let idxCol = xPos.indexOf(me.private_getActPosEx(contentItemNode, contentItemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_LEFT, bandW, xPos));
+                    let idxCol = xPos.indexOf(virtualCommonOprObj.getActPosEx(contentItemNode, contentItemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_LEFT, bandW, xPos));
                     sheet.getCell(iSelectedRow, idxCol).value(contentItemNode[JV.PROP_NAME]);
                     me.private_merge_ctrl(rptTpl, idxCol, contentItemNode, null);
                 }
@@ -125,10 +102,10 @@ let fieldLocationOprObj = {
                     sheet.getRange(idx - 1, -1, 1, -1).backColor(undefined);
                 }
                 for (let itemNode of columnParentNode.items) {
-                    let idx1 = xPos.indexOf(me.private_getActPosEx(itemNode, itemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_LEFT, bandW, xPos));
-                    let idx2 = xPos.indexOf(me.private_getActPosEx(itemNode, itemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_RIGHT, bandW, xPos));
-                    let idy1 = yPos.indexOf(me.private_getActPosEx(itemNode, itemNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_TOP, bandH, yPos));
-                    let idy2 = yPos.indexOf(me.private_getActPosEx(itemNode, itemNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_BOTTOM, bandH, yPos));
+                    let idx1 = xPos.indexOf(virtualCommonOprObj.getActPosEx(itemNode, itemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_LEFT, bandW, xPos));
+                    let idx2 = xPos.indexOf(virtualCommonOprObj.getActPosEx(itemNode, itemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_RIGHT, bandW, xPos));
+                    let idy1 = yPos.indexOf(virtualCommonOprObj.getActPosEx(itemNode, itemNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_TOP, bandH, yPos));
+                    let idy2 = yPos.indexOf(virtualCommonOprObj.getActPosEx(itemNode, itemNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_BOTTOM, bandH, yPos));
                     if (idx2 - idx1 > 1 || idy2 - idy1 > 1) {
                         sheet.addSpan(idy1, idx1, idy2 - idy1, idx2 - idx1, GC.Spread.Sheets.SheetArea.viewport);
                     }
@@ -235,7 +212,7 @@ let fieldLocationOprObj = {
             }
         }
     },
-    dismergeCells: function () {
+    disMergeCells: function () {
         let me = fieldLocationOprObj,
             sheet = me.columnWorkBook.getActiveSheet();
         let selectedRanges = sheet.getSelections();
@@ -522,29 +499,6 @@ let fieldLocationOprObj = {
             }
         }
     },
-    private_getActPos: function (textNode, caclStr, typeStr, baseMea) {
-        let rst = 0;
-        if (caclStr === JV.CAL_TYPE[0]) {
-            //percentage
-            rst = Math.round(baseMea * textNode[JV.PROP_AREA][typeStr] / 100);
-        } else {
-            //abstract
-            rst = Math.round(textNode[JV.PROP_AREA][typeStr] / 2.54 * 96);
-        }
-        return rst;
-    },
-    private_getActPosEx: function (textNode, caclObj, typeStr, baseMea) {
-        let me = this;
-        if (typeof caclObj === 'string') {
-            return me.private_getActPos(textNode, caclObj, typeStr, baseMea);
-        } else {
-            return me.private_getActPos(textNode, caclObj[typeStr], typeStr, baseMea);
-        }
-    },
-    private_pushPos: function (textNode, caclObj, typeStr, baseMea, posArr) {
-        let me = this, pos = me.private_getActPosEx(textNode, caclObj, typeStr, baseMea);
-        if (posArr.indexOf(pos) < 0) posArr.push(pos);
-    },
     private_create_content_node: function (colWidthArr, cellValue, colIdx, rptTpl) {
         let me = this;
         let rst = {"Name": cellValue, "Title": '', "FieldID": -1, "font": "Content", "control": "Column", "style" : "Default_Normal", "isAutoHeight" : false,
@@ -621,75 +575,16 @@ let fieldLocationOprObj = {
         if (rptTpl && me.columnParentNode && me.contentParentNode && confirm(`请确认提交应用!`)) {
             let sheet = me.columnWorkBook.getActiveSheet();
             if (sheet.getRowCount() > 1 && sheet.getColumnCount() > 0) {
-                let spans= sheet.getSpans();
                 let texts = [], colWidthArr = [], rowHeightArr = [];
-                let private_build_pre_text = function (row, col, rowCount, colCount) {
-                    texts.push({"row": row, "col": col, "rowCount": rowCount, "colCount": colCount, "text": sheet.getValue(row, col)});
-                };
-                let private_chk_in_span = function (row, col) {
-                    let rst = false;
-                    for (let span of spans) {
-                        if (span.row <= row && row < (span.row + span.rowCount) && span.col <= col && col < (span.col + span.colCount)) {
-                            rst = true;
-                            break;
-                        }
-                    }
-                    return rst;
-                };
-                for (let span of spans) {
-                    private_build_pre_text(span.row, span.col, span.rowCount, span.colCount);
-                }
-                for (let iRow = 0; iRow < sheet.getRowCount() - 1; iRow++) {
-                    rowHeightArr.push(sheet.getRowHeight(iRow));
-                    if (iRow > 0) {
-                        rowHeightArr[iRow] = rowHeightArr[iRow] + rowHeightArr[iRow - 1];
-                    }
-                    for (let jCol = 0; jCol < sheet.getColumnCount(); jCol++) {
-                        if (iRow === 0) {
-                            colWidthArr.push(sheet.getColumnWidth(jCol));
-                            if (jCol > 0) {
-                                colWidthArr[jCol] = colWidthArr[jCol] + colWidthArr[jCol - 1];
-                            }
-                        }
-                        if (!private_chk_in_span(iRow, jCol)) {
-                            private_build_pre_text(iRow, jCol, 1, 1);
-                        }
-                    }
-                }
-                texts.sort(function(t1, t2){
-                    if (t1.col === t2.col) {
-                        return t1.row - t2.row;
-                    } else {
-                        return t1.col - t2.col;
-                    }
-                });
+                virtualCommonOprObj.collectSheetTxt(sheet, texts, colWidthArr, rowHeightArr);
                 let nodes = [];
-                let width = colWidthArr[colWidthArr.length - 1], height = rowHeightArr[rowHeightArr.length - 1];
                 //表栏重置
                 //0. 先清除原先所有的column text
                 dataInfoMapTreeOprObj.treeObj.removeChildNodes(me.columnParentNode);
                 //1. 需要重新设置columnBand的高度
                 //2. 重新生成text节点
                 for (let text of texts) {
-                    let node = dataInfoMapTreeOprObj.getDummyTextNode(me.columnParentNode);
-                    node[JV.PROP_AREA][JV.PROP_RIGHT] = (colWidthArr[text.col + text.colCount - 1] / width * 100).toFixed(2);
-                    if (text.col > 0) {
-                        node[JV.PROP_AREA][JV.PROP_LEFT] = (colWidthArr[text.col - 1] / width * 100).toFixed(2);
-                    } else {
-                        node[JV.PROP_AREA][JV.PROP_LEFT] = 0;
-                    }
-                    node[JV.PROP_AREA][JV.PROP_BOTTOM] = (rowHeightArr[text.row + text.rowCount - 1] / height * 100).toFixed(2);
-                    if (text.row > 0) {
-                        node[JV.PROP_AREA][JV.PROP_TOP] = (rowHeightArr[text.row - 1] / height * 100).toFixed(2);
-                    } else {
-                        node[JV.PROP_AREA][JV.PROP_TOP] = 0;
-                    }
-                    if (stringUtil.isEmptyString(text[`text`])) {
-                        node[JV.PROP_NAME] = '';
-                    } else {
-                        node[JV.PROP_NAME] = stringUtil.replaceAll(stringUtil.replaceAll(text[`text`].toString(), '\n', '|'), '\r', '');
-                    }
-                    node[JV.PROP_LABEL] = node[JV.PROP_NAME];
+                    let node = virtualCommonOprObj.createTxtNode(text, me.columnParentNode, colWidthArr, rowHeightArr);
                     nodes.push(node);
                 }
                 dataInfoMapTreeOprObj.treeObj.addNodes(me.columnParentNode, -1, nodes, true);

+ 121 - 0
web/maintain/report/js/rpt_tpl_virtual_common.js

@@ -0,0 +1,121 @@
+/**
+ * Created by Tony on 2018/9/4.
+ */
+
+let virtualCommonOprObj = {
+    getActPos: function (textNode, caclStr, typeStr, baseMea) {
+        let rst = 0;
+        if (caclStr === JV.CAL_TYPE[0]) {
+            //percentage
+            rst = Math.round(baseMea * textNode[JV.PROP_AREA][typeStr] / 100);
+        } else {
+            //abstract
+            rst = Math.round(textNode[JV.PROP_AREA][typeStr] / 2.54 * 96);
+        }
+        return rst;
+    },
+    getActPosEx: function (textNode, caclObj, typeStr, baseMea) {
+        let me = this;
+        if (typeof caclObj === 'string') {
+            return me.getActPos(textNode, caclObj, typeStr, baseMea);
+        } else {
+            return me.getActPos(textNode, caclObj[typeStr], typeStr, baseMea);
+        }
+    },
+    pushPos: function (textNode, caclObj, typeStr, baseMea, posArr) {
+        let me = this, pos = me.getActPosEx(textNode, caclObj, typeStr, baseMea);
+        if (posArr.indexOf(pos) < 0) posArr.push(pos);
+    },
+    getBandEx: function (bandName, rptTpl) {
+        let me = this, rst;
+        for (let band of rptTpl[JV.NODE_BAND_COLLECTION]) {
+            rst = me.getBand(bandName, band);
+            if (rst !== null) {
+                break;
+            }
+        }
+        return rst;
+    },
+    getBand: function (bandName, parentBand) {
+        let me = this, rst = null;
+        if (parentBand[JV.PROP_NAME] === bandName) {
+            rst = parentBand;
+        } else {
+            if (parentBand[JV.BAND_PROP_SUB_BANDS] && parentBand[JV.BAND_PROP_SUB_BANDS].length > 0) {
+                for (let subBand of parentBand[JV.BAND_PROP_SUB_BANDS]) {
+                    rst = me.getBand(bandName, subBand);
+                    if (rst !== null) {
+                        break;
+                    }
+                }
+            }
+        }
+        return rst;
+    },
+    checkInSpan: function (spans, row, col) {
+        let rst = false;
+        for (let span of spans) {
+            if (span.row <= row && row < (span.row + span.rowCount) && span.col <= col && col < (span.col + span.colCount)) {
+                rst = true;
+                break;
+            }
+        }
+        return rst;
+    },
+    createTxtNode: function (text, parentNode, colWidthArr, rowHeightArr) {
+        let width = colWidthArr[colWidthArr.length - 1], height = rowHeightArr[rowHeightArr.length - 1];
+        let rst = dataInfoMapTreeOprObj.getDummyTextNode(parentNode);
+        rst[JV.PROP_AREA][JV.PROP_RIGHT] = (colWidthArr[text.col + text.colCount - 1] / width * 100).toFixed(2);
+        if (text.col > 0) {
+            rst[JV.PROP_AREA][JV.PROP_LEFT] = (colWidthArr[text.col - 1] / width * 100).toFixed(2);
+        } else {
+            rst[JV.PROP_AREA][JV.PROP_LEFT] = 0;
+        }
+        rst[JV.PROP_AREA][JV.PROP_BOTTOM] = (rowHeightArr[text.row + text.rowCount - 1] / height * 100).toFixed(2);
+        if (text.row > 0) {
+            rst[JV.PROP_AREA][JV.PROP_TOP] = (rowHeightArr[text.row - 1] / height * 100).toFixed(2);
+        } else {
+            rst[JV.PROP_AREA][JV.PROP_TOP] = 0;
+        }
+        if (stringUtil.isEmptyString(text[`text`])) {
+            rst[JV.PROP_NAME] = '';
+        } else {
+            rst[JV.PROP_NAME] = stringUtil.replaceAll(stringUtil.replaceAll(text[`text`].toString(), '\n', '|'), '\r', '');
+        }
+        rst[JV.PROP_LABEL] = rst[JV.PROP_NAME];
+        return rst;
+    },
+    collectSheetTxt: function (sheet, texts, colWidthArr, rowHeightArr) {
+        let spans= sheet.getSpans();
+        let private_build_pre_text = function (row, col, rowCount, colCount) {
+            texts.push({"row": row, "col": col, "rowCount": rowCount, "colCount": colCount, "text": sheet.getValue(row, col)});
+        };
+        for (let span of spans) {
+            private_build_pre_text(span.row, span.col, span.rowCount, span.colCount);
+        }
+        for (let iRow = 0; iRow < sheet.getRowCount() - 1; iRow++) {
+            rowHeightArr.push(sheet.getRowHeight(iRow));
+            if (iRow > 0) {
+                rowHeightArr[iRow] = rowHeightArr[iRow] + rowHeightArr[iRow - 1];
+            }
+            for (let jCol = 0; jCol < sheet.getColumnCount(); jCol++) {
+                if (iRow === 0) {
+                    colWidthArr.push(sheet.getColumnWidth(jCol));
+                    if (jCol > 0) {
+                        colWidthArr[jCol] = colWidthArr[jCol] + colWidthArr[jCol - 1];
+                    }
+                }
+                if (!virtualCommonOprObj.checkInSpan(spans, iRow, jCol)) {
+                    private_build_pre_text(iRow, jCol, 1, 1);
+                }
+            }
+        }
+        texts.sort(function(t1, t2){
+            if (t1.col === t2.col) {
+                return t1.row - t2.row;
+            } else {
+                return t1.col - t2.col;
+            }
+        });
+    }
+}

+ 306 - 0
web/maintain/report/js/rpt_tpl_virtual_summary.js

@@ -0,0 +1,306 @@
+/**
+ * Created by Tony on 2018/9/4.
+ */
+
+let virtualSummaryOprObj = {
+    summaryWorkBook: null,
+    summaryParentNode: null,
+    iniSpreadJs: function (summaryParentNode) {
+        let me = this;
+        if (me.summaryWorkBook === null) {
+            me.summaryWorkBook = new GC.Spread.Sheets.Workbook($('#rptTplSummaryWorkbook')[0], {sheetCount: 1});
+            me.summaryWorkBook.options.tabStripVisible = false;
+            me.summaryWorkBook.options.allowCopyPasteExcelStyle = false;
+            me.summaryWorkBook.options.allowUserDragDrop = false;
+            me.summaryWorkBook.options.allowContextMenu = false;
+            let sheet = me.summaryWorkBook.getActiveSheet();
+            sheet.options.allowCellOverflow = false;
+            sheet.options.clipBoardOptions = GC.Spread.Sheets.ClipboardPasteOptions.values;
+            sheet.bind(GC.Spread.Sheets.Events.EnterCell, me.onCellEnter);
+        }
+        me.summaryParentNode = summaryParentNode;
+    },
+    restoreSummary: function () {
+        let me = this;
+        let rptTpl = (zTreeOprObj.currentNode)?zTreeOprObj.currentNode.rptTpl:null;
+        me.setupSummary(rptTpl, me.summaryParentNode);
+    },
+    setupSummary: function (rptTpl, summaryParentNode) {
+        let me = this, columnParentNode = null;
+        let selectedBand = virtualCommonOprObj.getBandEx(summaryParentNode[JV.PROP_BAND_NAME], rptTpl);
+        if (summaryParentNode && selectedBand) {
+            let preNode = summaryParentNode.getPreNode();
+            while (preNode) {
+                if (preNode[JV.PROP_NAME] === JV.NODE_FLOW_COLUMN) {
+                    columnParentNode = preNode;
+                    break;
+                } else {
+                    preNode = preNode.getPreNode();
+                }
+            }
+            let fieldNode = summaryParentNode.items[0], textNode = summaryParentNode.items[1];
+            if (columnParentNode) {
+                let yColumnPos = [], xPos = [], ySummaryPos = [0], xSummaryPos = [0];
+                let sheet = me.summaryWorkBook.getActiveSheet();
+                let columnBand = virtualCommonOprObj.getBandEx(columnParentNode[JV.PROP_BAND_NAME], rptTpl);
+                let bandH = Math.round(parseFloat(columnBand[JV.BAND_PROP_HEIGHT]) / 2.54 * 96);
+                let bandW = 700;
+                let pIdx = JV.PAGES_SIZE_STR.indexOf(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE]);
+                if (pIdx >= 0) {
+                    bandW = Math.round(JV.PAGES_SIZE[pIdx][0] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT])) /2.54*96 );
+                    if (rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] === JV.ORIENTATION_LANDSCAPE ||
+                        rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] === JV.ORIENTATION_LANDSCAPE_CHN) {
+                        bandW = Math.round(JV.PAGES_SIZE[pIdx][1] * 96 - (parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT]) + parseFloat(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT])) /2.54*96 );
+                    }
+                }
+                //1. 设置column位置(让用户知道位置,后期无需用户再调)
+                for (let itemNode of columnParentNode.items) {
+                    virtualCommonOprObj.pushPos(itemNode, itemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_LEFT, bandW, xPos);
+                    virtualCommonOprObj.pushPos(itemNode, itemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_RIGHT, bandW, xPos);
+                    virtualCommonOprObj.pushPos(itemNode, itemNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_TOP, bandH, yColumnPos);
+                    virtualCommonOprObj.pushPos(itemNode, itemNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_BOTTOM, bandH, yColumnPos);
+                }
+
+                sheet.setRowCount(yColumnPos.length - 1, GC.Spread.Sheets.SheetArea.colHeader);
+                sheet.setColumnCount(xPos.length - 1, GC.Spread.Sheets.SheetArea.viewport);
+                // sheet.clear();
+
+                xPos.sort(function(x1, x2){
+                    return (x1 - x2);
+                });
+                yColumnPos.sort(function(y1, y2){
+                    return (y1 - y2);
+                });
+                for (let idx = 1; idx < xPos.length; idx++) {
+                    sheet.setColumnWidth(idx - 1, xPos[idx] - xPos[idx - 1]);
+                }
+                for (let idx = 1; idx < yColumnPos.length; idx++) {
+                    sheet.setRowHeight(idx - 1, yColumnPos[idx] - yColumnPos[idx - 1]);
+                    sheet.getRange(idx - 1, -1, 1, -1).backColor(undefined);
+                }
+                for (let itemNode of columnParentNode.items) {
+                    let idx1 = xPos.indexOf(virtualCommonOprObj.getActPosEx(itemNode, itemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_LEFT, bandW, xPos));
+                    let idx2 = xPos.indexOf(virtualCommonOprObj.getActPosEx(itemNode, itemNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_RIGHT, bandW, xPos));
+                    let idy1 = yColumnPos.indexOf(virtualCommonOprObj.getActPosEx(itemNode, itemNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_TOP, bandH, yColumnPos));
+                    let idy2 = yColumnPos.indexOf(virtualCommonOprObj.getActPosEx(itemNode, itemNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_BOTTOM, bandH, yColumnPos));
+                    if (idx2 - idx1 > 1 || idy2 - idy1 > 1) {
+                        sheet.addSpan(idy1, idx1, idy2 - idy1, idx2 - idx1, GC.Spread.Sheets.SheetArea.colHeader);
+                    }
+                    me.private_setupCell(sheet.getCell(idy1, idx1, GC.Spread.Sheets.SheetArea.colHeader), rptTpl, itemNode);
+                }
+                //2. 设置已有的统计信息
+                let sumBandH = Math.round(parseFloat(selectedBand[JV.BAND_PROP_HEIGHT]) / 2.54 * 96);
+                for (let fNode of fieldNode.items) {
+                    virtualCommonOprObj.pushPos(fNode, fNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_LEFT, bandW, xSummaryPos);
+                    virtualCommonOprObj.pushPos(fNode, fNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_RIGHT, bandW, xSummaryPos);
+                    virtualCommonOprObj.pushPos(fNode, fNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_TOP, sumBandH, ySummaryPos);
+                    virtualCommonOprObj.pushPos(fNode, fNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_BOTTOM, sumBandH, ySummaryPos);
+                }
+                for (let tNode of textNode.items) {
+                    virtualCommonOprObj.pushPos(tNode, tNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_LEFT, bandW, xSummaryPos);
+                    virtualCommonOprObj.pushPos(tNode, tNode[JV.PROP_AREA][JV.PROP_H_CALCULATION], JV.PROP_RIGHT, bandW, xSummaryPos);
+                    virtualCommonOprObj.pushPos(tNode, tNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_TOP, sumBandH, ySummaryPos);
+                    virtualCommonOprObj.pushPos(tNode, tNode[JV.PROP_AREA][JV.PROP_V_CALCULATION], JV.PROP_BOTTOM, sumBandH, ySummaryPos);
+                }
+                sheet.setRowCount(ySummaryPos.length - 1, GC.Spread.Sheets.SheetArea.viewport);
+            }
+        }
+    },
+    addRow: function () {
+        let me = this,
+            sheet = me.summaryWorkBook.getActiveSheet();
+        sheet.addRows(sheet.getRowCount() - 1, 1);
+        let rc = sheet.getRowCount();
+        for (let cc = 0; cc < sheet.getColumnCount(); cc++) {
+            me.private_setupCellDft(sheet.getCell(rc - 2, cc));
+        }
+    },
+    deleteRow: function () {
+        let me = this,
+            sheet = me.summaryWorkBook.getActiveSheet(),
+            selectedRanges = sheet.getSelections()
+        ;
+        if (selectedRanges.length > 0) {
+            sheet.deleteRows(selectedRanges[0].row, 1);
+        }
+    },
+    onCellEnter: function (sender, args) {
+        let me = virtualSummaryOprObj,
+            sheet = me.summaryWorkBook.getActiveSheet();
+        if (args.row === sheet.getRowCount() - 1) {
+        } else {
+        }
+    },
+    mergeCells: function () {
+        let me = virtualSummaryOprObj,
+            sheet = me.summaryWorkBook.getActiveSheet();
+        let selectedRanges = sheet.getSelections();
+        if (selectedRanges.length > 0) {
+            sheet.suspendPaint();
+            sheet.addSpan(selectedRanges[0].row, selectedRanges[0].col, selectedRanges[0].rowCount, selectedRanges[0].colCount);
+            sheet.resumePaint();
+        }
+    },
+    disMergeCells: function () {
+        let me = virtualSummaryOprObj,
+            sheet = me.summaryWorkBook.getActiveSheet();
+        let selectedRanges = sheet.getSelections();
+        let spans =sheet.getSpans();
+        if (selectedRanges.length > 0 && spans.length > 0) {
+            let selectedSpans = [];
+            for(let i = 0; i < spans.length; i++)
+            {
+                for (let j = 0; j < selectedRanges.length; j++) {
+                    if (spans[i].row >= selectedRanges[j].row && spans[i].col >= selectedRanges[j].col &&
+                        spans[i].row <= selectedRanges[j].row + selectedRanges[j].rowCount && spans[i].col <= selectedRanges[j].col + selectedRanges[j].colCount) {
+                        selectedSpans.push(spans[i]);
+                    }
+                }
+            }
+            for (let span of selectedSpans) {
+                sheet.removeSpan(span.row, span.col, GC.Spread.Sheets.SheetArea.viewport);
+            }
+        }
+    },
+    changeCtrl: function (dom) {
+        let me = virtualSummaryOprObj,
+            sheet = me.summaryWorkBook.getActiveSheet()
+        ;
+        let selectedRanges = sheet.getSelections();
+        for(let i = 0; i < selectedRanges.length; i++){
+            //         let ctrl = me.columnFieldCtrls[selectedRanges[i].col]
+            //         ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_SHRINK]] = 'F';
+            //         ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_SHOW_ZERO]] = 'F';
+            //         ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_WRAP]] = 'F';
+            //         ctrl.isNarrow = false;
+            //         ctrl.isAutoHeight = false;
+            //         if ($("#eleShrinkEx")[0].checked) {
+            //             ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_SHRINK]] = 'T';
+            //         }
+            //         if ($("#eleShowZeroEx")[0].checked) {
+            //             ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_SHOW_ZERO]] = 'T';
+            //         }
+            //         if ($("#eleAutoWrapEx")[0].checked) {
+            //             ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_WRAP]] = 'T';
+            //         }
+            //         if ($("#eleIsNarrowEx")[0].checked) {
+            //             ctrl.isNarrow = true;
+            //         }
+            //         if ($("#eleIsAutoHeightEx")[0].checked) {
+            //             ctrl.isAutoHeight = true;
+            //         }
+            //
+            //         if ($("#hOptionLeft")[0].checked) {
+            //             ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_HORIZON]] = JV.OUTPUT_ALIGN.H[0];
+            //         } else if ($("#hOptionCenter")[0].checked) {
+            //             ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_HORIZON]] = JV.OUTPUT_ALIGN.H[1];
+            //         } else {
+            //             ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_HORIZON]] = JV.OUTPUT_ALIGN.H[2];
+            //         }
+            //         if ($("#vOptionUp")[0].checked) {
+            //             ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_VERTICAL]] = JV.OUTPUT_ALIGN.V[0];
+            //         } else if ($("#vOptionCenter")[0].checked) {
+            //             ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_VERTICAL]] = JV.OUTPUT_ALIGN.V[1];
+            //         } else {
+            //             ctrl[JV.CONTROL_PROPS[JV.CONTROL_PROP_IDX_VERTICAL]] = JV.OUTPUT_ALIGN.V[2];
+            //         }
+        }
+    },
+
+    private_setupCellDft: function (cell) {
+        cell.font(`9pt 宋体`);
+        cell.hAlign(GC.Spread.Sheets.HorizontalAlign.center);
+        cell.vAlign(GC.Spread.Sheets.VerticalAlign.center);
+        cell.wordWrap(true);
+        cell.value(``);
+    },
+    private_setupCell: function (cell, rptTpl, textNode) {
+        let me = this;
+        me.private_setCellFont(cell, textNode);
+        me.private_setCellControl(cell, textNode);
+        me.private_setCellStyle(cell, textNode);
+        let value = textNode[JV.PROP_NAME];
+        if (textNode[JV.PROP_NAME].indexOf(`|`) >= 0) {
+            value = textNode[JV.PROP_NAME].split('|').join('\n');
+        }
+        cell.wordWrap(true);
+        cell.value(value);
+    },
+
+    private_setCellControl: function (cell, textNode) {
+        let ctrl = null;
+        if (typeof textNode[JV.PROP_CONTROL] === 'string') {
+            let idx = rpt_tpl_cfg_helper.reportCfg.controlArr.indexOf(textNode[JV.PROP_CONTROL]);
+            ctrl = rpt_tpl_cfg_helper.reportCfg.ctrls[idx];
+        } else {
+            ctrl = textNode[JV.PROP_CONTROL];
+        }
+        if (ctrl) {
+            switch (ctrl.Horizon) {
+                case `center`:
+                    cell.hAlign(GC.Spread.Sheets.HorizontalAlign.center);
+                    break;
+                case `right`:
+                    cell.hAlign(GC.Spread.Sheets.HorizontalAlign.right);
+                    break;
+                default:
+                    cell.hAlign(GC.Spread.Sheets.HorizontalAlign.left);
+                    break;
+            }
+            switch (ctrl.Vertical) {
+                case `center`:
+                    cell.vAlign(GC.Spread.Sheets.VerticalAlign.center);
+                    break;
+                case `bottom`:
+                    cell.vAlign(GC.Spread.Sheets.VerticalAlign.bottom);
+                    break;
+                default:
+                    cell.vAlign(GC.Spread.Sheets.VerticalAlign.top);
+                    break;
+            }
+        }
+    },
+    private_setCellStyle: function (cell, textNode) {
+        //默认是normal,暂时不管
+    },
+    private_setCellFont: function (cell, textNode) {
+        for (let font of rpt_tpl_cfg_helper.reportCfg.fonts) {
+            if (font.ID === textNode[JV.PROP_FONT]) {
+                cell.font(Math.round(font[JV.FONT_PROPS[JV.FONT_PROP_IDX_HEIGHT]] * 3 / 4) + 'pt ' + font[JV.FONT_PROPS[JV.FONT_PROP_IDX_NAME]]);
+                break;
+            }
+        }
+    },
+
+    applySummaryBack: function () {
+        let me = this;
+        let rptTpl = (zTreeOprObj.currentNode)?zTreeOprObj.currentNode.rptTpl:null;
+        if (rptTpl && me.summaryParentNode) {
+            let sheet = me.summaryWorkBook.getActiveSheet();
+            let rAmt = sheet.getRowCount(), pixH = [0];
+            if (rAmt > 0) {
+                let texts = [], colWidthArr = [], rowHeightArr = [];
+                virtualCommonOprObj.collectSheetTxt(sheet, texts, colWidthArr, rowHeightArr);
+                for (let node of summaryParentNode.items) {
+                    dataInfoMapTreeOprObj.treeObj.removeChildNodes(node);
+                }
+                let txtNodes = [], fieldNodes = [];
+                for (let text of texts) {
+                    if (!stringUtil.isEmptyString(text[`text`]) && text[`text`].indexOf(`{`) === 0) {
+                        //创建指标
+                    } else {
+                        //创建文本
+                        let node = virtualCommonOprObj.createTxtNode(text, me.columnParentNode, colWidthArr, rowHeightArr);
+                        txtNodes.push(node);
+                    }
+                }
+                //....
+                let selectedBand = virtualCommonOprObj.getBandEx(summaryParentNode[JV.PROP_BAND_NAME], rptTpl);
+                selectedBand[JV.BAND_PROP_HEIGHT] = (rowHeightArr[rowHeightArr.length - 1] / 96 * 2.54).toFixed(2);
+            } else {
+                displayMessage("模板行数量不足!", "red", 2000, "id_summary_setup_lbl");
+            }
+        }
+    }
+
+};