Browse Source

fix: 报表模板预处理新增 绑定含量指标定制表模板

lishihao 6 months ago
parent
commit
b49e564813

+ 15 - 0
modules/all_models/costIndexReport.js

@@ -0,0 +1,15 @@
+var mongoose = require("mongoose");
+var Schema = mongoose.Schema;
+var costIndexReportSchema = new Schema(
+  {
+    _id: String,
+    compilationID: String,
+    type: String,
+    aidReportID: String,
+    aidReportName: String,
+    colData: [Schema.Types.Mixed],
+    data: [Schema.Types.Mixed],
+  },
+  { versionKey: false }
+);
+mongoose.model("costIndexReport", costIndexReportSchema, "costIndexReport");

+ 467 - 376
modules/reports/controllers/rpt_tpl_controller.js

@@ -7,11 +7,12 @@ import mongoose from "mongoose";
 import async from "async";
 import counter from "../../../public/counter/counter";
 
-let RptTplModel = mongoose.model('rpt_templates');
-let TreeNodeModel = mongoose.model('rpt_tpl_tree');
-let rptExtCodeModel = mongoose.model('rpt_ext_code_tpl');
+let RptTplModel = mongoose.model("rpt_templates");
+let TreeNodeModel = mongoose.model("rpt_tpl_tree");
+let rptExtCodeModel = mongoose.model("rpt_ext_code_tpl");
 
 let rptCustCfgFacade = require("../facade/rpt_cust_cfg_facade");
+let costIndexModel = mongoose.model("costIndexReport");
 
 import JV from "../rpt_component/jpc_value_define";
 import rttFacade from "../facade/rpt_tpl_tree_node_facade";
@@ -19,401 +20,491 @@ import CompilationModel from "../../users/models/compilation_model";
 
 //统一回调函数
 let callback = function (req, res, err, message, data) {
-    res.json({ error: err, message: message, data: data });
+  res.json({ error: err, message: message, data: data });
 };
 
 let mExport = {
-    getCustomerCfg: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            userId = params.userId,
-            me = this;
-        ;
-        if (req.session.sessionUser && req.session.sessionUser.id) userId = req.session.sessionUser.id;
-        let userIds = [];
-        userIds.push(userId);
-        if (userId !== "-100") {
-            userIds.push("-100");
-        }
-        rptCustCfgFacade.getCustomizeCfg(userIds).then(function (custCfg) {
-            if (custCfg) {
-                //success
-                let rst = null;
-                if (custCfg.length > 0) {
-                    rst = [];
-                    rst.push(null);
-                    for (let itemCfg of custCfg) {
-                        // rst = itemCfg;
-                        let doc = (itemCfg._doc) ? itemCfg._doc : itemCfg;
-                        let dest = {};
-                        copyRptCfg(doc, dest);
-                        if (doc.userId !== "-100") {
-                            rst.push(dest);
-                        } else {
-                            rst[0] = dest;
-                        }
-                    }
-                }
-                if (rst !== null && rst.length === 1) {
-                    //copy dft config
-                    let userDest = {};
-                    copyRptCfg(rst[0], userDest);
-                    rst.push(userDest);
-                }
-                callback(req, res, false, "", rst);
-            } else {
-                //failed
-                callback(req, res, true, "失败!", null);
-            }
-        })
-    },
-    saveCustomerCfg: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            userId = params.userId,
-            custCfg = params.custCfg;
-        ;
-        if (req.session.sessionUser && req.session.sessionUser.id) userId = req.session.sessionUser.id;
-        custCfg.userId = userId;
-        rptCustCfgFacade.saveCustomizeCfg(custCfg).then(function (rst) {
-            if (rst) {
-                //success
-                callback(req, res, false, "", "success!");
-            } else {
-                //failed
-                callback(req, res, true, "更新失败!", null);
-            }
-        })
-    },
-    getDftTemplates: function (req, res) {
-        let filter = { "userId": "-100", "$or": [{ "isDeleted": null }, { "isDeleted": false }] };
-        TreeNodeModel.find(filter, '-_id', function (err, data) {
-            if (err) {
-                callback(req, res, true, "", null);
-            } else {
-                callback(req, res, false, "", data);
-            }
-        });
-    },
-    getExtCodeTpl: function (req, res) {
-        rptExtCodeModel.find({}).exec().then(function (rstCodeTpl) {
-            if (rstCodeTpl) {
-                callback(req, res, false, "", rstCodeTpl);
+  getCustomerCfg: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      userId = params.userId,
+      me = this;
+    if (req.session.sessionUser && req.session.sessionUser.id)
+      userId = req.session.sessionUser.id;
+    let userIds = [];
+    userIds.push(userId);
+    if (userId !== "-100") {
+      userIds.push("-100");
+    }
+    rptCustCfgFacade.getCustomizeCfg(userIds).then(function (custCfg) {
+      if (custCfg) {
+        //success
+        let rst = null;
+        if (custCfg.length > 0) {
+          rst = [];
+          rst.push(null);
+          for (let itemCfg of custCfg) {
+            // rst = itemCfg;
+            let doc = itemCfg._doc ? itemCfg._doc : itemCfg;
+            let dest = {};
+            copyRptCfg(doc, dest);
+            if (doc.userId !== "-100") {
+              rst.push(dest);
             } else {
-                callback(req, res, 'The report template was not found!', null);
+              rst[0] = dest;
             }
-        })
-    },
-    async getCompilationList(req, res) {
-        let compilationModel = new CompilationModel();
-        // let compilationList = await compilationModel.getPermissionCompilationList(req);
-        let compilationList = await compilationModel.getCompilationList();
-        console.log(compilationList);
-        if (compilationList) {
-            // console.log(compilationList);
-            // compilationList.then(function (rst) {
-            //     console.log(rst);
-            //     callback(req, res, false, "", rst);
-            // })
-            callback(req, res, false, "", compilationList);
-        } else {
-            callback(req, res, true, "no result", null);
+          }
         }
-    },
-    getRptTplTree: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            compilationId = params.compilationId,
-            userId = params.userId,
-            sessionUserId = null;
-        let userIds = ["-100"];
-        if (req.session.sessionUser && req.session.sessionUser.id) sessionUserId = req.session.sessionUser.id;
-        if (userId !== null) {
-            if (typeof userId === "string") {
-                if (userIds.indexOf(userId) < 0) userIds.push(userId);
-            } else if (userId instanceof Array) {
-                for (let uid of userId) {
-                    userIds.push(uid);
-                }
-            }
-        } else {
+        if (rst !== null && rst.length === 1) {
+          //copy dft config
+          let userDest = {};
+          copyRptCfg(rst[0], userDest);
+          rst.push(userDest);
         }
-        if (sessionUserId && userIds.indexOf(sessionUserId) < 0) userIds.push(sessionUserId);
-        if (!compilationId) {
-            compilationId = req.session.sessionCompilation._id;
+        callback(req, res, false, "", rst);
+      } else {
+        //failed
+        callback(req, res, true, "失败!", null);
+      }
+    });
+  },
+  saveCustomerCfg: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      userId = params.userId,
+      custCfg = params.custCfg;
+    if (req.session.sessionUser && req.session.sessionUser.id)
+      userId = req.session.sessionUser.id;
+    custCfg.userId = userId;
+    rptCustCfgFacade.saveCustomizeCfg(custCfg).then(function (rst) {
+      if (rst) {
+        //success
+        callback(req, res, false, "", "success!");
+      } else {
+        //failed
+        callback(req, res, true, "更新失败!", null);
+      }
+    });
+  },
+  getDftTemplates: function (req, res) {
+    let filter = {
+      userId: "-100",
+      $or: [{ isDeleted: null }, { isDeleted: false }],
+    };
+    TreeNodeModel.find(filter, "-_id", function (err, data) {
+      if (err) {
+        callback(req, res, true, "", null);
+      } else {
+        callback(req, res, false, "", data);
+      }
+    });
+  },
+  getExtCodeTpl: function (req, res) {
+    rptExtCodeModel
+      .find({})
+      .exec()
+      .then(function (rstCodeTpl) {
+        if (rstCodeTpl) {
+          callback(req, res, false, "", rstCodeTpl);
+        } else {
+          callback(req, res, "The report template was not found!", null);
         }
-        rttFacade.findTplTree(compilationId, userIds).then(function (result) {
-            if (result) {
-                callback(req, res, false, "", result);
-            } else {
-                callback(req, res, true, "no result", null);
-            }
-        });
-    },
-    getTplTreeByCompilation: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            compilationId = params.compilationId;
-        // if (req.session.sessionUser && req.session.sessionUser.id) sessionUserId = req.session.sessionUser.id;
-        console.log(params);
-        if (!compilationId) {
-            console.log(req.session.sessionCompilation);
-            compilationId = req.session.sessionCompilation._id;
+      });
+  },
+  async getCompilationList(req, res) {
+    let compilationModel = new CompilationModel();
+    // let compilationList = await compilationModel.getPermissionCompilationList(req);
+    let compilationList = await compilationModel.getCompilationList();
+    console.log(compilationList);
+    if (compilationList) {
+      // console.log(compilationList);
+      // compilationList.then(function (rst) {
+      //     console.log(rst);
+      //     callback(req, res, false, "", rst);
+      // })
+      callback(req, res, false, "", compilationList);
+    } else {
+      callback(req, res, true, "no result", null);
+    }
+  },
+  getRptTplTree: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      compilationId = params.compilationId,
+      userId = params.userId,
+      sessionUserId = null;
+    let userIds = ["-100"];
+    if (req.session.sessionUser && req.session.sessionUser.id)
+      sessionUserId = req.session.sessionUser.id;
+    if (userId !== null) {
+      if (typeof userId === "string") {
+        if (userIds.indexOf(userId) < 0) userIds.push(userId);
+      } else if (userId instanceof Array) {
+        for (let uid of userId) {
+          userIds.push(uid);
         }
-        rttFacade.findTplTreeByCompilation(compilationId).then(function (result) {
-            if (result) {
-                callback(req, res, false, "", result);
-            } else {
-                callback(req, res, true, "no result", null);
-            }
-        });
-    },
-    updateTreeNodes: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            nodes = params.nodes;
-        let functions = [];
-        for (let node of nodes) {
-            functions.push((function (doc) {
-                return function (cb) {
-                    TreeNodeModel.update({ ID: doc.ID }, doc, cb);
-                };
-            })(node));
+      }
+    } else {
+    }
+    if (sessionUserId && userIds.indexOf(sessionUserId) < 0)
+      userIds.push(sessionUserId);
+    if (!compilationId) {
+      compilationId = req.session.sessionCompilation._id;
+    }
+    rttFacade.findTplTree(compilationId, userIds).then(function (result) {
+      if (result) {
+        callback(req, res, false, "", result);
+      } else {
+        callback(req, res, true, "no result", null);
+      }
+    });
+  },
+  getTplTreeByCompilation: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      compilationId = params.compilationId;
+    // if (req.session.sessionUser && req.session.sessionUser.id) sessionUserId = req.session.sessionUser.id;
+    console.log(params);
+    if (!compilationId) {
+      console.log(req.session.sessionCompilation);
+      compilationId = req.session.sessionCompilation._id;
+    }
+    rttFacade.findTplTreeByCompilation(compilationId).then(function (result) {
+      if (result) {
+        callback(req, res, false, "", result);
+      } else {
+        callback(req, res, true, "no result", null);
+      }
+    });
+  },
+  updateTreeNodes: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      nodes = params.nodes;
+    let functions = [];
+    for (let node of nodes) {
+      functions.push(
+        (function (doc) {
+          return function (cb) {
+            TreeNodeModel.update({ ID: doc.ID }, doc, cb);
+          };
+        })(node)
+      );
+    }
+    async.parallel(functions, function (err, results) {
+      callback(req, res, err, "", results);
+    });
+  },
+  deleteRptTplNodes: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      nodeIds = params.nodeIds,
+      preNodeId = params.preNodeId,
+      preNodeNextId = params.preNodeNextId;
+    let functions = [];
+    if (preNodeId !== -1) {
+      functions.push(
+        (function (nodeId, nextId) {
+          return function (cb) {
+            TreeNodeModel.update({ ID: nodeId }, { NextSiblingID: nextId }, cb);
+          };
+        })(preNodeId, preNodeNextId)
+      );
+    }
+    for (let nId of nodeIds) {
+      functions.push(
+        (function (nodeId) {
+          return function (cb) {
+            TreeNodeModel.update({ ID: nodeId }, { isDeleted: true }, cb);
+          };
+        })(nId)
+      );
+    }
+    async.parallel(functions, function (err, results) {
+      callback(req, res, err, "", results);
+    });
+  },
+  createTreeRootNode: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      doc = params.doc;
+    rttFacade.createNewTree(doc).then(function (rst) {
+      if (rst) {
+        //success
+        callback(req, res, false, "", rst);
+      } else {
+        //failed
+        callback(req, res, true, "创建失败!", null);
+      }
+    });
+  },
+  updateTreeRootNode: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      doc = params.doc;
+    rttFacade
+      .updateTree(doc.compilationId, doc.engineerId, doc.userId, doc)
+      .then(function (rst) {
+        if (rst) {
+          //success
+          callback(req, res, false, "", rst);
+        } else {
+          //failed
+          callback(req, res, true, "更新失败!", null);
         }
-        async.parallel(functions, function (err, results) {
-            callback(req, res, err, "", results);
+      });
+  },
+  updateTopNodeName: function (req, res) {
+    //备注:因设计的更改,此方法将被放弃
+    let params = JSON.parse(req.body.params),
+      compilationId = params.compilationId,
+      engineerId = params.engineerId,
+      userId = params.userId,
+      nodeName = params.nodeName;
+    if (req.session.sessionUser && req.session.sessionUser.id)
+      userId = req.session.sessionUser.id;
+    let filter = {
+      compilationId: compilationId,
+      engineerId: engineerId,
+      userId: userId,
+      $or: [{ isDeleted: null }, { isDeleted: false }],
+    };
+    let updateStatement = { $set: { name: nodeName } };
+    rttFacade.updateTreeInDetail(filter, updateStatement).then(function (rst) {
+      if (rst) {
+        //success
+        callback(req, res, false, "", rst);
+      } else {
+        //failed
+        callback(req, res, true, "更新失败!", null);
+      }
+    });
+  },
+  updateSubLevelOneNode: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      compilationId = params.compilationId,
+      // engineerId = params.engineerId,
+      userId = params.userId,
+      subNode = params.subNode;
+    if (req.session.sessionUser && req.session.sessionUser.id)
+      userId = req.session.sessionUser.id; //备注:这段逻辑只会在前端有效,后端运维不会走到
+    let filter = {
+      compilationId: compilationId,
+      userId: userId,
+      "items.ID": subNode.ID,
+      $or: [{ isDeleted: null }, { isDeleted: false }],
+    };
+    let updateStatement = { $set: { "items.$": subNode } };
+    rttFacade.updateTreeInDetail(filter, updateStatement).then(function (rst) {
+      if (rst) {
+        //success
+        callback(req, res, false, "", rst);
+      } else {
+        //failed
+        callback(req, res, true, "更新失败!", null);
+      }
+    });
+  },
+
+  removeTreeRootNode: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      compilationId = params.compilationId,
+      engineerId = params.engineerId,
+      userId = params.userId,
+      isPhysically = params.isPhysically;
+    if (req.session.sessionUser && req.session.sessionUser.id)
+      userId = req.session.sessionUser.id;
+    if (isPhysically) {
+      rttFacade
+        .removeTreePhycically(compilationId, engineerId, userId)
+        .then(function (rst) {
+          if (rst) {
+            //success
+            callback(req, res, false, "", rst);
+          } else {
+            //failed
+            callback(req, res, true, "删除失败!", null);
+          }
         });
-    },
-    deleteRptTplNodes: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            nodeIds = params.nodeIds,
-            preNodeId = params.preNodeId,
-            preNodeNextId = params.preNodeNextId;
-        let functions = [];
-        if (preNodeId !== -1) {
-            functions.push((function (nodeId, nextId) {
-                return function (cb) {
-                    TreeNodeModel.update({ ID: nodeId }, { "NextSiblingID": nextId }, cb);
-                };
-            })(preNodeId, preNodeNextId));
-        }
-        for (let nId of nodeIds) {
-            functions.push((function (nodeId) {
-                return function (cb) {
-                    TreeNodeModel.update({ ID: nodeId }, { "isDeleted": true }, cb);
-                };
-            })(nId));
-        }
-        async.parallel(functions, function (err, results) {
-            callback(req, res, err, "", results);
+    } else {
+      rttFacade
+        .removeTree(compilationId, engineerId, userId)
+        .then(function (rst) {
+          if (rst) {
+            //success
+            callback(req, res, false, "", rst);
+          } else {
+            //failed
+            callback(req, res, true, "删除失败!", null);
+          }
         });
-    },
-    createTreeRootNode: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            doc = params.doc;
-        rttFacade.createNewTree(doc).then(function (rst) {
-            if (rst) {
-                //success
-                callback(req, res, false, "", rst);
-            } else {
-                //failed
-                callback(req, res, true, "创建失败!", null);
-            }
-        })
-    },
-    updateTreeRootNode: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            doc = params.doc;
-        rttFacade.updateTree(doc.compilationId, doc.engineerId, doc.userId, doc).then(function (rst) {
-            if (rst) {
-                //success
-                callback(req, res, false, "", rst);
-            } else {
-                //failed
-                callback(req, res, true, "更新失败!", null);
-            }
-        })
-    },
-    updateTopNodeName: function (req, res) {
-        //备注:因设计的更改,此方法将被放弃
-        let params = JSON.parse(req.body.params),
-            compilationId = params.compilationId, engineerId = params.engineerId,
-            userId = params.userId,
-            nodeName = params.nodeName
-            ;
-        if (req.session.sessionUser && req.session.sessionUser.id) userId = req.session.sessionUser.id;
-        let filter = { "compilationId": compilationId, "engineerId": engineerId, "userId": userId, "$or": [{ "isDeleted": null }, { "isDeleted": false }] };
-        let updateStatement = { "$set": { "name": nodeName } };
-        rttFacade.updateTreeInDetail(filter, updateStatement).then(function (rst) {
-            if (rst) {
-                //success
-                callback(req, res, false, "", rst);
-            } else {
-                //failed
-                callback(req, res, true, "更新失败!", null);
-            }
-        });
-    },
-    updateSubLevelOneNode: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            compilationId = params.compilationId,
-            // engineerId = params.engineerId,
-            userId = params.userId,
-            subNode = params.subNode
-            ;
-        if (req.session.sessionUser && req.session.sessionUser.id) userId = req.session.sessionUser.id; //备注:这段逻辑只会在前端有效,后端运维不会走到
-        let filter = { "compilationId": compilationId, "userId": userId, "items.ID": subNode.ID, "$or": [{ "isDeleted": null }, { "isDeleted": false }] };
-        let updateStatement = { $set: { "items.$": subNode } };
-        rttFacade.updateTreeInDetail(filter, updateStatement).then(function (rst) {
-            if (rst) {
-                //success
-                callback(req, res, false, "", rst);
+    }
+  },
+  getNewNodeID: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      scope = params.scope;
+    counter.counterDAO.getIDAfterCount(
+      counter.moduleName.report,
+      scope,
+      function (err, result) {
+        callback(req, res, false, "", result.sequence_value);
+      }
+    );
+  },
+  createDftRptTpl: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      treeNodeId = params.treeNodeId,
+      rptDftTplId = params.rptDftTplId,
+      rptName = params.rptName,
+      grpKey = params.grpKey,
+      compilationId = params.compilationId,
+      engineerId = params.engineerId,
+      userId = params.userId,
+      subNode = params.subNode;
+    if (req.session.sessionUser && req.session.sessionUser.id)
+      userId = req.session.sessionUser.id;
+    let filter = { ID: rptDftTplId };
+    RptTplModel.findOne(filter, "-_id")
+      .exec()
+      .then(function (dftTplRst) {
+        if (dftTplRst) {
+          let _doc = dftTplRst["_doc"];
+          _doc["ID"] = treeNodeId;
+          _doc["GROUP_KEY"] = grpKey;
+          _doc["ID_KEY"] = "";
+          _doc[JV.NODE_MAIN_INFO][JV.NODE_MAIN_INFO_RPT_NAME] = rptName;
+          let rptTpl = new RptTplModel(_doc);
+          rptTpl.save(function (err, actTplRst) {
+            if (err) {
+              callback(req, res, "报表模板创建错误", "", null);
             } else {
-                //failed
-                callback(req, res, true, "更新失败!", null);
-            }
-        });
-    },
-
-    removeTreeRootNode: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            compilationId = params.compilationId,
-            engineerId = params.engineerId,
-            userId = params.userId,
-            isPhysically = params.isPhysically
-            ;
-        if (req.session.sessionUser && req.session.sessionUser.id) userId = req.session.sessionUser.id;
-        if (isPhysically) {
-            rttFacade.removeTreePhycically(compilationId, engineerId, userId).then(function (rst) {
-                if (rst) {
+              let filter = {
+                compilationId: compilationId,
+                engineerId: engineerId,
+                userId: userId,
+                "items.ID": subNode.ID,
+                $or: [{ isDeleted: null }, { isDeleted: false }],
+              };
+              let updateStatement = { $set: { "items.$": subNode } };
+              rttFacade
+                .updateTreeInDetail(filter, updateStatement)
+                .then(function (rst) {
+                  if (rst) {
                     //success
-                    callback(req, res, false, "", rst);
-                } else {
+                    callback(req, res, false, "", actTplRst);
+                  } else {
                     //failed
-                    callback(req, res, true, "删除失败!", null);
-                }
-            })
-        } else {
-            rttFacade.removeTree(compilationId, engineerId, userId).then(function (rst) {
-                if (rst) {
-                    //success
-                    callback(req, res, false, "", rst);
-                } else {
-                    //failed
-                    callback(req, res, true, "删除失败!", null);
-                }
-            })
-        }
-    },
-    getNewNodeID: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            scope = params.scope;
-        counter.counterDAO.getIDAfterCount(counter.moduleName.report, scope, function (err, result) {
-            callback(req, res, false, "", result.sequence_value);
-        });
-    },
-    createDftRptTpl: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            treeNodeId = params.treeNodeId,
-            rptDftTplId = params.rptDftTplId,
-            rptName = params.rptName,
-            grpKey = params.grpKey,
-            compilationId = params.compilationId,
-            engineerId = params.engineerId,
-            userId = params.userId,
-            subNode = params.subNode
-            ;
-        if (req.session.sessionUser && req.session.sessionUser.id) userId = req.session.sessionUser.id;
-        let filter = { "ID": rptDftTplId };
-        RptTplModel.findOne(filter, '-_id').exec().then(function (dftTplRst) {
-            if (dftTplRst) {
-                let _doc = dftTplRst["_doc"];
-                _doc["ID"] = treeNodeId;
-                _doc["GROUP_KEY"] = grpKey;
-                _doc["ID_KEY"] = "";
-                _doc[JV.NODE_MAIN_INFO][JV.NODE_MAIN_INFO_RPT_NAME] = rptName;
-                let rptTpl = new RptTplModel(_doc);
-                rptTpl.save(function (err, actTplRst) {
-                    if (err) {
-                        callback(req, res, "报表模板创建错误", "", null);
-                    } else {
-                        let filter = { "compilationId": compilationId, "engineerId": engineerId, "userId": userId, "items.ID": subNode.ID, "$or": [{ "isDeleted": null }, { "isDeleted": false }] };
-                        let updateStatement = { $set: { "items.$": subNode } };
-                        rttFacade.updateTreeInDetail(filter, updateStatement).then(function (rst) {
-                            if (rst) {
-                                //success
-                                callback(req, res, false, "", actTplRst);
-                            } else {
-                                //failed
-                                callback(req, res, true, "更新失败!", null);
-                            }
-                        });
-                    }
+                    callback(req, res, true, "更新失败!", null);
+                  }
                 });
-            } else {
-                callback(req, res, 'Create report template failed!', null);
-            }
-        })
-    },
-    getRefRptTpl: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            rptTplId = params.rptTplId;
-        let filter = { "ID": rptTplId };
-        RptTplModel.findOne(filter, '-_id').exec().then(function (rstTpl) {
-            if (rstTpl) {
-                callback(req, res, false, "", rstTpl);
-            } else {
-                callback(req, res, 'The report template was not found!', null);
             }
-        })
-    },
-    updateRptTpl: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            rptTpl = JSON.parse(params.rptTpl);
-        let filter = { "ID": parseInt(rptTpl[JV.PROP_ID]) },
-            options = { "overwrite": true };
-        RptTplModel.update(filter, rptTpl, options, function (err, rst) {
+          });
+        } else {
+          callback(req, res, "Create report template failed!", null);
+        }
+      });
+  },
+  getRefRptTpl: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      rptTplId = params.rptTplId;
+    let filter = { ID: rptTplId };
+    RptTplModel.findOne(filter, "-_id")
+      .exec()
+      .then(function (rstTpl) {
+        if (rstTpl) {
+          callback(req, res, false, "", rstTpl);
+        } else {
+          callback(req, res, "The report template was not found!", null);
+        }
+      });
+  },
+  updateRptTpl: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      rptTpl = JSON.parse(params.rptTpl);
+    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 {
+        callback(
+          req,
+          res,
+          false,
+          "The report template was updated successfully!",
+          true
+        );
+      }
+    });
+  },
+  copyRptTpl: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      orgRptTplId = params.orgRptTplId,
+      newID = params.newRptTplId;
+    let filter = { ID: orgRptTplId };
+    RptTplModel.findOne(filter, "-_id")
+      .exec()
+      .then(function (baseTplRst) {
+        if (baseTplRst) {
+          let _doc = baseTplRst["_doc"];
+          _doc["ID"] = newID;
+          if (_doc["GROUP_KEY"].indexOf("(Copy)") < 0) {
+            _doc["GROUP_KEY"] = _doc["GROUP_KEY"] + "(Copy)";
+          }
+          let rptTpl = new RptTplModel(_doc);
+          rptTpl.save(function (err, actTplRst) {
             if (err) {
-                callback(req, res, true, 'The report template was updated failed!', false);
-            } else {
-                callback(req, res, false, 'The report template was updated successfully!', true);
-            }
-        });
-    },
-    copyRptTpl: function (req, res) {
-        let params = JSON.parse(req.body.params),
-            orgRptTplId = params.orgRptTplId,
-            newID = params.newRptTplId;
-        let filter = { "ID": orgRptTplId };
-        RptTplModel.findOne(filter, '-_id').exec().then(function (baseTplRst) {
-            if (baseTplRst) {
-                let _doc = baseTplRst["_doc"];
-                _doc["ID"] = newID;
-                if (_doc["GROUP_KEY"].indexOf("(Copy)") < 0) {
-                    _doc["GROUP_KEY"] = _doc["GROUP_KEY"] + "(Copy)";
-                }
-                let rptTpl = new RptTplModel(_doc);
-                rptTpl.save(function (err, actTplRst) {
-                    if (err) {
-                        callback(req, res, "报表模板创建错误", "", null);
-                    } else {
-                        callback(req, res, false, "", newID);
-                    }
-                });
+              callback(req, res, "报表模板创建错误", "", null);
             } else {
-                callback(req, res, 'Create report template failed!', null);
+              callback(req, res, false, "", newID);
             }
-        });
-    }
+          });
+        } else {
+          callback(req, res, "Create report template failed!", null);
+        }
+      });
+  },
+  // 接口指标报表编辑器,新增的辅表选项数据
+  getAidReportDataList: function (req, res) {
+    let params = JSON.parse(req.body.params),
+      compilationID = params.compilationID;
+    let filter = { compilationID };
+    costIndexModel
+      .find(filter, "-_id")
+      .exec()
+      .then(function (data) {
+        if (data) {
+          callback(req, res, false, "", data);
+        } else {
+          callback(req, res, "The aidReportData template was not found!", null);
+        }
+      });
+  },
 };
 
 function copyRptCfg(src, dest) {
-    dest.margins = { Left: src.margins.Left, Right: src.margins.Right, Top: src.margins.Top, Bottom: src.margins.Bottom };
-    dest.showVerticalLine = src.showVerticalLine;
-    dest.isNarrow = src.isNarrow;
-    dest.fillZero = src.fillZero;
-    dest.fonts = [];
-    for (let font of src.fonts) {
-        dest.fonts.push({
-            "ID": font["ID"], "CfgDispName": font["CfgDispName"], "Name": font["Name"], "FontHeight": font["FontHeight"], "FontColor": font["FontColor"],
-            "FontBold": font["FontBold"], "FontItalic": font["FontItalic"], "FontUnderline": font["FontUnderline"], "FontStrikeOut": font["FontStrikeOut"], "FontAngle": font["FontAngle"]
-        });
-    }
+  dest.margins = {
+    Left: src.margins.Left,
+    Right: src.margins.Right,
+    Top: src.margins.Top,
+    Bottom: src.margins.Bottom,
+  };
+  dest.showVerticalLine = src.showVerticalLine;
+  dest.isNarrow = src.isNarrow;
+  dest.fillZero = src.fillZero;
+  dest.fonts = [];
+  for (let font of src.fonts) {
+    dest.fonts.push({
+      ID: font["ID"],
+      CfgDispName: font["CfgDispName"],
+      Name: font["Name"],
+      FontHeight: font["FontHeight"],
+      FontColor: font["FontColor"],
+      FontBold: font["FontBold"],
+      FontItalic: font["FontItalic"],
+      FontUnderline: font["FontUnderline"],
+      FontStrikeOut: font["FontStrikeOut"],
+      FontAngle: font["FontAngle"],
+    });
+  }
 }
 
-export default mExport;
+export default mExport;

+ 64 - 36
modules/reports/routes/rpt_tpl_router.js

@@ -5,40 +5,68 @@ import reportTplController from "./../controllers/rpt_tpl_controller";
 import reportCfgController from "./../controllers/rpt_cfg_controller";
 
 module.exports = function (app) {
-    app.get('/rpt_tpl',  function(req, res) {
-        if (!req.session.managerData.username) {
-            res.redirect('/login');
-        }
-        else {
-            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)
-                }
-            );
-        }
-    });
+  app.get("/rpt_tpl", function (req, res) {
+    if (!req.session.managerData.username) {
+      res.redirect("/login");
+    } else {
+      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),
+      });
+    }
+  });
 
-    rptTplRouter.post('/createTreeRootNode', reportTplController.createTreeRootNode);
-    rptTplRouter.post('/updateTreeRootNode', reportTplController.updateTreeRootNode);
-    rptTplRouter.post('/updateTopNodeName', reportTplController.updateTopNodeName);
-    rptTplRouter.post('/updateSubLevelOneNode', reportTplController.updateSubLevelOneNode);
-    rptTplRouter.post('/removeTreeRootNode', reportTplController.removeTreeRootNode);
-    rptTplRouter.post('/getRptTplTree', reportTplController.getRptTplTree);
-    rptTplRouter.post('/getTplTreeByCompilation', reportTplController.getTplTreeByCompilation);
-    rptTplRouter.post('/getNewNodeID', reportTplController.getNewNodeID);
-    rptTplRouter.post('/updateRptTplNodes', reportTplController.updateTreeNodes);
-    rptTplRouter.post('/deleteRptTplNodes', reportTplController.deleteRptTplNodes);
-    rptTplRouter.post('/createDftRptTpl', reportTplController.createDftRptTpl);
-    rptTplRouter.post('/getRefRptTpl', reportTplController.getRefRptTpl);
-    rptTplRouter.post('/updateRptTpl', reportTplController.updateRptTpl);
-    rptTplRouter.post('/copyRptTpl', reportTplController.copyRptTpl);
-    rptTplRouter.post('/getCompilationList', reportTplController.getCompilationList);
-    rptTplRouter.post('/getCustomizeCfg', reportTplController.getCustomerCfg);
-    rptTplRouter.post('/saveCustomerCfg', reportTplController.saveCustomerCfg);
-    rptTplRouter.post('/getExtCodeTpl', reportTplController.getExtCodeTpl);
-
-    rptTplRouter.post('/getUserRptCfg', reportCfgController.getReportUserCfg);
-    rptTplRouter.post('/getMappingFields', reportCfgController.getAllMappingFields);
-    app.use("/report_tpl_api", rptTplRouter);
-};
+  rptTplRouter.post(
+    "/createTreeRootNode",
+    reportTplController.createTreeRootNode
+  );
+  rptTplRouter.post(
+    "/updateTreeRootNode",
+    reportTplController.updateTreeRootNode
+  );
+  rptTplRouter.post(
+    "/updateTopNodeName",
+    reportTplController.updateTopNodeName
+  );
+  rptTplRouter.post(
+    "/updateSubLevelOneNode",
+    reportTplController.updateSubLevelOneNode
+  );
+  rptTplRouter.post(
+    "/removeTreeRootNode",
+    reportTplController.removeTreeRootNode
+  );
+  rptTplRouter.post("/getRptTplTree", reportTplController.getRptTplTree);
+  rptTplRouter.post(
+    "/getTplTreeByCompilation",
+    reportTplController.getTplTreeByCompilation
+  );
+  rptTplRouter.post("/getNewNodeID", reportTplController.getNewNodeID);
+  rptTplRouter.post("/updateRptTplNodes", reportTplController.updateTreeNodes);
+  rptTplRouter.post(
+    "/deleteRptTplNodes",
+    reportTplController.deleteRptTplNodes
+  );
+  rptTplRouter.post("/createDftRptTpl", reportTplController.createDftRptTpl);
+  rptTplRouter.post("/getRefRptTpl", reportTplController.getRefRptTpl);
+  rptTplRouter.post("/updateRptTpl", reportTplController.updateRptTpl);
+  rptTplRouter.post("/copyRptTpl", reportTplController.copyRptTpl);
+  rptTplRouter.post(
+    "/getCompilationList",
+    reportTplController.getCompilationList
+  );
+  rptTplRouter.post("/getCustomizeCfg", reportTplController.getCustomerCfg);
+  rptTplRouter.post("/saveCustomerCfg", reportTplController.saveCustomerCfg);
+  rptTplRouter.post("/getExtCodeTpl", reportTplController.getExtCodeTpl);
+  rptTplRouter.post("/getUserRptCfg", reportCfgController.getReportUserCfg);
+  rptTplRouter.post(
+    "/getMappingFields",
+    reportCfgController.getAllMappingFields
+  );
+  rptTplRouter.post(
+    "/getAidReportDataList",
+    reportTplController.getAidReportDataList
+  );
+  app.use("/report_tpl_api", rptTplRouter);
+};

+ 381 - 334
public/web/rpt_value_define.js

@@ -2,338 +2,385 @@
  * Created by Tony on 2017/6/7.
  */
 const JV = {
-    NODE_CROSS_INFO: "交叉表_信息",
-    NODE_CROSS_ROW: "交叉行",
-    NODE_CROSS_COL: "交叉列",
-    NODE_CROSS_CONTENT: "交叉数据",
-    NODE_CROSS_ROW_SUM: "交叉行合计",
-    NODE_CROSS_COL_SUM: "交叉列合计",
-    NODE_CROSS_ROW_EXT: "交叉行拓展",
-    NODE_CROSS_ROW_SUM_EXT: "交叉行拓展合计",
-    NODE_CROSS_ROW_AD_HOC: "交叉行AD_HOC",
-    NODE_FIELD_MAP: "指标_数据_映射",
-    NODE_DISCRETE_FIELDS: "离散指标_集合",
-    NODE_NO_MAPPING_FIELDS: "无映射离散指标_集合",
-    NODE_DISCRETE_PARAMS: "离散参数_集合",
-    NODE_MASTER_FIELDS: "主数据指标_集合",
-    NODE_MASTER_FIELDS_EX: "主数据指标_拓展集合",
-    NODE_DETAIL_FIELDS: "从数据指标_集合",
-    NODE_DETAIL_FIELDS_EX: "从数据指标_拓展集合",
-    NODE_BAND_COLLECTION: "布局框_集合",
-    NODE_FORMULAS: "计算式_集合",
-    NODE_EVENTS: "事件_集合",
-    NODE_DISCRETE_INFO: "离散信息",
-    NODE_BILL_INFO: "账单式表_信息",
-    NODE_BILL_CONTENT: "账单式表_数据",
-    NODE_FLOW_INFO: "流水式表_信息",
-    NODE_FLOW_INFO_EX: "流水式表_拓展信息",
-    NODE_FLOW_GROUP: "流水式表_分组信息",
-    NODE_FLOW_SEG_SUM: "流水式表_段统计信息",
-    NODE_FLOW_PAGE_SUM: "流水式表_页统计信息",
-    NODE_FLOW_COLUMN: "流水式表_列",
-    NODE_FLOW_CONTENT: "流水式表_数据",
-    PROP_MULTI_COLUMN: "多列显示数量",
-    PROP_ERASE_BLANK_ROWS: '空行提上',
-    PROP_FLOW_EX_DISPLAY_MODE: "流水拓展显示模式",
-    DISPLAY_MODE_INDEPENDENT: "单独模式",
-    DISPLAY_MODE_FOLLOW: "紧随模式",
-
-    NODE_MAIN_INFO: "主信息",
-    NODE_MAIN_INFO_RPT_NAME: "报表名称",
-    NODE_PAGE_INFO: "打印页面_信息",
-    NODE_PAGE_SIZE: "纸张宽高",
-    NODE_MARGINS: "页边距",
-    NODE_RPT_BIZ_TYPE: "报表业务类型",
-    NODE_BIZ_TYPE_AUDI: "审核类型",
-    NODE_BIZ_TYPE_SUM: "汇总类型",
-    NODE_BIZ_TYPE_DETAIL: "明细类型",
-
-    NODE_MAP_DATA_HANDLE_INFO: "映射数据预处理",
-    PROP_DATA_KEY: "映射数据对象",
-    PROP_PARENT_DATA_KEY: "父映射数据对象",
-    PROP_PARENT_CHILD_SORT_KEY: "父子排序键",
-    PROP_PARENT_SORT_KEYS: "父排序键值集",
-    PROP_CHILD_SORT_KEYS: "子排序键值集",
-    PROP_OTHER_SUB_SORT: "其他子排序",
-    PROP_OTHER_SUB_FILTER: "其他子过滤",
-    PROP_HANDLE_TYPE: "预处理类型",
-    PROP_FILTER_KEYS: "过滤键值集",
-    PROP_FILTER_TOP_BILLS_NODES: "清单顶节点集",
-    PROP_FILTER_OTHER_BILLS_NODES: "其他清单节点集",
-    PROP_FILTER_COMPARE_OBJ: "compareObjKey",
-    PROP_FILTER_COMPARE_OBJ_KEY: "compareObjIdKey",
-    PROP_FILTER_COMPARE_VAL: "compareValue",
-    PROP_FILTER_CONDITION: "判断条件",
-    PROP_HANDLE_TYPE_FILTER: "过滤",
-    PROP_HANDLE_TYPE_SUM: "合计",
-    PROP_HANDLE_TYPE_SORT: "排序",
-    PROP_HANDLE_TYPE_ADD_DUMMY: "增加Dummy数据",
-    PROP_HANDLE_TYPE_ADJUST: "数据调整",
-    PROP_HANDLE_TYPE_BILLS_DATA_MOVE: "量材数据转移",
-    PROP_HANDLE_TYPE_COMPONENT_MOVE: "组成物数据转移",
-    PROP_HANDLE_TYPE_COMPONENT_REPLACEMENT: "组成物替换",
-    PROP_HANDLE_TYPE_PRECISION: "合计精度",
-    PROP_HANDLE_TYPE_CHANGE_QUANTITIES_BILLS: "转化工程量清单",
-    PROP_HANDLE_TYPE_CHANGE_QUANTITIES_BILLS_SORT_TYPE: "工程量清单排序类型",
-    PROP_HANDLE_TYPE_CHANGE_QUANTITIES_BILLS_DATA_TYPE: "工程量清单数据类型",
-    PROP_HANDLE_TYPE_FX_GLJ: "分项定额人材机处理",
-    PROP_HANDLE_TYPE_LAND_COMPS: "清单土地计算合并",
-    PROP_HANDLE_TYPE_COST_TREE_BU_GLJ: "造价书插入补项工料机",
-    PROP_HANDLE_TYPE_FLITE_XMJ_IS_BILL_BUDGET: "筛选清单预算项目节",
-
-    PROP_ADJUST_COLLECTION: "数据调整集",
-    PROP_ADJUST_ACTION: "action",
-    PROP_ADJUST_ACTION_VAL: "actionValue",
-    PROP_DUMMY_COLLECTION: "Dummy数据集",
-    PROP_DUMMY_VAL: "Dummy数据对象值",
-    PROP_FREQUENCY: "频率",
-    PROP_GRP_KEYS: "GrpKeyIds",
-    PROP_SORT_TYPE: "排序方式",
-    PROP_SORT_TYPE_SELF_DEFINE_LOGIC: "自定义逻辑",
-    PROP_SORT_KEYS: "排序键值集",
-    PROP_SUM_GROUP_KEYS: "分组键值集",
-    PROP_SUM_SUM_KEYS: "统计键值集",
-    PROP_SUM_CALC_AHEAD: "统计前计算",
-    PROP_SUM_CACL_TYPE: "计算类型",
-    PROP_FIELD_EXP_MAP: "mapExpression",
-    PROP_PRECISION: "Precision",
-    PROP_FIXED_PRECISION_AMT: "fixedPrecisionNum",
-    PROP_FIELD_EXP_FIXED_MAP: "fixedMapExpression",
-    PROP_FIELD_EXP_FLEXIBLE_MAP: "flexibleMapExpression",
-    PROP_FLEXIBLE_REF_FILED_ID: "flexibleRefFieldID",
-    PROP_QUANTITIES_BILLS_LEVEL: "工程量清单输出类型",
-
-    NODE_FONT_COLLECTION: "font_collection",
-    NODE_STYLE_COLLECTION: "style_collection",
-    NODE_CONTROL_COLLECTION: "control_collection",
-
-    PROP_ID: "ID",
-    PROP_AD_HOC_DATA: "data_field",
-    PROP_CMN_HEIGHT: "CommonHeight",
-    PROP_CMN_WIDTH: "CommonWidth",
-    PROP_BAND_NAME: "BandName",
-    PROP_BAND_NORMAL_ONLY: "normalOnly",
-    PROP_BAND_EX_ONLY: "exOnly",
-    PROP_BAND_EX_JOIN_AFTER: "isJoinAfter",
-
-    PROP_UNITS: "单位",
-    PROP_PAGE_SIZE: "页规格",
-    PROP_ORIENTATION: "方向",
-    PROP_LEFT: "Left",
-    PROP_RIGHT: "Right",
-    PROP_TOP: "Top",
-    PROP_BOTTOM: "Bottom",
-    PROP_DATA_TYPE: "DataType",
-    PROP_NAME: "Name",
-    PROP_DFT_VALUE: "Default_Value",
-    PROP_EXPRESSION: "expression",
-    PROP_RUN_TYPE: "run_type",
-    PROP_BORDER_STYLE: "border_style",
-    PROP_POSITION: "Position",
-    PROP_HIDDEN: "Hidden",
-    PROP_IS_SERIAL: "isSerial",
-    PROP_IS_MERGE: "isMerge",
-    PROP_COMBINE_TYPE: "combineType",
-    PROP_IS_AUTO_HEIGHT: "isAutoHeight",
-    PROP_FONT: "font",
-    PROP_CONTROL: "control",
-    PROP_STYLE: "style",
-    PROP_VALUE: "Value",
-    PROP_LABEL: "Label",
-    PROP_AREA: "area",
-    PROP_DISCRETE_FIELDS: "discrete_field_s",
-    PROP_FLOW_FIELDS: "flow_field_s",
-    PROP_BILL_FIELDS: "bill_field_s",
-    PROP_CROSS_FIELDS: "cross_field_s",
-    PROP_CROSS_DISPLAY_ORDER: "cross_display_order",
-    PROP_GROUP_FIELDS: "group_field_s", //用来分组的指标(如按清单、定额etc...)
-    PROP_GROUP_LINES: "group_lines",    //显示分组行,因分组的特殊性,分组的数据当成流水数据一样(行高相同),group_lines里的每一条数据占用流水的一整行,里面再细分(指标/text)
-    PROP_GROUP_SUM_KEYS: "SumKey_S",
-    PROP_SUM_KEY: "SumKey",
-    PROP_SUM_FIELDS: "sum_field_s",
-    PROP_TEXTS: "text_s",
-    PROP_TEXT: "text",
-    PROP_PARAMS: "param_s",
-    PROP_FIELD_ID: "FieldID",
-    PROP_PARAM_ID: "ParamID",
-    PROP_PREFIX: "Prefix",
-    PROP_SUFFIX: "Suffix",
-    PROP_FORMAT: "Format",
-
-    PROP_SHOW_ZERO: "ShowZero",
-    PROP_EXTENSION_TYPE: "ExtType",
-
-    PROP_CALCULATION: "CalculationType",
-    PROP_H_CALCULATION: "H_CalculationType",
-    PROP_V_CALCULATION: "V_CalculationType",
-    PROP_FIT_AREA: "isFitArea",
-
-    IDX_LEFT: 0,
-    IDX_TOP: 1,
-    IDX_RIGHT: 2,
-    IDX_BOTTOM: 3,
-
-    BAND_PROP_NAME: "Name",
-    BAND_PROP_MERGE_BAND: "MergeBand",
-    BAND_PROP_STYLE: "style",
-    BAND_PROP_CONTROL: "control",
-    BAND_PROP_HEIGHT: "Height",
-    BAND_PROP_WIDTH: "Width",
-    BAND_PROP_DISPLAY_TYPE: "DisplayType",
-    BAND_PROP_ALIGNMENT: "Alignment",
-    BAND_PROP_MERGE_BORDER: "MergeBorder",
-    BAND_PROP_SUB_BANDS: "band_s",
-
-    MEASUREMENT: {
-        PIXEL: ["像素点", "象素点", "PIXEL"],
-        CM: ["厘米", "CM"],
-        INCH: ["英寸", "INCH"]
-    },
-
-    PROP_IS_ID: "isID",
-    PROP_ID_SEQ: "IDSeq",
-
-    TAB_FIELD_PROP_SORT: "Sort",
-    TAB_FIELD_PROP_SORT_VAL_NOSORT: "no_sort",
-    TAB_FIELD_PROP_SORT_VAL_ASC: "ascend",
-    TAB_FIELD_PROP_SORT_VAL_DESC: "descend",
-
-    DATA_DISCRETE_DATA: "discrete_data",
-    DATA_MASTER_DATA: "master_data",
-    DATA_DETAIL_DATA: "detail_data",
-    DATA_MASTER_DATA_EX: "master_data_ex",
-    DATA_DETAIL_DATA_EX: "detail_data_ex",
-
-    BLANK_FIELD_INDEX: -10,
-    BLANK_VALUE_INDEX: -100,
-    BLANK_PAGE_VALUE_INDEX: -200,
-
-    PROP_SEG_GRP_IDX: "segGrpRecStartIdx",
-    PROP_PRE_ADD_GRP_REC_INFO: "preAddPageGrpInfo",
-    PROP_INSERTED_GRP_REC: "insertedGrpRecAmt",
-    PROP_GRP_LINES: "group_lines_amt",
-
-    RUN_TYPE_BEFORE_ANALYZING: "before_analyzing",
-    RUN_TYPE_BEFORE_PAGING: "before_paging",
-    RUN_TYPE_BEFORE_OUTPUT: "before_output",
-    RUN_TYPE_BEFORE_COMBINE: "before_combine",
-    RUN_TYPE_AFTER_COMBINE: "after_combine",
-
-    RUN_TYPE_BEFORE_GROUP_TEXT_OUT: "before_group_text_output",
-
-    PAGE_STATUS: ["EveryPage", "FirstPage", "LastPage", "SegmentStart", "SegmentEnd", "Group", "CrossRowEnd", "CrossColEnd"],
-
-    CONTROL_PROPS: ["Shrink", "ShowZero", "Horizon", "Vertical", "Wrap", "VerticalForExcel", "ShrinkFirst", "CloseOutput"],
-    CONTROL_PROP_IDX_SHRINK: 0,
-    CONTROL_PROP_IDX_SHOW_ZERO: 1,
-    CONTROL_PROP_IDX_HORIZON: 2,
-    CONTROL_PROP_IDX_VERTICAL: 3,
-    CONTROL_PROP_IDX_WRAP: 4,
-    CONTROL_PROP_IDX_VERTICAL_EXCEL: 5,
-    CONTROL_PROP_IDX_SHRINK_FIRST: 6,
-    CONTROL_PROP_IDX_CLOSE_OUTPUT: 7,
-    BORDER_STYLE_PROPS: ["LineWeight", "DashStyle", "Color"],
-    PROP_LINE_WEIGHT: "LineWeight",
-    PROP_DASH_STYLE: "DashStyle",
-    PROP_COLOR: "Color",
-    FONT_PROPS: ["Name", "FontHeight", "FontColor", "FontBold", "FontItalic", "FontUnderline", "FontStrikeOut", "FontAngle"],
-    FONT_PROP_IDX_NAME: 0,
-    FONT_PROP_IDX_HEIGHT: 1,
-    FONT_PROP_IDX_COLOR: 2,
-    FONT_PROP_IDX_BOLD: 3,
-    FONT_PROP_IDX_ITALIC: 4,
-    FONT_PROP_IDX_UNDERLINE: 5,
-    FONT_PROP_IDX_STRIKEOUT: 6,
-    FONT_PROP_IDX_ANGLE: 7,
-
-    STATUS_NORMAL: 0,
-    STATUS_REPORT_START: 1,
-    STATUS_REPORT_END: 2,
-    STATUS_SEGMENT_START: 3,
-    STATUS_SEGMENT_END: 4,
-    STATUS_GROUP: 5,
-    STATUS_CROSS_ROW_END: 6,
-    STATUS_CROSS_COL_END: 7,
-
-    LAYOUT: ["Top", "Bottom", "Left", "Right", "Fulfill"],
-    LAYOUT_TOP: 0,
-    LAYOUT_BOTTOM: 1,
-    LAYOUT_LEFT: 2,
-    LAYOUT_RIGHT: 3,
-    LAYOUT_FULFILL: 4,
-
-    OUTPUT_ALIGN: {
-        H: ["left", "center", "right"],
-        V: ["top", "center", "bottom"]
-    },
-    H_ALIGN_IDX_LEFT: 0,
-    H_ALIGN_IDX_CENTER: 1,
-    H_ALIGN_IDX_RIGHT: 2,
-    V_ALIGN_IDX_TOP: 0,
-    V_ALIGN_IDX_CENTER: 1,
-    V_ALIGN_IDX_BOTTOM: 2,
-
-    CAL_TYPE: ["percentage", "abstract"],
-    CAL_TYPE_PERCENTAGE: 0,
-    CAL_TYPE_ABSTRACT: 1,
-
-    EVENT_TYPE: ["GRP_ON_CREATE", "FLOW_CONTENT_ON_CREATE"],
-    EVENT_IDX_GRP_ON_CREATE: 0,
-    EVENT_IDX_FLOW_CONTENT_ON_CREATE: 1,
-
-    PAGE_ORIENTATION_V_FIRST: 0,
-    PAGE_ORIENTATION_H_FIRST: 1,
-
-    ORIENTATION_PORTRAIT: "PORTRAIT",
-    ORIENTATION_LANDSCAPE: "LANDSCAPE",
-    ORIENTATION_PORTRAIT_CHN: "纵向",
-    ORIENTATION_LANDSCAPE_CHN: "横向",
-    SIZE_A3: [11.69, 16.54],
-    SIZE_A4: [8.27, 11.69],
-    SIZE_A5: [5.83, 8.27],
-    SIZE_B5: [6.93, 9.84],
-    SIZE_LETTER: [8.5, 11.0],
-    SIZE_LEGAL: [8.5, 14.0],
-    SIZE_16K: [7.75, 10.75],
-    SIZE_EXECUTIVE: [7.25, 10.5],
-
-    OUTPUT_OFFSET: [2, 2, 1, 3],
-    OFFSET_IDX_LEFT: 0,
-    OFFSET_IDX_RIGHT: 1,
-    OFFSET_IDX_TOP: 2,
-    OFFSET_IDX_BOTTOM: 3,
-
-    PROP_PAGE_SEQ: "page_seq",
-    PROP_PAGE_MERGE_BORDER: "page_merge_border",
-    PROP_CELLS: "cells",
-
-    PAGING_OPTION_NORMAL: 'normal',
-    PAGING_OPTION_INFINITY: 'infinity',
-
-    OUTPUT_TYPE_NORMAL: 'normal',
-    OUTPUT_TYPE_SVG: 'svg',
-    OUTPUT_TYPE_PDF: 'pdf',
-    OUTPUT_TYPE_EXCEL: 'excel',
-
-    DISPLAY_VAL_TYPE_NORMAL: 0,
-    DISPLAY_VAL_TYPE_GROUP: 1,
-    DISPLAY_VAL_TYPE_AUTO_HEIGHT: 2,
-
-    TYPE_FOLLOW_MODE: 1,
-
-    PAGE_SELF_DEFINE: "自定义",
-    PAGE_SPECIAL_MERGE_POS: "page_merge_pos",
-
-    PAGES_SIZE_STR: ["A3", "A4", "A5", "B5", "LETTER", "LEGAL", "EXECUTIVE", "16K"],
-    PAGES_SIZE_IDX: [8, 9, 11, 13, 1, 5, 7, 93],
-    PAGES_SIZE: [[11.69, 16.54], [8.27, 11.69], [5.83, 8.27], [6.93, 9.84], [8.5, 11.0], [8.5, 14.0], [7.25, 10.5], [7.25, 10.5]],
-
-    HUNDRED_PERCENT: 100.0,
-
-    VERTICAL_ANGLE: "90",
-    ANTI_VERTICAL_ANGLE: "-90",
-    VERTICAL_ANGLE_INT: 90,
-    ANTI_VERTICAL_ANGLE_INT: -90,
-
-    LAST_DEF: ""
+  NODE_CROSS_INFO: "交叉表_信息",
+  NODE_CROSS_ROW: "交叉行",
+  NODE_CROSS_COL: "交叉列",
+  NODE_CROSS_CONTENT: "交叉数据",
+  NODE_CROSS_ROW_SUM: "交叉行合计",
+  NODE_CROSS_COL_SUM: "交叉列合计",
+  NODE_CROSS_ROW_EXT: "交叉行拓展",
+  NODE_CROSS_ROW_SUM_EXT: "交叉行拓展合计",
+  NODE_CROSS_ROW_AD_HOC: "交叉行AD_HOC",
+  NODE_FIELD_MAP: "指标_数据_映射",
+  NODE_DISCRETE_FIELDS: "离散指标_集合",
+  NODE_NO_MAPPING_FIELDS: "无映射离散指标_集合",
+  NODE_DISCRETE_PARAMS: "离散参数_集合",
+  NODE_MASTER_FIELDS: "主数据指标_集合",
+  NODE_MASTER_FIELDS_EX: "主数据指标_拓展集合",
+  NODE_DETAIL_FIELDS: "从数据指标_集合",
+  NODE_DETAIL_FIELDS_EX: "从数据指标_拓展集合",
+  NODE_BAND_COLLECTION: "布局框_集合",
+  NODE_FORMULAS: "计算式_集合",
+  NODE_EVENTS: "事件_集合",
+  NODE_DISCRETE_INFO: "离散信息",
+  NODE_BILL_INFO: "账单式表_信息",
+  NODE_BILL_CONTENT: "账单式表_数据",
+  NODE_FLOW_INFO: "流水式表_信息",
+  NODE_FLOW_INFO_EX: "流水式表_拓展信息",
+  NODE_FLOW_GROUP: "流水式表_分组信息",
+  NODE_FLOW_SEG_SUM: "流水式表_段统计信息",
+  NODE_FLOW_PAGE_SUM: "流水式表_页统计信息",
+  NODE_FLOW_COLUMN: "流水式表_列",
+  NODE_FLOW_CONTENT: "流水式表_数据",
+  PROP_MULTI_COLUMN: "多列显示数量",
+  PROP_ERASE_BLANK_ROWS: "空行提上",
+  PROP_FLOW_EX_DISPLAY_MODE: "流水拓展显示模式",
+  DISPLAY_MODE_INDEPENDENT: "单独模式",
+  DISPLAY_MODE_FOLLOW: "紧随模式",
+
+  NODE_MAIN_INFO: "主信息",
+  NODE_MAIN_INFO_RPT_NAME: "报表名称",
+  NODE_PAGE_INFO: "打印页面_信息",
+  NODE_PAGE_SIZE: "纸张宽高",
+  NODE_MARGINS: "页边距",
+  NODE_RPT_BIZ_TYPE: "报表业务类型",
+  NODE_BIZ_TYPE_AUDI: "审核类型",
+  NODE_BIZ_TYPE_SUM: "汇总类型",
+  NODE_BIZ_TYPE_DETAIL: "明细类型",
+
+  NODE_MAP_DATA_HANDLE_INFO: "映射数据预处理",
+  PROP_DATA_KEY: "映射数据对象",
+  PROP_PARENT_DATA_KEY: "父映射数据对象",
+  PROP_PARENT_CHILD_SORT_KEY: "父子排序键",
+  PROP_PARENT_SORT_KEYS: "父排序键值集",
+  PROP_CHILD_SORT_KEYS: "子排序键值集",
+  PROP_OTHER_SUB_SORT: "其他子排序",
+  PROP_OTHER_SUB_FILTER: "其他子过滤",
+  PROP_HANDLE_TYPE: "预处理类型",
+  PROP_FILTER_KEYS: "过滤键值集",
+  PROP_FILTER_TOP_BILLS_NODES: "清单顶节点集",
+  PROP_FILTER_OTHER_BILLS_NODES: "其他清单节点集",
+  PROP_FILTER_COMPARE_OBJ: "compareObjKey",
+  PROP_FILTER_COMPARE_OBJ_KEY: "compareObjIdKey",
+  PROP_FILTER_COMPARE_VAL: "compareValue",
+  PROP_FILTER_CONDITION: "判断条件",
+  PROP_HANDLE_TYPE_FILTER: "过滤",
+  PROP_HANDLE_TYPE_SUM: "合计",
+  PROP_HANDLE_TYPE_SORT: "排序",
+  PROP_HANDLE_TYPE_ADD_DUMMY: "增加Dummy数据",
+  PROP_HANDLE_TYPE_ADJUST: "数据调整",
+  PROP_HANDLE_TYPE_BILLS_DATA_MOVE: "量材数据转移",
+  PROP_HANDLE_TYPE_COMPONENT_MOVE: "组成物数据转移",
+  PROP_HANDLE_TYPE_COMPONENT_REPLACEMENT: "组成物替换",
+  PROP_HANDLE_TYPE_PRECISION: "合计精度",
+  PROP_HANDLE_TYPE_CHANGE_QUANTITIES_BILLS: "转化工程量清单",
+  PROP_HANDLE_TYPE_CHANGE_QUANTITIES_BILLS_SORT_TYPE: "工程量清单排序类型",
+  PROP_HANDLE_TYPE_CHANGE_QUANTITIES_BILLS_DATA_TYPE: "工程量清单数据类型",
+  PROP_HANDLE_TYPE_FX_GLJ: "分项定额人材机处理",
+  PROP_HANDLE_TYPE_LAND_COMPS: "清单土地计算合并",
+  PROP_HANDLE_TYPE_COST_TREE_BU_GLJ: "造价书插入补项工料机",
+  PROP_HANDLE_TYPE_FLITE_XMJ_IS_BILL_BUDGET: "筛选清单预算项目节",
+  PROP_HANDLE_TYPE_BIND_AID_REPORT: "绑定含量指标定制表模板",
+  PROP_HANDLE_TYPE_BIND_AID_REPORT_ID: "含量指标定制表模板ID",
+
+  PROP_ADJUST_COLLECTION: "数据调整集",
+  PROP_ADJUST_ACTION: "action",
+  PROP_ADJUST_ACTION_VAL: "actionValue",
+  PROP_DUMMY_COLLECTION: "Dummy数据集",
+  PROP_DUMMY_VAL: "Dummy数据对象值",
+  PROP_FREQUENCY: "频率",
+  PROP_GRP_KEYS: "GrpKeyIds",
+  PROP_SORT_TYPE: "排序方式",
+  PROP_SORT_TYPE_SELF_DEFINE_LOGIC: "自定义逻辑",
+  PROP_SORT_KEYS: "排序键值集",
+  PROP_SUM_GROUP_KEYS: "分组键值集",
+  PROP_SUM_SUM_KEYS: "统计键值集",
+  PROP_SUM_CALC_AHEAD: "统计前计算",
+  PROP_SUM_CACL_TYPE: "计算类型",
+  PROP_FIELD_EXP_MAP: "mapExpression",
+  PROP_PRECISION: "Precision",
+  PROP_FIXED_PRECISION_AMT: "fixedPrecisionNum",
+  PROP_FIELD_EXP_FIXED_MAP: "fixedMapExpression",
+  PROP_FIELD_EXP_FLEXIBLE_MAP: "flexibleMapExpression",
+  PROP_FLEXIBLE_REF_FILED_ID: "flexibleRefFieldID",
+  PROP_QUANTITIES_BILLS_LEVEL: "工程量清单输出类型",
+
+  NODE_FONT_COLLECTION: "font_collection",
+  NODE_STYLE_COLLECTION: "style_collection",
+  NODE_CONTROL_COLLECTION: "control_collection",
+
+  PROP_ID: "ID",
+  PROP_AD_HOC_DATA: "data_field",
+  PROP_CMN_HEIGHT: "CommonHeight",
+  PROP_CMN_WIDTH: "CommonWidth",
+  PROP_BAND_NAME: "BandName",
+  PROP_BAND_NORMAL_ONLY: "normalOnly",
+  PROP_BAND_EX_ONLY: "exOnly",
+  PROP_BAND_EX_JOIN_AFTER: "isJoinAfter",
+
+  PROP_UNITS: "单位",
+  PROP_PAGE_SIZE: "页规格",
+  PROP_ORIENTATION: "方向",
+  PROP_LEFT: "Left",
+  PROP_RIGHT: "Right",
+  PROP_TOP: "Top",
+  PROP_BOTTOM: "Bottom",
+  PROP_DATA_TYPE: "DataType",
+  PROP_NAME: "Name",
+  PROP_DFT_VALUE: "Default_Value",
+  PROP_EXPRESSION: "expression",
+  PROP_RUN_TYPE: "run_type",
+  PROP_BORDER_STYLE: "border_style",
+  PROP_POSITION: "Position",
+  PROP_HIDDEN: "Hidden",
+  PROP_IS_SERIAL: "isSerial",
+  PROP_IS_MERGE: "isMerge",
+  PROP_COMBINE_TYPE: "combineType",
+  PROP_IS_AUTO_HEIGHT: "isAutoHeight",
+  PROP_FONT: "font",
+  PROP_CONTROL: "control",
+  PROP_STYLE: "style",
+  PROP_VALUE: "Value",
+  PROP_LABEL: "Label",
+  PROP_AREA: "area",
+  PROP_DISCRETE_FIELDS: "discrete_field_s",
+  PROP_FLOW_FIELDS: "flow_field_s",
+  PROP_BILL_FIELDS: "bill_field_s",
+  PROP_CROSS_FIELDS: "cross_field_s",
+  PROP_CROSS_DISPLAY_ORDER: "cross_display_order",
+  PROP_GROUP_FIELDS: "group_field_s", //用来分组的指标(如按清单、定额etc...)
+  PROP_GROUP_LINES: "group_lines", //显示分组行,因分组的特殊性,分组的数据当成流水数据一样(行高相同),group_lines里的每一条数据占用流水的一整行,里面再细分(指标/text)
+  PROP_GROUP_SUM_KEYS: "SumKey_S",
+  PROP_SUM_KEY: "SumKey",
+  PROP_SUM_FIELDS: "sum_field_s",
+  PROP_TEXTS: "text_s",
+  PROP_TEXT: "text",
+  PROP_PARAMS: "param_s",
+  PROP_FIELD_ID: "FieldID",
+  PROP_PARAM_ID: "ParamID",
+  PROP_PREFIX: "Prefix",
+  PROP_SUFFIX: "Suffix",
+  PROP_FORMAT: "Format",
+
+  PROP_SHOW_ZERO: "ShowZero",
+  PROP_EXTENSION_TYPE: "ExtType",
+
+  PROP_CALCULATION: "CalculationType",
+  PROP_H_CALCULATION: "H_CalculationType",
+  PROP_V_CALCULATION: "V_CalculationType",
+  PROP_FIT_AREA: "isFitArea",
+
+  IDX_LEFT: 0,
+  IDX_TOP: 1,
+  IDX_RIGHT: 2,
+  IDX_BOTTOM: 3,
+
+  BAND_PROP_NAME: "Name",
+  BAND_PROP_MERGE_BAND: "MergeBand",
+  BAND_PROP_STYLE: "style",
+  BAND_PROP_CONTROL: "control",
+  BAND_PROP_HEIGHT: "Height",
+  BAND_PROP_WIDTH: "Width",
+  BAND_PROP_DISPLAY_TYPE: "DisplayType",
+  BAND_PROP_ALIGNMENT: "Alignment",
+  BAND_PROP_MERGE_BORDER: "MergeBorder",
+  BAND_PROP_SUB_BANDS: "band_s",
+
+  MEASUREMENT: {
+    PIXEL: ["像素点", "象素点", "PIXEL"],
+    CM: ["厘米", "CM"],
+    INCH: ["英寸", "INCH"],
+  },
+
+  PROP_IS_ID: "isID",
+  PROP_ID_SEQ: "IDSeq",
+
+  TAB_FIELD_PROP_SORT: "Sort",
+  TAB_FIELD_PROP_SORT_VAL_NOSORT: "no_sort",
+  TAB_FIELD_PROP_SORT_VAL_ASC: "ascend",
+  TAB_FIELD_PROP_SORT_VAL_DESC: "descend",
+
+  DATA_DISCRETE_DATA: "discrete_data",
+  DATA_MASTER_DATA: "master_data",
+  DATA_DETAIL_DATA: "detail_data",
+  DATA_MASTER_DATA_EX: "master_data_ex",
+  DATA_DETAIL_DATA_EX: "detail_data_ex",
+
+  BLANK_FIELD_INDEX: -10,
+  BLANK_VALUE_INDEX: -100,
+  BLANK_PAGE_VALUE_INDEX: -200,
+
+  PROP_SEG_GRP_IDX: "segGrpRecStartIdx",
+  PROP_PRE_ADD_GRP_REC_INFO: "preAddPageGrpInfo",
+  PROP_INSERTED_GRP_REC: "insertedGrpRecAmt",
+  PROP_GRP_LINES: "group_lines_amt",
+
+  RUN_TYPE_BEFORE_ANALYZING: "before_analyzing",
+  RUN_TYPE_BEFORE_PAGING: "before_paging",
+  RUN_TYPE_BEFORE_OUTPUT: "before_output",
+  RUN_TYPE_BEFORE_COMBINE: "before_combine",
+  RUN_TYPE_AFTER_COMBINE: "after_combine",
+
+  RUN_TYPE_BEFORE_GROUP_TEXT_OUT: "before_group_text_output",
+
+  PAGE_STATUS: [
+    "EveryPage",
+    "FirstPage",
+    "LastPage",
+    "SegmentStart",
+    "SegmentEnd",
+    "Group",
+    "CrossRowEnd",
+    "CrossColEnd",
+  ],
+
+  CONTROL_PROPS: [
+    "Shrink",
+    "ShowZero",
+    "Horizon",
+    "Vertical",
+    "Wrap",
+    "VerticalForExcel",
+    "ShrinkFirst",
+    "CloseOutput",
+  ],
+  CONTROL_PROP_IDX_SHRINK: 0,
+  CONTROL_PROP_IDX_SHOW_ZERO: 1,
+  CONTROL_PROP_IDX_HORIZON: 2,
+  CONTROL_PROP_IDX_VERTICAL: 3,
+  CONTROL_PROP_IDX_WRAP: 4,
+  CONTROL_PROP_IDX_VERTICAL_EXCEL: 5,
+  CONTROL_PROP_IDX_SHRINK_FIRST: 6,
+  CONTROL_PROP_IDX_CLOSE_OUTPUT: 7,
+  BORDER_STYLE_PROPS: ["LineWeight", "DashStyle", "Color"],
+  PROP_LINE_WEIGHT: "LineWeight",
+  PROP_DASH_STYLE: "DashStyle",
+  PROP_COLOR: "Color",
+  FONT_PROPS: [
+    "Name",
+    "FontHeight",
+    "FontColor",
+    "FontBold",
+    "FontItalic",
+    "FontUnderline",
+    "FontStrikeOut",
+    "FontAngle",
+  ],
+  FONT_PROP_IDX_NAME: 0,
+  FONT_PROP_IDX_HEIGHT: 1,
+  FONT_PROP_IDX_COLOR: 2,
+  FONT_PROP_IDX_BOLD: 3,
+  FONT_PROP_IDX_ITALIC: 4,
+  FONT_PROP_IDX_UNDERLINE: 5,
+  FONT_PROP_IDX_STRIKEOUT: 6,
+  FONT_PROP_IDX_ANGLE: 7,
+
+  STATUS_NORMAL: 0,
+  STATUS_REPORT_START: 1,
+  STATUS_REPORT_END: 2,
+  STATUS_SEGMENT_START: 3,
+  STATUS_SEGMENT_END: 4,
+  STATUS_GROUP: 5,
+  STATUS_CROSS_ROW_END: 6,
+  STATUS_CROSS_COL_END: 7,
+
+  LAYOUT: ["Top", "Bottom", "Left", "Right", "Fulfill"],
+  LAYOUT_TOP: 0,
+  LAYOUT_BOTTOM: 1,
+  LAYOUT_LEFT: 2,
+  LAYOUT_RIGHT: 3,
+  LAYOUT_FULFILL: 4,
+
+  OUTPUT_ALIGN: {
+    H: ["left", "center", "right"],
+    V: ["top", "center", "bottom"],
+  },
+  H_ALIGN_IDX_LEFT: 0,
+  H_ALIGN_IDX_CENTER: 1,
+  H_ALIGN_IDX_RIGHT: 2,
+  V_ALIGN_IDX_TOP: 0,
+  V_ALIGN_IDX_CENTER: 1,
+  V_ALIGN_IDX_BOTTOM: 2,
+
+  CAL_TYPE: ["percentage", "abstract"],
+  CAL_TYPE_PERCENTAGE: 0,
+  CAL_TYPE_ABSTRACT: 1,
+
+  EVENT_TYPE: ["GRP_ON_CREATE", "FLOW_CONTENT_ON_CREATE"],
+  EVENT_IDX_GRP_ON_CREATE: 0,
+  EVENT_IDX_FLOW_CONTENT_ON_CREATE: 1,
+
+  PAGE_ORIENTATION_V_FIRST: 0,
+  PAGE_ORIENTATION_H_FIRST: 1,
+
+  ORIENTATION_PORTRAIT: "PORTRAIT",
+  ORIENTATION_LANDSCAPE: "LANDSCAPE",
+  ORIENTATION_PORTRAIT_CHN: "纵向",
+  ORIENTATION_LANDSCAPE_CHN: "横向",
+  SIZE_A3: [11.69, 16.54],
+  SIZE_A4: [8.27, 11.69],
+  SIZE_A5: [5.83, 8.27],
+  SIZE_B5: [6.93, 9.84],
+  SIZE_LETTER: [8.5, 11.0],
+  SIZE_LEGAL: [8.5, 14.0],
+  SIZE_16K: [7.75, 10.75],
+  SIZE_EXECUTIVE: [7.25, 10.5],
+
+  OUTPUT_OFFSET: [2, 2, 1, 3],
+  OFFSET_IDX_LEFT: 0,
+  OFFSET_IDX_RIGHT: 1,
+  OFFSET_IDX_TOP: 2,
+  OFFSET_IDX_BOTTOM: 3,
+
+  PROP_PAGE_SEQ: "page_seq",
+  PROP_PAGE_MERGE_BORDER: "page_merge_border",
+  PROP_CELLS: "cells",
+
+  PAGING_OPTION_NORMAL: "normal",
+  PAGING_OPTION_INFINITY: "infinity",
+
+  OUTPUT_TYPE_NORMAL: "normal",
+  OUTPUT_TYPE_SVG: "svg",
+  OUTPUT_TYPE_PDF: "pdf",
+  OUTPUT_TYPE_EXCEL: "excel",
+
+  DISPLAY_VAL_TYPE_NORMAL: 0,
+  DISPLAY_VAL_TYPE_GROUP: 1,
+  DISPLAY_VAL_TYPE_AUTO_HEIGHT: 2,
+
+  TYPE_FOLLOW_MODE: 1,
+
+  PAGE_SELF_DEFINE: "自定义",
+  PAGE_SPECIAL_MERGE_POS: "page_merge_pos",
+
+  PAGES_SIZE_STR: [
+    "A3",
+    "A4",
+    "A5",
+    "B5",
+    "LETTER",
+    "LEGAL",
+    "EXECUTIVE",
+    "16K",
+  ],
+  PAGES_SIZE_IDX: [8, 9, 11, 13, 1, 5, 7, 93],
+  PAGES_SIZE: [
+    [11.69, 16.54],
+    [8.27, 11.69],
+    [5.83, 8.27],
+    [6.93, 9.84],
+    [8.5, 11.0],
+    [8.5, 14.0],
+    [7.25, 10.5],
+    [7.25, 10.5],
+  ],
+
+  HUNDRED_PERCENT: 100.0,
+
+  VERTICAL_ANGLE: "90",
+  ANTI_VERTICAL_ANGLE: "-90",
+  VERTICAL_ANGLE_INT: 90,
+  ANTI_VERTICAL_ANGLE_INT: -90,
+
+  LAST_DEF: "",
 };

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

@@ -35,6 +35,8 @@
             <%include ./rpt_tpl_dtl_pre_hdl_addDummy.html %>
             <!--工程量清单数据处理-->
             <%include ./rpt_tpl_dtl_pre_hdl_change_quantities_bills.html %>
+            <!--含量指标报表,定制表辅表-->
+            <%include ./rpt_tpl_dtl_pre_hdl_aidReportList.html %>
         </div>
     </div>
 </div>

+ 11 - 0
web/maintain/report/html/rpt_tpl_dtl_pre_hdl_aidReportList.html

@@ -0,0 +1,11 @@
+<div id="div_aid_report_sort_bar">
+    <div class="form-group row" id="div_aid_report_list_bar">
+        <div class="input-group col-5">
+            <div class="input-group-addon">定制表格</div>
+            <select class="form-control input-sm" id="select_aid_report_data_select"
+                onchange="preHandleAidReportListObj.onAidReportIDChange(this)">
+               
+            </select>
+        </div>
+    </div>
+</div>

+ 237 - 193
web/maintain/report/js/rpt_tpl_helper.js

@@ -4,208 +4,252 @@
  * 管理:编办、工程类型等
  */
 let tplHelper = {
-    createDftRptTpl: function(treeNode) {
-        var me = this, rst = {GROUP_KEY: 'CONSTRUCT', ID_KEY: null};
-        rst[JV.NODE_MAIN_INFO] = me.createDftRptMainInfo(treeNode.name);
-        rst[JV.NODE_FIELD_MAP] = {};
-        rst[JV.NODE_BAND_COLLECTION] = {};
-        rst[JV.NODE_CROSS_INFO] = {};
-        rst[JV.NODE_DISCRETE_PARAMS] = {};
-        rst[JV.NODE_FORMULAS] = {};
-        rst[JV.NODE_FLOW_INFO] = {};
-        rst[JV.NODE_NO_MAPPING_FIELDS] = {};
-        return rst;
-    },
-    createDftRptMainInfo: function(rptName) {
-        let rst = {};
-        rst[JV.NODE_MAIN_INFO_RPT_NAME] = rptName;
-        rst[JV.PROP_UNITS] = JV.MEASUREMENT.CM[0];
+  createDftRptTpl: function (treeNode) {
+    var me = this,
+      rst = { GROUP_KEY: "CONSTRUCT", ID_KEY: null };
+    rst[JV.NODE_MAIN_INFO] = me.createDftRptMainInfo(treeNode.name);
+    rst[JV.NODE_FIELD_MAP] = {};
+    rst[JV.NODE_BAND_COLLECTION] = {};
+    rst[JV.NODE_CROSS_INFO] = {};
+    rst[JV.NODE_DISCRETE_PARAMS] = {};
+    rst[JV.NODE_FORMULAS] = {};
+    rst[JV.NODE_FLOW_INFO] = {};
+    rst[JV.NODE_NO_MAPPING_FIELDS] = {};
+    return rst;
+  },
+  createDftRptMainInfo: function (rptName) {
+    let rst = {};
+    rst[JV.NODE_MAIN_INFO_RPT_NAME] = rptName;
+    rst[JV.PROP_UNITS] = JV.MEASUREMENT.CM[0];
 
-        rst[JV.NODE_PAGE_INFO] = {};
-        rst[JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = "A4";
-        rst[JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] = "LANDSCAPE";
+    rst[JV.NODE_PAGE_INFO] = {};
+    rst[JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = "A4";
+    rst[JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] = "LANDSCAPE";
 
-        rst[JV.NODE_MARGINS] = {};
-        rst[JV.NODE_MARGINS][JV.PROP_LEFT] = 0.8;
-        rst[JV.NODE_MARGINS][JV.PROP_RIGHT] = 0.8;
-        rst[JV.NODE_MARGINS][JV.PROP_TOP] = 0.8;
-        rst[JV.NODE_MARGINS][JV.PROP_BOTTOM] = 0.8;
+    rst[JV.NODE_MARGINS] = {};
+    rst[JV.NODE_MARGINS][JV.PROP_LEFT] = 0.8;
+    rst[JV.NODE_MARGINS][JV.PROP_RIGHT] = 0.8;
+    rst[JV.NODE_MARGINS][JV.PROP_TOP] = 0.8;
+    rst[JV.NODE_MARGINS][JV.PROP_BOTTOM] = 0.8;
 
-        return rst;
-    },
+    return rst;
+  },
 
-    getJsTxt: function(destDom) {
-        let me = this;
-        if (destDom && me.reCombineRptTpl()) {
-            let rptTpl = zTreeOprObj.currentNode.rptTpl;
-            destDom.value = JSON.stringify(rptTpl, null, 4);
-        }
-    },
-
-    setFromJsTxt: function (srcDom) {
-        if (srcDom && zTreeOprObj.currentNode && zTreeOprObj.currentNode.refId > 0 &&
-            confirm("导入将覆盖原模板所有信息,请确认!")) {
-            try {
-                // let rptTpl = JSON.parse(srcDom.value);
-                let rptTpl = JSON.parse(stringUtil.replaceAll(srcDom.value, "\t", " "));
-                // JSON.format()
-                delete rptTpl["__v"];
-                delete rptTpl["_id"];
-                rptTpl["ID"] = zTreeOprObj.currentNode.rptTpl["ID"];
-                //以下从zTreeOprObj.chkAndRreshRefTpl中参考
-                zTreeOprObj.currentNode.rptTpl = rptTpl;
-                zTreeOprObj.currentNode.rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MAIN_INFO_RPT_NAME] = zTreeOprObj.currentNode.name;
-                if (zTreeOprObj.currentNode.rptTpl["GROUP_KEY"]) {
-                    let grp_keys = zTreeOprObj.currentNode.rptTpl["GROUP_KEY"].split('_');
-                    if (grp_keys.length > 0) {
-                        grp_keys[1] = zTreeOprObj.currentNode.name;
-                    }
-                    zTreeOprObj.currentNode.rptTpl["GROUP_KEY"] = grp_keys.join("_");
-                }
-                tplHelper.refreshTplView(zTreeOprObj.currentNode.rptTpl);
-                displayMessage("导入成功!", "green", 1000, "id_after_js_load_lbl");
-            } catch (ex) {
-                console.log(ex);
-                // alert("导入失败!请仔细检查JS对象的正确性");
-                displayMessage("导入失败!请仔细检查JS对象的正确性!", "red", 3000, "id_after_js_load_lbl");
-            }
-        }
-    },
+  getJsTxt: function (destDom) {
+    let me = this;
+    if (destDom && me.reCombineRptTpl()) {
+      let rptTpl = zTreeOprObj.currentNode.rptTpl;
+      destDom.value = JSON.stringify(rptTpl, null, 4);
+    }
+  },
 
-    refreshTplView: function (rptTpl) {
-        if (rptTpl) {
-            //1. 模板信息
-            $("#rptTplName")[0].value = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MAIN_INFO_RPT_NAME];
-            $("#rptTplPageSize")[0].selectedIndex = JV.PAGES_SIZE_STR.indexOf(rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE]);
-            if (rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] === JV.ORIENTATION_PORTRAIT ||
-                rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] === JV.ORIENTATION_PORTRAIT_CHN) {
-                $("#rptTplPageOrientation")[0].selectedIndex = 1;
-            } else {
-                $("#rptTplPageOrientation")[0].selectedIndex = 0;
-            }
-            if (rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_CROSS_DISPLAY_ORDER] === JV.PAGE_ORIENTATION_H_FIRST) {
-                $("#element_cross_display_seq")[0].selectedIndex = 1;
-            } else {
-                $("#element_cross_display_seq")[0].selectedIndex = 0;
-            }
-            if (rptTpl[JV.NODE_FLOW_INFO]) {
-                $("#multiColCnt")[0].style.display = "";
-                $("#flow_content_height_div")[0].style.display = "";
-                $("#cross_row_height_div")[0].style.display = "none";
-                $("#element_content_height").get(0).removeAttribute("disabled");
-                $("#element_content_width").get(0).disabled = "disabled" ;
-                $("#rptTplMultiCols")[0].value = rptTpl[JV.NODE_FLOW_INFO][JV.PROP_MULTI_COLUMN];
-                $("#rptTplEraseBlankRows").get(0).checked = !!(rptTpl[JV.NODE_FLOW_INFO][JV.PROP_ERASE_BLANK_ROWS]);
-                $("#element_cross_display_seq").get(0).disabled = "disabled" ;
-            } else if (rptTpl[JV.NODE_CROSS_INFO]) {
-                $("#flow_content_height_div")[0].style.display = "none";
-                $("#cross_row_height_div")[0].style.display = "";
-                $("#multiColCnt")[0].style.display = "none";
-                $("#element_content_width").get(0).removeAttribute("disabled");
-                $("#element_content_height").get(0).disabled = "disabled" ;
-                $("#element_cross_display_seq").get(0).removeAttribute("disabled");
-            } else {
-                $("#multiColCnt")[0].style.display = "none";
-                $("#element_cross_display_seq").get(0).disabled = "disabled" ;
-            }
-            // $("#rptTplMarginLeft")[0].value = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT];
-            // $("#rptTplMarginRight")[0].value = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT];
-            // $("#rptTplMarginTop")[0].value = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_TOP];
-            // $("#rptTplMarginBottom")[0].value = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_BOTTOM];
-            //2. 模板布局
-            bandTreeOprObj.iniTree(rptTpl);
-            //3. 指标映射
-            fieldMapTreeOprObj.iniTree(rptTpl);
-            //4. 指标摆放
-            dataInfoMapTreeOprObj.iniTree(rptTpl);
-            discreteFieldParamTreeOprObj.iniTree(rptTpl);
-            dataInfoMapTreeOprObj.iniDataMap();
-            //5. 数据预处理
-            preHandleObj.iniTree(rptTpl);
-            preHandleObj.hide_all_dom();
-            //6. 计算式
-            calculationTreeOprObj.iniTree(rptTpl);
-            //7. 刷白js对象text区域
-            document.getElementById('tplScriptTextContent').value = "";
-            //9. 刷白预览区域
-            let canvas = $('#tplCanvas')[0];
-            JpcCanvasOutput.cleanCanvas(canvas);
-            preview_util.drawBorder(canvas);
-            // JpcCanvasOutput.drawBorderLine(canvas);
+  setFromJsTxt: function (srcDom) {
+    if (
+      srcDom &&
+      zTreeOprObj.currentNode &&
+      zTreeOprObj.currentNode.refId > 0 &&
+      confirm("导入将覆盖原模板所有信息,请确认!")
+    ) {
+      try {
+        // let rptTpl = JSON.parse(srcDom.value);
+        let rptTpl = JSON.parse(stringUtil.replaceAll(srcDom.value, "\t", " "));
+        // JSON.format()
+        delete rptTpl["__v"];
+        delete rptTpl["_id"];
+        rptTpl["ID"] = zTreeOprObj.currentNode.rptTpl["ID"];
+        //以下从zTreeOprObj.chkAndRreshRefTpl中参考
+        zTreeOprObj.currentNode.rptTpl = rptTpl;
+        zTreeOprObj.currentNode.rptTpl[JV.NODE_MAIN_INFO][
+          JV.NODE_MAIN_INFO_RPT_NAME
+        ] = zTreeOprObj.currentNode.name;
+        if (zTreeOprObj.currentNode.rptTpl["GROUP_KEY"]) {
+          let grp_keys = zTreeOprObj.currentNode.rptTpl["GROUP_KEY"].split("_");
+          if (grp_keys.length > 0) {
+            grp_keys[1] = zTreeOprObj.currentNode.name;
+          }
+          zTreeOprObj.currentNode.rptTpl["GROUP_KEY"] = grp_keys.join("_");
         }
-    },
+        tplHelper.refreshTplView(zTreeOprObj.currentNode.rptTpl);
+        displayMessage("导入成功!", "green", 1000, "id_after_js_load_lbl");
+      } catch (ex) {
+        console.log(ex);
+        // alert("导入失败!请仔细检查JS对象的正确性");
+        displayMessage(
+          "导入失败!请仔细检查JS对象的正确性!",
+          "red",
+          3000,
+          "id_after_js_load_lbl"
+        );
+      }
+    }
+  },
 
-    saveRptTpl: function (directSave) {
-        let me = this, params = null;
-        if (directSave || me.reCombineRptTpl()) {
-            displayMessage("正在保存...", "yellow", 1000);
-            let rptTpl = zTreeOprObj.currentNode.rptTpl;
-            params = {};
-            params.rptTpl = JSON.stringify(rptTpl);
-            CommonAjax.postEx("report_tpl_api/updateRptTpl", params, 20000, true, function(result){
-                    if (result) {
-                        displayMessage("保存成功!", "green", 3000);
-                    } else {
-                        displayMessage("保存失败!", "red", 3000);
-                    }
-                }, null, null
-            );
-        }
-    },
+  refreshTplView: function (rptTpl) {
+    if (rptTpl) {
+      //1. 模板信息
+      $("#rptTplName")[0].value =
+        rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MAIN_INFO_RPT_NAME];
+      $("#rptTplPageSize")[0].selectedIndex = JV.PAGES_SIZE_STR.indexOf(
+        rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE]
+      );
+      if (
+        rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] ===
+          JV.ORIENTATION_PORTRAIT ||
+        rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION] ===
+          JV.ORIENTATION_PORTRAIT_CHN
+      ) {
+        $("#rptTplPageOrientation")[0].selectedIndex = 1;
+      } else {
+        $("#rptTplPageOrientation")[0].selectedIndex = 0;
+      }
+      if (
+        rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][
+          JV.PROP_CROSS_DISPLAY_ORDER
+        ] === JV.PAGE_ORIENTATION_H_FIRST
+      ) {
+        $("#element_cross_display_seq")[0].selectedIndex = 1;
+      } else {
+        $("#element_cross_display_seq")[0].selectedIndex = 0;
+      }
+      if (rptTpl[JV.NODE_FLOW_INFO]) {
+        $("#multiColCnt")[0].style.display = "";
+        $("#flow_content_height_div")[0].style.display = "";
+        $("#cross_row_height_div")[0].style.display = "none";
+        $("#element_content_height").get(0).removeAttribute("disabled");
+        $("#element_content_width").get(0).disabled = "disabled";
+        $("#rptTplMultiCols")[0].value =
+          rptTpl[JV.NODE_FLOW_INFO][JV.PROP_MULTI_COLUMN];
+        $("#rptTplEraseBlankRows").get(0).checked =
+          !!rptTpl[JV.NODE_FLOW_INFO][JV.PROP_ERASE_BLANK_ROWS];
+        $("#element_cross_display_seq").get(0).disabled = "disabled";
+      } else if (rptTpl[JV.NODE_CROSS_INFO]) {
+        $("#flow_content_height_div")[0].style.display = "none";
+        $("#cross_row_height_div")[0].style.display = "";
+        $("#multiColCnt")[0].style.display = "none";
+        $("#element_content_width").get(0).removeAttribute("disabled");
+        $("#element_content_height").get(0).disabled = "disabled";
+        $("#element_cross_display_seq").get(0).removeAttribute("disabled");
+      } else {
+        $("#multiColCnt")[0].style.display = "none";
+        $("#element_cross_display_seq").get(0).disabled = "disabled";
+      }
+      // $("#rptTplMarginLeft")[0].value = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT];
+      // $("#rptTplMarginRight")[0].value = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT];
+      // $("#rptTplMarginTop")[0].value = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_TOP];
+      // $("#rptTplMarginBottom")[0].value = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_BOTTOM];
+      //2. 模板布局
+      bandTreeOprObj.iniTree(rptTpl);
+      //3. 指标映射
+      fieldMapTreeOprObj.iniTree(rptTpl);
+      //4. 指标摆放
+      dataInfoMapTreeOprObj.iniTree(rptTpl);
+      discreteFieldParamTreeOprObj.iniTree(rptTpl);
+      dataInfoMapTreeOprObj.iniDataMap();
+      //5. 数据预处理
+      preHandleObj.iniTree(rptTpl);
+      preHandleObj.hide_all_dom();
+      //6. 计算式
+      calculationTreeOprObj.iniTree(rptTpl);
+      //7. 刷白js对象text区域
+      document.getElementById("tplScriptTextContent").value = "";
+      //9. 刷白预览区域
+      let canvas = $("#tplCanvas")[0];
+      JpcCanvasOutput.cleanCanvas(canvas);
+      preview_util.drawBorder(canvas);
+      // JpcCanvasOutput.drawBorderLine(canvas);
+    }
+  },
 
-    saveDirectFromJs: function (srcDom) {
-        if (confirm("将覆盖原模板所有信息并保存,请确认!")) {
-            let me = this;
-            try {
-                //1. 覆盖原模板信息
-                let rptTpl = JSON.parse(stringUtil.replaceAll(srcDom.value, "\t", " "));
-                // JSON.format()
-                delete rptTpl["__v"];
-                delete rptTpl["_id"];
-                rptTpl["ID"] = zTreeOprObj.currentNode.rptTpl["ID"];
-                //以下从zTreeOprObj.chkAndRreshRefTpl中参考
-                zTreeOprObj.currentNode.rptTpl = rptTpl;
-                zTreeOprObj.currentNode.rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MAIN_INFO_RPT_NAME] = zTreeOprObj.currentNode.name;
-                if (zTreeOprObj.currentNode.rptTpl["GROUP_KEY"]) {
-                    let grp_keys = zTreeOprObj.currentNode.rptTpl["GROUP_KEY"].split('_');
-                    if (grp_keys.length > 0) {
-                        grp_keys[1] = zTreeOprObj.currentNode.name;
-                    }
-                    zTreeOprObj.currentNode.rptTpl["GROUP_KEY"] = grp_keys.join("_");
-                }
-                tplHelper.refreshTplView(zTreeOprObj.currentNode.rptTpl);
-                displayMessage("导入成功!", "green", 3000, "id_after_js_load_lbl");
-                //2. 直接保存
-                me.saveRptTpl(true);
-            } catch (ex) {
-                console.log(ex);
-                displayMessage("导入失败!请仔细检查JS对象的正确性!", "red", 3000, "id_after_js_load_lbl");
-            }
-        }
-    },
+  saveRptTpl: function (directSave) {
+    let me = this,
+      params = null;
+    if (directSave || me.reCombineRptTpl()) {
+      displayMessage("正在保存...", "yellow", 1000);
+      let rptTpl = zTreeOprObj.currentNode.rptTpl;
+      params = {};
+      params.rptTpl = JSON.stringify(rptTpl);
+      debugger;
+      CommonAjax.postEx(
+        "report_tpl_api/updateRptTpl",
+        params,
+        20000,
+        true,
+        function (result) {
+          if (result) {
+            displayMessage("保存成功!", "green", 3000);
+          } else {
+            displayMessage("保存失败!", "red", 3000);
+          }
+        },
+        null,
+        null
+      );
+    }
+  },
 
-    reCombineRptTpl: function () {
-        let rst = true;
-        if (zTreeOprObj.currentNode && zTreeOprObj.currentNode.nodeType === RT.NodeType.TEMPLATE && zTreeOprObj.currentNode.rptTpl !== null) {
-            let rptTpl = zTreeOprObj.currentNode.rptTpl;
-            //1. 模板信息
-            zTreeOprObj.extractMainInfo(rptTpl);
-            //2. 模板布局
-            bandTreeOprObj.extractBands(rptTpl);
-            //3. 指标映射
-            fieldMapTreeOprObj.extractFieldMaps(rptTpl);
-            //4. 指标摆放
-            dataInfoMapTreeOprObj.extractTabFields(rptTpl);
-            dataInfoMapTreeOprObj.extractDiscreteFieldParam(rptTpl);
-            discreteFieldParamTreeOprObj.extractFieldMaps(rptTpl);
-            //5. 指标预处理
-            preHandleObj.extractTabFields(rptTpl);
-            //6. 计算式
-            calculationTreeOprObj.extractCalculation(rptTpl);
-        } else {
-            rst = false;
+  saveDirectFromJs: function (srcDom) {
+    if (confirm("将覆盖原模板所有信息并保存,请确认!")) {
+      let me = this;
+      try {
+        //1. 覆盖原模板信息
+        let rptTpl = JSON.parse(stringUtil.replaceAll(srcDom.value, "\t", " "));
+        // JSON.format()
+        delete rptTpl["__v"];
+        delete rptTpl["_id"];
+        rptTpl["ID"] = zTreeOprObj.currentNode.rptTpl["ID"];
+        //以下从zTreeOprObj.chkAndRreshRefTpl中参考
+        zTreeOprObj.currentNode.rptTpl = rptTpl;
+        zTreeOprObj.currentNode.rptTpl[JV.NODE_MAIN_INFO][
+          JV.NODE_MAIN_INFO_RPT_NAME
+        ] = zTreeOprObj.currentNode.name;
+        if (zTreeOprObj.currentNode.rptTpl["GROUP_KEY"]) {
+          let grp_keys = zTreeOprObj.currentNode.rptTpl["GROUP_KEY"].split("_");
+          if (grp_keys.length > 0) {
+            grp_keys[1] = zTreeOprObj.currentNode.name;
+          }
+          zTreeOprObj.currentNode.rptTpl["GROUP_KEY"] = grp_keys.join("_");
         }
-        return rst;
+        tplHelper.refreshTplView(zTreeOprObj.currentNode.rptTpl);
+        displayMessage("导入成功!", "green", 3000, "id_after_js_load_lbl");
+        //2. 直接保存
+        me.saveRptTpl(true);
+      } catch (ex) {
+        console.log(ex);
+        displayMessage(
+          "导入失败!请仔细检查JS对象的正确性!",
+          "red",
+          3000,
+          "id_after_js_load_lbl"
+        );
+      }
     }
+  },
 
-}
+  reCombineRptTpl: function () {
+    let rst = true;
+    if (
+      zTreeOprObj.currentNode &&
+      zTreeOprObj.currentNode.nodeType === RT.NodeType.TEMPLATE &&
+      zTreeOprObj.currentNode.rptTpl !== null
+    ) {
+      let rptTpl = zTreeOprObj.currentNode.rptTpl;
+      //1. 模板信息
+      zTreeOprObj.extractMainInfo(rptTpl);
+      //2. 模板布局
+      bandTreeOprObj.extractBands(rptTpl);
+      //3. 指标映射
+      fieldMapTreeOprObj.extractFieldMaps(rptTpl);
+      //4. 指标摆放
+      dataInfoMapTreeOprObj.extractTabFields(rptTpl);
+      dataInfoMapTreeOprObj.extractDiscreteFieldParam(rptTpl);
+      discreteFieldParamTreeOprObj.extractFieldMaps(rptTpl);
+      //5. 指标预处理
+      preHandleObj.extractTabFields(rptTpl);
+      //6. 计算式
+      calculationTreeOprObj.extractCalculation(rptTpl);
+    } else {
+      rst = false;
+    }
+    return rst;
+  },
+};

+ 19 - 0
web/maintain/report/js/rpt_tpl_main.js

@@ -1354,6 +1354,25 @@ let zTreeOprObj = {
           null,
           null
         );
+        // 获取含量指标模板列表
+        CommonAjax.postEx(
+          "report_tpl_api/getAidReportDataList",
+          { compilationID: $("#compilations").val() },
+          20000,
+          true,
+          function (result) {
+            $("#select_aid_report_data_select").empty();
+            result.forEach((i) => {
+              if (i.aidReportID) {
+                $("#select_aid_report_data_select").append(
+                  `<option value="${i.aidReportID}">${i.aidReportName}</option>`
+                );
+              }
+            });
+          },
+          null,
+          null
+        );
       } else {
         me.currentNode.rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MAIN_INFO_RPT_NAME] =
           me.currentNode.name;

File diff suppressed because it is too large
+ 1776 - 1197
web/maintain/report/js/rpt_tpl_pre_handle.js