فهرست منبع

Merge branch '1.0.0_online' of http://192.168.1.12:3000/SmartCost/ConstructionOperation

laiguoran 7 سال پیش
والد
کامیت
dfe097cc8a
57فایلهای تغییر یافته به همراه619 افزوده شده و 155 حذف شده
  1. 3 1
      .gitignore
  2. 2 2
      Dockerfile
  3. 3 2
      Dockerfile_pp
  4. 4 2
      Dockerfile_qa
  5. 17 2
      config/config.js
  6. 3 1
      config/db/db_manager.js
  7. 2 1
      modules/all_models/bills_template_items.js
  8. 4 4
      modules/bills_lib/controllers/views_permissionController.js
  9. 4 1
      modules/bills_template_lib/controllers/bills_template_controller.js
  10. 2 1
      modules/main_col_lib/controllers/main_col_controller.js
  11. 9 4
      modules/ration_repository/controllers/repository_views_controller.js
  12. 15 25
      modules/reports/controllers/rpt_tpl_controller.js
  13. 9 1
      modules/reports/facade/rpt_tpl_data_facade.js
  14. 13 7
      modules/reports/facade/rpt_tpl_tree_node_facade.js
  15. 1 0
      modules/reports/routes/rpt_tpl_router.js
  16. 107 10
      modules/reports/rpt_component/jpc_flow_tab.js
  17. 22 0
      modules/reports/rpt_component/jpc_rte.js
  18. BIN
      modules/reports/util/pdf_base_files/Smart-italic.ttf
  19. BIN
      modules/reports/util/pdf_base_files/Smart.ttf
  20. BIN
      modules/reports/util/pdf_base_files/hwxsb.ttf
  21. 23 5
      modules/reports/util/rpt_excel_util.js
  22. 28 0
      modules/reports/util/rpt_font_util.js
  23. 18 24
      modules/reports/util/rpt_pdf_util.js
  24. 5 9
      modules/reports/util/rpt_svg_util.js
  25. 53 0
      modules/reports/util/rpt_tmp_file_sweep.js
  26. 3 2
      modules/std_billsGuidance_lib/controllers/viewController.js
  27. 3 2
      modules/std_glj_lib/controllers/viewsController.js
  28. 9 4
      modules/users/controllers/compilation_controller.js
  29. 3 1
      modules/users/controllers/dashboard_controller.js
  30. 4 1
      modules/users/controllers/manager_controller.js
  31. 6 2
      modules/users/controllers/notify_controller.js
  32. 3 1
      modules/users/controllers/tool_controller.js
  33. 3 1
      modules/users/controllers/user_controller.js
  34. 26 0
      public/web/common_ajax.js
  35. 2 1
      public/web/rpt_value_define.js
  36. 18 0
      web/maintain/bill_template_lib/js/bills_template_edit.js
  37. 1 1
      web/maintain/billsGuidance_lib/html/zhiyin.html
  38. 1 1
      web/maintain/bills_lib/html/neirong.html
  39. 1 1
      web/maintain/bills_lib/html/qingdan.html
  40. 1 1
      web/maintain/bills_lib/html/tezheng.html
  41. 1 1
      web/maintain/common/html/edit_layout.html
  42. 1 1
      web/maintain/main_col_lib/html/main.html
  43. 4 0
      web/maintain/main_col_lib/js/main_tree_col.js
  44. 1 1
      web/maintain/ration_repository/anzhuang.html
  45. 1 1
      web/maintain/ration_repository/dinge.html
  46. 1 1
      web/maintain/ration_repository/fuzhu.html
  47. 1 1
      web/maintain/ration_repository/gongliao.html
  48. 44 1
      web/maintain/report/js/jpc_output.js
  49. 39 17
      web/maintain/report/js/rpt_tpl_helper.js
  50. 70 6
      web/maintain/report/js/rpt_tpl_main.js
  51. 1 0
      web/maintain/report/js/rpt_tpl_preview_util.js
  52. 6 0
      web/maintain/report/rpt_tpl_detail.html
  53. 1 1
      web/maintain/report/rpt_tpl_detail_calculation.html
  54. 14 0
      web/maintain/report/rpt_tpl_script_text.html
  55. 1 1
      web/maintain/std_glj_lib/html/gongliao.html
  56. 1 1
      web/users/views/layout/layout.html
  57. 1 1
      web/users/views/login/index.html

+ 3 - 1
.gitignore

@@ -2,4 +2,6 @@ node_modules/
 .git/
 dist/
 .idea/
-tmp/
+tmp/
+modules/reports/util/pdf_base_files/*.ttf
+modules/reports/util/pdf_base_files/*.ttc

+ 2 - 2
Dockerfile

@@ -1,8 +1,8 @@
-FROM operationbase:latest
+FROM operationbase:2.0
 
 WORKDIR /ConstructionOperation
 
-RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionOperation master
+COPY . /ConstructionOperation
 
 RUN mkdir tmp
 

+ 3 - 2
Dockerfile_pp

@@ -1,9 +1,10 @@
-FROM operationbase:latest
+FROM operationbase:2.0
 
 WORKDIR /ConstructionOperation
 
-RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionOperation master
+COPY . /ConstructionOperation
 
+RUN mkdir tmp
 
 RUN cnpm install
 

+ 4 - 2
Dockerfile_qa

@@ -1,8 +1,10 @@
-FROM operationbase:latest
+FROM operationbase:2.0
 
 WORKDIR /ConstructionOperation
 
-RUN git pull http://192.168.1.12:3000/SmartCost/ConstructionOperation master
+COPY .  /ConstructionOperation
+
+RUN mkdir tmp
 
 RUN cnpm install
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 17 - 2
config/config.js


+ 3 - 1
config/db/db_manager.js

@@ -49,7 +49,9 @@ module.exports = {
     connect:function (env="local") {
         var config = require("../config.js");
         var dbURL = 'mongodb://' + config[env].server + ":" + config[env].port + '/scConstruct';
-        if(config[env].options){
+        if(config[env].dbURL){
+            mg.connect(config[env].dbURL,{connectTimeoutMS: 20000,useMongoClient: true});
+        } else if(config[env].options){
             mg.connect(dbURL,config[env].options);
         }else {
             mg.connect(dbURL,{connectTimeoutMS: 20000,useMongoClient: true});//useMongoClient': true*! //报 DeprecationWarning: `open()` is deprecated in mongoose这个错

+ 2 - 1
modules/all_models/bills_template_items.js

@@ -34,7 +34,8 @@ let BillsTemplateSchema = {
     //计算基数
     calcBase: String,
     //费率ID
-    feeRateID:Number
+    feeRateID:Number,
+    quantity: String,
 };
 
 mongoose.model(collectionName, new Schema(BillsTemplateSchema, {versionKey: false, collection: collectionName}));

+ 4 - 4
modules/bills_lib/controllers/views_permissionController.js

@@ -3,7 +3,7 @@
  * Created by Zhong on 2017/8/2.
  */
 import baseController from "../../common/base/base_controller";
-
+let config = require("../../../config/config.js");
 class viewsPermContr extends baseController{
     redirectStdBillsMain(req, res){
         res.render("maintain/bills_lib/html/main.html",
@@ -12,15 +12,15 @@ class viewsPermContr extends baseController{
     }
     redirectStdBills(req, res){
         res.render("maintain/bills_lib/html/qingdan.html",
-            {userAccount: req.session.managerData.username});
+            {userAccount: req.session.managerData.username, LicenseKey:config.getLicenseKey(process.env.NODE_ENV)});
     }
     redirectStdJobs(req, res){
         res.render('maintain/bills_lib/html/neirong.html',
-            {userAccount: req.session.managerData.username});
+            {userAccount: req.session.managerData.username, LicenseKey:config.getLicenseKey(process.env.NODE_ENV)});
     }
     redirectStdItems(req, res){
         res.render('maintain/bills_lib/html/tezheng.html',
-            {userAccount: req.session.managerData.username});
+            {userAccount: req.session.managerData.username, LicenseKey:config.getLicenseKey(process.env.NODE_ENV)});
     }
 }
 

+ 4 - 1
modules/bills_template_lib/controllers/bills_template_controller.js

@@ -9,6 +9,7 @@ import BaseController from "../../common/base/base_controller";
 import billsTemplateFacade from "../facade/bills_template_facade";
 import {default as BillsFixedFlagConst, List as BillsFixedFlagList} from "../../common/const/bills_fixed.js";
 import {default as BillsTypeFlagConst, List as BillsTypeFlagList} from "../../common/const/bills_type.js";
+let config = require("../../../config/config.js");
 
 class BillsTemplateController extends BaseController {
 
@@ -26,7 +27,8 @@ class BillsTemplateController extends BaseController {
             userAccount: request.session.managerData.username,
             userID: request.session.managerData.userID,
             templateLibs:templateLibs,
-            layout: 'maintain/common/html/layout'
+            layout: 'maintain/common/html/layout',
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
 
         response.render("maintain/bill_template_lib/html/main", randerData);
@@ -68,6 +70,7 @@ class BillsTemplateController extends BaseController {
                 billsFixedFlagList: JSON.stringify(BillsFixedFlagList),
                 billsTypeFlagList: JSON.stringify(BillsTypeFlagList),
                 libID:libID,
+                LicenseKey:config.getLicenseKey(process.env.NODE_ENV),
                 layout: 'maintain/common/html/edit_layout'
             };
             response.render("maintain/bill_template_lib/html/edit", randerData);

+ 2 - 1
modules/main_col_lib/controllers/main_col_controller.js

@@ -8,7 +8,7 @@
  */
 import BaseController from "../../common/base/base_controller";
 import mainColFacade from "../facade/main_col_facade";
-
+let config = require("../../../config/config.js");
 
 class MainColController extends BaseController {
 
@@ -26,6 +26,7 @@ class MainColController extends BaseController {
             userAccount: request.session.managerData.username,
             userID: request.session.managerData.userID,
             mainColLibs:mainColLibs,
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV),
             layout: 'maintain/common/html/layout'
         };
 

+ 9 - 4
modules/ration_repository/controllers/repository_views_controller.js

@@ -2,6 +2,7 @@
  * Created by Zhong on 2017/8/3.
  */
 import BaseController from "../../common/base/base_controller";
+let config = require("../../../config/config.js");
 class ViewsController extends BaseController{
     redirectMain(req, res){
         res.render('maintain/ration_repository/main.html',
@@ -22,7 +23,8 @@ class ViewsController extends BaseController{
                 userID: req.session.managerData.userID,
                 redirectGlj: redirectGlj,
                 redirectCoe: redirectCoe,
-                redirectInstallation: redirectInstallation
+                redirectInstallation: redirectInstallation,
+                LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
             });
     }
     redirectGlj(req, res){
@@ -36,7 +38,8 @@ class ViewsController extends BaseController{
                 userID: req.session.managerData.userID,
                 redirectRation: redirectRation,
                 redirectCoe: redirectCoe,
-                redirectInstallation: redirectInstallation
+                redirectInstallation: redirectInstallation,
+                LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
             });
     }
     redirectCoeList(req, res){
@@ -50,7 +53,8 @@ class ViewsController extends BaseController{
                 userID: req.session.managerData.userID,
                 redirectGlj: redirectGlj,
                 redirectRation: redirectRation,
-                redirectInstallation: redirectInstallation
+                redirectInstallation: redirectInstallation,
+                LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
             });
     }
     redirectInstallation(req, res){
@@ -64,7 +68,8 @@ class ViewsController extends BaseController{
                 userID: req.session.managerData.userID,
                 redirectGlj: redirectGlj,
                 redirectCoe: redirectCoe,
-                redirectRation: redirectRation
+                redirectRation: redirectRation,
+                LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
             });
     }
 }

+ 15 - 25
modules/reports/controllers/rpt_tpl_controller.js

@@ -132,6 +132,21 @@ let mExport = {
             }
         });
     },
+    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;
+        if (!compilationId) {
+            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;
@@ -268,30 +283,6 @@ let mExport = {
             })
         }
     },
-    // createTplTreeNode: function(req, res){
-    //     let params = JSON.parse(req.body.params),
-    //         lastNodeId = params.lastNodeId,
-    //         nodeData = params.rawNodeData;
-    //     counter.counterDAO.getIDAfterCount(counter.moduleName.report, 1, function(err, result){
-    //         nodeData.ID = result.value.sequence_value;
-    //         let node = new TreeNodeModel(nodeData);
-    //         node.save(function (err, result) {
-    //             if (err) {
-    //                 callback(req,res, "树节点错误!", "", null);
-    //             } else {
-    //                 if (lastNodeId > 0) {
-    //                     TreeNodeModel.update({ID: lastNodeId}, {"NextSiblingID": nodeData.ID}, function(err, rst){
-    //                         if (err) {
-    //                             callback(req,res, "树节点错误!", "", null);
-    //                         } else {
-    //                             callback(req,res, false, "", result);
-    //                         }
-    //                     });
-    //                 } else callback(req,res, false, "", result);
-    //             }
-    //         });
-    //     });
-    // },
     getNewNodeID: function(req, res) {
         let params = JSON.parse(req.body.params),
             scope = params.scope;
@@ -324,7 +315,6 @@ let mExport = {
                     if (err) {
                         callback(req,res, "报表模板创建错误", "", null);
                     } else {
-                        //TreeNodeModel.update();
                         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) {

+ 9 - 1
modules/reports/facade/rpt_tpl_data_facade.js

@@ -14,6 +14,7 @@ module.exports = {
 
 function prepareProjectData(userId, prjId, filter, callback) {
     let rawDataObj = null;
+    let basicInformation = prjMdl.project.getBasicInfo(prjId);
     prjMdl.project.getUserProject(userId, prjId, function(err, msg, rst){
         if (!err) {
             rawDataObj = {};
@@ -21,7 +22,14 @@ function prepareProjectData(userId, prjId, filter, callback) {
             projectDataMdl.getFilterData(prjId, filter, function (results) {
                 if (results) {
                     rawDataObj.prjData = results;
-                    callback(false, 'Succeeded!', rawDataObj);
+                    basicInformation.then(function(basicRst) {
+                        if (basicRst !== null && basicRst !== undefined) {
+                            let doc = (rawDataObj.prj._doc)?rawDataObj.prj._doc:rawDataObj.prj;
+                            doc.property.basicInformation = basicRst;
+                        }
+                        callback(false, 'Succeeded!', rawDataObj);
+                    });
+                    // callback(false, 'Succeeded!', rawDataObj);
                 } else {
                     callback(true, 'No data were found!', null);
                 }

+ 13 - 7
modules/reports/facade/rpt_tpl_tree_node_facade.js

@@ -65,15 +65,21 @@ async function findTplTreeByOid(objectId) {
     } else return null;
 }
 
+async function findTplTreeByCompilation(compilationId) {
+    let filter = {"compilationId": compilationId, "$or": [{"isDeleted": null}, {"isDeleted": false}]};
+    return await rpt_tpl_tree_mdl.find(filter);
+}
+
 
 let expObj = {
-    createNewTree:          createNewTree,
-    updateTree:             updateTree,
-    updateTreeInDetail:     updateTreeInDetail,
-    removeTree:             removeTree,
-    removeTreePhycically:   removeTreePhycically,
-    findTplTree:            findTplTree,
-    findTplTreeByOid:       findTplTreeByOid
+    createNewTree:              createNewTree,
+    updateTree:                 updateTree,
+    updateTreeInDetail:         updateTreeInDetail,
+    removeTree:                 removeTree,
+    removeTreePhycically:       removeTreePhycically,
+    findTplTree:                findTplTree,
+    findTplTreeByOid:           findTplTreeByOid,
+    findTplTreeByCompilation:   findTplTreeByCompilation
 };
 
 export {expObj as default};

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

@@ -21,6 +21,7 @@ module.exports = function (app) {
     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);

+ 107 - 10
modules/reports/rpt_component/jpc_flow_tab.js

@@ -10,6 +10,9 @@ let JpcTextHelper = require('./helper/jpc_helper_text');
 let JpcCommonOutputHelper = require('./helper/jpc_helper_common_output');
 let JpcAreaHelper = require('./helper/jpc_helper_area');
 let PDFKit = require('pdfkit');
+let fontUtil = require('../util/rpt_font_util');
+let fsUtil = require("../../../public/fsUtil");
+
 
 let JpcFlowTabSrv = function(){};
 JpcFlowTabSrv.prototype.createNew = function(){
@@ -316,7 +319,8 @@ JpcFlowTabSrv.prototype.createNew = function(){
                         if (values.length > rst) rst = values.length;
                         let font = private_get_font(tab_field[JV.PROP_FONT]);
                         if (font) {
-                            doc.font(__dirname.slice(0, __dirname.length - 14) + '/util/pdf_base_files/Smart.ttf');
+                            let fontFile = __dirname.slice(0, __dirname.length - 14) + '/util/pdf_base_files/' + fontUtil.getActualFont(font[JV.FONT_PROPS[0]], (font[JV.FONT_PROPS[3]] === 'T'), (font[JV.FONT_PROPS[4]] === 'T')) + '.ttf';
+                            doc.font(fontFile);
                             doc.fontSize(parseInt(font[JV.FONT_PROPS[JV.FONT_PROP_IDX_HEIGHT]]));
                         } else {
                             doc.font(__dirname.slice(0, __dirname.length - 14) + '/util/pdf_base_files/Smart.ttf');
@@ -420,10 +424,12 @@ JpcFlowTabSrv.prototype.createNew = function(){
                 JpcBandHelper.setBandArea(bands, rptTpl, pageStatus, !me.isEx, me.isEx);
                 maxRowRec = JpcFlowTabHelper.getMaxRowsPerPage(bands, rptTpl, me.isEx);
             }
+            let handledRowAmt = 0; //handledRowAmt纪录的是真正处理过的显示行数,包含了空白行,主要是为分页用(自动行高)
             function private_addPage(segIdx, grpSeqInfo, isFollow, isMix, mixSplitPoint) {
                 private_resetBandArea();
                 me.pageStatusLst.push(pageStatus.slice(0));
                 currentRecAmt += maxRowRec; //在自动行高的场景下,currentRecAmt在后面还需要调整
+                handledRowAmt += maxRowRec;
                 let redundantRecAmt = 0;
                 pageIdx++;
                 function private_chk_handle_rec_amt(dv, isEx) {
@@ -471,6 +477,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
                 let grpRecAmt = (grpSeqInfo)?(grpSeqInfo.length*me.group_lines_amt):0;
                 let grpRecAmtEx = 0;
                 let accAutoHeightAmt = 0; //累计的自动行高数量
+                handledRowAmt = 0; //初始化每一段的已处理纪录行数
                 if (followTabEx && followTabEx.group_node_info) {
                     grpRecAmtEx = followTabEx.group_node_info.length * followTabEx.group_lines_amt;
                 }
@@ -572,17 +579,16 @@ JpcFlowTabSrv.prototype.createNew = function(){
                         }
                     } else {
                         //普通流水数据情况
-                        // if ((currentRecAmt + adHocAutoHeightAmt + maxRowRec >= ttlSegRecAmt)
-                        if ((currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt + maxRowRec >= ttlSegRecAmt)
-                             //&& (adHocAutoHeightAmt < 2 * maxRowRec) ) {
-                             // && ((currentRecAmt + adHocAutoHeightAmt + maxRowRec - ttlSegRecAmt) < maxRowRec) ) {
-                            && ((currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt + maxRowRec - ttlSegRecAmt) < maxRowRec) ) {
+                        if (handledRowAmt + maxRowRec >= ttlSegRecAmt) {
                             //备注: 理论上自动行高是没有上限的,有可能正常一页的数据可以拓展到3页及以上,在此极端情况下,必须做一些限制判断,否则会出现缺页情况。
+                            // 2018-08-04 其实之前的判断逻辑完全是自找麻烦,而且还不够正确。其实只需要判断已经处理了多少行纪录(所有的都算,包括空白行),
+                            // 与总的seg纪录数想比较,就很容易得到结果,而且能处理更极端的情况。
                             pageStatus[JV.STATUS_SEGMENT_END] = true;
                             pageStatus[JV.STATUS_REPORT_END] = true;
                             private_resetBandArea();
-                            let hasAdHocRow = ((adHocAutoHeightAmt > maxRowRec) ||
-                                              !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + adHocAutoHeightAmt, maxRowRec, me.isEx));
+                            let hasAdHocRow = ((adHocAutoHeightAmt > maxRowRec) || !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, handledRowAmt, maxRowRec, me.isEx));
+                                              // !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, ttlSegRecAmt, currentRecAmt + adHocAutoHeightAmt, maxRowRec, me.isEx));
+
                             if (hasAdHocRow) {
                                 //add page info(pre segment end)
                                 pageStatus[JV.STATUS_SEGMENT_END] = false;
@@ -600,7 +606,8 @@ JpcFlowTabSrv.prototype.createNew = function(){
                         }
                     }
                     //检测是否可退出
-                    if ((currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt >= ttlSegRecAmt) && (pageIdx % me.multiCols === 0)) {
+                    // if ((currentRecAmt + accAutoHeightAmt + adHocAutoHeightAmt >= ttlSegRecAmt) && (pageIdx % me.multiCols === 0)) {
+                    if (handledRowAmt >= ttlSegRecAmt && (pageIdx % me.multiCols === 0)) {
                         //备注:这里必须得考虑多栏的情况,否则会造成pageStatus出界的问题
                         break;
                     }
@@ -735,7 +742,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
         return rst;
     };
     JpcFlowTabResult.outputContent = function(rptTpl, dataObj, page, bands, unitFactor, controls, multiColIdx, $CURRENT_RPT, customizeCfg) {
-        let me = this, rst = [];
+        let me = this, rst = [], prepareObj = {};
         let FLOW_NODE_STR = me.isEx?JV.NODE_FLOW_INFO_EX:JV.NODE_FLOW_INFO;
         let tab = rptTpl[FLOW_NODE_STR][JV.NODE_FLOW_CONTENT];
         let tabEx = (rptTpl[JV.NODE_FLOW_INFO_EX])?rptTpl[JV.NODE_FLOW_INFO_EX][JV.NODE_FLOW_CONTENT]:null;
@@ -803,6 +810,7 @@ JpcFlowTabSrv.prototype.createNew = function(){
                                     } else {
                                         cellItem[JV.PROP_STYLE] = cellItem[JV.PROP_STYLE] + '_AutoHeightMerge_Middle';
                                     }
+                                    prepareAutoHeightCells(prepareObj, cellItem, rst.length - 1, rst);
                                 }
                             }
                         }
@@ -862,6 +870,13 @@ JpcFlowTabSrv.prototype.createNew = function(){
                 }
             }
         }
+        let eliminateCells = combineAutoHeightCells(prepareObj, page, controls);
+        // console.log("rst.length: " + rst.length);
+        // console.log("eliminateCells.length: " + eliminateCells.length);
+        for (let idIdx = eliminateCells.length - 1; idIdx >= 0; idIdx--) {
+            rst.splice(eliminateCells[idIdx], 1);
+        }
+        console.log("rst.length: " + rst.length);
         return rst;
     };
     JpcFlowTabResult.outputColumn = function (rptTpl, dataObj, page, segIdx, bands, unitFactor, multiColIdx) {
@@ -1010,4 +1025,86 @@ JpcFlowTabSrv.prototype.createNew = function(){
     return JpcFlowTabResult;
 };
 
+function push_cell(pageCellObj, cell, cellIdx) {
+    if (!pageCellObj[cell[JV.PROP_AREA][JV.PROP_LEFT] + '_' + cell[JV.PROP_AREA][JV.PROP_RIGHT]]) {
+        pageCellObj[cell[JV.PROP_AREA][JV.PROP_LEFT] + '_' + cell[JV.PROP_AREA][JV.PROP_RIGHT]] = [];
+    }
+    let cellArr = pageCellObj[cell[JV.PROP_AREA][JV.PROP_LEFT] + '_' + cell[JV.PROP_AREA][JV.PROP_RIGHT]];
+    cellArr.push({"cellIdx": cellIdx, "cell": cell});
+}
+
+function prepareAutoHeightCells(prepareObj, cellItem, cellIdx, cellsArr) {
+    if (prepareObj) {
+        if (prepareObj.cellsArr === undefined) {
+            prepareObj.cellsArr = cellsArr;
+            prepareObj.pageCellObj = {};
+        }
+        push_cell(prepareObj.pageCellObj, cellItem, cellIdx);
+    }
+}
+
+function setupControl(mergeCell, controls) {
+    let orgCtrl = null;
+    if ( typeof mergeCell[JV.PROP_CONTROL] === "string") {
+        orgCtrl = controls[mergeCell[JV.PROP_CONTROL]];
+        mergeCell[JV.PROP_CONTROL] = {
+            "Shrink": "T",
+            "ShowZero": orgCtrl.ShowZero,
+            "Horizon": orgCtrl.Horizon,
+            "Vertical": "top",
+            "Wrap": "T"
+        };
+    } else {
+        mergeCell[JV.PROP_CONTROL].Shrink = "T";
+        mergeCell[JV.PROP_CONTROL].Vertical = "top";
+        mergeCell[JV.PROP_CONTROL].Wrap = "T";
+        orgCtrl = mergeCell[JV.PROP_CONTROL];
+    }
+    return orgCtrl;
+}
+
+function combineAutoHeightCells(prepareObj, page, controls) {
+    let rst = [];
+    if (prepareObj.cellsArr) {
+        //merge cells' value and area
+        for (let mergeKey in prepareObj.pageCellObj) {
+            if (prepareObj.pageCellObj[mergeKey].length > 1) {
+                let firstMergeCell = prepareObj.pageCellObj[mergeKey][0].cell;
+                firstMergeCell[JV.PROP_STYLE] = firstMergeCell[JV.PROP_STYLE].slice(0, firstMergeCell[JV.PROP_STYLE].indexOf("_AutoHeightMerge"));
+                let orgCtrl = setupControl(firstMergeCell, controls);
+                let validValueAmt = 0;
+                for (let i = 1; i < prepareObj.pageCellObj[mergeKey].length; i++) {
+                    let mergeCell = prepareObj.pageCellObj[mergeKey][i].cell;
+                    if (mergeCell[JV.PROP_STYLE].indexOf("_AutoHeightMerge_Top") < 0) {
+                        //merge into the firstMergeCell!
+                        firstMergeCell[JV.PROP_AREA][JV.PROP_BOTTOM] = mergeCell[JV.PROP_AREA][JV.PROP_BOTTOM];
+                        firstMergeCell[JV.PROP_VALUE] = firstMergeCell[JV.PROP_VALUE] + "|" + mergeCell[JV.PROP_VALUE];
+                        if (mergeCell[JV.PROP_VALUE]) validValueAmt++;
+                        rst.push(prepareObj.pageCellObj[mergeKey][i].cellIdx);
+                        if (i === prepareObj.pageCellObj[mergeKey].length - 1 && validValueAmt === 0) {
+                            firstMergeCell[JV.PROP_CONTROL].Shrink = orgCtrl.Shrink;
+                            firstMergeCell[JV.PROP_CONTROL].Wrap = "F";
+                        }
+                    } else {
+                        if (validValueAmt === 0) {
+                            firstMergeCell[JV.PROP_CONTROL].Shrink = orgCtrl.Shrink;
+                            firstMergeCell[JV.PROP_CONTROL].Wrap = "F";
+                        }
+                        firstMergeCell = prepareObj.pageCellObj[mergeKey][i].cell;
+                        firstMergeCell[JV.PROP_STYLE] = firstMergeCell[JV.PROP_STYLE].slice(0, firstMergeCell[JV.PROP_STYLE].indexOf("_AutoHeightMerge"));
+                        orgCtrl = setupControl(firstMergeCell, controls);
+                        validValueAmt = 0;
+                    }
+                }
+            }
+        }
+        rst.sort(function (i1, i2) {
+            return (i1 > i2)?1:-1;
+        });
+    }
+    // fsUtil.writeObjToFile(prepareObj, "D:/GitHome/ConstructionCost/tmp/afterMergeCellsPrepareObj_" + page + ".jsp");
+    // fsUtil.writeObjToFile(rst, "D:/GitHome/ConstructionCost/tmp/eliminateCells_" + page + ".jsp");
+    return rst;
+}
+
 module.exports = new JpcFlowTabSrv();

+ 22 - 0
modules/reports/rpt_component/jpc_rte.js

@@ -92,6 +92,28 @@ let JE = {
             }
         }
         return rst;
+    },
+    removeFieldValue: function (field, dataObj, valIdx) {
+        if (field.DataNodeName === "NA") {
+            if (field[JV.PROP_AD_HOC_DATA].length > valIdx && valIdx >= 0) {
+                field[JV.PROP_AD_HOC_DATA].splice(valIdx, 1);
+            }
+        } else {
+            if (dataObj[field.DataNodeName][field.DataSeq].length > valIdx && valIdx >= 0) {
+                dataObj[field.DataNodeName][field.DataSeq].splice(valIdx, 1);
+            }
+        }
+    },
+    insertFieldValue: function (field, dataObj, valIdx, newValue) {
+        if (field.DataNodeName === "NA") {
+            if (field[JV.PROP_AD_HOC_DATA].length > valIdx && valIdx >= 0) {
+                field[JV.PROP_AD_HOC_DATA].splice(valIdx, 0, newValue);
+            }
+        } else {
+            if (dataObj[field.DataNodeName][field.DataSeq].length > valIdx && valIdx >= 0) {
+                dataObj[field.DataNodeName][field.DataSeq].splice(valIdx, 0, newValue);
+            }
+        }
     }
 };
 

BIN
modules/reports/util/pdf_base_files/Smart-italic.ttf


BIN
modules/reports/util/pdf_base_files/Smart.ttf


BIN
modules/reports/util/pdf_base_files/hwxsb.ttf


+ 23 - 5
modules/reports/util/rpt_excel_util.js

@@ -9,6 +9,7 @@ let jpcCmnHelper = require('../rpt_component/helper/jpc_helper_common');
 let DPI = jpcCmnHelper.getScreenDPI()[0];
 let fsUtil = require('../../../public/fsUtil');
 const dftHeadXml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
+const uuidV1 = require('uuid/v1');
 
 function writeContentTypes(sheets, isSinglePage) {
     let rst = [];
@@ -157,6 +158,9 @@ function writeStyles(stylesObj){
         if (strUtil.convertStrToBoolean(font[JV.FONT_PROPS[3]])) {
             rst.push('<b/>');
         }
+        if (strUtil.convertStrToBoolean(font[JV.FONT_PROPS[4]])) {
+            rst.push('<i/>');
+        }
         if (strUtil.convertStrToBoolean(font[JV.FONT_PROPS[5]])) {
             rst.push('<u/>');
         }
@@ -342,7 +346,8 @@ function writeSheets(pageData, paperSize, sharedStrList, stylesObj, isSinglePage
     return rst;
 }
 function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, appointedMergeBand){
-    let rst = [], xPos = [], yPos = [], yMultiPos = [], headerStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+    let rst = [], xPos = [], yPos = [], yMultiPos = [], currentMergeBorder = null,
+        headerStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
     let currentPageMergePos = null; //在 JV.PAGING_OPTION_INFINITY 场合应用
     let private_pre_analyze_pos = function(){
         let cell, pos;
@@ -443,7 +448,8 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, ap
             if (sheetFont) {
                 // if (font[JV.FONT_PROPS[0]] === sheetFont[JV.FONT_PROPS[0]] && font.size === Math.round(sheetFont[JV.FONT_PROPS[1]] * 3 / 4)
                 if (font[JV.FONT_PROPS[0]] === sheetFont[JV.FONT_PROPS[0]] && font.size === Math.floor(sheetFont[JV.FONT_PROPS[1]] * 3 / 4)
-                    && font[JV.FONT_PROPS[3]] === sheetFont[JV.FONT_PROPS[3]] && font[JV.FONT_PROPS[5]] === sheetFont[JV.FONT_PROPS[5]]) {
+                    && font[JV.FONT_PROPS[3]] === sheetFont[JV.FONT_PROPS[3]] && font[JV.FONT_PROPS[4]] === sheetFont[JV.FONT_PROPS[4]]
+                    && font[JV.FONT_PROPS[5]] === sheetFont[JV.FONT_PROPS[5]] ) {
                     hasFont = true;
                     rst = i;
                     break;
@@ -460,6 +466,7 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, ap
             font.charset = 134;
             font.colorIdx = "8";
             font[JV.FONT_PROPS[3]] = sheetFont[JV.FONT_PROPS[3]]; //font bold
+            font[JV.FONT_PROPS[4]] = sheetFont[JV.FONT_PROPS[4]]; //font italic
             font[JV.FONT_PROPS[5]] = sheetFont[JV.FONT_PROPS[5]]; //font underline
             stylesObj.fonts.push(font);
             rst = stylesObj.fonts.length - 1;
@@ -502,7 +509,8 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, ap
     };
     let private_chkAndGetMergeLine = function(cell, sheetBorder, borderStr, needFurtherChk) {
         let rst = 0,
-            mergeBorder = (sheetData)?sheetData[JV.PROP_PAGE_MERGE_BORDER]:pageData[JV.BAND_PROP_MERGE_BAND],
+            // mergeBorder = (sheetData)?sheetData[JV.PROP_PAGE_MERGE_BORDER]:pageData[JV.BAND_PROP_MERGE_BAND],
+            mergeBorder = currentMergeBorder,
             mergeBand = pageData[JV.BAND_PROP_MERGE_BAND]
         ;
         if (appointedMergeBand !== null) {
@@ -752,6 +760,7 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, ap
         if (sheetData) {
             //current sheet data
             currentPageMergePos = sheetData[JV.PAGE_SPECIAL_MERGE_POS];
+            currentMergeBorder = sheetData[JV.PROP_PAGE_MERGE_BORDER];
             self_setDataEx(sheetData, yPos, 0);
         } else {
             //total data in one sheet
@@ -759,6 +768,7 @@ function writeSheet(pageData, sheetData, paperSize, sharedStrList, stylesObj, ap
             for (let i = 0; i < pageData.items.length; i++) {
                 let shtItemData = pageData.items[i];
                 currentPageMergePos = shtItemData[JV.PAGE_SPECIAL_MERGE_POS];
+                currentMergeBorder = shtItemData[JV.PROP_PAGE_MERGE_BORDER];
                 let tmpPos = yMultiPos[i];
                 cellIdx = 0;
                 self_setDataEx(shtItemData, tmpPos, cnt);
@@ -818,7 +828,7 @@ function mergeProperties(orgObj, newObj) {
 module.exports = {
     exportExcel: function (pageData, paperSize, fName, options, custSheetNames, custSheetMergeBands, callback) {
         let rptOptions = ({singlePage: false, fileName: 'report'});
-        if (options === 'true') {
+        if (options === 'true' || options === true) {
             rptOptions.singlePage = true;
         }
         let isSinglePage = rptOptions.singlePage;
@@ -891,7 +901,9 @@ module.exports = {
         zip_xl.file(file, data.join(''), {compression: 'DEFLATE'});
 
         if (fName) {
-            let newName = '' + (new Date()).valueOf();
+            // let newName = '' + (new Date()).valueOf();
+            let newName = uuidV1();
+
             zip.generateNodeStream({type:'nodebuffer',streamFiles:true})
                 .pipe(fs.createWriteStream(__dirname.slice(0, __dirname.length - 21) + '/tmp/' + newName + '.xlsx'))
                 .on('finish', function () {
@@ -931,6 +943,7 @@ module.exports = {
                 let offsetY = 0;
                 let mergeBand = {};
                 custMergeBands.push(pageDataArray[i][JV.BAND_PROP_MERGE_BAND]);
+                //备注:不同的报表有可能有不同的边框,如封面表就是无边框的
                 mergeBand[JV.PROP_LEFT] = [];
                 mergeBand[JV.PROP_RIGHT] = [];
                 mergeBand[JV.PROP_TOP] = [];
@@ -947,6 +960,11 @@ module.exports = {
                         mergeBand[JV.PROP_TOP].push(pos);
                         pos = pageDataArray[i].items[j][JV.PAGE_SPECIAL_MERGE_POS][JV.PROP_BOTTOM][0] + offsetY;
                         mergeBand[JV.PROP_BOTTOM].push(pos);
+                    } else if (pageDataArray[i].items[j][JV.PROP_PAGE_MERGE_BORDER]) {
+                        let pos = pageDataArray[i].items[j][JV.PROP_PAGE_MERGE_BORDER][JV.PROP_TOP] + offsetY;
+                        mergeBand[JV.PROP_TOP].push(pos);
+                        pos = pageDataArray[i].items[j][JV.PROP_PAGE_MERGE_BORDER][JV.PROP_BOTTOM] + offsetY;
+                        mergeBand[JV.PROP_BOTTOM].push(pos);
                     } else {
                         mergeBand[JV.PROP_TOP].push(pageDataArray[i][JV.BAND_PROP_MERGE_BAND][JV.PROP_TOP] + offsetY);
                         mergeBand[JV.PROP_BOTTOM].push(pageDataArray[i][JV.BAND_PROP_MERGE_BAND][JV.PROP_BOTTOM] + offsetY);

+ 28 - 0
modules/reports/util/rpt_font_util.js

@@ -0,0 +1,28 @@
+/**
+ * Created by Tony on 2018/8/2.
+ */
+
+let fontMapObj = {
+    "宋体": "Smart"
+    ,"楷体": "simkai"
+    ,"黑体": "simhei"
+};
+//下划线在option中支持
+//另注意:PDFkit设置字体的时候会检测是否同源,也就是说,如果是同一种字体转换不同的特性(如粗体、斜体),那么在设置的时候会无效
+//      比如前一种是普通的字体,后来想设置这种字体的斜体,实际上这种设置会失效
+
+module.exports = {
+    getActualFont: getActualFont
+}
+
+function getActualFont(mapName, isBold, isItalic) {
+    let rst = ["Smart"];
+    if (fontMapObj[mapName]) rst[0] = fontMapObj[mapName];
+    if (isBold) {
+        rst.push("_bold");
+    }
+    if (isItalic) {
+        rst.push("_italic");
+    }
+    return rst.join("");
+}

+ 18 - 24
modules/reports/util/rpt_pdf_util.js

@@ -10,22 +10,22 @@ let fs = require('fs');
 let jpcCmnHelper = require('../rpt_component/helper/jpc_helper_common');
 let DPI = jpcCmnHelper.getScreenDPI()[0];
 let JV = require('../rpt_component/jpc_value_define');
+const uuidV1 = require('uuid/v1');
 
-// hwxsb.ttf: 华文中宋
-// Smart.ttf: 宋体(常规)
-// Smart-italic.ttf: 宋体(斜体)
-//目前不支持下划线
+let fontUtil = require('./rpt_font_util');
 
-module.exports ={
+// 目前不支持下划线
+
+module.exports = {
     export_pdf_file:export_pdf_file
 }
 
-
 function export_pdf_file (pageData, paperSize, fName, callback) {
     let offsetX= 10;
     let offsetY=10;
     let doc = new pdf({autoFirstPage: false});
-    let newName = '' + (new Date()).valueOf();
+    // let newName = '' + (new Date()).valueOf();
+    let newName = uuidV1();
     let stream = doc.pipe(fs.createWriteStream(__dirname.slice(0, __dirname.length - 21) + '/tmp/'+newName+'.pdf'));
     let pageObj = pageData;
     // doc.rect(5,5,1190,890).lineWidth(1).strokeColor('black').stroke();//边框
@@ -144,19 +144,13 @@ function export_pdf_file (pageData, paperSize, fName, callback) {
     function private_drawText(val, area, font, control) {
         let dftFontHeight = 12;
         let output = [];
+        let fontFile = __dirname + '/pdf_base_files/simkai.ttf';
         if (font) {
             dftFontHeight = 1 * font[JV.FONT_PROPS[1]];
-            let dftFontBold = font[JV.FONT_PROPS[3]];
-            let dftFontItalic = font[JV.FONT_PROPS[4]];
-            if (dftFontBold && dftFontBold === 'T') {
-                doc.font(__dirname+'/pdf_base_files/hwxsb.ttf');
-            }else if(dftFontItalic && dftFontItalic === 'T'){
-                doc.font(__dirname+'/pdf_base_files/Smart-italic.ttf');
-            }else {
-                doc.font(__dirname+'/pdf_base_files/Smart.ttf');
-            }
+            fontFile = __dirname + '/pdf_base_files/' + fontUtil.getActualFont(font[JV.FONT_PROPS[0]], (font[JV.FONT_PROPS[3]] === 'T'), (font[JV.FONT_PROPS[4]] === 'T')) + '.ttf';
             doc.fontSize(dftFontHeight);
         }
+        doc.font(fontFile);
         let options={};
         if (control) {
             private_setupAreaH(area, control.Horizon, font.FontAngle, dftFontHeight, output,options);
@@ -169,23 +163,22 @@ function export_pdf_file (pageData, paperSize, fName, callback) {
         if (parseInt(font.FontAngle) !== 0) {
             w = area[JV.IDX_BOTTOM] - JV.OUTPUT_OFFSET[JV.OFFSET_IDX_BOTTOM] - area[JV.IDX_TOP] - JV.OUTPUT_OFFSET[JV.OFFSET_IDX_TOP];
         }
-        doc.save();
+        // doc.save();
         //doc.translate(output[0], output[1]);
         if (w >= doc.widthOfString(val)) {
-            options.width=w;
-            options.height=dftFontHeight;
+            options.width = w;
+            options.height = dftFontHeight;
         } else {
             while (true) {
                 dftFontHeight--;
                 doc.fontSize(dftFontHeight);
                 if (w >= doc.widthOfString(val) || dftFontHeight < 6) {
-                    options.width=w;
-                    options.height=dftFontHeight;
+                    options.width = w;
+                    options.height = dftFontHeight;
                     break;
                 }
             }
         }
-
         function private_drawUnderline() {
             //A. 暂不支持角度; B. PDF输出时,坐标没有translate
             let ctx = doc;
@@ -237,8 +230,9 @@ function export_pdf_file (pageData, paperSize, fName, callback) {
             }
             doc.rotate(font.FontAngle,rotateOptions);
         }
-        doc.text(val,output[0], output[1],options);
-        doc.restore();
+        doc.text(val,output[0], output[1], options);
+        doc.font(__dirname + '/pdf_base_files/Smart.ttf');
+        // doc.restore();
     }
 
     function private_setupAreaH(area, type, fontAngle, dftFontHeight, outputPoint,options) {

+ 5 - 9
modules/reports/util/rpt_svg_util.js

@@ -7,6 +7,7 @@ let JV = require('../rpt_component/jpc_value_define');
 let pdf = require('pdfkit');
 let jpcCmnHelper = require('../rpt_component/helper/jpc_helper_common');
 let SCREEN_DPI = jpcCmnHelper.getScreenDPI();
+let fontUtil = require('./rpt_font_util');
 
 module.exports = {
     exportSvgStr: function (pagesData, offsetX, offsetY) {
@@ -109,6 +110,9 @@ function buildText(destRst, cell, font, control, offsetX, offsetY, adjustY, pdf_
     let orgFontHeight = parseInt(font[JV.FONT_PROPS[JV.FONT_PROP_IDX_HEIGHT]]);
     let fontWeight = (font[JV.FONT_PROPS[JV.FONT_PROP_IDX_BOLD]] === 'T')?"bold":"normal";
     let fontStyle = (font[JV.FONT_PROPS[JV.FONT_PROP_IDX_ITALIC]] === 'T')?"italic":"normal";
+    let dftFontBold = font[JV.FONT_PROPS[3]];
+    let dftFontItalic = font[JV.FONT_PROPS[4]];
+    let fontFile = __dirname + '/pdf_base_files/' + fontUtil.getActualFont(font[JV.FONT_PROPS[0]], (dftFontBold === 'T'), (dftFontItalic === 'T')) + '.ttf';
     let left = parseInt(cell[JV.PROP_AREA][JV.PROP_LEFT]) + offsetX + 0.5,
         right = parseInt(cell[JV.PROP_AREA][JV.PROP_RIGHT]) + offsetX + 0.5,
         top = parseInt(cell[JV.PROP_AREA][JV.PROP_TOP]) + offsetY + adjustY,
@@ -142,15 +146,7 @@ function buildText(destRst, cell, font, control, offsetX, offsetY, adjustY, pdf_
     for (let vidx = 0; vidx < values.length; vidx++) {
         //check whether need to adjust the font size
         let dftFontHeight = orgFontHeight;
-        let dftFontBold = font[JV.FONT_PROPS[3]];
-        let dftFontItalic = font[JV.FONT_PROPS[4]];
-        if (dftFontBold && dftFontBold === 'T') {
-            pdf_doc.font(__dirname+'/pdf_base_files/hwxsb.ttf');
-        }else if(dftFontItalic && dftFontItalic === 'T'){
-            pdf_doc.font(__dirname+'/pdf_base_files/Smart-italic.ttf');
-        }else {
-            pdf_doc.font(__dirname+'/pdf_base_files/Smart.ttf');
-        }
+        pdf_doc.font(fontFile);
         pdf_doc.fontSize(dftFontHeight);
         while ((right - left) <= pdf_doc.widthOfString(values[vidx])) {
             if (dftFontHeight > 6) {

+ 53 - 0
modules/reports/util/rpt_tmp_file_sweep.js

@@ -0,0 +1,53 @@
+/**
+ * Created by Tony on 2018/7/27.
+ */
+
+let fs = require('fs');
+let cron = require('node-schedule');
+let remove_file_types = [".xlsx", ".pdf", ".jsp"];
+function chkIsRemoveType(file) {
+    let rst = false;
+    for (let fType of remove_file_types) {
+        if (file.indexOf(fType) === (file.length - fType.length)) {
+            rst = true;
+            break;
+        }
+    }
+    return rst;
+}
+let jobObj = {
+    createJob: function (rule, rootPath) {
+        let localRule = rule;
+        if (!localRule) {
+            // setup schedule rule
+            localRule = new cron.RecurrenceRule();
+            // 3:15AM, everyday
+            localRule.dayOfWeek = [1,2,3,4,5,6,0];
+            localRule.hour = 3;
+            localRule.minute = 15;
+        }
+        cron.scheduleJob(localRule, function(){
+            let path = rootPath;
+            fs.exists(path, function (exists) {
+                if (exists) {
+                    fs.readdir(path, function (err, files) {
+                        let currentTime = (new Date()).valueOf();
+                        let timeGap = currentTime - (1000 * 60 * 60 * 24 * 0.5); //half day before
+                        files.forEach(function(file,index){
+                            if (chkIsRemoveType(file)) {
+                                let curPath = path + "/" + file;
+                                fs.stat(curPath,function(err,data){
+                                    if (timeGap > data.mtime) {
+                                        fs.unlink(curPath);
+                                    }
+                                });
+                            }
+                        });
+                    })
+                }
+            })
+        });
+    }
+};
+
+export default jobObj;

+ 3 - 2
modules/std_billsGuidance_lib/controllers/viewController.js

@@ -8,7 +8,7 @@
  * @version
  */
 import BaseController from "../../common/base/base_controller";
-
+let config = require("../../../config/config.js");
 class ViewsController extends BaseController{
     redirectMain(req, res){
         res.render('maintain/billsGuidance_lib/html/main.html',
@@ -19,7 +19,8 @@ class ViewsController extends BaseController{
     redirectGuidance(req, res){
         res.render('maintain/billsGuidance_lib/html/zhiyin.html',
             {
-                userAccount: req.session.managerData.username
+                userAccount: req.session.managerData.username,
+                LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
             });
     }
 }

+ 3 - 2
modules/std_glj_lib/controllers/viewsController.js

@@ -4,7 +4,7 @@
  */
 
 import BaseController from "../../common/base/base_controller";
-
+let config = require("../../../config/config.js");
 class ViewsController extends BaseController{
     redirectMain(req, res){
         res.render('maintain/std_glj_lib/html/main.html',
@@ -15,7 +15,8 @@ class ViewsController extends BaseController{
     redirectGlj(req, res){
         res.render('maintain/std_glj_lib/html/gongliao.html',
         {
-            userAccount: req.session.managerData.username
+            userAccount: req.session.managerData.username,
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         });
     }
 }

+ 9 - 4
modules/users/controllers/compilation_controller.js

@@ -21,6 +21,7 @@ import STDCalcProgramModel from "../../common/std/std_calc_program_model";
 const billsGuidanceFc = require('../../std_billsGuidance_lib/facade/facades');
 import mainColFacade from "../../main_col_lib/facade/main_col_facade";
 import billTemplateFacade from "../../bills_template_lib/facade/bills_template_facade";
+let config = require("../../../config/config.js");
 
 class CompilationController extends BaseController {
 
@@ -62,7 +63,8 @@ class CompilationController extends BaseController {
             id: id,
             compilationList: compilationList,
             selectedCompilation: selectedCompilation,
-            layout: 'users/views/layout/layout'
+            layout: 'users/views/layout/layout',
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
 
         response.render('users/views/compilation/index', renderData);
@@ -153,7 +155,8 @@ class CompilationController extends BaseController {
             valuationList: valuationList,
             valuationId: valuationId,
             section: section,
-            layout: 'users/views/layout/layout'
+            layout: 'users/views/layout/layout',
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
         response.render('users/views/compilation/add', renderData);
     }
@@ -246,7 +249,8 @@ class CompilationController extends BaseController {
             gljCol:JSON.stringify(libData.glj_col),
             calculationList: JSON.stringify(calculationList),
             billsGuidanceList: JSON.stringify(billsGuidanceList),
-            layout: 'users/views/layout/layout'
+            layout: 'users/views/layout/layout',
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
         response.render('users/views/compilation/engineering', renderData);
     }
@@ -532,7 +536,8 @@ class CompilationController extends BaseController {
             compilationList: compilationList,
             valuationId: valuationId,
             section: section,
-            layout: 'users/views/layout/layout'
+            layout: 'users/views/layout/layout',
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
         response.render('users/views/compilation/template', renderData);
     }

+ 3 - 1
modules/users/controllers/dashboard_controller.js

@@ -7,6 +7,7 @@
  */
 import BaseController from "../../common/base/base_controller";
 import MessageModel from "../models/message_model";
+let config = require("../../../config/config.js");
 
 class DashboardController extends BaseController {
 
@@ -41,7 +42,8 @@ class DashboardController extends BaseController {
             parentTitle: DashboardController.parentTitle,
             parentIndex: DashboardController.parentIndex,
             layout: 'users/views/layout/layout',
-            messageList: messageList
+            messageList: messageList,
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
         response.render('users/views/dashboard/index', renderData);
     }

+ 4 - 1
modules/users/controllers/manager_controller.js

@@ -8,6 +8,7 @@
 import BaseController from "../../common/base/base_controller";
 import ManagerModel from "../models/manager_model";
 import Config from "../../../config/config";
+let config = require("../../../config/config.js");
 
 class ManagerController extends BaseController {
 
@@ -66,6 +67,7 @@ class ManagerController extends BaseController {
             managerList: managerList,
             pages: pageData,
             layout: 'users/views/layout/layout',
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
         response.render('users/views/manager/index', renderData);
     }
@@ -144,7 +146,8 @@ class ManagerController extends BaseController {
 
         let renderData = {
             adminData: adminData,
-            layout: 'users/views/layout/layout'
+            layout: 'users/views/layout/layout',
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
         response.render('users/views/manager/save', renderData);
     }

+ 6 - 2
modules/users/controllers/notify_controller.js

@@ -8,6 +8,7 @@
 import BaseController from "../../common/base/base_controller";
 import MessageModel from "../models/message_model";
 import Config from "../../../config/config";
+let config = require("../../../config/config.js");
 
 class NotifyController extends BaseController {
 
@@ -52,7 +53,8 @@ class NotifyController extends BaseController {
             userMessageTotal: userMessageTotal,
             systemMessageTotal: systemMessageTotal,
             type: type,
-            filter: request.query
+            filter: request.query,
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
         response.render('users/views/notify/index', renderData);
     }
@@ -81,6 +83,7 @@ class NotifyController extends BaseController {
             type: type,
             userMessageTotal: userMessageTotal,
             systemMessageTotal: systemMessageTotal,
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
         response.render('users/views/notify/save', renderData);
     }
@@ -141,7 +144,8 @@ class NotifyController extends BaseController {
             messageData: messageData,
             userMessageTotal: userMessageTotal,
             systemMessageTotal: systemMessageTotal,
-            type: type
+            type: type,
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
         response.render("users/views/notify/save", renderData);
     }

+ 3 - 1
modules/users/controllers/tool_controller.js

@@ -6,6 +6,7 @@
  * @version
  */
 import BaseController from "../../common/base/base_controller";
+let config = require("../../../config/config.js");
 
 class ToolController extends BaseController {
 
@@ -18,7 +19,8 @@ class ToolController extends BaseController {
      */
     index(request, response) {
         let renderData = {
-            layout: 'users/views/layout/layout'
+            layout: 'users/views/layout/layout',
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
         response.render('users/views/tool/index', renderData);
     }

+ 3 - 1
modules/users/controllers/user_controller.js

@@ -8,6 +8,7 @@
 import BaseController from "../../common/base/base_controller";
 import UserModel from "../models/user_model";
 import Config from "../../../config/config";
+let config = require("../../../config/config.js");
 
 class UserController extends BaseController {
 
@@ -57,7 +58,8 @@ class UserController extends BaseController {
             total: total,
             filter: filter,
             model: userModel,
-            layout: 'users/views/layout/layout'
+            layout: 'users/views/layout/layout',
+            LicenseKey:config.getLicenseKey(process.env.NODE_ENV)
         };
         response.render('users/views/user/index', renderData);
     }

+ 26 - 0
public/web/common_ajax.js

@@ -118,3 +118,29 @@ var CommonAjax = {
         });
     }
 };
+
+async function ajaxPost(url, data) {
+    return new Promise(function (resolve, reject) {
+        $.ajax({
+            type:"POST",
+            url: url,
+            data: {'data': JSON.stringify(data)},
+            dataType: 'json',
+            cache: false,
+            timeout: 50000,
+            success: function(result){
+                if (result.error === 0) {
+                    resolve(result.data);
+                } else {
+                    alert('error: ' + result.message);
+                    reject(result.message);
+                }
+            },
+            error: function(jqXHR, textStatus, errorThrown){
+                ajaxErrorInfo(jqXHR, textStatus, errorThrown);
+                reject("请求错误");
+            }
+        });
+
+    });
+}

+ 2 - 1
public/web/rpt_value_define.js

@@ -201,12 +201,13 @@ const JV = {
 
     PAGE_STATUS: ["EveryPage","FirstPage", "LastPage", "SegmentStart", "SegmentEnd", "Group", "CrossRowEnd", "CrossColEnd"],
 
-    CONTROL_PROPS: ["Shrink", "ShowZero", "Horizon", "Vertical", "Wrap"],
+    CONTROL_PROPS: ["Shrink", "ShowZero", "Horizon", "Vertical", "Wrap", "VerticalForExcel"],
     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,
     BORDER_STYLE_PROPS: ["LineWeight", "DashStyle", "Color"],
     PROP_LINE_WEIGHT: "LineWeight",
     PROP_DASH_STYLE: "DashStyle",

+ 18 - 0
web/maintain/bill_template_lib/js/bills_template_edit.js

@@ -78,6 +78,24 @@ let TEMPLATE_BILLS_SETTING = {
             "font":"Arail"
         }
     }, {
+            "width":80,
+            "readOnly":false,
+            "head":{
+                "titleNames":["工程量"],
+                "spanCols":[1],
+                "spanRows":[1],
+                "vAlign":[1],
+                "hAlign":[1],
+                "font":["Arial"]
+            },
+            "data":{
+                "field":"quantity",
+                "type":'Number',
+                "vAlign":0,
+                "hAlign":2,
+                "font":"Arail"
+            }
+    }, {
         "width":200,
         "readOnly":false,
         "head":{

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/maintain/billsGuidance_lib/html/zhiyin.html


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/maintain/bills_lib/html/neirong.html


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/maintain/bills_lib/html/qingdan.html


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/maintain/bills_lib/html/tezheng.html


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/maintain/common/html/edit_layout.html


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/maintain/main_col_lib/html/main.html


+ 4 - 0
web/maintain/main_col_lib/js/main_tree_col.js

@@ -141,6 +141,10 @@ let MainTreeCol = {
         },
         isEstimate:function (node) {
 
+        },
+        //综合合价
+        commonTotalFee: function () {
+
         }
      },
     getEvent: function (eventName) {

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/maintain/ration_repository/anzhuang.html


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/maintain/ration_repository/dinge.html


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/maintain/ration_repository/fuzhu.html


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/maintain/ration_repository/gongliao.html


+ 44 - 1
web/maintain/report/js/jpc_output.js

@@ -268,6 +268,33 @@ let JpcCanvasOutput = {
             }
         }
     },
+    highlightConflictArea: function (pageObj, pageIdx) {
+        if (pageObj && pageObj.items.length > 0 && pageObj.items.length >= pageIdx) {
+            let private_create_conflict_line = function () {
+                return {"LineWeight": "1", "DashStyle": "SOLID", "Color": "RED"};
+            };
+            let page = pageObj.items[pageIdx - 1],
+                styleConflict = {"Left": private_create_conflict_line(), "Right": private_create_conflict_line(), "Top": private_create_conflict_line(), "Bottom": private_create_conflict_line()}
+            ;
+            pageObj[JV.NODE_STYLE_COLLECTION]["ConflictCell"] = styleConflict;
+            let conflictIds = [];
+            for (let j = 0; j < page.cells.length; j++) {
+                if (conflictIds.indexOf(j) < 0) {
+                    let cell1 = page.cells[j];
+                    for (let k = j + 1; k < page.cells.length; k++) {
+                        let cell2 = page.cells[k];
+                        //判断area是否有交叉
+                        if (areaConflict(cell1[JV.PROP_AREA], cell2[JV.PROP_AREA])) {
+                            conflictIds.push(j);
+                            conflictIds.push(k);
+                            cell1[JV.PROP_STYLE] = "ConflictCell";
+                            cell2[JV.PROP_STYLE] = "ConflictCell";
+                        }
+                    }
+                }
+            }
+        }
+    },
     drawPageBorder: function(rptTpl, canvas, resolution) {
         let me = this;
         let size = me.getReportSizeInPixel(rptTpl, resolution);
@@ -295,4 +322,20 @@ let JpcCanvasOutput = {
         rst[1] = Math.round(resolution[0] * rst[1]);
         return rst;
     }
-};
+};
+
+function areaConflict(area1,area2) {
+    let maxX,maxY,minX,minY,
+        w1 = area1[JV.PROP_RIGHT] - area1[JV.PROP_LEFT],
+        w2 = area2[JV.PROP_RIGHT] - area2[JV.PROP_LEFT],
+        h1 = area1[JV.PROP_BOTTOM] - area1[JV.PROP_TOP],
+        h2 = area2[JV.PROP_BOTTOM] - area2[JV.PROP_TOP]
+    ;
+    //1. 求2个矩形的最小外包矩形
+    minX = (area1[JV.PROP_LEFT] <= area2[JV.PROP_LEFT]) ? area1[JV.PROP_LEFT] : area2[JV.PROP_LEFT];
+    minY = (area1[JV.PROP_TOP] <= area2[JV.PROP_TOP]) ? area1[JV.PROP_TOP] : area2[JV.PROP_TOP];
+    maxX = (area1[JV.PROP_RIGHT] >= area2[JV.PROP_RIGHT]) ? area1[JV.PROP_RIGHT] : area2[JV.PROP_RIGHT];
+    maxY = (area1[JV.PROP_BOTTOM] >= area2[JV.PROP_BOTTOM]) ? area1[JV.PROP_BOTTOM] : area2[JV.PROP_BOTTOM];
+    //2. 判断外包矩形与高与宽是否小于俩矩形的高与宽之和(这里的边界条件是小于,等于的话不算;而且是高与宽都得符合条件!)
+    return (maxX - minX < w1 + w2 && maxY - minY < h1 + h2);
+}

+ 39 - 17
web/maintain/report/js/rpt_tpl_helper.js

@@ -34,9 +34,40 @@ let tplHelper = {
         return rst;
     },
 
-    confirmAndCreateTpl: function(treeNode) {
-        if (zTreeOprObj.currentNode && zTreeOprObj.currentNode.nodeType == RT.NodeType.TEMPLATE) {
-            //
+    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);
+                // 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");
+            }
         }
     },
 
@@ -73,6 +104,8 @@ let tplHelper = {
             preHandleObj.hide_all_dom();
             //6. 计算式
             calculationTreeOprObj.iniTree(rptTpl);
+            //7. 刷白js对象text区域
+            document.getElementById('tplScriptTextContent').value = "";
             //9. 刷白预览区域
             let canvas = $('#tplCanvas')[0];
             JpcCanvasOutput.cleanCanvas(canvas);
@@ -84,26 +117,15 @@ let tplHelper = {
     saveRptTpl: function () {
         let me = this, params = null;
         if (me.reCombineRptTpl()) {
-            $("#id_after_saved_lbl")[0].style.color = "yellow";
-            $("#id_after_saved_lbl")[0].innerHTML = "正在保存...";
+            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) {
-                        //alert('update succeeded!')
-                        $("#id_after_saved_lbl")[0].style.color = "green";
-                        $("#id_after_saved_lbl")[0].innerHTML = "保存成功!";
-                        setTimeout(function(){
-                            $("#id_after_saved_lbl")[0].innerHTML = "";
-                        }, 1000);
+                        displayMessage("保存成功!", "green", 1000);
                     } else {
-                        // alert('update failed!');
-                        $("#id_after_saved_lbl")[0].style.color = "red";
-                        $("#id_after_saved_lbl")[0].innerHTML = "保存失败!";
-                        setTimeout(function(){
-                            $("#id_after_saved_lbl")[0].innerHTML = "";
-                        }, 2000);
+                        displayMessage("保存失败!", "red", 1000);
                     }
                 }, null, null
             );

+ 70 - 6
web/maintain/report/js/rpt_tpl_main.js

@@ -47,7 +47,8 @@ let zTreeOprObj = {
                         $("#compilations").append("<option value='" + item._id + "'>" + item.name + "</option>");
                     }
                 }
-                me.getReportTemplateTree($("#compilations").get(0));
+                // me.getReportTemplateTree($("#compilations").get(0));
+                me.getReportTemplateTreeFirstTime($("#compilations").get(0));
             }, null, null
         );
     },
@@ -572,6 +573,62 @@ let zTreeOprObj = {
             }
         }, null, null);
     },
+    getReportTemplateTreeFirstTime: function (compilationSelect) {
+        let me = zTreeOprObj, params = {};
+        params.compilationId = compilationSelect.value;
+        CommonAjax.postEx("report_tpl_api/getTplTreeByCompilation", params, 20000, true, function(result){
+            result.sort(function(item1, item2){
+                let rst = 0;
+                if (item1.userId === "-100") {
+                    rst = -1;
+                } else if (item2.userId === "-100") {
+                    rst = 1;
+                }
+                return rst;
+            });
+            let allTopUserIdNodes = ["-100"];
+            let allTopTplNodes = [{userId: "-100", name: "公共模板", items:[], isParent: true}];
+            allTopTplNodes[0].items.push(result[0]);
+            let userIds = [];
+            for (let idx = 1; idx < result.length; idx++) {
+                let item = result[idx];
+                userIds.push(item.userId);
+            }
+            userListObj.findUsersByIds(userIds, function () {
+                // for (let item of result) {
+                //     let uidx = allTopUserIdNodes.indexOf(item.userId);
+                //     item.isParent = true;
+                //     let topItem = {userId: item.userId, name: item.name, items: [], isParent: true};
+                //     allTopTplNodes[uidx].items.push(item);
+                // }
+            });
+            zTreeHelper.createTreeDirectly(allTopTplNodes, setting, "rptTplTree", me);
+            me.refreshNodes();
+            let private_setup_checked = function (itemNode) {
+                if (itemNode.nodeType === RT.NodeType.NODE) {
+                    me.treeObj.setChkDisabled(itemNode, true);
+                } else if (itemNode.nodeType === RT.NodeType.TEMPLATE) {
+                    me.treeObj.checkNode(itemNode, !!(itemNode.released));
+                }
+                if (itemNode.items && itemNode.items.length > 0) {
+                    for (let subItem of itemNode.items) {
+                        private_setup_checked(subItem);
+                    }
+                }
+            };
+            let topNodes = me.treeObj.getNodes();
+            me.treeObj.expandAll(true);
+            for (let node of topNodes) {
+                me.treeObj.setChkDisabled(node, true);
+                if (node.items && node.items.length > 0) {
+                    for (let item of node.items) {
+                        me.treeObj.setChkDisabled(item, true);
+                        private_setup_checked(item);
+                    }
+                }
+            }
+        }, null, null);
+    },
     getNewNodeID: function (scope, callback) {
         let params = {};
         params.scope = scope;
@@ -838,7 +895,9 @@ let userListObj = {
             me.UserIdList.push(user._id);
             let newUser = {userId: user._id, real_name: user.real_name, username: user.username, mobile: user.mobile};
             me.foundedUserList.push(newUser);
-            newUsers.push(newUser);
+            if (newUsers) {
+                newUsers.push(newUser);
+            }
         }
     },
     findUser: function () {
@@ -862,13 +921,18 @@ let userListObj = {
             error: function(jqXHR, textStatus, errorThrown){
             }
         });
+    },
+    findUsersByIds: function (userIds, cb) {
+        //
     }
 };
 
-function displayMessage(message, color, disappearTime) {
-    $("#id_after_saved_lbl")[0].style.color = color;
-    $("#id_after_saved_lbl")[0].innerHTML = message;
+function displayMessage(message, color, disappearTime, id) {
+    let domId = id;
+    if (!domId) domId = "id_after_saved_lbl";
+    $("#" + domId)[0].style.color = color;
+    $("#" + domId)[0].innerHTML = message;
     setTimeout(function(){
-        $("#id_after_saved_lbl")[0].innerHTML = "";
+        $("#" + domId)[0].innerHTML = "";
     }, disappearTime);
 }

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

@@ -192,6 +192,7 @@ let preview_util = {
                         }
                         JpcCanvasOutput.cleanCanvas(canvas);
                         JpcCanvasOutput.drawPageBorder(result, canvas, [96,96]);
+                        JpcCanvasOutput.highlightConflictArea(result, 1);
                         JpcCanvasOutput.drawToCanvas(result, canvas, 1);
                     } else {
                         alert('preview error!');

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

@@ -19,6 +19,10 @@
             <li class="nav-item">
                 <a class="nav-link p-1" data-toggle="tab" href="#rpttplformula" role="tab">计算式</a>
             </li>
+            <li class="nav-item">
+                <a class="nav-link p-1" data-toggle="tab" href="#rpttplscripttxt" role="tab">模板JS对象</a>
+            </li>
+
         </ul>
         <div class="tab-content">
             <!--模板信息-->
@@ -33,6 +37,8 @@
             <%include ./rpt_tpl_detail_pre_handle.html %>
             <!--计算式-->
             <%include ./rpt_tpl_detail_calculation.html %>
+            <!--java script 对象-->
+            <%include ./rpt_tpl_script_text.html %>
         </div>
     </div>
 </div>

+ 1 - 1
web/maintain/report/rpt_tpl_detail_calculation.html

@@ -28,7 +28,7 @@
                 </div>
             </div>
             <div class="form-group">
-                <textarea rows="16" cols="108" id="exprContent" onkeyup="calculationTreeOprObj.changeExpression(this)"></textarea>
+                <textarea rows="16" cols="106" id="exprContent" onkeyup="calculationTreeOprObj.changeExpression(this)"></textarea>
             </div>
         </div>
     </div>

+ 14 - 0
web/maintain/report/rpt_tpl_script_text.html

@@ -0,0 +1,14 @@
+<div class="tab-pane" id="rpttplscripttxt" role="tabpanel">
+    <div class="sub-button p-2">
+        <button class="btn btn-primary" onclick="tplHelper.getJsTxt(document.getElementById('tplScriptTextContent'))">生成JS文本</button>
+        <button class="btn btn-primary" onclick="tplHelper.setFromJsTxt(document.getElementById('tplScriptTextContent'))">导入JS文本</button>
+        <label id="id_after_js_load_lbl" style="color:yellowgreen;font-weight:bold">...</label>
+    </div>
+    <div class="main-data">
+        <div class="p-2" id="exprDetail">
+            <div class="form-group">
+                <textarea rows="35" cols="106" id="tplScriptTextContent"></textarea>
+            </div>
+        </div>
+    </div>
+</div>

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/maintain/std_glj_lib/html/gongliao.html


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1 - 1
web/users/views/layout/layout.html


+ 1 - 1
web/users/views/login/index.html

@@ -33,7 +33,7 @@
                 <div class="form-group">
                     <div class="input-group">
                         <div class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></div>
-                        <input type="password" class="form-control input-lg"  placeholder="输入密码" id="password" name="password" value="admin1234">
+                        <input type="password" class="form-control input-lg"  placeholder="输入密码" id="password" name="password" value="">
                     </div>
                 </div>
                 <a class="btn btn-primary btn-lg btn-block" href="javascript:void(0);" id="login">登录</a>