Browse Source

template builder go on...

TonyKang 7 years ago
parent
commit
1fec3a9547

+ 43 - 14
modules/reports/rpt_component/helper/jpc_helper_area.js

@@ -8,29 +8,58 @@ let JpcAreaHelper = {
             let areaWidth = 1.0 * (band[JV.PROP_RIGHT] - band[JV.PROP_LEFT]) / multipleDispCol;
             areaWidth = areaWidth / colAmount;
             let innerLeft = 0.0, innerRight = areaWidth;
-            switch (areaNode[JV.PROP_H_CALCULATION]) {
-                case JV.CAL_TYPE[JV.CAL_TYPE_PERCENTAGE] :
+            //
+            if (typeof areaNode[JV.PROP_H_CALCULATION]  === "string") {
+                switch (areaNode[JV.PROP_H_CALCULATION]) {
+                    case JV.CAL_TYPE[JV.CAL_TYPE_PERCENTAGE] :
+                        innerLeft = (1.0 * areaNode[JV.PROP_LEFT] * areaWidth / JV.HUNDRED_PERCENT);
+                        innerRight = (1.0 * areaNode[JV.PROP_RIGHT] * areaWidth / JV.HUNDRED_PERCENT);
+                        break;
+                    case JV.CAL_TYPE[JV.CAL_TYPE_ABSTRACT] :
+                        innerLeft = 1.0 * areaNode[JV.PROP_LEFT] * unitFactor;
+                        innerRight = 1.0 * areaNode[JV.PROP_RIGHT] * unitFactor;
+                        break;
+                }
+            } else {
+                //颗粒度更加细化的控制,可能左右两边的计算坐标方式都不同
+                if (areaNode[JV.PROP_H_CALCULATION][JV.PROP_LEFT] === JV.CAL_TYPE[JV.CAL_TYPE_PERCENTAGE]) {
                     innerLeft = (1.0 * areaNode[JV.PROP_LEFT] * areaWidth / JV.HUNDRED_PERCENT);
-                    innerRight = (1.0 * areaNode[JV.PROP_RIGHT] * areaWidth / JV.HUNDRED_PERCENT) ;
-                    break;
-                case JV.CAL_TYPE[JV.CAL_TYPE_ABSTRACT] :
+                } else {
                     innerLeft = 1.0 * areaNode[JV.PROP_LEFT] * unitFactor;
-                    innerRight = 1.0 * areaNode[JV.PROP_RIGHT] * unitFactor ;
-                    break;
+                }
+                if (areaNode[JV.PROP_H_CALCULATION][JV.PROP_RIGHT] === JV.CAL_TYPE[JV.CAL_TYPE_PERCENTAGE]) {
+                    innerRight = (1.0 * areaNode[JV.PROP_RIGHT] * areaWidth / JV.HUNDRED_PERCENT);
+                } else {
+                    innerRight = 1.0 * areaNode[JV.PROP_RIGHT] * unitFactor;
+                }
             }
             //2. calculate top/bottom
             let  areaHeight = 1.0 * (band[JV.PROP_BOTTOM] - band[JV.PROP_TOP]);
             areaHeight = areaHeight / rowAmount;
             let innerTop = 0.0, innerBottom = areaHeight;
-            switch (areaNode[JV.PROP_V_CALCULATION]) {
-                case JV.CAL_TYPE[JV.CAL_TYPE_PERCENTAGE] :
+            if (typeof areaNode[JV.PROP_V_CALCULATION]  === "string") {
+                switch (areaNode[JV.PROP_V_CALCULATION]) {
+                    case JV.CAL_TYPE[JV.CAL_TYPE_PERCENTAGE] :
+                        innerTop = (1.0 * areaNode[JV.PROP_TOP] * areaHeight / JV.HUNDRED_PERCENT);
+                        innerBottom = (1.0 * areaNode[JV.PROP_BOTTOM] * areaHeight / JV.HUNDRED_PERCENT);
+                        break;
+                    case JV.CAL_TYPE[JV.CAL_TYPE_ABSTRACT] :
+                        innerTop = 1.0 * areaNode[JV.PROP_TOP] * unitFactor;
+                        innerBottom = 1.0 * areaNode[JV.PROP_BOTTOM] * unitFactor;
+                        break;
+                }
+            } else {
+                //颗粒度更加细化的控制,可能上下两边的计算坐标方式都不同
+                if (areaNode[JV.PROP_H_CALCULATION][JV.PROP_TOP] === JV.CAL_TYPE[JV.CAL_TYPE_PERCENTAGE]) {
                     innerTop = (1.0 * areaNode[JV.PROP_TOP] * areaHeight / JV.HUNDRED_PERCENT);
-                    innerBottom = (1.0 * areaNode[JV.PROP_BOTTOM] * areaHeight / JV.HUNDRED_PERCENT) ;
-                    break;
-                case JV.CAL_TYPE[JV.CAL_TYPE_ABSTRACT] :
+                } else {
                     innerTop = 1.0 * areaNode[JV.PROP_TOP] * unitFactor;
-                    innerBottom = 1.0 * areaNode[JV.PROP_BOTTOM] * unitFactor ;
-                    break;
+                }
+                if (areaNode[JV.PROP_H_CALCULATION][JV.PROP_BOTTOM] === JV.CAL_TYPE[JV.CAL_TYPE_PERCENTAGE]) {
+                    innerBottom = (1.0 * areaNode[JV.PROP_BOTTOM] * areaHeight / JV.HUNDRED_PERCENT);
+                } else {
+                    innerBottom = 1.0 * areaNode[JV.PROP_BOTTOM] * unitFactor;
+                }
             }
             //
             let rstLeft = 0.0, rstRight = 0.0, rstTop = 0.0, rstBottom = 0.0;

+ 7 - 3
web/maintain/report/js/cfg_const.js

@@ -183,7 +183,8 @@ let selectedFieldMapSetting = {
     },
     callback:{
         beforeDrag: dataInfoMapTreeOprObj.onBeforeDrag,
-        beforeDrop: dataInfoMapTreeOprObj.onBeforeDrop
+        beforeDrop: dataInfoMapTreeOprObj.onBeforeDrop,
+        onDrop: dataInfoMapTreeOprObj.onDrop
     }
 };
 
@@ -265,7 +266,9 @@ let rptDataInfoSetting = {
         onClick: dataInfoMapTreeOprObj.onTabDataClick,
         beforeRemove: dataInfoMapTreeOprObj.onBeforeRemove,
         beforeEditName: dataInfoMapTreeOprObj.beforeEditName,
-        onRemove: dataInfoMapTreeOprObj.onRemove
+        onRemove: dataInfoMapTreeOprObj.onRemove,
+        onRename: dataInfoMapTreeOprObj.onRename,
+        beforeDrag: function () { return false; }
         //,beforeDrop: dataInfoMapTreeOprObj.onBeforeDrop
     }
 };
@@ -348,7 +351,8 @@ let discreteFieldParamSetting = {
         onRemove: discreteFieldParamTreeOprObj.onRemove,
         onRename: discreteFieldParamTreeOprObj.onRename,
         beforeDrag: discreteFieldParamTreeOprObj.onBeforeDrag,
-        beforeDrop: discreteFieldParamTreeOprObj.onBeforeDrop
+        beforeDrop: dataInfoMapTreeOprObj.onBeforeDrop,
+        onDrop: dataInfoMapTreeOprObj.onDrop
     }
 };
 

+ 2 - 37
web/maintain/report/js/rpt_tpl_band.js

@@ -4,7 +4,6 @@ let bandTreeOprObj = {
     treeObj : null,
     currentNode: null,
     innerCounter: 1,
-    reportCfg: null,
     canTrickEvent: false,
     iniTree: function(rptTpl) {
         var me = this;
@@ -71,40 +70,6 @@ let bandTreeOprObj = {
 
         return rst;
     },
-    getReportTplCfg: function() {
-        let me = this, params = {};
-        params.userId = userID;
-        CommonAjax.postEx("report_tpl_api/getUserRptCfg", params, 20000, true, function(result){
-                me.reportCfg = result;
-                me.refreshRptCfgs();
-            }, null, null
-        );
-    },
-    refreshRptCfgs: function () {
-        let me = this;
-        if (me.reportCfg) {
-            me.reportCfg.borderArr = [];
-            for (let style of me.reportCfg.styles) {
-                me.reportCfg.borderArr.push(style.ID);
-                $("#borderStyles").append("<option value='" + style.ID + "'>" + style.CfgDispName + "</option>");
-            }
-        }
-        let pf = $("#pageFrequency");
-        pf.append("<option value='" + JV.PAGE_STATUS[0] + "'>每页</option>");
-        pf.append("<option value='" + JV.PAGE_STATUS[1] + "'>首页</option>");
-        pf.append("<option value='" + JV.PAGE_STATUS[2] + "'>尾页</option>");
-        pf.append("<option value='" + JV.PAGE_STATUS[3] + "'>章首页</option>");
-        pf.append("<option value='" + JV.PAGE_STATUS[4] + "'>章尾页</option>");
-        pf.append("<option value='" + JV.PAGE_STATUS[5] + "'>分组</option>");
-        pf.append("<option value='" + JV.PAGE_STATUS[6] + "'>交叉行尾页</option>");
-        pf.append("<option value='" + JV.PAGE_STATUS[7] + "'>交叉列尾页</option>");
-        let ba = $("#bandAlignment");
-        ba.append("<option value='" + JV.LAYOUT[0] + "'>上</option>");
-        ba.append("<option value='" + JV.LAYOUT[1] + "'>下</option>");
-        ba.append("<option value='" + JV.LAYOUT[2] + "'>左</option>");
-        ba.append("<option value='" + JV.LAYOUT[3] + "'>右</option>");
-        ba.append("<option value='" + JV.LAYOUT[4] + "'>填充</option>");
-    },
     createBandFromNode: function(node) {
         let me = this, rst = {};
         rst[JV.BAND_PROP_ALIGNMENT] = node[JV.BAND_PROP_ALIGNMENT];
@@ -190,7 +155,7 @@ let bandTreeOprObj = {
         me.canTrickEvent = false;
         //then refresh the band tab properties
         //边框样式borderStyles
-        $("#borderStyles ").get(0).selectedIndex = me.reportCfg.borderArr.indexOf(treeNode[JV.PROP_STYLE]);
+        $("#borderStyles").get(0).selectedIndex = rpt_tpl_cfg_helper.reportCfg.borderArr.indexOf(treeNode[JV.PROP_STYLE]);
         //边框合并
         $("#mergeBandBorder").get(0).checked = stringUtil.convertStrToBoolean(treeNode[JV.BAND_PROP_MERGE_BORDER]);
         //位置
@@ -231,7 +196,7 @@ let bandTreeOprObj = {
     bandStyleChange: function (dom) {
         let me = this;
         if (me.currentNode) {
-            me.currentNode[JV.PROP_STYLE] = me.reportCfg.borderArr[dom.selectedIndex];
+            me.currentNode[JV.PROP_STYLE] = rpt_tpl_cfg_helper.reportCfg.borderArr[dom.selectedIndex];
         }
     },
     bandAlignmentChange: function (dom) {

+ 88 - 0
web/maintain/report/js/rpt_tpl_cfg_helper.js

@@ -0,0 +1,88 @@
+/**
+ * Created by Tony on 2017/12/8.
+ */
+let rpt_tpl_cfg_helper = {
+    reportCfg: null,
+    getReportTplCfg: function() {
+        let me = this, params = {};
+        params.userId = userID;
+        CommonAjax.postEx("report_tpl_api/getUserRptCfg", params, 20000, true, function(result){
+                me.reportCfg = result;
+                me.refreshRptCfgs();
+            }, null, null
+        );
+    },
+    refreshRptCfgs: function () {
+        let me = this;
+        if (me.reportCfg) {
+            me.reportCfg.borderArr = [];
+            for (let style of me.reportCfg.styles) {
+                me.reportCfg.borderArr.push(style.ID);
+                $("#borderStyles").append("<option value='" + style.ID + "'>" + style.CfgDispName + "</option>");
+                $("#elementBorders").append("<option value='" + style.ID + "'>" + style.CfgDispName + "</option>");
+            }
+            me.reportCfg.fontArr = [];
+            for (let font of me.reportCfg.fonts) {
+                if (font.CfgDispName) {
+                    me.reportCfg.fontArr.push(font.ID);
+                    $("#elementFonts").append("<option value='" + font.ID + "'>" + font.CfgDispName + "</option>");
+                } else {
+                    me.reportCfg.fontArr.push("dummy font");
+                }
+            }
+            me.reportCfg.controlArr = [];
+            for (let control of me.reportCfg.ctrls) {
+                if (control.CfgDispName) {
+                    me.reportCfg.controlArr.push(control.ID);
+                    $("#elementControls").append("<option value='" + control.ID + "'>" + control.CfgDispName + "</option>");
+                } else {
+                    me.reportCfg.controlArr.push("dummy control");
+                }
+            }
+        }
+        //elementFonts
+        let pf = $("#pageFrequency");
+        pf.append("<option value='" + JV.PAGE_STATUS[0] + "'>每页</option>");
+        pf.append("<option value='" + JV.PAGE_STATUS[1] + "'>首页</option>");
+        pf.append("<option value='" + JV.PAGE_STATUS[2] + "'>尾页</option>");
+        pf.append("<option value='" + JV.PAGE_STATUS[3] + "'>章首页</option>");
+        pf.append("<option value='" + JV.PAGE_STATUS[4] + "'>章尾页</option>");
+        pf.append("<option value='" + JV.PAGE_STATUS[5] + "'>分组</option>");
+        pf.append("<option value='" + JV.PAGE_STATUS[6] + "'>交叉行尾页</option>");
+        pf.append("<option value='" + JV.PAGE_STATUS[7] + "'>交叉列尾页</option>");
+        let ba = $("#bandAlignment");
+        ba.append("<option value='" + JV.LAYOUT[0] + "'>上</option>");
+        ba.append("<option value='" + JV.LAYOUT[1] + "'>下</option>");
+        ba.append("<option value='" + JV.LAYOUT[2] + "'>左</option>");
+        ba.append("<option value='" + JV.LAYOUT[3] + "'>右</option>");
+        ba.append("<option value='" + JV.LAYOUT[4] + "'>填充</option>");
+    },
+    checkAndSetSelectedNodeCfg: function (treeNode) {
+        if (treeNode[JV.PROP_AREA]) {
+            $("#element_font")[0].style.display = "";
+            $("#element_border")[0].style.display = "";
+            $("#element_control")[0].style.display = "";
+        } else {
+            $("#element_font")[0].style.display = "none";
+            $("#element_border")[0].style.display = "none";
+            $("#element_control")[0].style.display = "none";
+        }
+    },
+    fontChange: function(dom) {
+        //
+    },
+    borderChange: function(dom) {
+        //
+    },
+    controlChange: function(dom) {
+        //
+    },
+    changeAlignment: function(dom, type) {
+        if (type === "horizon") {
+            //
+        } else {
+            //vertical
+        }
+    }
+
+};

+ 66 - 42
web/maintain/report/js/rpt_tpl_data_map.js

@@ -1,5 +1,6 @@
 /**
  * Created by Tony on 2017/10/5.
+ * 各种类型(flow/bill/cross)数据类型 + 离散
  */
 'use strict'
 
@@ -82,7 +83,7 @@ let dataInfoMapTreeOprObj = {
         discreteNode.items = [];
         for (let i = 0; i < discreteData.length; i++) {
             let dtl = discreteData[i];
-            let item = {"Name": "离散" + (i + 1), "items":[]};
+            let item = {"Name": "子项(所在区域:" + dtl[JV.PROP_BAND_NAME] + ")", "items":[]};
             item[JV.PROP_BAND_NAME] = dtl[JV.PROP_BAND_NAME];
             let discreteFieldsNode = {"Name": "离散字段集", "items": [], "isParent": true};
             let discreteTextsNode = {"Name": "离散文本集", "items": [], "isParent": true};
@@ -236,18 +237,34 @@ let dataInfoMapTreeOprObj = {
         return rst;
     },
 
+    private_setup_dummy_field_node: function(node) {
+        if (!node[JV.PROP_PARAM_ID]) {
+            node[JV.PROP_FIELD_ID] = node[JV.PROP_ID];
+        }
+        node[JV.PROP_FONT] = "Content";
+        node[JV.PROP_CONTROL] = "Default";
+        node[JV.PROP_STYLE] = "Default_None";
+        node[JV.PROP_AREA] = {};
+        node[JV.PROP_AREA][JV.PROP_LEFT] = 0;
+        node[JV.PROP_AREA][JV.PROP_RIGHT] = 100;
+        node[JV.PROP_AREA][JV.PROP_TOP] = 0;
+        node[JV.PROP_AREA][JV.PROP_BOTTOM] = 100;
+        node[JV.PROP_AREA][JV.PROP_H_CALCULATION] = JV.CAL_TYPE[0];
+        node[JV.PROP_AREA][JV.PROP_V_CALCULATION] = JV.CAL_TYPE[0];
+    },
+
     onTabDataClick: function (event,treeId,treeNode) {
         let me = dataInfoMapTreeOprObj, matchedBandNode = null;
-        let chked = false;
+        let bandChked = false;
         me.currentNode = treeNode;
         function checkBandNode(bNode, bandName) {
             if (bNode[JV.PROP_NAME] === bandName) {
-                chked = true;
+                bandChked = true;
                 matchedBandNode = bNode;
             } else if (bNode.items){
                 for (let subNode of bNode.items) {
                     checkBandNode(subNode, bandName);
-                    if (chked) {
+                    if (bandChked) {
                         break;
                     }
                 }
@@ -262,23 +279,27 @@ let dataInfoMapTreeOprObj = {
         if (treeNode[JV.PROP_BAND_NAME]) {
             for (let node of nodes) {
                 checkBandNode(node, treeNode[JV.PROP_BAND_NAME]);
-                if (chked) {
+                if (bandChked) {
                     break;
                 }
             }
         }
-        if (chked) {
+        if (bandChked) {
             setDisabledBandSelect(false);
             me.bandTreeObj.checkNode(matchedBandNode, true, true);
         } else {
             setDisabledBandSelect(true);
         }
+        //检测是否为field/param/text对象
+        rpt_tpl_cfg_helper.checkAndSetSelectedNodeCfg(treeNode);
     },
     onCheck: function (event,treeId,treeNode) {
         let me = dataInfoMapTreeOprObj;
         if (me.currentNode[JV.PROP_BAND_NAME] && me.currentNode[JV.PROP_BAND_NAME] !== treeNode[JV.PROP_NAME])  {
-            alert("change band from: " + me.currentNode[JV.PROP_BAND_NAME] + " to : " + treeNode[JV.PROP_NAME]);
+            // alert("change band from: " + me.currentNode[JV.PROP_BAND_NAME] + " to : " + treeNode[JV.PROP_NAME]);
             me.currentNode[JV.PROP_BAND_NAME] = treeNode[JV.PROP_NAME];
+            me.currentNode[JV.PROP_NAME] = "子项(所在区域:" + treeNode[JV.PROP_NAME] + ")";
+            me.treeObj.updateNode(me.currentNode);
         }
     },
     onBeforeRemove: function(treeId, treeNode){
@@ -314,28 +335,27 @@ let dataInfoMapTreeOprObj = {
     },
     onBeforeDrop: function(treeId, treeNodes, targetNode, moveType){
         let rst = false;
-        if (targetNode.tId && targetNode.tId.indexOf("tpl_data_info_reversed") >= 0 && (!(targetNode.isParent && moveType !== 'inner')) ) {
-            if (targetNode.level === 0) {
-                if (targetNode.Name !== JV.NODE_DISCRETE_INFO && moveType === 'inner') {
-                    rst = true;
-                }
-            } else {
-                let parentNode = targetNode.getParentNode();
-                if (parentNode.Name === "离散信息") {
-                    // if (targetNode.Name === "Fields") {
-                    //     rst = true;
-                    // }
-                }
-            }
+        if (targetNode.Name === JV.NODE_FLOW_CONTENT || targetNode.Name === JV.NODE_BILL_CONTENT || targetNode.Name === JV.NODE_CROSS_CONTENT
+            || targetNode.Name === JV.NODE_CROSS_ROW || targetNode.Name === JV.NODE_CROSS_COL
+            || targetNode.Name === "离散字段集" ) {
+            rst = true;
         }
         return rst;
     },
-    onRemove: function () {
-        //
+    onDrop: function(event, treeId, treeNodes, targetNode, moveType) {
+        let me = dataInfoMapTreeOprObj;
+        for (let node of treeNodes) {
+            me.private_setup_dummy_field_node(node);
+        }
     },
-    onRename: function () {
+    onRemove: function (e, treeId, treeNode) {
         //
     },
+    onRename: function (e, treeId, treeNode, isCancel) {
+        if (!isCancel) {
+            treeNode[JV.PROP_LABEL] = treeNode[JV.PROP_NAME];
+        }
+    },
     addHoverDom: function(treeId, treeNode) {
         let me = dataInfoMapTreeOprObj, sObj = $("#" + treeNode.tId + "_span");
         if (treeNode.editNameFlag || $("#addBtn_"+treeNode.tId).length > 0) {
@@ -348,7 +368,7 @@ let dataInfoMapTreeOprObj = {
                 btn.bind("click", function(){
                     let amtIdx = treeNode.items.length + 1;
                     let node = {};
-                    node[JV.PROP_NAME] = "离散" + amtIdx;
+                    node[JV.PROP_NAME] = "子项(所在区域:" + me.bandTreeObj.getNodes()[0][JV.PROP_NAME] + ")";
                     node[JV.PROP_BAND_NAME] = me.bandTreeObj.getNodes()[0][JV.PROP_NAME];
                     node.items = [];
                     let fields = {"Name": "离散字段集", "items": [], "isParent": true};
@@ -408,28 +428,32 @@ let dataInfoMapTreeOprObj = {
     },
     private_extract_discrete_info: function(discreteNode) {
         let me = this, rst = [];
-        for (let node of discreteNode) {
+        for (let dtlItemNode of discreteNode.items) {
             let newContent = {};
             rst.push(newContent);
-            newContent[JV.PROP_BAND_NAME] = node[JV.PROP_BAND_NAME];
-            if (node[JV.PROP_DISCRETE_FIELDS] && node[JV.PROP_DISCRETE_FIELDS].length > 0) {
-                newContent[JV.PROP_DISCRETE_FIELDS] = [];
-                for (let field of node[JV.PROP_DISCRETE_FIELDS]) {
-                    let item = {};
-                    newContent[JV.PROP_DISCRETE_FIELDS].push(item);
-                    if (field[JV.PROP_FIELD_ID]) {
-                        me.private_copy_field_properties(field, item);
-                    } else if (field[JV.PROP_PARAM_ID]) {
-                        me.private_copy_param_properties(field, item);
+            newContent[JV.PROP_BAND_NAME] = dtlItemNode[JV.PROP_BAND_NAME];
+            for (let node of dtlItemNode.items) {
+                // if (node[JV.PROP_DISCRETE_FIELDS] && node[JV.PROP_DISCRETE_FIELDS].length > 0) {
+                if (node[JV.PROP_NAME] === "离散字段集" && node.items.length > 0) {
+                    newContent[JV.PROP_DISCRETE_FIELDS] = [];
+                    for (let field of node.items) {
+                        let item = {};
+                        newContent[JV.PROP_DISCRETE_FIELDS].push(item);
+                        if (field[JV.PROP_FIELD_ID]) {
+                            me.private_copy_field_properties(field, item);
+                        } else if (field[JV.PROP_PARAM_ID]) {
+                            me.private_copy_param_properties(field, item);
+                        }
                     }
                 }
-            }
-            if (node[JV.PROP_TEXTS] && node[JV.PROP_TEXTS].length > 0) {
-                newContent[JV.PROP_TEXTS] = [];
-                for (let txt of node[JV.PROP_TEXTS]) {
-                    let item = {};
-                    newContent[JV.PROP_TEXTS].push(item);
-                    me.private_copy_text_properties(txt, item);
+                // if (node[JV.PROP_TEXTS] && node[JV.PROP_TEXTS].length > 0) {
+                if (node[JV.PROP_NAME] === "离散文本集" && node.items.length > 0) {
+                    newContent[JV.PROP_TEXTS] = [];
+                    for (let txt of node.items) {
+                        let item = {};
+                        newContent[JV.PROP_TEXTS].push(item);
+                        me.private_copy_text_properties(txt, item);
+                    }
                 }
             }
         }

+ 18 - 3
web/maintain/report/js/rpt_tpl_field_map.js

@@ -1,3 +1,9 @@
+/**
+ * Created by Tony on 2017/6/7.
+ * 各种指标处理对象
+ * 包括:可映射指标、报表已选指标集合、离散独立指标和参数
+ */
+
 'use strict'
 
 let fieldMapTreeOprObj = {
@@ -101,10 +107,10 @@ let fieldMapTreeOprObj = {
         }
         return rst;
     },
-    onRemove: function () {
+    onRemove: function (e, treeId, treeNode) {
         //
     },
-    onRename: function () {
+    onRename: function (e, treeId, treeNode, isCancel) {
         //
     },
     extractFieldMaps: function (rptTpl) {
@@ -203,6 +209,7 @@ let discreteFieldParamTreeOprObj = {
             for (let df of rptTpl[JV.NODE_NO_MAPPING_FIELDS]) {
                 let node = {};
                 node[JV.PROP_ID] = df[JV.PROP_ID];
+                node[JV.PROP_FIELD_ID] = df[JV.PROP_ID];
                 node[JV.PROP_NAME] = df[JV.PROP_NAME];
                 node[JV.PROP_DATA_TYPE] = df[JV.PROP_DATA_TYPE];
                 disFieldNode.items.push(node);
@@ -212,6 +219,7 @@ let discreteFieldParamTreeOprObj = {
             for (let dp of rptTpl[JV.NODE_DISCRETE_PARAMS]) {
                 let node = {};
                 node[JV.PROP_ID] = dp[JV.PROP_ID];
+                node[JV.PROP_PARAM_ID] = dp[JV.PROP_ID];
                 node[JV.PROP_NAME] = dp[JV.PROP_NAME];
                 node[JV.PROP_DATA_TYPE] = dp[JV.PROP_DATA_TYPE];
                 node[JV.PROP_DFT_VALUE] = dp[JV.PROP_DFT_VALUE];
@@ -248,7 +256,14 @@ let discreteFieldParamTreeOprObj = {
         return rst;
     },
     onBeforeDrag: function (treeId, treeNodes) {
-        //
+        let rst = true;
+        for (let node of treeNodes) {
+            if (node.level === 0) {
+                rst = false;
+                break;
+            }
+        }
+        return rst;
     },
     onBeforeDrop: function(treeId, treeNodes, targetNode, moveType){
         // let rst = false;

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

@@ -1,5 +1,7 @@
 /**
  * Created by Tony on 2017/6/7.
+ * 报表模板helper
+ * 管理:编办、工程类型等
  */
 let tplHelper = {
     createDftRptTpl: function(treeNode) {

+ 1 - 1
web/maintain/report/js/rpt_tpl_main.js

@@ -4,7 +4,7 @@ let rptTplObj = {
     iniPage: function() {
         zTreeOprObj.iniEngineerIdList();
         zTreeOprObj.getCompilationList();
-        bandTreeOprObj.getReportTplCfg();
+        rpt_tpl_cfg_helper.getReportTplCfg();
         selectableFiledTreeOprObj.iniTree();
         preview_util.drawBorder($("#tplCanvas")[0]);
     }

+ 86 - 0
web/maintain/report/rpt_tpl_detail.html

@@ -176,6 +176,92 @@
                                 </div>
                             </div>
                         </div>
+                        <div class="row" id="element_font">
+                            <div class="form-group col-md-3">
+                                <label>字体选择</label>
+                                <select class="form-control" id="elementFonts" onchange="rpt_tpl_cfg_helper.fontChange(this)"></select>
+                            </div>
+                            <div class="form-group col-md-2">
+                                <label>字体名称</label>
+                                <input class="form-control" id="eleFontName" value="" disabled>
+                            </div>
+                            <div class="form-group col-md-2">
+                                <label>字体大小</label>
+                                <input class="form-control input-sm" id="eleFontSize" type="number" value="12" step="1" min="6" max="56" disabled>
+                            </div>
+                            <div class="form-group col-md-5">
+                                <label></label>
+                                <div class="form-check">
+                                    <label class="form-check-label">
+                                        <input type="checkbox" class="form-check-input" id="eleFontBold" onchange="" disabled>
+                                        粗体
+                                    </label>&nbsp&nbsp
+                                    <label class="form-check-label">
+                                        <input type="checkbox" class="form-check-input" id="eleFontItalic" onchange="" disabled>
+                                        斜体
+                                    </label>&nbsp&nbsp
+                                    <label class="form-check-label">
+                                        <input type="checkbox" class="form-check-input" id="eleFontUnderline" onchange="" disabled>
+                                        下划线
+                                    </label>
+                                </div>
+                            </div>
+                        </div>
+                        <div class="row" id="element_border">
+                            <div class="form-group col-md-3">
+                                <label>边框样式</label>
+                                <select class="form-control" id="elementBorders" onchange="rpt_tpl_cfg_helper.borderChange(this)"></select>
+                            </div>
+                            <div class="form-group col-md-2">
+                                <label>左边</label>
+                                <input class="form-control input-sm" id="eleBorderLeft" type="number" value="1" step="1" min="0" max="3" disabled>
+                            </div>
+                            <div class="form-group col-md-2">
+                                <label>右边</label>
+                                <input class="form-control input-sm" id="eleBorderRight" type="number" value="1" step="1" min="0" max="3" disabled>
+                            </div>
+                            <div class="form-group col-md-2">
+                                <label>上边</label>
+                                <input class="form-control input-sm" id="eleBorderTop" type="number" value="1" step="1" min="0" max="3" disabled>
+                            </div>
+                            <div class="form-group col-md-2">
+                                <label>下边</label>
+                                <input class="form-control input-sm" id="eleBorderBottom" type="number" value="1" step="1" min="0" max="3" disabled>
+                            </div>
+                        </div>
+                        <div class="row" id="element_control">
+                            <div class="form-group col-md-3">
+                                <label>控制选择</label>
+                                <select class="form-control" id="elementControls" onchange="rpt_tpl_cfg_helper.controlChange(this)"></select>
+                            </div>
+                            <div class="form-group col-md-2">
+                                <label>横向对齐</label>
+                                <select class="form-control" id="elementAlignmentHorizon" onchange="rpt_tpl_cfg_helper.changeAlignment(this, 'horizon')" disabled></select>
+                            </div>
+                            <div class="form-group col-md-2">
+                                <label>纵向对齐</label>
+                                <select class="form-control" id="elementAlignmentVertical" onchange="rpt_tpl_cfg_helper.changeAlignment(this, 'vertical')" disabled></select>
+                            </div>
+                            <div class="form-group col-md-5">
+                                <label></label>
+                                <div class="form-check">
+                                    <label class="form-check-label">
+                                        <input type="checkbox" class="form-check-input" id="eleShrink" onchange="" disabled>
+                                        自动缩放
+                                    </label>&nbsp&nbsp
+                                    <label class="form-check-label">
+                                        <input type="checkbox" class="form-check-input" id="eleShowZero" onchange="" disabled>
+                                        显示0
+                                    </label>&nbsp&nbsp
+                                    <label class="form-check-label">
+                                        <input type="checkbox" class="form-check-input" id="eleAutoWrap" onchange="" disabled>
+                                        自动折行
+                                    </label>
+                                </div>
+                            </div>
+                        </div>
+                        <div class="row" id="element_area">
+                        </div>
                         <div class="form-group" id="dispRowHeight">
                             <label>显示行高度</label>
                             <select class="form-control"><option> </option></select>

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

@@ -74,6 +74,7 @@
     <script src="/lib/bootstrap/bootstrap.min.js"></script>
     <script src="/web/maintain/report/js/global.js"></script>
     <script src="/web/maintain/report/js/rpt_tpl_main.js"></script>
+    <script src="/web/maintain/report/js/rpt_tpl_cfg_helper.js"></script>
     <script src="/web/maintain/report/js/rpt_tpl_band.js"></script>
     <script src="/web/maintain/report/js/rpt_tpl_field_map.js"></script>
     <script src="/web/maintain/report/js/rpt_tpl_calculation.js"></script>