Browse Source

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

Conflicts:
	server.js
MaiXinRong 8 years ago
parent
commit
e67a536ce2
89 changed files with 12 additions and 13636 deletions
  1. 2 2
      config/cacheCfg.js
  2. 1 0
      modules/main/models/project.js
  3. 0 30
      modules/ration_repository/controllers/coe_controller.js
  4. 0 47
      modules/ration_repository/controllers/ration_controller.js
  5. 0 70
      modules/ration_repository/controllers/ration_repository_controller.js
  6. 0 45
      modules/ration_repository/controllers/ration_section_tree_controller.js
  7. 0 83
      modules/ration_repository/controllers/repository_glj_controller.js
  8. 0 30
      modules/ration_repository/controllers/search_controller.js
  9. 0 134
      modules/ration_repository/models/coe.js
  10. 0 220
      modules/ration_repository/models/glj_repository.js
  11. 0 45
      modules/ration_repository/models/rationAssist.js
  12. 0 35
      modules/ration_repository/models/rationCoe.js
  13. 0 166
      modules/ration_repository/models/ration_item.js
  14. 0 100
      modules/ration_repository/models/ration_section_tree.js
  15. 0 120
      modules/ration_repository/models/repository_map.js
  16. 0 46
      modules/ration_repository/routes/ration_rep_routes.js
  17. 0 99
      modules/reports/controllers/rpt_controller.js
  18. 0 46
      modules/reports/controllers/rpt_tpl_controller.js
  19. 0 32
      modules/reports/models/cfg_common.js
  20. 0 25
      modules/reports/models/cfg_control.js
  21. 0 28
      modules/reports/models/cfg_font.js
  22. 0 22
      modules/reports/models/cfg_style.js
  23. 0 40
      modules/reports/models/rpt_template.js
  24. 0 34
      modules/reports/models/rpt_tpl_data.js
  25. 0 98
      modules/reports/models/tpl_tree_node.js
  26. 0 12
      modules/reports/routes/report_router.js
  27. 0 10
      modules/reports/routes/rpt_tpl_router.js
  28. 0 52
      modules/reports/rpt_component/Jpc_Band.js
  29. 0 98
      modules/reports/rpt_component/Jpc_Data.js
  30. 0 47
      modules/reports/rpt_component/Jpc_Field.js
  31. 0 18
      modules/reports/rpt_component/Jpc_Function.js
  32. 0 27
      modules/reports/rpt_component/Jpc_Param.js
  33. 0 47
      modules/reports/rpt_component/Jpc_RTE.js
  34. 0 58
      modules/reports/rpt_component/helper/Jpc_Helper_Area.js
  35. 0 74
      modules/reports/rpt_component/helper/Jpc_Helper_Band.js
  36. 0 148
      modules/reports/rpt_component/helper/Jpc_Helper_Common.js
  37. 0 58
      modules/reports/rpt_component/helper/Jpc_Helper_Discrete.js
  38. 0 44
      modules/reports/rpt_component/helper/Jpc_Helper_Field.js
  39. 0 14
      modules/reports/rpt_component/helper/Jpc_Helper_Text.js
  40. 0 60
      modules/reports/rpt_component/helper/jpc_helper_common_output.js
  41. 0 189
      modules/reports/rpt_component/helper/jpc_helper_cross_tab.js
  42. 0 43
      modules/reports/rpt_component/helper/jpc_helper_flow_tab.js
  43. 0 78
      modules/reports/rpt_component/jpc_bill_tab.js
  44. 0 554
      modules/reports/rpt_component/jpc_cross_tab.js
  45. 0 202
      modules/reports/rpt_component/jpc_ex.js
  46. 0 229
      modules/reports/rpt_component/jpc_flow_tab.js
  47. 0 281
      modules/reports/util/excel_base_files/theme1.xml
  48. 0 687
      modules/reports/util/rpt_excel_util.js
  49. 0 36
      modules/reports/util/rpt_util.js
  50. 0 123
      operation.js
  51. 5 3
      modules/reports/rpt_component/jpc_value_define.js
  52. 4 5
      server.js
  53. 0 274
      web/maintain/bills_lib/css/main.css
  54. 0 177
      web/maintain/bills_lib/html/main.html
  55. 0 243
      web/maintain/bills_lib/html/neirong.html
  56. 0 490
      web/maintain/bills_lib/html/qingdan.html
  57. 0 289
      web/maintain/bills_lib/html/tezheng.html
  58. 0 371
      web/maintain/bills_lib/scripts/bills_lib_ajax.js
  59. 0 294
      web/maintain/bills_lib/scripts/bills_lib_setting.js
  60. 0 38
      web/maintain/bills_lib/scripts/bills_lib_tree.js
  61. 0 1130
      web/maintain/bills_lib/scripts/db_controller.js
  62. 0 37
      web/maintain/bills_lib/scripts/global.js
  63. 0 221
      web/maintain/bills_lib/scripts/set_sheets.js
  64. 0 30
      web/maintain/bills_lib/scripts/tools.js
  65. 0 275
      web/maintain/ration_repository/css/main.css
  66. 0 574
      web/maintain/ration_repository/dinge.html
  67. 0 265
      web/maintain/ration_repository/fuzhu.html
  68. 0 237
      web/maintain/ration_repository/gongliao.html
  69. 0 281
      web/maintain/ration_repository/js/coe.js
  70. 0 42
      web/maintain/ration_repository/js/global.js
  71. 0 161
      web/maintain/ration_repository/js/main.js
  72. 0 278
      web/maintain/ration_repository/js/ration.js
  73. 0 214
      web/maintain/ration_repository/js/ration_coe.js
  74. 0 236
      web/maintain/ration_repository/js/ration_glj.js
  75. 0 457
      web/maintain/ration_repository/js/repository_glj.js
  76. 0 208
      web/maintain/ration_repository/js/section_tree.js
  77. 0 136
      web/maintain/ration_repository/main.html
  78. 0 275
      web/maintain/report/css/main.css
  79. 0 198
      web/maintain/report/js/Jpc_Output.js
  80. 0 42
      web/maintain/report/js/global.js
  81. 0 48
      web/maintain/report/js/jpc_output_value_define.js
  82. 0 243
      web/maintain/report/js/rpt_tpl_main.js
  83. 0 170
      web/maintain/report/rpt_test.html
  84. 0 113
      web/maintain/report/rpt_tpl_main.html
  85. 0 274
      web/maintain/templates/css/main.css
  86. 0 106
      web/maintain/templates/html/bills.html
  87. 0 168
      web/maintain/templates/js/bills.js
  88. 0 42
      web/maintain/templates/js/global.js
  89. 0 205
      web/maintain/templates/js/tp_bills_setting.js

+ 2 - 2
config/cacheCfg.js

@@ -1,12 +1,12 @@
 /**
  * Created by Tony on 2017/3/24.
  */
-var rptUtil = require("../modules/reports/util/rpt_util");
+//var rptUtil = require("../modules/reports/util/rpt_util");
 //rptUtil.setReportDefaultCache();
 
 module.exports = {
     setupDftCache: function() {
-        rptUtil.setReportDefaultCache();
+        //rptUtil.setReportDefaultCache();
         //and others...(if any)
     }
 }

+ 1 - 0
modules/main/models/project.js

@@ -4,6 +4,7 @@
 var billsData = require('./bills');
 var rationData = require('./ration');
 var GLJData = require('./glj');
+let projCounter = require('./proj_counter');
 var consts = require('./project_consts');
 var projectConsts = consts.projectConst;
 var async = require("async");

+ 0 - 30
modules/ration_repository/controllers/coe_controller.js

@@ -1,30 +0,0 @@
-/**
- * Created by CSL on 2017/5/19.
- */
-var coeList = require("../models/coe");
-
-var callback = function(req,res,err,message, data){
-    res.json({error: err, message: message, data: data});
-}
-
-module.exports ={
-    getCoeList: function(req,res){
-        coeList.getCoesByLibID(req.body.libID, function(err,data){
-            callback(req, res, err, 'Get coes', data);
-        });
-    },
-
-    saveCoeList: function(req, res) {
-        coeList.saveToCoeList(JSON.parse(req.body.data), function(isErr, msg, data){
-            callback(req, res, isErr, msg, data);
-        });
-    },
-
-    getCoeItemsByIDs: function(req,res){
-        coeList.getCoeItemsByIDs(JSON.parse(req.body.data), function(err,data){
-            console.log(JSON.stringify(data));;
-            callback(req, res, err, 'Get coe', data);
-        });
-    }
-
-}

+ 0 - 47
modules/ration_repository/controllers/ration_controller.js

@@ -1,47 +0,0 @@
-/**
- * Created by Tony on 2017/5/2.
- */
-
-var rationItem = require('../models/ration_item');
-var callback = function(req, res, err, message, data){
-    res.json({error: err, message: message, data: data});
-};
-
-module.exports = {
-    getRationItemsBySection: function(req, res){
-        var sectionId = req.body.sectionID;
-        rationItem.getRationItemsBySection(sectionId, function(err, message, rst){
-            if (err) {
-                callback(req, res, err, message, null);
-            } else {
-                callback(req, res, err, message, rst);
-            }
-        });
-    },
-    mixUpdateRationItems: function(req, res){
-        var sectionId = req.body.sectionID,
-            rationLibId = req.body.rationLibId,
-            updateItems = JSON.parse(req.body.updateItems),
-            addItems = JSON.parse(req.body.addItems),
-            removeIds = JSON.parse(req.body.removeIds);
-        rationItem.mixUpdateRationItems(rationLibId, sectionId, updateItems, addItems, removeIds, function(err, message, rst){
-            if (err) {
-                callback(req, res, err, message, null);
-            } else {
-                callback(req, res, err, message, rst);
-            }
-        });
-    },
-    removeRationItems: function(req, res){
-        var rIds = JSON.parse(req.body.updateItems);
-        if (rIds && rIds.length > 0) {
-            rationItem.removeRationItems(rIds, function(err, message, rst){
-                if (err) {
-                    callback(req, res, err, message, null);
-                } else {
-                    callback(req, res, err, message, rst);
-                }
-            });
-        }
-    }
-}

+ 0 - 70
modules/ration_repository/controllers/ration_repository_controller.js

@@ -1,70 +0,0 @@
-/**
- * Created by Tony on 2017/4/20.
- */
-var rationRepository = require("../models/repository_map");
-
-var callback = function(req, res, err, message, data){
-    res.json({error: err, message: message, data: data});
-};
-
-module.exports = {
-    addRationRepository:function(req,res){
-        var rationObj = JSON.parse(req.body.rationRepObj);
-        rationRepository.addRationRepository(rationObj,function(err,data){
-            if (data) {
-                callback(req, res, err, "has data", data);
-            } else {
-                callback(req, res, err, "no data", null);
-            }
-        })
-    },
-    getDisPlayRationLibs: function(req, res){
-        rationRepository.getDisplayRationLibs(function(err, data){
-            if (data) {
-                callback(req, res, err, "has data",data);
-            } else {
-                callback(req, res, err, "no data", null);
-            }
-        });
-    },
-    getRealLibName:function(req,res){
-        var libName = req.body.rationName;
-        rationRepository.getRealLibName(libName,function(err,data){
-            if (data) {
-                callback(req, res, err, "has data", data);
-            } else {
-                callback(req, res, err, "no data", null);
-            }
-        })
-    },
-    getLibIDByName:function(req,res){
-        rationRepository.getLibIDByName(req.body.libName, function(err,data){
-            if (data) {
-                callback(req, res, err, "has ID", data);
-            } else {
-                callback(req, res, err, "no ID", null);
-            }
-        })
-    },
-    deleteRationLib:function(req,res){
-        var rationName = req.body.rationName;
-        rationRepository.deleteRationLib(rationName,function(err,data){
-            if (data) {
-                callback(req, res, err, "has data", data);
-            } else {
-                callback(req, res, err, "no data", null);
-            }
-        })
-    },
-    updateRationRepositoryName: function(req, res) {
-        var orgName = req.body.rationName;
-        var newName = req.body.newName;
-        rationRepository.updateName(orgName, newName, function(err, data){
-            if (data) {
-                callback(req, res, err, "has data", data);
-            } else {
-                callback(req, res, err, "no data", null);
-            }
-        });
-    }
-}

+ 0 - 45
modules/ration_repository/controllers/ration_section_tree_controller.js

@@ -1,45 +0,0 @@
-/**
- * Created by Tony on 2017/4/21.
- */
-
-var rationChapterTreeData = require('../models/ration_section_tree');
-var callback = function(req,res,err,message, data){
-    res.json({error: err, message: message, data: data});
-}
-module.exports ={
-    getRationChapterTree: function(req,res){
-        var rationLibId = req.body.rationLibId;
-        var repId = req.body.rationRepositoryId;
-        if (rationLibId) {
-            rationChapterTreeData.getRationChapterTree(rationLibId,function(err,data){
-                callback(req,res,err, "", data);
-            })
-        } else if (repId) {
-            rationChapterTreeData.getRationChapterTreeByRepId(repId,function(err,data){
-                callback(req,res,err,"", data)
-            })
-        }
-    },
-    createNewNode: function(req, res){
-        var libId = req.body.rationLibId;
-        var lastNodeId = req.body.lastNodeId;
-        var nodeData = JSON.parse(req.body.rawNodeData);
-        rationChapterTreeData.createNewNode(libId, lastNodeId, nodeData, function(err,data){
-            callback(req,res,err,"", data)
-        });
-    },
-    updateNodes: function(req, res) {
-        var nodes = JSON.parse(req.body.nodes);
-        rationChapterTreeData.updateNodes(nodes, function(err,results){
-            callback(req,res, err, "", results)
-        });
-    },
-    deleteNodes: function(req, res) {
-        var nodes = JSON.parse(req.body.nodes);
-        var preNodeId = req.body.preNodeId;
-        var preNodeNextId = req.body.preNodeNextId;
-        rationChapterTreeData.removeNodes(nodes, preNodeId, preNodeNextId, function(err,results){
-            callback(req,res, err, "", results)
-        });
-    }
-}

+ 0 - 83
modules/ration_repository/controllers/repository_glj_controller.js

@@ -1,83 +0,0 @@
-/**
- * Created by Tony on 2017/5/5.
- */
-var gljRepository = require("../models/glj_repository");
-
-var callback = function(req,res,err,message, data){
-    res.json({error: err, message: message, data: data});
-}
-module.exports ={
-    getGljTree: function(req,res){
-        var rationLibId = req.body.rationLibId;
-        gljRepository.getGljTypes(rationLibId,function(err,data){
-            callback(req,res,err, 'Get Tree', data)
-        });
-    },
-    createNewGljTypeNode: function(req, res) {
-        var repId = req.body.repositoryId;
-        var lastNodeId = req.body.lastNodeId;
-        var nodeData = JSON.parse(req.body.rawNodeData);
-        gljRepository.createNewNode(repId, lastNodeId, nodeData, function(err, msg, data){
-            callback(req,res,err,msg, data)
-        });
-    },
-    updateGljNodes: function(req, res) {
-        var nodes = JSON.parse(req.body.nodes);
-        gljRepository.updateNodes(nodes, function(err,results){
-            callback(req,res, err, results)
-        });
-    },
-    deleteGljNodes: function(req, res) {
-        var nodes = JSON.parse(req.body.nodes);
-        var preNodeId = req.body.preNodeId;
-        var preNodeNextId = req.body.preNodeNextId;
-        gljRepository.removeNodes(nodes, preNodeId, preNodeNextId, function(err,results){
-            callback(req,res, err, results)
-        });
-    },
-    getGljItems: function(req, res) {
-        var repId = req.body.repositoryId,
-            gljType = req.body.type,
-            gljCode = req.body.code;
-        if (gljCode) {
-            gljRepository.getGljItem(repId, gljCode, function(err, data){
-                callback(req,res,err,'Get Items', data)
-            });
-        } else if (gljType) {
-            gljRepository.getGljItemByType(repId, gljType, function(err, data){
-                callback(req,res,err,'Get Types', data)
-            });
-        } else {
-            gljRepository.getGljItemsByRep(repId, function(err, data){
-                callback(req,res,err,'Get Items',data)
-            });
-        }
-    },
-    getGljItemsByIds: function(req, res) {
-        var gljIds = JSON.parse(req.body.gljIds);
-        gljRepository.getGljItems(gljIds, function(err, data){
-            callback(req,res,err,'Get Items',data)
-        });
-    },
-    getGljItemsByCodes: function(req, res) {
-        var gljCodes = JSON.parse(req.body.gljCodes),
-            repId = req.body.repId;
-        gljRepository.getGljItemsByCode(repId, gljCodes, function(err, data){
-            callback(req,res,err,'Get Items',data)
-        });
-    },
-    mixUpdateGljItems: function(req, res){
-        var repId = req.body.repositoryId,
-            updateItems = JSON.parse(req.body.updateItems),
-            addItems = JSON.parse(req.body.addItems),
-            removeIds = JSON.parse(req.body.removeIds);
-        gljRepository.mixUpdateGljItems(repId, updateItems, addItems, removeIds, function(err, message, rst){
-            if (err) {
-                callback(req, res, err, message, null);
-            } else {
-                callback(req, res, err, message, rst);
-            }
-        });
-    }
-
-}

+ 0 - 30
modules/ration_repository/controllers/search_controller.js

@@ -1,30 +0,0 @@
-/**
- * Created by Mai on 2017/6/5.
- */
-var rationItem = require('../models/ration_item');
-var callback = function(req, res, err, message, data){
-    res.json({error: err, message: message, data: data});
-};
-
-module.exports = {
-    getRationItem: function (req, res) {
-        var rId = req.body.rationLibId, code = req.body.code;
-        var rationData = {}
-        rationItem.getRationItem(rId, code).then(function (result) {
-            rationData = result._doc;
-            callback(req, res, null, '', rationData);
-        }).catch(function (err, message) {
-            callback(req, res, err, message, null);
-        })
-    },
-    findRation: function (req, res) {
-        var rId = req.body.rationLibId, keyword = req.body.keyword;
-        rationItem.findRation(rId, keyword, function (err, message, rst) {
-            if (err) {
-                callback(req, res, err, message, null);
-            } else {
-                callback(req, res, 0, '', rst);
-            }
-        });
-    }
-};

+ 0 - 134
modules/ration_repository/models/coe.js

@@ -1,134 +0,0 @@
-/**
- * Created by CSL on 2017/5/3.
- * 系数表。
- */
-
-var mongoose = require("mongoose");
-var dbm = require("../../../config/db/db_manager");
-var db = dbm.getCfgConnection("rationRepository");
-var counter = require('../../../public/counter/counter');
-
-var coeSchema = mongoose.Schema({
-    coeType: String,                // 系数类型,指作用范围:
-                                    // 单个(如:111量0.001)、人工类、材料类、机械类、全部(如:定额×0.925)。
-    gljID: Number,                  // 要调整的工料机ID(当coeType=0时有效)
-    operator: String,               // 运算符(*、+、-、=)
-    amount: String,                 // 调整的量
-    _id: false
-});
-
-var coeListSchema = mongoose.Schema({
-    libID: Number,                      // 所属定额定ID
-    ID: Number,                         // 系数ID(流水号ID)
-    name: String,                       // 名称
-    content: String,                    // 说明
-    coes: [coeSchema]
-}, {versionKey: false});
-
-var coeListModel = db.model("coeLists",coeListSchema, "coeLists")
-
-var coeListDAO = function(){};
-
-coeListDAO.prototype.getCoe = function (data, callback) {
-    coeListModel.findOne({
-            "libID": data.libID,
-            "ID": data.ID,
-            "$or": [{"isDeleted": null}, {"isDeleted": false}]
-        },
-        function (err, doc) {
-            if (err) callback("获取系数明细错误!", null)
-            else callback(null, doc);
-        })
-};
-
-coeListDAO.prototype.getCoeItemsByIDs = function (data, callback) {
-    coeListModel.find({
-            "libID": data.libID,
-            "ID": {"$in":data.coeIDs}
-        }, ["libID","ID","name","content","-_id"],
-        function (err, doc) {
-            if (err) callback("批量获取系数明细错误!", null)
-            else callback(null, doc);
-        })
-};
-
-coeListDAO.prototype.getCoesByLibID = function (libID, callback) {
-    coeListModel.find({ "libID": libID },
-        function (err, doc) {
-            if (err) callback("获取定额库系数表错误", null)
-            else callback(null, doc);
-        })
-};
-
-coeListDAO.prototype.saveToCoeList = function(data, callback) {
-    var me = this;
-    if (data.addArr.length > 0) {
-        me.addItems(data.addArr, callback);
-    };
-
-    if (data.deleteArr.length > 0) {
-        me.deleteItems(data.deleteArr, callback);
-    };
-
-    if (data.updateArr.length > 0) {
-        me.updateItems(data.updateArr, callback);
-    };
-};
-
-coeListDAO.prototype.addItems = function(addArr, callback) {
-    if (addArr && addArr.length > 0) {
-        counter.counterDAO.getIDAfterCount(counter.moduleName.coeList, addArr.length, function(err, result){
-            var maxId = result.value.sequence_value;
-            for (var i = 0; i < addArr.length; i++) {
-                var obj = new coeListModel(addArr[i]);
-                obj.ID = (maxId - (addArr.length - 1) + i);
-                coeListModel.create(obj, function(err) {
-                    if (err) {
-                        callback(true, "add fail", null);
-                    } else {
-                        callback(false, "add success", obj.ID);
-                    };
-                });
-            };
-
-        });
-    } else {
-        callback(true, "no source", null);
-    };
-};
-
-coeListDAO.prototype.updateItems = function(updateArr, callback) {
-    if (updateArr && updateArr.length > 0) {
-            for (var i = 0; i < updateArr.length; i++) {
-                var obj = updateArr[i];
-                coeListModel.update({"libID": obj.libID, "ID": obj.ID}, updateArr[i], function(err) {
-                    if (err) {
-                        callback(true, "update fail", null);
-                    } else {
-                        callback(false, "update success", obj.ID);
-                    };
-                });
-            };
-    } else {
-        callback(true, "no source", null);
-    };
-};
-
-coeListDAO.prototype.deleteItems = function(deleteArr, callback) {
-    if (deleteArr && deleteArr.length > 0) {
-        for (var i = 0; i < deleteArr.length; i++) {
-            var obj = deleteArr[i];
-            coeListModel.remove({"libID": obj.libID, "ID": obj.ID}, function(err) {
-                if (err) {
-                    callback(true, "delete fail", null);
-                } else {
-                    callback(false, "delete success", obj.ID);
-                };
-            });
-        };
-    } else {
-        callback(true, "no source", null);
-    };
-};
-
-module.exports = new coeListDAO();

+ 0 - 220
modules/ration_repository/models/glj_repository.js

@@ -1,220 +0,0 @@
-/**
- * Created by Tony on 2017/5/4.
- * 工料机的总库,根据不同定额库分类,参考原gljList表
- */
-
-var mongoose = require("mongoose");
-var dbm = require("../../../config/db/db_manager");
-var db = dbm.getCfgConnection("rationRepository")
-var async = require("async");
-var Schema = mongoose.Schema;
-
-var gljTypeSchema = mongoose.Schema({
-    repositoryId: Number,
-    ID: Number,
-    ParentID: Number,
-    NextSiblingID: Number,
-    Name: String,
-    isDeleted: Boolean
-});
-
-var gljSchema = mongoose.Schema({
-    repositoryId: Number,
-    ID:Number,
-    //以下是基于已有access库
-    code: String,
-    name: String,
-    specs: String,
-    unit: String,
-    basePrice: Number,
-    gljType: Number, //这个是UI显示上的详细分类,对应gljTypeSchema
-    gljDistType: String  //人工,材料,机械
-});
-var gljTypeModel = db.model("gljType",gljTypeSchema, "gljType");
-var gljItemModel = db.model("gljRepository",gljSchema, "gljRepository");
-var repositoryMap = require('./repository_map');
-var counter = require('../../../public/counter/counter');
-
-var gljItemDAO = function(){};
-gljItemDAO.prototype.getGljTypes = function(rationLibId, callback){
-    gljTypeModel.find({"repositoryId": rationLibId, "$or": [{"isDeleted": null}, {"isDeleted": false} ]},function(err,data){
-        if(data.length) callback(false,data);
-        else  if(err) callback("获取工料机类型错误!",false)
-        else callback(false,false);
-    })
-};
-
-gljItemDAO.prototype.getGljItemsByRep = function(repositoryId,callback){
-    gljItemModel.find({"repositoryId": repositoryId},function(err,data){
-        if(err) callback(true, "")
-        else callback(false,data);
-    })
-};
-
-gljItemDAO.prototype.getGljItemByType = function(repositoryId, type, callback){
-    gljItemModel.find({"repositoryId": repositoryId, "gljType": type},function(err,data){
-        if(err) callback(true, "")
-        else callback(false, data);
-    })
-};
-
-gljItemDAO.prototype.getGljItem = function(repositoryId, code, callback){
-    gljItemModel.find({"repositoryId": repositoryId, "code": code},function(err,data){
-        if(err) callback(true, "")
-        else callback(false, data);
-    })
-};
-
-gljItemDAO.prototype.getGljItems = function(gljIds, callback){
-    gljItemModel.find({"ID": {"$in": gljIds}},function(err,data){
-        if(err) callback(true, "")
-        else callback(false, data);
-    })
-};
-
-gljItemDAO.prototype.getGljItemsByCode = function(repositoryId, codes, callback){
-    gljItemModel.find({"repositoryId": repositoryId,"code": {"$in": codes}},function(err,data){
-        if(err) callback(true, "")
-        else callback(false, data);
-    })
-};
-
-gljItemDAO.prototype.mixUpdateGljItems = function(repId, updateItems, addItems, rIds, callback) {
-    var me = this;
-    if (updateItems.length == 0 && rIds.length == 0) {
-        me.addGljItems(repId, addItems, callback);
-    } else {
-        me.removeGljItems(rIds, function(err, message, docs) {
-            me.updateGljItems(repId, updateItems, function(err, results){
-                if (err) {
-                    callback(true, "Fail to update", false);
-                } else {
-                    if (addItems && addItems.length > 0) {
-                        me.addGljItems(repId, addItems, callback);
-                    } else {
-                        callback(false, "Save successfully", results);
-                    }
-                }
-            });
-        });
-    }
-};
-
-gljItemDAO.prototype.removeGljItems = function(rIds, callback) {
-    if (rIds && rIds.length > 0) {
-        gljItemModel.collection.remove({ID: {$in: rIds}}, null, function(err, docs){
-            if (err) {
-                callback(true, "Fail to remove", false);
-            } else {
-                callback(false, "Remove successfully", docs);
-            }
-        })
-    } else {
-        callback(false, "No records were deleted!", null);
-    }
-};
-
-gljItemDAO.prototype.addGljItems = function(repId, items, callback) {
-    if (items && items.length > 0) {
-        counter.counterDAO.getIDAfterCount(counter.moduleName.GLJ, items.length, function(err, result){
-            var maxId = result.value.sequence_value;
-            var arr = [];
-            for (var i = 0; i < items.length; i++) {
-                var obj = new gljItemModel(items[i]);
-                obj.ID = (maxId - (items.length - 1) + i);
-                obj.repositoryId = repId;
-                arr.push(obj);
-            }
-            gljItemModel.collection.insert(arr, null, function(err, docs){
-                if (err) {
-                    callback(true, "Fail to add", false);
-                } else {
-                    callback(false, "Add successfully", docs);
-                }
-            })
-        });
-    } else {
-        callback(true, "No source", false);
-    }
-};
-
-gljItemDAO.prototype.updateGljItems = function(repId, items, callback) {
-    var functions = [];
-    for (var i=0; i < items.length; i++) {
-        functions.push((function(doc) {
-            return function(cb) {
-                var filter = {};
-                if (doc.ID) {
-                    filter.ID = doc.ID;
-                } else {
-                    filter.repositoryId = repId;
-                    filter.code = doc.code;
-                }
-                gljItemModel.update(filter, doc, cb);
-            };
-        })(items[i]));
-    }
-    async.parallel(functions, function(err, results) {
-        callback(err, results);
-    });
-};
-
-gljItemDAO.prototype.updateNodes = function(nodes, callback) {
-    var functions = [];
-    for (var i=0; i < nodes.length; i++) {
-        functions.push((function(doc) {
-            return function(cb) {
-                gljTypeModel.update({ID: doc.ID}, doc, cb);
-            };
-        })(nodes[i]));
-    }
-    async.parallel(functions, function(err, results) {
-        callback(err, results);
-    });
-};
-gljItemDAO.prototype.removeNodes =  function(nodeIds, preNodeId, preNodeNextId, callback){
-    var functions = [];
-    if (preNodeId != -1) {
-        functions.push((function(nodeId, nextId) {
-            return function(cb) {
-                gljTypeModel.update({ID: nodeId}, {"NextSiblingID": nextId}, cb);
-            };
-        })(preNodeId, preNodeNextId));
-    }
-    for (var i=0; i < nodeIds.length; i++) {
-        functions.push((function(nodeId) {
-            return function(cb) {
-                gljTypeModel.update({ID: nodeId}, {"isDeleted": true}, cb);
-            };
-        })(nodeIds[i]));
-    }
-    async.parallel(functions, function(err, results) {
-        callback(err, results);
-    });
-};
-
-gljItemDAO.prototype.createNewNode = function(repId, lastNodeId, nodeData, callback) {
-    return counter.counterDAO.getIDAfterCount(counter.moduleName.GLJ, 1, function(err, result){
-        nodeData.repositoryId = repId;
-        nodeData.ID = result.value.sequence_value;
-        var node = new gljTypeModel(nodeData);
-        node.save(function (err, result) {
-            if (err) {
-                callback(true, "章节树ID错误!", false);
-            } else {
-                if (lastNodeId > 0) {
-                    gljTypeModel.update({ID: lastNodeId}, {"NextSiblingID": nodeData.ID}, function(err, rst){
-                        if (err) {
-                            callback(true, "章节树ID错误!", false);
-                        } else {
-                            callback(false, '', result);
-                        }
-                    });
-                } else callback(false, '', result);
-            }
-        });
-    });
-};
-
-module.exports = new gljItemDAO();
-

+ 0 - 45
modules/ration_repository/models/rationAssist.js

@@ -1,45 +0,0 @@
-/**
- * Created by CSL on 2017/5/5.
- * 辅助定额调整。
- */
-
-var mongoose = require("mongoose");
-var dbm = require("../../../config/db/db_manager");
-var db = dbm.getCfgConnection("rationRepository")
-
-// eg:重庆CQJZDE-2008,P28,AA0116机械装运土方全程运距100米内(主定额)20米内(会根据用户实际录入值变化),AA0117每增加10米(辅助定额)。
-// 建筑中的主定额只有一条辅助定额。(公路的主定额会对应多条辅助定额)
-var assistSchema = mongoose.Schema({
-    libID: Number,                      // 所属定额定ID
-    mainRationID: Number,               // 主定额ID
-    assistRationID: Number,             // 辅助定额ID
-    assistDisplayName: String,          // 辅助定额显示名称 (eg:每增加10米)
-    minValue: String,                   // 下限值(eg:20)
-    maxValue: String,                   // 上限值(eg:100,也可能没有)
-    stepValue: String                   // 步距值 (eg:10)
-});
-
-var assistModel = db.model("rationAssists",assistSchema, "rationAssists")
-
-var assistDAO = function(){};
-
-assistDAO.prototype.getAssist = function (data, callback) {
-    assistModel.findOne({
-            "libID": data.libID,
-            "mainRationID": data.mainRationID,
-            "$or": [{"isDeleted": null}, {"isDeleted": false}]
-        },
-        function (err, doc) {
-            if (err) callback(true, "获取辅助定额错误!", "")
-            else callback(false, "获取辅助定额成功", doc);
-        })
-};
-
-// test datas.
-//function callbackExec(err) {if (err) {console.log(err);} else {console.log('saved.')};};
-//assistModel.create({"libID": 1, "mainRationID":1, assistRationID: 2, assistDisplayName: "每增加10米", minValue:"20", maxValue: "100", stepValue:"10"}, callbackExec);
-//assistModel.create({"libID": 1, "mainRationID":3, assistRationID: 4, assistDisplayName: "每增加100米", minValue:"200", maxValue: "500", stepValue:"100"}, callbackExec);
-//assistModel.create({"libID": 1, "mainRationID":5, assistRationID: 6, assistDisplayName: "每增加100米", minValue:"1000", maxValue: null, stepValue:"1000"}, callbackExec);
-
-
-module.exports = new assistDAO();

+ 0 - 35
modules/ration_repository/models/rationCoe.js

@@ -1,35 +0,0 @@
-/**
- * Created by CSL on 2017/5/3.
- * 定额系数关系表。(即附注条件。系数会被定额公用,如同一个分枝下的兄弟定额。)
- * 公路上,定额章节点上也会挂系数(关系数据库可减少数据冗余),该系数作用于该章节下的所有定额。每条定额还有自己特有的系数。
- * 建筑上,简化逻辑设计,把章节点上的系数移到具体的定额上。
- */
-var mongoose = require("mongoose");
-var dbm = require("../../../config/db/db_manager");
-var db = dbm.getCfgConnection("rationRepository")
-
-var rationCoeSchema = mongoose.Schema({
-    ID:Number,
-    libID: Number,
-    rationID: Number,
-    coeIDs: Array
-});
-
-var rationCoeModel = db.model("rationCoes",rationCoeSchema, "rationCoes")
-
-var rationCoeDAO = function(){};
-
-rationCoeDAO.prototype.getRationCoes = function (data, callback) {
-    rationCoeModel.findOne({
-            "libID": data.libID,
-            "rationID": data.rationID,
-            "$or": [{"isDeleted": null}, {"isDeleted": false}]
-        },
-        function (err, doc) {
-            if (err) callback(true, "获取定额调整系数错误!", "")
-            else callback(false, "获取定额调整系数成功", doc);
-        })
-};
-
-module.exports = new rationCoeDAO();
-

+ 0 - 166
modules/ration_repository/models/ration_item.js

@@ -1,166 +0,0 @@
-/**
- * Created by Tony on 2017/4/28.
- */
-var mongoose = require("mongoose");
-var dbm = require("../../../config/db/db_manager");
-var db = dbm.getCfgConnection("rationRepository")
-var async = require("async");
-var Schema = mongoose.Schema;
-
-var rationGljItemSchema = mongoose.Schema({
-    gljId: Number,
-    consumeAmt: Number,
-    proportion: Number //配合比,暂时无需使用,默认0
-}, { _id: false });
-var rationItemSchema = mongoose.Schema({
-    ID:Number,
-    code: String,
-    name: String,
-    unit: String,
-    basePrice: Number,
-    sectionId: Number,
-    rationRepId: Number,
-    caption: String,
-    feeType: Number,
-    rationGljList: [rationGljItemSchema]
-});
-var rationItemModel = db.model("rationItems",rationItemSchema, "rationItems")
-var counter = require('../../../public/counter/counter');
-
-var rationItemDAO = function(){};
-
-rationItemDAO.prototype.getRationItemsBySection = function(sectionId,callback){
-    rationItemModel.find({"sectionId": sectionId, "$or": [{"isDeleted": null}, {"isDeleted": false} ]},function(err,data){
-        if(err) callback(true, "Fail to get items", "")
-        else callback(false,"Get items successfully", data);
-    })
-};
-rationItemDAO.prototype.mixUpdateRationItems = function(rationLibId, sectionId, updateItems, addItems, rIds, callback){
-    var me = this;
-    if (updateItems.length == 0 && rIds.length == 0) {
-        me.addRationItems(rationLibId, sectionId, addItems, callback);
-    } else {
-        me.removeRationItems(rIds, function(err, message, docs) {
-            if (err) {
-                callback(true, "Fail to remove", false);
-            } else {
-                me.updateRationItems(rationLibId, sectionId, updateItems, function(err, results){
-                    if (err) {
-                        callback(true, "Fail to save", false);
-                    } else {
-                        if (addItems && addItems.length > 0) {
-                            me.addRationItems(rationLibId, sectionId, addItems, callback);
-                        } else {
-                            callback(false, "Save successfully", results);
-                        }
-                    }
-                });
-            }
-        })
-    }
-};
-
-rationItemDAO.prototype.removeRationItems = function(rIds,callback){
-    if (rIds.length > 0) {
-        rationItemModel.collection.remove({ID: {$in: rIds}}, null, function(err, docs){
-            if (err) {
-                callback(true, "Fail to remove", false);
-            } else {
-                callback(false, "Remove successfully", docs);
-            }
-        })
-    } else {
-        callback(false, "No records were deleted!", null);
-    }
-};
-
-rationItemDAO.prototype.getRationItemsByCode = function(repId, code,callback){
-    rationItemModel.find({"rationRepId": repId, "code": {'$regex': code, $options: '$i'}, "$or": [{"isDeleted": null}, {"isDeleted": false}]},function(err,data){
-        if(err) callback(true, "Fail to get items", "")
-        else callback(false,"Get items successfully", data);
-    })
-};
-
-rationItemDAO.prototype.findRation = function (repId, keyword, callback) {
-    var filter = {
-        'rationRepId': repId,
-        '$and': [{
-            '$or': [{'code': {'$regex': keyword, $options: '$i'}}, {'name': {'$regex': keyword, $options: '$i'}}]
-        }, {
-            '$or': [{'isDeleted': {"$exists":false}}, {'isDeleted': null}, {'isDeleted': false}]
-        }]
-    };
-    rationItemModel.find(filter, function (err, data) {
-        if (err) {
-            callback(true, 'Fail to find ration', null);
-        } else {
-            callback(false, '', data);
-        }
-    })
-}
-
-rationItemDAO.prototype.getRationItem = function (repId, code, callback) {
-    if (callback) {
-        rationItemModel.findOne({rationRepId: repId, code: code, "$or": [{"isDeleted": null}, {"isDeleted": false}]}, '-_id').exec()
-            .then(function (result, err) {
-                if (err) {
-                    callback(1, '找不到定额“' + code +'”' , null);
-                } else {
-                    callback(0, '', result);
-                }
-            });
-        return null;
-    } else {
-        return rationItemModel.findOne({rationRepId: repId, code: code, "$or": [{"isDeleted": null}, {"isDeleted": false}]}, '-_id').exec();
-    }
-};
-
-rationItemDAO.prototype.addRationItems = function(rationLibId, sectionId, items,callback){
-    if (items && items.length > 0) {
-        counter.counterDAO.getIDAfterCount(counter.moduleName.rations, items.length, function(err, result){
-            var maxId = result.value.sequence_value;
-            var arr = [];
-            for (var i = 0; i < items.length; i++) {
-                var obj = new rationItemModel(items[i]);
-                obj.ID = (maxId - (items.length - 1) + i);
-                obj.sectionId = sectionId;
-                obj.rationRepId = rationLibId;
-                arr.push(obj);
-            }
-            rationItemModel.collection.insert(arr, null, function(err, docs){
-                if (err) {
-                    callback(true, "Fail to save", false);
-                } else {
-                    callback(false, "Save successfully", docs);
-                }
-            })
-        });
-    } else {
-        callback(true, "Source error!", false);
-    }
-};
-
-rationItemDAO.prototype.updateRationItems = function(rationLibId, sectionId, items,callback){
-    var functions = [];
-    for (var i=0; i < items.length; i++) {
-        functions.push((function(doc) {
-            return function(cb) {
-                var filter = {};
-                if (doc.ID) {
-                    filter.ID = doc.ID;
-                } else {
-                    filter.sectionId = sectionId;
-                    if (rationLibId) filter.rationRepId = rationLibId;
-                    filter.code = doc.code;
-                }
-                rationItemModel.update(filter, doc, cb);
-            };
-        })(items[i]));
-    }
-    async.parallel(functions, function(err, results) {
-        callback(err, results);
-    });
-};
-
-module.exports = new rationItemDAO()
-

+ 0 - 100
modules/ration_repository/models/ration_section_tree.js

@@ -1,100 +0,0 @@
-/**
- * Created by Tony on 2017/4/21.
- */
-
-var mongoose = require("mongoose");
-var dbm = require("../../../config/db/db_manager");
-var chapterTreeDb = dbm.getCfgConnection("rationRepository")
-var async = require("async");
-var Schema = mongoose.Schema;
-
-var rationChapterTreeSchema = new Schema({//章节树  //生成唯一id改为sectionID  改成string
-    rationRepId: Number,
-    ID:Number,
-    ParentID:Number,
-    NextSiblingID:Number,
-    name: String,
-    isDeleted: Boolean
-});
-var rationChapterTreeModel = chapterTreeDb.model("rationChapterTrees",rationChapterTreeSchema, "rationChapterTrees")
-var counter = require('../../../public/counter/counter');
-
-var rationChapterTreeDAO = function(){};
-
-rationChapterTreeDAO.prototype.getRationChapterTree = function(rationLibId,callback){
-    rationChapterTreeModel.find({"rationRepId": rationLibId, "$or": [{"isDeleted": null}, {"isDeleted": false} ]},function(err,data){
-        if(data.length) callback(false,data);
-        else  if(err) callback("获取定额树错误!",false)
-        else callback(false,false);
-    })
-}
-
-rationChapterTreeDAO.prototype.getRationChapterTreeByRepId = function(repId,callback){
-    rationChapterTreeModel.find({"rationRepId": repId, "$or": [{"isDeleted": null}, {"isDeleted": false} ]},function(err,data){
-        if(data.length) callback(false,data);
-        else  if(err) callback("获取定额树错误!",false)
-        else callback(false,false);
-    })
-}
-
-rationChapterTreeDAO.prototype.createNewNode = function(libId, lastNodeId, nodeData,callback){
-    counter.counterDAO.getIDAfterCount(counter.moduleName.rationTree, 1, function(err, result){
-        nodeData.rationRepId = libId;
-        nodeData.ID = result.value.sequence_value;
-        var node = new rationChapterTreeModel(nodeData);
-        node.save(function (err, result) {
-            if (err) {
-                callback("章节树ID错误!", false);
-            } else {
-                if (lastNodeId > 0) {
-                    rationChapterTreeModel.update({ID: lastNodeId}, {"NextSiblingID": nodeData.ID}, function(err, rst){
-                        if (err) {
-                            callback("章节树ID错误!", false);
-                        } else {
-                            callback(false, result);
-                        }
-                    });
-                } else callback(false, result);
-            }
-        });
-    });
-},
-
-rationChapterTreeDAO.prototype.removeNodes = function(nodeIds, preNodeId, preNodeNextId, callback){
-    var functions = [];
-    if (preNodeId != -1) {
-        functions.push((function(nodeId, nextId) {
-            return function(cb) {
-                rationChapterTreeModel.update({ID: nodeId}, {"NextSiblingID": nextId}, cb);
-            };
-        })(preNodeId, preNodeNextId));
-    }
-    for (var i=0; i < nodeIds.length; i++) {
-        functions.push((function(nodeId) {
-            return function(cb) {
-                rationChapterTreeModel.update({ID: nodeId}, {"isDeleted": true}, cb);
-            };
-        })(nodeIds[i]));
-    }
-    async.parallel(functions, function(err, results) {
-        callback(err, results);
-    });
-}
-
-rationChapterTreeDAO.prototype.updateNodes = function(nodes,callback){
-    var functions = [];
-    for (var i=0; i < nodes.length; i++) {
-        //var md = new rationChapterTreeModel(nodes[i]);
-        //md.isNew = false;
-        functions.push((function(doc) {
-            return function(cb) {
-                rationChapterTreeModel.update({ID: doc.ID}, doc, cb);
-            };
-        })(nodes[i]));
-    }
-    async.parallel(functions, function(err, results) {
-        callback(err, results);
-    });
-};
-
-module.exports = new rationChapterTreeDAO()

+ 0 - 120
modules/ration_repository/models/repository_map.js

@@ -1,120 +0,0 @@
-/**
- * Created by Tony on 2017/4/24.
- * 重新构造,不适宜生成多个定额库db,还是得统一在一个表
- */
-var mongoose = require('mongoose');
-var dbm = require("../../../config/db/db_manager");
-//var stringUtil = require('../../../public/stringUtil');
-var rationLibdb = dbm.getCfgConnection("rationRepository");
-var Schema = mongoose.Schema;
-var RepositoryMapSchema = new Schema({
-    "ID": Number,
-    "dispName" : String,
-    "appType" : String, //如:"建筑" / "公路"
-    "localeType": String, //如 各个省份 / 部颁
-    "descr" : String,
-    "deleted": Boolean
-});
-var counter = require('../../../public/counter/counter');
-
-var rationRepository = rationLibdb.model("repositoryMap", RepositoryMapSchema, "repositoryMap");
-
-function createNewLibModel(rationLibObj){
-    var rst = {};
-    rst.dispName = rationLibObj.dispName;
-    rst.appType = rationLibObj.appType?rationLibObj.appType:'construct';
-    rst.localeType = rationLibObj.localeType?rationLibObj.localeType:'';
-    rst.descr = rationLibObj.descr;
-    rst.deleted = false;
-    return rst;
-}
-
-rationRepositoryDao = function(){};
-
-rationRepositoryDao.prototype.getRealLibName = function(dispName,callback){
-    if (callback) {
-        rationRepository.find({"dispName": dispName}, function(err,data){
-            if (err) {
-                callback('Error', null);
-            } else {
-                callback(false, data);
-            }
-        });
-    } else {
-        var rst = rationRepository.find({"dispName": dispName}).exec();
-        return rst;
-    }
-};
-
-rationRepositoryDao.prototype.getLibIDByName = function(dispName, callback){
-    rationRepository.findOne({"dispName": dispName}, function(err,data){
-        if (err) {
-            callback('Error', null);
-        } else {
-            callback(false, data.ID);
-        }
-    });
-};
-
-rationRepositoryDao.prototype.getRepositoryById = function(repId,callback){
-    if (callback) {
-        rationRepository.find({"ID": repId}, function(err,data){
-            if (err) {
-                callback('Error', null);
-            } else {
-                callback(false, data);
-            }
-        });
-    } else {
-        var rst = rationRepository.find({"ID": repId}).exec();
-        return rst;
-    }
-};
-
-rationRepositoryDao.prototype.addRationRepository = function( rationLibObj,callback){
-    counter.counterDAO.getIDAfterCount(counter.moduleName.rationMap, 1, function(err, result){
-        var rMap = createNewLibModel(rationLibObj);
-        rMap.ID = result.value.sequence_value;
-        new rationRepository(rMap).save(function(err, result) {
-            if (err) callback("Error", null)
-            else
-                callback(false, result);
-        });
-    });
-};
-
-rationRepositoryDao.prototype.getDisplayRationLibs = function(callback) {
-    rationRepository.find({"deleted": false}, function(err, data){
-        if (err) {
-            callback( 'Error', null);
-        } else {
-            callback( false, data);
-        }
-    });
-};
-
-rationRepositoryDao.prototype.updateName = function(orgName,newName,callback){
-    rationRepository.find({"dispName":newName, "deleted": false}, function(err, data){
-        if (data.length == 0) {
-            rationRepository.update({dispName:orgName},{$set:{dispName:newName}},function(err){
-                if(err) callback("err",false);
-                else callback(false,"ok")
-            })
-        } else
-            callback("不可重名!",false);
-    });
-}
-
-rationRepositoryDao.prototype.deleteRationLib = function(rationName,callback){
-    rationRepository.find({"dispName":rationName, "deleted": false}, function(err, data){
-        if (data.length == 1) {
-            rationRepository.update({dispName:rationName},{$set:{deleted: true}},function(err){
-                if(err) callback("err",false);
-                else callback(false,"ok")
-            })
-        } else
-            callback("删除失败!",false);
-    });
-}
-
-module.exports = new rationRepositoryDao();

+ 0 - 46
modules/ration_repository/routes/ration_rep_routes.js

@@ -1,46 +0,0 @@
-/**
- * Created by Tony on 2017/4/20.
- */
-var express = require("express");
-var apiRouter =express.Router();
-//var _rootDir = __dirname;
-
-var rationRepositoryController = require("../controllers/ration_repository_controller");
-var rationChapterTreeController = require("../controllers/ration_section_tree_controller");
-var rationController = require("../controllers/ration_controller");
-var repositoryGljController = require("../controllers/repository_glj_controller");
-var coeListController = require("../controllers/coe_controller");
-var searchController = require('../controllers/search_controller');
-
-apiRouter.post("/getRationDisplayNames",rationRepositoryController.getDisPlayRationLibs);
-apiRouter.post("/editRationLibs",rationRepositoryController.updateRationRepositoryName);
-apiRouter.post("/addRationRepository",rationRepositoryController.addRationRepository);
-apiRouter.post("/deleteRationLibs",rationRepositoryController.deleteRationLib);
-apiRouter.post("/getRealLibName",rationRepositoryController.getRealLibName);
-apiRouter.post("/getLibIDByName",rationRepositoryController.getLibIDByName);
-
-apiRouter.post("/getRationTree",rationChapterTreeController.getRationChapterTree);
-apiRouter.post("/createNewNode",rationChapterTreeController.createNewNode);
-apiRouter.post("/updateNodes",rationChapterTreeController.updateNodes);
-apiRouter.post("/deleteNodes",rationChapterTreeController.deleteNodes);
-
-apiRouter.post("/getRationItems",rationController.getRationItemsBySection);
-apiRouter.post("/mixUpdateRationItems",rationController.mixUpdateRationItems);
-
-apiRouter.post("/createNewGljTypeNode",repositoryGljController.createNewGljTypeNode);
-apiRouter.post("/updateGljNodes",repositoryGljController.updateGljNodes);
-apiRouter.post("/deleteGljNodes",repositoryGljController.deleteGljNodes);
-apiRouter.post("/getGljTree",repositoryGljController.getGljTree);
-apiRouter.post("/getGljItems",repositoryGljController.getGljItems);
-apiRouter.post("/mixUpdateGljItems",repositoryGljController.mixUpdateGljItems);
-apiRouter.post("/getGljItemsByIds",repositoryGljController.getGljItemsByIds);
-apiRouter.post("/getGljItemsByCodes",repositoryGljController.getGljItemsByCodes);
-
-apiRouter.post("/getCoeList",coeListController.getCoeList);
-apiRouter.post("/saveCoeList",coeListController.saveCoeList);
-apiRouter.post("/getCoeItemsByIDs",coeListController.getCoeItemsByIDs);
-
-apiRouter.post('/getRationItem', searchController.getRationItem);
-apiRouter.post('/findRation', searchController.findRation);
-
-module.exports = apiRouter;

+ 0 - 99
modules/reports/controllers/rpt_controller.js

@@ -1,99 +0,0 @@
-/**
- * Created by Tony on 2017/3/13.
- */
-
-let JV = require('../rpt_component/jpc_value_define');
-let Template = require('../models/rpt_template');
-let TemplateData = require('../models/rpt_tpl_data');
-let JpcEx = require('../rpt_component/jpc_ex');
-//let cache = require('../../../public/cache/cacheUtil');
-let rptUtil = require("../util/rpt_util");
-let rpt_xl_util = require('../util/rpt_excel_util');
-let fs = require('fs');
-let strUtil = require('../../../public/stringUtil');
-
-//统一回调函数
-let callback = function(req, res, err, data){
-    if(err){
-        res.json({success: false, error: err});
-    }
-    else{
-        //res.send({success: true, data: data});
-        res.json({success:true, data: data});
-    }
-};
-
-module.exports = {
-    getReportAllPages: function(req, res){
-        let grp_id = req.body.grp_id;
-        let tpl_id = req.body.tpl_id;
-        let pageSize = req.body.pageSize;
-        let rptTpl = null;
-        Template.getPromise(grp_id, tpl_id).then(function(rst) {
-            rptTpl = rst;
-            if (rptTpl) {
-                return TemplateData.getPromise(tpl_id);
-            } else {
-                callback(req, res, 'No report template was found!', null);
-            }
-        }).then(function(tplData){
-                if (tplData) {
-                    let printCom = JpcEx.createNew();
-                    rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = pageSize;
-                    let defProperties = rptUtil.getReportDefaultCache();
-                    printCom.initialize(rptTpl);
-                    printCom.analyzeData(rptTpl, tplData, defProperties);
-                    let maxPages = printCom.totalPages;
-                    let pageRst = printCom.outputAsSimpleJSONPageArray(rptTpl, tplData, 1, maxPages, defProperties);
-                    if (pageRst) {
-                        callback(req, res, null, pageRst);
-                    } else {
-                        callback(req, res, "Have errors while on going...", null);
-                    }
-                } else {
-                    callback(req, res, 'No report data were found!', null);
-                }
-            }
-        );
-    },
-    getExcel: function(req, res) {
-        let grp_id = req.params.id, tpl_id = req.params.pm, pageSize = req.params.size, rptName = req.params.rptName;
-        let rptTpl = null;
-        Template.getPromise(grp_id, tpl_id).then(function(rst) {
-            rptTpl = rst;
-            if (rptTpl) {
-                return TemplateData.getPromise(tpl_id);
-            } else {
-                callback(req, res, 'No report template was found!', null);
-            }
-        }).then(function(tplData){
-                if (tplData) {
-                    let printCom = JpcEx.createNew();
-                    rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE] = pageSize;
-                    let defProperties = rptUtil.getReportDefaultCache();
-                    printCom.initialize(rptTpl);
-                    printCom.analyzeData(rptTpl, tplData, defProperties);
-                    let maxPages = printCom.totalPages;
-                    let pageRst = printCom.outputAsSimpleJSONPageArray(rptTpl, tplData, 1, maxPages, defProperties);
-                    if (pageRst) {
-                        rpt_xl_util.exportExcel(pageRst, rptName, null, function(newName){
-                            res.setHeader('Content-Type', 'application/vnd.openxmlformats');
-                            res.setHeader("Content-Disposition", "attachment; filename=" + strUtil.getPinYinCamelChars(rptName) + ".xlsx");
-                            let filestream = fs.createReadStream(__dirname.slice(0, __dirname.length - 28) + '/tmp/' + newName + '.xlsx');
-                            filestream.on('data', function(chunk) {
-                                res.write(chunk);
-                            });
-                            filestream.on('end', function() {
-                                res.end();
-                            });
-                        });
-                    } else {
-                        callback(req, res, "Have errors while on going...", null);
-                    }
-                } else {
-                    callback(req, res, 'No report data were found!', null);
-                }
-            }
-        );
-    }
-};

+ 0 - 46
modules/reports/controllers/rpt_tpl_controller.js

@@ -1,46 +0,0 @@
-/**
- * Created by Tony on 2017/6/1.
- */
-
-let TplNode = require('../models/tpl_tree_node');
-
-//统一回调函数
-let callback = function(req, res, err, message, data){
-    res.json({error: err, message: message, data: data});
-}
-
-module.exports = {
-    getRptTplTree: function(req, res) {
-        let params = JSON.parse(req.body.params),
-            grpType = params.grpType,
-            userId = params.userId,
-            tplType = params.tplType;
-        TplNode.getTplTreeNodes(grpType, userId, tplType, function(err, data){
-            callback(req,res,err,"", data);
-        })
-    },
-    updateTreeNodes: function(req, res) {
-        let params = JSON.parse(req.body.params),
-            nodes = params.nodes;
-        TplNode.updateTreeNodes(nodes, function(err,results){
-            callback(req,res, err, "", results)
-        });
-    },
-    deleteTptTplNodes: function(req, res){
-        let params = JSON.parse(req.body.params),
-            nodeIds = params.nodeIds,
-            preNodeId = params.preNodeId,
-            preNodeNextId = params.preNodeNextId;
-        TplNode.removeNodes(nodeIds, preNodeId, preNodeNextId, function(err,results){
-            callback(req,res, err, "", results)
-        });
-    },
-    createTplTreeNode: function(req, res){
-        let params = JSON.parse(req.body.params),
-            lastNodeId = params.lastNodeId,
-            nodeData = params.rawNodeData;
-        TplNode.createTplTreeNode(nodeData, lastNodeId, function(err, data){
-            callback(req,res,err,"", data);
-        })
-    }
-}

+ 0 - 32
modules/reports/models/cfg_common.js

@@ -1,32 +0,0 @@
-/**
- * Created by Tony on 2017/6/6.
- */
-
-class cfgCommon{
-    constructor(modelObj) {
-        this.modelObj = modelObj;
-    }
-    get(id, callback){
-        this.modelObj.find({ID: id}, '-_id', function(err, templates){
-            if(templates.length){
-                callback(false, templates[0]);
-            }
-            else{
-                callback('no record was found!');
-            }
-        })
-    };
-    getAll(id, callback){
-        this.modelObj.find({}, '-_id', function(err, templates){
-            if(templates.length){
-                callback(false, templates);
-            }
-            else{
-                callback('no record was found!');
-            }
-        })
-    };
-};
-
-//module.exports = new cfgCommon(null);
-module.exports = cfgCommon;

+ 0 - 25
modules/reports/models/cfg_control.js

@@ -1,25 +0,0 @@
-/**
- * Created by Tony on 2016/12/23.
- */
-let mongoose = require('mongoose');
-let dbm = require("../../../config/db/db_manager");
-let smartcostdb = dbm.getCfgConnection("Reports");
-let Schema = mongoose.Schema;
-let CtrlSchema = new Schema({
-    "ID" : String,
-    "Shrink" : String,
-    "ShowZero" : String,
-    "Horizon" : String,
-    "Vertical" : String,
-    "Wrap" : String
-});
-let Control = smartcostdb.model("com_ctrls", CtrlSchema, "com_ctrls");
-let cfgCommonClass = require('./cfg_common');
-
-class CtrlDAO extends cfgCommonClass{
-    constructor(){
-        super(Control);
-    };
-};
-
-module.exports = new CtrlDAO();

+ 0 - 28
modules/reports/models/cfg_font.js

@@ -1,28 +0,0 @@
-/**
- * Created by Tony on 2016/12/23.
- */
-let mongoose = require('mongoose');
-let dbm = require("../../../config/db/db_manager");
-let smartcostdb = dbm.getCfgConnection("Reports");
-let Schema = mongoose.Schema;
-let FontSchema = new Schema({
-    "ID" : String,
-    "Name" : String,
-    "FontHeight" : String,
-    "FontColor" : String,
-    "FontBold" : String,
-    "FontItalic" : String,
-    "FontUnderline" : String,
-    "FontStrikeOut" : String,
-    "FontAngle" : String
-});
-let Font = smartcostdb.model("com_fonts", FontSchema, "com_fonts");
-let cfgCommonClass = require('./cfg_common');
-
-class FontDAO extends cfgCommonClass{
-    constructor(){
-        super(Font);
-    };
-};
-
-module.exports = new FontDAO();

+ 0 - 22
modules/reports/models/cfg_style.js

@@ -1,22 +0,0 @@
-/**
- * Created by Tony on 2016/12/23.
- */
-let mongoose = require('mongoose');
-let dbm = require("../../../config/db/db_manager");
-let smartcostdb = dbm.getCfgConnection("Reports");
-let Schema = mongoose.Schema;
-let StyleSchema = new Schema({
-    "ID" : String,
-    "border_style" : Array
-});
-let Style = smartcostdb.model("com_styles", StyleSchema, "com_styles");
-let cfgCommonClass = require('./cfg_common');
-
-class StyleDAO extends cfgCommonClass{
-    constructor(){
-        super(Style);
-    };
-};
-
-module.exports = new StyleDAO();
-

+ 0 - 40
modules/reports/models/rpt_template.js

@@ -1,40 +0,0 @@
-/**
- * Created by Tony on 2016/12/23.
- */
-let mongoose = require('mongoose');
-let dbm = require("../../../config/db/db_manager");
-let smartcostdb = dbm.getCfgConnection("Reports");
-let Schema = mongoose.Schema;
-let RptTemplateSchema = new Schema({
-    "GROUP_KEY": String,
-    "ID_KEY": String,
-    "主信息": Schema.Types.Mixed,
-    "指标_数据_映射": Schema.Types.Mixed,
-    "布局框_集合": Array,
-    "流水式表_信息": Schema.Types.Mixed,
-    "交叉表_信息": Schema.Types.Mixed,
-    "无映射离散指标_集合": Schema.Types.Mixed,
-    "离散参数_集合": Schema.Types.Mixed,
-    "计算式_集合": Array
-});
-
-let Template = smartcostdb.model("rpt_templates", RptTemplateSchema, "rpt_templates");
-
-class RplTplDAO{
-    get(grpId, id, callback){
-        Template.find({GROUP_KEY: grpId, ID_KEY: id}, '-_id', function(err, templates){
-            if(templates.length){
-                callback(false, templates[0]);
-            }
-            else{
-                callback('查找不到报表模板!');
-            }
-        })
-    };
-    getPromise(grpId, id){
-        let rst = Template.findOne({GROUP_KEY: grpId, ID_KEY: id}, '-_id').exec() ;
-        return rst;
-    }
-}
-
-module.exports = new RplTplDAO();

+ 0 - 34
modules/reports/models/rpt_tpl_data.js

@@ -1,34 +0,0 @@
-/**
- * Created by Tony on 2016/12/28.
- */
-let mongoose = require('mongoose');
-let dbm = require("../../../config/db/db_manager");
-let smartcostdb = dbm.getCfgConnection("Reports");
-let Schema = mongoose.Schema;
-let RptTemplateDataSchema = new Schema({
-    "Data_Key": String,
-    "discrete_data": Array,
-    "master_data": Array,
-    "detail_data": Array
-});
-
-let TemplateData = smartcostdb.model("temp_tpl_data", RptTemplateDataSchema, "temp_tpl_data");
-
-class RplTplDataDAO{
-    //根据id获取临时数据
-    get(tpl_id, callback){
-        TemplateData.find({"Data_Key": tpl_id}, function(err, templates){
-            if(templates.length){
-                callback(false, templates[0]);
-            }
-            else{
-                callback('查找不到模板临时数据!');
-            }
-        })
-    };
-    getPromise(tpl_id, callback){
-        return TemplateData.findOne({"Data_Key": tpl_id}).exec();
-    }
-};
-
-module.exports = new RplTplDataDAO();

+ 0 - 98
modules/reports/models/tpl_tree_node.js

@@ -1,98 +0,0 @@
-/**
- * Created by Tony on 2017/5/31.
- */
-var mongoose = require('mongoose');
-var dbm = require("../../../config/db/db_manager");
-var db = dbm.getCfgConnection("Reports");
-var async = require("async");
-var rptTplDef = require("../../../public/rpt_tpl_def").getUtil();
-var Schema = mongoose.Schema;
-var TreeNodeSchema = new Schema({
-    ID:Number,
-    ParentID:Number,
-    NextSiblingID:Number,
-    grpType: Number, //建筑(const : 1)/公路(const 2)/其他 etc...
-    nodeType: Number,//节点类型:树节点(枝) 或 模板节点(叶)
-    tplType: Number, //概算、预算、招投标 etc...
-    userId: String,   //用户自定义模板用
-    refId: Number,   //
-    name: String,
-    isDeleted: Boolean
-});
-
-var TreeNodeModel = db.model("rpt_tpl_tree", TreeNodeSchema, "rpt_tpl_tree");
-var counter = require('../../../public/counter/counter');
-
-//var RplTplTreeDAO = function(){};
-class RplTplTreeDAO{
-    getTplTreeNodes(grpType, userId, tplType, callback) {
-        var filter = {"grpType": grpType, "$or": [{"isDeleted": null}, {"isDeleted": false} ]};
-        if (userId) {
-            filter.userId = userId;
-        }
-        if ((tplType && tplType !== rptTplDef.TplType.ALL)) {
-            filter.tplType = tplType;
-        }
-        TreeNodeModel.find(filter, '-_id', function(err, data){
-            if (err) {
-                callback(true, null);
-            } else callback(false,data);
-        });
-    };
-    updateTreeNodes(nodes, callback) {
-        var 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(err, results);
-        });
-    };
-    removeNodes(nodeIds, preNodeId, preNodeNextId, callback) {
-        var 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(err, results);
-        });
-    };
-    createTplTreeNode(nodeData, lastNodeId, callback) {
-        counter.counterDAO.getIDAfterCount(counter.moduleName.report, 1, function(err, result){
-            nodeData.ID = result.value.sequence_value;
-            var node = new TreeNodeModel(nodeData);
-            node.save(function (err, result) {
-                if (err) {
-                    callback("树节点错误!", false);
-                } else {
-                    if (lastNodeId > 0) {
-                        TreeNodeModel.update({ID: lastNodeId}, {"NextSiblingID": nodeData.ID}, function(err, rst){
-                            if (err) {
-                                callback("树节点错误!", false);
-                            } else {
-                                callback(false, result);
-                            }
-                        });
-                    } else callback(false, result);
-                }
-            });
-        });
-    };
-}
-
-module.exports = new RplTplTreeDAO();

+ 0 - 12
modules/reports/routes/report_router.js

@@ -1,12 +0,0 @@
-/**
- * Created by Tony on 2017/3/13.
- */
-
-let express = require('express');
-let rptRouter = express.Router();
-let reportController = require('./../controllers/rpt_controller');
-
-rptRouter.post('/getReport', reportController.getReportAllPages);
-rptRouter.get('/getExcel/:id/:pm/:size/:rptName', reportController.getExcel);
-
-module.exports = rptRouter;

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

@@ -1,10 +0,0 @@
-let express = require("express");
-let rptTplRouter = express.Router();
-let reportTplController = require('./../controllers/rpt_tpl_controller');
-
-rptTplRouter.post('/createTplTreeNode', reportTplController.createTplTreeNode);
-rptTplRouter.post('/getRptTplTree', reportTplController.getRptTplTree);
-rptTplRouter.post('/updateTptTplNodes', reportTplController.updateTreeNodes);
-rptTplRouter.post('/deleteTptTplNodes', reportTplController.deleteTptTplNodes);
-
-module.exports = rptTplRouter;

+ 0 - 52
modules/reports/rpt_component/Jpc_Band.js

@@ -1,52 +0,0 @@
-let JV = require('./jpc_value_define');
-let JpcCommonHelper = require('./helper/jpc_helper_common');
-let JpcBandHelper = require('./helper/jpc_helper_band');
-
-let JpcBand = {
-    createNew: function(rptTpl, defProperties) {
-        let me = this;
-        let JpcBandResult = {};
-        if (rptTpl[JV.NODE_BAND_COLLECTION]) {
-            for (let i = 0; i < rptTpl[JV.NODE_BAND_COLLECTION].length; i++) {
-                me.createSingle(rptTpl[JV.NODE_BAND_COLLECTION][i], JpcBandResult, rptTpl, defProperties);
-            }
-        }
-        return JpcBandResult;
-    },
-    createSingle: function(bandNode, parentObj, rptTpl, defProperties) {
-        let me = this;
-        if (bandNode && bandNode[JV.BAND_PROP_NAME]) {
-            let item = {Left:0, Right:0, Top:0, Bottom:0};
-            item[JV.BAND_PROP_STYLE] = JpcCommonHelper.getStyle(bandNode[JV.BAND_PROP_STYLE], defProperties.styles, null);
-            item[JV.BAND_PROP_CONTROL] = JpcCommonHelper.getControl(bandNode[JV.BAND_PROP_CONTROL], defProperties.ctrls, null);
-            if (bandNode[JV.BAND_PROP_HEIGHT]) {
-                item[JV.BAND_PROP_HEIGHT] = 1.0 * bandNode[JV.BAND_PROP_HEIGHT];
-            } else {
-                item[JV.BAND_PROP_HEIGHT] = 0.0;
-            }
-            if (bandNode[JV.BAND_PROP_WIDTH]) {
-                item[JV.BAND_PROP_WIDTH] = 1.0 * bandNode[JV.BAND_PROP_WIDTH];
-            } else {
-                item[JV.BAND_PROP_WIDTH] = 0.0;
-            }
-            item[JV.BAND_PROP_DISPLAY_TYPE] = JpcBandHelper.getBandTypeValByString(bandNode[JV.BAND_PROP_DISPLAY_TYPE]);
-            item[JV.BAND_PROP_ALIGNMENT] = JpcCommonHelper.getLayoutAlignment(bandNode[JV.BAND_PROP_ALIGNMENT]);
-            item[JV.PROP_CALCULATION] = JpcCommonHelper.getPosCalculationType(bandNode[JV.PROP_CALCULATION]);
-
-            if (bandNode[JV.BAND_PROP_MERGE_BORDER]) {
-                item[JV.BAND_PROP_MERGE_BORDER] = bandNode[JV.BAND_PROP_MERGE_BORDER];
-            }
-            if (bandNode[JV.BAND_PROP_SUB_BANDS]) {
-                for (let i = 0; i < bandNode[JV.BAND_PROP_SUB_BANDS].length; i++) {
-                    me.createSingle(bandNode[JV.BAND_PROP_SUB_BANDS][i], parentObj, rptTpl, defProperties);
-                }
-            }
-            parentObj[bandNode[JV.BAND_PROP_NAME]] = item;
-            if (item[JV.BAND_PROP_MERGE_BORDER] != null && item[JV.BAND_PROP_MERGE_BORDER] != undefined && item[JV.BAND_PROP_MERGE_BORDER] == 'T') {
-                parentObj[JV.BAND_PROP_MERGE_BAND] = item;
-            }
-        }
-    }
-}
-
-module.exports = JpcBand;

+ 0 - 98
modules/reports/rpt_component/Jpc_Data.js

@@ -1,98 +0,0 @@
-let JV = require('./jpc_value_define');
-let JpcData = {
-    createNew: function() {
-        let JpcDataRst = {};
-        JpcDataRst.dataSeq = [];
-        JpcDataRst.analyzeData = function(rptTpl, dataObj) {
-            let me = this;
-            if ((rptTpl) && (dataObj)) {
-                //1. get ID fields
-                let masterIDs = [];
-                for (let i = 0; i < rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS].length; i++) {
-                    let mstFieldObj = rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS][i];
-                    if ((mstFieldObj[JV.PROP_IS_ID]) && (mstFieldObj[JV.PROP_IS_ID] === 'T')) {
-                        masterIDs.push({"idx": i, "seq": mstFieldObj[JV.PROP_ID_SEQ]});
-                    }
-                }
-                let detailIDs = [];
-                for (let i = 0; i < rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS].length; i++) {
-                    let dtlFieldObj = rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS][i];
-                    if ((dtlFieldObj[JV.PROP_IS_ID]) && (dtlFieldObj[JV.PROP_IS_ID] === 'T')) {
-                        detailIDs.push({"idx": i, "seq": dtlFieldObj[JV.PROP_ID_SEQ]});
-                    }
-                }
-                //2. sort the ID fields
-                if (masterIDs.length > 1) {
-                    masterIDs.sort(function(a, b) {
-                        return 1*a["seq"] - 1*b["seq"];
-                    })
-                }
-                if (detailIDs.length > 1) {
-                    detailIDs.sort(function(a, b) {
-                        return 1*a["seq"] - 1*b["seq"];
-                    })
-                }
-                //3. prepare data sequence
-                if (masterIDs.length > 0) {
-                    let mst_dt_len = 0, dtl_dt_len = 0, mst_fields = [];
-                    for (let i = 0; i < masterIDs.length; i++) {
-                        mst_fields.push(dataObj[JV.DATA_MASTER_DATA][masterIDs[i]["idx"]]);
-                        mst_dt_len = dataObj[JV.DATA_MASTER_DATA][masterIDs[i]["idx"]].length;
-                    }
-                    let dtl_fields = [];
-                    for (let i = 0; i < detailIDs.length; i++) {
-                        dtl_fields.push(dataObj[JV.DATA_DETAIL_DATA][detailIDs[i]["idx"]]);
-                        dtl_dt_len = dataObj[JV.DATA_DETAIL_DATA][detailIDs[i]["idx"]].length;
-                    }
-                    let sIdx = 0;
-                    let isEqual = true;
-                    for (let i = 0; i < mst_dt_len; i++) {
-                        me.dataSeq.push([]);
-                        //then compare the master/detail ID-field value
-                        for (let j = sIdx; j < dtl_dt_len; j++) {
-                            isEqual = true;
-                            for (let k = 0; k < mst_fields.length; k++) {
-                                if (!(mst_fields[k][i] === dtl_fields[k][j])) {
-                                    isEqual = false;
-                                    break;
-                                }
-                            }
-                            if (isEqual) {
-                                me.dataSeq[i].push(j);
-                            } else {
-                                sIdx = j;
-                                //below logic is for the data robustness purpose, to avoid those strange record(detail level) which could not match even one of the master record!
-                                if (i < mst_dt_len - 1 && j < dtl_dt_len - 1) {
-                                    for (let j1 = j; j1 < dtl_dt_len; j1++) {
-                                        isEqual = true;
-                                        for (let k = 0; k < mst_fields.length; k++) {
-                                            if (!(mst_fields[k][i + 1] === dtl_fields[k][j1])) {
-                                                isEqual = false;
-                                                break;
-                                            }
-                                        }
-                                        if (isEqual) {
-                                            sIdx = j1;
-                                            break;
-                                        }
-                                    }
-                                }
-                                break;
-                            }
-                        }
-                    }
-                } else { //if no master data
-                    let field = dataObj[JV.DATA_DETAIL_DATA][0];
-                    me.dataSeq = [[]];
-                    for (let i = 0; i < field.length; i++) {
-                        me.dataSeq[0].push(i);
-                    }
-                }
-            }
-            //alert(3);
-        };
-        return JpcDataRst;
-    }
-}
-
-module.exports = JpcData;

+ 0 - 47
modules/reports/rpt_component/Jpc_Field.js

@@ -1,47 +0,0 @@
-let JV = require('./jpc_value_define');
-let JpcField = {
-    createNew: function(rptTpl) {
-        let JpcFieldResult = {};
-        let me = this;
-        JpcFieldResult[JV.NODE_DISCRETE_FIELDS] = {};
-        if (rptTpl[JV.NODE_FIELD_MAP] && rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DISCRETE_FIELDS]) {
-            for (let i = 0; i < rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DISCRETE_FIELDS].length; i++) {
-                me.createSingle(rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DISCRETE_FIELDS][i], JpcFieldResult[JV.NODE_DISCRETE_FIELDS], rptTpl, JV.DATA_DISCRETE_DATA, i);
-            }
-        }
-        JpcFieldResult[JV.NODE_MASTER_FIELDS] = {};
-        if (rptTpl[JV.NODE_FIELD_MAP] && rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS]) {
-            for (let i = 0; i < rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS].length; i++) {
-                me.createSingle(rptTpl[JV.NODE_FIELD_MAP][JV.NODE_MASTER_FIELDS][i], JpcFieldResult[JV.NODE_MASTER_FIELDS], rptTpl, JV.DATA_MASTER_DATA, i);
-            }
-        }
-        JpcFieldResult[JV.NODE_DETAIL_FIELDS] = {};
-        if (rptTpl[JV.NODE_FIELD_MAP] && rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS]) {
-            for (let i = 0; i < rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS].length; i++) {
-                me.createSingle(rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS][i], JpcFieldResult[JV.NODE_DETAIL_FIELDS], rptTpl, JV.DATA_DETAIL_DATA, i);
-            }
-        }
-        JpcFieldResult[JV.NODE_NO_MAPPING_FIELDS] = {};
-        if (rptTpl[JV.NODE_NO_MAPPING_FIELDS]) {
-            for (let i = 0; i < rptTpl[JV.NODE_NO_MAPPING_FIELDS].length; i++) {
-                me.createSingle(rptTpl[JV.NODE_NO_MAPPING_FIELDS][i], JpcFieldResult[JV.NODE_NO_MAPPING_FIELDS], rptTpl, "NA", JV.BLANK_FIELD_INDEX);
-            }
-        }
-        //
-        return JpcFieldResult;
-    },
-    createSingle: function(fieldNode, parentObj, rptTpl, dataNodeName, sequence) {
-        let me = this;
-        if (fieldNode && fieldNode[JV.PROP_ID]) {
-            let item = {};
-            item[JV.PROP_ID] = fieldNode[JV.PROP_ID];
-            item[JV.PROP_NAME] = fieldNode[JV.PROP_NAME];
-            item[JV.PROP_DATA_TYPE] = fieldNode[JV.PROP_DATA_TYPE];
-            item.DataNodeName = dataNodeName;
-            item.DataSeq = sequence;
-            parentObj[JV.PROP_ID + "_" + fieldNode[JV.PROP_ID]] = item;
-        }
-    }
-}
-
-module.exports = JpcField;

+ 0 - 18
modules/reports/rpt_component/Jpc_Function.js

@@ -1,18 +0,0 @@
-let JV = require('./jpc_value_define');
-let JpcFunc = {
-    createNew: function (rptTpl) {
-        let me = this;
-        let rst = [];
-        if (rptTpl[JV.NODE_FORMULAS]) {
-            for (let i = 0; i < rptTpl[JV.NODE_FORMULAS].length; i++) {
-                let item = {};
-                item[JV.PROP_RUN_TYPE] = rptTpl[JV.NODE_FORMULAS][i][JV.PROP_RUN_TYPE];
-                item[JV.PROP_EXPRESSION] = rptTpl[JV.NODE_FORMULAS][i][JV.PROP_EXPRESSION];
-                rst.push(item);
-            }
-        }
-        return rst;
-    }
-};
-
-module.exports = JpcFunc;

+ 0 - 27
modules/reports/rpt_component/Jpc_Param.js

@@ -1,27 +0,0 @@
-let JV = require('./jpc_value_define');
-let JpcParam = {
-    createNew: function(rptTpl) {
-        let JpcParamResult = {};
-        let me = this;
-        if (rptTpl[JV.NODE_DISCRETE_PARAMS]) {
-            for (let i = 0; i < rptTpl[JV.NODE_DISCRETE_PARAMS].length; i++) {
-                me.createSingle(rptTpl[JV.NODE_DISCRETE_PARAMS][i], JpcParamResult, rptTpl, i);
-            }
-        }
-        return JpcParamResult;
-    },
-    createSingle: function(paramNode, parentObj, rptTpl, sequence) {
-        let me = this;
-        if (paramNode && paramNode[JV.PROP_ID]) {
-            let item = {};
-            item[JV.PROP_ID] = paramNode[JV.PROP_ID];
-            item[JV.PROP_NAME] = paramNode[JV.PROP_NAME];
-            item[JV.PROP_DATA_TYPE] = paramNode[JV.PROP_DATA_TYPE];
-            if (paramNode[JV.PROP_DFT_VALUE]) item[JV.PROP_DFT_VALUE] = paramNode[JV.PROP_DFT_VALUE];
-            item.DataSeq = sequence;
-            parentObj[JV.PROP_ID + "_" + paramNode[JV.PROP_ID]] = item;
-        }
-    }
-}
-
-module.exports = JpcParam;

+ 0 - 47
modules/reports/rpt_component/Jpc_RTE.js

@@ -1,47 +0,0 @@
-/**
- * Created by Tony on 2016/12/28.
- */
-
-let JV = require('./jpc_value_define');
-let JE = {
-    F: function(fID, $CURRENT_RPT) {
-        let rst = null;
-        if ($CURRENT_RPT && ($CURRENT_RPT.fields[JV.NODE_DETAIL_FIELDS][JV.PROP_ID + "_" + fID])) {
-            rst = $CURRENT_RPT.fields[JV.NODE_DETAIL_FIELDS][JV.PROP_ID + "_" + fID];
-        } else if ($CURRENT_RPT && ($CURRENT_RPT.fields[JV.NODE_MASTER_FIELDS][JV.PROP_ID + "_" + fID])) {
-            rst = $CURRENT_RPT.fields[JV.NODE_MASTER_FIELDS][JV.PROP_ID + "_" + fID];
-        } else if ($CURRENT_RPT && ($CURRENT_RPT.fields[JV.NODE_DISCRETE_FIELDS][JV.PROP_ID + "_" + fID])) {
-            rst = $CURRENT_RPT.fields[JV.NODE_DISCRETE_FIELDS][JV.PROP_ID + "_" + fID];
-        } else if ($CURRENT_RPT && ($CURRENT_RPT.fields[JV.NODE_NO_MAPPING_FIELDS][JV.PROP_ID + "_" + fID])) {
-            rst = $CURRENT_RPT.fields[JV.NODE_NO_MAPPING_FIELDS][JV.PROP_ID + "_" + fID];
-        } else {
-            rst = {msg: "the Field-ID is not valid, no result could be found!"};
-        }
-        return rst;
-    },
-    P: function(pID, $CURRENT_RPT) {
-        let rst = null;
-        if ($CURRENT_RPT && ($CURRENT_RPT.params[JV.PROP_ID + "_" + pID])) {
-            rst = $CURRENT_RPT.params[JV.PROP_ID + "_" + pID];
-        } else {
-            rst = {msg: "the Param-ID is not valid, no result was found!"};
-        }
-        return rst;
-    },
-    getCurrentPage: function ($CURRENT_RPT) {
-        let rst = 0;
-        if ($CURRENT_RPT) {
-            rst = $CURRENT_RPT.runTimePageData.currentPage;
-        }
-        return rst;
-    },
-    getTotalPage: function ($CURRENT_RPT) {
-        let rst = 0;
-        if ($CURRENT_RPT) {
-            rst = $CURRENT_RPT.totalPages;
-        }
-        return rst;
-    }
-}
-
-module.exports = JE;

+ 0 - 58
modules/reports/rpt_component/helper/Jpc_Helper_Area.js

@@ -1,58 +0,0 @@
-let JV = require('../jpc_value_define');
-
-let JpcAreaHelper = {
-    outputArea: function(areaNode, band, unitFactor, rowAmount, rowIdx, colAmount, colIdx, multipleDispCol, multipleColIdx,syncHeight, syncWidth) {
-        let rst = {}, maxMultiColumns = 3;
-        if (multipleDispCol > 0 && multipleDispCol <= maxMultiColumns) {
-            //1. calculate left/right
-            let areaWidth = 1.0 * (band[JV.PROP_RIGHT] - band[JV.PROP_LEFT]) / multipleDispCol;
-            areaWidth = areaWidth / colAmount;
-            let innerLeft = 0.0, innerRight = areaWidth;
-            switch (areaNode[JV.PROP_H_CALCULATION]) {
-                case JV.CAL_TYPE[JV.CAL_TYPE_PERCENTAGE] :
-                    innerLeft = (1.0 * areaNode[JV.PROP_LEFT] * areaWidth / JV.HUNDRED_PERCENT);
-                    innerRight = (1.0 * areaNode[JV.PROP_RIGHT] * areaWidth / JV.HUNDRED_PERCENT) ;
-                    break;
-                case JV.CAL_TYPE[JV.CAL_TYPE_ABSTRACT] :
-                    innerLeft = 1.0 * areaNode[JV.PROP_LEFT] * unitFactor;
-                    innerRight = 1.0 * areaNode[JV.PROP_RIGHT] * unitFactor ;
-                    break;
-            }
-            //2. calculate top/bottom
-            let  areaHeight = 1.0 * (band[JV.PROP_BOTTOM] - band[JV.PROP_TOP]);
-            areaHeight = areaHeight / rowAmount;
-            let innerTop = 0.0, innerBottom = areaHeight;
-            switch (areaNode[JV.PROP_V_CALCULATION]) {
-                case JV.CAL_TYPE[JV.CAL_TYPE_PERCENTAGE] :
-                    innerTop = (1.0 * areaNode[JV.PROP_TOP] * areaHeight / JV.HUNDRED_PERCENT);
-                    innerBottom = (1.0 * areaNode[JV.PROP_BOTTOM] * areaHeight / JV.HUNDRED_PERCENT) ;
-                    break;
-                case JV.CAL_TYPE[JV.CAL_TYPE_ABSTRACT] :
-                    innerTop = 1.0 * areaNode[JV.PROP_TOP] * unitFactor;
-                    innerBottom = 1.0 * areaNode[JV.PROP_BOTTOM] * unitFactor ;
-                    break;
-            }
-            //
-            let rstLeft = 0.0, rstRight = 0.0, rstTop = 0.0, rstBottom = 0.0;
-            if (syncHeight) {
-                rstBottom = Math.round(1.0 * band[JV.PROP_TOP] + areaHeight * (rowIdx + 1) + innerTop);
-            } else {
-                rstBottom = Math.round(1.0 * band[JV.PROP_TOP] + areaHeight * rowIdx + innerBottom);
-            }
-            if (syncWidth) {
-                rstRight = Math.round(1.0 * band[JV.PROP_LEFT] + areaWidth * (colIdx + 1) + innerLeft + multipleColIdx * areaWidth);
-            } else {
-                rstRight = Math.round(1.0 * band[JV.PROP_LEFT] + areaWidth * colIdx + innerRight + multipleColIdx * areaWidth);
-            }
-            rstLeft = Math.round(1.0 * band[JV.PROP_LEFT] + areaWidth * colIdx + innerLeft + multipleColIdx * areaWidth);
-            rstTop = Math.round(1.0 * band[JV.PROP_TOP] + areaHeight * rowIdx + innerTop);
-            rst[JV.PROP_LEFT] = rstLeft;
-            rst[JV.PROP_RIGHT] = rstRight;
-            rst[JV.PROP_TOP] = rstTop;
-            rst[JV.PROP_BOTTOM] = rstBottom;
-        }
-        return rst;
-    }
-};
-
-module.exports = JpcAreaHelper;

+ 0 - 74
modules/reports/rpt_component/helper/Jpc_Helper_Band.js

@@ -1,74 +0,0 @@
-let JV = require('../jpc_value_define');
-let JpcCommonHelper = require('./jpc_helper_common');
-
-let JpcBandHelper = {
-    getBandTypeValByString: function(bandType) {
-        let rst = JV.PAGE_STATUS.indexOf(bandType);
-        if (rst < 0) rst = JV.STATUS_NORMAL;
-        return rst;
-    },
-    setBandArea: function(bands, rptTpl, pageStatus) {
-        let me = this;
-        if (rptTpl[JV.NODE_BAND_COLLECTION]) {
-            let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
-            let orgArea = JpcCommonHelper.getReportArea(rptTpl, unitFactor);
-            for (let i = 0; i < rptTpl[JV.NODE_BAND_COLLECTION].length; i++) {
-                me.setBandPos(bands, rptTpl[JV.NODE_BAND_COLLECTION][i], orgArea, unitFactor, pageStatus);
-            }
-        }
-    },
-    setBandPos: function(bands, bandNode, orgArea, unitFactor, pageStatus) {
-        let me = this, band = bands[bandNode[JV.BAND_PROP_NAME]];
-        //1. initialize
-        band[JV.PROP_LEFT] = orgArea[JV.IDX_LEFT];
-        band[JV.PROP_TOP] = orgArea[JV.IDX_TOP];
-        band[JV.PROP_RIGHT] = orgArea[JV.IDX_RIGHT];
-        band[JV.PROP_BOTTOM] = orgArea[JV.IDX_BOTTOM];
-        //2. set this band
-        if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
-            switch (band[JV.BAND_PROP_ALIGNMENT]) {
-                case JV.LAYOUT_TOP:
-                    if (band[JV.PROP_CALCULATION] == JV.CAL_TYPE_ABSTRACT) {
-                        band.Bottom = band.Top + unitFactor * band[JV.BAND_PROP_HEIGHT];
-                    } else {
-                        band.Bottom = band.Top + (band.Bottom - band.Top) * band[JV.BAND_PROP_HEIGHT] / 100;
-                    }
-                    orgArea[JV.IDX_TOP] = band.Bottom;
-                    break;
-                case JV.LAYOUT_BOTTOM:
-                    if (band[JV.PROP_CALCULATION] == JV.CAL_TYPE_ABSTRACT) {
-                        band.Top = band.Bottom - unitFactor * band[JV.BAND_PROP_HEIGHT];
-                    } else {
-                        band.Top = band.Bottom - (band.Bottom - band.Top) * band[JV.BAND_PROP_HEIGHT] / 100;
-                    }
-                    orgArea[JV.IDX_BOTTOM] = band.Top;
-                    break;
-                case JV.LAYOUT_LEFT:
-                    if (band[JV.PROP_CALCULATION] == JV.CAL_TYPE_ABSTRACT) {
-                        band.Right = band.Left + unitFactor * band[JV.BAND_PROP_WIDTH];
-                    } else {
-                        band.Right = band.Left + (band.Right - band.Left) * band[JV.BAND_PROP_WIDTH] / 100;
-                    }
-                    orgArea[JV.IDX_LEFT] = band.Right;
-                    break;
-                case JV.LAYOUT_RIGHT:
-                    if (band[JV.PROP_CALCULATION] == JV.CAL_TYPE_ABSTRACT) {
-                        band.Left = band.Right - unitFactor * band[JV.BAND_PROP_WIDTH];
-                    } else {
-                        band.Left = band.Right - (band.Right - band.Left) * band[JV.BAND_PROP_WIDTH] / 100;
-                    }
-                    orgArea[JV.IDX_RIGHT] = band.Left;
-                    break;
-            }
-            //3. set sub-bands
-            if (bandNode[JV.BAND_PROP_SUB_BANDS]) {
-                let bandArea = [band.Left, band.Top, band.Right, band.Bottom];
-                for (let i = 0; i < bandNode[JV.BAND_PROP_SUB_BANDS].length; i++) {
-                    me.setBandPos(bands, bandNode[JV.BAND_PROP_SUB_BANDS][i], bandArea, unitFactor, pageStatus);
-                }
-            }
-        }
-    }
-};
-
-module.exports = JpcBandHelper;

+ 0 - 148
modules/reports/rpt_component/helper/Jpc_Helper_Common.js

@@ -1,148 +0,0 @@
-let JV = require('../jpc_value_define');
-
-let JpcCommonHelper = {
-    commonConstant: {},
-    getResultByID: function (KeyID, collectionList) {
-        let rst = null;
-        if (KeyID) {
-            for (let i = 0; i < collectionList.length; i++) {
-                let collection = collectionList[i];
-                if (collection && collection instanceof Array) {
-                    for (let j = 0; j < collection.length; j++) {
-                        if (collection[j][JV.PROP_ID] === KeyID) {
-                            rst = collection[j];
-                            break;
-                        }
-                    }
-                    if (rst) break;
-                }
-            }
-        }
-        return rst;
-    },
-    getFont: function(fontName, dftFonts, rptTpl) {
-        let me = this, rst = null, list = [];
-        if (rptTpl) list.push(rptTpl[JV.NODE_FONT_COLLECTION]);
-        list.push(dftFonts);
-        rst = me.getResultByID(fontName, list);
-        return rst;
-    },
-    getStyle: function(styleName, dftStyles, rptTpl) {
-        let me = this, rst = null, list = [];
-        if (rptTpl) list.push(rptTpl[JV.NODE_STYLE_COLLECTION]);
-        list.push(dftStyles);
-        rst = me.getResultByID(styleName, list);
-        return rst;
-    },
-    getControl: function(controlName, dftControls, rptTpl) {
-        let me = this, rst = null, list = [];
-        if (rptTpl) list.push(rptTpl[JV.NODE_CONTROL_COLLECTION]);
-        list.push(dftControls);
-        rst = me.getResultByID(controlName, list);
-        return rst;
-    },
-    getLayoutAlignment: function(alignStr) {
-        let rst = JV.LAYOUT.indexOf(alignStr);
-        if (rst < 0) rst = JV.LAYOUT_FULFILL;
-        return rst;
-    },
-    getPosCalculationType: function (typeStr) {
-        let rst = JV.CAL_TYPE.indexOf(typeStr);
-        if (rst < 0) rst = JV.CAL_TYPE_ABSTRACT;
-        return rst;
-    },
-    getScreenDPI: function() {
-        let me = this, arrDPI = [];
-        if (!me.commonConstant.resolution) {
-            arrDPI = [96,96];
-            me.commonConstant.resolution = arrDPI;
-        } else {
-            arrDPI = me.commonConstant.resolution;
-        }
-        return arrDPI;
-    },
-    getScreenDPI_bk: function() {
-        let me = this, arrDPI = [];
-        if (!me.commonConstant.resolution) {
-            if (window) {
-                if (window.screen.deviceXDPI != undefined) {
-                    arrDPI.push(window.screen.deviceXDPI);
-                    arrDPI.push(window.screen.deviceYDPI);
-                } else {
-                    let tmpNode = document.createElement("DIV");
-                    tmpNode.style.cssText = "width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden";
-                    document.body.appendChild(tmpNode);
-                    arrDPI.push(parseInt(tmpNode.offsetWidth));
-                    arrDPI.push(parseInt(tmpNode.offsetHeight));
-                    tmpNode.parentNode.removeChild(tmpNode);
-                }
-            } else {
-                arrDPI = [96,96];
-            }
-            me.commonConstant.resolution = arrDPI;
-        } else {
-            arrDPI = me.commonConstant.resolution;
-        }
-        return arrDPI;
-    },
-    getUnitFactor: function(rptTpl) {
-        let me = this;
-        return me.translateUnit(rptTpl[JV.NODE_MAIN_INFO][JV.PROP_UNITS]);
-    },
-    translateUnit: function(unitStr) {
-        let me = this, rst = 1.0;
-        if (unitStr) {
-            let resolution = me.getScreenDPI();
-            if (JV.MEASUREMENT.PIXEL.indexOf(unitStr) >= 0) {
-                rst = 1.0;
-            } else if (JV.MEASUREMENT.CM.indexOf(unitStr) >= 0) {
-                rst = 1.0 * resolution[0] / 2.54;
-            } else if (JV.MEASUREMENT.INCH.indexOf(unitStr) >= 0) {
-                rst = 1.0 * resolution[0];
-            }
-        }
-        return rst;
-    },
-    getPageSize: function (rptTpl) {
-        let me = this, size = null;
-        let sizeStr = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_PAGE_SIZE];
-        let sizeIdx = JV.PAGES_SIZE_STR.indexOf(sizeStr);
-        if (sizeIdx >= 0) {
-            size = JV.PAGES_SIZE[sizeIdx].slice(0);
-        } else if (sizeStr === JV.PAGE_SELF_DEFINE) {
-            //
-        } else {
-            size = JV.SIZE_A4.slice(0);
-        }
-        let page_orientation = rptTpl[JV.NODE_MAIN_INFO][JV.NODE_PAGE_INFO][JV.PROP_ORIENTATION];
-        if (page_orientation === JV.ORIENTATION_LANDSCAPE || page_orientation === JV.ORIENTATION_LANDSCAPE_CHN) {
-            //swap x,y
-            let tmp = size[0];
-            size[0] = size[1];
-            size[1] = tmp;
-        }
-        return size;
-    },
-    getReportArea: function(rptTpl, unitFactor) {
-        let me = this, resolution = me.getScreenDPI(), rst = [], size = me.getPageSize(rptTpl);
-        size[0] = resolution[0] * size[0];
-        size[1] = resolution[0] * size[1];
-        rst.push(unitFactor * rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_LEFT]);
-        rst.push(unitFactor * rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_TOP]);
-        rst.push(size[0] - unitFactor * rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_RIGHT]);
-        rst.push(size[1] - unitFactor * rptTpl[JV.NODE_MAIN_INFO][JV.NODE_MARGINS][JV.PROP_BOTTOM]);
-        return rst;
-    },
-    getSegIdxByPageIdx: function(page, page_seg_map) {
-        let rst = -1;
-        for (let pIdx = 0; pIdx < page_seg_map.length; pIdx++) {
-            if (page_seg_map[pIdx][0] == page) {
-                rst = page_seg_map[pIdx][1];
-                break;
-            }
-        }
-        return rst;
-    }
-};
-
-module.exports = JpcCommonHelper;

+ 0 - 58
modules/reports/rpt_component/helper/Jpc_Helper_Discrete.js

@@ -1,58 +0,0 @@
-let JV = require('../jpc_value_define');
-let JE = require('../jpc_rte');
-let JpcTextHelper = require('./jpc_helper_text');
-let JpcCommonOutputHelper = require('./jpc_helper_common_output');
-let JpcAreaHelper = require('./jpc_helper_area');
-
-let JpcDiscreteHelper = {
-    outputDiscreteInfo: function (discreteArray, bands, dataObj, unitFactor, pageStatus, segIdx, multiCols, multiColIdx, $CURRENT_RPT) {
-        let rst = [];
-        if (discreteArray && dataObj) {
-            for (let i = 0; i < discreteArray.length; i++) {
-                let band = bands[discreteArray[i][JV.PROP_BAND_NAME]];
-                if (band && pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
-                    if (discreteArray[i][JV.PROP_TEXT]) {
-                        rst.push(JpcTextHelper.outputText(discreteArray[i][JV.PROP_TEXT], band, unitFactor, 1, 0, 1, 0, multiCols, multiColIdx));
-                    }
-                    if (discreteArray[i][JV.PROP_TEXTS]) {
-                        for (let j = 0; j < discreteArray[i][JV.PROP_TEXTS].length; j++) {
-                            rst.push(JpcTextHelper.outputText(discreteArray[i][JV.PROP_TEXTS][j], band, unitFactor, 1, 0, 1, 0, multiCols, multiColIdx));
-                        }
-                    }
-                    if (discreteArray[i][JV.PROP_DISCRETE_FIELDS]) {
-                        for (let j = 0; j < discreteArray[i][JV.PROP_DISCRETE_FIELDS].length; j++) {
-                            let df = discreteArray[i][JV.PROP_DISCRETE_FIELDS][j];
-                            let value = "";
-                            if (df[JV.PROP_FIELD_ID]) {
-                                let field = JE.F(df[JV.PROP_FIELD_ID], $CURRENT_RPT);
-                                if (field.DataSeq != JV.BLANK_FIELD_INDEX) {
-                                    let data = dataObj[field.DataNodeName][field.DataSeq];
-                                    if (data && data.length > 0) {
-                                        if (data.length > segIdx) {
-                                            value = data[segIdx];
-                                        } else {
-                                            value = data[0];
-                                        }
-                                    }
-                                } else {
-                                    if (field[JV.PROP_AD_HOC_DATA] && field[JV.PROP_AD_HOC_DATA].length > 0) value = field[JV.PROP_AD_HOC_DATA][0]
-                                    else value = "";
-                                }
-                            } else if (df[JV.PROP_PARAM_ID]) {
-                                let param = JE.P(df[JV.PROP_PARAM_ID], $CURRENT_RPT);
-                                value = param[JV.PROP_DFT_VALUE];
-                            }
-                            let item = JpcCommonOutputHelper.createCommonOutputWithoutDecorate(df, value, null);
-                            //position
-                            item[JV.PROP_AREA] = JpcAreaHelper.outputArea(df[JV.PROP_AREA], band, unitFactor, 1, 0, 1, 0, multiCols, multiColIdx, false, false);
-                            rst.push(item);
-                        }
-                    }
-                }
-            }
-        }
-        return rst;
-    }
-}
-
-module.exports = JpcDiscreteHelper;

+ 0 - 44
modules/reports/rpt_component/helper/Jpc_Helper_Field.js

@@ -1,44 +0,0 @@
-let JV = require('../jpc_value_define');
-
-let JpcFieldHelper = {
-    getValue: function(dataField, valueIdx) {
-        let rst = "";
-        if (dataField && (dataField.length > valueIdx) && (valueIdx >= 0)) {
-            rst = dataField[valueIdx];
-        }
-        return rst;
-    },
-    decorateValue: function (cell, controls) {
-        if (controls) {
-            let val = cell[JV.PROP_VALUE];
-            let showZero = controls[cell[JV.PROP_CONTROL]][JV.PROP_SHOW_ZERO];
-            if (showZero && showZero == 'F' ) {
-                if (0.0 == 1.0 * (0 + val)) {
-                    cell[JV.PROP_VALUE] = "";
-                }
-            }
-        }
-    },
-    findAndPutDataFieldIdx: function (rptTpl, tab_fields, rstFields, rstFieldsIdx) {
-        if (tab_fields) {
-            let detail_fields = rptTpl[JV.NODE_FIELD_MAP][JV.NODE_DETAIL_FIELDS];
-            for (let i = 0; i < tab_fields.length; i++) {
-                let isFounded = false;
-                for (let j = 0; j < detail_fields.length; j++) {
-                    if (tab_fields[i]["FieldID"] == detail_fields[j]["ID"]) {
-                        isFounded = true;
-                        if (rstFields) rstFields.push(tab_fields[i]);
-                        if (rstFieldsIdx) rstFieldsIdx.push(j);
-                        break;
-                    }
-                }
-                if (!isFounded) {
-                    if (rstFields) rstFields.push(tab_fields[i]);
-                    if (rstFieldsIdx) rstFieldsIdx.push(JV.BLANK_FIELD_INDEX);
-                }
-            }
-        }
-    }
-};
-
-module.exports = JpcFieldHelper;

+ 0 - 14
modules/reports/rpt_component/helper/Jpc_Helper_Text.js

@@ -1,14 +0,0 @@
-let JV = require('../jpc_value_define');
-let JpcCommonOutputHelper = require('./jpc_helper_common_output');
-let JpcAreaHelper = require('./jpc_helper_area');
-
-let JpcTextHelper = {
-    outputText: function (textNode, band, unitFactor, rows, rowIdx, cols, colIdx, multiCols, multiColIdx) {
-        let rst = JpcCommonOutputHelper.createCommonOutput(textNode, textNode[JV.PROP_LABEL], null);
-        //position
-        rst[JV.PROP_AREA] = JpcAreaHelper.outputArea(textNode[JV.PROP_AREA], band, unitFactor, rows, rowIdx, cols, colIdx, multiCols, multiColIdx, false, false);
-        return rst;
-    }
-};
-
-module.exports = JpcTextHelper;

+ 0 - 60
modules/reports/rpt_component/helper/jpc_helper_common_output.js

@@ -1,60 +0,0 @@
-let JV = require('../jpc_value_define');
-let JpcFieldHelper = require('./jpc_helper_field');
-
-let JpcCommonOutputHelper = {
-    createCommonOutputWithoutDecorate: function (node, value, controls) {
-        let rst = {};
-        //1. font/style/control
-        rst[JV.PROP_FONT] = node[[JV.PROP_FONT]];
-        rst[JV.PROP_CONTROL] = node[[JV.PROP_CONTROL]];
-        rst[JV.PROP_STYLE] = node[[JV.PROP_STYLE]];
-        //2. value
-        rst[JV.PROP_VALUE] = value;
-        if (node[JV.PROP_FORMAT]) {
-            if (!(isNaN(parseFloat(rst[JV.PROP_VALUE])))) {
-                let dotIdx = node[JV.PROP_FORMAT].indexOf(".");
-                if (dotIdx >= 0) {
-                    rst[JV.PROP_VALUE] = parseFloat(rst[JV.PROP_VALUE]).toFixed(node[JV.PROP_FORMAT].length - dotIdx - 1);
-                } else {
-                    rst[JV.PROP_VALUE] = parseFloat(rst[JV.PROP_VALUE]).toFixed(0);
-                }
-            }
-        }
-        if (node[JV.PROP_PREFIX] && rst[JV.PROP_VALUE] != null) {
-            rst[JV.PROP_VALUE] = node[JV.PROP_PREFIX] + rst[JV.PROP_VALUE];
-        }
-        if (node[JV.PROP_SUFFIX] && rst[JV.PROP_VALUE] != null) {
-            rst[JV.PROP_VALUE] = rst[JV.PROP_VALUE] + node[JV.PROP_SUFFIX];
-        }
-        return rst;
-    },
-    createCommonOutput: function (node, value, controls) {
-        let rst = {};
-        //1. font/style/control
-        rst[JV.PROP_FONT] = node[[JV.PROP_FONT]];
-        rst[JV.PROP_CONTROL] = node[[JV.PROP_CONTROL]];
-        rst[JV.PROP_STYLE] = node[[JV.PROP_STYLE]];
-        //2. value
-        rst[JV.PROP_VALUE] = value;
-        JpcFieldHelper.decorateValue(rst, controls);
-        if (node[JV.PROP_FORMAT]) {
-            if (!(isNaN(parseFloat(rst[JV.PROP_VALUE])))) {
-                let dotIdx = node[JV.PROP_FORMAT].indexOf(".");
-                if (dotIdx >= 0) {
-                    rst[JV.PROP_VALUE] = parseFloat(rst[JV.PROP_VALUE]).toFixed(node[JV.PROP_FORMAT].length - dotIdx - 1);
-                } else {
-                    rst[JV.PROP_VALUE] = parseFloat(rst[JV.PROP_VALUE]).toFixed(0);
-                }
-            }
-        }
-        if (node[JV.PROP_PREFIX] && rst[JV.PROP_VALUE] != null && rst[JV.PROP_VALUE] != "") {
-            rst[JV.PROP_VALUE] = node[JV.PROP_PREFIX] + rst[JV.PROP_VALUE];
-        }
-        if (node[JV.PROP_SUFFIX] && rst[JV.PROP_VALUE] != null && rst[JV.PROP_VALUE] != "") {
-            rst[JV.PROP_VALUE] = rst[JV.PROP_VALUE] + node[JV.PROP_SUFFIX];
-        }
-        return rst;
-    }
-}
-
-module.exports = JpcCommonOutputHelper;

+ 0 - 189
modules/reports/rpt_component/helper/jpc_helper_cross_tab.js

@@ -1,189 +0,0 @@
-let JV = require('../jpc_value_define');
-let JpcCommonHelper = require('./jpc_helper_common');
-
-let JpcCrossTabHelper = {
-    getColIDX: function(cl, val) {
-        let rst = -1;
-        for (let i = 0; i < cl.length; i++) {
-            let ca = cl[i];
-            for (let j = 0; j < ca.length; j++) {
-                if (ca[j] == val) {
-                    rst = i;
-                    break;
-                }
-            }
-            if (rst != -1) {
-                break;
-            }
-        }
-        return rst;
-    },
-    pushToSeg: function(segArr, dataSeq, segIdx, sIdx, eIdx) {
-        let arrIdx = [];
-        for (let k = sIdx; k < eIdx; k++) {
-            arrIdx.push(dataSeq[segIdx][k]);
-        }
-        segArr.push(arrIdx);
-    },
-    sortFieldValue: function(sIDX, eIDX, sortOrder, dataField, dataValSeq) {
-        let tmpSeq = [];
-        if ((sortOrder) && (sortOrder != JV.TAB_FIELD_PROP_SORT_VAL_NOSORT)) {
-            if (sIDX >= 0 && eIDX >= sIDX && dataValSeq.length > eIDX) {
-                let reversed = 1;
-                if (sortOrder === JV.TAB_FIELD_PROP_SORT_VAL_DESC) {
-                    reversed = -1;
-                }
-                for (let i = sIDX; i <= eIDX; i++) {
-                    tmpSeq.push(dataValSeq[i]);
-                }
-                tmpSeq.sort(function(idx1, idx2) {
-                    let rst = 0;
-                    if (isNaN(parseFloat(dataField[idx1])) || isNaN(parseFloat(dataField[idx1]))) {
-                        if (dataField[idx1] > dataField[idx2]) {
-                            rst = reversed;
-                        } else if (dataField[idx1] < dataField[idx2]) {
-                            rst = -reversed;
-                        }
-                    } else {
-                        if ((1.0 * dataField[idx1]) > (1.0 * dataField[idx2])) {
-                            rst = reversed;
-                        } else if ((1.0 * dataField[idx1]) < (1.0 * dataField[idx2])) {
-                            rst = -reversed;
-                        }
-                    }
-                    return rst;
-                });
-            }
-        }
-        if (tmpSeq.length > 0) {
-            for (let i = sIDX; i <= eIDX; i++) {
-                dataValSeq[i] = tmpSeq[i - sIDX];
-            }
-        }
-        return tmpSeq;
-    },
-    checkIfEqual: function(dataFields, seq1, seq2) {
-        let rst = true;
-        for (let i = 0; i < dataFields.length; i++) {
-            if ((dataFields[i][seq1] !== dataFields[i][seq2])) {
-                rst = false;
-                break;
-            }
-        }
-        return rst;
-    },
-    sortTabFields: function(tabFields, fieldSeqs, data_details, dataSeq) {
-        let me = this;
-        let sIDX = 0, eIDX = -1, isFirstSort = true;
-        for (let i = 0; i < tabFields.length; i++) {
-            let tabField = tabFields[i];
-            if (tabField[JV.TAB_FIELD_PROP_SORT] != JV.TAB_FIELD_PROP_SORT_VAL_NOSORT) {
-                if (isFirstSort) {
-                    isFirstSort = false;
-                    //first field, should sort all data items
-                    for (let j = 0; j < dataSeq.length; j++) {
-                        sIDX = 0;
-                        eIDX = dataSeq[j].length - 1;
-                        //sort the field value here
-                        me.sortFieldValue(sIDX, eIDX, tabField[JV.TAB_FIELD_PROP_SORT],data_details[fieldSeqs[i]], dataSeq[j]);
-                    }
-                } else {
-                    //then sort the rest fields one by one
-                    for (let j = 0; j < dataSeq.length; j++) {
-                        let chkFields = [];
-                        for (let k = 0; k < i; k++) {
-                            chkFields.push(data_details[fieldSeqs[k]]);
-                        }
-                        sIDX = 0, eIDX = -1;
-                        for (let m = 1; m < dataSeq[j].length; m++) {
-                            if (!(me.checkIfEqual(chkFields, dataSeq[j][m - 1], dataSeq[j][m]))) {
-                                eIDX = m - 1;
-                            } else if (m == dataSeq[j].length - 1) {
-                                eIDX = m;
-                            };
-                            if (eIDX >= sIDX) {
-                                if (eIDX != sIDX) {
-                                    me.sortFieldValue(sIDX, eIDX, tabField[JV.TAB_FIELD_PROP_SORT],data_details[fieldSeqs[i]], dataSeq[j]);
-                                }
-                                sIDX = m;
-                                eIDX = m - 1; //for protection purpose
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    },
-    getMaxTabCntPerPage: function(bands, rptTpl, tabNodeName, tabMeasurePropName, measureForCal) {
-        let rst = 1;
-        if (rptTpl[JV.NODE_CROSS_INFO][tabNodeName]) {
-            let tab = rptTpl[JV.NODE_CROSS_INFO][tabNodeName];
-            let maxFieldMeasure = 1.0;
-            if (JV.CAL_TYPE_ABSTRACT == JpcCommonHelper.getPosCalculationType(tab[JV.PROP_CALCULATION])) {
-                let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
-                maxFieldMeasure = 1.0 * rptTpl[JV.NODE_CROSS_INFO][tabNodeName][tabMeasurePropName] * unitFactor;
-            } else {
-                maxFieldMeasure = measureForCal * rptTpl[JV.NODE_CROSS_INFO][tabNodeName][tabMeasurePropName] / JV.HUNDRED_PERCENT;
-            }
-            rst = Math.floor(measureForCal / maxFieldMeasure);
-        }
-        return rst;
-    },
-    getMaxRowsPerPage: function(bands, rptTpl) {
-        let me = this, rst = 1;
-        let band = bands[rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW][JV.PROP_BAND_NAME]];
-        if (band) {
-            rst =  me.getMaxTabCntPerPage(bands, rptTpl, JV.NODE_CROSS_ROW, JV.PROP_CMN_HEIGHT, band.Bottom - band.Top);
-        }
-        return rst;
-    },
-    getMaxColsPerPage: function(bands, rptTpl) {
-        let me = this, rst = 1;
-        let band = bands[rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_COL][JV.PROP_BAND_NAME]];
-        if (band) {
-            rst =  me.getMaxTabCntPerPage(bands, rptTpl, JV.NODE_CROSS_COL, JV.PROP_CMN_WIDTH, band.Right - band.Left);
-        }
-        return rst;
-    },
-    chkTabEnd: function(tabType, rptTpl, bands, sortedSequence, segIdx, preRec, nextRec) {
-        let me = this, rst = true;
-        let remainAmt = preRec + nextRec - sortedSequence[segIdx].length;
-        rst = me.hasEnoughSpace(tabType, rptTpl, bands, remainAmt);
-        return rst;
-    },
-    hasEnoughSpace: function (tabType, rptTpl, bands, remainAmt) {
-        if (remainAmt < 0) return false;
-        let rst = true, measurement = 1.0, douDiffForCompare = 0.00001;
-        let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
-        let band = null;
-        if (rptTpl[JV.NODE_CROSS_INFO][tabType]) {
-            band = bands[rptTpl[JV.NODE_CROSS_INFO][tabType][JV.PROP_BAND_NAME]];
-        }
-        if (band != null && band != undefined) {
-            if (tabType === JV.NODE_CROSS_ROW_SUM || tabType === JV.NODE_CROSS_ROW_EXT) {
-                measurement = 1.0 * rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW][JV.PROP_CMN_HEIGHT] * unitFactor;
-                let spareHeight = measurement * remainAmt;
-                let douH = 1.0 * (band.Bottom - band.Top);
-                rst = (spareHeight >= douH) || (spareHeight - douH <= douDiffForCompare);
-            } else if (tabType === JV.NODE_CROSS_COL_SUM) {
-                measurement = 1.0 * rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_COL][JV.PROP_CMN_WIDTH] * unitFactor;
-                let spareWidth = measurement * remainAmt;
-                let douW = 1.0 * (band.Right - band.Left);
-                rst = (spareWidth >= douW) || (spareWidth - douW <= douDiffForCompare);
-            }
-        }
-        return rst;
-    },
-    initialPageStatus: function (pageStatus) {
-        pageStatus[JV.STATUS_NORMAL] = true;
-        pageStatus[JV.STATUS_REPORT_START] = false;
-        pageStatus[JV.STATUS_REPORT_END] = false;
-        pageStatus[JV.STATUS_SEGMENT_START] = false;
-        pageStatus[JV.STATUS_SEGMENT_END] = false;
-        pageStatus[JV.STATUS_GROUP] = false;
-        pageStatus[JV.STATUS_CROSS_ROW_END] = false;
-        pageStatus[JV.STATUS_CROSS_COL_END] = false;
-    }
-};
-
-module.exports = JpcCrossTabHelper;

+ 0 - 43
modules/reports/rpt_component/helper/jpc_helper_flow_tab.js

@@ -1,43 +0,0 @@
-let JV = require('../jpc_value_define');
-let JpcCommonHelper = require('./jpc_helper_common');
-
-let JpcFlowTabHelper = {
-    getMaxRowsPerPage: function(bands, rptTpl) {
-        let me = this, rst = 1;
-        let tab = rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_CONTENT];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
-        if (band) {
-            let maxFieldMeasure = 1.0;
-            if (JV.CAL_TYPE_ABSTRACT == JpcCommonHelper.getPosCalculationType(tab[JV.PROP_CALCULATION])) {
-                let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
-                maxFieldMeasure = 1.0 * rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_CONTENT][JV.PROP_CMN_HEIGHT] * unitFactor;
-            } else {
-                maxFieldMeasure = (band.Bottom - band.Top) * rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_CONTENT][JV.PROP_CMN_HEIGHT] / JV.HUNDRED_PERCENT;
-            }
-            rst = Math.floor((band.Bottom - band.Top) / maxFieldMeasure);
-        }
-        return rst;
-    },
-    chkSegEnd: function (bands, rptTpl, sortedSequence, segIdx, preRec, nextRec) {
-        let me = this, rst = true;
-        let remainAmt = preRec + nextRec - sortedSequence[segIdx].length;
-        rst = me.hasEnoughSpace(rptTpl, bands, remainAmt);
-        return rst;
-    },
-    hasEnoughSpace: function (rptTpl, bands, remainAmt) {
-        if (remainAmt < 0) return false;
-        let rst = true, measurement = 1.0, douDiffForCompare = 0.00001;
-        let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
-        let tab = rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_CONTENT];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
-        if (band != null && band != undefined) {
-            measurement = 1.0 * tab[JV.PROP_CMN_HEIGHT] * unitFactor;
-            let spareHeight = measurement * remainAmt;
-            let douH = 1.0 * (band.Bottom - band.Top);
-            rst = (spareHeight >= douH) || (spareHeight - douH <= douDiffForCompare);
-        }
-        return rst;
-    }
-};
-
-module.exports = JpcFlowTabHelper;

+ 0 - 78
modules/reports/rpt_component/jpc_bill_tab.js

@@ -1,78 +0,0 @@
-let JV = require('./jpc_value_define');
-let JpcFieldHelper = require('./helper/jpc_helper_field');
-let JpcBandHelper = require('./helper/jpc_helper_band');
-let JpcBand = require('./jpc_band');
-let JpcFlowTabHelper = require('./helper/jpc_helper_flow_tab');
-let JpcCommonHelper = require('./helper/jpc_helper_common');
-let JpcDiscreteHelper = require('./helper/jpc_helper_discrete');
-let JpcTextHelper = require('./helper/jpc_helper_text');
-let JpcCommonOutputHelper = require('./helper/jpc_helper_common_output');
-let JpcAreaHelper = require('./helper/jpc_helper_area');
-
-let JpcBillTabSrv = function(){};
-JpcBillTabSrv.prototype.createNew = function(){
-    let JpcBillTabResult = {};
-    JpcBillTabResult.initialize = function() {
-        let me = this;
-        me.disp_fields_idx = [];
-    };
-    JpcBillTabResult.sorting = function(rptTpl) {
-        let me = this;
-        JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_BILL_INFO][JV.NODE_BILL_CONTENT][JV.PROP_BILL_FIELDS], null, me.disp_fields_idx);
-    };
-    JpcBillTabResult.outputAsSimpleJSONPage = function (rptTpl, dataObj, page, bands, controls, $CURRENT_RPT) {
-        let me = this, rst = [], tabRstLst = [];
-        //1 calculate the band position
-        let pageStatus = [true, false, false, false, false, false, false, false];
-        JpcBandHelper.setBandArea(bands, rptTpl, pageStatus);
-        //2. start to output detail-part
-        let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
-        //2.1 output content
-        tabRstLst.push(me.outputContent(rptTpl, dataObj, page, bands, unitFactor, controls, pageStatus));
-        //2.2 output discrete
-        tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[JV.NODE_BILL_INFO][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, pageStatus, page - 1, 1, 0, $CURRENT_RPT));
-    }
-    JpcBillTabResult.outputContent = function(rptTpl, dataObj, page, bands, unitFactor, controls, pageStatus) {
-        let me = this, rst = [];
-        let tab = rptTpl[JV.NODE_BILL_INFO][JV.NODE_BILL_CONTENT];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
-        if (band) {
-            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
-                let tab_fields = tab[JV.PROP_BILL_FIELDS];
-                let data_details = dataObj[JV.DATA_MASTER_DATA];
-                for (let i = 0; i < tab_fields.length; i++) {
-                    let tab_field = tab_fields[i];
-                    let data_field = null;
-                    if (me.disp_fields_idx[i] != JV.BLANK_FIELD_INDEX) {
-                        data_field = data_details[me.disp_fields_idx[i]];
-                    } else {
-                        data_field = JE.F(tab_field[JV.PROP_FIELD_ID]);
-                        if (data_field) {
-                            data_field = data_field[JV.PROP_AD_HOC_DATA];
-                        }
-                    }
-                    if (!(tab_field[JV.PROP_HIDDEN])) {
-                        let cellItem = JpcCommonOutputHelper.createCommonOutput(tab_field, JpcFieldHelper.getValue(data_field, page - 1), controls);
-                        cellItem[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, 1, 0, 1, 0, 1, 0, true, false);
-                        rst.push(cellItem);
-                    }
-                }
-                if (tab[JV.PROP_TEXT]) {
-                    rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXT], band, unitFactor, 1, 0, 1, 0, 1, 0));
-                }
-                if (tab[JV.PROP_TEXTS]) {
-                    for (let j = 0; j < tab[JV.PROP_TEXTS].length; j++) {
-                        rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXTS][j], band, unitFactor, 1, 0, 1, 0, 1, 0));
-                    }
-                }
-                if (tab[JV.NODE_DISCRETE_INFO]) {
-                    rst = rst.concat(JpcDiscreteHelper.outputDiscreteInfo(tab[JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, pageStatus, page - 1, 1, 0));
-                }
-            }
-        }
-        return rst;
-    }
-    return JpcBillTabResult;
-}
-
-module.exports = new JpcBillTabSrv();

+ 0 - 554
modules/reports/rpt_component/jpc_cross_tab.js

@@ -1,554 +0,0 @@
-let JV = require('./jpc_value_define');
-let JpcFieldHelper = require('./helper/jpc_helper_field');
-let JpcBandHelper = require('./helper/jpc_helper_band');
-let JpcBand = require('./jpc_band');
-let JpcFlowTabHelper = require('./helper/jpc_helper_flow_tab');
-let JpcCrossTabHelper = require('./helper/jpc_helper_cross_tab');
-let JpcCommonHelper = require('./helper/jpc_helper_common');
-let JpcDiscreteHelper = require('./helper/jpc_helper_discrete');
-let JpcTextHelper = require('./helper/jpc_helper_text');
-let JpcCommonOutputHelper = require('./helper/jpc_helper_common_output');
-let JpcAreaHelper = require('./helper/jpc_helper_area');
-
-let JpcCrossTabSrv = function(){};
-JpcCrossTabSrv.prototype.createNew = function(){
-    function private_addTabValue(tabValuedIdxLst, sortedSequence, segIdx, preRec, nextRec, dispSerialIdxLst, sorted_sum_value_Lst, rst_sum_value_Lst) {
-        if (tabValuedIdxLst) {
-            let serial1stTier = null;
-            if (dispSerialIdxLst) serial1stTier = [];
-            let pgseg1stTier = [];
-            let sumVal = [];
-            let sumValL = 1;
-            if (sortedSequence) {
-                let arrDupVals = sortedSequence[segIdx];
-                let arrDupSumVals = null;
-                if (sorted_sum_value_Lst != null) {
-                    arrDupSumVals = sorted_sum_value_Lst[segIdx];
-                    sumValL = arrDupSumVals[0].length;
-                }
-
-                for (let i = 0; i < nextRec; i++) {
-                    if (arrDupVals.length <= preRec + i) {
-                        pgseg1stTier[i] = JV.BLANK_VALUE_INDEX;
-                        sumVal[i] = [];
-                        for (let ei = 0; ei < sumValL; ei++) {
-                            sumVal[i][ei] = null;
-                        }
-                        if (serial1stTier != null) {
-                            serial1stTier[i] = JV.BLANK_VALUE_INDEX;
-                        }
-                        continue;
-                    }
-                    let duplicateValueArr = arrDupVals[preRec + i];
-                    pgseg1stTier[i] = duplicateValueArr[0];
-                    if (arrDupSumVals != null) sumVal[i] = arrDupSumVals[preRec + i];
-
-                    if (serial1stTier != null) {
-                        serial1stTier[i] = preRec + i;
-                    }
-                }
-                tabValuedIdxLst.push(pgseg1stTier);
-                if (dispSerialIdxLst != null) {
-                    dispSerialIdxLst.push(serial1stTier);
-                }
-                if (sorted_sum_value_Lst != null && rst_sum_value_Lst != null) {
-                    rst_sum_value_Lst.push(sumVal);
-                }
-            } else {
-                //should push blank value index rather than null
-                for (let i = 0; i < nextRec; i++) {
-                    pgseg1stTier[i] = JV.BLANK_VALUE_INDEX;
-                    sumVal[i] = null;
-                    if (serial1stTier != null) {
-                        serial1stTier[i] = JV.BLANK_VALUE_INDEX;
-                    }
-                }
-                tabValuedIdxLst.push(pgseg1stTier);
-                if (dispSerialIdxLst != null) {
-                    dispSerialIdxLst.push(serial1stTier);
-                }
-                if (sorted_sum_value_Lst != null && rst_sum_value_Lst != null) {
-                    rst_sum_value_Lst.push(sumVal);
-                }
-            }
-        }
-    }
-    function private_addContentValue(dispValueIdxLst_Content, sortedContentSequence, segIdx, counterRowRec, maxRowRec, counterColRec, maxColRec, page_seg_map, pageIdx) {
-        if (dispValueIdxLst_Content != null) {
-            page_seg_map.push([pageIdx,segIdx]);
-            let arrContents = [];
-            if (sortedContentSequence != null) {
-                let arrAllContent = sortedContentSequence[segIdx];
-                for (let i = 0; i < maxRowRec; i++) {
-                    arrContents.push([]);
-                    for (let j = 0; j < maxColRec; j++) {
-                        if (arrAllContent.length <= counterRowRec + i || arrAllContent[counterRowRec + i].length <= counterColRec + j) {
-                            arrContents[i][j] = JV.BLANK_VALUE_INDEX;
-                        } else {
-                            arrContents[i][j] = arrAllContent[counterRowRec + i][counterColRec + j];
-                        }
-                    }
-                }
-                dispValueIdxLst_Content.push(arrContents);
-            } else {
-                //should push blank value index rather than null
-                for (let i = 0; i < maxRowRec; i++) {
-                    arrContents.push([]);
-                    for (let j = 0; j < maxColRec; j++) {
-                        arrContents[i][j] = JV.BLANK_VALUE_INDEX;
-                    }
-                }
-                dispValueIdxLst_Content.push(arrContents);
-            }
-        }
-    }
-    function private_SortAndOptimize(rptTpl, dataObj, dataSeq, sortTab, rstFieldsIdx) {
-        let result = [];
-        let tab = rptTpl[JV.NODE_CROSS_INFO][sortTab];
-        if (tab) {
-            let sIDX = 0;
-            //1. prepare and sort by tab-field
-            let fields = [];
-            JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, tab[JV.TAB_CROSS_FIELDS], fields, rstFieldsIdx);
-            let data_details = dataObj[JV.DATA_DETAIL_DATA];
-            JpcCrossTabHelper.sortTabFields(fields, rstFieldsIdx, data_details, dataSeq);
-            //2. distinguish sort tab fields value
-            let b1 = false;
-            for (let i = 0; i < dataSeq.length; i++) {
-                sIDX = 0;
-                let segArr = [];
-                if (dataSeq[i].length == 1) {
-                    JpcCrossTabHelper.pushToSeg(segArr, dataSeq, i, 0, 1);
-                } else {
-                    for (let j = 1; j < dataSeq[i].length; j++) {
-                        b1 = false;
-                        for (let k = 0; k < rstFieldsIdx.length; k++) {
-                            if (data_details[rstFieldsIdx[k]][dataSeq[i][j - 1]] != data_details[rstFieldsIdx[k]][dataSeq[i][j]]) {
-                                b1 = true;
-                                break;
-                            }
-                        }
-                        if (b1) {
-                            JpcCrossTabHelper.pushToSeg(segArr, dataSeq, i, sIDX, j);
-                            sIDX = j;
-                            if (j == dataSeq[i].length - 1) {
-                                JpcCrossTabHelper.pushToSeg(segArr, dataSeq, i, j, dataSeq[i].length);
-                            }
-                        } else if (j == dataSeq[i].length - 1) {
-                            JpcCrossTabHelper.pushToSeg(segArr, dataSeq, i, sIDX, dataSeq[i].length);
-                        }
-                    }
-                }
-                if (segArr.length > 0) result.push(segArr);
-            }
-        }
-        return result;
-    }
-    function private_SortForDisplayContent(rptTpl, rowSeq, colSeq, rstFieldsIdx){
-        let result = [];
-        let tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_CONTENT];
-        if (tab) {
-            JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, tab[JV.TAB_CROSS_FIELDS], null, rstFieldsIdx);
-        }
-        for (let i = 0; i < rowSeq.length; i++) {
-            let rl = rowSeq[i], cl = colSeq[i];
-            let ds = [];
-            //1. initialize to blank value index
-            for (let j = 0; j < rl.length; j++) {
-                ds.push([]);
-                for (let k = 0; k < cl.length; k++) {
-                    ds[j].push(JV.BLANK_VALUE_INDEX);
-                }
-            }
-            //2. then fill up the right index
-            for (let j = 0; j < rl.length; j++) {
-                let ra = rl[j];
-                for (let k = 0; k < ra.length; k++) {
-                    let colIdx = JpcCrossTabHelper.getColIDX(cl, ra[k]);
-                    if (colIdx >= 0) {
-                        ds[j][colIdx] = ra[k];
-                    }
-                }
-            }
-            result.push(ds);
-        }
-        return result;
-    }
-
-    let JpcCrossTabResult = {};
-    JpcCrossTabResult.initialize = function() {
-        let me = this;
-        me.dispValueIdxLst_Row = [];
-        me.dispValueIdxLst_Col = [];
-        me.dispValueIdxLst_Content = [];
-        me.dispSerialIdxLst_Row = [];
-        me.col_sum_fields_idx = [];
-        me.col_sum_fields_value_total = [];
-        me.dispSumValueLst_Col = [];
-        me.page_seg_map = [];
-        me.row_fields_idx = [];
-        me.col_fields_idx = [];
-        me.content_fields_idx = [];
-        me.row_extension_fields_idx = [];
-        me.row_sum_extension_fields_idx = [];
-        me.crsOrient = JV.PAGE_ORIENTATION_V_FIRST;
-        me.pageStatusLst = [];
-    };
-    JpcCrossTabResult.sorting = function(rptTpl, dataObj, dataSeq) {
-        let me = this;
-        //IMPORTANT: the data should be sorted in SQL/NoSQL level!
-        me.sortedRowSequence = private_SortAndOptimize(rptTpl, dataObj, dataSeq, JV.NODE_CROSS_ROW, me.row_fields_idx);
-        me.sortedColSequence = private_SortAndOptimize(rptTpl, dataObj, dataSeq, JV.NODE_CROSS_COL, me.col_fields_idx);
-        me.sortedContentSequence = private_SortForDisplayContent(rptTpl, me.sortedRowSequence, me.sortedColSequence, me.content_fields_idx);
-        JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_COL_SUM][JV.TAB_CROSS_FIELDS], null, me.col_sum_fields_idx);
-        //pre-sum the data(for col sum display)
-        let data_details = dataObj[JV.DATA_DETAIL_DATA],
-            data_fields = [];
-        for (let i = 0; i < me.col_sum_fields_idx.length; i++) {
-            let data_field = data_details[me.col_sum_fields_idx[i]];
-            data_fields.push(data_field);
-        }
-        for (let i = 0; i < me.sortedRowSequence.length; i++) { //seg level
-            if (me.sortedRowSequence[i].length > 0) {
-                me.col_sum_fields_value_total.push([]);
-                for (let j = 0; j < me.sortedRowSequence[i].length; j++) {
-                    let rowGrandTotal = [];
-                    for (let di = 0; di < data_fields.length; di++) {
-                        rowGrandTotal.push(0.0);
-                        for (let k = 0; k < me.sortedRowSequence[i][j].length; k++) {
-                            //3. start to sum
-                            rowGrandTotal[di] = rowGrandTotal[di] + 1.0 * JpcFieldHelper.getValue(data_fields[di], me.sortedRowSequence[i][j][k]);
-                        }
-                    }
-                    me.col_sum_fields_value_total[i].push(rowGrandTotal);
-                }
-            }
-
-        }
-    };
-    JpcCrossTabResult.preSetupPages = function(rptTpl, defProperties) {
-        let rst = 0, me = this;
-        //1. original initialize
-        let maxRowRec = 1, maxColRec = 1, counterRowRec = 0, counterColRec = 0, pageIdx = 0, segCnt = me.sortedContentSequence.length;
-        let pageStatus = [true, true, false, true, false, false, false, false];
-        //2. calculate the page info one by one
-        let bands = JpcBand.createNew(rptTpl, defProperties);
-        function private_resetBandArea() {
-            JpcBandHelper.setBandArea(bands, rptTpl, pageStatus);
-            maxRowRec = JpcCrossTabHelper.getMaxRowsPerPage(bands, rptTpl);
-            maxColRec = JpcCrossTabHelper.getMaxColsPerPage(bands, rptTpl);
-        }
-        JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_EXT][JV.TAB_CROSS_FIELDS], null, me.row_extension_fields_idx);
-        JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_SUM_EXT][JV.TAB_CROSS_FIELDS], null, me.row_sum_extension_fields_idx);
-        for (let segIdx = 0; segIdx < segCnt; segIdx++) {
-            //2.1. seg level initialize
-            private_resetBandArea();
-            let orgMaxRowRec = maxRowRec, orgMaxColRec = maxColRec;
-            let rowSplitCnt = Math.ceil(1.0 * me.sortedRowSequence[segIdx].length / maxRowRec);
-            let colSplitCnt = Math.ceil(1.0 * me.sortedColSequence[segIdx].length / maxColRec);
-            pageStatus[JV.STATUS_CROSS_ROW_END] = true;
-            private_resetBandArea();
-            let hasAdHocRow = !JpcCrossTabHelper.chkTabEnd(JV.NODE_CROSS_ROW_SUM, rptTpl, bands, me.sortedRowSequence, segIdx, (rowSplitCnt - 1) * orgMaxRowRec, maxRowRec);
-            if (hasAdHocRow) {
-                hasAdHocRow = !JpcCrossTabHelper.chkTabEnd(JV.NODE_CROSS_ROW_EXT, rptTpl, bands, me.sortedRowSequence, segIdx, (rowSplitCnt - 1) * orgMaxRowRec, maxRowRec);
-            }
-            pageStatus[JV.STATUS_CROSS_ROW_END] = false;
-            pageStatus[JV.STATUS_CROSS_COL_END] = true;
-            private_resetBandArea();
-            let hasAdHocCol = !JpcCrossTabHelper.chkTabEnd(JV.NODE_CROSS_COL_SUM, rptTpl, bands, me.sortedColSequence, segIdx, (colSplitCnt - 1) * orgMaxColRec, maxColRec);
-            pageStatus[JV.STATUS_CROSS_COL_END] = false;
-            private_resetBandArea();
-            if (hasAdHocRow) rowSplitCnt++;
-            if (hasAdHocCol) colSplitCnt++;
-            //2.2
-            for (let colIdx = 0; colIdx < colSplitCnt; colIdx++) {
-                pageStatus[JV.STATUS_CROSS_COL_END] = colIdx == (colSplitCnt - 1)?true:false;
-                private_resetBandArea();
-                counterColRec = orgMaxColRec * colIdx;
-                let currentSortedContentSequence = me.sortedContentSequence;
-                let currentSortedColSequence = me.sortedColSequence;
-                if (hasAdHocCol && colIdx == (colSplitCnt - 1)) {
-                    currentSortedColSequence = null;
-                    currentSortedContentSequence = null;
-                    counterColRec = 0;
-                }
-                for (let rowIdx = 0; rowIdx < rowSplitCnt; rowIdx++) {
-                    pageStatus[JV.STATUS_CROSS_ROW_END] = rowIdx == (rowSplitCnt - 1)?true:false;
-                    private_resetBandArea();
-                    me.pageStatusLst.push(pageStatus.slice(0));
-                    pageIdx++;
-                    counterRowRec = orgMaxRowRec * rowIdx;
-                    let currentSortedRowSequence = me.sortedRowSequence;
-                    if (hasAdHocRow && rowIdx == (rowSplitCnt - 1)) {
-                        currentSortedRowSequence = null;
-                        currentSortedContentSequence = null;
-                        counterRowRec = 0;
-                    }
-                    private_addTabValue(me.dispValueIdxLst_Row, currentSortedRowSequence, segIdx, counterRowRec, maxRowRec, me.dispSerialIdxLst_Row, me.col_sum_fields_value_total, me.dispSumValueLst_Col);
-                    private_addTabValue(me.dispValueIdxLst_Col, currentSortedColSequence, segIdx, counterColRec, maxColRec, null, null, null);
-                    private_addContentValue(me.dispValueIdxLst_Content, currentSortedContentSequence, segIdx, counterRowRec, maxRowRec, counterColRec, maxColRec, me.page_seg_map, pageIdx);
-                }
-            }
-            JpcCrossTabHelper.initialPageStatus(pageStatus);
-        }
-        bands = null;
-        //3. set pageSeq and return the result
-        rst = pageIdx;
-        return rst;
-    };
-    JpcCrossTabResult.outputAsSimpleJSONPage = function(rptTpl, dataObj, page, bands, controls, $CURRENT_RPT) {
-        let me = this, rst = [], tabRstLst = [];
-        let segIdx = JpcCommonHelper.getSegIdxByPageIdx(page, me.page_seg_map);
-        //1 calculate the band position
-        JpcBandHelper.setBandArea(bands, rptTpl, me.pageStatusLst[page - 1]);
-        //2. start to output detail-part
-        let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
-        //2.1 Row-Tab
-        tabRstLst.push(me.outputRowTab(rptTpl, dataObj, page, bands, unitFactor, controls));
-        //2.2 Col-Tab
-        tabRstLst.push(me.outputColTab(rptTpl, dataObj, page, bands, unitFactor, controls));
-        //2.3 Content-Tab
-        tabRstLst.push(me.outputContent(rptTpl, dataObj, page, bands, unitFactor, controls));
-        //2.4 Sum-Tab Row
-        //2.4 Sum-tab Col
-        tabRstLst.push(me.outputTabSum(rptTpl, dataObj, page, bands, unitFactor, JV.NODE_CROSS_COL_SUM, controls));
-        //2.x row tab ext
-        tabRstLst.push(me.outputTabExt(rptTpl, dataObj, page, bands, unitFactor, controls));
-        tabRstLst.push(me.outputSumTabExt(rptTpl, dataObj, page, bands, unitFactor, segIdx, controls));
-        //2.5 Discrete
-        tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[JV.NODE_CROSS_INFO][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[page - 1], segIdx, 1, 0, $CURRENT_RPT));
-        for (let i = 0; i < tabRstLst.length; i++) {
-            rst = rst.concat(tabRstLst[i]);
-            tabRstLst[i] = null;
-        }
-        return rst;
-    };
-    JpcCrossTabResult.outputRowTab = function(rptTpl, dataObj, page, bands, unitFactor, controls) {
-        let me = this, rst = [];
-        let tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
-        if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
-            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
-                let tab_fields = tab[JV.TAB_CROSS_FIELDS];
-                let data_details = dataObj[JV.DATA_DETAIL_DATA];
-                let valuesIdx = me.dispValueIdxLst_Row[page - 1];
-                let serialsIdx = me.dispSerialIdxLst_Row[page - 1];
-                for (let i = 0; i < me.row_fields_idx.length; i++) {
-                    let tab_field = tab_fields[i];
-                    let data_field = data_details[me.row_fields_idx[i]];
-                    if (!(tab_field[JV.PROP_HIDDEN])) {
-                        let rows = valuesIdx.length;
-                        for (let rowIdx = 0; rowIdx < rows; rowIdx++) {
-                            rst.push(me.outputTabField(band, tab_field, data_field, valuesIdx[rowIdx], serialsIdx[rowIdx], rows, rowIdx, 1, 0, unitFactor, true, controls));
-                        }
-                    }
-                }
-            }
-        }
-        return rst;
-    };
-    JpcCrossTabResult.outputColTab = function(rptTpl, dataObj, page, bands, unitFactor, controls) {
-        let me = this, rst = [], firstTextOutput = true;
-        let tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_COL];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
-        if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
-            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
-                let tab_fields = tab[JV.TAB_CROSS_FIELDS];
-                let data_details = dataObj[JV.DATA_DETAIL_DATA];
-                let valuesIdx = me.dispValueIdxLst_Col[page - 1];
-                for (let i = 0; i < me.col_fields_idx.length; i++) {
-                    let tab_field = tab_fields[i];
-                    let data_field = data_details[me.col_fields_idx[i]];
-                    if (!(tab_field[JV.PROP_HIDDEN])) {
-                        let cols = valuesIdx.length;
-                        for (let colIdx = 0; colIdx < cols; colIdx++) {
-                            rst.push(me.outputTabField(band, tab_field, data_field, valuesIdx[colIdx], -1, 1, 0, cols, colIdx, unitFactor, false, controls));
-                            //2. output texts
-                            if (firstTextOutput) {
-                                if (tab[JV.PROP_TEXT]) {
-                                    rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXT], band, unitFactor, 1, 0, cols, colIdx, 1, 0));
-                                }
-                                if (tab[JV.PROP_TEXTS]) {
-                                    for (let j = 0; j < tab[JV.PROP_TEXTS].length; j++) {
-                                        rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXTS][j], band, unitFactor, 1, 0, cols, colIdx, 1, 0));
-                                    }
-                                }
-                            }
-                        }
-                        firstTextOutput = false;
-                    }
-                }
-            }
-        }
-        return rst;
-    };
-    JpcCrossTabResult.outputContent = function (rptTpl, dataObj, page, bands, unitFactor, controls) {
-        let me = this, rst = [];
-        let tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_CONTENT];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
-        if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
-            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
-                let tab_fields = tab[JV.TAB_CROSS_FIELDS];
-                let data_details = dataObj[JV.DATA_DETAIL_DATA];
-                let contentValuesIdx = me.dispValueIdxLst_Content[page - 1];
-                for (let i = 0; i < tab_fields.length; i++) {
-                    let tab_field = tab_fields[i];
-                    let data_field = data_details[me.content_fields_idx[i]];
-                    if (!(tab_field[JV.PROP_HIDDEN])) {
-                        let rows = contentValuesIdx.length;
-                        for (let rowIdx = 0; rowIdx < rows; rowIdx++) {
-                            let cols = contentValuesIdx[rowIdx].length;
-                            for (let colIdx = 0; colIdx < cols; colIdx++) {
-                                rst.push(me.outputTabField(band, tab_field, data_field, contentValuesIdx[rowIdx][colIdx], -1, rows, rowIdx, cols, colIdx, unitFactor, true, controls));
-                            }
-                        }
-                    }
-                }
-            }
-        }
-        return rst;
-    };
-    JpcCrossTabResult.outputTabSum = function (rptTpl, dataObj, page, bands, unitFactor, tabNodeName, controls) {
-        let me = this, rst = [],
-            tab = rptTpl[JV.NODE_CROSS_INFO][tabNodeName],
-            band = bands[tab[JV.PROP_BAND_NAME]];
-        if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
-            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
-                let tab_fields = tab[JV.TAB_CROSS_FIELDS];
-                for (let i = 0; i < me.dispSumValueLst_Col[page - 1].length; i++) {
-                    if (me.dispSumValueLst_Col[page - 1][i] != null) {
-                        for (let j = 0; j < me.dispSumValueLst_Col[page - 1][i].length; j++) {
-                            let tab_field = tab_fields[j];
-                            let val = me.dispSumValueLst_Col[page - 1][i][j];
-                            let cellItem = JpcCommonOutputHelper.createCommonOutput(tab_field, val, controls);
-                            cellItem[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, me.dispSumValueLst_Col[page - 1].length, i, 1, 0, 1, 0, true, false);
-                            rst.push(cellItem);
-                        }
-                    } else {
-                        let sumL = 1;
-                        for (let si = 0; si < me.dispSumValueLst_Col.length; si++) {
-                            if (me.dispSumValueLst_Col[si][0] != null) {
-                                sumL = me.dispSumValueLst_Col[si][0].length;
-                                break;
-                            }
-                        }
-                        for (let j = 0; j < sumL; j++) {
-                            let tab_field = tab_fields[j];
-                            let val = null;
-                            let cellItem = JpcCommonOutputHelper.createCommonOutput(tab_field, val, controls);
-                            cellItem[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, me.dispSumValueLst_Col[page - 1].length, i, 1, 0, 1, 0, true, false);
-                            rst.push(cellItem);
-                        }
-                    }
-                }
-            }
-        }
-        return rst;
-    };
-    JpcCrossTabResult.outputTabExt = function (rptTpl, dataObj, page, bands, unitFactor, controls) {
-        let me = this, rst = [], firstTextOutput = true,
-            tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_EXT];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
-        if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
-            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
-                let tab_fields = tab[JV.TAB_CROSS_FIELDS],
-                    data_details = dataObj[JV.DATA_DETAIL_DATA],
-                    valuesIdx = me.dispValueIdxLst_Col[page - 1];
-                for (let i = 0; i < me.row_extension_fields_idx.length; i++) {
-                    let tab_field = tab_fields[i];
-                    let data_field = data_details[me.row_extension_fields_idx[i]];
-                    if (!(tab_field[JV.PROP_HIDDEN])) {
-                        let cols = valuesIdx.length;
-                        for (let colIdx = 0; colIdx < cols; colIdx++) {
-                            rst.push(me.outputTabField(band, tab_field, data_field, valuesIdx[colIdx], -1, 1, 0, cols, colIdx, unitFactor, false, controls));
-                            //2. output texts if has
-                            if (firstTextOutput) {
-                                if (tab[JV.PROP_TEXT]) {
-                                    rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXT], band, unitFactor, 1, 0, cols, colIdx, 1, 0));
-                                }
-                                if (tab[JV.PROP_TEXTS]) {
-                                    for (let j = 0; j < tab[JV.PROP_TEXTS].length; j++) {
-                                        rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXTS][j], band, unitFactor, 1, 0, cols, colIdx, 1, 0));
-                                    }
-                                }
-                            }
-                        }
-                        firstTextOutput = false;
-                    }
-                }
-            }
-        }
-        return rst;
-    };
-    JpcCrossTabResult.outputSumTabExt = function (rptTpl, dataObj, page, bands, unitFactor, segIdx, controls) {
-        let me = this, rst = [],
-            tab = rptTpl[JV.NODE_CROSS_INFO][JV.NODE_CROSS_ROW_SUM_EXT];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
-        if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
-            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true && pageStatus[JV.STATUS_CROSS_ROW_END] === true) {
-                let tab_fields = tab[JV.TAB_CROSS_FIELDS],
-                    data_details = dataObj[JV.DATA_DETAIL_DATA],
-                    data_fields = [];
-                for (let i = 0; i < me.row_sum_extension_fields_idx.length; i++) {
-                    let data_field = data_details[me.row_sum_extension_fields_idx[i]];
-                    data_fields.push(data_field);
-                }
-                //2. initialize grand total value
-                let rowGrandTotal = [];
-                for (let di = 0; di < data_fields.length; di++) {
-                    rowGrandTotal[di] = 0.0;
-                    //3. start to sum
-                    for (let i = 0; i < me.sortedColSequence[segIdx].length; i++) {
-                        //me.sortedColSequence[segIdx][i][0] //this is the data field value index!
-                        rowGrandTotal[di] = rowGrandTotal[di] + 1.0 * JpcFieldHelper.getValue(data_fields[di], me.sortedColSequence[segIdx][i][0]);
-                    }
-                }
-                //4. output
-                for (let di = 0; di < tab_fields.length; di++) {
-                    let tab_field = tab_fields[di];
-                    if (!tab_field[JV.PROP_HIDDEN]) {
-                        let val = rowGrandTotal[di];
-                        let cellItem = JpcCommonOutputHelper.createCommonOutput(tab_field, val, controls);
-                        cellItem[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, 1, 0, 1, 0, 1, 0, false, false);
-                        rst.push(cellItem);
-                    }
-                }
-                //output texts if has
-                if (tab[JV.PROP_TEXT]) {
-                    rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXT], band, unitFactor, 1, 0, 1, 0, 1, 0));
-                }
-                if (tab[JV.PROP_TEXTS]) {
-                    for (let j = 0; j < tab[JV.PROP_TEXTS].length; j++) {
-                        rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXTS][j], band, unitFactor, 1, 0, 1, 0, 1, 0));
-                    }
-                }
-            }
-        }
-        return rst;
-    };
-    JpcCrossTabResult.outputTabField = function (band, tab_field, data_field, valueIdx, serialIdx, rows, rowIdx, cols, colIdx, unitFactor, isRow, controls) {
-        let me = this, rst = null;
-        if (isRow == true && tab_field[JV.PROP_IS_SERIAL] && tab_field[JV.PROP_IS_SERIAL] == true) {
-            if (serialIdx >= 0) rst = JpcCommonOutputHelper.createCommonOutput(tab_field, serialIdx + 1)
-            else rst = JpcCommonOutputHelper.createCommonOutput(tab_field, "", controls);
-        } else {
-            rst = JpcCommonOutputHelper.createCommonOutput(tab_field, JpcFieldHelper.getValue(data_field, valueIdx), controls);
-        }
-        //position
-        if (isRow == true) {
-            rst[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, rows, rowIdx, cols, colIdx, 1, 0, true, false);
-        } else {
-            rst[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, rows, rowIdx, cols, colIdx, 1, 0, false, false);
-        }
-        return rst;
-    }
-    return JpcCrossTabResult;
-}
-
-module.exports = new JpcCrossTabSrv();

+ 0 - 202
modules/reports/rpt_component/jpc_ex.js

@@ -1,202 +0,0 @@
-let JV = require('./jpc_value_define');
-let JpcBand = require('./jpc_band');
-let JpcFlowTab = require('./jpc_flow_tab');
-let JpcBillTab = require('./jpc_bill_tab');
-let JpcCrossTab = require('./jpc_cross_tab');
-let JpcField = require('./jpc_field');
-let JpcParam = require('./jpc_param');
-let JpcFunc = require('./jpc_function');
-let JpcData = require('./jpc_data');
-let JpcCommonHelper = require('./helper/jpc_helper_common');
-let JE = require('./jpc_rte'); //Important: for self-define function execution purpose
-
-let JpcExSrv = function(){};
-JpcExSrv.prototype.createNew = function(){
-    function private_buildDftItems(rptTpl, dftCollection, propArray, nodeName) {
-        let rst = {};
-        if (dftCollection) {
-            for (let i = 0; i < dftCollection.length; i++) {
-                let item = {};
-                for (let j = 0; j < propArray.length; j++) {
-                    item[propArray[j]] = dftCollection[i][propArray[j]];
-                }
-                rst[dftCollection[i][JV.PROP_ID]] = item;
-            }
-            if (rptTpl && rptTpl[nodeName] && rptTpl[nodeName].length > 0) {
-                for (let i = 0; i < rptTpl[nodeName].length; i++) {
-                    let rptDftItem = rptTpl[nodeName][i];
-                    if (rst[rptDftItem[JV.PROP_ID]] == undefined) {
-                        let item = {};
-                        for (let j = 0; j < propArray.length; j++) {
-                            item[propArray[j]] = rptDftItem[propArray[j]];
-                        }
-                        rst[rptDftItem[JV.PROP_ID]] = item;
-                    }
-                }
-            }
-        }
-        return rst;
-    }
-    function private_buildDftControls(rptTpl, dftControlCollection) {
-        let rst = private_buildDftItems(rptTpl,dftControlCollection, JV.CONTROL_PROPS, JV.NODE_CONTROL_COLLECTION);
-        return rst;
-    }
-    function private_buildDftFonts(rptTpl, dftFontCollection) {
-        let rst = private_buildDftItems(rptTpl,dftFontCollection, JV.FONT_PROPS, JV.NODE_FONT_COLLECTION);
-        return rst;
-    }
-    function private_buildDftStyles(rptTpl, dftStyleCollection) {
-        let rst = {};
-        if (dftStyleCollection) {
-            for (let i = 0; i < dftStyleCollection.length; i++) {
-                let item = {};
-                if (dftStyleCollection[i][JV.PROP_BORDER_STYLE] && dftStyleCollection[i][JV.PROP_BORDER_STYLE].length > 0) {
-                    for (let j = 0; j < dftStyleCollection[i][JV.PROP_BORDER_STYLE].length; j++) {
-                        let borderItem = {};
-                        for (let k = 0; k < JV.BORDER_STYLE_PROPS.length; k++) {
-                            borderItem[JV.BORDER_STYLE_PROPS[k]] = dftStyleCollection[i][JV.PROP_BORDER_STYLE][j][JV.BORDER_STYLE_PROPS[k]];
-                        }
-                        item[dftStyleCollection[i][JV.PROP_BORDER_STYLE][j][JV.PROP_POSITION]] = borderItem;
-                    }
-                }
-                rst[dftStyleCollection[i][JV.PROP_ID]] = item;
-            }
-            if (rptTpl && rptTpl[JV.NODE_STYLE_COLLECTION] && rptTpl[JV.NODE_STYLE_COLLECTION].length > 0) {
-                for (let i = 0; i < rptTpl[JV.NODE_STYLE_COLLECTION].length; i++) {
-                    let rptDftItem = rptTpl[JV.NODE_STYLE_COLLECTION][i];
-                    if (rst[rptDftItem[JV.PROP_ID]] == undefined) {
-                        let item = {};
-                        for (let j = 0; j < rptDftItem[JV.PROP_BORDER_STYLE].length; j++) {
-                            let borderItem = {};
-                            for (let k = 0; k < JV.BORDER_STYLE_PROPS.length; k++) {
-                                borderItem[JV.BORDER_STYLE_PROPS[k]] = rptDftItem[JV.PROP_BORDER_STYLE][j][JV.BORDER_STYLE_PROPS[k]];
-                            }
-                            item[rptDftItem[JV.PROP_BORDER_STYLE][j][JV.PROP_POSITION]] = borderItem;
-                        }
-                        rst[rptDftItem[JV.PROP_ID]] = item;
-                    }
-                }
-            }
-        }
-        return rst;
-    }
-    let JpcResult = {};
-    //JpcResult.report_title
-    JpcResult.initialize = function(rptTpl) {
-        let me = this;
-        if (rptTpl[JV.NODE_FLOW_INFO]) {
-            me.flowTab = JpcFlowTab.createNew();
-            me.flowTab.initialize();
-        }
-        if (rptTpl[JV.NODE_BILL_INFO]) {
-            me.billTab = JpcBillTab.createNew();
-            me.billTab.initialize();
-        }
-        //let dt1 = new Date();
-        if (rptTpl[JV.NODE_CROSS_INFO]) {
-            me.crossTab = JpcCrossTab.createNew();
-            me.crossTab.initialize();
-        }
-        me.totalPages = 0;
-        me.runTimePageData = {};
-        me.fields = JpcField.createNew(rptTpl);
-        me.params = JpcParam.createNew(rptTpl);
-        me.formulas = JpcFunc.createNew(rptTpl);
-    };
-
-    JpcResult.analyzeData = function(rptTpl, dataObj, defProperties) {
-        let me = this;
-        //1. data object
-        let dataHelper = JpcData.createNew();
-        dataHelper.analyzeData(rptTpl, dataObj);
-        //2. tab object
-        //pre-condition: the data should be sorted in SQL/NoSQL level!
-        //let dt1 = new Date();
-        if (me.flowTab) {
-            me.flowTab.sorting(rptTpl, dataObj, dataHelper.dataSeq.slice(0));
-        }
-        if (me.crossTab) {
-            me.crossTab.sorting(rptTpl, dataObj, dataHelper.dataSeq.slice(0));
-        }
-        //let dt2 = new Date();
-        //alert(dt2 - dt1);
-        //3. formulas
-        me.executeFormulas(JV.RUN_TYPE_BEFORE_PAGING, rptTpl, dataObj, me);
-        //4. paging
-        me.paging(rptTpl, dataObj, defProperties);
-        //alert('analyzeData was completed!');
-        //for garbage collection:
-        dataHelper = null;
-    };
-    JpcResult.paging = function(rptTpl, dataObj, defProperties) {
-        let me = this;
-        if (me.flowTab) {
-            me.totalPages = me.flowTab.preSetupPages(rptTpl, dataObj, defProperties);
-        } else if (me.crossTab) {
-            me.totalPages = me.crossTab.preSetupPages(rptTpl, defProperties);
-        } else if (me.billTab) {
-            //me.totalPages = billTab.paging();
-        }
-    };
-    JpcResult.executeFormulas = function(runType, $CURRENT_TEMPLATE, $CURRENT_DATA, $CURRENT_RPT) {
-        let me = this;
-        for (let i = 0; i < me.formulas.length; i++) {
-            if (me.formulas[i][JV.PROP_RUN_TYPE] === runType) {
-                let expression = me.formulas[i][JV.PROP_EXPRESSION];
-                if (expression) {
-                    eval(expression);
-                }
-            }
-        }
-    };
-    JpcResult.outputAsSimpleJSONPageArray = function(rptTpl, dataObj, startPage, endPage, defProperties) {
-        let me = this, rst = {};
-        if ((startPage > 0) && (startPage <= endPage) && (endPage <= me.totalPages)) {
-            rst[JV.NODE_CONTROL_COLLECTION] = private_buildDftControls(rptTpl, (defProperties == null)?null:defProperties.ctrls);
-            rst[JV.NODE_STYLE_COLLECTION] = private_buildDftStyles(rptTpl, (defProperties == null)?null:defProperties.styles);
-            rst[JV.NODE_FONT_COLLECTION] = private_buildDftFonts(rptTpl, (defProperties == null)?null:defProperties.fonts);
-            rst[JV.NODE_PAGE_INFO] = JpcCommonHelper.getPageSize(rptTpl);
-            rst.items = [];
-            let bands = JpcBand.createNew(rptTpl, defProperties);
-            try {
-                for (let page = startPage; page <= endPage; page++) {
-                    me.runTimePageData.currentPage = page;
-                    me.executeFormulas(JV.RUN_TYPE_BEFORE_OUTPUT, rptTpl, dataObj, me);
-                    rst.items.push(me.outputAsSimpleJSONPage(rptTpl, dataObj, bands, page, rst[JV.NODE_CONTROL_COLLECTION]));
-                }
-                if (bands[JV.BAND_PROP_MERGE_BAND]) {
-                    let mergedBand = {}, band = bands[JV.BAND_PROP_MERGE_BAND];
-                    mergedBand[JV.PROP_LEFT] = band[JV.PROP_LEFT].toFixed(0);
-                    mergedBand[JV.PROP_RIGHT] = band[JV.PROP_RIGHT].toFixed(0);
-                    mergedBand[JV.PROP_TOP] = band[JV.PROP_TOP].toFixed(0);
-                    mergedBand[JV.PROP_BOTTOM] = band[JV.PROP_BOTTOM].toFixed(0);
-                    mergedBand[JV.BAND_PROP_STYLE] = band[JV.BAND_PROP_STYLE];
-                    rst[JV.BAND_PROP_MERGE_BAND] = mergedBand;
-                }
-            } finally {
-                bands = null;
-            }
-        }
-        return rst;
-    };
-    JpcResult.outputAsSimpleJSONPage = function(rptTpl, dataObj, bands, page, controls) {
-        let me = this, rst = null;
-        if (me.totalPages >= page) {
-            rst = {};
-            rst[JV.PROP_PAGE_SEQ] = page;
-            //rst.cells = [];
-            if (me.flowTab) {
-                rst.cells = me.flowTab.outputAsSimpleJSONPage(rptTpl, dataObj, page, bands, controls, me);
-            } else if (me.crossTab) {
-                rst.cells = me.crossTab.outputAsSimpleJSONPage(rptTpl, dataObj, page, bands, controls, me);
-            } else if (me.billTab) {
-                //
-            }
-        }
-        return rst;
-    };
-    //JpcEx.rte.currentRptObj = JpcResult;
-    return JpcResult;
-}
-
-module.exports = new JpcExSrv();

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

@@ -1,229 +0,0 @@
-let JV = require('./jpc_value_define');
-let JE = require('./jpc_rte');
-let JpcFieldHelper = require('./helper/jpc_helper_field');
-let JpcBandHelper = require('./helper/jpc_helper_band');
-let JpcBand = require('./jpc_band');
-let JpcFlowTabHelper = require('./helper/jpc_helper_flow_tab');
-let JpcCommonHelper = require('./helper/jpc_helper_common');
-let JpcDiscreteHelper = require('./helper/jpc_helper_discrete');
-let JpcTextHelper = require('./helper/jpc_helper_text');
-let JpcCommonOutputHelper = require('./helper/jpc_helper_common_output');
-let JpcAreaHelper = require('./helper/jpc_helper_area');
-
-let JpcFlowTabSrv = function(){};
-JpcFlowTabSrv.prototype.createNew = function(){
-    function private_addPageValue(ValuedIdxLst, sortedSequence, preRec, nextRec,page_seg_map, segIdx, pageIdx) {
-        let vIdx = [];
-        for (let vi = 0; vi < nextRec; vi++) {
-            if (sortedSequence.length > preRec + vi) {
-                vIdx.push(sortedSequence[preRec + vi]);
-            } else {
-                vIdx.push(JV.BLANK_VALUE_INDEX);
-            }
-        }
-        page_seg_map.push([pageIdx, segIdx]);
-        ValuedIdxLst.push(vIdx);
-    }
-    let JpcFlowTabResult = {};
-    JpcFlowTabResult.initialize = function() {
-        let me = this;
-        me.segments = [];
-        me.dispValueIdxLst = [];
-        me.page_seg_map = [];
-        me.disp_fields_idx = [];
-        me.seg_sum_fields_idx = [];
-        me.seg_sum_tab_fields = [];
-        me.page_sum_fields_idx = [];
-        me.group_fields_idx = [];
-        me.pageStatusLst = [];
-        me.groupSumValLst = [];
-        me.segSumValLst = [];
-        me.multiCols = 1;
-    };
-    JpcFlowTabResult.sorting = function(rptTpl, dataObj, dataSeq) {
-        let me = this;
-        JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_SEG_SUM][JV.PROP_SUM_FIELDS], me.seg_sum_tab_fields, me.seg_sum_fields_idx);
-        JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_PAGE_SUM][JV.PROP_SUM_FIELDS], null, me.page_sum_fields_idx);
-        JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_GROUP][JV.PROP_GROUP_FIELDS], null, me.group_fields_idx);
-        for (let si = 0; si < dataSeq.length; si++) {
-            me.segments.push(dataSeq[si].slice(0));
-        }
-        //pre-sum the data(for seg sum display)
-        let data_details = dataObj[JV.DATA_DETAIL_DATA],
-            data_fields = [];
-        for (let i = 0; i < me.seg_sum_fields_idx.length; i++) {
-            let data_field = data_details[me.seg_sum_fields_idx[i]];
-            data_fields.push(data_field);
-        }
-        for (let i = 0; i < me.segments.length; i++) { //seg level
-            if (me.segments[i].length > 0) {
-                let rowGrandTotal = [];
-                for (let di = 0; di < data_fields.length; di++) {
-                    rowGrandTotal.push(0.0);
-                    for (let j = 0; j < me.segments[i].length; j++) {
-                        //3. start to sum
-                        rowGrandTotal[di] = rowGrandTotal[di] + 1.0 * JpcFieldHelper.getValue(data_fields[di], me.segments[i][j]);
-                    }
-                }
-                me.segSumValLst.push(rowGrandTotal);
-            }
-
-        }
-    };
-    JpcFlowTabResult.preSetupPages = function (rptTpl, dataOjb, defProperties) {
-        let rst = 0, me = this, counterRowRec = 0, maxRowRec = 1, pageIdx = 0;
-        JpcFieldHelper.findAndPutDataFieldIdx(rptTpl, rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_CONTENT][JV.PROP_FLOW_FIELDS], null, me.disp_fields_idx);
-        let bands = JpcBand.createNew(rptTpl, defProperties);
-        let pageStatus = [true, true, false, false, false, false, false, false];
-        if (rptTpl[JV.NODE_FLOW_INFO][JV.PROP_MULTI_COLUMN]) {
-            me.multiCols = 1 * rptTpl[JV.NODE_FLOW_INFO][JV.PROP_MULTI_COLUMN];
-        }
-        function private_resetBandArea() {
-            JpcBandHelper.setBandArea(bands, rptTpl, pageStatus);
-            maxRowRec = JpcFlowTabHelper.getMaxRowsPerPage(bands, rptTpl);
-        }
-        for (let segIdx = 0; segIdx < me.segments.length; segIdx++) {
-            private_resetBandArea();
-            let orgMaxRowRec = maxRowRec;
-            let rowSplitCnt = Math.ceil(1.0 * me.segments[segIdx].length / orgMaxRowRec);
-            pageStatus[JV.STATUS_SEGMENT_END] = true;
-            private_resetBandArea();
-            let hasAdHocRow = !JpcFlowTabHelper.chkSegEnd(bands, rptTpl, me.segments, segIdx, (rowSplitCnt - 1) * orgMaxRowRec, maxRowRec);
-            if (hasAdHocRow) rowSplitCnt++;
-            if (rowSplitCnt % me.multiCols > 0) {
-                rowSplitCnt++
-            }
-            for (let rowIdx = 0; rowIdx < rowSplitCnt; rowIdx++) {
-                pageStatus[JV.STATUS_SEGMENT_END] = rowIdx == (rowSplitCnt - 1)?true:false;
-                if (pageIdx > 0) pageStatus[JV.STATUS_REPORT_START] = false;
-                private_resetBandArea();
-                me.pageStatusLst.push(pageStatus.slice(0));
-                pageIdx++;
-                counterRowRec = orgMaxRowRec * rowIdx;
-                private_addPageValue(me.dispValueIdxLst, me.segments[segIdx], counterRowRec, maxRowRec,me.page_seg_map, segIdx, pageIdx);
-            }
-            pageStatus[JV.STATUS_SEGMENT_END] = false;
-            pageStatus[JV.STATUS_REPORT_START] = false;
-        }
-        rst = Math.ceil(1.0 * pageIdx / me.multiCols);
-        return rst;
-    };
-    JpcFlowTabResult.outputAsSimpleJSONPage = function (rptTpl, dataObj, page, bands, controls, $CURRENT_RPT) {
-        let me = this, rst = [], tabRstLst = [];
-        let segIdx = JpcCommonHelper.getSegIdxByPageIdx(page, me.page_seg_map);
-        //1 calculate the band position
-        JpcBandHelper.setBandArea(bands, rptTpl, me.pageStatusLst[page - 1]);
-        //2. start to output detail-part
-        let unitFactor = JpcCommonHelper.getUnitFactor(rptTpl);
-        for (let pi = 0; pi < me.multiCols; pi++) {
-            let actualPage = (page - 1) * me.multiCols + pi + 1;
-            //2.1 Content-Tab
-            tabRstLst.push(me.outputContent(rptTpl, dataObj, actualPage, bands, unitFactor, controls, pi));
-            //2.2 Column tab
-            tabRstLst.push(me.outputColumn(rptTpl, dataObj, actualPage, segIdx, bands, unitFactor, controls, pi));
-            //2.3 Sum Seg
-            tabRstLst.push(me.outputSegSum(rptTpl, dataObj, actualPage, segIdx, bands, unitFactor, controls));
-            //2.4 Sum Page
-            //2.5 Discrete
-            if (pi == 0) {
-                tabRstLst.push(JpcDiscreteHelper.outputDiscreteInfo(rptTpl[JV.NODE_FLOW_INFO][JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[actualPage - 1], segIdx, 1, pi, $CURRENT_RPT));
-            }
-        }
-        for (let i = 0; i < tabRstLst.length; i++) {
-            rst = rst.concat(tabRstLst[i]);
-            tabRstLst[i] = null;
-        }
-        return rst;
-    };
-    JpcFlowTabResult.outputContent = function(rptTpl, dataObj, page, bands, unitFactor, controls, multiColIdx, $CURRENT_RPT) {
-        let me = this, rst = [];
-        let tab = rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_CONTENT];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
-        if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
-            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
-                let tab_fields = tab[JV.PROP_FLOW_FIELDS];
-                let data_details = dataObj[JV.DATA_DETAIL_DATA];
-                let contentValuesIdx = me.dispValueIdxLst[page - 1];
-                for (let i = 0; i < tab_fields.length; i++) {
-                    let tab_field = tab_fields[i];
-                    let data_field = null;
-                    if (me.disp_fields_idx[i] != JV.BLANK_FIELD_INDEX) {
-                        data_field = data_details[me.disp_fields_idx[i]];
-                    } else {
-                        data_field = JE.F(tab_field[JV.PROP_FIELD_ID], $CURRENT_RPT);
-                        if (data_field) {
-                            data_field = data_field[JV.PROP_AD_HOC_DATA];
-                        }
-                    }
-                    if (!(tab_field[JV.PROP_HIDDEN])) {
-                        for (let rowIdx = 0; rowIdx < contentValuesIdx.length; rowIdx++) {
-                            rst.push(me.outputTabField(band, tab_field, data_field, contentValuesIdx[rowIdx], -1, contentValuesIdx.length, rowIdx, 1, 0, unitFactor, true, controls, multiColIdx));
-                        }
-                    }
-                }
-            }
-        }
-        return rst;
-    };
-    JpcFlowTabResult.outputColumn = function (rptTpl, dataObj, page, segIdx, bands, unitFactor, controls, multiColIdx) {
-        let me = this, rst = [];
-        let tab = rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_COLUMN];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
-        if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
-            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
-                if (tab[JV.PROP_TEXT]) {
-                    rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXT], band, unitFactor, 1, 0, 1, 0, me.multiCols, multiColIdx));
-                }
-                if (tab[JV.PROP_TEXTS]) {
-                    for (let j = 0; j < tab[JV.PROP_TEXTS].length; j++) {
-                        rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXTS][j], band, unitFactor, 1, 0, 1, 0, me.multiCols, multiColIdx));
-                    }
-                }
-                if (tab[JV.NODE_DISCRETE_INFO]) {
-                    rst = rst.concat(JpcDiscreteHelper.outputDiscreteInfo(tab[JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[page - 1], segIdx, me.multiCols, multiColIdx));
-                }
-            }
-        }
-        return rst;
-    };
-    JpcFlowTabResult.outputSegSum = function (rptTpl, dataObj, page, segIdx, bands, unitFactor, controls) {
-        let me = this, rst = [];
-        let tab = rptTpl[JV.NODE_FLOW_INFO][JV.NODE_FLOW_SEG_SUM];
-        let band = bands[tab[JV.PROP_BAND_NAME]];
-        if (band) {
-            let pageStatus = me.pageStatusLst[page - 1];
-            if (pageStatus[band[JV.BAND_PROP_DISPLAY_TYPE]] == true) {
-                let tab_fields = me.seg_sum_tab_fields;
-                for (let i = 0; i < tab_fields.length; i++) {
-                    let cellItem = JpcCommonOutputHelper.createCommonOutput(tab_fields[i], me.segSumValLst[segIdx][i], controls);
-                    cellItem[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_fields[i][JV.PROP_AREA], band, unitFactor, 1, 0, 1, 0, me.multiCols, 0, true, false);
-                    rst.push(cellItem);
-                }
-                if (tab[JV.PROP_TEXT]) {
-                    rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXT], band, unitFactor, 1, 0, 1, 0, me.multiCols, 0));
-                }
-                if (tab[JV.PROP_TEXTS]) {
-                    for (let j = 0; j < tab[JV.PROP_TEXTS].length; j++) {
-                        rst.push(JpcTextHelper.outputText(tab[JV.PROP_TEXTS][j], band, unitFactor, 1, 0, 1, 0, me.multiCols, 0));
-                    }
-                }
-                if (tab[JV.NODE_DISCRETE_INFO]) {
-                    rst = rst.concat(JpcDiscreteHelper.outputDiscreteInfo(tab[JV.NODE_DISCRETE_INFO], bands, dataObj, unitFactor, me.pageStatusLst[page - 1], segIdx, me.multiCols, 0));
-                }
-            }
-        }
-        return rst;
-    };
-    JpcFlowTabResult.outputTabField = function (band, tab_field, data_field, valueIdx, serialIdx, rows, rowIdx, cols, colIdx, unitFactor, isRow, controls, multiColIdx) {
-        let me = this, rst = null;
-        rst = JpcCommonOutputHelper.createCommonOutput(tab_field, JpcFieldHelper.getValue(data_field, valueIdx), controls);
-        rst[JV.PROP_AREA] = JpcAreaHelper.outputArea(tab_field[JV.PROP_AREA], band, unitFactor, rows, rowIdx, cols, colIdx, me.multiCols, multiColIdx, true, false);
-        return rst;
-    }
-
-    return JpcFlowTabResult;
-}
-
-module.exports = new JpcFlowTabSrv();

+ 0 - 281
modules/reports/util/excel_base_files/theme1.xml

@@ -1,281 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office 主题">
-	<a:themeElements>
-		<a:clrScheme name="Office">
-			<a:dk1>
-				<a:sysClr val="windowText" lastClr="000000"/>
-			</a:dk1>
-			<a:lt1>
-				<a:sysClr val="window" lastClr="FFFFFF"/>
-			</a:lt1>
-			<a:dk2>
-				<a:srgbClr val="1F497D"/>
-			</a:dk2>
-			<a:lt2>
-				<a:srgbClr val="EEECE1"/>
-			</a:lt2>
-			<a:accent1>
-				<a:srgbClr val="4F81BD"/>
-			</a:accent1>
-			<a:accent2>
-				<a:srgbClr val="C0504D"/>
-			</a:accent2>
-			<a:accent3>
-				<a:srgbClr val="9BBB59"/>
-			</a:accent3>
-			<a:accent4>
-				<a:srgbClr val="8064A2"/>
-			</a:accent4>
-			<a:accent5>
-				<a:srgbClr val="4BACC6"/>
-			</a:accent5>
-			<a:accent6>
-				<a:srgbClr val="F79646"/>
-			</a:accent6>
-			<a:hlink>
-				<a:srgbClr val="0000FF"/>
-			</a:hlink>
-			<a:folHlink>
-				<a:srgbClr val="800080"/>
-			</a:folHlink>
-		</a:clrScheme>
-		<a:fontScheme name="Office">
-			<a:majorFont>
-				<a:latin typeface="Cambria"/>
-				<a:ea typeface=""/>
-				<a:cs typeface=""/>
-				<a:font script="Jpan" typeface="MS Pゴシック"/>
-				<a:font script="Hang" typeface="맑은 고딕"/>
-				<a:font script="Hans" typeface="宋体"/>
-				<a:font script="Hant" typeface="新細明體"/>
-				<a:font script="Arab" typeface="Times New Roman"/>
-				<a:font script="Hebr" typeface="Times New Roman"/>
-				<a:font script="Thai" typeface="Tahoma"/>
-				<a:font script="Ethi" typeface="Nyala"/>
-				<a:font script="Beng" typeface="Vrinda"/>
-				<a:font script="Gujr" typeface="Shruti"/>
-				<a:font script="Khmr" typeface="MoolBoran"/>
-				<a:font script="Knda" typeface="Tunga"/>
-				<a:font script="Guru" typeface="Raavi"/>
-				<a:font script="Cans" typeface="Euphemia"/>
-				<a:font script="Cher" typeface="Plantagenet Cherokee"/>
-				<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>
-				<a:font script="Tibt" typeface="Microsoft Himalaya"/>
-				<a:font script="Thaa" typeface="MV Boli"/>
-				<a:font script="Deva" typeface="Mangal"/>
-				<a:font script="Telu" typeface="Gautami"/>
-				<a:font script="Taml" typeface="Latha"/>
-				<a:font script="Syrc" typeface="Estrangelo Edessa"/>
-				<a:font script="Orya" typeface="Kalinga"/>
-				<a:font script="Mlym" typeface="Kartika"/>
-				<a:font script="Laoo" typeface="DokChampa"/>
-				<a:font script="Sinh" typeface="Iskoola Pota"/>
-				<a:font script="Mong" typeface="Mongolian Baiti"/>
-				<a:font script="Viet" typeface="Times New Roman"/>
-				<a:font script="Uigh" typeface="Microsoft Uighur"/>
-			</a:majorFont>
-			<a:minorFont>
-				<a:latin typeface="Calibri"/>
-				<a:ea typeface=""/>
-				<a:cs typeface=""/>
-				<a:font script="Jpan" typeface="MS Pゴシック"/>
-				<a:font script="Hang" typeface="맑은 고딕"/>
-				<a:font script="Hans" typeface="宋体"/>
-				<a:font script="Hant" typeface="新細明體"/>
-				<a:font script="Arab" typeface="Arial"/>
-				<a:font script="Hebr" typeface="Arial"/>
-				<a:font script="Thai" typeface="Tahoma"/>
-				<a:font script="Ethi" typeface="Nyala"/>
-				<a:font script="Beng" typeface="Vrinda"/>
-				<a:font script="Gujr" typeface="Shruti"/>
-				<a:font script="Khmr" typeface="DaunPenh"/>
-				<a:font script="Knda" typeface="Tunga"/>
-				<a:font script="Guru" typeface="Raavi"/>
-				<a:font script="Cans" typeface="Euphemia"/>
-				<a:font script="Cher" typeface="Plantagenet Cherokee"/>
-				<a:font script="Yiii" typeface="Microsoft Yi Baiti"/>
-				<a:font script="Tibt" typeface="Microsoft Himalaya"/>
-				<a:font script="Thaa" typeface="MV Boli"/>
-				<a:font script="Deva" typeface="Mangal"/>
-				<a:font script="Telu" typeface="Gautami"/>
-				<a:font script="Taml" typeface="Latha"/>
-				<a:font script="Syrc" typeface="Estrangelo Edessa"/>
-				<a:font script="Orya" typeface="Kalinga"/>
-				<a:font script="Mlym" typeface="Kartika"/>
-				<a:font script="Laoo" typeface="DokChampa"/>
-				<a:font script="Sinh" typeface="Iskoola Pota"/>
-				<a:font script="Mong" typeface="Mongolian Baiti"/>
-				<a:font script="Viet" typeface="Arial"/>
-				<a:font script="Uigh" typeface="Microsoft Uighur"/>
-			</a:minorFont>
-		</a:fontScheme>
-		<a:fmtScheme name="Office">
-			<a:fillStyleLst>
-				<a:solidFill>
-					<a:schemeClr val="phClr"/>
-				</a:solidFill>
-				<a:gradFill rotWithShape="1">
-					<a:gsLst>
-						<a:gs pos="0">
-							<a:schemeClr val="phClr">
-								<a:tint val="50000"/>
-								<a:satMod val="300000"/>
-							</a:schemeClr>
-						</a:gs>
-						<a:gs pos="35000">
-							<a:schemeClr val="phClr">
-								<a:tint val="37000"/>
-								<a:satMod val="300000"/>
-							</a:schemeClr>
-						</a:gs>
-						<a:gs pos="100000">
-							<a:schemeClr val="phClr">
-								<a:tint val="15000"/>
-								<a:satMod val="350000"/>
-							</a:schemeClr>
-						</a:gs>
-					</a:gsLst>
-					<a:lin ang="16200000" scaled="1"/>
-				</a:gradFill>
-				<a:gradFill rotWithShape="1">
-					<a:gsLst>
-						<a:gs pos="0">
-							<a:schemeClr val="phClr">
-								<a:shade val="51000"/>
-								<a:satMod val="130000"/>
-							</a:schemeClr>
-						</a:gs>
-						<a:gs pos="80000">
-							<a:schemeClr val="phClr">
-								<a:shade val="93000"/>
-								<a:satMod val="130000"/>
-							</a:schemeClr>
-						</a:gs>
-						<a:gs pos="100000">
-							<a:schemeClr val="phClr">
-								<a:shade val="94000"/>
-								<a:satMod val="135000"/>
-							</a:schemeClr>
-						</a:gs>
-					</a:gsLst>
-					<a:lin ang="16200000" scaled="0"/>
-				</a:gradFill>
-			</a:fillStyleLst>
-			<a:lnStyleLst>
-				<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr">
-					<a:solidFill>
-						<a:schemeClr val="phClr">
-							<a:shade val="95000"/>
-							<a:satMod val="105000"/>
-						</a:schemeClr>
-					</a:solidFill>
-					<a:prstDash val="solid"/>
-				</a:ln>
-				<a:ln w="25400" cap="flat" cmpd="sng" algn="ctr">
-					<a:solidFill>
-						<a:schemeClr val="phClr"/>
-					</a:solidFill>
-					<a:prstDash val="solid"/>
-				</a:ln>
-				<a:ln w="38100" cap="flat" cmpd="sng" algn="ctr">
-					<a:solidFill>
-						<a:schemeClr val="phClr"/>
-					</a:solidFill>
-					<a:prstDash val="solid"/>
-				</a:ln>
-			</a:lnStyleLst>
-			<a:effectStyleLst>
-				<a:effectStyle>
-					<a:effectLst>
-						<a:outerShdw blurRad="40000" dist="20000" dir="5400000" rotWithShape="0">
-							<a:srgbClr val="000000">
-								<a:alpha val="38000"/>
-							</a:srgbClr>
-						</a:outerShdw>
-					</a:effectLst>
-				</a:effectStyle>
-				<a:effectStyle>
-					<a:effectLst>
-						<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0">
-							<a:srgbClr val="000000">
-								<a:alpha val="35000"/>
-							</a:srgbClr>
-						</a:outerShdw>
-					</a:effectLst>
-				</a:effectStyle>
-				<a:effectStyle>
-					<a:effectLst>
-						<a:outerShdw blurRad="40000" dist="23000" dir="5400000" rotWithShape="0">
-							<a:srgbClr val="000000">
-								<a:alpha val="35000"/>
-							</a:srgbClr>
-						</a:outerShdw>
-					</a:effectLst>
-					<a:scene3d>
-						<a:camera prst="orthographicFront">
-							<a:rot lat="0" lon="0" rev="0"/>
-						</a:camera>
-						<a:lightRig rig="threePt" dir="t">
-							<a:rot lat="0" lon="0" rev="1200000"/>
-						</a:lightRig>
-					</a:scene3d>
-					<a:sp3d>
-						<a:bevelT w="63500" h="25400"/>
-					</a:sp3d>
-				</a:effectStyle>
-			</a:effectStyleLst>
-			<a:bgFillStyleLst>
-				<a:solidFill>
-					<a:schemeClr val="phClr"/>
-				</a:solidFill>
-				<a:gradFill rotWithShape="1">
-					<a:gsLst>
-						<a:gs pos="0">
-							<a:schemeClr val="phClr">
-								<a:tint val="40000"/>
-								<a:satMod val="350000"/>
-							</a:schemeClr>
-						</a:gs>
-						<a:gs pos="40000">
-							<a:schemeClr val="phClr">
-								<a:tint val="45000"/>
-								<a:shade val="99000"/>
-								<a:satMod val="350000"/>
-							</a:schemeClr>
-						</a:gs>
-						<a:gs pos="100000">
-							<a:schemeClr val="phClr">
-								<a:shade val="20000"/>
-								<a:satMod val="255000"/>
-							</a:schemeClr>
-						</a:gs>
-					</a:gsLst>
-					<a:path path="circle">
-						<a:fillToRect l="50000" t="-80000" r="50000" b="180000"/>
-					</a:path>
-				</a:gradFill>
-				<a:gradFill rotWithShape="1">
-					<a:gsLst>
-						<a:gs pos="0">
-							<a:schemeClr val="phClr">
-								<a:tint val="80000"/>
-								<a:satMod val="300000"/>
-							</a:schemeClr>
-						</a:gs>
-						<a:gs pos="100000">
-							<a:schemeClr val="phClr">
-								<a:shade val="30000"/>
-								<a:satMod val="200000"/>
-							</a:schemeClr>
-						</a:gs>
-					</a:gsLst>
-					<a:path path="circle">
-						<a:fillToRect l="50000" t="50000" r="50000" b="50000"/>
-					</a:path>
-				</a:gradFill>
-			</a:bgFillStyleLst>
-		</a:fmtScheme>
-	</a:themeElements>
-	<a:objectDefaults/>
-	<a:extraClrSchemeLst/>
-</a:theme>

+ 0 - 687
modules/reports/util/rpt_excel_util.js

@@ -1,687 +0,0 @@
-/**
- * Created by Tony on 2017/4/1.
- */
-let JV = require('../rpt_component/jpc_value_define');
-let fs = require('fs');
-let JSZip = require("jszip");
-let strUtil = require('../../../public/stringUtil');
-let jpcCmnHelper = require('../rpt_component/helper/jpc_helper_common');
-let DPI = jpcCmnHelper.getScreenDPI()[0];
-const dftHeadXml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
-
-function writeContentTypes(sheets) {
-    let rst = [];
-    rst.push(dftHeadXml + '\r\n');
-    rst.push('<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">');
-    //...
-    rst.push('<Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/>');
-    rst.push('<Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>');
-    rst.push('<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>');
-    rst.push('<Default Extension="xml" ContentType="application/xml"/>');
-    rst.push('<Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/>');
-    rst.push('<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>');
-    rst.push('<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>');
-    for (let i = 0; i < sheets.length; i++) {
-        rst.push('<Override PartName="/xl/worksheets/sheet' + (i + 1) + '.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>')
-    }
-    rst.push('<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>');
-    rst.push('</Types>');
-    return rst;
-}
-function writeRootRels(){
-    let rst = [];
-    rst.push(dftHeadXml + '\r\n');
-    rst.push('<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">');
-    rst.push('<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>');
-    rst.push('<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>');
-    rst.push('<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>');
-    rst.push('</Relationships>');
-    return rst;
-}
-function writeApp(sheets) {
-    let rst = [];
-    rst.push(dftHeadXml + '\r\n');
-    rst.push('<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes">');
-    rst.push('<Application>Microsoft Excel</Application>');
-    rst.push('<DocSecurity>0</DocSecurity>');
-    rst.push('<ScaleCrop>false</ScaleCrop>');
-    rst.push('<HeadingPairs>');
-    rst.push('<vt:vector size="2" baseType="variant">');
-    rst.push('<vt:variant><vt:lpstr>工作表</vt:lpstr></vt:variant>');
-    rst.push('<vt:variant><vt:i4>' + sheets.length + '</vt:i4></vt:variant>');
-    rst.push('</vt:vector>');
-    rst.push('</HeadingPairs>');
-    rst.push('<TitlesOfParts>');
-    rst.push('<vt:vector size="' + sheets.length + '" baseType="lpstr">');
-    for (let i = 0; i < sheets.length; i++) {
-        rst.push('<vt:lpstr>' + sheets[i].sheetName + '</vt:lpstr>')
-    }
-    rst.push('</vt:vector>');
-    rst.push('</TitlesOfParts>');
-    rst.push('<Company>SmartCost</Company>');
-    rst.push('<LinksUpToDate>false</LinksUpToDate>');
-    rst.push('<SharedDoc>false</SharedDoc>');
-    rst.push('<HyperlinksChanged>false</HyperlinksChanged>');
-    rst.push('<AppVersion>12.0000</AppVersion>');
-    //rst.push('');
-    rst.push('</Properties>');
-    return rst;
-}
-function writeCore() {
-    let rst = [];
-    p_fillZero = function(val){
-        let rst = val;
-        if (val < 10) {
-            rst = '0' + val;
-        }
-        return rst;
-    };
-    rst.push(dftHeadXml + '\r\n');
-    rst.push('<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">');
-    rst.push('<dc:creator>SmartCost</dc:creator>');
-    rst.push('<cp:lastModifiedBy>SmartCost</cp:lastModifiedBy>');
-    let dt = new Date(), dtStr = dt.getFullYear() + '-' + p_fillZero(dt.getMonth()+1) + '-' + p_fillZero(dt.getDate()) + 'T' +
-        p_fillZero(dt.getHours()) + ':' + p_fillZero(dt.getMinutes()) + ':' + p_fillZero(dt.getSeconds()) + 'Z';
-    rst.push('<dcterms:created xsi:type="dcterms:W3CDTF">' + dtStr + '</dcterms:created>');
-    rst.push('<dcterms:modified xsi:type="dcterms:W3CDTF">' + dtStr + '</dcterms:modified>');
-    //rst.push('');
-    rst.push('</cp:coreProperties>');
-    return rst;
-}
-function writeXlWorkBook(sheets){
-    let rst = [];
-    rst.push(dftHeadXml + '\r\n');
-    rst.push('<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">');
-    rst.push('<fileVersion appName="xl" lastEdited="4" lowestEdited="4" rupBuild="4505"/>');
-    rst.push('<workbookPr defaultThemeVersion="124226"/>');
-    rst.push('<bookViews><workbookView xWindow="360" yWindow="345" windowWidth="14655" windowHeight="4305"/></bookViews>');
-    rst.push('<sheets>');
-    for (let i = 0; i < sheets.length; i++) {
-        rst.push('<sheet name="' + sheets[i].sheetName + '" sheetId="' + (i + 1) + '" r:id="rId' + (i + 1) + '"/>')
-    }
-    rst.push('</sheets>');
-    rst.push('<calcPr calcId="124519"/>');
-    //rst.push('');
-    rst.push('</workbook>');
-    return rst;
-}
-function writeXlRels(sheets){
-    let rst = [], idx = 1;
-    rst.push(dftHeadXml + '\r\n');
-    rst.push('<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">');
-    for (let i = 0; i < sheets.length; i++) {
-        rst.push('<Relationship Id="rId' + idx + '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet' + (i + 1) + '.xml"/>')
-        idx++;
-    }
-    rst.push('<Relationship Id="rId' + idx + '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/>');
-    idx++;
-    rst.push('<Relationship Id="rId' + idx + '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>');
-    idx++;
-    rst.push('<Relationship Id="rId' + idx + '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>');
-    //rst.push('');
-    rst.push('</Relationships>');
-    return rst;
-}
-function writeTheme(){
-    let rst = fs.readFileSync(__dirname + '/excel_base_files/theme1.xml', 'utf8', 'r');
-    return rst;
-}
-function writeStyles(stylesObj){
-    let rst = [];
-    rst.push(dftHeadXml + '\r\n');
-    rst.push('<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">');
-    //1. push fonts
-    rst.push('<fonts count="' + stylesObj.fonts.length + '">')
-    for (let i = 0; i < stylesObj.fonts.length; i++) {
-        let font = stylesObj.fonts[i];
-        rst.push('<font>');
-        if (strUtil.convertStrToBoolean(font[JV.FONT_PROPS[3]])) {
-            rst.push('<b/>');
-        }
-        rst.push('<sz val="' + font.size + '"/>');
-        rst.push('<color indexed="' + font.colorIdx + '"/>');
-        rst.push('<name val="' + font[JV.FONT_PROPS[0]] + '"/>');
-        rst.push('<charset val="' + font.charset + '"/>');
-        rst.push('</font>');
-    }
-    rst.push('</fonts>');
-    //2. push default fills
-    rst.push('<fills count="2"><fill><patternFill patternType="none" /></fill><fill><patternFill patternType="gray125" /></fill></fills>');
-    //3. push borders
-    rst.push('<borders count="' + stylesObj.borders.length + '">')
-    private_setBorder = function(border, borderDirection) {
-        if (border[borderDirection][JV.PROP_LINE_WEIGHT] == 0) {
-            rst.push('<' + borderDirection.toLowerCase() + '/>');
-        } else {
-            let bW = 'thin';
-            if (border[borderDirection][JV.PROP_LINE_WEIGHT] == 2) bW = 'medium';
-            if (border[borderDirection][JV.PROP_LINE_WEIGHT] > 2) bW = 'thick';
-            rst.push('<' + borderDirection.toLowerCase() + ' style="' + bW + '">' + '<color indexed="64"/>' + '</' + borderDirection.toLowerCase() + '>');
-        }
-    };
-    for (let i = 0; i < stylesObj.borders.length; i++) {
-        let border = stylesObj.borders[i];
-        rst.push('<border>');
-        private_setBorder(border, JV.PROP_LEFT);
-        private_setBorder(border, JV.PROP_RIGHT);
-        private_setBorder(border, JV.PROP_TOP);
-        private_setBorder(border, JV.PROP_BOTTOM);
-        rst.push('<diagonal />');
-        rst.push('</border>');
-    }
-    rst.push('</borders>');
-    //4. push cellStyleXfs
-    rst.push('<cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"><alignment vertical="center"/></xf></cellStyleXfs>');
-    //5. push cellXfs
-    rst.push('<cellXfs count="' + stylesObj.cellXfs.length + '">');
-    for (let i = 0; i < stylesObj.cellXfs.length; i++) {
-        let excelStyle = stylesObj.cellXfs[i];
-        rst.push('<xf numFmtId="0" fontId="' + excelStyle.fontId + '" fillId="0" borderId="' + excelStyle.borderId + '" xfId="0">');
-        let alignStr = '<alignment horizontal="' + excelStyle[JV.CONTROL_PROPS[2]] + '" vertical="' + excelStyle[JV.CONTROL_PROPS[3]] + '"';
-        if (strUtil.convertStrToBoolean(excelStyle[JV.CONTROL_PROPS[1]])) {
-            alignStr = alignStr + ' shrinkToFit="1"';
-        }
-        if (strUtil.convertStrToBoolean(excelStyle[JV.CONTROL_PROPS[4]])) {
-            alignStr = alignStr + ' wrapText="1"';
-        }
-        alignStr = alignStr + '/>';
-        rst.push(alignStr);
-        rst.push('</xf>');
-    }
-    rst.push('</cellXfs>');
-    //6. others (xfl style / dxfs / tableStyles)
-    rst.push('<cellStyles count="1"><cellStyle name="常规" xfId="0" builtinId="0"/></cellStyles>');
-    rst.push('<dxfs count="0"/>');
-    rst.push('<tableStyles count="0" defaultTableStyle="TableStyleMedium9" defaultPivotStyle="PivotStyleLight16"/>');
-    rst.push('</styleSheet>');
-    return rst;
-}
-function writeSharedString(sharedStrList){
-    let rst = [];
-    if (sharedStrList && sharedStrList.length > 0) {
-        rst.push(dftHeadXml + '\r\n');
-        rst.push('<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="' + sharedStrList.length + '" uniqueCount="' + sharedStrList.length + '">');
-        for (let i = 0; i < sharedStrList.length; i++) {
-            //rst.push('<si><t>' + sharedStrList[i] + '</t></si>');
-            if (typeof sharedStrList[i] === 'string') {
-                rst.push('<si><t>' + sharedStrList[i].replace('|','\r\n') + '</t></si>');
-            } else {
-                rst.push('<si><t>' + sharedStrList[i] + '</t></si>');
-            }
-        }
-        rst.push('</sst>');
-    }
-    return rst;
-}
-function writeSheets(pageData, sharedStrList, stylesObj){
-    let rst = [];
-    private_pushDftFont = function(){
-        let font = {};
-        if (!(stylesObj.fonts)) {
-            stylesObj.fonts = [];
-        }
-        font[JV.FONT_PROPS[0]] = "宋体"; //font name
-        font.size = 11;
-        font.charset = 134;
-        font.colorIdx = "8";
-        stylesObj.fonts.push(font);
-    };
-    private_pushDftFont();
-    for (let i = 0; i < pageData.items.length; i++) {
-        rst.push(writeSheet(pageData, pageData.items[i], sharedStrList, stylesObj));
-    }
-    return rst;
-}
-function writeSheet(pageData, sheetData, sharedStrList, stylesObj){
-    let rst = [], xPos = [], yPos = [], headerStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
-    let cacheBorderCell = {};
-    xPos.push(0);
-    yPos.push(0);
-    private_pre_analyze_pos = function(){
-        let cell, pos;
-        sheetData.cells.sort(function(cell1, cell2) {
-            let rst = 0;
-            if (cell1[JV.PROP_AREA][JV.PROP_TOP] > cell2[JV.PROP_AREA][JV.PROP_TOP]) {
-                rst = 1;
-            } else if (cell1[JV.PROP_AREA][JV.PROP_TOP] < cell2[JV.PROP_AREA][JV.PROP_TOP]) {
-                rst = -1;
-            } else {
-                if (cell1[JV.PROP_AREA][JV.PROP_LEFT] > cell2[JV.PROP_AREA][JV.PROP_LEFT]) {
-                    rst = 1;
-                } else if (cell1[JV.PROP_AREA][JV.PROP_LEFT] < cell2[JV.PROP_AREA][JV.PROP_LEFT]) {
-                    rst = -1;
-                }
-            }
-            return rst;
-        });
-        for (let i = 0; i < sheetData.cells.length; i++) {
-            cell = sheetData.cells[i];
-            pos = cell[JV.PROP_AREA][JV.PROP_LEFT];
-            if (xPos.indexOf(pos) < 0) xPos.push(pos);
-            pos = cell[JV.PROP_AREA][JV.PROP_RIGHT];
-            if (xPos.indexOf(pos) < 0) xPos.push(pos);
-            pos = cell[JV.PROP_AREA][JV.PROP_TOP];
-            if (yPos.indexOf(pos) < 0) yPos.push(pos);
-            pos = cell[JV.PROP_AREA][JV.PROP_BOTTOM];
-            if (yPos.indexOf(pos) < 0) yPos.push(pos);
-        }
-        xPos.sort(private_array_sort);
-        yPos.sort(private_array_sort);
-    };
-    private_array_sort = function(i1, i2){
-        let rst = 0;
-        if (i1 > i2) {rst = 1} else
-        if (i1 < i2) rst = -1;
-        return rst;
-    };
-    private_getCellIdxStr = function(idx){
-        let rst = 'A';
-        if (idx < 26) {
-            rst = headerStr[idx];
-        } else if (idx < 26*26+26) {
-            let ti = Math.floor(idx / 26), tj = idx % 26;
-            rst = headerStr[ti - 1] + headerStr[tj];
-        } else if (idx < 26*26*26+26) {
-            let ti = Math.floor(idx / (26*26)), tj = Math.floor((idx - ti * 26*26) / 26), tk = idx % 26;
-            rst = headerStr[ti - 1] + headerStr[tj-1] + headerStr[tk];
-        }
-        return rst;
-    };
-    private_getSharedStrIdx = function(val) {
-        let rst = sharedStrList.indexOf(val);
-        if (rst < 0) {
-            sharedStrList.push(val);
-            rst = sharedStrList.length - 1;
-        }
-        return rst;
-    };
-    private_getFontId = function(cell) {
-        let rst = 0, hasFont = false;
-        if (!(stylesObj.fonts)) {
-            stylesObj.fonts = [];
-            //for (let i = 0; i < sheetData.font_collection)
-        }
-        let sheetFont = pageData.font_collection[cell.font];
-        for (let i = 0; i < stylesObj.fonts.length; i++) {
-            let font = stylesObj.fonts[i];
-            if (sheetFont) {
-                if (font[JV.FONT_PROPS[0]] === sheetFont[JV.FONT_PROPS[0]] && font.size === Math.round(sheetFont[JV.FONT_PROPS[1]] * 3 / 4) && font[JV.FONT_PROPS[3]] == sheetFont[JV.FONT_PROPS[3]]) {
-                    hasFont = true;
-                    rst = i;
-                    break;
-                }
-            } else {
-                break;
-            }
-        }
-        if (!hasFont) {
-            let font = {};
-            font[JV.FONT_PROPS[0]] = sheetFont[JV.FONT_PROPS[0]]; //font name
-            font.size = Math.round(sheetFont[JV.FONT_PROPS[1]] * 3 / 4);
-            font.charset = 134;
-            font.colorIdx = "8";
-            font[JV.FONT_PROPS[3]] = sheetFont[JV.FONT_PROPS[3]]; //font bold
-            stylesObj.fonts.push(font);
-            rst = stylesObj.fonts.length - 1;
-        }
-        return rst;
-    };
-    private_checkBorder = function(cell, border, sheetBorder) {
-        let rst = true, borderLineWidths = [], sheetBorderLineWidths = [];
-        borderLineWidths.push(border[JV.PROP_LEFT][JV.PROP_LINE_WEIGHT]);
-        borderLineWidths.push(border[JV.PROP_RIGHT][JV.PROP_LINE_WEIGHT]);
-        borderLineWidths.push(border[JV.PROP_TOP][JV.PROP_LINE_WEIGHT]);
-        borderLineWidths.push(border[JV.PROP_BOTTOM][JV.PROP_LINE_WEIGHT]);
-        if (sheetBorder[JV.PROP_LEFT] && sheetBorder[JV.PROP_LEFT][JV.PROP_LINE_WEIGHT]) {
-            sheetBorderLineWidths.push(private_chkAndGetMergeLine(cell, sheetBorder, JV.PROP_LEFT));
-        } else {
-            sheetBorderLineWidths.push(0);
-        }
-        if (sheetBorder[JV.PROP_RIGHT] && sheetBorder[JV.PROP_RIGHT][JV.PROP_LINE_WEIGHT]) {
-            sheetBorderLineWidths.push(private_chkAndGetMergeLine(cell, sheetBorder, JV.PROP_RIGHT));
-        } else {
-            sheetBorderLineWidths.push(0);
-        }
-        if (sheetBorder[JV.PROP_TOP] && sheetBorder[JV.PROP_TOP][JV.PROP_LINE_WEIGHT]) {
-            sheetBorderLineWidths.push(private_chkAndGetMergeLine(cell, sheetBorder, JV.PROP_TOP));
-        } else {
-            sheetBorderLineWidths.push(0);
-        }
-        if (sheetBorder[JV.PROP_BOTTOM] && sheetBorder[JV.PROP_BOTTOM][JV.PROP_LINE_WEIGHT]) {
-            sheetBorderLineWidths.push(private_chkAndGetMergeLine(cell, sheetBorder, JV.PROP_BOTTOM));
-        } else {
-            sheetBorderLineWidths.push(0);
-        }
-        for (let i = 0; i < 4; i++) {
-            if (borderLineWidths[i] != sheetBorderLineWidths[i]) {
-                rst = false;
-                break;
-            }
-        }
-        return rst;
-    };
-    private_chkAndGetMergeLine = function(cell, sheetBorder, borderStr) {
-        let rst = sheetBorder[borderStr][JV.PROP_LINE_WEIGHT], mergeBorder = pageData[JV.BAND_PROP_MERGE_BAND];
-        if (cell[JV.PROP_AREA][borderStr] == mergeBorder[borderStr]) {
-            let destStyle = pageData[JV.NODE_STYLE_COLLECTION][mergeBorder[JV.PROP_STYLE][JV.PROP_ID]];
-            rst = destStyle[borderStr][JV.PROP_LINE_WEIGHT];
-        }
-        return parseInt(rst);
-    };
-    private_getIniBorder = function() {
-        let rst = {};
-        rst[JV.PROP_LEFT] = {};
-        rst[JV.PROP_LEFT][JV.PROP_LINE_WEIGHT] = 0;
-        rst[JV.PROP_RIGHT] = {};
-        rst[JV.PROP_RIGHT][JV.PROP_LINE_WEIGHT] = 0;
-        rst[JV.PROP_TOP] = {};
-        rst[JV.PROP_TOP][JV.PROP_LINE_WEIGHT] = 0;
-        rst[JV.PROP_BOTTOM] = {};
-        rst[JV.PROP_BOTTOM][JV.PROP_LINE_WEIGHT] = 0;
-        return rst;
-    };
-    private_getBorderId = function(cell) {
-        let rst = 0, hasBorder = false;
-        if (!(stylesObj.borders)) {
-            stylesObj.borders = [];
-        }
-        let sheetBorder = pageData[JV.NODE_STYLE_COLLECTION][cell.style];
-        for (let i = 0; i < stylesObj.borders.length; i++) {
-            let border = stylesObj.borders[i];
-            if (private_checkBorder(cell, border, sheetBorder)) {
-                hasBorder = true;
-                rst = i;
-                break;
-            }
-        }
-        if (!hasBorder) {
-            let border = private_getIniBorder();
-            if (sheetBorder && sheetBorder[JV.PROP_LEFT]) {
-                border[JV.PROP_LEFT][JV.PROP_LINE_WEIGHT] = private_chkAndGetMergeLine(cell, sheetBorder, JV.PROP_LEFT);
-            }
-            if (sheetBorder && sheetBorder[JV.PROP_RIGHT]) {
-                border[JV.PROP_RIGHT][JV.PROP_LINE_WEIGHT] = private_chkAndGetMergeLine(cell, sheetBorder, JV.PROP_RIGHT);
-            }
-            if (sheetBorder && sheetBorder[JV.PROP_TOP]) {
-                border[JV.PROP_TOP][JV.PROP_LINE_WEIGHT] = private_chkAndGetMergeLine(cell, sheetBorder, JV.PROP_TOP);
-            }
-            if (sheetBorder && sheetBorder[JV.PROP_BOTTOM]) {
-                border[JV.PROP_BOTTOM][JV.PROP_LINE_WEIGHT] = private_chkAndGetMergeLine(cell, sheetBorder, JV.PROP_BOTTOM);
-            }
-            stylesObj.borders.push(border);
-            rst = stylesObj.borders.length - 1;
-        }
-        return rst;
-    };
-    private_checkControl = function(cellControl, sheetControl) {
-        let rst = true;
-        for (let i = 0; i < JV.CONTROL_PROPS.length; i++) {
-            if (cellControl[JV.CONTROL_PROPS[i]] != sheetControl[JV.CONTROL_PROPS[i]]) {
-                rst = false;
-                break;
-            }
-        }
-        return rst;
-    };
-    private_getStyleId = function(cell) {
-        let rst = 1, hasStyle = false;
-        if (!(stylesObj.cellXfs)) stylesObj.cellXfs = [];
-        let fontId = private_getFontId(cell);
-        let borderId = private_getBorderId(cell);
-        let cellControl = pageData[JV.NODE_CONTROL_COLLECTION][cell[JV.PROP_CONTROL]];
-        for (let i = 0; i < stylesObj.cellXfs.length; i++) {
-            let sheetControl = stylesObj.cellXfs[i];
-            if (sheetControl.fontId == fontId && sheetControl.borderId == borderId) {
-                if (private_checkControl(cellControl, sheetControl)) {
-                    rst = i;
-                    hasStyle = true;
-                    break;
-                }
-            }
-        }
-        if (!hasStyle) {
-            let sheetControl = {};
-            sheetControl.fontId = fontId;
-            sheetControl.borderId = borderId;
-            for (let i = 0; i < JV.CONTROL_PROPS.length; i++) {
-                sheetControl[JV.CONTROL_PROPS[i]] = cellControl[JV.CONTROL_PROPS[i]];
-            }
-            stylesObj.cellXfs.push(sheetControl);
-            rst = stylesObj.cellXfs.length - 1;
-        }
-        return rst;
-    };
-    private_setCols = function(){
-        //remark: 1 excel width = 2.117 mm
-        rst.push('<cols>');
-        let w = 0;
-        for (let i = 1; i < xPos.length - 1; i++) {
-            w = 1.0 * (xPos[i + 1] - xPos[i]) / DPI * 25.4 / 2.117;
-            w = Math.round(w * 1000) / 1000;
-            rst.push('<col min="' + i +'" max="' + i +'" width="' + w + '" customWidth="1"/>');
-        }
-        rst.push('</cols>');
-    };
-    private_setMergedCells = function() {
-        let cell, idxR, idxL, idxT, idxB, cnt = 0;
-        rst.push('<mergeCells count="?">');
-        let startIdx = rst.length - 1;
-        for (let i = 0; i < sheetData.cells.length; i++) {
-            cell = sheetData.cells[i];
-            idxR = xPos.indexOf(cell[JV.PROP_AREA][JV.PROP_RIGHT]);
-            idxL = xPos.indexOf(cell[JV.PROP_AREA][JV.PROP_LEFT]);
-            idxB = yPos.indexOf(cell[JV.PROP_AREA][JV.PROP_BOTTOM]);
-            idxT = yPos.indexOf(cell[JV.PROP_AREA][JV.PROP_TOP]);
-            if (idxR - idxL > 1 || idxB - idxT > 1) {
-                rst.push('<mergeCell ref="' + private_getCellIdxStr(idxL - 1) + idxT + ':' + private_getCellIdxStr(idxR - 2) + (idxB - 1) + '"/>');
-                cnt++;
-            }
-        }
-        rst[startIdx] = '<mergeCells count="' + cnt + '">';
-        rst.push('</mergeCells>');
-    };
-    private_chkIfNeedCacheCell = function(cell){
-        let rst = false;
-        if (cell[JV.PROP_AREA][JV.PROP_LEFT] == pageData[JV.BAND_PROP_MERGE_BAND][JV.PROP_LEFT] ||
-            cell[JV.PROP_AREA][JV.PROP_RIGHT] == pageData[JV.BAND_PROP_MERGE_BAND][JV.PROP_RIGHT] ||
-            cell[JV.PROP_AREA][JV.PROP_TOP] == pageData[JV.BAND_PROP_MERGE_BAND][JV.PROP_TOP] ||
-            cell[JV.PROP_AREA][JV.PROP_BOTTOM] == pageData[JV.BAND_PROP_MERGE_BAND][JV.PROP_BOTTOM]){
-            if (cell[JV.PROP_AREA][JV.PROP_LEFT] >= pageData[JV.BAND_PROP_MERGE_BAND][JV.PROP_LEFT] &&
-                cell[JV.PROP_AREA][JV.PROP_RIGHT] <= pageData[JV.BAND_PROP_MERGE_BAND][JV.PROP_RIGHT] &&
-                cell[JV.PROP_AREA][JV.PROP_TOP] >= pageData[JV.BAND_PROP_MERGE_BAND][JV.PROP_TOP] &&
-                cell[JV.PROP_AREA][JV.PROP_BOTTOM] <= pageData[JV.BAND_PROP_MERGE_BAND][JV.PROP_BOTTOM]) {
-                rst = true;
-            }
-        }
-        return rst;
-    };
-    private_cacheMergeBandBorderIdxs = function() {
-        let cell, idxR, idxL, idxT, idxB;
-        for (let i = 0; i < sheetData.cells.length; i++) {
-            cell = sheetData.cells[i];
-            idxR = xPos.indexOf(cell[JV.PROP_AREA][JV.PROP_RIGHT]);
-            idxL = xPos.indexOf(cell[JV.PROP_AREA][JV.PROP_LEFT]);
-            idxB = yPos.indexOf(cell[JV.PROP_AREA][JV.PROP_BOTTOM]);
-            idxT = yPos.indexOf(cell[JV.PROP_AREA][JV.PROP_TOP]);
-            if (idxR - idxL > 1 || idxB - idxT > 1) {
-                if (private_chkIfNeedCacheCell(cell)) {
-                    for (let xi = idxL; xi < idxR; xi++) {
-                        for (let yj = idxT; yj < idxB; yj++) {
-                            cacheBorderCell[private_getCellIdxStr(xi - 1) + yj] = cell;
-                        }
-                    }
-                }
-            }
-        }
-    };
-    private_getMergedCellStyleId = function(preStyleId, colIdxStr) {
-        let rst = preStyleId;
-        if (cacheBorderCell[colIdxStr]) {
-            rst = private_getStyleId(cacheBorderCell[colIdxStr]);
-        }
-        return rst;
-    };
-    private_setSheetData = function(){
-        //remark: 1 excel height = 0.3612 mm
-        rst.push('<sheetData>');
-        let spanX = xPos.length - 2, cellIdx = 0, h = 0,
-            hasMoreCols = true, nextColIdx = -1,
-            nextRowIdx = yPos.indexOf(sheetData.cells[cellIdx][JV.PROP_AREA][JV.PROP_TOP])
-            ;
-        private_cacheMergeBandBorderIdxs();
-        for (let i = 1; i < yPos.length - 1; i++) {
-            h = 1.0 * (yPos[i+1] - yPos[i]) / DPI * 25.4 / 0.3612;
-            h = Math.round(h * 1000) / 1000;
-            rst.push('<row r="' + i + '" spans="1:' + spanX + '" ht="' + h + '" customHeight="1">');
-            //then put the cells of this row
-            let colIdxStr = '';
-            hasMoreCols = true;
-            while (nextRowIdx < i) {
-                if (cellIdx >= sheetData.cells.length || nextRowIdx > i) {
-                    break;
-                } else {
-                    cellIdx++;
-                    nextRowIdx = yPos.indexOf(sheetData.cells[cellIdx][JV.PROP_AREA][JV.PROP_TOP]);
-                }
-            }
-            if (nextRowIdx > i) {
-                hasMoreCols = false;
-            }
-            nextColIdx = xPos.indexOf(sheetData.cells[cellIdx][JV.PROP_AREA][JV.PROP_LEFT]);
-            let preStyleIdx = 1;
-            for (let j = 1; j < xPos.length - 1; j++) {
-                colIdxStr = private_getCellIdxStr(j - 1);
-                if (hasMoreCols) {
-                    if (nextColIdx == j) {
-                        let styleIdx = private_getStyleId(sheetData.cells[cellIdx]);
-                        preStyleIdx = styleIdx;
-                        if (strUtil.isEmptyString(sheetData.cells[cellIdx][JV.PROP_VALUE])) {
-                            rst.push('<c r="' + colIdxStr + i + '" s="' + styleIdx + '"/>');
-                            //should setup the right style instead!
-                        } else {
-                            let valIdx = private_getSharedStrIdx(sheetData.cells[cellIdx][JV.PROP_VALUE]);
-                            rst.push('<c r="' + colIdxStr + i + '" s="' + styleIdx + '" t="s">');
-                            rst.push('<v>' + valIdx + '</v>');
-                            rst.push('</c>');
-                        }
-                        cellIdx++;
-                        if (cellIdx < sheetData.cells.length) {
-                            nextRowIdx = yPos.indexOf(sheetData.cells[cellIdx][JV.PROP_AREA][JV.PROP_TOP]);
-                            if (nextRowIdx > i) {
-                                hasMoreCols = false;
-                            } else {
-                                nextColIdx = xPos.indexOf(sheetData.cells[cellIdx][JV.PROP_AREA][JV.PROP_LEFT]);
-                            }
-                        } else {
-                            hasMoreCols = false;
-                        }
-                    } else if (nextColIdx < 0) {
-                        //impossible!
-                        console.log('has abnormal case!');
-                        hasMoreCols = false;
-                    } else {
-                        //rst.push('<c r="' + colIdxStr + i + '" s="' + preStyleIdx + '"/>');
-                        rst.push('<c r="' + colIdxStr + i + '" s="' + private_getMergedCellStyleId(preStyleIdx, colIdxStr + i) + '"/>');
-                    }
-                } else {
-                    //rst.push('<c r="' + colIdxStr + i + '" s="' + preStyleIdx + '"/>');
-                    rst.push('<c r="' + colIdxStr + i + '" s="' + private_getMergedCellStyleId(preStyleIdx, colIdxStr + i) + '"/>');
-                }
-            }
-            rst.push('</row>');
-        }
-        //sheetData.cells.length
-        rst.push('</sheetData>');
-    };
-    private_pre_analyze_pos();
-    rst.push(dftHeadXml + '\r\n');
-    rst.push('<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">');
-    let colStr = private_getCellIdxStr(xPos.length - 3);
-    rst.push('<dimension ref="A1:' + colStr + '' + yPos.length + '"/>');
-    rst.push('<sheetViews><sheetView tabSelected="1" workbookViewId="0">');
-    rst.push('<selection sqref="A1:' + colStr + '1"/>');
-    rst.push('</sheetView></sheetViews>');
-    rst.push('<sheetFormatPr defaultRowHeight="13.5"/>');
-    private_setCols();
-    private_setSheetData();
-    private_setMergedCells();
-    rst.push('<phoneticPr fontId="1" type="noConversion"/>');
-    rst.push('<pageMargins left="0.315" right="0.215" top="0.315" bottom="0.315" header="0" footer="0"/>');
-    //rst.push('<pageSetup paperSize="9" fitToWidth="0" fitToHeight="0" orientation="landscape" horizontalDpi="300" verticalDpi="300"/>');
-    rst.push('<headerFooter alignWithMargins="0"/>');
-    rst.push('</worksheet>');
-    //rst.push('');
-    return rst;
-}
-
-module.exports = {
-    exportExcel: function (pageData, fName, options, callback) {
-        let rptOptions = (options || {singlePage: false, fileName: 'report'});
-        let sheets = [];
-        for (let i = 0; i < pageData.items.length; i++) {
-            sheets.push({sheetName: '第' + (i + 1) + '页'});
-        }
-        //1.
-        let file = '[Content_Types].xml';
-        let data = writeContentTypes(sheets);
-        let zip = new JSZip();
-        zip.file(file, data.join(''), {compression: 'DEFLATE'});
-        //2.
-        let zip_rels = zip.folder('_rels');
-        file = '.rels';
-        data = writeRootRels();
-        zip_rels.file(file, data.join(''), {compression: 'DEFLATE'});
-        //3.
-        let zip_docProps = zip.folder('docProps');
-        file = 'app.xml';
-        data = writeApp(sheets);
-        zip_docProps.file(file, data.join(''), {compression: 'DEFLATE'});
-        file = 'core.xml';
-        data = writeCore();
-        zip_docProps.file(file, data.join(''), {compression: 'DEFLATE'});
-        //4.
-        let zip_xl = zip.folder('xl');
-        file = 'workbook.xml';
-        data = writeXlWorkBook(sheets);
-        zip_xl.file(file, data.join(''), {compression: 'DEFLATE'});
-        let zip_rels2 = zip_xl.folder('_rels');
-        file = 'workbook.xml.rels';
-        data = writeXlRels(sheets);
-        zip_rels2.file(file, data.join(''), {compression: 'DEFLATE'});
-        //5.
-        let zip_theme = zip_xl.folder('theme');
-        file = 'theme1.xml';
-        data = writeTheme();
-        zip_theme.file(file, data, {compression: 'DEFLATE'});
-        //6.
-        let zip_worksheets = zip_xl.folder('worksheets');
-        let sharedStrList = [], stylesObj = {};
-        data = writeSheets(pageData, sharedStrList, stylesObj);
-        for (let i = 0; i < data.length; i++) {
-            file = 'sheet' + (i + 1) + '.xml';
-            zip_worksheets.file(file, data[i].join(''), {compression: 'DEFLATE'});
-        }
-        file = 'sharedStrings.xml';
-        data = writeSharedString(sharedStrList);
-        zip_xl.file(file, data.join(''), {compression: 'DEFLATE'});
-        file = 'styles.xml';
-        data = writeStyles(stylesObj);
-        zip_xl.file(file, data.join(''), {compression: 'DEFLATE'});
-
-        if (fName) {
-            let newName = '' + (new Date()).valueOf();
-            zip.generateNodeStream({type:'nodebuffer',streamFiles:true})
-                .pipe(fs.createWriteStream(__dirname.slice(0, __dirname.length - 21) + '/tmp/' + newName + '.xlsx'))
-                .on('finish', function () {
-                    // JSZip generates a readable stream with a "end" event,
-                    // but is piped here in a writable stream which emits a "finish" event.
-                    console.log(newName + ".xlsx was written.");
-                    if (callback) callback(newName);
-                }
-            );
-        } else {
-            //return zip.generateNodeStream({type:'nodebuffer',streamFiles:true});
-            return zip;
-        }
-    }
-}

+ 0 - 36
modules/reports/util/rpt_util.js

@@ -1,36 +0,0 @@
-/**
- * Created by Tony on 2017/3/24.
- */
-let cache = require('../../../public/cache/cacheUtil');
-let cmn_ctrl = require('../models/cfg_control');
-let cmn_font = require('../models/cfg_font');
-let cmn_style = require('../models/cfg_style');
-
-const RPT_CFG_GRP = 'rpt_cfg';
-
-module.exports = {
-    setReportDefaultCache: function () {
-        cmn_ctrl.getAll(null, function(err, ctrls){
-            if (ctrls) {
-                cache.setCache(RPT_CFG_GRP,'common_ctrls',ctrls);
-            }
-        });
-        cmn_font.getAll(null, function(err, fonts){
-            if (fonts) {
-                cache.setCache(RPT_CFG_GRP,'common_fonts',fonts);
-            }
-        });
-        cmn_style.getAll(null, function(err, styles){
-            if (styles) {
-                cache.setCache(RPT_CFG_GRP,'common_styles',styles);
-            }
-        });
-    },
-    getReportDefaultCache: function () {
-        let rst = {ctrls: null, fonts: null, styles: null};
-        rst.ctrls = cache.getCache(RPT_CFG_GRP,'common_ctrls');
-        rst.fonts = cache.getCache(RPT_CFG_GRP,'common_fonts');
-        rst.styles = cache.getCache(RPT_CFG_GRP,'common_styles');
-        return rst;
-    }
-}

+ 0 - 123
operation.js

@@ -1,123 +0,0 @@
-let express = require('express');
-
-let config = require("./config/config.js");
-config.setToQaDb();
-//config.setupCache();
-let cfgCacheUtil = require("./config/cacheCfg");
-cfgCacheUtil.setupDftCache();
-
-let path = require('path');
-let session = require('express-session');
-let DBStore = require('connect-mongo')(session);
-
-let URL = require('url')
-
-let app = express();
-let _rootDir = __dirname;
-
-app.use(express.static(_rootDir));
-
-app.set('views', path.join(__dirname, 'web'));
-app.engine('.html', require('ejs').__express);
-app.set('view engine', 'html');
-
-let bodyParser = require('body-parser');
-app.use(bodyParser.urlencoded({extended: false}));
-app.use(bodyParser.json());
-
-app.use(session({
-    name: 'usersSession',
-    secret: 'session users secret',
-    cookie: {maxAge: 1000*60*30},
-    resave: false,
-    saveUninitialized: true
-    //*
-    ,store: new DBStore({
-        url: 'mongodb://' + config.current.server + ':' + config.current.port + '/usersManagesOpr'
-    })
-    //*/
-}));
-
-app.use(function (req, res, next) {
-    let url = req.originalUrl, referer;
-    if (!/^\/login/.test(req.originalUrl) && !req.session.userAccount) {
-        if (/\/api/.test(req.originalUrl)) {
-            referer = URL.parse(req.headers.referer);
-            return res.redirect('/login' + '?referer=' + referer.path);
-        } else {
-            return res.redirect("/login" + '?referer=' + req.originalUrl);
-        }
-    }
-    next();
-});
-
-app.use('/', require('./modules/users/routes/users_route'));
-
-let rpt_Router = require("./modules/reports/routes/report_router");
-app.get('/report',  function(req, res) {
-    if (!req.session.userAccount) {
-        res.redirect('/login');
-    }
-    else {
-        res.render('maintain/report/rpt_test.html',
-            {userAccount: req.session.userAccount,
-                userID: req.session.userID});
-    }
-});
-app.use("/report_api", rpt_Router);
-
-let rptTpl_Router = require("./modules/reports/routes/rpt_tpl_router");
-app.get('/rpt_tpl',  function(req, res) {
-    if (!req.session.userAccount) {
-        res.redirect('/login');
-    }
-    else {
-        res.render('maintain/report/rpt_tpl_main.html',
-            {userAccount: req.session.userAccount,
-                userID: req.session.userID});
-    }
-});
-app.use("/report_tpl_api", rptTpl_Router);
-
-let rationRepository_Router = require("./modules/ration_repository/routes/ration_rep_routes");
-app.get('/rationRepository/main', function(req, res) {
-    res.render('maintain/ration_repository/main.html',
-        {
-            userAccount: req.session.userAccount,
-            userID: req.session.userID
-        });
-});
-app.get('/rationRepository/ration', function(req, res) {
-    res.render('maintain/ration_repository/dinge.html',
-        {
-            userAccount: req.session.userAccount,
-            userID: req.session.userID
-        });
-});
-app.get('/rationRepository/lmm', function(req, res) {
-    res.render('maintain/ration_repository/gongliao.html',
-        {
-            userAccount: req.session.userAccount,
-            userID: req.session.userID
-        });
-});
-
-app.get('/rationRepository/coeList', function(req, res) {
-    res.render('maintain/ration_repository/fuzhu.html',
-        {
-            userAccount: req.session.userAccount,
-            userID: req.session.userID
-        });
-});
-
-app.use("/rationRepository/api",rationRepository_Router);
-
-
-app.use(function(req, res, next) {
-    res.status(404).send('404 Error');
-});
-app.use(function(err, req, res, next) {
-    console.error(err.stack);
-    res.status(500).send('500 Error');
-});
-app.listen(6080);

+ 5 - 3
modules/reports/rpt_component/jpc_value_define.js

@@ -1,4 +1,7 @@
-let JV = {
+/**
+ * Created by Tony on 2017/6/7.
+ */
+var JV = {
     NODE_CROSS_INFO: "交叉表_信息",
     NODE_CROSS_ROW: "交叉行",
     NODE_CROSS_COL: "交叉列",
@@ -27,6 +30,7 @@ let JV = {
     PROP_MULTI_COLUMN: "多列显示数量",
 
     NODE_MAIN_INFO: "主信息",
+    NODE_MAIN_INFO_RPT_NAME: "报表名称",
     NODE_PAGE_INFO: "打印页面_信息",
     NODE_MARGINS: "页边距",
 
@@ -193,5 +197,3 @@ let JV = {
 
     LAST_DEF: ""
 }
-
-module.exports = JV;

+ 4 - 5
server.js

@@ -140,9 +140,6 @@ let billsLibRouter = require("./modules/bills_lib/routes/bills_lib_routes");
 app.use("/stdBillsEditor", billsLibRouter);
 //-----------------
 
-let rationRepository_Router = require("./modules/ration_repository/routes/ration_rep_routes");
-app.use("/rationRepository/api",rationRepository_Router);
-
 app.use(function(req, res, next) {
 	res.status(404).send('404 Error');
 });
@@ -150,6 +147,8 @@ app.use(function(err, req, res, next) {
     console.error(err.stack);
     res.status(500).send('500 Error');
 });
-app.listen(6060, function () {
-    console.log('server start');
+app.listen(6060, function(){
+    console.log('server started!');
 });
+
+

+ 0 - 274
web/maintain/bills_lib/css/main.css

@@ -1,274 +0,0 @@
-/*building SAAS 0.1*/
-/*bootstrap 初始化*/
-body {
-    font-size: 0.9rem;
-    overflow: hidden;
-}
-.dropdown-menu {
-    font-size: 0.9rem
-}
-/*自定义css*/
-.header {
-    background: #e1e1e1
-}
-.header .header-logo {
-    background: #ff6501;
-    color: #fff;
-    float: left;
-    padding-top: .25rem;
-    padding-bottom: .25rem;
-    margin-right: 1rem;
-    font-size: 1.25rem;
-    line-height: inherit
-}
-.top-msg{
-  position: fixed;
-  top:0;
-  width:100%;
-  z-index: 999
-}
-.in-1{padding-left:0px!important}
-.in-2{padding-left:21px!important}
-.in-3{padding-left:42px!important}
-.in-4{padding-left:63px!important}
-.in-5{padding-left:84px!important}
-.in-6{padding-left:105px!important}
-.main {
-    position: relative;
-    background: #f7f7f9;
-}
-.main-nav {
-    position: absolute;
-    text-align: center;
-    z-index: 999;
-    padding: 2px 0 0 2px
-}
-.main-nav .nav a {
-    display: block;
-    width: 28px;
-    text-align: center;
-    line-height: 18px;
-    color: #999;
-    padding: 10px 0;
-    border-right: 1px solid #ccc;
-}
-.main-nav .nav a:hover {
-    background: #fff;
-    color: #333;
-    text-decoration: none;
-}
-.main-nav .nav a.active {
-    border: 1px solid #ccc;
-    border-right: 1px solid #fff;
-    background: #fff;
-    color: #333
-}
-.main-nav .nav-tabs{
-  border-bottom: none
-}
-.content {
-    border-left: 1px solid #ccc;
-    margin-left: 29px;
-    background: #fff
-}
-.tools-btn {
-    height: 30px;
-    line-height: 30px;
-}
-.toolsbar .tools-btn.btn:hover {
-    background: #f7f7f9;
-}
-.main-side {
-    border-top: 1px solid #ccc;
-    border-left: 1px solid #ccc;
-    overflow-y: hidden;
-}
-.sidebar-bottom,.sidebar-bottom .col-lg-6,.sidebar-bottom .col-lg-12 {
-  height:200px
-}
-.top-content, .fluid-content {
-    overflow: auto;
-    border-bottom: 1px solid #ccc;
-}
-.bottom-content .nav {
-    background: #f7f7f9;
-    padding:0 0 0 2px
-}
-.bottom-content .nav-tabs .nav-link, .side-tabs .nav-tabs .nav-link {
-    border-radius: 0;
-    padding: 0.2em 0.5em
-}
-.side-tabs .nav-tabs .nav-item {
-  z-index: 999
-}
-.side-tabs .nav-tabs {
-    border-bottom: none;
-    margin-bottom: -1px
-}
-.side-tabs .nav-tabs .nav-link {
-    border-radius: 0;
-    padding: 0em 0.5em;
-    line-height: 30px;
-    z-index: 999
-}
-.bottom-content .nav-tabs .nav-link.active {
-    border-top: 1px solid #f7f7f9
-}
-.side-tabs .nav-tabs .nav-link.active {
-    border-top: none;
-    border-bottom:1px solid #fff
-}
-.side-tabs a.active, .sub-nav a.active {
-    background: #ccc
-}
-.poj-manage {
-    background: #fff
-}
-.slide-sidebar {
-    border-left: 1px solid #E1E1E1;
-    box-shadow: 0px 15px 15px rgba(0, 0, 0, 0.1);
-    background: none repeat scroll 0% 0% #ffffff;
-    overflow: hidden;
-    position: absolute;
-    right: 0px;
-    top: 0;
-    z-index: 999;
-    width: 0px;
-}
-.new-msg {
-    -webkit-animation: tada 1s infinite .2s ease both;
-    -moz-animation: tada 1s infinite .2s ease both;
-}
-@-webkit-keyframes tada {
-    0% {
-        -webkit-transform: scale(1)
-    }
-    10%, 20% {
-        -webkit-transform: scale(0.9) rotate(-3deg)
-    }
-    30%, 50%, 70%, 90% {
-        -webkit-transform: scale(1.1) rotate(3deg)
-    }
-    40%, 60%, 80% {
-        -webkit-transform: scale(1.1) rotate(-3deg)
-    }
-    100% {
-        -webkit-transform: scale(1) rotate(0)
-    }
-}
-@-moz-keyframes tada {
-    0% {
-        -moz-transform: scale(1)
-    }
-    10%, 20% {
-        -moz-transform: scale(0.9) rotate(-3deg)
-    }
-    30%, 50%, 70%, 90% {
-        -moz-transform: scale(1.1) rotate(3deg)
-    }
-    40%, 60%, 80% {
-        -moz-transform: scale(1.1) rotate(-3deg)
-    }
-    100% {
-        -moz-transform: scale(1) rotate(0)
-    }
-}
-.has-danger {
-    -webkit-animation: shake 1s .2s ease both;
-    -moz-animation: shake 1s .2s ease both;
-    animation: shake 1s .2s ease both;
-}
-@-webkit-keyframes shake {
-    0%, 100% {
-        -webkit-transform: translateX(0);
-    }
-    10%, 30%, 50%, 70%, 90% {
-        -webkit-transform: translateX(-10px);
-    }
-    20%, 40%, 60%, 80% {
-        -webkit-transform: translateX(10px);
-    }
-}
-@-moz-keyframes shake {
-    0%, 100% {
-        -moz-transform: translateX(0);
-    }
-    10%, 30%, 50%, 70%, 90% {
-        -moz-transform: translateX(-10px);
-    }
-    20%, 40%, 60%, 80% {
-        -moz-transform: translateX(10px);
-    }
-}
-@keyframes shake {
-    0%, 100% {
-        transform: translateX(0);
-    }
-    10%, 30%, 50%, 70%, 90% {
-        transform: translateX(-10px);
-    }
-    20%, 40%, 60%, 80% {
-        transform: translateX(10px);
-    }
-}
-.bottom-content .tab-content .main-data-bottom{
-    height: 200px;
-    overflow: auto;
-}
-.bottom-content .tab-content .ovf-hidden{
-    overflow: hidden;
-}
-.form-signin {
-    max-width: 500px;
-    margin: 150px auto;
-}
-.poj-list, .side-content {
-    overflow: auto;
-}
-.poj-list span.poj-icon {
-  padding-right:7px;
-  color:#ccc
-}
-.poj-list a.tree-open,.poj-list a.tree-close{
-  width:15px;
-  display: inline-block;
-}
-.print-toolsbar{
-  padding:5px
-}
-.print-toolsbar .panel {
-  display:inline-block;
-  vertical-align:top;
-  background:#f7f7f9
-}
-.print-toolsbar .panel .panel-foot{
-  text-align: center;
-  font-size: 12px
-}
-.print-list {
-  border-right:1px solid #ccc
-}
-.print-list .form-list {
-  overflow: auto
-}
-.print-list .list-tools{
-  height:50px;
-  padding:10px 0;
-  border-bottom:1px solid #f2f2f2
-}
-.pageContainer {
-  background: #ededed;
-  text-align: center
-}
-.pageContainer .page{
-  border:9px solid transparent;
-  display: inline-block;
-}
-.pageContainer .page img{
-  width:inherit;
-  height: inherit;
-}
-.modal-fixed-height {
-  height: 400px;
-  overflow-y: auto;
-}

+ 0 - 177
web/maintain/bills_lib/html/main.html

@@ -1,177 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>清单规则编辑器</title>
-    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
-    <link rel="stylesheet" href="/web/maintain/bills_lib/css/main.css">
-    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
-</head>
-
-<body>
-    <div class="header">
-        <nav class="navbar navbar-toggleable-lg navbar-light bg-faded p-0 ">
-            <span class="header-logo px-2">清单规则编辑器</span>
-            <div class="navbar-text"></div>
-        </nav>
-        <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
-          <ul class="nav navbar-nav px-1">
-                          <li class="nav-item">
-                              <a class="nav-link" href="javascript:void(0);" aria-haspopup="true" aria-expanded="false" data-toggle="modal" data-target="#add">新建清单规则</a>
-                          </li>
-                      </ul>
-        </nav>
-    </div>
-    <div class="main">
-        <div class="content">
-            <div class="container-fluid">
-                <div class="row">
-                  <div class="col-md-8">
-                    <div class="warp-p2 mt-3">
-                      <table class="table table-hover table-bordered">
-                        <thead><tr><th>清单规则名称</th><th width="160">添加时间</th><th width="90">操作</th></tr></thead>
-                        <tbody id="showArea">
-                          <!--<tr><td><a href="qingdan.html">XX清单规则</a></td><td>2017-01-01 </td><td><a href="javacript:void(0);" data-toggle="modal" data-target="#edit" title="编辑"><i class="fa fa-pencil-square-o"></i></a> <a href="javacript:void(0);" data-toggle="modal" data-target="#del" class="text-danger" title="删除"><i class="fa fa-remove"></i></a></td></tr>
-                          <tr><td><a href="qingdan.html">XX清单规则</a></td><td>2017-01-01 </td><td><a href="javacript:void(0);" data-toggle="modal" data-target="#edit" title="编辑"><i class="fa fa-pencil-square-o"></i></a> <a href="javacript:void(0);" data-toggle="modal" data-target="#del" class="text-danger" title="删除"><i class="fa fa-remove"></i></a></td></tr>
-                          <tr><td><a href="qingdan.html">XX清单规则</a></td><td>2017-01-01 </td><td><a href="javacript:void(0);" data-toggle="modal" data-target="#edit" title="编辑"><i class="fa fa-pencil-square-o"></i></a> <a href="javacript:void(0);" data-toggle="modal" data-target="#del" class="text-danger" title="删除"><i class="fa fa-remove"></i></a></td></tr>-->
-                        </tbody>
-                      </table>
-                    </div>
-                  </div>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!--弹出添加-->
-    <div class="modal fade" id="add" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">添加清单规则</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>清单规则名称</label>
-                      <input id="createText" class="form-control" placeholder="输入清单规则名称" type="text">
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a id="createA"  href="javascript:void(0);" class="btn btn-primary" data-dismiss="modal">新建</a>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!--弹出编辑-->
-    <div class="modal fade" id="edit" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">编辑清单规则</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>清单规则名称</label>
-                      <input id="renameText" class="form-control" placeholder="输入名称" type="text" value="">
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a id="renameA" href="javascript: void(0);" class="btn btn-primary" data-dismiss="modal" renameId="">确定</a>
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <!--弹出删除-->
-    <div class="modal fade" id="del" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">删除确认</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                    <h5 class="text-danger">删除后无法恢复,确认是否删除?</h5>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a id="deleteA" href="javascript:void(0);" class="btn btn-danger" data-dismiss="modal" deleteId="">删除</a>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!-- JS. -->
-    <script src="/lib/jquery/jquery.min.js"></script>
-    <script src="/lib/tether/tether.min.js"></script>
-    <script src="/lib/bootstrap/bootstrap.min.js"></script>
-    <script src="/web/maintain/js/global.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/bills_lib_ajax.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/tools.js"></script>
-
-</body>
-<script type="text/javascript">
-    autoFlashHeight();
-</script>
-<script>
-    var userId = '<%= userID %>';
-    var userAccount = '<%= userAccount %>';
-    mainAjax.getStdBillsLib(userId);
-    $(document).ready(function(){
-        //main 增删改
-        $("#createA").click(function(){
-            var billsLibName = $("#createText").val();
-            if(billsLibName){
-                mainAjax.createStdBillsLib(userId, billsLibName);
-                $("#createText").val("");
-            }
-            else{
-                alert("请输入清单规则名称!");
-            }
-        });
-
-       $("#showArea").on("click", "[data-target = '#del']", function(){
-            var deleteId = $(this).parent().parent().attr("id")
-           $("#deleteA").attr("deleteId", deleteId);
-       });
-        $("#deleteA").click(function(){
-            var deleteId = $(this).attr("deleteId");
-            mainAjax.deleteStdBillsLib(deleteId);
-        });
-
-       $("#showArea").on("click", "[data-target = '#edit']", function(){
-           var renameId = $(this).parent().parent().attr("id");
-           $("#renameA").attr("renameId", renameId);
-
-       });
-
-        $("#renameA").click(function(){
-            var newName = $("#renameText").val();
-            var renameId = $(this).attr("renameId");
-            if(newName){
-                mainAjax.renameStdBillsLib(renameId, newName);
-                $("#renameText").val("");
-            }
-            else {
-                alert("请输入名称!");
-            }
-        });
-    });
-</script>
-
-</html>

+ 0 - 243
web/maintain/bills_lib/html/neirong.html

@@ -1,243 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>清单规则编辑器</title>
-    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
-    <!--<link rel="stylesheet" href="../../web/css/bootstrap/themes.css">-->
-    <link rel="stylesheet" href="/web/maintain/bills_lib/css/main.css">
-    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
-    <!--spread-->
-    <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.excel2013white.10.0.1.css">
-    <!--zTree-->
-    <link rel="stylesheet" href="/lib/ztree/css/zTreeStyle.css" type="text/css">
-</head>
-
-<body>
-    <div class="header">
-        <nav class="navbar navbar-toggleable-lg navbar-light bg-faded p-0 ">
-            <span class="header-logo px-2">清单规则编辑器</span>
-            <div class="navbar-text"></div>
-        </nav>
-        <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
-
-              <ul class="nav nav-tabs" role="tablist">
-                  <li class="nav-item">
-                      <a id="aStdBills" class="nav-link px-3" href="stdBills">清单</a>
-                  </li>
-                  <li class="nav-item">
-                      <a class="nav-link active px-3" href="javascript: void(0);">工作内容</a>
-                  </li>
-                  <li class="nav-item">
-                      <a id="aStdItems" class="nav-link px-3" href="stdItems">项目特征</a>
-                  </li>
-              </ul>
-        </nav>
-    </div>
-    <div class="main">
-      <div class="content">
-        <div class="container-fluid">
-          <div class="row">
-            <div class="main-content col-lg-7 p-0">
-                <nav class="tools-bar">
-                </nav>
-                <div class="main-data" id="spreadAllJobs">
-                </div>
-            </div>
-            <div class="main-side col-lg-5 p-0">
-            </div>
-          </div>
-        </div>
-      </div>
-    </div>
-    <!--弹出添加-->
-    <div class="modal fade" id="add" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">添加定额</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>编码</label>
-                      <input class="form-control" placeholder="输入编码" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>名称</label>
-                      <input class="form-control" placeholder="输入名称" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>单位</label>
-                      <select class="form-control"><option>选择单位</option><option>m3</option></select>
-                    </div>
-                    <div class="form-group">
-                      <label>基价</label>
-                      <input class="form-control" placeholder="输入基价" type="number">
-                    </div>
-                    <div class="form-group">
-                      <label>显示名称(以%s表示参数)</label>
-                      <input class="form-control" placeholder="输入显示名称" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>默认取费专业</label>
-                      <input class="form-control" placeholder="输入取费专业" type="text">
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-primary">添加</a>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!--弹出编辑-->
-    <div class="modal fade" id="edit" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">编辑定额</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>编码</label>
-                      <input class="form-control" placeholder="输入编码" type="text" value="AA0001">
-                    </div>
-                    <div class="form-group">
-                      <label>名称</label>
-                      <input class="form-control" placeholder="输入名称" type="text" value="人工挖土方">
-                    </div>
-                    <div class="form-group">
-                      <label>单位</label>
-                      <select class="form-control"><option>m3</option></select>
-                    </div>
-                    <div class="form-group">
-                      <label>基价</label>
-                      <input class="form-control" placeholder="输入基价" type="number" value="880.84">
-                    </div>
-                    <div class="form-group">
-                      <label>显示名称(以%s表示参数)</label>
-                      <input class="form-control" placeholder="输入显示名称" type="text" value="人工挖土方">
-                    </div>
-                    <div class="form-group">
-                      <label>默认取费专业</label>
-                      <input class="form-control" placeholder="输入取费专业" type="text" value="1">
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-primary">确定</a>
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <!--弹出删除-->
-    <div class="modal fade" id="del" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">删除确认</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                    <h5 class="text-danger">删除后无法恢复,确认是否删除?</h5>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-danger">删除</a>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!-- JS. -->
-    <script src="/lib/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
-    <script src="/lib/jquery/jquery.min.js"></script>
-    <script src="/lib/tether/tether.min.js"></script>
-    <script src="/lib/bootstrap/bootstrap.min.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/global.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/set_sheets.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/bills_lib_ajax.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/tools.js"></script>
-    <script src="/public/web/tree_sheet/tree_sheet_helper.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/bills_lib_setting.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/db_controller.js"></script>
-    <SCRIPT type="text/javascript">
-        var billsLibId = getQueryString("billsLibId");
-        tools.redirect(billsLibId, 'stdBillsmain');
-        var spreadAllJobs = new GC.Spread.Sheets.Workbook($('#spreadAllJobs')[0], {sheetCount: 1});
-        var orgJobData;
-        var maxJobNumer;
-        $(document).ready(function(){
-            $('#aStdBills').attr('href', function(){
-                return 'stdBills?billsLibId=' + billsLibId;
-            });
-            $('#aStdItems').attr('href', function(){
-                return 'stdItems?billsLibId=' + billsLibId;
-            });
-            billsAjax.getStdBillsLibName(billsLibId);
-            buildAllJobs(spreadAllJobs, totalJobsSetting);
-        });
-        function buildAllJobs(spreadAllJobs, setting){
-            setSheet.initSheet(spreadAllJobs, setting);
-            myKey.downKey(spreadAllJobs);
-            myKey.enterKey(spreadAllJobs);
-            TREE_SHEET_HELPER.loadSheetHeader(setting, spreadAllJobs.getActiveSheet());
-            jobsAjax.getJobContent(billsLibId, function(datas){
-                spreadAllJobs.getActiveSheet().suspendPaint();
-                var len = datas.length;
-                for(var i=0; i<len; i++){
-                    setting.cols.forEach(function(col, colIdx){
-                        spreadAllJobs.getActiveSheet().setTag(i, colIdx, datas[i].id, GC.Spread.Sheets.SheetArea.viewport);
-                        if(datas[i][col.data.field]){
-                            spreadAllJobs.getActiveSheet().getCell(i, colIdx, GC.Spread.Sheets.SheetArea.viewport).value(datas[i][col.data.field]);
-                        }
-                        else {
-                            spreadAllJobs.getActiveSheet().getCell(i, colIdx, GC.Spread.Sheets.SheetArea.viewport).value('');
-                        }
-                    });
-                }
-                spreadAllJobs.getActiveSheet().resumePaint();
-                var totalJobs = createObj.newJobs();
-                totalJobs.loadJobs(null, datas);
-                tools.getBillsIds(function(ids){
-                    myKey.delKey(spreadAllJobs, ids, totalJobs, setting, 'totalJobs');
-                    bindSheet(totalJobs, spreadAllJobs.getActiveSheet(), setting);
-                });
-            });
-        }
-        function bindSheet(totalJobs, sheet, setting){
-            mainAjax.getMaxNumber(billsLibId, 'jobs', function(result){
-                if(result.length === 0){
-                    maxJobsNumber = 0;
-                }
-                else {
-                    maxJobsNumber = result[0].code;
-                }
-                orgJobData = sheet.getCell(0, 0).value();
-                totalJobsController.eiditData(totalJobs, sheet, setting);
-            });
-        }
-
-
-  	</SCRIPT>
-</body>
-<script type="text/javascript">
-    autoFlashHeight();
-</script>
-
-</html>

+ 0 - 490
web/maintain/bills_lib/html/qingdan.html

@@ -1,490 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>清单规则编辑器</title>
-    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
-    <link rel="stylesheet" href="/web/maintain/bills_lib/css/main.css">
-    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
-    <!--spread-->
-    <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.excel2013white.10.0.1.css">
-</head>
-
-<body>
-    <div class="header">
-        <nav class="navbar navbar-toggleable-lg navbar-light bg-faded p-0 ">
-            <span class="header-logo px-2">清单规则编辑器</span>
-            <div class="navbar-text"></div>
-        </nav>
-        <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
-
-              <ul class="nav nav-tabs" role="tablist">
-                  <li class="nav-item">
-                      <a class="nav-link active px-3" href="javascript: void(0);">清单</a>
-                  </li>
-                  <li class="nav-item">
-                      <a id="aStdJobs" class="nav-link px-3" href="stdJobs">工作内容</a>
-                  </li>
-                  <li class="nav-item">
-                      <a id="aStdItems" class="nav-link px-3" href="stdItems">项目特征</a>
-                  </li>
-              </ul>
-        </nav>
-    </div>
-    <div class="main">
-      <div class="content" >
-        <div class="container-fluid">
-          <div class="row">
-            <div class="main-content col-lg-7 p-0">
-                <nav class="navbar sticky-top navbar-toggleable-md navbar-light bg-faded tools-bar">
-                  <div class="collapse navbar-collapse" id="navbarNav">
-                      <ul class="navbar-nav">
-                          <li class="nav-item">
-                              <a class="nav-link text-primary" id="insert" href="javascript: void(0);"><i class="fa fa-share" aria-hidden="true"></i>插入</a>
-                          </li>
-                          <li class="nav-item">
-                              <a class="nav-link text-primary" id ="delete" href="javascript:void (0)"><i class="fa fa-remove" aria-hidden="true"></i>删除</a>
-                          </li>
-                          <li class="nav-item">
-                              <a class="nav-link text-primary" id="upLevel"  href="javascript: void(0);"><i class="fa fa-arrow-left" aria-hidden="true"></i>升级</a>
-                          </li>
-                          <li class="nav-item">
-                              <a class="nav-link text-primary" id="downLevel" href="javascript: void(0);"><i class="fa fa-arrow-right" aria-hidden="true"></i>降级</a>
-                          </li>
-                          <li class="nav-item">
-                              <a class="nav-link text-primary" id="upMove" href="javascript: void(0);"><i class="fa fa-arrow-up" aria-hidden="true"></i>上移</a>
-                          </li>
-                          <li class="nav-item">
-                              <a class="nav-link text-primary" id="downMove" href="javascript: void(0);"><i class="fa fa-arrow-down" aria-hidden="true"></i>下移</a>
-                          </li>
-                      </ul>
-                  </div>
-                </nav>
-                <div class="main-data" id="spreadBills">
-                </div>
-            </div>
-            <div class="main-side col-lg-5 p-0">
-              <div class="container-fluid">
-                <div class="row">
-                  <div class="col" style="width:50%; height: 100%">
-                      <h5>工作内容</h5>
-                      <div id="spreadJobs"  style="width:97%; height: 300px;"></div>
-                  </div>
-                  <div class="col" style="width:50%; height: 100%">
-                    <h5>项目特征</h5>
-                      <div id="spreadItems" style="width: 97%; height: 300px;"></div>
-                  </div>
-                  <div class="w-100"></div>
-                  <div class="col">
-                    <div class="form-group">
-                      <label for="exampleTextarea"><h5>补注:</h5></label>
-                      <textarea class="form-control" id="exampleTextarea" rows="8"></textarea>
-                    </div>
-                  </div>
-                </div>
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-    </div>
-    <!--弹出添加-->
-    <div class="modal fade" id="add" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">添加定额</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>编码</label>
-                      <input class="form-control" placeholder="输入编码" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>名称</label>
-                      <input class="form-control" placeholder="输入名称" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>单位</label>
-                      <select class="form-control"><option>选择单位</option><option>m3</option></select>
-                    </div>
-                    <div class="form-group">
-                      <label>基价</label>
-                      <input class="form-control" placeholder="输入基价" type="number">
-                    </div>
-                    <div class="form-group">
-                      <label>显示名称(以%s表示参数)</label>
-                      <input class="form-control" placeholder="输入显示名称" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>默认取费专业</label>
-                      <input class="form-control" placeholder="输入取费专业" type="text">
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-primary">添加</a>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!--弹出编辑-->
-    <div class="modal fade" id="edit" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">编辑定额</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>编码</label>
-                      <input class="form-control" placeholder="输入编码" type="text" value="AA0001">
-                    </div>
-                    <div class="form-group">
-                      <label>名称</label>
-                      <input class="form-control" placeholder="输入名称" type="text" value="人工挖土方">
-                    </div>
-                    <div class="form-group">
-                      <label>单位</label>
-                      <select class="form-control"><option>m3</option></select>
-                    </div>
-                    <div class="form-group">
-                      <label>基价</label>
-                      <input class="form-control" placeholder="输入基价" type="number" value="880.84">
-                    </div>
-                    <div class="form-group">
-                      <label>显示名称(以%s表示参数)</label>
-                      <input class="form-control" placeholder="输入显示名称" type="text" value="人工挖土方">
-                    </div>
-                    <div class="form-group">
-                      <label>默认取费专业</label>
-                      <input class="form-control" placeholder="输入取费专业" type="text" value="1">
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-primary">确定</a>
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <!--弹出删除-->
-    <div class="modal fade" id="del" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">删除确认</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                    <h5 class="text-danger">删除后无法恢复,确认是否删除?</h5>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-danger">删除</a>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!--弹出提示窗口-->
-    <div class="modal fade" id="qAlert" style="display: none; margin: 300px auto; width: 300px; height: 200px;">
-        <div id="alertText"></div>
-        <div style="margin: 50px auto">
-            <button id="alertBtn" class="btn btn-warning">确定</button>
-        </div>
-    </div>
-    <!-- JS. -->
-    <script src="/lib/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
-    <script src="/lib/jquery/jquery.min.js"></script>
-    <script src="/lib/tether/tether.min.js"></script>
-    <script src="/lib/bootstrap/bootstrap.min.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/global.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/set_sheets.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/bills_lib_ajax.js"></script>
-    <!--idTree-->
-    <script src="/public/web/id_tree.js"></script>
-    <script src="/public/web/tree_sheet/tree_sheet_controller.js"></script>
-    <script src="/public/web/tree_sheet/tree_sheet_helper.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/bills_lib_setting.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/bills_lib_tree.js"></script>
-    <script src="/test/tmp_data/bills_grid_setting.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/db_controller.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/tools.js"></script>
-</body>
-<script type="text/javascript">
-    autoFlashHeight();
-    var maxJobsNumber;
-    var maxItemsNumber;
-    var orgJobData;
-    var orgItemData;
-    var billsTree = billsLibTree.createBillsTree();
-    var billsLibId = getQueryString("billsLibId");
-    tools.redirect(billsLibId, 'stdBillsmain');
-    var jobsSpread = new GC.Spread.Sheets.Workbook($("#spreadJobs")[0], {sheetCount: 1});
-    var itemsSpread = new GC.Spread.Sheets.Workbook($("#spreadItems")[0], {sheetCount: 1});
-    $(document).ready(function(){
-        $("#aStdJobs").attr('href', function(){
-            return 'stdJobs?billsLibId=' + billsLibId;
-        });
-        $('#aStdItems').attr('href', function(){
-            return 'stdItems?billsLibId=' + billsLibId;
-        });
-        billsAjax.getStdBillsLibName(billsLibId);
-        billsAjax.getBills(billsLibId, function(bills){
-            showBillsSheet(bills, jobsSpread.getActiveSheet(), itemsSpread.getActiveSheet(), billsLibSetting)
-        });
-        buildJobs(jobsSpread, jobsSetting);
-        buildItems(itemsSpread, itemsSetting);
-    });
-
-    function nodeOpration(controller, totalJobs, totalItems){
-        dbController.editData(controller, controller.sheet);
-        $('#insert').click(function(){
-            dbController.insert(controller);
-            tools.clearData(jobsSpread.getActiveSheet());
-            tools.clearData(itemsSpread.getActiveSheet());
-        });
-        $('#delete').click(function(){
-            dbController.delete(controller, totalJobs, totalItems);
-        });
-        $('#upLevel').click(function(){
-            dbController.upLevel(controller);
-        });
-        $('#downLevel').click(function(){
-           dbController.downLevel(controller);
-        });
-        $('#upMove').click(function(){
-            dbController.upMove(controller);
-        });
-        $('#downMove').click(function(){
-            dbController.downMove(controller);
-        });
-    }
-
-
-    function showBillsSheet(datas, jobsSheet, itemsSheet, setting) {
-        var billsSpread = new GC.Spread.Sheets.Workbook($('#spreadBills')[0], {sheetCount: 1});
-        setSheet.initSheet(billsSpread, setting);
-        myKey.delKey(billsSpread);
-        billsTree.loadDatas(datas);
-        //粘贴事件
-        bindPasteBills(billsSpread.getActiveSheet(), setting);
-        var controller = TREE_SHEET_CONTROLLER.createNew(billsTree.tree, billsSpread.getActiveSheet(), setting);
-        controller.showTreeData();
-        //setTagId
-        setTagID(controller, setting);
-        if (!controller.tree.selected && controller.tree.findNode(controller.sheet.getTag(0, 0, GC.Spread.Sheets.SheetArea.viewport))) {
-            controller.setTreeSelected(controller.tree.findNode(controller.sheet.getTag(0, 0, GC.Spread.Sheets.SheetArea.viewport)));
-        }
-        //刷新节点可进行操作的按钮
-        refreshBtn(controller);
-        controller.setTreeSelected(controller.tree.findNode(controller.sheet.getTag(0, 0)));
-        //补注内容改变
-        rechargeChange(controller);
-        //jobs
-        jobOperation(controller, jobsSheet, function(totalJobs){
-            //items
-            itemOperation(controller, itemsSheet, function(totalItems){
-                //节点操作
-                nodeOpration(controller, totalJobs, totalItems);
-            });
-        });
-    }
-
-    function setTagID(controller, setting){
-        if(controller.tree.items.length > 0){
-            var length = controller.tree.items.length;
-            for(var i=0; i<length; i++){
-                setting.cols.forEach(function(col, colIdx){
-                    if(controller.tree.items[i].data.ID){
-                        controller.sheet.setTag(i, colIdx, controller.tree.items[i].data.ID);
-                    }
-                });
-            }
-        }
-    }
-
-    function refreshBtn(controller){
-        controller.bind('refreshBaseActn', function (tree) {
-            var showButton = function (show, btn) {
-                if (show) {
-                    btn.show();
-                } else {
-                    btn.hide();
-                }
-            };
-            showButton(tree.selected && tree.selected.canUpLevel(), $('#upLevel'));
-            showButton(tree.selected && tree.selected.canDownLevel(), $('#downLevel'));
-            showButton(tree.selected && tree.selected.canUpMove(), $('#upMove'));
-            showButton(tree.selected && tree.selected.canDownMove(), $('#downMove'));
-            showButton(tree.selected ? true : false, $('#delete'));
-        });
-    }
-
-    function rechargeChange(controller){
-        $('#exampleTextarea').bind('change', function(){
-            var newData = $('#exampleTextarea').val();
-            if(controller.tree.selected){
-                rechargeController.updateRechar(controller.tree.selected, newData);
-            }
-        });
-    }
-
-    function jobOperation(controller, jobsSheet, callback){
-        mainAjax.getMaxNumber(billsLibId, 'jobs', function(result){
-            if(result.length === 0){
-                maxJobsNumber = 0;
-            }
-            else {
-                maxJobsNumber = result[0].code;
-            }
-            jobsAjax.getJobContent(billsLibId, function(datas){
-                var totalJobs = createObj.newJobs();
-                totalJobs.loadJobs(controller.tree.items, datas);
-                initData(controller, jobsSheet, jobsSetting, 'jobs');
-                myKey.delKey(jobsSpread, controller, totalJobs, jobsSetting, 'jobs');
-                bindSheet(controller, jobsSheet, 'jobs', jobsSetting);
-                jobsController.editData(controller, jobsSheet, totalJobs, jobsSetting);
-                if (callback){
-                    callback(totalJobs);
-                }
-            });
-        });
-    }
-
-    function itemOperation(controller, itemsSheet, callback){
-        mainAjax.getMaxNumber(billsLibId, 'items', function(result){
-            if(result.length === 0){
-                maxItemsNumber = 0;
-            }
-            else {
-                maxItemsNumber = result[0].code;
-            }
-            itemsAjax.getItemCharacter(billsLibId, function(datas){
-                var totalItems = createObj.newItems();
-                totalItems.loadItems(controller.tree.items, datas);
-                initData(controller, itemsSheet, itemsSetting, 'items');
-                myKey.delKey(itemsSpread, controller, totalItems, itemsSetting, 'items');
-                bindSheet(controller, itemsSheet, 'items', itemsSetting);
-                itemsController.editData(controller, itemsSheet, totalItems, itemsSetting);
-                if(callback){
-                    callback(totalItems)
-                }
-            });
-        });
-    }
-
-    //初始焦点工作表和项目表绑定数据
-    function initData(controller, sheet, setting, classify){
-        if(controller.tree.selected){
-            var arr = controller.tree.selected[classify];
-            var recharge = controller.tree.selected.data.recharge;
-            if(arr.length > 0){
-                tools.reshowData(sheet, arr, setting, true);
-            }
-            if(recharge){
-                $('#exampleTextarea').val(recharge);
-            }
-        }
-    }
-
-    function bindSheet(controller, sheet, field, setting){
-        controller.sheet.bind(GC.Spread.Sheets.Events.SelectionChanged, function(sender, args){
-            if(controller.tree.selected  && args.oldSelections[0].row !== args.newSelections[0].row|| controller.tree.selected && args.oldSelections[0].row === 0){
-                //rechargeArea
-                $('#exampleTextarea').val(controller.tree.selected.data.recharge);
-                tools.clearData(sheet);
-                if(field === 'jobs'){
-                    var jobs = controller.tree.selected.jobs;
-                    if(jobs.length > 0){
-                        tools.reshowData(sheet, jobs, setting, true);
-                        orgJobData = sheet.getValue(0, 0);
-                    }
-                }
-                if(field === 'items'){
-                    var items = controller.tree.selected.items;
-                    if(items.length > 0){
-                        tools.reshowData(sheet, items, setting, true);
-                        orgItemData = sheet.getValue(0, 0);
-                    }
-                }
-            }
-            else {
-                tools.clearData(sheet);
-                $('#exampleTextarea').val('');
-            }
-        });
-    }
-
-    function bindPasteBills(sheet, setting){
-        sheet.bind(GC.Spread.Sheets.Events.ClipboardPasted, function(sender, args){
-            var datas = [], field;
-            var orgRow = args.cellRange.row, orgCol = args.cellRange.col, rowCount = args.cellRange.rowCount, colCount = args.cellRange.colCount;
-            var maxRow = orgRow + rowCount - 1, maxCol = orgCol + colCount -1;
-            for(var i=orgRow; i<= maxRow; i++){
-                var id =  sheet.getTag(i, 0, GC.Spread.Sheets.SheetArea.viewport);
-                if(id){
-                    var pasteJson = {billsLibId: billsLibId, ID: id, code: null, name: null, unit: null, ruleText: null};
-                    var colLen = sheet.getColumnCount(GC.Spread.Sheets.SheetArea.viewport);
-                    for(var j=0; j<colLen; j++){
-                        setting.cols.forEach(function(col, colIdx){
-                            if(colIdx === j){
-                                field = col.data.field;
-                            }
-                        });
-                        pasteJson[field] = sheet.getValue(i, j);
-                    }
-                    datas.push(pasteJson);
-                }
-                else {
-                    sheet.clear(i, 0, 1, sheet.getColumnCount(), GC.Spread.Sheets.SheetArea.viewport,GC.Spread.Sheets.StorageType.data);
-                }
-            }
-            billsAjax.pasteBills(datas);
-        });
-    }
-
-    function bindPasteRel(sheet, setting){
-        sheet.bind(GC.Spread.Sheets.Events.ClipboardPasted, function(sender, args){
-            var orgRow = args.cellRange.row, orgCol = args.cellRange.col, rowCount = args.cellRange.rowCount, colCount = args.cellRange.colCount;
-            var maxRow = orgRow + rowCount - 1, maxCol = orgCol + colCount -1;
-        });
-    }
-
-
-    function buildJobs(jobsSpread, setting){
-        setSheet.initSheet(jobsSpread, setting);
-        setSheet.setMaxRowCount(jobsSpread.getActiveSheet(), 10);
-        myKey.downKey(jobsSpread);
-        myKey.enterKey(jobsSpread);
-        TREE_SHEET_HELPER.loadSheetHeader(jobsSetting, jobsSpread.getActiveSheet());
-    }
-
-    function buildItems(itemsSpread, setting){
-        setSheet.initSheet(itemsSpread, setting);
-        setSheet.setMaxRowCount(itemsSpread.getActiveSheet(), 10);
-        myKey.downKey(itemsSpread);
-        myKey.enterKey(itemsSpread);
-        TREE_SHEET_HELPER.loadSheetHeader(itemsSetting, itemsSpread.getActiveSheet());
-    }
-
-
-</script>
-
-</html>

+ 0 - 289
web/maintain/bills_lib/html/tezheng.html

@@ -1,289 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>清单规则编辑器</title>
-    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
-    <!--<link rel="stylesheet" href="../../web/css/bootstrap/themes.css">-->
-    <link rel="stylesheet" href="/web/maintain/bills_lib/css/main.css">
-    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
-    <!--spread-->
-    <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.excel2013white.10.0.1.css">
-    <!--zTree-->
-    <link rel="stylesheet" href="/lib/ztree/css/zTreeStyle.css" type="text/css">
-</head>
-
-<body>
-    <div class="header">
-        <nav class="navbar navbar-toggleable-lg navbar-light bg-faded p-0 ">
-            <span class="header-logo px-2">清单规则编辑器</span>
-            <div class="navbar-text"></div>
-        </nav>
-        <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
-
-              <ul class="nav nav-tabs" role="tablist">
-                  <li class="nav-item">
-                      <a id="aStdBills" class="nav-link px-3" href="stdBills">清单</a>
-                  </li>
-                  <li class="nav-item">
-                      <a id="aStdJobs" class="nav-link px-3" href="stdJobs">工作内容</a>
-                  </li>
-                  <li class="nav-item">
-                      <a class="nav-link active px-3" href="javascript: void(0);">项目特征</a>
-                  </li>
-              </ul>
-        </nav>
-    </div>
-    <div class="main">
-      <div class="content">
-        <div class="container-fluid">
-          <div class="row">
-            <div class="main-content col-lg-7 p-0">
-              <nav class="tools-bar"></nav>
-              <div class="main-data" id="spreadAllItems">
-            </div>
-            </div>
-            <div class="main-side col-lg-5 p-0">
-              <div class="main-data" id="spreadEigenvalue" style="width: 95%">
-              </div>
-            </div>
-          </div>
-        </div>
-      </div>
-    </div>
-    <!--弹出添加-->
-    <div class="modal fade" id="add" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">添加定额</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>编码</label>
-                      <input class="form-control" placeholder="输入编码" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>名称</label>
-                      <input class="form-control" placeholder="输入名称" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>单位</label>
-                      <select class="form-control"><option>选择单位</option><option>m3</option></select>
-                    </div>
-                    <div class="form-group">
-                      <label>基价</label>
-                      <input class="form-control" placeholder="输入基价" type="number">
-                    </div>
-                    <div class="form-group">
-                      <label>显示名称(以%s表示参数)</label>
-                      <input class="form-control" placeholder="输入显示名称" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>默认取费专业</label>
-                      <input class="form-control" placeholder="输入取费专业" type="text">
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-primary">添加</a>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!--弹出编辑-->
-    <div class="modal fade" id="edit" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">编辑定额</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>编码</label>
-                      <input class="form-control" placeholder="输入编码" type="text" value="AA0001">
-                    </div>
-                    <div class="form-group">
-                      <label>名称</label>
-                      <input class="form-control" placeholder="输入名称" type="text" value="人工挖土方">
-                    </div>
-                    <div class="form-group">
-                      <label>单位</label>
-                      <select class="form-control"><option>m3</option></select>
-                    </div>
-                    <div class="form-group">
-                      <label>基价</label>
-                      <input class="form-control" placeholder="输入基价" type="number" value="880.84">
-                    </div>
-                    <div class="form-group">
-                      <label>显示名称(以%s表示参数)</label>
-                      <input class="form-control" placeholder="输入显示名称" type="text" value="人工挖土方">
-                    </div>
-                    <div class="form-group">
-                      <label>默认取费专业</label>
-                      <input class="form-control" placeholder="输入取费专业" type="text" value="1">
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-primary">确定</a>
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <!--弹出删除-->
-    <div class="modal fade" id="del" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">删除确认</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                    <h5 class="text-danger">删除后无法恢复,确认是否删除?</h5>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" class="btn btn-danger">删除</a>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!-- JS. -->
-    <script src="/lib/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
-    <script src="/lib/jquery/jquery.min.js"></script>
-    <script src="/lib/tether/tether.min.js"></script>
-    <script src="/lib/bootstrap/bootstrap.min.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/global.js"></script>
-    <!--<script src="lib/global.js"></script>-->
-    <script src="/web/maintain/bills_lib/scripts/set_sheets.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/bills_lib_ajax.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/tools.js"></script>
-    <script src="/public/web/tree_sheet/tree_sheet_helper.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/bills_lib_setting.js"></script>
-    <script src="/web/maintain/bills_lib/scripts/db_controller.js"></script>
-    <SCRIPT type="text/javascript">
-        var spread = new GC.Spread.Sheets.Workbook($('#spreadAllItems')[0], {sheetCount: 1});
-        var spreadVal = new GC.Spread.Sheets.Workbook($('#spreadEigenvalue')[0], {sheetCount: 1});
-        var billsLibId = getQueryString('billsLibId');
-        tools.redirect(billsLibId, 'stdBillsmain');
-        var selectedId;
-        var orgValue;
-        var orgItemData;
-        var maxItemsNumber;
-  		$(document).ready(function(){
-            $('#aStdBills').attr('href', function(){
-                return 'stdBills?billsLibId=' + billsLibId;
-            });
-            $('#aStdJobs').attr('href', function(){
-                return 'stdJobs?billsLibId=' + billsLibId;
-            });
-
-            billsAjax.getStdBillsLibName(billsLibId);
-            buildAllItems(spread, totalItemsSetting);
-            buildEigenvalue(spreadVal, eigenValueSetting);
-  		});
-        function buildAllItems(spread, setting){
-            setSheet.initSheet(spread, setting);
-            myKey.downKey(spread);
-            myKey.enterKey(spread);
-            TREE_SHEET_HELPER.loadSheetHeader(setting, spread.getActiveSheet());
-            itemsAjax.getItemCharacter(billsLibId, function(datas){
-                spread.getActiveSheet().suspendPaint();
-                var len = datas.length;
-                for(var i=0; i<len; i++){
-                    if(datas[0].id){
-                        selectedId = datas[0].id;
-                    }
-                    totalItemsSetting.cols.forEach(function(col, colIdx){
-                        spread.getActiveSheet().setTag(i, colIdx, datas[i].id, GC.Spread.Sheets.SheetArea.viewport);
-                        if(datas[i][col.data.field]){
-                            spread.getActiveSheet().getCell(i, colIdx, GC.Spread.Sheets.SheetArea.viewport).value(datas[i][col.data.field]);
-                        }
-                        else {
-                            spread.getActiveSheet().getCell(i, colIdx, GC.Spread.Sheets.SheetArea.viewport).value('');
-                        }
-                    });
-                }
-                //
-                var totalItems = createObj.newItems();
-                totalItems.loadItems(null, datas);
-                initValue(spreadVal.getActiveSheet(), totalItems, eigenValueSetting);
-                tools.getBillsIds(function(ids){
-                    myKey.delKey(spread, ids, totalItems, totalItemsSetting, 'totalItems');
-                    myKey.delKey(spreadVal, null, totalItems, eigenValueSetting, 'itemValue');
-                    bindSheet(totalItems, spread.getActiveSheet(), spreadVal.getActiveSheet(), totalItemsSetting);
-                });
-                //
-                spread.getActiveSheet().resumePaint();
-            });
-        }
-
-        function buildEigenvalue(spread, setting){
-            setSheet.initSheet(spread, setting);
-            setSheet.setMaxRowCount(spread.getActiveSheet(), 10);
-           // setSheet.setEditCol(spread.getActiveSheet(), 1);
-            myKey.downKey(spread);
-            myKey.enterKey(spread);
-            TREE_SHEET_HELPER.loadSheetHeader(setting, spread.getActiveSheet());
-        }
-
-        function bindSheet(totalItems, itemSheet, valueSheet, setting){
-            mainAjax.getMaxNumber(billsLibId, 'items', function(result){
-                if(result.length === 0){
-                    maxItemsNumber = 0;
-                }
-                else {
-                    maxItemsNumber = result[0].code;
-                }
-                orgItemData = itemSheet.getCell(0, 0).value();
-                totalItemsController.eiditData(totalItems, itemSheet, setting);
-            });
-            valueController.editData(totalItems, valueSheet, eigenValueSetting);
-            itemSheet.bind(GC.Spread.Sheets.Events.SelectionChanged, function(sender, args){
-                var itemId = itemSheet.getTag(args.newSelections[0].row, args.newSelections[0].col, GC.Spread.Sheets.SheetArea.viewport);
-                if(itemId && args.oldSelections[0].row !== args.newSelections[0].row|| itemId && args.oldSelections[0].row === 0){
-                    var valueArr = valueController.getValues(totalItems, itemId);
-                    tools.clearData(valueSheet);
-                    selectedId = itemId;
-                    tools.reshowValue(valueSheet, valueArr, eigenValueSetting, true);
-                    orgValue = valueSheet.getValue(0, 0);
-                }
-                else {
-                    tools.clearData(valueSheet);
-                }
-            });
-        }
-
-        function initValue(sheet, totalItems, setting){
-            if(selectedId){
-                var valueArr = valueController.getValues(totalItems, selectedId);
-                if(valueArr.length > 0){
-                    tools.reshowValue(sheet, valueArr, setting, true);
-                }
-            }
-        }
-
-  	</SCRIPT>
-</body>
-<script type="text/javascript">
-    autoFlashHeight();
-</script>
-
-</html>

+ 0 - 371
web/maintain/bills_lib/scripts/bills_lib_ajax.js

@@ -1,371 +0,0 @@
-/**
- * Created by vian on 2017/3/27.
- */
-var mainAjax = {
-    getMaxNumber: function(billsLibId, field, callback){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/getMaxNumber',
-            data: {data: JSON.stringify({billsLibId: billsLibId, field: field})},
-            dataType: 'json',
-            success: function(result){
-                if(!result.error){
-                    if(callback){
-                        callback(result.data);
-                    }
-                }
-            }
-        });
-    },
-    getABillsLib: function(billsLibId, callback){
-        $.ajax({
-            type: 'post',
-            url: '/stdBillsEditor/getABillsLib',
-            data: {data: JSON.stringify({billsLibId: billsLibId})},
-            dataType: 'json',
-            success: function(result){
-                if(!result.error){
-                    if(callback){
-                        callback(result.data);
-                    }
-                }
-            }
-        });
-    },
-    getStdBillsLib: function(userId){
-        $.ajax({
-            type: "post",
-            url: "/stdBillsEditor/getStdBillsLib",
-            data: {data: JSON.stringify({userId: userId})},
-            dataType: "json",
-            success: function(result){
-                if(result.data){
-                    for(var i=0; i<result.data.length; i++){
-                        var id = result.data[i].billsLibId;
-                        var billsLibName = result.data[i].billsLibName;
-                        var createDate = result.data[i].createDate;
-                        var createDateFmt = new Date(createDate).format("yyyy-MM-dd");
-                        $("#showArea").append(
-                            "<tr id='tempId'>" +
-                            "<td><a href='stdBills'>"+billsLibName+"</a></td>" +
-                            "<td>"+createDateFmt+" </td>" +
-                            "<td><a href='javascript:void(0);' data-toggle='modal' data-target='#edit' title='编辑'>" +
-                            "<i class='fa fa-pencil-square-o'></i></a> <a href='javascript:void(0);' data-toggle='modal' data-target='#del' class='text-danger' title='删除'>" +
-                            "<i class='fa fa-remove'></i></a></td></tr>");
-                        var newHref = "stdBills?billsLibId="+id;
-                        $("#tempId td:first a").attr("href", newHref);
-                        $("#tempId").attr("id", id);
-                    }
-                }
-
-            }
-        });
-    },
-    createStdBillsLib: function(userId, billsLibName){
-        $.ajax({
-            type: "POST",
-            url: "/stdBillsEditor/createStdBillsLib",
-            data: {data: JSON.stringify({userId: userId, name: billsLibName}) },
-            dataType: "json",
-            success: function(result){
-                if(!result.error){
-                    var id = result.data[0].billsLibId;
-                    var createDate = result.data[0].createDate;
-                    var createDateFmt = new Date(createDate).format("yyyy-MM-dd");
-                    $("#showArea").append(
-                        "<tr id='tempId'><td><a href='stdBills'>"+billsLibName+"</a></td><td>"+createDateFmt+" </td><td><a href='javascript:void(0);' data-toggle='modal' data-target='#edit' title='编辑'>" +
-                        "<i class='fa fa-pencil-square-o'></i></a> <a href='javascript:void(0);' data-toggle='modal' data-target='#del' class='text-danger' title='删除'>" +
-                        "<i class='fa fa-remove'></i></a></td></tr>"
-                    );
-                    var newHref = "stdBills?billsLibId="+id;
-                    $("#tempId td:first a").attr("href", newHref);
-                    $("#tempId").attr("id", id);
-                }
-            }
-        });
-    },
-    deleteStdBillsLib: function(billsLibId){
-        $.ajax({
-            type: "POST",
-            url: "/stdBillsEditor/deleteStdBillsLib",
-            data: {data: JSON.stringify({billsLibId: billsLibId})},
-            dataType: "json",
-            success: function(result){
-                if(!result.error){
-                    var jqSel = "#"+billsLibId;
-                    $(jqSel).remove();
-                }
-            }
-        });
-    },
-    renameStdBillsLib: function(billsLibId, newName){
-        $.ajax({
-            type: "post",
-            url: "/stdBillsEditor/renameStdbillsLib",
-            data: {data: JSON.stringify({id: billsLibId, value: newName})},
-            dataType: "json",
-            success: function(result){
-                if(!result.error){
-                    var jqSel = "#" + billsLibId + " td:first" + " a";
-                    $(jqSel).text(newName);
-                }
-            }
-        });
-    }
-}
-
-var billsAjax = {
-    getStdBillsLibName: function(billsLibId) {
-        $.ajax({
-            type: "post",
-            url: "/stdBillsEditor/getStdBillsLibName",
-            data: {data: JSON.stringify({billsLibId: billsLibId})},
-            success: function(result){
-                if(!result.error){
-                    $(".navbar-text").append(
-                    "<a href='stdBillsmain'>清单规则</a><i class='fa fa-angle-right fa-fw'></i>"+result.data[0].billsLibName
-                    );
-                }
-            }
-        });
-    },
-    getBills: function(billsLibId, callback){
-        $.ajax({
-            type: "post",
-            url: "/stdBillsEditor/getBills",
-            data: {data: JSON.stringify({billsLibId: billsLibId})},
-            dataType: "json",
-            success: function(result){
-                if(!result.error){
-                    if(callback) {
-                        callback(result.data);
-                    }
-                }
-            }
-        });
-    },
-    createBills: function(billsLibId, newId, pid, nid, callback){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/createBills',
-            data: {data: JSON.stringify({billsLibId: billsLibId, newId: newId, ParentID: pid, NextSiblingID: nid})},
-            dataType: 'json',
-            success: function(result){
-                if(!result.error){
-                    if(callback){
-                        callback();
-                    }
-                }
-            }
-        });
-    },
-
-    updatePNId: function(billsLibId, updateData, callback){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/updatePNId',
-            data: {data: JSON.stringify({billsLibId: billsLibId, updateData: updateData})},
-            dataType: 'json',
-            success: function(result){
-                if(!result.error){
-                    if(callback){
-                        callback();
-                    }
-                }
-            }
-        });
-    },
-    deleteBills: function(billsLibId, deleteIds, callback){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/deleteBills',
-            data: {data: JSON.stringify({billsLibId: billsLibId, deleteIds: deleteIds})},
-            dataType: 'json',
-            success: function(result){
-                if(!result.error){
-                    if(callback){
-                        callback();
-                    }
-                }
-            }
-
-        });
-    },
-    updateBills: function(billsLibId, updateId, field, data){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/updateBills',
-            data: {data: JSON.stringify({billsLibId: billsLibId, updateId: updateId, field: field, data: data})},
-            dataType: 'json',
-            success: function(result){
-
-            }
-        });
-    },
-    updateBillsArr: function(billsLibId, updateId, orgId, newId, type, classify){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/updateBillsArr',
-            data: {data: JSON.stringify({billsLibId: billsLibId, updateId: updateId, orgId: orgId, newId: newId, type: type, classify: classify})},
-            dataType: 'json',
-            success: function(result){
-            }
-        });
-    },
-    pasteBills: function(datas){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/pasteBills',
-            data: {data: JSON.stringify({datas: datas})},
-            dataType: 'json',
-            success: function(result){
-
-            }
-        });
-    },
-    updateRecharge: function(billsLibId, updateIds, data){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/updateRecharge',
-            data: {data: JSON.stringify({billsLibId: billsLibId, updateIds: updateIds, data: data})},
-            dataType: 'json',
-            success: function(result){
-
-            }
-        });
-    }
-}
-
-var jobsAjax = {
-    getJobContent: function(billsLidId, callback){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/getJobContent',
-            data: {data: JSON.stringify({billsLibId: billsLidId})},
-            dataType: 'json',
-            success: function(result){
-                if(!result.error && callback){
-                    callback(result.data);
-                }
-            }
-        });
-    },
-    getSomeJobs: function(billsLibId, ids, callback){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/getSomeJobs',
-            data: {data: JSON.stringify({billsLibId: billsLibId, ids: ids})},
-            dataType: 'json',
-            success: function(result){
-                if(!result.error && callback){
-                    callback(result.data);
-                }
-            }
-        });
-    },
-    createJobContent: function(billsLibId, field, data, serialNo, callback){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/createJobContent',
-            data: {data: JSON.stringify({billsLibId: billsLibId, field: field, data: data, serialNo: serialNo })},
-            dataType: 'json',
-            success: function(result){
-                if(!result.error){
-                    if(callback){
-                        callback(result.data);
-                    }
-                }
-            }
-        });
-    },
-    updateJobContent: function(id, field, data){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/updateJobContent',
-            data: {data: JSON.stringify({updateId: id, field: field, data: data })},
-            dataType: 'json',
-            success: function(result){
-
-            }
-        });
-    },
-    deleteJobContent: function(ids){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/deleteJobContent',
-            data: {data: JSON.stringify({ids: ids})},
-            dataType: 'json',
-            success: function(result){
-
-            }
-        });
-    }
-}
-
-var itemsAjax = {
-    getItemCharacter: function(billsLibId, callback){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/getItemCharacter',
-            data: {data: JSON.stringify({billsLibId: billsLibId})},
-            dataType: 'json',
-            success: function(result){
-                if(!result.error){
-                    if(callback){
-                        callback(result.data);
-                    }
-                }
-            }
-        });
-    },
-    createItemCharacter: function(billsLibId, field, data, serialNo, callback){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/createItemCharacter',
-            data: {data: JSON.stringify({billsLibId: billsLibId, field: field, data: data, serialNo: serialNo})},
-            dataType: 'json',
-            success: function(result){
-                if(!result.error){
-                    if(callback){
-                        callback(result.data);
-                    }
-                }
-            }
-        });
-    },
-    updateItemCharacter: function(id, field, data){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/updateItemCharacter',
-            data: {data: JSON.stringify({updateId: id, field: field, data: data })},
-            dataType: 'json',
-            success: function(result){
-
-            }
-        });
-    },
-    updateValue: function(id, data, deleteCodes, type){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/updateValue',
-            data: {data: JSON.stringify({updateId: id, data: data, type: type, deleteCodes: deleteCodes})},
-            dataType: 'json',
-            success: function(reslut){
-
-            }
-        });
-    },
-    deleteItemCharacter: function(ids){
-        $.ajax({
-            type: 'post',
-            url: 'stdBillsEditor/deleteItemCharacter',
-            data: {data: JSON.stringify({ids: ids})},
-            dataType: 'json',
-            success: function(result){
-
-            }
-        });
-    }
-}
-
-

+ 0 - 294
web/maintain/bills_lib/scripts/bills_lib_setting.js

@@ -1,294 +0,0 @@
-/**
- * Created by vian on 2017/4/10.
- */
-var billsLibSetting = {
-    cols:[
-        {
-            head: {
-                titleNames: ['编码'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'code',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 160
-        },
-        {
-            head: {
-                titleNames: ['名称'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'name',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 300
-        },
-        {
-            head: {
-                titleNames: ['计量单位'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'unit',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 160
-        },
-        {
-            head: {
-                titleNames: ['工程量计算规则'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'ruleText',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 420
-        }
-    ],
-    headRows: 2,
-    headRowHeight: [20, 30, 30],
-    emptyRows: 3,
-    treeCol: 0
-};
-
-var jobsSetting = {
-    cols:[
-        {
-            head: {
-                titleNames: ['编号'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'code',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 100
-        },
-        {
-            head: {
-                titleNames: ['工作内容'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'content',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 210
-        },
-    ],
-    headRows: 2,
-    headRowHeight: [20, 30, 30],
-    emptyRows: 3,
-    treeCol: 0
-};
-
-var itemsSetting = {
-    cols:[
-        {
-            head: {
-                titleNames: ['编号'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'code',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 100
-        },
-        {
-            head: {
-                titleNames: ['项目特征'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'content',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 210
-        },
-    ],
-    headRows: 2,
-    headRowHeight: [20, 30, 30],
-    emptyRows: 3,
-    treeCol: 0
-};
-
-var totalJobsSetting = {
-    cols:[
-        {
-            head: {
-                titleNames: ['编号'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'code',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 200
-        },
-        {
-            head: {
-                titleNames: ['工作内容'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'content',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 850
-        },
-    ],
-    headRows: 2,
-    headRowHeight: [20, 30, 30],
-    emptyRows: 3,
-    treeCol: 0
-};
-
-var totalItemsSetting = {
-    cols:[
-        {
-            head: {
-                titleNames: ['编号'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'code',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 200
-        },
-        {
-            head: {
-                titleNames: ['项目特征'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'content',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 850
-        },
-    ],
-    headRows: 2,
-    headRowHeight: [20, 30, 30],
-    emptyRows: 3,
-    treeCol: 0
-};
-
-var eigenValueSetting = {
-    cols:[
-        {
-            head: {
-                titleNames: ['编号'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'code',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 200
-        },
-        {
-            head: {
-                titleNames: ['特征值'],
-                spanCols: [1],
-                spanRows: [2],
-                vAlign: [1, 1],
-                hAlign: [1, 1],
-                font: '16px Arial'
-            },
-            data: {
-                field: 'value',
-                vAlign: 1,
-                hAlign: 0,
-                font: '14px Arial'
-            },
-            width: 480
-        },
-    ],
-    headRows: 2,
-    headRowHeight: [20, 30, 30],
-    emptyRows: 3,
-    treeCol: 0
-}

+ 0 - 38
web/maintain/bills_lib/scripts/bills_lib_tree.js

@@ -1,38 +0,0 @@
-/**
- * Created by vian on 2017/4/10.
- */
-var billsLibTree = {
-    setting: {
-        id: 'ID',
-        pid: 'ParentID',
-        nid: 'NextSiblingID',
-        rootId: -1
-    },
-    virtualRoot: [{
-        ID: 1,
-        ParentID: -1,
-        NextSiblingID: -1,
-        code: '开始编辑',
-    }],
-    createBillsTree: function(){
-        var billsTree = function(){
-            this.datas = null;
-            this.tree = null;
-        };
-
-        billsTree.prototype.loadDatas = function(datas){
-            if(datas){
-                this.datas = datas;
-                this.tree = idTree.createNew(billsLibTree.setting);
-                this.tree.loadDatas(this.datas);
-           }
-           else {
-                this.datas = [];
-                this.tree = idTree.createNew(billsLibTree.setting);
-                this.tree.loadDatas(this.datas);
-            }
-        };
-
-        return new billsTree();
-    }
-}

File diff suppressed because it is too large
+ 0 - 1130
web/maintain/bills_lib/scripts/db_controller.js


+ 0 - 37
web/maintain/bills_lib/scripts/global.js

@@ -1,37 +0,0 @@
-/*全局自适应高度*/
-function autoFlashHeight(){
-    var headerHeight = $(".header").height();
-    var toolsBar = $(".tools-bar").height();
-    $(".content").height($(window).height()-headerHeight);
-    $(".main-side").height($(window).height()-headerHeight-2);
-    $(".main-content").height($(window).height()-headerHeight-2);
-    $(".main-data").height($(window).height()-headerHeight-toolsBar-16);
-};
-$(window).resize(autoFlashHeight);
-/*全局自适应高度结束*/
-$(function(){
-/*侧滑*/
-$(".open-sidebar").click(function(){
-    $(".slide-sidebar").animate({width:"800"}).addClass("open");
-});
-$("body").click(function(event){
-        var e = event || window.event; //浏览器兼容性
-        if(!$(event.target).is('a')) {
-            var elem = event.target || e.srcElement;
-            while (elem) { //循环判断至跟节点,防止点击的是div子元素
-                if (elem.className == "open-sidebar" || elem.className == 'slide-sidebar open') {
-                    return false;
-                }
-                elem = elem.parentNode;
-            }
-            $(".slide-sidebar").animate({width:"0"}).removeClass("open")// 关闭处理
-        }
-
-    });
-/*侧滑*/
-/*工具提示*/
-$('*[data-toggle=tooltip]').mouseover(function() {
- $(this).tooltip('show');
-  });
-/*工具提示*/
-});

+ 0 - 221
web/maintain/bills_lib/scripts/set_sheets.js

@@ -1,221 +0,0 @@
-/**
- * Created by vian on 2017/3/16.
- */
-var setSheet = {
-    initSheet: function(spread, setting){
-        var spreadNS = GC.Spread.Sheets, sheet = spread.getActiveSheet();
-        sheet.suspendPaint();
-        spread.options.showHorizontalScrollbar = false;
-        spread.options.showVerticalScrollbar =false;
-        spread.options.tabStripVisible = false;
-        spread.options.scrollbarMaxAlign = true;
-        sheet.showRowOutline(false);
-        sheet.defaults.rowHeight = 30;
-        setting.cols.forEach(function(col, colIdx){
-            sheet.getRange(-1,colIdx,-1,1, GC.Spread.Sheets.SheetArea.viewport).hAlign(GC.Spread.Sheets.HorizontalAlign.left);
-            sheet.getRange(-1,colIdx,-1,1, GC.Spread.Sheets.SheetArea.viewport).vAlign(GC.Spread.Sheets.VerticalAlign.center);
-            sheet.getRange(-1,colIdx,-1,1, GC.Spread.Sheets.SheetArea.viewport).textIndent(0.5);
-        });
-        sheet.resumePaint();
-    },
-    setEditCol: function(sheet, colIdx){
-        var style = new GC.Spread.Sheets.Style();
-        style.locked = false;
-        sheet.setStyle(-1, colIdx, style);
-        sheet.options.isProtected = true;
-    },
-    setMaxRowCount: function(sheet, rowCount){
-        sheet.setRowCount(rowCount, GC.Spread.Sheets.SheetArea.viewport);
-    }
-}
-
-function setScrollBar(spread, sheet, initRow){
-    var events = GC.Spread.Sheets.Events;
-    sheet.bind(events.EnterCell, function(e, data){
-        var rowCount = sheet.getRowCount();
-        //��ǰ�������ڳ�ʼ����
-        if(rowCount >initRow){
-            spread.options.showVerticalScrollbar = true;
-        }
-        else{
-            spread.options.showVerticalScrollbar = false;
-        }
-    });
-}
-
-var myKey = {
-    enterKey: function(spread){
-        var sheet = spread.getActiveSheet();
-        spread.commandManager().register("myEnter", function(){
-            var idxRow = sheet.getActiveRowIndex();
-            var rowCount = sheet.getRowCount();
-            if(idxRow+1 == rowCount){
-                sheet.addRows(rowCount, 1);
-                sheet.setRowHeight(rowCount, 30);
-                sheet.getRange(rowCount, -1, 1, -1).vAlign(GC.Spread.Sheets.VerticalAlign.center);
-                sheet.getRange(rowCount, -1, 1, -1).hAlign(GC.Spread.Sheets.HorizontalAlign.left);
-                sheet.getRange(rowCount, -1, 1, -1).textIndent(0.5);
-                sheet.getRange(rowCount, -1, 1, -1).font("14px Arial");
-            }
-        });
-        spread.commandManager().setShortcutKey("myEnter", GC.Spread.Commands.Key.enter, false, false, false, false);
-    },
-
-    downKey: function(spread){
-        var sheet = spread.getActiveSheet();
-        spread.commandManager().register("myDown", function(){
-            var idxRow = sheet.getActiveRowIndex();
-            var rowCount = sheet.getRowCount();
-            if(idxRow+1 == rowCount){
-                sheet.suspendPaint();
-                sheet.addRows(rowCount, 1);
-                sheet.setRowHeight(rowCount, 30);
-                sheet.getRange(rowCount, -1, 1, -1).vAlign(GC.Spread.Sheets.VerticalAlign.center);
-                sheet.getRange(rowCount, -1, 1, -1).hAlign(GC.Spread.Sheets.HorizontalAlign.left);
-                sheet.getRange(rowCount, -1, 1, -1).textIndent(0.5);
-                sheet.getRange(rowCount, -1, 1, -1).font("14px Arial");
-                sheet.resumePaint();
-            }
-        });
-        spread.commandManager().setShortcutKey("myDown", GC.Spread.Commands.Key.down, false, false, false, false);
-    },
-
-
-    delKey: function(spread, controller, totalObj, setting, classify){
-        if(classify === 'jobs' || classify === 'items'){
-            bindRefDel(spread, controller, totalObj, setting, classify);
-        }
-        else if(classify === 'totalJobs'){
-            bindTotalJobDel(spread, controller, totalObj, setting);
-        }
-        else if(classify === 'totalItems'){
-            bindTotalItemDel(spread, spreadVal.getActiveSheet(), controller, totalObj, setting);
-        }
-        else if(classify === 'itemValue'){
-            bindValDel(spread, totalObj, setting);
-        }
-        else if(!classify){
-            rejectDel(spread);
-        }
-
-        function bindRefDel(spread, controller, totalObj, setting, classify){
-            var sheet = spread.getActiveSheet();
-            spread.commandManager().register('myDelete', function(){
-                spread.suspendEvent();
-                var ids = tools.delIds(sheet);
-                console.log(ids);
-                tools.deleteELes(controller.tree.selected[classify], ids, function(result){
-                    //deleteFrontData
-                    tools.reshowData(sheet, controller.tree.selected[classify], setting, true);
-                    //deleteDB
-                    billsAjax.updateBillsArr(billsLibId, controller.tree.selected.getID(), ids, null, 'delete', classify);
-                    if(result.length > 0){
-                        if(classify === 'jobs'){
-                            result.forEach(function(id){
-                                if(totalObj.findJob(id)){
-                                    totalObj.jobsArr.splice(totalObj.jobsArr.indexOf(totalObj.findJob(id)), 1);
-                                    delete  totalObj.jobs[totalObj.prefix + id];
-                                }
-                            });
-                            jobsAjax.deleteJobContent(result);
-                        }
-                        else {
-                            result.forEach(function(id){
-                                if(totalObj.findItem(id)){
-                                    totalObj.itemsArr.splice(totalObj.itemsArr.indexOf(totalObj.findItem(id)), 1);
-                                    delete totalObj.items[totalObj.prefix + id];
-                                }
-                            });
-                            itemsAjax.deleteItemCharacter(result);
-                        }
-                    }
-                });
-                spread.resumeEvent();
-            });
-            spread.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.del, false, false, false, false);
-            spread.commandManager().setShortcutKey('myDelete', GC.Spread.Commands.Key.del, false, false, false, false);
-        }
-
-        function rejectDel(spread){
-            var sheet = spread.getActiveSheet();
-            spread.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.del, false, false, false, false);
-        }
-
-        function bindTotalJobDel(spread, billsIds, totalJobs, setting){
-            var sheet = spread.getActiveSheet();
-            spread.commandManager().register('myJobDelete', function(){
-                spread.suspendEvent();
-                var ids = tools.delIds(sheet);
-                if(ids.length > 0){
-                    ids.forEach(function(id){
-                        var job = totalJobs.findJob(id);
-                        totalJobs.jobsArr.splice(totalJobs.jobsArr.indexOf(job), 1);
-                    });
-                    tools.reshowData(sheet, totalJobs.jobsArr, setting, true);
-                    jobsAjax.deleteJobContent(ids);
-                    billsAjax.updateBillsArr(billsLibId, billsIds, ids, null, 'deleteAll', 'jobs');
-                }
-                spread.resumeEvent();
-            });
-            spread.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.del, false, false, false, false);
-            spread.commandManager().setShortcutKey('myJobDelete', GC.Spread.Commands.Key.del, false, false, false, false)
-        }
-
-        function bindTotalItemDel(spread, valSheet, billsIds, totalItems, setting){
-            var sheet = spread.getActiveSheet();
-            spread.commandManager().register('myItemDelete', function(){
-                spread.suspendEvent();
-                var ids = tools.delIds(sheet);
-                if(ids.length > 0){
-                    ids.forEach(function(id){
-                        var item = totalItems.findItem(id);
-                        totalItems.itemsArr.splice(totalItems.itemsArr.indexOf(item), 1);
-                    });
-                    tools.reshowData(sheet, totalItems.itemsArr, setting, true);
-                    itemsAjax.deleteItemCharacter(ids);
-                    billsAjax.updateBillsArr(billsLibId, billsIds, ids, null, 'deleteAll', 'items');
-                    //reshowVal
-                    if(totalItems.itemsArr.length > 0){
-                        selectedId = totalItems.itemsArr[0].data.id;
-                        tools.reshowValue(valSheet, totalItems.itemsArr[0].data.itemValue, eigenValueSetting, true);
-                    }
-                    else {
-                        tools.clearData(valSheet);
-                    }
-                }
-                spread.resumeEvent();
-            });
-            spread.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.del, false, false, false, false);
-            spread.commandManager().setShortcutKey('myItemDelete', GC.Spread.Commands.Key.del, false, false, false, false)
-        }
-
-        function bindValDel(spread, totalItems, setting){
-            var sheet = spread.getActiveSheet();
-            spread.commandManager().register('valDelete', function(){
-                spread.suspendEvent();
-                var ids = tools.delIds(sheet);
-                //deleteFront
-                var valsArr = valueController.getValues(totalItems, selectedId);
-                ids.forEach(function(id){
-                    valsArr.forEach(function(val){
-                        if(val.code === id){
-                            valsArr.splice(valsArr.indexOf(val), 1);
-                        }
-                    });
-                });
-                tools.reshowValue(sheet, valsArr, setting, true);
-                //deleteDb
-                itemsAjax.updateValue(selectedId, null, ids, 'delete');
-                spread.resumeEvent();
-            });
-            spread.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.del, false, false, false, false);
-            spread.commandManager().setShortcutKey('valDelete', GC.Spread.Commands.Key.del, false, false, false, false);
-        }
-
-        function reSerialNo(){
-
-        }
-
-    }
-}
-

+ 0 - 30
web/maintain/bills_lib/scripts/tools.js

@@ -1,30 +0,0 @@
-/**
- * Created by vian on 2017/3/30.
- */
-//time tools
-Date.prototype.format = function(fmt)
-{
-    var o = {
-        "M+" : this.getMonth()+1,                 //月份
-        "d+" : this.getDate(),                    //日
-        "h+" : this.getHours(),                   //小时
-        "m+" : this.getMinutes(),                 //分
-        "s+" : this.getSeconds(),                 //秒
-        "q+" : Math.floor((this.getMonth()+3)/3), //季度
-        "S"  : this.getMilliseconds()             //毫秒
-    };
-    if(/(y+)/.test(fmt))
-        fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
-    for(var k in o)
-        if(new RegExp("("+ k +")").test(fmt))
-            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
-    return fmt;
-}
-
-//
-function getQueryString(name)
-{
-    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
-    var r = window.location.search.substr(1).match(reg);
-    if(r!=null)return  unescape(r[2]); return null;
-}

+ 0 - 275
web/maintain/ration_repository/css/main.css

@@ -1,275 +0,0 @@
-/*building SAAS 0.1*/
-/*bootstrap 初始化*/
-body {
-    font-size: 0.9rem
-}
-.dropdown-menu {
-    font-size: 0.9rem
-}
-/*自定义css*/
-.header {
-    background: #e1e1e1
-}
-.header .header-logo {
-    background: #ff6501;
-    color: #fff;
-    float: left;
-    padding-top: .25rem;
-    padding-bottom: .25rem;
-    margin-right: 1rem;
-    font-size: 1.25rem;
-    line-height: inherit
-}
-.top-msg{
-  position: fixed;
-  top:0;
-  width:100%;
-  z-index: 999
-}
-.in-1{padding-left:0rem!important}
-.in-2{padding-left:1rem!important}
-.in-3{padding-left:1.5rem!important}
-.in-4{padding-left:2rem!important}
-.in-5{padding-left:2.5rem!important}
-.in-6{padding-left:3rem!important}
-.main {
-    position: relative;
-    background: #f7f7f9;
-}
-.main-nav {
-    position: absolute;
-    text-align: center;
-    z-index: 999;
-    padding: 2px 0 0 2px
-}
-.main-nav .nav a {
-    display: block;
-    width: 28px;
-    text-align: center;
-    line-height: 18px;
-    color: #999;
-    padding: 10px 0;
-    border-right: 1px solid #ccc;
-}
-.main-nav .nav a:hover {
-    background: #fff;
-    color: #333;
-    text-decoration: none;
-}
-.main-nav .nav a.active {
-    border: 1px solid #ccc;
-    border-right: 1px solid #fff;
-    background: #fff;
-    color: #333
-}
-.content {
-    background: #fff
-}
-.tools-btn {
-    height: 30px;
-    line-height: 30px;
-}
-.toolsbar .tools-btn.btn:hover {
-    background: #f7f7f9;
-}
-.main-side {
-    border-right: 1px solid #ccc;
-    overflow-y: auto;
-}
-.main-side .tab-bar {
-    padding:5px 10px;
-    height:38px;
-    position:fixed;
-}
-.main-side .tab-content {
-    margin-top: 38px
-}
-.top-content, .fluid-content {
-    overflow: hidden;
-    border-bottom: 1px solid #ccc;
-}
-.warp-p2 {
-    padding: 2px
-}
-.bottom-content .nav,.top-content .nav {
-    background: #f7f7f9;
-    padding:0 0 0 2px
-}
-.bottom-content .nav-tabs .nav-link, .side-tabs .nav-tabs .nav-link,.top-content .nav-tabs .nav-link {
-    border-radius: 0;
-    padding: 0.2em 0.5em
-}
-.side-tabs .nav-tabs .nav-item {
-  z-index: 999
-}
-.side-tabs .nav-tabs {
-    border-bottom: none;
-    margin-bottom: -1px
-}
-.side-tabs .nav-tabs .nav-link {
-    border-radius: 0;
-    padding: 0em 0.5em;
-    line-height: 30px;
-    z-index: 999
-}
-.bottom-content .nav-tabs .nav-link.active {
-    border-top: 1px solid #f7f7f9
-}
-.side-tabs .nav-tabs .nav-link.active {
-    border-top: none;
-    border-bottom:1px solid #fff
-}
-.side-tabs a.active, .sub-nav a.active {
-    background: #ccc
-}
-.poj-manage {
-    background: #fff
-}
-.slide-sidebar {
-    border-left: 1px solid #E1E1E1;
-    box-shadow: 0px 15px 15px rgba(0, 0, 0, 0.1);
-    background: none repeat scroll 0% 0% #ffffff;
-    overflow: hidden;
-    position: absolute;
-    right: 0px;
-    top: 0;
-    z-index: 999;
-    width: 0px;
-}
-.new-msg {
-    -webkit-animation: tada 1s infinite .2s ease both;
-    -moz-animation: tada 1s infinite .2s ease both;
-}
-@-webkit-keyframes tada {
-    0% {
-        -webkit-transform: scale(1)
-    }
-    10%, 20% {
-        -webkit-transform: scale(0.9) rotate(-3deg)
-    }
-    30%, 50%, 70%, 90% {
-        -webkit-transform: scale(1.1) rotate(3deg)
-    }
-    40%, 60%, 80% {
-        -webkit-transform: scale(1.1) rotate(-3deg)
-    }
-    100% {
-        -webkit-transform: scale(1) rotate(0)
-    }
-}
-@-moz-keyframes tada {
-    0% {
-        -moz-transform: scale(1)
-    }
-    10%, 20% {
-        -moz-transform: scale(0.9) rotate(-3deg)
-    }
-    30%, 50%, 70%, 90% {
-        -moz-transform: scale(1.1) rotate(3deg)
-    }
-    40%, 60%, 80% {
-        -moz-transform: scale(1.1) rotate(-3deg)
-    }
-    100% {
-        -moz-transform: scale(1) rotate(0)
-    }
-}
-.has-danger {
-    -webkit-animation: shake 1s .2s ease both;
-    -moz-animation: shake 1s .2s ease both;
-    animation: shake 1s .2s ease both;
-}
-@-webkit-keyframes shake {
-    0%, 100% {
-        -webkit-transform: translateX(0);
-    }
-    10%, 30%, 50%, 70%, 90% {
-        -webkit-transform: translateX(-10px);
-    }
-    20%, 40%, 60%, 80% {
-        -webkit-transform: translateX(10px);
-    }
-}
-@-moz-keyframes shake {
-    0%, 100% {
-        -moz-transform: translateX(0);
-    }
-    10%, 30%, 50%, 70%, 90% {
-        -moz-transform: translateX(-10px);
-    }
-    20%, 40%, 60%, 80% {
-        -moz-transform: translateX(10px);
-    }
-}
-@keyframes shake {
-    0%, 100% {
-        transform: translateX(0);
-    }
-    10%, 30%, 50%, 70%, 90% {
-        transform: translateX(-10px);
-    }
-    20%, 40%, 60%, 80% {
-        transform: translateX(10px);
-    }
-}
-.bottom-content {
-    height: 370px;
-    overflow: hidden;
-}
-.bottom-content .tab-content .main-data-bottom{
-    height: 340px;
-    overflow: auto;
-}
-.form-signin {
-    max-width: 500px;
-    margin: 150px auto;
-}
-.poj-list, .side-content {
-    overflow: auto;
-}
-.poj-list span.poj-icon {
-  padding-right:10px;
-  color:#ccc
-}
-.print-toolsbar{
-  padding:5px
-}
-.print-toolsbar .panel {
-  display:inline-block;
-  vertical-align:top;
-  background:#f7f7f9
-}
-.print-toolsbar .panel .panel-foot{
-  text-align: center;
-  font-size: 12px
-}
-.print-list {
-  border-right:1px solid #ccc
-}
-.print-list .form-list {
-  overflow: auto
-}
-.print-list .list-tools{
-  height:50px;
-  padding:10px 0;
-  border-bottom:1px solid #f2f2f2
-}
-.pageContainer {
-  background: #ededed;
-  text-align: center
-}
-.pageContainer .page{
-  border:9px solid transparent;
-  display: inline-block;
-}
-.pageContainer .page img{
-  width:inherit;
-  height: inherit;
-}
-.codeList{
-    max-height: 200px;
-    overflow:auto;
-}
-.main-data-top,.main-data-bottom,.main-data{
-  overflow: auto;
-}

+ 0 - 574
web/maintain/ration_repository/dinge.html

@@ -1,574 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器</title>
-    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
-   <!-- <link rel="stylesheet" href="/lib/css/bootstrap/themes.css">-->
-    <link rel="stylesheet" href="/web/maintain/ration_repository/css/main.css">
-    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
-    <!--zTree-->
-  	<link rel="stylesheet" href="/lib/ztree/css/zTreeStyle.css" type="text/css">
-    <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.10.0.1.css" type="text/css">
-
-</head>
-
-<body>
-    <div class="header">
-        <nav class="navbar navbar-toggleable-lg navbar-light bg-faded p-0 ">
-            <span class="header-logo px-2">Smartcost</span>
-            <div id="rationname" class="navbar-text"><a href="main">定额库</a><i class="fa fa-angle-right fa-fw"></i>XXX定额库</div>
-        </nav>
-        <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
-              <ul class="nav nav-tabs" role="tablist">
-                  <li class="nav-item">
-                      <a class="nav-link active px-3" id ="dinge" >定额</a>
-                  </li>
-                  <li class="nav-item">
-                      <a class="nav-link px-3" id="gongliao" href="#">工料机</a>
-                  </li>
-                  <li class="nav-item">
-                      <a class="nav-link px-3" id="fuzhu" href="#">附注条件</a>
-                  </li>
-                  <li class="nav-item">
-                      <a class="nav-link px-3" href="#maz">安装增加费</a>
-                  </li>
-              </ul>
-        </nav>
-    </div>
-    <div class="main">
-        <div class="content">
-            <div class="container-fluid">
-                <div class="row">
-                  <div class="main-side col-lg-3 p-0">
-                      <div class="tab-bar">
-                          <a onclick="zTreeOprObj.addRootNode()" class="btn btn-secondary btn-sm">增加根节点</a>
-                      </div>
-                    <div class="tab-content">
-                      <ul id="rationChapterTree" class="ztree"></ul>
-                    </div>
-                  </div>
-                  <div class="main-content col-lg-9 p-0">
-                      <!-- 右标签 -->
-                      <ul class="nav nav-tabs tools-bar" role="tablist">
-                          <li class="nav-item">
-                              <a class="nav-link active" data-toggle="tab" href="#tde" role="tab">定额</a>
-                          </li>
-                          <li class="nav-item">
-                              <a class="nav-link" data-toggle="tab" href="#tsm" role="tab">说明</a>
-                          </li>
-                          <li class="nav-item">
-                              <a class="nav-link" data-toggle="tab" href="#tjs" role="tab">计算规则</a>
-                          </li>
-                          <li class="nav-item">
-                              <a class="nav-link" data-toggle="tab" href="#tgz" role="tab">工作内容</a>
-                          </li>
-                      </ul>
-                      <div class="tab-content">
-                          <!--定额-->
-                          <div class="tab-pane active" id="tde" role="tabpanel">
-                              <!--定额top-->
-                              <div id="rationItemsSheet" class="main-data-top"></div>
-                              <!--定额bottom-->
-                              <div class="bottom-content">
-                                  <!-- 标签 -->
-                                  <ul class="nav nav-tabs" role="tablist">
-                                      <li class="nav-item">
-                                          <a class="nav-link" data-toggle="tab" href="#bglj" role="tab">工料机</a>
-                                      </li>
-                                      <li class="nav-item">
-                                          <a class="nav-link" data-toggle="tab" href="#bfzd" role="tab">辅助定额调整</a>
-                                      </li>
-                                      <li class="nav-item">
-                                          <a class="nav-link active" data-toggle="tab" href="#bfzt" role="tab">附注条件调整</a>
-                                      </li>
-                                      <li class="nav-item">
-                                          <a class="nav-link" data-toggle="tab" href="#baz" role="tab">安装增加费</a>
-                                      </li>
-                                      <li class="nav-item">
-                                          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button>本分项全部适用</button>
-                                      </li>
-                                  </ul>
-                                  <!-- 内容 -->
-                                  <div class="tab-content">
-                                      <!--工料机-->
-                                      <div class="tab-pane" id="bglj" role="tabpanel">
-                                          <div id="rationGLJSheet" class="main-data-bottom"></div>
-                                      </div>
-                                      <!--辅助定额调整-->
-                                      <div class="tab-pane" id="bfzd" role="tabpanel">
-                                          <div class="main-data-bottom">
-                                              <table class="table table-sm table-bordered m-0">
-                                                  <thead><tr><th width="30"></th><th width="120">调整名称</th><th>序号</th><th>参数最大值</th><th>辅助定额号</th><th>参数名称</th><th>标准值</th><th>步距</th><th>精度</th><th>进位方式</th></tr></thead>
-                                                  <tbody>
-                                                  <tr>
-                                                      <td>1</td><td>运距m</td><td>0</td><td></td><td>AA0012</td><td>运距m</td>
-                                                      <td>20</td><td>20</td><td>0</td><td>四舍五入</td>
-                                                  </tr>
-                                                  <tr>
-                                                      <td>2</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
-                                                  </tr>
-                                                  <tr>
-                                                      <td>3</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
-                                                  </tr>
-                                                  <tr>
-                                                      <td>4</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td>
-                                                  </tr>
-                                                  </tbody>
-                                              </table>
-                                          </div>
-                                      </div>
-                                      <!--附注条件调整-->
-
-                                      <div class="tab-pane active" id="bfzt" role="tabpanel">
-                                          <div id="rationCoeSpread" class="main-data-bottom"></div>
-                                          <!--<div class="main-data-bottom">
-                                              <table class="table table-sm table-bordered m-0">
-                                                  <thead><tr><th width="30"></th><th width="40">编号</th><th width="120">本分项全部适用</th><th>调整顺序</th><th>名称</th><th>内容</th></tr></thead>
-                                                  <tbody>
-                                                  <tr>
-                                                      <td>1</td><td>1</td><td><label class="form-check-label"><input type="checkbox" class="form-check-input" checked></label></td><td>2</td><td>挖湿土时</td><td>人工x1.18</td>
-                                                  </tr>
-                                                  <tr>
-                                                      <td>2</td><td></td><td></td><td></td><td></td><td></td>
-                                                  </tr>
-                                                  <tr>
-                                                      <td>3</td><td></td><td></td><td></td><td></td><td></td>
-                                                  </tr>
-                                                  <tr>
-                                                      <td>4</td><td></td><td></td><td></td><td></td><td></td>
-                                                  </tr>
-                                                  </tbody>
-                                              </table>
-                                          </div>-->
-                                      </div>
-                                      <!--安装增加费-->
-                                      <div class="tab-pane" id="baz" role="tabpanel">
-                                          <div class="main-data-bottom">
-                                              安装增加费
-                                          </div>
-                                      </div>
-
-                                  </div>
-                              </div>
-                          </div>
-                          <!--说明-->
-                          <div class="tab-pane" id="tsm" role="tabpanel">
-                              <div class="main-data">
-                                  <div class="m-2"><a href="javacript:void(0);" data-toggle="modal" data-target="#editTsm" title="编辑">编辑说明</a></div>
-                                  <div class="main-content m-2">
-                                      <h5>说明</h5><p>一、一般说明</p><p>1.土壤及岩石分类,详见土壤及岩石分类表。</p><p>2.....</p>
-                                  </div>
-                              </div>
-                          </div>
-                          <!--计算规则-->
-                          <div class="tab-pane" id="tjs" role="tabpanel">
-                              <div class="main-data">
-                                  <div class="m-2"><a href="javacript:void(0);" data-toggle="modal" data-target="#editTjs" title="编辑">编辑计算规则</a></div>
-                                  <div class="main-content m-2">
-                                      <h5>计算规则</h5>
-                                      <p>土壤、岩石体积,均按挖掘前的天然密度体积以立方米计算。.....</p>
-                                  </div>
-                              </div>
-                          </div>
-                          <!--工作内容-->
-                          <div class="tab-pane" id="tgz" role="tabpanel">
-                              <div class="main-data">
-                                  <div class="form-check m-2"><label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios" value="option1" checked=""> 适合本项所有定额</label>&nbsp;&nbsp;<label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios" value="option1"> 适合本项部分定额</label></div>
-                                  <!-- <p class="m-2">适合本项所有定额</p> -->
-                                  <table class="table table-sm table-bordered m-0">
-                                      <tr>
-                                          <td>1.挖土、修理边底。2.挖淤泥、流沙、修理边底。</td>
-                                      </tr>
-                                  </table>
-                                  <div class="form-check m-2"><label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios2" value="option1"> 适合本项所有定额</label>&nbsp;&nbsp;<label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios2" value="option1" checked=""> 适合本项部分定额</label></div>
-                                  <table class="table table-sm table-bordered m-0">
-                                      <thead>
-                                      <tr>
-                                          <th></th>
-                                          <th>编码</th>
-                                          <th>工作内容</th>
-                                      </tr>
-                                      </thead>
-                                      <tbody>
-                                      <tr>
-                                          <td>1</td>
-                                          <td><a href data-toggle="modal" data-target="#editBianmaQ" class="m-0">编辑编码</a><p class="m-0">AA0017</p><p class="m-0">AA0018</p><p class="m-0">AA0019</p><p class="m-0">AA0020</p><p class="m-0">AA0021</p><p class="m-0">AA0022</p></td>
-                                          <td><p class="m-0">1.松填土:5m内的就地取土,铺平。</p><p class="m-0">2.夯填土方(石渣):5m内的就地取土(石渣)、铺平、夯实、洒水等。</p></td>
-                                      </tr>
-                              <tr>
-                                  <td>2</td>
-                                  <td><a href data-toggle="modal" data-target="#editBianma" class="m-0">点击勾选编码</a></td>
-                                  <td></td>
-                              </tr>
-                              <tr>
-                                  <td>3</td>
-                                  <td></td>
-                                  <td></td>
-                              </tr>
-                              <tr>
-                                  <td>4</td>
-                                  <td></td>
-                                  <td></td>
-                              </tr>
-                              </tbody>
-                              </table>
-                              <div class="form-check m-2"><label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios1" value="option1"> 适合本项所有定额</label>&nbsp;&nbsp;<label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios1" value="option1" checked=""> 适合本项部分定额</label></div>
-                              <table class="table table-sm table-bordered m-0">
-                                  <thead>
-                                  <tr>
-                                      <th></th>
-                                      <th>编码</th>
-                                      <th>工作内容</th>
-                                  </tr>
-                                  </thead>
-                                  <tbody>
-                                  <tr>
-                                      <td>1</td>
-                                      <td><a href data-toggle="modal" data-target="#editBianma" class="m-0">编辑编码</a><p class="m-0">AA0017</p><p class="m-0">AA0018</p><p class="m-0">AA0019</p></td>
-                                      <td><p class="m-0">1.松填土:5m内的就地取土,铺平。</p><p class="m-0">2.夯填土方(石渣):5m内的就地取土(石渣)、铺平、夯实、洒水等。</p></td>
-                                  </tr>
-                                  <tr>
-                                      <td>2</td>
-                                      <td><a href data-toggle="modal" data-target="#editBianma" class="m-0">编辑编码</a><p class="m-0">AA0020</p><p class="m-0">AA0021</p><p class="m-0">AA0022</p></td>
-                                      <td><p class="m-0">1.松填土:5m内的就地取土,铺平。</p><p class="m-0">2.夯填土方(石渣):5m内的就地取土(石渣)、铺平、夯实、洒水等。</p></td>
-                                  </tr>
-                                  <tr>
-                                      <td>3</td>
-                                      <td><a href data-toggle="modal" data-target="#editBianma" class="m-0">点击勾选编码</a></td>
-                                      <td></td>
-                                  </tr>
-                                  <tr>
-                                      <td>4</td>
-                                      <td></td>
-                                      <td></td>
-                                  </tr>
-                                  <tr>
-                                      <td>5</td>
-                                      <td></td>
-                                      <td></td>
-                                  </tr>
-                                  </tbody>
-                              </table>
-                          </div>
-                      </div>
-                  </div>
-                </div>
-            </div>
-        </div>
-    </div>
-        <!--弹出添加-->
-        <div class="modal fade" id="addNewgznr" data-backdrop="static" style="display: none;" aria-hidden="true">
-            <div class="modal-dialog" role="document">
-                <div class="modal-content">
-                    <div class="modal-header">
-                        <h5 class="modal-title">添加工作内容</h5>
-                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                            <span aria-hidden="true">×</span>
-                        </button>
-                    </div>
-                    <div class="modal-body">
-                        <form>
-                            <div class="form-group">
-                                <label>内容</label>
-                                <textarea class="form-control" rows="5"></textarea>
-                            </div>
-                        </form>
-                        <form>
-                            <div class="form-group">
-                                <label>编码</label>
-                                <div class="form-control">
-                                    <div class="row code">
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" checked> AA0017
-                                            </label>
-                                        </div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" checked> AA0018
-                                            </label>
-                                        </div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" checked> AA0019
-                                            </label>
-                                        </div>
-                                        <div class="w-100"></div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1"> AA0020
-                                            </label>
-                                        </div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1"> AA0021
-                                            </label>
-                                        </div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1"> AA0022
-                                            </label>
-                                        </div>
-                                    </div>
-                                </div>
-                            </div>
-
-                            <div class="form-group">
-                                <label>内容</label>
-                                <textarea class="form-control" rows="5"></textarea>
-                            </div>
-                        </form>
-                    </div>
-                    <div class="modal-footer">
-                        <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                        <a href="" class="btn btn-primary">确定</a>
-                    </div>
-                </div>
-            </div>
-        </div>
-        <!--弹出编辑-->
-        <div class="modal fade" id="editTsm" data-backdrop="static" style="display: none;" aria-hidden="true">
-            <div class="modal-dialog" role="document">
-                <div class="modal-content">
-                    <div class="modal-header">
-                        <h5 class="modal-title">编辑说明</h5>
-                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                            <span aria-hidden="true">×</span>
-                        </button>
-                    </div>
-                    <div class="modal-body">
-                        <form>
-                            <div class="form-group">
-                                <label>内容</label>
-                                <textarea class="form-control" rows="5"></textarea>
-                            </div>
-                        </form>
-                    </div>
-                    <div class="modal-footer">
-                        <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                        <a href="" class="btn btn-primary">确定</a>
-                    </div>
-                </div>
-            </div>
-        </div>
-        <div class="modal fade" id="editTjs" data-backdrop="static" style="display: none;" aria-hidden="true">
-            <div class="modal-dialog" role="document">
-                <div class="modal-content">
-                    <div class="modal-header">
-                        <h5 class="modal-title">编辑计算规则</h5>
-                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                            <span aria-hidden="true">×</span>
-                        </button>
-                    </div>
-                    <div class="modal-body">
-                        <form>
-                            <div class="form-group">
-                                <label>内容</label>
-                                <textarea class="form-control" rows="5"></textarea>
-                            </div>
-                        </form>
-                    </div>
-                    <div class="modal-footer">
-                        <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                        <a href="" class="btn btn-primary">确定</a>
-                    </div>
-                </div>
-            </div>
-        </div>
-        <div class="modal fade" id="editBianmaQ" data-backdrop="static" style="display: none;" aria-hidden="true">
-            <div class="modal-dialog" role="document">
-                <div class="modal-content">
-                    <div class="modal-header">
-                        <h5 class="modal-title">修改编码</h5>
-                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                            <span aria-hidden="true">×</span>
-                        </button>
-                    </div>
-                    <div class="modal-body">
-                        <form>
-                            <div class="form-group">
-                                <label>编码</label>
-                                <div class="form-control">
-                                    <div class="row code">
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" checked> AA0017
-                                            </label>
-                                        </div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" checked> AA0018
-                                            </label>
-                                        </div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" checked> AA0019
-                                            </label>
-                                        </div>
-                                        <div class="w-100"></div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" checked> AA0020
-                                            </label>
-                                        </div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" checked> AA0021
-                                            </label>
-                                        </div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" checked> AA0022
-                                            </label>
-                                        </div>
-                                    </div>
-                                </div>
-                            </div>
-                        </form>
-                    </div>
-                    <div class="modal-footer">
-                        <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                        <a href="" class="btn btn-primary">确定</a>
-                    </div>
-                </div>
-            </div>
-        </div>
-        <div class="modal fade" id="editBianma" data-backdrop="static" style="display: none;" aria-hidden="true">
-            <div class="modal-dialog" role="document">
-                <div class="modal-content">
-                    <div class="modal-header">
-                        <h5 class="modal-title">修改编码</h5>
-                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                            <span aria-hidden="true">×</span>
-                        </button>
-                    </div>
-                    <div class="modal-body">
-                        <form>
-                            <div class="form-group">
-                                <label>编码</label>
-                                <div class="form-control">
-                                    <div class="row code">
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" checked> AA0017
-                                            </label>
-                                        </div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" checked> AA0018
-                                            </label>
-                                        </div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" checked> AA0019
-                                            </label>
-                                        </div>
-                                        <div class="w-100"></div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" disabled> AA0020
-                                            </label>
-                                        </div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" disabled> AA0021
-                                            </label>
-                                        </div>
-                                        <div class="col">
-                                            <label class="form-check-label">
-                                                <input class="form-check-input" type="checkbox" value="option1" disabled> AA0022
-                                            </label>
-                                        </div>
-                                    </div>
-                                </div>
-                            </div>
-                        </form>
-                    </div>
-                    <div class="modal-footer">
-                        <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                        <a href="" class="btn btn-primary">确定</a>
-                    </div>
-                </div>
-            </div>
-        </div>
-
-        <!-- JS. -->
-        <script src = "/lib/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
-        <script>GC.Spread.Sheets.LicenseKey = "559432293813965#A0y3iTOzEDOzkjMyMDN9UTNiojIklkI1pjIEJCLi4TPB9mM5AFNTd4cvZ7SaJUVy3CWKtWYXx4VVhjMpp7dYNGdx2ia9sEVlZGOTh7NRlTUwkWR9wEV4gmbjBDZ4ElR8N7cGdHVvEWVBtCOwIGW0ZmeYVWVr3mI0IyUiwCMzETN8kzNzYTM0IicfJye&Qf35VfiEzRwEkI0IyQiwiIwEjL6ByUKBCZhVmcwNlI0IiTis7W0ICZyBlIsIyNyMzM5ADI5ADNwcTMwIjI0ICdyNkIsIibj9SbvNmL4N7bjRnch56ciojIz5GRiwiI8+Y9sWY9QmZ0Jyp96uL9v6L0wap9biY9qiq95q197Wr9g+89iojIh94Wiqi";</script>
-        <script src="/lib/jquery/jquery.min.js"></script>
-        <script src="/lib/tether/tether.min.js"></script>
-        <script src="/lib/bootstrap/bootstrap.min.js"></script>
-        <script type="text/javascript" src="/web/maintain/ration_repository/js/global.js"></script>
-        <!-- zTree -->
-        <script type="text/javascript" src="/lib/ztree/jquery.ztree.core.js"></script>
-        <script type="text/javascript" src="/lib/ztree/jquery.ztree.excheck.js"></script>
-        <script type="text/javascript" src="/lib/ztree/jquery.ztree.exedit.js"></script>
-        <script type="text/javascript" src="/web/maintain/ration_repository/js/section_tree.js"></script>
-        <script type="text/javascript" src="/public/web/ztree_common.js"></script>
-        <script type="text/javascript" src="/public/web/sheet/sheet_common.js"></script>
-        <script type="text/javascript" src="/web/maintain/ration_repository/js/ration.js"></script>
-        <script type="text/javascript" src="/web/maintain/ration_repository/js/ration_glj.js"></script>
-        <script type="text/javascript" src="/public/web/sheet_creater.js"></script>
-        <script type="text/javascript" src="/web/maintain/ration_repository/js/ration_coe.js"></script>
-        <script type="text/javascript" src="/public/web/treeDataHelper.js"></script>
-        <script type="text/javascript" src="/public/web/QueryParam.js"></script>
-        <script type="text/javascript" src="/public/web/storageUtil.js"></script>
-        <script type="text/javascript">
-            var setting = {
-                view: {
-                    addHoverDom: zTreeOprObj.addHoverDom,
-                    removeHoverDom: zTreeOprObj.removeHoverDom,
-                    expandSpeed: "",
-                    selectedMulti: false
-                },
-                edit: {
-                    enable: true,
-                    editNameSelectAll: true,
-                    showRemoveBtn: true,
-                    showRenameBtn: true,
-                    removeTitle: "删除节点",
-                    renameTitle: "更改名称"
-                },
-                data: {
-                    keep: {
-                        parent:true,
-                        leaf:true
-                    },
-                    key: {
-                        children: "items"
-                    },
-                    simpleData: {
-                        enable: true,
-                        idKey: "ID",
-                        pIdKey: "ParentID",
-                        rootPId: -1
-                    }
-                },
-                callback:{
-                    onClick: zTreeOprObj.onClick,
-                    beforeRename: zTreeOprObj.beforeRename,
-                    beforeRemove: zTreeOprObj.onBeforeRemove,
-                    onRemove: zTreeOprObj.onRemove,
-                    onRename: zTreeOprObj.onRename
-                }
-            };
-            $(document).ready(function(){
-                pageOprObj.initPage();
-                rationOprObj.buildSheet($("#rationItemsSheet")[0]);
-                rationGLJOprObj.buildSheet($("#rationGLJSheet")[0]);
-                rationCoeOprObj.buildSheet($("#rationCoeSpread")[0]);
-                sheetCommonObj.shieldAllCells(rationOprObj.workBook.getSheet(0), rationOprObj.setting);
-                sheetCommonObj.shieldAllCells(rationGLJOprObj.workBook.getSheet(0), rationGLJOprObj.setting);
-            });
-        </script>
-    </div>
-</body>
-<script type="text/javascript">
-    autoFlashHeight();
-</script>
-
-</html>

+ 0 - 265
web/maintain/ration_repository/fuzhu.html

@@ -1,265 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器</title>
-    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
-    <link rel="stylesheet" href="/web/maintain/ration_repository/css/main.css">
-    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
-    <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.10.0.1.css" type="text/css">
-    <!--zTree-->
-    <link rel="stylesheet" href="/lib/ztree/css/zTreeStyle.css" type="text/css">
-</head>
-
-<body>
-    <div class="header">
-        <nav class="navbar navbar-toggleable-lg navbar-light bg-faded p-0 ">
-            <span class="header-logo px-2">Smartcost</span>
-            <div class="navbar-text" id="rationname"><a href="main">定额库</a><i class="fa fa-angle-right fa-fw"></i>XXX定额库</div>
-        </nav>
-        <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
-              <ul class="nav nav-tabs" role="tablist">
-                  <li class="nav-item">
-                      <a class="nav-link px-3" id="drirect-dinge" href="javascript:void(0);">定额</a>
-                  </li>
-                  <li class="nav-item">
-                      <a class="nav-link px-3" id="gongliao" href="javascript:void(0);">工料机</a>
-                  </li>
-                  <li class="nav-item">
-                      <a class="nav-link active px-3">附注条件</a>
-                  </li>
-                  <li class="nav-item">
-                      <a class="nav-link px-3" href="#maz">安装增加费</a>
-                  </li>
-
-                  <li class="nav-item">
-                  <!--<input type="button" id="btnAddRow" value="Add Row" />-->
-                  <!--<input type="button" id="btnDeleteRow" value="Delete Row" />-->
-                  </li>
-              </ul>
-        </nav>
-    </div>
-    <div class="main">
-        <div class="content">
-            <div class="container-fluid">
-                <div class="row">
-                  <div class="main-side col-lg-7 p-0">
-                    <div class="main-data" id="mainSpread" style="height: 600px;">
-                   <!-- <table class="table table-sm table-bordered m-0">
-                      <thead>
-                        <tr>
-                          <th></th>
-                          <th>编号</th>
-                          <th>名称</th>
-                          <th>内容</th>
-                        </tr>
-                      </thead>
-                      <tbody>
-                        <tr class="table-active">
-                          <td>1</td>
-                          <td>1</td>
-                          <td>挖湿土时</td>
-                          <td>人工×1.18</td>
-                        </tr>
-                        <tr>
-                          <td>2</td>
-                          <td>2</td>
-                          <td>深2m以内</td>
-                          <td>人工×2.63</td>
-                        </tr>
-                        <tr>
-                          <td>3</td>
-                          <td>3</td>
-                          <td>深4m以内</td>
-                          <td>人工×14.71</td>
-                        </tr>
-                        <tr>
-                          <td>4</td>
-                          <td>4</td>
-                          <td>深6m以内</td>
-                          <td>人工×26.72</td>
-                        </tr>
-                        <tr>
-                          <td>5</td>
-                          <td></td>
-                          <td></td>
-                          <td></td>
-                        </tr>
-                        <tr>
-                          <td>6</td>
-                          <td></td>
-                          <td></td>
-                          <td></td>
-                        </tr>
-                        <tr>
-                          <td>7</td>
-                          <td></td>
-                          <td></td>
-                          <td></td>
-                        </tr>
-                      </tbody>
-                    </table>-->
-                    </div>
-                  </div>
-                  <div class="main-content col-lg-5 p-0">
-                      <div id="contentSpread" style="height: 400px; margin-left:4px;margin-right:4px;" />
-                    <!--<div class="m-2">
-                      <p><div class="form-check"><label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios" id="optionsRadios1" value="option1" checked> 工料机整体调整</label>&nbsp;&nbsp;<label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios" id="optionsRadios1" value="option1"> 单个工料机调整</label></div></p>
-                    </div>
-                    <table class="table table-sm table-bordered m-0">
-                      <thead>
-                        <tr>
-                          <th>名称</th>
-                          <th>操作符</th>
-                          <th>数量</th>
-                        </tr>
-                      </thead>
-                      <tbody>
-                        <tr>
-                          <td>人工</td>
-                          <td>*</td>
-                          <td>1.18</td>
-                        </tr>
-                        <tr>
-                          <td>材料</td>
-                          <td></td>
-                          <td></td>
-                        </tr>
-                        <tr>
-                          <td>机械</td>
-                          <td></td>
-                          <td></td>
-                        </tr>
-                      </tbody>
-                    </table>
-                    <div class="m-2">
-                      <p><div class="form-check"><label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios1" id="optionsRadios" value="option1"> 工料机整体调整</label>&nbsp;&nbsp;<label class="form-check-label"><input type="radio" class="form-check-input" name="optionsRadios1" id="optionsRadios" value="option1" checked> 单个工料机调整</label></div></p>
-                    </div>
-                    <table class="table table-sm table-bordered m-0">
-                      <thead>
-                        <tr>
-                          <th></th>
-                          <th>编码</th>
-                          <th>名称</th>
-                          <th>操作符</th>
-                          <th>数量</th>
-                        </tr>
-                      </thead>
-                      <tbody>
-                        <tr>
-                          <td>1</td>
-                          <td>00010201</td>
-                          <td>人工</td>
-                          <td>*</td>
-                          <td>1.18</td>
-                        </tr>
-                        <tr>
-                          <td>2</td>
-                          <td></td>
-                          <td></td>
-                          <td></td>
-                          <td></td>
-                        </tr>
-                        <tr>
-                          <td>3</td>
-                          <td></td>
-                          <td></td>
-                          <td></td>
-                          <td></td>
-                        </tr>
-                        <tr>
-                          <td>4</td>
-                          <td></td>
-                          <td></td>
-                          <td></td>
-                          <td></td>
-                        </tr>
-                      </tbody>
-                    </table>-->
-                  </div>
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <!-- JS. -->
-    <script src="/lib/jquery/jquery.min.js"></script>
-    <script src="/lib/tether/tether.min.js"></script>
-    <script src="/lib/bootstrap/bootstrap.min.js"></script>
-    <script type="text/javascript" src="/web/maintain/ration_repository/js/global.js"></script>
-    <!-- zTree -->
-    <script src = "/lib/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
-    <script>GC.Spread.Sheets.LicenseKey = "559432293813965#A0y3iTOzEDOzkjMyMDN9UTNiojIklkI1pjIEJCLi4TPB9mM5AFNTd4cvZ7SaJUVy3CWKtWYXx4VVhjMpp7dYNGdx2ia9sEVlZGOTh7NRlTUwkWR9wEV4gmbjBDZ4ElR8N7cGdHVvEWVBtCOwIGW0ZmeYVWVr3mI0IyUiwCMzETN8kzNzYTM0IicfJye&Qf35VfiEzRwEkI0IyQiwiIwEjL6ByUKBCZhVmcwNlI0IiTis7W0ICZyBlIsIyNyMzM5ADI5ADNwcTMwIjI0ICdyNkIsIibj9SbvNmL4N7bjRnch56ciojIz5GRiwiI8+Y9sWY9QmZ0Jyp96uL9v6L0wap9biY9qiq95q197Wr9g+89iojIh94Wiqi";</script>
-    <script type="text/javascript" src="/lib/ztree/jquery.ztree.core.js"></script>
-    <script type="text/javascript" src="/lib/ztree/jquery.ztree.excheck.js"></script>
-    <script type="text/javascript" src="/lib/ztree/jquery.ztree.exedit.js"></script>
-    <script type="text/javascript" src="/public/web/treeDataHelper.js"></script>
-    <script type="text/javascript" src="/public/web/QueryParam.js"></script>
-    <script src="/public/web/sheet_creater.js"></script>
-    <script src="/public/common_util.js"></script>
-    <script src="/public/debug.js"></script>
-    <script type="text/javascript" src="/public/web/storageUtil.js"></script>
-    <script type="text/javascript" src="/web/maintain/ration_repository/js/coe.js"></script>
-    <SCRIPT type="text/javascript">
-  		<!--
-  		var setting = {
-  			view: {
-  				showIcon: false
-  			},
-  			data: {
-  				simpleData: {
-  					enable: true
-  				}
-  			}
-  		};
-
-  		var zNodes =[
-  			{ id:1, pId:0, name:"父节点1 - 展开", open:true},
-  			{ id:11, pId:1, name:"父节点11 - 折叠"},
-  			{ id:111, pId:11, name:"叶子节点111"},
-  			{ id:112, pId:11, name:"叶子节点112"},
-  			{ id:113, pId:11, name:"叶子节点113"},
-  			{ id:114, pId:11, name:"叶子节点114"},
-  			{ id:12, pId:1, name:"父节点12 - 折叠"},
-  			{ id:121, pId:12, name:"叶子节点121"},
-  			{ id:122, pId:12, name:"叶子节点122"},
-  			{ id:123, pId:12, name:"叶子节点123"},
-  			{ id:124, pId:12, name:"叶子节点124"},
-  			{ id:13, pId:1, name:"父节点13 - 没有子节点", isParent:true},
-  			{ id:2, pId:0, name:"父节点2 - 折叠"},
-  			{ id:21, pId:2, name:"父节点21 - 展开", open:true},
-  			{ id:211, pId:21, name:"叶子节点211"},
-  			{ id:212, pId:21, name:"叶子节点212"},
-  			{ id:213, pId:21, name:"叶子节点213"},
-  			{ id:214, pId:21, name:"叶子节点214"},
-  			{ id:22, pId:2, name:"父节点22 - 折叠"},
-  			{ id:221, pId:22, name:"叶子节点221"},
-  			{ id:222, pId:22, name:"叶子节点222"},
-  			{ id:223, pId:22, name:"叶子节点223"},
-  			{ id:224, pId:22, name:"叶子节点224"},
-  			{ id:23, pId:2, name:"父节点23 - 折叠"},
-  			{ id:231, pId:23, name:"叶子节点231"},
-  			{ id:232, pId:23, name:"叶子节点232"},
-  			{ id:233, pId:23, name:"叶子节点233"},
-  			{ id:234, pId:23, name:"叶子节点234"},
-  			{ id:3, pId:0, name:"父节点3 - 没有子节点", isParent:true}
-  		];
-
-  		function showIconForTree(treeId, treeNode) {
-  			return !treeNode.isParent;
-  		};
-
-  		$(document).ready(function(){
-  			$.fn.zTree.init($("#treeDemo"), setting, zNodes);
-  		});
-  		//-->
-  	</SCRIPT>
-</body>
-<script type="text/javascript">
-//    autoFlashHeight();
-</script>
-
-</html>

+ 0 - 237
web/maintain/ration_repository/gongliao.html

@@ -1,237 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器</title>
-    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
-    <link rel="stylesheet" href="/web/maintain/ration_repository/css/main.css">
-    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
-    <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.10.0.1.css" type="text/css">
-    <!--zTree-->
-  	<link rel="stylesheet" href="/lib/ztree/css/zTreeStyle.css" type="text/css">
-</head>
-
-<body>
-    <div class="header">
-        <nav class="navbar navbar-toggleable-lg navbar-light bg-faded p-0 ">
-            <span class="header-logo px-2">Smartcost</span>
-            <div id="rationname" class="navbar-text"><a href="main">定额库</a><i class="fa fa-angle-right fa-fw"></i>XXX定额库</div>
-        </nav>
-        <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
-              <ul class="nav nav-tabs" role="tablist">
-                  <li class="nav-item">
-                      <a class="nav-link px-3" id="drirect-dinge" href="/rationRepository/ration">定额</a>
-                  </li>
-                  <li class="nav-item">
-                      <a class="nav-link active px-3">工料机</a>
-                  </li>
-                  <li class="nav-item">
-                      <a class="nav-link px-3" id="fuzhu" href="javascript:void(0);">附注条件</a>
-                  </li>
-                  <li class="nav-item">
-                      <a class="nav-link px-3" href="#maz">安装增加费</a>
-                  </li>
-              </ul>
-        </nav>
-    </div>
-    <div class="main">
-        <div class="content">
-            <div class="container-fluid">
-                <div class="row">
-                    <div class="main-side col-lg-3 p-0">
-                        <ul id="repositoryTree" class="ztree"></ul>
-                    </div>
-                    <div class="main-content col-lg-9 p-0">
-                        <div id="GLJListSheet" class="main-data"></div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <!--弹出添加-->
-    <div class="modal fade" id="add" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">添加工料机</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>编码</label>
-                      <input class="form-control" id="gljcode" placeholder="输入编码" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>名称</label>
-                      <input class="form-control" id="gljname" placeholder="输入名称" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>规格</label>
-                      <input class="form-control" id="gljgg" placeholder="输入规格" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>单位</label>
-                      <select class="form-control" id = "gljdw"><option>选择单位</option><option>工日</option><option>t</option><option>m3</option></select>
-                    </div>
-                    <div class="form-group">
-                      <label>基价单价</label>
-                      <input class="form-control" id="gljjj" placeholder="输入基价" type="number">
-                    </div>
-                    <div class="form-group">
-                      <label>类型</label>
-                      <select class="form-control" id="gljlx"><option>人工</option><option>材料</option></select>
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" id="btadd" data-dismiss="modal">添加</button>
-                    <a   class="btn btn-primary">取消</a>
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <!--弹出编辑-->
-    <div class="modal fade" id="edit" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">编辑工料机</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>编码</label>
-                      <input class="form-control" placeholder="输入编码" id="Ecode" type="text" value="">
-                    </div>
-                    <div class="form-group">
-                      <label>名称</label>
-                      <input class="form-control" placeholder="输入名称" id ="Ename" type="text" vaule="">
-                    </div>
-                    <div class="form-group">
-                      <label>规格</label>
-                      <input class="form-control" placeholder="输入规格" id="Eguige" type="text">
-                    </div>
-                    <div class="form-group">
-                      <label>单位</label>
-                      <select class="form-control" id="Edanwei"><option>工日</option></select>
-                    </div>
-                    <div class="form-group">
-                      <label>基价单价</label>
-                      <input class="form-control" id="Ejijia" placeholder="输入基价" type="number" value="">
-                    </div>
-                    <div class="form-group">
-                      <label>类型</label>
-                      <select class="form-control" id="Eleixing"><option>人工</option></select>
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <button type="button" class="btn btn-secondary" id="edtglj" data-dismiss="modal">确定</button>
-
-                </div>
-            </div>
-        </div>
-    </div>
-
-    <!--弹出删除-->
-    <div class="modal fade" id="del" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <input type="hidden" id="did" value="">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">删除确认</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                    <h5 class="text-danger">删除后无法恢复,确认是否删除?</h5>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary"   data-dismiss="modal">取消</button>
-                    <button type="button" class="btn btn-secondary" id="deleteGLJ"  data-dismiss="modal">删除</button>
-                   <!-- <a href="" class="btn btn-danger" >删除</a>-->
-                </div>
-            </div>
-        </div>
-    </div>
-    <!-- JS. -->
-    <script src="/lib/jquery/jquery.min.js"></script>
-    <script src="/lib/tether/tether.min.js"></script>
-    <script src="/lib/bootstrap/bootstrap.min.js"></script>
-    <script type="text/javascript" src="/web/maintain/ration_repository/js/global.js"></script>
-    <!-- zTree -->
-    <script src = "/lib/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
-    <script>GC.Spread.Sheets.LicenseKey = "559432293813965#A0y3iTOzEDOzkjMyMDN9UTNiojIklkI1pjIEJCLi4TPB9mM5AFNTd4cvZ7SaJUVy3CWKtWYXx4VVhjMpp7dYNGdx2ia9sEVlZGOTh7NRlTUwkWR9wEV4gmbjBDZ4ElR8N7cGdHVvEWVBtCOwIGW0ZmeYVWVr3mI0IyUiwCMzETN8kzNzYTM0IicfJye&Qf35VfiEzRwEkI0IyQiwiIwEjL6ByUKBCZhVmcwNlI0IiTis7W0ICZyBlIsIyNyMzM5ADI5ADNwcTMwIjI0ICdyNkIsIibj9SbvNmL4N7bjRnch56ciojIz5GRiwiI8+Y9sWY9QmZ0Jyp96uL9v6L0wap9biY9qiq95q197Wr9g+89iojIh94Wiqi";</script>
-  	<script type="text/javascript" src="/lib/ztree/jquery.ztree.core.js"></script>
-  	<script type="text/javascript" src="/lib/ztree/jquery.ztree.excheck.js"></script>
-    <script type="text/javascript" src="/lib/ztree/jquery.ztree.exedit.js"></script>
-    <script type="text/javascript" src="/public/web/treeDataHelper.js"></script>
-    <script type="text/javascript" src="/public/web/QueryParam.js"></script>
-    <script type="text/javascript" src="/web/maintain/ration_repository/js/repository_glj.js"></script>
-    <script type="text/javascript" src="/public/web/ztree_common.js"></script>
-    <script type="text/javascript" src="/public/web/sheet/sheet_common.js"></script>
-    <script type="text/javascript" src="/public/web/storageUtil.js"></script>
-    <script type="text/javascript">
-        var gljSetting = {
-            view: {
-                addHoverDom: gljTypeTreeOprObj.addHoverDom,
-                removeHoverDom: gljTypeTreeOprObj.removeHoverDom,
-                expandSpeed: "",
-                selectedMulti: false
-            },
-            edit: {
-                enable: true,
-                editNameSelectAll: true,
-                showRemoveBtn: true,
-                showRenameBtn: true,
-                removeTitle: "删除节点",
-                renameTitle: "更改名称"
-            },
-            data: {
-                keep: {
-                    parent:true,
-                    leaf:true
-                },
-                key: {
-                    children: "items",
-                    name: "Name"
-                },
-                simpleData: {
-                    enable: true,
-                    idKey: "ID",
-                    pIdKey: "ParentID",
-                    rootPId: -1
-                }
-            },
-            callback:{
-                beforeRename: gljTypeTreeOprObj.beforeRename,
-                onRename: gljTypeTreeOprObj.onRename,
-                beforeRemove: gljTypeTreeOprObj.onBeforeRemove,
-                onRemove: gljTypeTreeOprObj.onRemove,
-                onClick: gljTypeTreeOprObj.onClick
-            }
-        };
-        $(document).ready(function(){
-            pageOprObj.initPage($("#GLJListSheet")[0]);
-            //repositoryGljObj.buildSheet($("#GLJListSheet")[0]);
-        });
-  	</script>
-</body>
-<script type="text/javascript">
-    autoFlashHeight();
-</script>
-
-</html>

+ 0 - 281
web/maintain/ration_repository/js/coe.js

@@ -1,281 +0,0 @@
-/**
- * Created by CSL on 2017-05-18.
- */
-
-var pageObj = {
-    initPage: function (){
-        $("#drirect-dinge").click(function(){
-            $(this).attr('href', "/rationRepository/ration" + "?repository=" + getQueryString("repository"))
-        });
-
-        $("#gongliao").click(function(){
-            $(this).attr('href', "/rationRepository/lmm" + "?repository=" + getQueryString("repository"))
-        });
-
-        var libID = getQueryString("repository");
-        var libName = storageUtil.getSessionCache("RationGrp","repositoryID_" + libID);
-        if (libName) {
-            var html = $("#rationname")[0].outerHTML;
-            html = html.replace("XXX定额库", libName);
-            $("#rationname")[0].outerHTML = html;
-        };
-
-        coeList.show();
-    }
-};
-
-var coeList = {
-    mainSpread: null,
-    detailSpread: null,
-    datas: [],
-    libID: Number,
-    tempID: -999999,       // 本地新增一条数据给的默认ID,用作标记,服务端返回新ID后替换该ID
-
-    colDefMain: [
-        {name: "ID", displayName: "ID", size: 60, hAlign: "center", readOnly: true},
-        {name: "name", displayName: "名称", size: 280},
-        {name: "content", displayName: "内容", size: 250}
-    ],
-    colDefContent: [
-        {name: "coeType", displayName: "类型", size: 100, hAlign: "center"},
-        {name: "gljID", displayName: "工料机ID", size: 100, hAlign: "center",formatter: "00000000"},
-        {name: "operator", displayName: "操作符", size: 60, hAlign: "center"},
-        {name: "amount", displayName: "数量", size: 80, hAlign: "right"}
-    ],
-
-    show: function (){
-        var me = this;
-        me.libID = getQueryString("repository");
-        me.getDatas();
-        me.mainSpread = sheetObj.create($('#mainSpread')[0], me.colDefMain, me.datas);
-        me.detailSpread = sheetObj.create($('#contentSpread')[0], me.colDefContent, me.datas[0].coes);
-
-        var coeType = new GC.Spread.Sheets.CellTypes.ComboBox();
-        coeType.items(["单个","全部","人工类","材料类","机械类"]);
-        me.detailSpread.getSheet(0).getRange(-1, 0, -1, 1).cellType(coeType);
-
-        var operType = new GC.Spread.Sheets.CellTypes.ComboBox();
-        operType.items(["+","-","*","/","="]);
-        me.detailSpread.getSheet(0).getRange(-1, 2, -1, 1).cellType(operType);
-
-        me.detailSpread.options.showVerticalScrollbar = false;
-
-        me.mainSpread.getSheet(0).bind(GC.Spread.Sheets.Events.EnterCell, me.onMainEnterCell);
-        me.mainSpread.getSheet(0).bind(GC.Spread.Sheets.Events.CellChanged, me.onMainCellChanged);
-        me.mainSpread.getSheet(0).bind(GC.Spread.Sheets.Events.RangeChanged, me.onMainRangeChanged);
-
-        me.detailSpread.getSheet(0).bind(GC.Spread.Sheets.Events.CellChanged, me.onDetailCellChanged);
-        me.detailSpread.getSheet(0).bind(GC.Spread.Sheets.Events.RangeChanged, me.onDetailRangeChanged);
-    },
-
-    getDatas: function () {
-        var me = this;
-
-        $.ajax({
-            type:"POST",
-            url:"/rationRepository/api/getCoeList",
-            data:{"libID": me.libID},
-            dataType:"json",
-            cache:false,
-            async: false,
-            timeout:20000,
-            success: function (result) {
-                if (result.data) {
-                    me.datas = result.data;
-                };
-            },
-            error: function (result) {
-                alert('内部程序错误!');
-            }
-        })
-    },
-
-    /*getLibID: function(libName){
-        var me = this;
-        $.ajax({
-            type:"POST",
-            url:"/rationRepository/api/getLibIDByName",
-            data:{"libName": libName},
-            dataType:"json",
-            cache:false,
-            async: false,
-            timeout:20000,
-            success: function (result) {
-                if (result.data) {
-                    me.libID = result.data;
-                }
-            },
-            error: function (result) {
-                alert('内部程序错误!');
-            }
-        })
-    },*/
-
-    onMainEnterCell: function(sender, args) {
-        var me = coeList;
-        var row = args.sheet.getActiveRowIndex();
-        me.detailSpread.suspendPaint();
-
-        var dSheet = me.detailSpread.getSheet(0);
-        var dData = me.datas[row].coes;
-        if (dData == undefined){
-            dSheet.setDataSource([]);
-            dSheet.setRowCount(0);
-        }else{
-            dSheet.setDataSource(dData);
-            me.showNullRow(dSheet);
-        };
-        me.detailSpread.resumePaint();
-    },
-
-    onMainCellChanged: function(sender, args) {
-        if (args.propertyName !== "value"){return;};
-        var me = coeList;
-        var row = args.sheet.getActiveRowIndex();
-        var obj = me.datas[row];
-
-        if (obj.ID == undefined){           // 空行录入,即新增
-            obj.libID = me.libID;
-            obj.ID = me.tempID;
-            if (obj.name == undefined){obj.name = '';};     // 生成属性,令属性存储顺序一致
-            if (obj.content == undefined){obj.content = '';};
-            obj.coes = [{coeType:"全部", operator:"*", amount: "0"}];
-            me.datas[row] = obj;
-
-            me.save([obj],[],[]);
-
-            me.detailSpread.suspendPaint();
-            me.detailSpread.getSheet(0).setDataSource(me.datas[row].coes);
-            me.detailSpread.resumePaint();
-            var sheet = me.mainSpread.getSheet(0);
-            me.showNullRow(sheet);
-        }
-        else{ // 正常修改
-            me.save([],[],[obj]);
-        };
-    },
-
-    onMainRangeChanged: function(sender, args) {
-        if (args.action == GC.Spread.Sheets.RangeChangedAction.clear) {
-            if (!confirm('确定要删除本条附注条件吗?')){ args.cancel = true; return; }
-            var me = coeList;
-            var obj = me.datas[args.row];
-            me.save([],[obj],[]);
-            args.sheet.deleteRows(args.row, 1);
-        };
-    },
-    
-    onDetailCellChanged: function(sender, args) {
-        if (args.propertyName !== "value"){return;};
-
-        var me = coeList;
-        var mainRow = me.mainSpread.getSheet(0).getActiveRowIndex();
-        var detailRow = args.sheet.getActiveRowIndex();
-        var detailDatas = me.datas[mainRow].coes;
-        var curDetailData = detailDatas[detailRow];
-
-        if (curDetailData !== undefined){       // 当在空白行输入时,curDetailData为undefined。
-            var curType = curDetailData.coeType;
-            if (curType !== '单个'){
-                me.detailSpread.suspendPaint();
-                curDetailData.gljID = null;
-                me.detailSpread.resumePaint();
-            };
-
-            if (curDetailData.operator == undefined){ curDetailData.operator = "*"; } ;
-            if (curDetailData.amount == undefined){ curDetailData.amount = "0"; } ;
-        };
-
-/*        var curType = args.sheet.getValue(detailRow, 0);
-        if (curType !== '单个'){
-            me.detailSpread.suspendEvent();
-            args.sheet.setValue(detailRow, 1, null);
-            me.detailSpread.resumeEvent();
-            //args.sheet.getCell(row, 1).backColor("red");
-        }
-        else{
-            //args.sheet.getCell(row, 1).backColor("Blue");
-        };*/
-
-
-        var obj = me.datas[mainRow];
-        me.save([],[],[obj]);
-
-        me.showNullRow(args.sheet);
-    },
-
-    onDetailRangeChanged: function(sender, args) {
-        if (args.action == GC.Spread.Sheets.RangeChangedAction.clear) {
-            if (!confirm('确定要删除该类型的明细数据吗?')){ args.cancel = true; return; }
-            var me = coeList;
-            var detailData = args.sheet.getDataSource();
-            args.sheet.deleteRows(args.row, 1);
-            var mainRow = me.mainSpread.getSheet(0).getActiveRowIndex();
-            var obj = me.datas[mainRow];
-            me.save([],[],[obj]);
-        };
-    },
-
-    showNullRow: function(sheet){
-        var datas = sheet.getDataSource();
-        //alert('004: datas.length: ' + datas.length + ', sheet.getRowCount: ' + sheet.getRowCount());
-        var lastData = datas[datas.length - 1];
-        if (!$.isEmptyObject(lastData)){
-            sheet.addRows(sheet.getRowCount(), 1);
-            //alert('005: datas.length: ' + datas.length + ', sheet.getRowCount: ' + sheet.getRowCount());
-        };
-    },
-
-    save: function(addArr, deleteArr, updateArr) {
-        var me = coeList;
-
-        //var addArrTemp = [];
-        //var deleteArrTemp = [];
-        var updateArrTemp = [];
-
-        // 空行会产生空对象数据,清理空对象会给sheet的空行效果带来奇怪的干扰,这里要中转一下。
-        if (updateArr.length > 0){
-            $.extend(true, updateArrTemp, updateArr);
-            //debug.d('011: ', updateArrTemp);
-            //debug.d('012: ', updateArr);
-            deleteEmptyObject(updateArrTemp[0].coes);
-            //debug.d('013: ', updateArrTemp);
-            //debug.d('014: ', updateArr);
-            //return;
-        };
-
-        $.ajax({
-            type:"POST",
-            url:"api/saveCoeList",
-            data: {"data": JSON.stringify({"addArr": addArr, "deleteArr": deleteArr, "updateArr": updateArrTemp})},
-            dataType:"json",
-            cache:false,
-            timeout:5000,
-            success:function(result){
-                if (result.error) {
-                    alert(result.message);
-                } else {
-                    // 成功。更新从后台返回的新ID。
-                    if (addArr.length > 0){
-                        for (var i = 0; i < me.datas.length; i++) {
-                            if (me.datas[i].ID == me.tempID){
-                                me.datas[i].ID = result.data;
-                                me.mainSpread.getSheet(0).repaint();
-                                break;
-                            }
-                        }
-                    };
-                }
-            },
-            error:function(err){
-                alert("内部程序错误!");
-            }
-        })
-    }
-};
-
-pageObj.initPage();
-
-
-
-

+ 0 - 42
web/maintain/ration_repository/js/global.js

@@ -1,42 +0,0 @@
-/*全局自适应高度*/
-function autoFlashHeight(){
-    var headerHeight = $(".header").height();
-    var bottomContentHeight = $(".bottom-content").height();
-    var toolsBar = $(".tools-bar").height();
-    $(".content").height($(window).height()-headerHeight);
-    $(".main-side").height($(window).height()-headerHeight-2);
-    $(".fluid-content").height($(window).height()-headerHeight-1);
-    $(".side-content").height($(window).height()-headerHeight );
-    $(".poj-list").height($(window).height()-headerHeight);
-    $(".form-list").height($(window).height()-headerHeight-50 );
-    $(".main-data-top").height($(window).height()-headerHeight-toolsBar-bottomContentHeight-2);
-    $(".main-data").height($(window).height()-headerHeight);
-};
-$(window).resize(autoFlashHeight);
-/*全局自适应高度结束*/
-$(function(){
-/*侧滑*/
-$(".open-sidebar").click(function(){
-    $(".slide-sidebar").animate({width:"800"}).addClass("open");
-});
-$("body").click(function(event){
-        var e = event || window.event; //浏览器兼容性
-        if(!$(event.target).is('a')) {
-            var elem = event.target || e.srcElement;
-            while (elem) { //循环判断至跟节点,防止点击的是div子元素
-                if (elem.className == "open-sidebar" || elem.className == 'slide-sidebar open') {
-                    return false;
-                }
-                elem = elem.parentNode;
-            }
-            $(".slide-sidebar").animate({width:"0"}).removeClass("open")// 关闭处理
-        }
-
-    });
-/*侧滑*/
-/*工具提示*/
-$('*[data-toggle=tooltip]').mouseover(function() {
- $(this).tooltip('show');
-  });
-/*工具提示*/
-});

+ 0 - 161
web/maintain/ration_repository/js/main.js

@@ -1,161 +0,0 @@
-/**
- * Created by Syusuke on 2017/3/17.
- */
-$(function(){
-    getRationLibs();
-})
-
-function addEvent_Addressdirect(){
-    $("tr:gt(0)").each(function() {
-        var td, a, tdId = $("td:eq(3)",$(this));
-        td = $("td:eq(0)", $(this));
-        a = $('a', td);
-        a.attr('href', "/rationRepository/ration" + "?repository=" + tdId.text());
-    })
-}
-function addEvent_DeleteLib(){
-    $("tr:gt(0)").each(function() {
-        var td0, a1,td2,a2;
-        td2 = $("td:eq(2)", $(this));
-        td0 = $("td:eq(0)", $(this));
-        a1 = $('a', td0);
-        var str = a1.text();
-        a2 = $("a:eq(1)",td2);
-        a2.click(function(){
-            $("#did").val(str)
-        })
-        // a.attr('href', "/ration/rationLib" + "?rationname=" + a.text());
-    })
-}
-
-function addEvent_EditLib(){
-    $("tr:gt(0)").each(function() {
-        var td0, a1,td2,a2;
-        td2 = $("td:eq(2)", $(this));
-        td0 = $("td:eq(0)", $(this));
-        a1 = $('a', td0);
-        var str = a1.text();
-        a2 = $("a:eq(0)",td2);
-        a2.click(function(){
-            $("#did").val(str)
-        })
-    })
-}
-
-$("#deleteLib").click(function(){
-    var rationLibName = $("#did").val();
-    $.ajax({
-        type:"POST",
-        url:"api/deleteRationLibs",
-        dataType:"json",
-        data:{"rationName": rationLibName},
-        cache:false,
-        timeout:50000,
-        success:function(result){
-            getRationLibs();
-        },
-        error:function(iqXHR,textStatus,errorThrown){
-
-        }
-    })
-
-
-});
-function getRationLibs(){
-    $.ajax({
-        type:"POST",
-        url:"api/getRationDisplayNames",
-        dataType:"json",
-        cache:false,
-        timeout:5000,
-        success:function(result){
-            $("tbody tr").html("");
-            for(var i=0;i<result.data.length;i++){
-                addLibTag(result.data[i].dispName, result.data[i].ID);
-                storageUtil.setSessionCache("RationGrp","repositoryID_" + result.data[i].ID, result.data[i].dispName);
-            }
-            addEvent_Addressdirect();
-            addEvent_DeleteLib();
-            addEvent_EditLib();
-        },
-        error:function(iqXHR,textStatus,errorThrown){
-            alert("error "+textStatus+" "+errorThrown);
-        }
-    })
-}
-
-function addLibTag(string, ID){
-    var $tr = $('<tr><td><a href="#"></a></td><td></td><td><a href="javacript:void(0);" data-toggle="modal" data-target="#edit" title="编辑"><i class="fa fa-pencil-square-o"></i></a> <a href="javacript:void(0);" data-toggle="modal"     data-target="#del" class="text-danger" title="删除"><i class="fa fa-remove"></i></a></td><td style="display:none"></td></tr>')
-    var $td0 = $("td:eq(0)",$tr);
-    var $td1 = $("td:eq(1)",$tr);
-    var $tdId = $("td:eq(3)",$tr);
-    var a = $("a",$td0);
-    var str = string;
-    a.text(str);
-    $tdId.text(ID);
-    var date = new Date().Format("yyyy-MM-dd");
-    $td1.text(date);
-    $tr.appendTo("tbody");
-}
-
-function addRationRepository(rationObj, $tdId) {
-    $.ajax({
-        type:"POST",
-        url:"api/addRationRepository",
-        dataType:"json",
-        data:{"rationRepObj": JSON.stringify(rationObj)},
-        cache:false,
-        timeout:5000,
-        success:function(result){
-            $tdId.text(result.data.ID);
-            storageUtil.setSessionCache("RationGrp","repositoryID_" + result.data.ID, result.data.dispName);
-            addEvent_Addressdirect();
-            addEvent_DeleteLib();
-        },
-        error:function(iqXHR,textStatus,errorThrown){
-            alert("error "+textStatus+" "+errorThrown);
-        }
-    })
-
-}
-
-$("#rationAdd").click(function(){
-    var $tr = $('<tr><td><a href="#"></a></td><td></td><td><a href="javacript:void(0);" data-toggle="modal" data-target="#edit" title="编辑"><i class="fa fa-pencil-square-o"></i></a> <a href="javacript:void(0);" data-toggle="modal" data-target="#del" class="text-danger" title="删除"><i class="fa fa-remove"></i></a></td><td style="display:none"></td></tr>')
-    var $td0 = $("td:eq(0)",$tr);
-    var $td1 = $("td:eq(1)",$tr);
-    var $tdId = $("td:eq(3)",$tr);
-    var a = $("a",$td0);
-    var str = $("#addInput").val();
-    a.text(str);
-    var date = new Date().Format("yyyy-MM-dd");
-    $td1.text(date);
-    $tr.appendTo("tbody");
-    var newRationRepObj = {};
-    newRationRepObj.dispName = str;
-    newRationRepObj.appType = "建筑";
-    newRationRepObj.descr = "";
-    addRationRepository(newRationRepObj, $tdId);
-});
-
-$("#edtOK").click(function(){
-    var str = $("#did").val();
-    var newStr = $("#inputRation").val();
-    $.ajax({
-        type:"POST",
-        url:"api/editRationLibs",
-        dataType:"json",
-        data:{"rationName": str,"newName":newStr},
-        cache:false,
-        timeout:50000,
-        success:function(result){
-            getRationLibs();
-        },
-        error:function(jqXHR){
-            var err = JSON.parse(jqXHR.responseText);
-            alert(err.error);
-        }
-    })
-
-});
-
-autoFlashHeight();

+ 0 - 278
web/maintain/ration_repository/js/ration.js

@@ -1,278 +0,0 @@
-/**
- * Created by Tony on 2017/4/28.
- */
-
-$("#gongliao").click(function(){
-    $(this).attr('href', "/rationRepository/lmm" + "?repository=" + getQueryString("repository"))
-});
-
-$("#fuzhu").click(function(){
-    $(this).attr('href', "/rationRepository/coeList" + "?repository=" + getQueryString("repository"))
-});
-
-var rationOprObj = {
-    workBook: null,
-    currentRations: {},
-    currentEditingRation: null,
-    currentSectionId: -1,
-    setting: {
-        header:[
-            {headerName:"编码",headerWidth:120,dataCode:"code", dataType: "String", formatter: "@"},
-            {headerName:"名称",headerWidth:300,dataCode:"name", dataType: "String"},
-            {headerName:"单位",headerWidth:120,dataCode:"unit", dataType: "String", hAlign: "center"},
-            {headerName:"基价",headerWidth:120,dataCode:"basePrice", dataType: "Number", formatter: "0.00", hAlign: "right"},
-            {headerName:"显示名称(以%s表示参数)",headerWidth:350,dataCode:"caption", dataType: "String"},
-            {headerName:"取费专业",headerWidth:120,dataCode:"feeType", dataType: "Number", hAlign: "center"}
-        ],
-        view:{
-            comboBox:[
-                {row:-1,col:2,rowCount:-1,colCount:1}
-            ],
-            lockedCells:[
-                {row:-1,col:3,rowCount:-1, colCount:1}
-            ]
-        }
-    },
-    buildSheet: function(container) {
-        var me = rationOprObj;
-        me.workBook = sheetCommonObj.buildSheet(container, me.setting, 30);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.ClipboardPasting, me.onClipboardPasting);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.ClipboardPasted, me.onClipboardPasted);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EditStarting, me.onCellEditStart);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EditEnded, me.onCellEditEnd);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.RangeChanged, me.onRangeChanged);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.CellClick, me.onCellClick);
-    },
-    onCellClick: function(sender, args) {
-        var me = rationOprObj, sheet = rationGLJOprObj.workBook.getSheet(0), setting = rationGLJOprObj.setting;
-        if(args.sheetArea === GC.Spread.Sheets.SheetArea.colHeader || args.sheetArea === GC.Spread.Sheets.SheetArea.corner){
-            sheetCommonObj.cleanSheet(sheet, setting, -1);
-            sheetCommonObj.shieldAllCells(sheet);
-        } else {
-            sheetCommonObj.cleanSheet(sheet, setting, -1);
-            sheetCommonObj.shieldAllCells(sheet);
-            var cacheSection = me.getCache();
-            if (cacheSection && args.row < cacheSection.length) {
-                rationGLJOprObj.getGljItems(cacheSection[args.row]);
-                rationCoeOprObj.getCoeItems(cacheSection[args.row]);
-            }
-        }
-        me.workBook.focus(true);
-    },
-    getCache: function() {
-        var me = this, rst = me.currentRations["_SEC_ID_" + me.currentSectionId];
-        if (!(rst)) {
-            me.currentRations["_SEC_ID_" + me.currentSectionId] = [];
-            rst = me.currentRations["_SEC_ID_" + me.currentSectionId];
-        }
-        return rst;
-    },
-    updateCache: function(addArr, updateArr, removeIds, result) {
-        var me = this, cacheSection = me.getCache();
-        if (addArr.length > 0) {
-            me.currentRations["_SEC_ID_" + me.currentSectionId] = cacheSection.concat(addArr);
-            cacheSection = me.currentRations["_SEC_ID_" + me.currentSectionId];
-        }
-        for (var i = removeIds.length - 1; i >= 0; i--) {
-            for (var j = cacheSection.length - 1; j >= 0 ; j--) {
-                if (cacheSection[j]["ID"] == removeIds[i]) {
-                    cacheSection.splice(j,1);
-                }
-            }
-        }
-        if (result && result.data.ops && result.data.ops.length > 0) {
-            for (var i = 0; i < result.data.ops.length; i++) {
-                for (var j = 0; j < cacheSection.length; j++) {
-                    if (cacheSection[j][me.setting.header[0].dataCode] == result.data.ops[i][me.setting.header[0].dataCode]) {
-                        cacheSection[j]["ID"] = result.data.ops[i]["ID"];
-                        cacheSection[j]["rationGljList"] = result.data.ops[i]["rationGljList"];
-                    }
-                }
-            }
-        }
-        for (var i = 0; i < updateArr.length; i++) {
-            for (var j = 0; j < cacheSection.length; j++) {
-                if (updateArr[i]["ID"] && cacheSection[j]["ID"]) {
-                    if (cacheSection[j]["ID"] == updateArr[i]["ID"]) {
-                        cacheSection[j] = updateArr[i];
-                    }
-                } else {
-                    if (cacheSection[j][me.setting.header[0].dataCode] == updateArr[i][me.setting.header[0].dataCode]) {
-                        cacheSection[j] = updateArr[i];
-                    }
-                }
-            }
-        }
-        return cacheSection;
-    },
-    onRangeChanged: function(sender, args) {
-        if (args.action == GC.Spread.Sheets.RangeChangedAction.clear) {
-            var me = rationOprObj, updateArr = [], removeArr = [];
-            var cacheSection = me.getCache();
-            if (cacheSection) {
-                for (var i = 0; i < args.rowCount; i++) {
-                    var hasUpdate = false, rObj = sheetCommonObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row + i),
-                        isEmpty = sheetCommonObj.chkIfEmpty(rObj, me.setting);
-                    for (var j = 0; j < cacheSection.length; j++) {
-                        if (cacheSection[j][me.setting.header[0].dataCode] == rObj[me.setting.header[0].dataCode]) {
-                            rObj["ID"] = cacheSection[j]["ID"];
-                            hasUpdate = true;
-                            break;
-                        }
-                    }
-                    if (hasUpdate) {
-                        if (isEmpty) {
-                            removeArr.push(rObj);
-                        } else updateArr.push(rObj);
-                    } else if (isEmpty) {
-                        if (args.row + i < cacheSection.length) {
-                            rObj["ID"] = cacheSection[args.row + i]["ID"];
-                            removeArr.push(rObj["ID"]);
-                        }
-                    }
-                }
-                me.mixUpdateRequest(updateArr, [], removeArr);
-                //removeRationItems
-            }
-        }
-    },
-    onCellEditStart: function(sender, args) {
-        var me = rationOprObj;
-        var rObj = sheetCommonObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row);
-        me.currentEditingRation = rObj;
-        var cacheSection = me.getCache();
-        if (cacheSection) {
-            for (var j = 0; j < cacheSection.length; j++) {
-                if (cacheSection[j][me.setting.header[0].dataCode] == rObj[me.setting.header[0].dataCode]) {
-                    rObj["ID"] = cacheSection[j]["ID"];
-                    break;
-                }
-            }
-        }
-    },
-    onCellEditEnd: function(sender, args) {
-        var me = rationOprObj, rObj = sheetCommonObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row),
-            updateArr = [], addArr = [];
-        if (me.currentEditingRation["ID"]) {
-            rObj["ID"] = me.currentEditingRation["ID"];
-            updateArr.push(rObj);
-        } else {
-            if (!sheetCommonObj.chkIfEmpty(rObj, me.setting)) {
-                addArr.push(rObj);
-            }
-        }
-        me.currentEditingRation = null;
-        if (updateArr.length > 0 || addArr.length > 0) {
-            me.mixUpdateRequest(updateArr, addArr, []);
-        }
-    },
-    onClipboardPasting: function(sender, args) {
-        var me = rationOprObj;
-        if (args.cellRange.colCount != me.setting.header.length) {
-            args.cancel = true;
-        }
-    },
-    onClipboardPasted: function(e, info) {
-        var me = rationOprObj;
-        var cacheSection = me.getCache();
-        var updateArr = [], addArr = [];
-        var items = sheetCommonObj.analyzePasteData(me.setting, info);
-        for (var i = 0; i < items.length; i++) {
-            if (cacheSection) {
-                var hasCacheItem = false;
-                for (var j = 0; j < cacheSection.length; j++) {
-                    if (cacheSection[j][me.setting.header[0].dataCode] == items[i][me.setting.header[0].dataCode]) {
-                        hasCacheItem = true;
-                        items[i]["ID"] = cacheSection[j]["ID"];
-                        break;
-                    }
-                }
-                if (!hasCacheItem) {
-                    addArr.push(items[i]);
-                } else {
-                    updateArr.push(items[i]);
-                }
-            } else {
-                addArr.push(items[i])
-            }
-        };
-        if (updateArr.length > 0 || addArr.length > 0) {
-            me.mixUpdateRequest(updateArr, addArr, []);
-        }
-    },
-    mixUpdateRequest: function(updateArr, addArr, removeIds) {
-        var me = rationOprObj;
-        $.ajax({
-            type:"POST",
-            url:"api/mixUpdateRationItems",
-            data:{"rationLibId": getQueryString("repository"), "sectionID": me.currentSectionId, "updateItems": JSON.stringify(updateArr), "addItems": JSON.stringify(addArr), "removeIds": JSON.stringify(removeIds)},
-            dataType:"json",
-            cache:false,
-            timeout:5000,
-            success:function(result){
-                if (result.err) {
-                    alert(err);
-                    me.getRationItems(me.currentSectionId);
-                } else {
-                    var cacheSection = me.updateCache(addArr, updateArr, removeIds, result);
-                    cacheSection.sort(function(a, b){
-                        var rst = 0;
-                        if (a.code > b.code) rst = 1
-                        else if (a.code < b.code) rst = -1;
-                        return rst;
-                    });
-                    me.showRationItems(me.currentSectionId);
-                }
-            },
-            error:function(){
-            }
-        });
-    },
-    getRationItems: function(sectionID){
-        if (sectionID != -1) {
-            var me = rationOprObj;
-            me.currentSectionId = sectionID;
-            if (me.currentRations["_SEC_ID_" + sectionID]) {
-                me.showRationItems(sectionID);
-                sheetCommonObj.unShieldAllCells(me.workBook.getSheet(0));
-                sheetCommonObj.lockCells(rationGLJOprObj.workBook.getSheet(0), rationGLJOprObj.setting);
-            } else {
-                $.ajax({
-                    type:"POST",
-                    url:"api/getRationItems",
-                    data:{"sectionID": sectionID},
-                    dataType:"json",
-                    cache:false,
-                    timeout:1000,
-                    success:function(result){
-                        if (result) {
-                            me.currentRations["_SEC_ID_" + sectionID] = result.data;
-                            me.showRationItems(sectionID);
-                            sheetCommonObj.unShieldAllCells(me.workBook.getSheet(0));
-                            sheetCommonObj.lockCells(rationGLJOprObj.workBook.getSheet(0), rationGLJOprObj.setting);
-                        } else {
-                            sheetCommonObj.shieldAllCells(me.workBook.getSheet(0));
-                            sheetCommonObj.shieldAllCells(rationGLJOprObj.workBook.getSheet(0));
-                        }
-                    },
-                    error:function(err){
-                        alert(err);
-                    }
-                })
-            }
-        }
-    },
-    showRationItems: function(sectionID){
-        var me = rationOprObj;
-        if (me.workBook) {
-            if (me.currentRations && me.currentRations["_SEC_ID_" + sectionID] && me.currentRations["_SEC_ID_" + sectionID].length > 0) {
-                var cacheSection = me.currentRations["_SEC_ID_" + sectionID];
-                sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
-                sheetCommonObj.showData(me.workBook.getSheet(0), me.setting, cacheSection);
-            } else {
-                //清除ration数据及工料机数据
-                sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
-            }
-        }
-    }
-}

+ 0 - 214
web/maintain/ration_repository/js/ration_coe.js

@@ -1,214 +0,0 @@
-/**
- * Created by CSL on 2017-06-08.
- */
-var rationCoeOprObj = {
-    workBook: null,
-    libID: -1,
-    currentRationItem: null,
-    cache: {},
-    setting: {
-        header:[
-            {headerName:"编号",headerWidth:160,dataCode:"ID", dataType: "Number"},
-            {headerName:"名称",headerWidth:400,dataCode:"name", dataType: "String"},
-            {headerName:"内容",headerWidth:500,dataCode:"content", dataType: "String"}
-        ],
-        view:{
-            comboBox:[],
-            lockColumns:[1,2]
-        }
-    },
-    buildSheet: function(container) {
-        var me = this;
-        me.libID = storageUtil.getSessionCache("RationGrp","repositoryID");
-        me.workBook = sheetCommonObj.buildSheet(container, me.setting, 30);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.ClipboardPasting, me.onClipboardPasting);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.ClipboardPasted, me.onClipboardPasted);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EditEnded, me.onCellEditEnd);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.RangeChanged, me.onRangeChanged);
-    },
-    onRangeChanged: function(sender, args) {
-        if (args.action == GC.Spread.Sheets.RangeChangedAction.clear) {
-            var me = rationCoeOprObj, updateArr = [], removeArr = [];
-            if (args.col == 0) {
-                if (me.cache["_Coe_" + me.currentRationItem.ID]) {
-                    var cacheArr = me.cache["_Coe_" + me.currentRationItem.ID];
-                    for (var i = args.rowCount - 1; i >= 0; i--) {
-                        if (args.row + i < cacheArr.length) {
-                            cacheArr.splice(args.row + i, 1);
-                        }
-                    }
-                    me.updateRationItem();
-                    sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
-                    me.showCoeItems(me.currentRationItem.ID);
-                }
-            }
-
-        }
-    },
-    onClipboardPasting: function(sender, args) {
-        var me = rationCoeOprObj;
-        if (args.cellRange.colCount != 1 || args.cellRange.col != 0 || !(me.currentRationItem)) {
-            args.cancel = true;
-        }
-    },
-    onClipboardPasted: function(e, info) {
-        var me = rationCoeOprObj;
-        if (me.libID) {
-            if (info.cellRange.col == 0) {
-                var tmpCoeIDs = sheetCommonObj.analyzePasteData({header:[{dataCode: "ID"}] }, info);
-                var IDs = [];
-                for (var i = 0; i < tmpCoeIDs.length; i++) {
-                    IDs.push(tmpCoeIDs[i].ID);
-                }
-                me.addCoeItems(IDs, me.libID);
-            } else {
-                //修改用量
-            }
-        }
-    },
-    onCellEditEnd: function(sender, args){
-        var me = rationCoeOprObj;
-        if (args.col = 0) {
-            //重新录入附注条件的ID
-            if (args.editingText == null || args.editingText.trim() == "") {
-                //delete
-                if (me.cache["_Coe_" + me.currentRationItem.ID]) {
-                    var cacheArr = me.cache["_Coe_" + me.currentRationItem.ID];
-                    if (args.row < cacheArr.length) {
-                        cacheArr.splice(args.row, 1);
-                        me.updateRationItem();
-                        sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
-                        me.showCoeItems(me.currentRationItem.ID);
-                    }
-                }
-            } else {
-                if (me.libID) {
-                    var coeIDs = [];
-                    coeIDs.push(args.editingText.trim());
-                    me.addCoeItems(coeIDs, me.libID);
-                }
-            }
-        }
-    },
-
-    addCoeItems: function(coeIDs, repId) {
-        var me = this;
-        $.ajax({
-            type:"POST",
-            url:"api/getCoeItemsByIDs",
-            data:{"coeIDs": JSON.stringify(coeIDs), repId: repId},
-            dataType:"json",
-            cache:false,
-            timeout:5000,
-            success:function(result){
-                sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
-                if (result) {
-                    var rstArr = [], newAddArr = [];
-                    for (var i = 0; i < result.data.length; i++) {
-                        rstArr.push(result.data[i]);
-                    };
-                    if (me.cache["_Coe_" + me.currentRationItem.ID]) {
-                        var cacheArr = me.cache["_Coe_" + me.currentRationItem.ID];
-                        for (var i = 0; i < rstArr.length; i++) {
-                            var hasDup = false;
-                            for (var j = 0; j < cacheArr.length; j++) {
-                                if (cacheArr[j].ID == rstArr[i].ID) {
-                                    hasDup = true;
-                                    break;
-                                }
-                            }
-                            if (!hasDup) {
-                                newAddArr.push(rstArr[i]);
-                            }
-                        }
-                        cacheArr.sort(function(a, b) {
-                            var rst = 0;
-                            if (a.ID > b.ID) rst = 1
-                            else if (a.ID < b.ID) rst = -1;
-                            return rst;
-                        });
-                        me.cache["_Coe_" + me.currentRationItem.ID] = cacheArr.concat(newAddArr);
-                    }
-                    me.showCoeItems(me.currentRationItem.ID);
-                    if (newAddArr.length > 0) {
-                        me.updateRationItem();
-                    }
-                }
-                sheetCommonObj.lockCells(me.workBook.getSheet(0), me.setting);
-            },
-            error:function(err){
-                alert(err);
-            }
-        })
-    },
-
-    updateRationItem: function() {
-        var me = this, updateArr = [];
-        if (me.currentRationItem) {
-            me.currentRationItem.rationCoeList = me.buildRationItemCoe();
-            updateArr.push(me.currentRationItem);
-            rationOprObj.mixUpdateRequest(updateArr, [], []);
-        }
-    },
-
-    buildRationItemCoe: function(){
-        var me = this, rst = [];
-        if (me.currentRationItem && me.cache["_Coe_" + me.currentRationItem.ID]) {
-            var cacheArr = me.cache["_Coe_" + me.currentRationItem.ID];
-            for (var i = 0; i < cacheArr.length; i++) {
-                rst.push({ID: cacheArr[i].ID});
-            }
-        }
-        return rst;
-    },
-
-    getCoeItems: function(rationItem) {
-        var me = this, rationID = rationItem.ID, rationCoeList = rationItem.rationCoeList;
-        if (rationCoeList == undefined){return;};
-
-        me.currentRationItem = rationItem;
-        if (me.cache["_Coe_" + rationID]) {
-            me.showCoeItems(rationID);
-            sheetCommonObj.lockCells(me.workBook.getSheet(0), me.setting);
-        } else {
-            $.ajax({
-                type:"POST",
-                url:"api/getCoeItemsByIDs",
-                data: {"data": JSON.stringify({"libID": me.libID, "coeIDs": rationCoeList})},
-                dataType:"json",
-                cache:false,
-                timeout:5000,
-                success:function(result){
-                    sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
-                    if (result) {
-                        alert(JSON.stringify(result.data));
-                        alert(JSON.stringify(rationCoeList));
-
-                        var cacheArr = [];
-                        for (var i = 0; i < result.data.length; i++) {
-                            for (var j = 0; j < rationCoeList.length; j++) {
-                                if (rationCoeList[j] == result.data[i].ID) {
-                                    cacheArr.push(result.data[i]);
-                                    break;
-                                }
-                            }
-                        };
-                        alert(JSON.stringify(cacheArr));
-                        me.cache["_Coe_" + rationID] = cacheArr;
-                        me.showCoeItems(rationID);
-                    }
-                    sheetCommonObj.lockCells(me.workBook.getSheet(0), me.setting);
-                },
-                error:function(err){
-                    alert(err);
-                }
-            })
-        }
-    },
-    showCoeItems: function(rationID) {
-        var me = this;
-        if (me.cache["_Coe_" + rationID]) {
-            sheetCommonObj.showData(me.workBook.getSheet(0), me.setting, me.cache["_Coe_" + rationID]);
-        }
-    }
-}

+ 0 - 236
web/maintain/ration_repository/js/ration_glj.js

@@ -1,236 +0,0 @@
-/**
- * Created by Tony on 2017/4/28.
- */
-var rationGLJOprObj = {
-    workBook: null,
-    currentRationItem: null,
-    cache: {},
-    setting: {
-        header:[
-            {headerName:"编码",headerWidth:160,dataCode:"code", dataType: "String", formatter: "@"},
-            {headerName:"名称",headerWidth:400,dataCode:"name", dataType: "String"},
-            {headerName:"单位",headerWidth:160,dataCode:"unit", dataType: "String"},
-            {headerName:"单位基价",headerWidth:160, dataCode:"basePrice", dataType: "Number", precision: 2},
-            {headerName:"定额消耗",headerWidth:160, dataCode:"consumeAmt", dataType: "Number", precision: 3},
-            {headerName:"类型",headerWidth:160,dataCode:"gljDistType", dataType: "String"}
-        ],
-        view:{
-            comboBox:[],
-            lockColumns:[1,2,3,5,6]
-        }
-    },
-    buildSheet: function(container) {
-        var me = this;
-        me.workBook = sheetCommonObj.buildSheet(container, me.setting, 30);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.ClipboardPasting, me.onClipboardPasting);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.ClipboardPasted, me.onClipboardPasted);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EditEnded, me.onCellEditEnd);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.RangeChanged, me.onRangeChanged);
-    },
-    onRangeChanged: function(sender, args) {
-        if (args.action == GC.Spread.Sheets.RangeChangedAction.clear) {
-            var me = rationGLJOprObj, updateArr = [], removeArr = [];
-            if (args.col == 0) {
-                if (me.cache["_GLJ_" + me.currentRationItem.ID]) {
-                    var cacheArr = me.cache["_GLJ_" + me.currentRationItem.ID];
-                    for (var i = args.rowCount - 1; i >= 0; i--) {
-                        if (args.row + i < cacheArr.length) {
-                            cacheArr.splice(args.row + i, 1);
-                        }
-                    }
-                    me.updateRationItem();
-                    sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
-                    me.showGljItems(me.currentRationItem.ID);
-                }
-            }
-
-        }
-    },
-    onClipboardPasting: function(sender, args) {
-        var me = rationGLJOprObj;
-        if (args.cellRange.colCount != 1 || args.cellRange.col != 0 || !(me.currentRationItem)) {
-            args.cancel = true;
-        }
-    },
-    onClipboardPasted: function(e, info) {
-        var me = rationGLJOprObj, repId = storageUtil.getSessionCache("RationGrp","repositoryID");
-        if (repId) {
-            if (info.cellRange.col == 0) {
-                var tmpCodes = sheetCommonObj.analyzePasteData({header:[{dataCode: "code"}] }, info);
-                var codes = [];
-                for (var i = 0; i < tmpCodes.length; i++) {
-                    codes.push(tmpCodes[i].code);
-                }
-                me.addGljItems(codes, repId);
-            } else {
-                //修改用量
-            }
-        }
-    },
-    onCellEditEnd: function(sender, args){
-        var me = rationGLJOprObj;
-        if (args.col != 0) {
-            var cacheArr = me.cache["_GLJ_" + me.currentRationItem.ID];
-            if (args.row < cacheArr.length) {
-                var editGlj = cacheArr[args.row];
-                if (editGlj["consumeAmt"] != args.editingText) {
-                    editGlj["consumeAmt"] = args.editingText;
-                    me.updateRationItem();
-                }
-            }
-        } else {
-            //重新更新工料机
-            if (args.editingText == null || args.editingText.trim() == "") {
-                //delete
-                if (me.cache["_GLJ_" + me.currentRationItem.ID]) {
-                    var cacheArr = me.cache["_GLJ_" + me.currentRationItem.ID];
-                    if (args.row < cacheArr.length) {
-                        cacheArr.splice(args.row, 1);
-                        me.updateRationItem();
-                        sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
-                        me.showGljItems(me.currentRationItem.ID);
-                    }
-                }
-            } else {
-                var repId = storageUtil.getSessionCache("RationGrp","repositoryID");
-                if (repId) {
-                    var codes = [];
-                    codes.push(args.editingText.trim());
-                    me.addGljItems(codes, repId);
-                }
-            }
-        }
-    },
-
-    addGljItems: function(codes, repId) {
-        var me = this;
-        $.ajax({
-            type:"POST",
-            url:"api/getGljItemsByCodes",
-            data:{"gljCodes": JSON.stringify(codes), repId: repId},
-            dataType:"json",
-            cache:false,
-            timeout:5000,
-            success:function(result){
-                sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
-                if (result) {
-                    var rstArr = [], dummyR = {gljId: 0, consumeAmt:0}, newAddArr = [];
-                    for (var i = 0; i < result.data.length; i++) {
-                        dummyR.gljId = result.data[i].ID;
-                        rstArr.push(me.createRationGljDisplayItem(dummyR, result.data[i]));
-                    }
-                    if (me.cache["_GLJ_" + me.currentRationItem.ID]) {
-                        var cacheArr = me.cache["_GLJ_" + me.currentRationItem.ID];
-                        for (var i = 0; i < rstArr.length; i++) {
-                            var hasDup = false;
-                            for (var j = 0; j < cacheArr.length; j++) {
-                                if (cacheArr[j].gljId == rstArr[i].gljId) {
-                                    hasDup = true;
-                                    break;
-                                }
-                            }
-                            if (!hasDup) {
-                                newAddArr.push(rstArr[i]);
-                            }
-                        }
-                        cacheArr.sort(function(a, b) {
-                            var rst = 0;
-                            if (a.code > b.code) rst = 1
-                            else if (a.code < b.code) rst = -1;
-                            return rst;
-                        });
-                        me.cache["_GLJ_" + me.currentRationItem.ID] = cacheArr.concat(newAddArr);
-                    }
-                    me.showGljItems(me.currentRationItem.ID);
-                    if (newAddArr.length > 0) {
-                        me.updateRationItem();
-                    }
-                }
-                sheetCommonObj.lockCells(me.workBook.getSheet(0), me.setting);
-            },
-            error:function(err){
-                alert(err);
-            }
-        })
-    },
-
-    updateRationItem: function() {
-        var me = this, updateArr = [];
-        if (me.currentRationItem) {
-            me.currentRationItem.rationGljList = me.buildRationItemGlj();
-            updateArr.push(me.currentRationItem);
-            rationOprObj.mixUpdateRequest(updateArr, [], []);
-        }
-    },
-
-    buildRationItemGlj: function(){
-        var me = this, rst = [];
-        if (me.currentRationItem && me.cache["_GLJ_" + me.currentRationItem.ID]) {
-            var cacheArr = me.cache["_GLJ_" + me.currentRationItem.ID];
-            for (var i = 0; i < cacheArr.length; i++) {
-                rst.push({gljId: cacheArr[i].gljId, consumeAmt: cacheArr[i].consumeAmt, proportion: 0});
-            }
-        }
-        return rst;
-    },
-
-    createRationGljDisplayItem: function(rItem, repGlj) {
-        var rst = {};
-        rst.gljId = rItem.gljId;
-        rst.consumeAmt = rItem.consumeAmt;
-        rst.code = repGlj.code;
-        rst.name = repGlj.name;
-        rst.specs = repGlj.specs;
-        rst.unit = repGlj.unit;
-        rst.basePrice = repGlj.basePrice;
-        rst.gljDistType = repGlj.gljDistType;
-        return rst;
-    },
-    getGljItems: function(rationItem) {
-        var me = this, rationID = rationItem.ID, rationGljList = rationItem.rationGljList;
-        me.currentRationItem = rationItem;
-        if (me.cache["_GLJ_" + rationID]) {
-            me.showGljItems(rationID);
-            sheetCommonObj.lockCells(me.workBook.getSheet(0), me.setting);
-        } else {
-            var gljIds = [];
-            for (var i = 0; i < rationGljList.length; i++) {
-                gljIds.push(rationGljList[i].gljId);
-            }
-            $.ajax({
-                type:"POST",
-                url:"api/getGljItemsByIds",
-                data:{"gljIds": JSON.stringify(gljIds)},
-                dataType:"json",
-                cache:false,
-                timeout:5000,
-                success:function(result){
-                    sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
-                    if (result) {
-                        var cacheArr = [];
-                        for (var i = 0; i < result.data.length; i++) {
-                            for (var j = 0; j < rationGljList.length; j++) {
-                                if (rationGljList[j].gljId == result.data[i].ID) {
-                                    cacheArr.push(me.createRationGljDisplayItem(rationGljList[j], result.data[i]));
-                                    break;
-                                }
-                            }
-                        }
-                        me.cache["_GLJ_" + rationID] = cacheArr;
-                        me.showGljItems(rationID);
-                    }
-                    sheetCommonObj.lockCells(me.workBook.getSheet(0), me.setting);
-                },
-                error:function(err){
-                    alert(err);
-                }
-            })
-        }
-    },
-    showGljItems: function(rationID) {
-        var me = this;
-        if (me.cache["_GLJ_" + rationID]) {
-            sheetCommonObj.showData(me.workBook.getSheet(0), me.setting, me.cache["_GLJ_" + rationID]);
-        }
-    }
-}

+ 0 - 457
web/maintain/ration_repository/js/repository_glj.js

@@ -1,457 +0,0 @@
-/**
- * Created by Tony on 2017/5/5.
- */
-
-$("#drirect-dinge").click(function(){
-    $(this).attr('href', "/rationRepository/ration" + "?repository=" + getQueryString("repository"))
-});
-
-$("#fuzhu").click(function(){
-    $(this).attr('href', "/rationRepository/coeList" + "?repository=" + getQueryString("repository"))
-});
-
-var pageOprObj = {
-    rationLibName : null,
-    initPage : function(container) {
-        var me = this, rationLibId = getQueryString("repository"),//获取定额库参数
-            rationLibName = storageUtil.getSessionCache("RationGrp","repositoryID_" + rationLibId);
-        if (rationLibName) {
-            var html = $("#rationname")[0].outerHTML;
-            html = html.replace("XXX定额库", rationLibName);
-            $("#rationname")[0].outerHTML = html;
-            me.rationLibName = rationLibName;
-            repositoryGljObj.currentRepositoryId = parseInt(rationLibId);
-            repositoryGljObj.getGljTree(rationLibId);
-            repositoryGljObj.buildSheet(container);
-            repositoryGljObj.getGljItems(rationLibId);
-            sheetCommonObj.shieldAllCells(repositoryGljObj.workBook.getSheet(0), repositoryGljObj.setting);
-        }
-    }
-}
-repositoryGljObj = {
-    treeObj : null,
-    workBook: null,
-    gljCurTypeId: -1,
-    currentRepositoryId: -1,
-    currentCache: null,
-    parentNodeIds: {},
-    gljList: [],
-    setting: {
-        header:[
-            {headerName:"编码",headerWidth:120,dataCode:"code", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"},
-            {headerName:"名称",headerWidth:260,dataCode:"name", dataType: "String", hAlign: "left", vAlign: "center"},
-            {headerName:"规格",headerWidth:260,dataCode:"specs", dataType: "String", hAlign: "left", vAlign: "center"},
-            {headerName:"单位",headerWidth:120,dataCode:"unit", dataType: "String", hAlign: "center", vAlign: "center"},
-            {headerName:"基价单价",headerWidth:120,dataCode:"basePrice", dataType: "Number", formatter: "0.00", hAlign: "right", vAlign: "center"},
-            {headerName:"类型",headerWidth:120,dataCode:"gljDistType", dataType: "String", hAlign: "center", vAlign: "center"}
-        ],
-        view:{
-            comboBox:[
-                {row:-1,col:3,rowCount:-1,colCount:1}
-            ],
-            lockedCells:[
-            ]
-        }
-    },
-    getGljTree: function(rationLibId) {
-        var me = this;
-        $.ajax({
-            type:"POST",
-            url:"api/getGljTree",
-            data:{"rationLibId": rationLibId},
-            dataType:"json",
-            cache:false,
-            timeout:20000,
-            success:function(result,textStatus,status){
-                if(status.status == 200) {
-                    zTreeHelper.createTree(result.data, gljSetting, "repositoryTree", me);
-                    if (result.data && result.data.length > 0) {
-                        me.gljCurTypeId = result.data[0].ID;
-                    } else {
-                        gljTypeTreeOprObj.addRootNode();
-                    }
-                }
-            },
-            error:function(err){
-                alert(err.responseJSON.error);
-            }
-        })
-    },
-    getGljItems: function(repId) {
-        var me = this;
-        $.ajax({
-            type:"POST",
-            url:"api/getGljItems",
-            data:{"repositoryId": repId},
-            dataType:"json",
-            cache:false,
-            timeout:5000,
-            success:function(result){
-                if(!result.error) {
-                    me.gljList = result.data;
-                    me.sortGlj();
-                    me.showGljItems(result.data, me.gljCurTypeId);
-                }
-            },
-            error:function(err){
-                alert(err.responseJSON.error);
-            }
-        })
-    },
-    showGljItems: function(data, type) {
-        var me = repositoryGljObj;
-        if (me.workBook) {
-            var cacheSection = [];
-            var pArr = me.parentNodeIds["_pNodeId_" + type];
-            for (var i = 0; i < data.length; i++) {
-                if (pArr && pArr.indexOf(data[i].gljType) >= 0) {
-                    cacheSection.push(data[i]);
-                } else if (type == data[i].gljType) {
-                    cacheSection.push(data[i]);
-                }
-            }
-            sheetCommonObj.cleanSheet(me.workBook.getSheet(0), me.setting, -1);
-            sheetCommonObj.showData(me.workBook.getSheet(0), me.setting, cacheSection);
-            cacheSection = null;
-        }
-    },
-    buildSheet: function(container) {
-        var me = repositoryGljObj;
-        me.workBook = sheetCommonObj.buildSheet(container, me.setting, 30);
-        me.workBook.bind(GC.Spread.Sheets.Events.ClipboardPasting, me.onClipboardPasting);
-        me.workBook.bind(GC.Spread.Sheets.Events.ClipboardPasted, me.onClipboardPasted);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EditStarting, me.onCellEditStart);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.EditEnded, me.onCellEditEnd);
-        me.workBook.getSheet(0).bind(GC.Spread.Sheets.Events.RangeChanged, me.onRangeChanged);
-    },
-    onCellEditStart: function(sender, args) {
-        var me = repositoryGljObj;
-        var rObj = sheetCommonObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row);
-        me.currentEditingGlj = rObj;
-        var cacheSection = me.gljList;
-        if (cacheSection) {
-            for (var j = 0; j < cacheSection.length; j++) {
-                if (cacheSection[j][me.setting.header[0].dataCode] == rObj[me.setting.header[0].dataCode]) {
-                    rObj["ID"] = cacheSection[j]["ID"];
-                    break;
-                }
-            }
-        }
-    },
-    onCellEditEnd: function(sender, args) {
-        var me = repositoryGljObj, rObj = sheetCommonObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row),
-            updateArr = [], addArr = [];
-        if (me.currentEditingGlj["ID"]) {
-            rObj["ID"] = me.currentEditingGlj["ID"];
-            updateArr.push(rObj);
-        } else {
-            addArr.push(rObj);
-        }
-        rObj.gljType = me.gljCurTypeId;
-        me.currentEditingGlj = null;
-        me.mixUpdateRequest(updateArr, addArr, []);
-    },
-    onRangeChanged: function(sender, args) {
-        if (args.action == GC.Spread.Sheets.RangeChangedAction.clear) {
-            var me = repositoryGljObj, updateArr = [], removeArr = [];
-            var cacheSection = me.currentCache;
-            if (cacheSection) {
-                for (var i = 0; i < args.rowCount; i++) {
-                    var hasUpdate = false, rObj = sheetCommonObj.combineRowData(me.workBook.getSheet(0), me.setting, args.row + i),
-                        isEmpty = sheetCommonObj.chkIfEmpty(rObj, me.setting);
-                    for (var j = 0; j < cacheSection.length; j++) {
-                        if (cacheSection[j][me.setting.header[0].dataCode] == rObj[me.setting.header[0].dataCode]) {
-                            rObj["ID"] = cacheSection[j]["ID"];
-                            hasUpdate = true;
-                            break;
-                        }
-                    }
-                    if (hasUpdate) {
-                        if (isEmpty) {
-                            removeArr.push(rObj["ID"]);
-                        } else updateArr.push(rObj);
-                    } else if (isEmpty) {
-                        if (args.row + i < cacheSection.length) {
-                            rObj["ID"] = cacheSection[args.row + i]["ID"];
-                            removeArr.push(rObj["ID"]);
-                        }
-                    }
-                }
-                me.mixUpdateRequest(updateArr, [], removeArr);
-            }
-        }
-    },
-    onClipboardPasting: function(sender, args) {
-        var me = repositoryGljObj;
-        if (args.cellRange.colCount != me.setting.header.length || me.gljCurTypeId < 0 || me.parentNodeIds["_pNodeId_" + me.gljCurTypeId]) {
-            args.cancel = true;
-        }
-    },
-    onClipboardPasted: function(e, info) {
-        var me = repositoryGljObj;
-        var updateArr = [], addArr = [];
-        var items = sheetCommonObj.analyzePasteData(me.setting, info);
-        var hasCacheItem = false;
-        for (var i = 0; i < items.length; i++) {
-            for (var j = 0; j < me.gljList.length; j++) {
-                if (me.gljList[j][me.setting.header[0].dataCode] == items[i][me.setting.header[0].dataCode]) {
-                    hasCacheItem = true;
-                    items[i]["ID"] = me.gljList[j]["ID"];
-                    break;
-                }
-            }
-            if (!hasCacheItem) {
-                items[i].gljType = me.gljCurTypeId;
-                addArr.push(items[i]);
-            } else {
-                updateArr.push(items[i]);
-            }
-        }
-        if (updateArr.length > 0 || addArr.length > 0) {
-            me.mixUpdateRequest(updateArr, addArr, []);
-        }
-    },
-    mixUpdateRequest: function(updateArr, addArr, removeIds) {
-        var me = repositoryGljObj;
-        $.ajax({
-            type:"POST",
-            url:"api/mixUpdateGljItems",
-            data:{"repositoryId": me.currentRepositoryId, "updateItems": JSON.stringify(updateArr), "addItems": JSON.stringify(addArr), "removeIds": JSON.stringify(removeIds)},
-            dataType:"json",
-            cache:false,
-            timeout:5000,
-            success:function(result){
-                if (result.error) {
-                    alert(result.message);
-                    me.getRationItems(me.currentRepositoryId);
-                } else {
-                    me.updateCache(addArr, updateArr, removeIds, result);
-                    me.sortGlj();
-                    me.currentCache = me.getCache();
-                    me.showGljItems(me.gljList, me.gljCurTypeId);
-                }
-            },
-            error:function(err){
-                alert("保存失败");
-            }
-        })
-    },
-    getCache: function() {
-        var me = this, rst = [];
-        for (var i = 0; i < me.gljList.length; i++) {
-            if (me.gljList[i].gljType == me.gljCurTypeId) {
-                rst.push(me.gljList[i]);
-            }
-        }
-        return rst;
-    },
-    updateCache: function(addArr, updateArr, removeIds, result) {
-        var me = this, cacheSection = me.gljList;
-        if (addArr.length > 0) {
-            me.gljList = me.gljList.concat(addArr);
-            cacheSection = me.gljList;
-        }
-        for (var i = removeIds.length - 1; i >= 0; i--) {
-            for (var j = cacheSection.length - 1; j >= 0 ; j--) {
-                if (cacheSection[j]["ID"] == removeIds[i]) {
-                    cacheSection.splice(j,1);
-                }
-            }
-        }
-        if (result && result.data.ops && result.data.ops.length > 0) {
-            for (var i = 0; i < result.data.ops.length; i++) {
-                for (var j = 0; j < cacheSection.length; j++) {
-                    if (cacheSection[j][me.setting.header[0].dataCode] == result.data.ops[i][me.setting.header[0].dataCode]) {
-                        cacheSection[j]["ID"] = result.data.ops[i]["ID"];
-                    }
-                }
-            }
-        }
-        for (var i = 0; i < updateArr.length; i++) {
-            for (var j = 0; j < cacheSection.length; j++) {
-                if (updateArr[i]["ID"] && cacheSection[j]["ID"]) {
-                    if (cacheSection[j]["ID"] == updateArr[i]["ID"]) {
-                        cacheSection[j] = updateArr[i];
-                    }
-                } else {
-                    if (cacheSection[j][me.setting.header[0].dataCode] == updateArr[i][me.setting.header[0].dataCode]) {
-                        cacheSection[j] = updateArr[i];
-                    }
-                }
-            }
-        }
-    },
-    sortGlj: function() {
-        var me = this;
-        me.gljList.sort(function(a, b){
-            var rst = 0;
-            if (a.code > b.code) rst = 1
-            else if (a.code < b.code) rst = -1;
-            return rst;
-        });
-    }
-}
-
-var gljTypeTreeOprObj = {
-    onClick: function(event,treeId,treeNode) {
-        var me = repositoryGljObj,
-            gljTypeId = treeNode.ID;
-        me.gljCurTypeId = treeNode.ID;
-        me.currentCache = me.getCache();
-        me.showGljItems(me.gljList, gljTypeId);
-        if (me.parentNodeIds["_pNodeId_" + treeNode.ID]) {
-            sheetCommonObj.shieldAllCells(me.workBook.getSheet(0), me.setting);
-        } else {
-            sheetCommonObj.unShieldAllCells(me.workBook.getSheet(0));
-        }
-    },
-    beforeRename: function(treeId, treeNode, newName, isCancel) {
-        if (newName.length == 0) {
-            return false;
-        }
-        return true;
-    },
-    onRename : function(e, treeId, treeNode, isCancel) {
-        var nodes = [];
-        nodes.push(treeNode);
-        gljTypeTreeOprObj.updateNodes(nodes);
-    },
-    onBeforeRemove: function(treeId, treeNode){
-        if (treeNode.ParentID == -1 && treeNode.isFirstNode) {
-            alert("不允许删除全部!");
-            return false;
-        }
-        if (!confirm("您确定要删除此节点及所有子节点的数据?删除后不可恢复!")) {
-            return false;
-        }
-        var nodeIds = [], preNode = treeNode.getPreNode(), preNodeId = -1;
-        if (preNode) {
-            preNodeId = preNode.ID;
-        }
-        private_fetchAllSubItems = function(pItem){
-            nodeIds.push(pItem.ID);
-            if (pItem.items && pItem.items.length > 0) {
-                for (var i = 0; i < pItem.items.length; i++) {
-                    private_fetchAllSubItems(pItem.items[i]);
-                }
-            }
-        };
-        nodeIds.push(treeNode.ID);
-        for (var i = 0; i < treeNode.items.length; i++) {
-            private_fetchAllSubItems(treeNode.items[i]);
-        }
-        $.ajax({
-            type:"POST",
-            url:"api/deleteGljNodes",
-            data:{"nodes": JSON.stringify(nodeIds), "preNodeId": preNodeId, "preNodeNextId": treeNode.NextSiblingID},
-            dataType:"json",
-            cache:false,
-            timeout:5000,
-            success:function(result,textStatus,status){
-                var pNode = treeNode.getParentNode();
-                if (pNode && pNode.items && pNode.items.length == 1) {
-                    pNode.isParent = false;
-                }
-            },
-            error:function(){
-            }
-        });
-        return true;
-    },
-    onRemove: function(e, treeId, treeNode){
-        var me = repositoryGljObj, pNode = me.treeObj.getNodeByTId(treeNode.parentTId);
-        if (pNode && pNode.items && pNode.items.length == 0) {
-            pNode.isParent = false;
-            me.treeObj.refresh();
-        }
-    },
-    updateNodes: function(nodes){
-        if (nodes && nodes.length > 0) {
-            var reqData = []
-            for (var i = 0; i < nodes.length; i++) {
-                var node = {};
-                node.repositoryId = nodes[i].repositoryId;
-                node.ID = nodes[i].ID;
-                node.ParentID = nodes[i].ParentID;
-                node.NextSiblingID = nodes[i].NextSiblingID;
-                node.Name = nodes[i].Name;
-                if (nodes[i].__v != null) node.__v = nodes[i].__v + 1
-                else node.__v = 0;
-                reqData.push(node);
-            }
-            $.ajax({
-                type:"POST",
-                url:"api/updateGljNodes",
-                data:{"nodes": JSON.stringify(reqData)},
-                dataType:"json",
-                cache:false,
-                timeout:5000,
-                success:function(result,textStatus,status){
-                    console.log(status + ' : ' + result);
-                },
-                error:function(){
-                }
-            })
-        }
-    },
-    addRootNode: function() {
-        var me = repositoryGljObj, rawNode = {ParentID: -1, NextSiblingID: -1, Name: "所有"}, lastNodeId = -1;
-        if (me.treeObj) {
-            var rootNodes = me.treeObj.getNodes();
-            if (rootNodes.length == 0) {
-                gljTypeTreeOprObj.addNewNode(rawNode, lastNodeId, function(err, rst){
-                    if (!(err)) {
-                        var newNodes = [], isSilent = false;
-                        newNodes.push({ repositoryId: rst.data.repositoryId, ID: rst.data.ID, ParentID: rst.data.ParentID, NextSiblingID:-1, Name:"所有",isParent:false, items:[]});
-                        me.treeObj.addNodes(null, -1, newNodes, isSilent);
-                    }
-                });
-            }
-        }
-    },
-    addNewNode : function(rawNode, lastNodeId, callback){
-        $.ajax({
-            type:"POST",
-            url:"api/createNewGljTypeNode",
-            data:{"repositoryId": repositoryGljObj.currentRepositoryId,"lastNodeId": lastNodeId, "rawNodeData": JSON.stringify(rawNode)},
-            dataType:"json",
-            cache:false,
-            timeout:1000,
-            success: function(result,textStatus,status){
-                callback(false, result);
-            },
-            error:function(err){
-                callback(err);
-            }
-        })
-    },
-    addHoverDom: function(treeId, treeNode) {
-        var me = repositoryGljObj, sObj = $("#" + treeNode.tId + "_span");
-        if (treeNode.editNameFlag || $("#addBtn_"+treeNode.tId).length>0) return;
-        var addStr = "<span class='button add' id='addBtn_" + treeNode.tId + "' title='新增子节点' onfocus='this.blur();'></span>";
-        sObj.after(addStr);
-        var btn = $("#addBtn_"+treeNode.tId);
-        if (btn) btn.bind("click", function(){
-            var rawNode = {ParentID: treeNode.ID, NextSiblingID: -1, Name: "新增子节点"}, lastNodeId = -1;
-            if (treeNode.items.length > 0) {
-                lastNodeId = treeNode.items[treeNode.items.length - 1].ID;
-            }
-            gljTypeTreeOprObj.addNewNode(rawNode, lastNodeId, function(err, rst){
-                if (!(err)) {
-                    var newNodes = [], isSilent = false;
-                    newNodes.push({ repositoryId: rst.data.repositoryId, ID: rst.data.ID, ParentID: rst.data.ParentID, NextSiblingID:-1, Name:"新增子节点",isParent:false, items:[]});
-                    treeNode.isParent = true;
-                    if (me.treeObj) {
-                        me.treeObj.addNodes(treeNode, -1, newNodes, isSilent);
-                    } else {
-                        me.treeObj = $.fn.zTree.init($("#rationChapterTree"), gljSetting, newNodes);
-                    }
-                }
-            });
-        });
-    },
-    removeHoverDom: function(treeId, treeNode) {
-        $("#addBtn_"+treeNode.tId).unbind().remove();
-    }
-
-}

+ 0 - 208
web/maintain/ration_repository/js/section_tree.js

@@ -1,208 +0,0 @@
-/**
- * Created by Tony on 2017/4/27.
- */
-
-var pageOprObj = {
-    rationLibName : null,
-    rationLibId : null,
-    initPage : function() {
-        var me = this, rationLibId = getQueryString("repository"),//获取定额库参数
-            rationLibName = storageUtil.getSessionCache("RationGrp","repositoryID_" + rationLibId);
-        if (rationLibName) {
-            var html = $("#rationname")[0].outerHTML;
-            html = html.replace("XXX定额库", rationLibName);
-            $("#rationname")[0].outerHTML = html;
-            me.rationLibName = rationLibName;
-            me.rationLibId = rationLibId;
-            zTreeOprObj.getRationTree(rationLibId);
-        }
-    }
-}
-var zTreeOprObj = {
-    treeObj: null,
-    getRationTree: function(rationLibId){
-        var me = this;
-        $.ajax({
-            type:"POST",
-            url:"api/getRationTree",
-            data:{"rationLibId": rationLibId},
-            dataType:"json",
-            cache:false,
-            timeout:20000,
-            success:function(result,textStatus,status){
-                if(status.status == 200) {
-                    if (result.data.length > 0) {
-                        storageUtil.setSessionCache("RationGrp","repositoryID",result.data[0].rationRepId);
-                    }
-                    zTreeHelper.createTree(result.data, setting, "rationChapterTree", me);
-                }
-            },
-            error:function(err){
-                alert(err.responseJSON.error);
-            }
-        })
-    },
-    addRootNode: function() {
-        var me = zTreeOprObj, rawNode = {ParentID: -1, NextSiblingID: -1, name: "新增节点"}, lastNodeId = -1;
-        if (me.treeObj) {
-            var rootNodes = me.treeObj.getNodes();
-            if (rootNodes.length > 0) {
-                lastNodeId = rootNodes[rootNodes.length - 1].ID;
-            }
-        }
-        me.addNewNode(rawNode, lastNodeId, function(err, rst){
-            if (!(err)) {
-                var newNodes = [], isSilent = false;
-                newNodes.push({ rationRepId: rst.data.rationRepId, ID: rst.data.ID, ParentID:-1, NextSiblingID:-1, name:"新增节点",isParent:false, items:[]});
-                if (me.treeObj) {
-                    me.treeObj.addNodes(null, -1, newNodes, isSilent);
-                } else {
-                    me.treeObj = $.fn.zTree.init($("#rationChapterTree"), setting, newNodes);
-                }
-            }
-        });
-    },
-    addNewNode : function(rawNode, lastNodeId, callback){
-        $.ajax({
-            type:"POST",
-            url:"api/createNewNode",
-            data:{"rationLibId":pageOprObj.rationLibId,"lastNodeId": lastNodeId, "rawNodeData": JSON.stringify(rawNode)},
-            dataType:"json",
-            cache:false,
-            timeout:1000,
-            success: function(result,textStatus,status){
-                callback(false, result);
-            },
-            error:function(err){
-                callback(err);
-            }
-        })
-    },
-    beforeRename: function(treeId, treeNode, newName, isCancel) {
-        if (newName.length == 0) {
-            return false;
-        }
-        return true;
-    },
-    onRename : function(e, treeId, treeNode, isCancel) {
-        var nodes = [];
-        nodes.push(treeNode);
-        zTreeOprObj.updateNodes(nodes);
-    },
-    onBeforeRemove: function(treeId, treeNode){
-        var nodeIds = [], preNode = treeNode.getPreNode(), preNodeId = -1;
-        if (preNode) {
-            preNodeId = preNode.ID;
-        }
-        private_fetchAllSubItems = function(pItem){
-            nodeIds.push(pItem.ID);
-            if (pItem.items && pItem.items.length > 0) {
-                for (var i = 0; i < pItem.items.length; i++) {
-                    private_fetchAllSubItems(pItem.items[i]);
-                }
-            }
-        };
-        nodeIds.push(treeNode.ID);
-        for (var i = 0; i < treeNode.items.length; i++) {
-            private_fetchAllSubItems(treeNode.items[i]);
-        }
-        $.ajax({
-            type:"POST",
-            url:"api/deleteNodes",
-            data:{"nodes": JSON.stringify(nodeIds), "preNodeId": preNodeId, "preNodeNextId": treeNode.NextSiblingID},
-            dataType:"json",
-            cache:false,
-            timeout:5000,
-            success:function(result,textStatus,status){
-                var pNode = treeNode.getParentNode();
-                if (pNode && pNode.items && pNode.items.length == 1) {
-                    pNode.isParent = false;
-                }
-            },
-            error:function(){
-            }
-        });
-        return true;
-    },
-    onRemove: function(e, treeId, treeNode){
-        var me = zTreeOprObj, pNode = me.treeObj.getNodeByTId(treeNode.parentTId);
-        if (pNode && pNode.items && pNode.items.length == 0) {
-            pNode.isParent = false;
-            me.treeObj.refresh();
-            //me.treeObj.updateNode(pNode, false); //这方法有后遗症,多次操作后会造成节点新增子节点时,父节点icon显示不正确
-        }
-    },
-    updateNodes: function(nodes){
-        if (nodes && nodes.length > 0) {
-            var reqData = []
-            for (var i = 0; i < nodes.length; i++) {
-                var node = {};
-                node.rationRepId = nodes[i].rationRepId;
-                node.ID = nodes[i].ID;
-                node.ParentID = nodes[i].ParentID;
-                node.NextSiblingID = nodes[i].NextSiblingID;
-                node.name = nodes[i].name;
-                if (nodes[i].__v != null) node.__v = nodes[i].__v + 1
-                else node.__v = 0;
-                reqData.push(node);
-            }
-            $.ajax({
-                type:"POST",
-                url:"api/updateNodes",
-                data:{"nodes": JSON.stringify(reqData)},
-                dataType:"json",
-                cache:false,
-                timeout:5000,
-                success:function(result,textStatus,status){
-                    console.log(status + ' : ' + result);
-                },
-                error:function(){
-                }
-            })
-        }
-    },
-    addHoverDom: function(treeId, treeNode) {
-        var me = zTreeOprObj, sObj = $("#" + treeNode.tId + "_span");
-        if (treeNode.editNameFlag || $("#addBtn_"+treeNode.tId).length>0) return;
-        var addStr = "<span class='button add' id='addBtn_" + treeNode.tId + "' title='新增子节点' onfocus='this.blur();'></span>";
-        sObj.after(addStr);
-        var btn = $("#addBtn_"+treeNode.tId);
-        if (btn) btn.bind("click", function(){
-            var rawNode = {ParentID: treeNode.ID, NextSiblingID: -1, name: "新增子节点"}, lastNodeId = -1, lastNode = null;
-            if (treeNode.items.length > 0) {
-                lastNodeId = treeNode.items[treeNode.items.length - 1].ID;
-                lastNode = treeNode.items[treeNode.items.length - 1];
-            }
-            zTreeOprObj.addNewNode(rawNode, lastNodeId, function(err, rst){
-                if (!(err)) {
-                    var newNodes = [], isSilent = false;
-                    if (lastNode) {
-                        lastNode.NextSiblingID = rst.ID;
-                    }
-                    newNodes.push({ rationRepId: rst.data.rationRepId, ID: rst.data.ID, ParentID: rst.data.ParentID, NextSiblingID:-1, name:"新增子节点",isParent:false, items:[]});
-                    treeNode.isParent = true;
-                    if (me.treeObj) {
-                        me.treeObj.addNodes(treeNode, -1, newNodes, isSilent);
-                    } else {
-                        me.treeObj = $.fn.zTree.init($("#rationChapterTree"), setting, newNodes);
-                    }
-                }
-            });
-        });
-    },
-    removeHoverDom: function(treeId, treeNode) {
-        $("#addBtn_"+treeNode.tId).unbind().remove();
-    },
-    onClick: function(event,treeId,treeNode) {
-        var sectionID = treeNode.ID;
-        if (!(treeNode.items) || treeNode.items.length == 0) {
-            rationOprObj.getRationItems(sectionID);
-        } else {
-            sheetCommonObj.cleanSheet(rationOprObj.workBook.getSheet(0), rationOprObj.setting, -1);
-            sheetCommonObj.shieldAllCells(rationOprObj.workBook.getSheet(0));
-        }
-        sheetCommonObj.cleanSheet(rationGLJOprObj.workBook.getSheet(0), rationGLJOprObj.setting, -1);
-        sheetCommonObj.shieldAllCells(rationGLJOprObj.workBook.getSheet(0));
-    }
-
-};

+ 0 - 136
web/maintain/ration_repository/main.html

@@ -1,136 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>定额库编辑器</title>
-    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
-   <!-- <link rel="stylesheet" href="css/bootstrap/themes.css">-->
-    <link rel="stylesheet" href="/web/maintain/ration_repository/css/main.css">
-    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
-    <!--zTree-->
-  	<link rel="stylesheet" href="/lib/ztree/css/zTreeStyle.css" type="text/css">
-</head>
-
-<body>
-    <div class="header">
-        <nav class="navbar navbar-toggleable-lg navbar-light bg-faded p-0 ">
-            <span class="header-logo px-2">Smartcost</span>
-            <div class="navbar-text"></div>
-        </nav>
-        <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
-          <ul class="nav navbar-nav px-1">
-                          <li class="nav-item">
-                              <a class="nav-link" href="javacript:void(0);" aria-haspopup="true" aria-expanded="false" data-toggle="modal" data-target="#add">新建定额库</a>
-                          </li>
-                      </ul>
-        </nav>
-    </div>
-    <div class="main">
-        <div class="content">
-            <div class="container-fluid">
-                <div class="row">
-                  <div class="col-md-8">
-                    <div class="warp-p2 mt-3">
-                      <table class="table table-hover table-bordered">
-                        <thead><tr><th>定额库名称</th><th width="160">添加时间</th><th width="90">操作</th></tr></thead>
-                        <tbody>
-                        </tbody>
-                      </table>
-                    </div>
-                  </div>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!--弹出添加-->
-    <div class="modal fade" id="add" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">添加定额库</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>定额库名称</label>
-                      <input class="form-control" id="addInput" placeholder="输入定额库名称" type="text">
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" id="rationAdd" class="btn btn-secondary" data-dismiss="modal">新建</button>
-                    <a href="" id="addCancel" class="btn btn-primary">取消</a>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!--弹出编辑-->
-    <div class="modal fade" id="edit" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">编辑定额库</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                  <form>
-                    <div class="form-group">
-                      <label>定额库名称</label>
-                      <input class="form-control" id = "inputRation" placeholder="输入编码" type="text" value="">
-                    </div>
-                  </form>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" id="edtCancel" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <button type="button"  id="edtOK" class="btn btn-secondary" data-dismiss="modal">确定</button>
-
-                </div>
-            </div>
-        </div>
-    </div>
-    <!--弹出删除-->
-    <div class="modal fade" id="del" data-backdrop="static" style="display: none;" aria-hidden="true">
-        <input type="hidden" id="did" value="123">
-        <div class="modal-dialog" role="document">
-            <div class="modal-content">
-                <div class="modal-header">
-                  <h5 class="modal-title">删除确认</h5>
-                  <button type="button" class="close" data-dismiss="modal" aria-label="Close">
-                    <span aria-hidden="true">×</span>
-                  </button>
-                </div>
-                <div class="modal-body">
-                    <h5 class="text-danger">删除后无法恢复,确认是否删除?</h5>
-                </div>
-                <div class="modal-footer">
-                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
-                    <a href="" id="deleteLib" class="btn btn-danger">删除</a>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!-- JS. -->
-    <script src="/lib/jquery/jquery.min.js"></script>
-    <script src="/lib/tether/tether.min.js"></script>
-    <script src="/lib/bootstrap/bootstrap.min.js"></script>
-    <script src="/web/maintain/ration_repository/js/global.js"></script>
-    <!-- zTree -->
-    <script type="text/javascript" src="/public/web/date_util.js"></script>
-  	<script type="text/javascript" src="/lib/ztree/jquery.ztree.core.js"></script>
-  	<script type="text/javascript" src="/lib/ztree/jquery.ztree.excheck.js"></script>
-    <script type="text/javascript" src="/web/maintain/ration_repository/js/main.js"></script>
-    <script type="text/javascript" src="/public/web/storageUtil.js"></script>
-</body>
-<script type="text/javascript">
-
-</script>
-
-</html>

+ 0 - 275
web/maintain/report/css/main.css

@@ -1,275 +0,0 @@
-/*building SAAS 0.1*/
-/*bootstrap 初始化*/
-body {
-    font-size: 0.9rem
-}
-.dropdown-menu {
-    font-size: 0.9rem
-}
-/*自定义css*/
-.header {
-    background: #e1e1e1
-}
-.header .header-logo {
-    background: #ff6501;
-    color: #fff;
-    float: left;
-    padding-top: .25rem;
-    padding-bottom: .25rem;
-    margin-right: 1rem;
-    font-size: 1.25rem;
-    line-height: inherit
-}
-.top-msg{
-  position: fixed;
-  top:0;
-  width:100%;
-  z-index: 999
-}
-.in-1{padding-left:0rem!important}
-.in-2{padding-left:1rem!important}
-.in-3{padding-left:1.5rem!important}
-.in-4{padding-left:2rem!important}
-.in-5{padding-left:2.5rem!important}
-.in-6{padding-left:3rem!important}
-.main {
-    position: relative;
-    background: #f7f7f9;
-}
-.main-nav {
-    position: absolute;
-    text-align: center;
-    z-index: 999;
-    padding: 2px 0 0 2px
-}
-.main-nav .nav a {
-    display: block;
-    width: 28px;
-    text-align: center;
-    line-height: 18px;
-    color: #999;
-    padding: 10px 0;
-    border-right: 1px solid #ccc;
-}
-.main-nav .nav a:hover {
-    background: #fff;
-    color: #333;
-    text-decoration: none;
-}
-.main-nav .nav a.active {
-    border: 1px solid #ccc;
-    border-right: 1px solid #fff;
-    background: #fff;
-    color: #333
-}
-.content {
-    background: #fff
-}
-.tools-btn {
-    height: 30px;
-    line-height: 30px;
-}
-.toolsbar .tools-btn.btn:hover {
-    background: #f7f7f9;
-}
-.main-side {
-    border-right: 1px solid #ccc;
-    overflow-y: auto;
-}
-.main-side .tab-bar {
-    padding:5px 10px;
-    height:38px;
-    position:fixed;
-}
-.main-side .tab-content {
-    margin-top: 38px
-}
-.top-content, .fluid-content {
-    overflow: hidden;
-    border-bottom: 1px solid #ccc;
-}
-.warp-p2 {
-    padding: 2px
-}
-.bottom-content .nav,.top-content .nav {
-    background: #f7f7f9;
-    padding:0 0 0 2px
-}
-.bottom-content .nav-tabs .nav-link, .side-tabs .nav-tabs .nav-link,.top-content .nav-tabs .nav-link {
-    border-radius: 0;
-    padding: 0.2em 0.5em
-}
-.side-tabs .nav-tabs .nav-item {
-  z-index: 999
-}
-.side-tabs .nav-tabs {
-    border-bottom: none;
-    margin-bottom: -1px
-}
-.side-tabs .nav-tabs .nav-link {
-    border-radius: 0;
-    padding: 0em 0.5em;
-    line-height: 30px;
-    z-index: 999
-}
-.bottom-content .nav-tabs .nav-link.active {
-    border-top: 1px solid #f7f7f9
-}
-.side-tabs .nav-tabs .nav-link.active {
-    border-top: none;
-    border-bottom:1px solid #fff
-}
-.side-tabs a.active, .sub-nav a.active {
-    background: #ccc
-}
-.poj-manage {
-    background: #fff
-}
-.slide-sidebar {
-    border-left: 1px solid #E1E1E1;
-    box-shadow: 0px 15px 15px rgba(0, 0, 0, 0.1);
-    background: none repeat scroll 0% 0% #ffffff;
-    overflow: hidden;
-    position: absolute;
-    right: 0px;
-    top: 0;
-    z-index: 999;
-    width: 0px;
-}
-.new-msg {
-    -webkit-animation: tada 1s infinite .2s ease both;
-    -moz-animation: tada 1s infinite .2s ease both;
-}
-@-webkit-keyframes tada {
-    0% {
-        -webkit-transform: scale(1)
-    }
-    10%, 20% {
-        -webkit-transform: scale(0.9) rotate(-3deg)
-    }
-    30%, 50%, 70%, 90% {
-        -webkit-transform: scale(1.1) rotate(3deg)
-    }
-    40%, 60%, 80% {
-        -webkit-transform: scale(1.1) rotate(-3deg)
-    }
-    100% {
-        -webkit-transform: scale(1) rotate(0)
-    }
-}
-@-moz-keyframes tada {
-    0% {
-        -moz-transform: scale(1)
-    }
-    10%, 20% {
-        -moz-transform: scale(0.9) rotate(-3deg)
-    }
-    30%, 50%, 70%, 90% {
-        -moz-transform: scale(1.1) rotate(3deg)
-    }
-    40%, 60%, 80% {
-        -moz-transform: scale(1.1) rotate(-3deg)
-    }
-    100% {
-        -moz-transform: scale(1) rotate(0)
-    }
-}
-.has-danger {
-    -webkit-animation: shake 1s .2s ease both;
-    -moz-animation: shake 1s .2s ease both;
-    animation: shake 1s .2s ease both;
-}
-@-webkit-keyframes shake {
-    0%, 100% {
-        -webkit-transform: translateX(0);
-    }
-    10%, 30%, 50%, 70%, 90% {
-        -webkit-transform: translateX(-10px);
-    }
-    20%, 40%, 60%, 80% {
-        -webkit-transform: translateX(10px);
-    }
-}
-@-moz-keyframes shake {
-    0%, 100% {
-        -moz-transform: translateX(0);
-    }
-    10%, 30%, 50%, 70%, 90% {
-        -moz-transform: translateX(-10px);
-    }
-    20%, 40%, 60%, 80% {
-        -moz-transform: translateX(10px);
-    }
-}
-@keyframes shake {
-    0%, 100% {
-        transform: translateX(0);
-    }
-    10%, 30%, 50%, 70%, 90% {
-        transform: translateX(-10px);
-    }
-    20%, 40%, 60%, 80% {
-        transform: translateX(10px);
-    }
-}
-.bottom-content {
-    height: 370px;
-    overflow: hidden;
-}
-.bottom-content .tab-content .main-data-bottom{
-    height: 340px;
-    overflow: auto;
-}
-.form-signin {
-    max-width: 500px;
-    margin: 150px auto;
-}
-.poj-list, .side-content {
-    overflow: auto;
-}
-.poj-list span.poj-icon {
-  padding-right:10px;
-  color:#ccc
-}
-.print-toolsbar{
-  padding:5px
-}
-.print-toolsbar .panel {
-  display:inline-block;
-  vertical-align:top;
-  background:#f7f7f9
-}
-.print-toolsbar .panel .panel-foot{
-  text-align: center;
-  font-size: 12px
-}
-.print-list {
-  border-right:1px solid #ccc
-}
-.print-list .form-list {
-  overflow: auto
-}
-.print-list .list-tools{
-  height:50px;
-  padding:10px 0;
-  border-bottom:1px solid #f2f2f2
-}
-.pageContainer {
-  background: #ededed;
-  text-align: center
-}
-.pageContainer .page{
-  border:9px solid transparent;
-  display: inline-block;
-}
-.pageContainer .page img{
-  width:inherit;
-  height: inherit;
-}
-.codeList{
-    max-height: 200px;
-    overflow:auto;
-}
-.main-data-top,.main-data-bottom,.main-data{
-  overflow: auto;
-}

+ 0 - 198
web/maintain/report/js/Jpc_Output.js

@@ -1,198 +0,0 @@
-/** Created by Tony on 2016/12/2. */
-JpcCanvasOutput = {
-    offsetX: 10,
-    offsetY: 10,
-    cleanCanvas: function (canvas) {
-        var ctx = canvas.getContext("2d");
-        ctx.save();
-        ctx.fillStyle="white";
-        ctx.clearRect(0,0, canvas.width, canvas.height);
-        ctx.restore();
-    },
-    drawToCanvas : function(pageObj, canvas, pageIdx) {
-        var me = this;
-        var ctx = canvas.getContext("2d");
-
-        function private_setupAreaH(area, type, fontAngle, dftFontHeight, outputPoint) {
-            var lType = type;
-            if (type != "left" && type != "right" && type != "center") lType = "left";
-            switch (lType) {
-                case "left":
-                    if (fontAngle == JV.VERTICAL_ANGLE) {
-                        outputPoint[1] = 1 * area[JV.IDX_TOP] + JV.OUTPUT_OFFSET[JV.OFFSET_IDX_LEFT];
-                    } else if (fontAngle == JV.ANTI_VERTICAL_ANGLE) {
-                        outputPoint[1] = 1 * area[JV.IDX_BOTTOM] - JV.OUTPUT_OFFSET[JV.OFFSET_IDX_LEFT];
-                    } else outputPoint[0] = 1 * area[JV.IDX_LEFT] + JV.OUTPUT_OFFSET[JV.OFFSET_IDX_LEFT];
-                    ctx.textAlign="start";
-                    break;
-                case "right":
-                    if (fontAngle == JV.VERTICAL_ANGLE) {
-                        outputPoint[1] = 1 * area[JV.IDX_BOTTOM] - JV.OUTPUT_OFFSET[JV.OFFSET_IDX_RIGHT];
-                    } else if (fontAngle == JV.ANTI_VERTICAL_ANGLE) {
-                        outputPoint[1] = 1 * area[JV.IDX_TOP] + JV.OUTPUT_OFFSET[JV.OFFSET_IDX_RIGHT];
-                    } else outputPoint[0] = 1 * area[JV.IDX_RIGHT] - JV.OUTPUT_OFFSET[JV.OFFSET_IDX_RIGHT];
-                    ctx.textAlign="end";
-                    break;
-                case "center":
-                    if (fontAngle == JV.VERTICAL_ANGLE || fontAngle == JV.ANTI_VERTICAL_ANGLE) {
-                        outputPoint[1] = (1 * area[JV.IDX_TOP] + 1 * area[JV.IDX_BOTTOM]) / 2;
-                    } else outputPoint[0] = (1 * area[JV.IDX_LEFT] + 1 * area[JV.IDX_RIGHT]) / 2;
-                    ctx.textAlign="center";
-                    break;
-            }
-        }
-        function private_setupAreaV(area, type, fontAngle, dftFontHeight, outputPoint) {
-            var lType = type;
-            if (type != "top" && type != "bottom" && type != "center") lType = "top";
-            switch (lType) {
-                case "top":
-                    if (fontAngle == JV.VERTICAL_ANGLE) {
-                        outputPoint[0] = 1 * area[JV.IDX_RIGHT] - dftFontHeight - JV.OUTPUT_OFFSET[JV.OFFSET_IDX_TOP];
-                    } else if (fontAngle == JV.ANTI_VERTICAL_ANGLE) {
-                        outputPoint[0] = 1 * area[JV.IDX_LEFT] + dftFontHeight + JV.OUTPUT_OFFSET[JV.OFFSET_IDX_TOP];
-                    } else outputPoint[1] = 1 * area[JV.IDX_TOP] + dftFontHeight + JV.OUTPUT_OFFSET[JV.OFFSET_IDX_TOP];
-                    break;
-                case "bottom":
-                    if (fontAngle == JV.VERTICAL_ANGLE) {
-                        outputPoint[0] = 1 * area[JV.IDX_LEFT] + JV.OUTPUT_OFFSET[JV.OFFSET_IDX_BOTTOM];
-                    } else if (fontAngle == JV.ANTI_VERTICAL_ANGLE) {
-                        outputPoint[0] = 1 * area[JV.IDX_RIGHT] - JV.OUTPUT_OFFSET[JV.OFFSET_IDX_BOTTOM];
-                    } else outputPoint[1] = 1 * area[JV.IDX_BOTTOM] - JV.OUTPUT_OFFSET[JV.OFFSET_IDX_BOTTOM];
-                    break;
-                case "center":
-                    if (fontAngle == JV.VERTICAL_ANGLE) {
-                        outputPoint[0] = (1 * area[JV.IDX_LEFT] + 1 * area[JV.IDX_RIGHT] - dftFontHeight) / 2;
-                    } else if (fontAngle == JV.ANTI_VERTICAL_ANGLE) {
-                        outputPoint[0] = (1 * area[JV.IDX_LEFT] + 1 * area[JV.IDX_RIGHT] + dftFontHeight) / 2;
-                    } else outputPoint[1] = (1 * area[JV.IDX_TOP] + 1 * area[JV.IDX_BOTTOM] + dftFontHeight) / 2;
-                    break;
-            }
-        }
-        function private_drawText(val, area, font, control) {
-            var dftFontHeight = 12;
-            var output = [];
-            if (font) {
-                dftFontHeight = 1 * font[JV.FONT_PROPS[1]];
-                var dftOthers = "";
-                var dftFontBold = font[JV.FONT_PROPS[3]];
-                if (dftFontBold && dftFontBold == 'T') {
-                    dftOthers = "bold " + dftOthers ;
-                }
-                var dftFontItalic = font[JV.FONT_PROPS[4]];
-                if (dftFontItalic && dftFontItalic == 'T') {
-                    dftOthers = dftOthers + "italic ";
-                }
-                ctx.font = dftOthers + dftFontHeight + "px " + font[JV.PROP_NAME];
-            }
-            if (control) {
-                private_setupAreaH(area, control.Horizon, font.FontAngle, dftFontHeight, output);
-                private_setupAreaV(area, control.Vertical, font.FontAngle, dftFontHeight, output);
-            } else {
-                private_setupAreaH(area, "left", font.FontAngle, dftFontHeight, output);
-                private_setupAreaV(area, "bottom", font.FontAngle, dftFontHeight, output);
-            }
-            var w = area[JV.IDX_RIGHT] - JV.OUTPUT_OFFSET[JV.OFFSET_IDX_RIGHT] - area[JV.IDX_LEFT] - JV.OUTPUT_OFFSET[JV.OFFSET_IDX_RIGHT];
-            if (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];
-            }
-            ctx.save();
-            ctx.translate(output[0], output[1]);
-            if (font.FontAngle == JV.VERTICAL_ANGLE) {
-                ctx.rotate(Math.PI/2);
-            } else if (font.FontAngle == JV.ANTI_VERTICAL_ANGLE) {
-                ctx.rotate(-Math.PI/2);
-            }
-            if (w >= ctx.measureText(val).width) {
-                ctx.fillText(val, 0, 0);
-            } else {
-                while (true) {
-                    dftFontHeight--;
-                    ctx.font = "" + dftFontHeight + "px " + font[JV.PROP_NAME];
-                    if (w >=  ctx.measureText(val).width || dftFontHeight < 6) {
-                        ctx.fillText(val, 0, 0);
-                        break;
-                    }
-                }
-            }
-            ctx.restore();
-        }
-        function private_drawCellText(cell, fonts, controls) {
-            if (cell[JV.PROP_VALUE]) {
-                var values = ("" + cell[JV.PROP_VALUE]).split('|');
-                var font = fonts[cell[JV.PROP_FONT]];
-                var control = controls[cell[JV.PROP_CONTROL]];
-                var height = cell[JV.PROP_AREA][JV.PROP_BOTTOM] - cell[JV.PROP_AREA][JV.PROP_TOP];
-                var area = [cell[JV.PROP_AREA][JV.PROP_LEFT] + me.offsetX, cell[JV.PROP_AREA][JV.PROP_TOP] + me.offsetY, cell[JV.PROP_AREA][JV.PROP_RIGHT] + me.offsetX, cell[JV.PROP_AREA][JV.PROP_BOTTOM] + me.offsetY];
-                for (var i = 0; i < values.length; i++) {
-                    area[JV.IDX_TOP] = cell[JV.PROP_AREA][JV.PROP_TOP] + i * (height / values.length) + me.offsetY;
-                    area[JV.IDX_BOTTOM] = cell[JV.PROP_AREA][JV.PROP_TOP] + (i + 1) * (height / values.length) + me.offsetY;
-                    private_drawText(values[i], area, font, control);
-                }
-            }
-        }
-        function private_drawLine(cell, ctx, style, styleBorderDest, startP, destP, mergedBand, styles) {
-            ctx.beginPath();
-            var destStyle = style;
-            if (mergedBand) {
-                if (mergedBand[styleBorderDest] == cell[JV.PROP_AREA][styleBorderDest]) {
-                    destStyle = styles[mergedBand[JV.PROP_STYLE][JV.PROP_ID]];
-                }
-            }
-            ctx.moveTo(cell[JV.PROP_AREA][startP[0]] + me.offsetX, cell[JV.PROP_AREA][startP[1]] + me.offsetY);
-            if (destStyle[styleBorderDest] && destStyle[styleBorderDest][JV.PROP_LINE_WEIGHT] != 0) {
-                ctx.lineWidth = 1.0 * destStyle[styleBorderDest][JV.PROP_LINE_WEIGHT];
-                ctx.strokeStyle = destStyle[styleBorderDest][JV.PROP_COLOR];
-                ctx.lineTo(cell[JV.PROP_AREA][destP[0]] + me.offsetX, cell[JV.PROP_AREA][destP[1]] + me.offsetY);
-            }
-            ctx.stroke();
-        }
-        function private_drawCell(cell, fonts, styles, controls, mergedBand) {
-            ctx.save();
-            ctx.translate(0.5,0.5);
-            var style = styles[cell[JV.PROP_STYLE]];
-            if (style) {
-                private_drawLine(cell, ctx, style, JV.PROP_TOP, [JV.PROP_LEFT, JV.PROP_TOP],[JV.PROP_RIGHT, JV.PROP_TOP], mergedBand, styles);
-                private_drawLine(cell, ctx, style, JV.PROP_RIGHT, [JV.PROP_RIGHT, JV.PROP_TOP],[JV.PROP_RIGHT, JV.PROP_BOTTOM], mergedBand, styles);
-                private_drawLine(cell, ctx, style, JV.PROP_BOTTOM, [JV.PROP_RIGHT, JV.PROP_BOTTOM],[JV.PROP_LEFT, JV.PROP_BOTTOM], mergedBand, styles);
-                private_drawLine(cell, ctx, style, JV.PROP_LEFT, [JV.PROP_LEFT, JV.PROP_BOTTOM],[JV.PROP_LEFT, JV.PROP_TOP], mergedBand, styles);
-            }
-            private_drawCellText(cell, fonts, controls);
-            ctx.restore();
-        }
-
-        if (pageObj && pageObj.items.length > 0 && canvas && pageObj.items.length >= pageIdx) {
-            var page = pageObj.items[pageIdx - 1],
-                fonts = pageObj[JV.NODE_FONT_COLLECTION],
-                styles = pageObj[JV.NODE_STYLE_COLLECTION],
-                controls = pageObj[JV.NODE_CONTROL_COLLECTION],
-                mergedBand = pageObj[JV.BAND_PROP_MERGE_BAND];
-            for (var j = 0; j < page.cells.length; j++) {
-                var cell = page.cells[j];
-                private_drawCell(cell, fonts, styles, controls, mergedBand);
-            }
-        }
-    },
-    drawPageBorder: function(rptTpl, canvas, resolution) {
-        var me = this;
-        var size = rptTpl[JV.NODE_PAGE_INFO].slice(0);
-        size[0] = Math.round(resolution[0] * size[0]);
-        size[1] = Math.round(resolution[0] * size[1]);
-
-        var ctx = canvas.getContext("2d");
-        ctx.save();
-        ctx.beginPath();
-        ctx.translate(0.5,0.5);
-        ctx.lineWidth = 1;
-        ctx.moveTo(me.offsetX, me.offsetY);
-        ctx.lineTo(size[0] + me.offsetX, me.offsetY);
-        ctx.lineTo(size[0] + me.offsetX, size[1] + me.offsetY);
-        ctx.lineTo(me.offsetX, size[1] + me.offsetY);
-        ctx.lineTo(me.offsetX, me.offsetY);
-        ctx.stroke();
-        ctx.restore();
-
-        ctx.fillStyle="black";
-        ctx.fillRect(size[0] + me.offsetX,10 + me.offsetY,10,size[1]);
-        ctx.fillRect(10 + me.offsetX,size[1] + me.offsetY,size[0],10);
-    }
-}

+ 0 - 42
web/maintain/report/js/global.js

@@ -1,42 +0,0 @@
-/*全局自适应高度*/
-function autoFlashHeight(){
-    var headerHeight = $(".header").height();
-    var bottomContentHeight = $(".bottom-content").height();
-    var toolsBar = $(".tools-bar").height();
-    $(".content").height($(window).height()-headerHeight);
-    $(".main-side").height($(window).height()-headerHeight-2);
-    $(".fluid-content").height($(window).height()-headerHeight-1);
-    $(".side-content").height($(window).height()-headerHeight );
-    $(".poj-list").height($(window).height()-headerHeight);
-    $(".form-list").height($(window).height()-headerHeight-50 );
-    $(".main-data-top").height($(window).height()-headerHeight-toolsBar-bottomContentHeight-2);
-    $(".main-data").height($(window).height()-headerHeight);
-};
-$(window).resize(autoFlashHeight);
-/*全局自适应高度结束*/
-$(function(){
-/*侧滑*/
-$(".open-sidebar").click(function(){
-    $(".slide-sidebar").animate({width:"800"}).addClass("open");
-});
-$("body").click(function(event){
-        var e = event || window.event; //浏览器兼容性
-        if(!$(event.target).is('a')) {
-            var elem = event.target || e.srcElement;
-            while (elem) { //循环判断至跟节点,防止点击的是div子元素
-                if (elem.className == "open-sidebar" || elem.className == 'slide-sidebar open') {
-                    return false;
-                }
-                elem = elem.parentNode;
-            }
-            $(".slide-sidebar").animate({width:"0"}).removeClass("open")// 关闭处理
-        }
-
-    });
-/*侧滑*/
-/*工具提示*/
-$('*[data-toggle=tooltip]').mouseover(function() {
- $(this).tooltip('show');
-  });
-/*工具提示*/
-});

+ 0 - 48
web/maintain/report/js/jpc_output_value_define.js

@@ -1,48 +0,0 @@
-/**
- * Created by Tony on 2017/1/4.
- */
-
-var JV = {
-    NODE_MAIN_INFO: "主信息",
-    NODE_PAGE_INFO: "打印页面_信息",
-    NODE_MARGINS: "页边距",
-
-    NODE_FONT_COLLECTION: "font_collection",
-    NODE_STYLE_COLLECTION: "style_collection",
-    NODE_CONTROL_COLLECTION: "control_collection",
-
-    BAND_PROP_MERGE_BAND: "MergeBand",
-
-    PROP_NAME: "Name",
-    PROP_VALUE: "Value",
-    PROP_FONT: "font",
-    PROP_CONTROL: "control",
-    PROP_STYLE: "style",
-    PROP_AREA: "area",
-    PROP_ID: "ID",
-    PROP_LEFT: "Left",
-    PROP_RIGHT: "Right",
-    PROP_TOP: "Top",
-    PROP_BOTTOM: "Bottom",
-
-    IDX_LEFT: 0,
-    IDX_TOP: 1,
-    IDX_RIGHT: 2,
-    IDX_BOTTOM: 3,
-
-    CONTROL_PROPS: ["Shrink", "ShowZero", "Horizon", "Vertical", "Wrap"],
-    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"],
-
-    OUTPUT_OFFSET: [2,1,2,3],
-    OFFSET_IDX_LEFT: 0,
-    OFFSET_IDX_RIGHT: 1,
-    OFFSET_IDX_TOP: 2,
-    OFFSET_IDX_BOTTOM: 3,
-
-    VERTICAL_ANGLE: "90",
-    ANTI_VERTICAL_ANGLE: "-90"
-}

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

@@ -1,243 +0,0 @@
-'use strict'
-
-let rptTplObj = {
-    iniPage: function() {
-        let me = this
-        zTreeOprObj.getReportTemplateTree(RT.GrpType.CONSTRUCT);
-    }
-}
-
-let zTreeOprObj = {
-    treeObj: null,
-    currentNode: null,
-    getReportTemplateTree: function(grpType) {
-        let me = zTreeOprObj, params = {};
-        params.grpType = grpType;
-        params.userId = userID;
-        params.tplType = RT.TplType.ALL;
-        CommonAjax.postEx("report_tpl_api/getRptTplTree", params, 20000, true, function(result){
-            zTreeHelper.createTree(result, setting, "rptTplTree", me);
-            me.refreshNodes();
-        }, null, null
-        );
-    },
-    refreshNodes: function() {
-        let me = this;
-        let private_setupIsParent = function(node){
-            if (node.nodeType == RT.NodeType.NODE) {
-                node.isParent = true;
-            } else {
-                node.isParent = false;
-            }
-            if (node.items && node.items.length) {
-                for (let i = 0; i < node.items.length; i++) {
-                    private_setupIsParent(node.items[i]);
-                }
-            }
-        };
-        let topNodes = me.treeObj.getNodes();
-        for (let i = 0; i < topNodes.length; i++) {
-            private_setupIsParent(topNodes[i]);
-        }
-        me.treeObj.refresh();
-    },
-    addRootNode: function() {
-        let me = this, rawNode = me.createIniRootNode(), lastNodeId = -1, lastNode = null;
-        if (me.treeObj) {
-            let rootNodes = me.treeObj.getNodes();
-            if (rootNodes.length > 0) {
-                lastNodeId = rootNodes[rootNodes.length - 1].ID;
-                lastNode = rootNodes[rootNodes.length - 1];
-            }
-            me.addNewNode(rawNode, lastNodeId, function(rst){
-                let newNodes = [], isSilent = false;
-                if (lastNode) {
-                    lastNode.NextSiblingID = rst.ID;
-                }
-                rawNode.ID = rst.ID;
-                rawNode.isParent = true;
-                rawNode.items = [];
-                newNodes.push(rawNode);
-                if (me.treeObj) {
-                    me.treeObj.addNodes(null, -1, newNodes, isSilent);
-                } else {
-                    me.treeObj = $.fn.zTree.init($("#rptTplTree"), setting, newNodes);
-                }
-            }, null);
-        }
-    },
-    updateNodes: function(nodes){
-        if (nodes && nodes.length > 0) {
-            let me = this;
-            for (let i = 0; i < nodes.length; i++) {
-                if (nodes[i].__v != null) node.__v = nodes[i].__v + 1
-                else nodes[i].__v = 0;
-            }
-            let params = {};
-            params.nodes = nodes;
-            CommonAjax.postEx("report_tpl_api/updateTptTplNodes", params, 5000, true, null, null, null);
-        }
-    },
-    addTplNode: function (){
-        let me = this;
-        if (me.currentNode) {
-            let rawNode = me.createIniRootNode(), lastNodeId = -1, lastNode = null;
-            rawNode.nodeType = RT.NodeType.TEMPLATE;
-            rawNode.ParentID = me.currentNode.ID;
-            rawNode.name = "新增报表模板";
-            if (me.treeObj) {
-                let nodes = me.currentNode.items;
-                if (nodes.length > 0) {
-                    lastNodeId = nodes[nodes.length - 1].ID;
-                    lastNode = nodes[nodes.length - 1];
-                }
-                me.addNewNode(rawNode, lastNodeId, function(rst){
-                    let newNodes = [], isSilent = false;
-                    if (lastNode) {
-                        lastNode.NextSiblingID = rst.ID;
-                    }
-                    rawNode.ID = rst.ID;
-                    rawNode.isParent = false;
-                    rawNode.items = [];
-                    newNodes.push(rawNode);
-                    if (me.treeObj) {
-                        me.treeObj.addNodes(me.currentNode, -1, newNodes, isSilent);
-                    } else {
-                        me.treeObj = $.fn.zTree.init($("#rptTplTree"), setting, newNodes);
-                    }
-                }, null);
-            }
-        }
-    },
-    addNewNode: function(rawNode, lastNodeId, callback, failcallback) {
-        let params = {};
-        params.lastNodeId = lastNodeId;
-        params.rawNodeData = rawNode;
-        CommonAjax.postEx("report_tpl_api/createTplTreeNode", params, 5000, true, callback, failcallback, null);
-    },
-    createIniRootNode: function() {
-        let rst = {
-            ID: -1,
-            ParentID: -1,
-            NextSiblingID: -1,
-            grpType: RT.GrpType.CONSTRUCT,
-            nodeType: RT.NodeType.NODE,
-            tplType: RT.TplType.ALL,
-            userId: userID,
-            refId: -1,
-            name: '新增节点'
-        };
-        return rst;
-    },
-    createNodeFromZTreeNode: function(treeNode) {
-        let rst = {};
-        rst.ID = treeNode.ID;
-        rst.ParentID = treeNode.ParentID;
-        rst.NextSiblingID = treeNode.NextSiblingID;
-        rst.grpType = treeNode.grpType;
-        rst.nodeType = treeNode.nodeType;
-        rst.tplType = treeNode.tplType;
-        rst.userId = treeNode.userId;
-        rst.refId = treeNode.refId;
-        rst.name = treeNode.name;
-        return rst;
-    },
-    addHoverDom: function(treeId, treeNode) {
-        let me = zTreeOprObj, sObj = $("#" + treeNode.tId + "_span");
-        if (treeNode.editNameFlag || $("#addBtn_"+treeNode.tId).length > 0 || treeNode.nodeType == RT.NodeType.TEMPLATE) return;
-        let addStr = "<span class='button add' id='addBtn_" + treeNode.tId + "' title='新增子节点' onfocus='this.blur();'></span>";
-        sObj.after(addStr);
-        let btn = $("#addBtn_"+treeNode.tId);
-        if (btn) btn.bind("click", function(){
-            let rawNode = me.createIniRootNode(), lastNodeId = -1, insertIdx = -1, lastNode = null;
-            rawNode.ParentID = treeNode.ID;
-            rawNode.name = "新增子节点";
-            if (treeNode.items.length > 0) {
-                for (let i = treeNode.items.length - 1; i >= 0; i--) {
-                    if (treeNode.items[i].nodeType == RT.NodeType.NODE) {
-                        lastNodeId = treeNode.items[i].ID;
-                        lastNode = treeNode.items[i];
-                        rawNode.NextSiblingID = treeNode.items[i].NextSiblingID;
-                        insertIdx = i + 1;
-                        break;
-                    } else {
-                        rawNode.NextSiblingID = treeNode.items[i].ID;
-                        insertIdx = i;
-                    }
-                }
-            }
-            zTreeOprObj.addNewNode(rawNode, lastNodeId, function(rst){
-                let newNodes = [], isSilent = false;
-                if (lastNode) {
-                    lastNode.NextSiblingID = rst.ID;
-                }
-                rawNode.ID = rst.ID;
-                rawNode.NextSiblingID = rst.NextSiblingID;
-                rawNode.isParent = true;
-                rawNode.items = [];
-                newNodes.push(rawNode);
-                treeNode.isParent = true;
-                if (me.treeObj) {
-                    me.treeObj.addNodes(treeNode, insertIdx, newNodes, isSilent);
-                } else {
-                    me.treeObj = $.fn.zTree.init($("#rptTplTree"), setting, newNodes);
-                }
-            }, null);
-        });
-    },
-    removeHoverDom: function(treeId, treeNode) {
-        $("#addBtn_"+treeNode.tId).unbind().remove();
-    },
-    onBeforeRemove: function(treeId, treeNode){
-        let nodeIds = [], preNode = treeNode.getPreNode(), preNodeId = -1, canRemove = false, params = {};
-        if (preNode) {
-            preNodeId = preNode.ID;
-        }
-        let private_fetchAllSubItems = function(pItem){
-            nodeIds.push(pItem.ID);
-            if (pItem.items && pItem.items.length > 0) {
-                for (let i = 0; i < pItem.items.length; i++) {
-                    private_fetchAllSubItems(pItem.items[i]);
-                }
-            }
-        };
-        nodeIds.push(treeNode.ID);
-        for (let i = 0; i < treeNode.items.length; i++) {
-            private_fetchAllSubItems(treeNode.items[i]);
-        }
-        params.nodeIds = nodeIds;
-        params.preNodeId = preNodeId;
-        params.preNodeNextId = treeNode.NextSiblingID;
-        CommonAjax.postEx("report_tpl_api/deleteTptTplNodes", params, 5000, false, function(data){
-            canRemove = true;
-        }, null, null);
-        return canRemove;
-    },
-    onRemove: function(e, treeId, treeNode){
-        let me = zTreeOprObj, pNode = me.treeObj.getNodeByTId(treeNode.parentTId);
-        if (pNode && pNode.items && pNode.items.length == 0) {
-            if (pNode.nodeType == RT.NodeType.NODE) pNode.isParent = true
-            else pNode.isParent = false;
-            me.treeObj.refresh();
-        }
-    },
-    beforeRename: function(treeId, treeNode, newName, isCancel) {
-        if (newName.length == 0) {
-            return false;
-        }
-        return true;
-    },
-    onRename : function(e, treeId, treeNode, isCancel) {
-        let me = zTreeOprObj, nodes = [];
-        nodes.push(me.createNodeFromZTreeNode(treeNode));
-        me.updateNodes(nodes);
-    },
-    onClick: function(event,treeId,treeNode) {
-        let me = zTreeOprObj;
-        if (treeNode.nodeType == RT.NodeType.NODE) {
-            me.currentNode = treeNode;
-        } else if (treeNode.nodeType == RT.NodeType.TEMPLATE) {
-            me.currentNode = null;
-        }
-    }
-}

+ 0 - 170
web/maintain/report/rpt_test.html

@@ -1,170 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-    <title>Report Demo!</title>
-</head>
-<body>
-    <!--
-    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
-    -->
-
-    <script src="/lib/jquery/jquery.min.js"></script>
-    <script type="text/javascript" src="/web/maintain/report/js/jpc_output_value_define.js"></script>
-    <script type="text/javascript" src="/web/maintain/report/js/jpc_output.js"></script>
-    <table id="forPrintHide">
-        <tr>
-            <td width="5"></td>
-            <td>
-                <select name="select1" id="select_k1" onchange="ajaxCall()">
-                    <option value="SC;07_1">07-1表</option>
-                    <option value="SC;08_2">08-2表</option>
-                    <option value="MEASURE;M_ZB03_QDZF_09">计量-清单支付09表</option>
-                </select>
-                <select name="select2" id="select_k2" onchange="ajaxCall()">
-                    <option value="A4">A4</option>
-                    <option value="A3">A3</option>
-                </select>
-            </td>
-            <td>
-                <input type="button" value="显示报表" onclick="ajaxCall()"/>
-                <input type="button" value="< 前一页" onclick="showPage(-1)"/>
-                <input type="button" value="后一页 >" onclick="showPage(1)"/>
-                <input type="button" value="打印" onclick="printCurrentPage()"/>
-                <input type="button" value="Excel" onclick="getExcel()"/>
-            </td>
-        </tr>
-    </table>
-    <canvas id="myCanvas" width="2000" height="1280">
-    </canvas>
-</body>
-<style>
-    body {
-        margin: 0px;
-        padding: 0px;
-    }
-    #myCanvas {
-        border: 0px solid #9C9898;
-    }
-</style>
-<script>
-    var currentPage = 1;
-    var pageRst = null;
-    var currentRptTpl = null;
-    var maxPages = 20;
-    var defProperties = null;
-    var rpt_grp = null;
-    var rpt_id = null;
-    var rpt_size = null;
-
-    function printCurrentPage() {
-        if (currentRptTpl) {
-            //$("table#forPrintHide").css
-            $("table#forPrintHide").css("display","none");
-            window.print();
-            //$("canvas#myCanvas").printArea();
-        }
-    }
-
-    function getScreenDPI() {
-        var me = this, arrDPI = [];
-        if (window.screen.deviceXDPI != undefined) {
-            arrDPI.push(window.screen.deviceXDPI);
-            arrDPI.push(window.screen.deviceYDPI);
-        } else {
-            var tmpNode = document.createElement("DIV");
-            tmpNode.style.cssText = "width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden";
-            document.body.appendChild(tmpNode);
-            arrDPI.push(parseInt(tmpNode.offsetWidth));
-            arrDPI.push(parseInt(tmpNode.offsetHeight));
-            tmpNode.parentNode.removeChild(tmpNode);
-        }
-        return arrDPI;
-    }
-
-    function setupReport() {
-        var rst = false;
-        var rpt = document.getElementById("select_k1");
-        var size = document.getElementById("select_k2");
-        if (rpt.selectedIndex >= 0 && size.selectedIndex >= 0) {
-            var strs = rpt.options[rpt.selectedIndex].value.split(';');
-            rpt_grp = strs[0];
-            rpt_id = strs[1];
-            rpt_size = size.options[size.selectedIndex].value;
-            rst = true;
-        }
-        return rst;
-    }
-
-    function showPage(pageStep, cv) {
-        if (currentPage + pageStep >= 1 && currentPage + pageStep <= maxPages) {
-            currentPage = currentPage + pageStep;
-            var canvas = null;
-            if (cv) {
-                canvas = cv;
-            } else canvas = document.getElementById("myCanvas");
-            JpcCanvasOutput.cleanCanvas(canvas);
-            JpcCanvasOutput.drawPageBorder(currentRptTpl, canvas, getScreenDPI());
-            JpcCanvasOutput.drawToCanvas(pageRst, canvas, currentPage);
-        }
-    }
-
-    function getDummyExcel() {
-        var id = "dummy_request_id";
-        var p1 = "dummy_paramm_2";
-        var url =  "/report_api/getDummyExcel/" + id + "/" + p1;
-        window.location = url;//这里不能使用get方法跳转,否则下载不成功
-    }
-
-    function getExcel() {
-        var rpt = document.getElementById("select_k1");
-        var size = document.getElementById("select_k2");
-        var rpt_name = rpt.options[rpt.selectedIndex].text;
-        if (rpt.selectedIndex >= 0 && size.selectedIndex >= 0) {
-            var strs = rpt.options[rpt.selectedIndex].value.split(';');
-            rpt_grp = strs[0];
-            rpt_id = strs[1];
-            rpt_size = size.options[size.selectedIndex].value;
-        }
-        var url =  "/report_api/getExcel/" + rpt_grp + "/" + rpt_id + "/" + rpt_size + "/" + rpt_name;
-        window.location = url;//这里不能使用get方法跳转,否则下载不成功
-    }
-
-    function ajaxCall() {
-        if (setupReport()) {
-            var canvas = document.getElementById("myCanvas");
-            canvas.style.cursor = "wait";
-            $.ajax({
-                type:"POST",
-                url: 'report_api/getReport',
-                data: {"grp_id": rpt_grp, "tpl_id": rpt_id, "pageSize": rpt_size},
-                dataType: 'json',
-                cache: false,
-                timeout: 15000,
-                success: function(result){
-                    canvas.style.cursor = "default";
-                    currentPage = 1;
-                    pageRst = result.data;
-                    if (pageRst) {
-                        maxPages = pageRst.items.length;
-                        currentRptTpl = pageRst;
-                        if (rpt_size === "A4") {
-                            canvas.width = 1200;
-                            canvas.height = 900;
-                        } else if (rpt_size === "A3") {
-                            canvas.width = 1880;
-                            canvas.height = 1200;
-                        }
-                        showPage(0, canvas);
-                    }
-                },
-                error: function(jqXHR, textStatus, errorThrown){
-                    canvas.style.cursor = "default";
-                    alert('error ' + textStatus + " " + errorThrown);
-                }
-            });
-        }
-    }
-</script>
-
-</html>

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

@@ -1,113 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
-    <meta charset="utf-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>报表模板编辑器</title>
-    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
-    <!-- <link rel="stylesheet" href="css/bootstrap/themes.css">-->
-    <link rel="stylesheet" href="/web/maintain/report/css/main.css">
-    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
-    <!--zTree-->
-    <link rel="stylesheet" href="/lib/ztree/css/zTreeStyle.css" type="text/css">
-    <script>
-        // 这里的变量供页面调用
-        var userAccount = '<%- userAccount %>';
-        var userID = '<%- userID %>';
-    </script>
-</head>
-
-<body>
-<div class="header">
-    <nav class="navbar navbar-toggleable-lg navbar-light bg-faded p-0 ">
-        <span class="header-logo px-2">Smartcost</span>
-        <div class="navbar-text"></div>
-    </nav>
-    <nav class="navbar navbar-toggleable-lg justify-content-between navbar-light p-0">
-        <ul class="nav navbar-nav px-1">
-            <li class="nav-item">
-                <a class="nav-link" href="javacript:void(0);" aria-haspopup="true" aria-expanded="false" data-toggle="modal" data-target="#add">报表模板库</a>
-            </li>
-        </ul>
-    </nav>
-</div>
-<div class="main">
-    <div class="content">
-        <div class="container-fluid">
-            <div class="row">
-                <div class="main-side col-lg-3 p-0">
-                    <div class="tab-bar">
-                        <a onclick="zTreeOprObj.addRootNode()" class="btn btn-secondary btn-sm">增加根节点</a>
-                        <a onclick="zTreeOprObj.addTplNode()" class="btn btn-secondary btn-sm">增加模板节点</a>
-                    </div>
-                    <div class="tab-content">
-                        <ul id="rptTplTree" class="ztree"></ul>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-<!-- JS. -->
-<script src="/lib/jquery/jquery.min.js"></script>
-<script src="/lib/tether/tether.min.js"></script>
-<script src="/lib/bootstrap/bootstrap.min.js"></script>
-<script src="/web/maintain/report/js/global.js"></script>
-<script src="/web/maintain/report/js/rpt_tpl_main.js"></script>
-<!-- zTree -->
-<script type="text/javascript" src="/public/web/date_util.js"></script>
-<script type="text/javascript" src="/lib/ztree/jquery.ztree.core.js"></script>
-<script type="text/javascript" src="/lib/ztree/jquery.ztree.excheck.js"></script>
-<script type="text/javascript" src="/lib/ztree/jquery.ztree.exedit.js"></script>
-<script type="text/javascript" src="/public/web/storageUtil.js"></script>
-<script type="text/javascript" src="/public/web/rpt_tpl_def.js"></script>
-<script type="text/javascript" src="/public/web/common_ajax.js"></script>
-<script type="text/javascript" src="/public/web/treeDataHelper.js"></script>
-<script type="text/javascript" src="/public/web/ztree_common.js"></script>
-</body>
-<script type="text/javascript">
-    var setting = {
-        view: {
-            addHoverDom: zTreeOprObj.addHoverDom,
-            removeHoverDom: zTreeOprObj.removeHoverDom,
-            expandSpeed: "",
-            selectedMulti: false
-        },
-        edit: {
-            enable: true,
-            editNameSelectAll: true,
-            showRemoveBtn: true,
-            showRenameBtn: true,
-            removeTitle: "删除节点",
-            renameTitle: "更改名称"
-        },
-        data: {
-            keep: {
-                parent:true,
-                leaf:true
-            },
-            key: {
-                children: "items"
-            },
-            simpleData: {
-                enable: true,
-                idKey: "ID",
-                pIdKey: "ParentID",
-                rootPId: -1
-            }
-        },
-        callback:{
-            onClick: zTreeOprObj.onClick,
-            beforeRename: zTreeOprObj.beforeRename,
-            beforeRemove: zTreeOprObj.onBeforeRemove,
-            onRemove: zTreeOprObj.onRemove,
-            onRename: zTreeOprObj.onRename
-        }
-    };
-    autoFlashHeight();
-    rptTplObj.iniPage();
-</script>
-
-</html>

+ 0 - 274
web/maintain/templates/css/main.css

@@ -1,274 +0,0 @@
-/*building SAAS 0.1*/
-/*bootstrap 初始化*/
-body {
-    font-size: 0.9rem;
-    overflow: hidden;
-}
-.dropdown-menu {
-    font-size: 0.9rem
-}
-/*自定义css*/
-.header {
-    background: #e1e1e1
-}
-.header .header-logo {
-    background: #ff6501;
-    color: #fff;
-    float: left;
-    padding-top: .25rem;
-    padding-bottom: .25rem;
-    margin-right: 1rem;
-    font-size: 1.25rem;
-    line-height: inherit
-}
-.top-msg{
-  position: fixed;
-  top:0;
-  width:100%;
-  z-index: 999
-}
-.in-1{padding-left:0px!important}
-.in-2{padding-left:21px!important}
-.in-3{padding-left:42px!important}
-.in-4{padding-left:63px!important}
-.in-5{padding-left:84px!important}
-.in-6{padding-left:105px!important}
-.main {
-    position: relative;
-    background: #f7f7f9;
-}
-.main-nav {
-    position: absolute;
-    text-align: center;
-    z-index: 999;
-    padding: 2px 0 0 2px
-}
-.main-nav .nav a {
-    display: block;
-    width: 28px;
-    text-align: center;
-    line-height: 18px;
-    color: #999;
-    padding: 10px 0;
-    border-right: 1px solid #ccc;
-}
-.main-nav .nav a:hover {
-    background: #fff;
-    color: #333;
-    text-decoration: none;
-}
-.main-nav .nav a.active {
-    border: 1px solid #ccc;
-    border-right: 1px solid #fff;
-    background: #fff;
-    color: #333
-}
-.main-nav .nav-tabs{
-  border-bottom: none
-}
-.content {
-    border-left: 1px solid #ccc;
-    margin-left: 29px;
-    background: #fff
-}
-.tools-btn {
-    height: 30px;
-    line-height: 30px;
-}
-.toolsbar .tools-btn.btn:hover {
-    background: #f7f7f9;
-}
-.main-side {
-    border-top: 1px solid #ccc;
-    border-left: 1px solid #ccc;
-    overflow-y: hidden;
-}
-.sidebar-bottom,.sidebar-bottom .col-lg-6,.sidebar-bottom .col-lg-12 {
-  height:200px
-}
-.top-content, .fluid-content {
-    overflow: auto;
-    border-bottom: 1px solid #ccc;
-}
-.bottom-content .nav {
-    background: #f7f7f9;
-    padding:0 0 0 2px
-}
-.bottom-content .nav-tabs .nav-link, .side-tabs .nav-tabs .nav-link {
-    border-radius: 0;
-    padding: 0.2em 0.5em
-}
-.side-tabs .nav-tabs .nav-item {
-  z-index: 999
-}
-.side-tabs .nav-tabs {
-    border-bottom: none;
-    margin-bottom: -1px
-}
-.side-tabs .nav-tabs .nav-link {
-    border-radius: 0;
-    padding: 0em 0.5em;
-    line-height: 30px;
-    z-index: 999
-}
-.bottom-content .nav-tabs .nav-link.active {
-    border-top: 1px solid #f7f7f9
-}
-.side-tabs .nav-tabs .nav-link.active {
-    border-top: none;
-    border-bottom:1px solid #fff
-}
-.side-tabs a.active, .sub-nav a.active {
-    background: #ccc
-}
-.poj-manage {
-    background: #fff
-}
-.slide-sidebar {
-    border-left: 1px solid #E1E1E1;
-    box-shadow: 0px 15px 15px rgba(0, 0, 0, 0.1);
-    background: none repeat scroll 0% 0% #ffffff;
-    overflow: hidden;
-    position: absolute;
-    right: 0px;
-    top: 0;
-    z-index: 999;
-    width: 0px;
-}
-.new-msg {
-    -webkit-animation: tada 1s infinite .2s ease both;
-    -moz-animation: tada 1s infinite .2s ease both;
-}
-@-webkit-keyframes tada {
-    0% {
-        -webkit-transform: scale(1)
-    }
-    10%, 20% {
-        -webkit-transform: scale(0.9) rotate(-3deg)
-    }
-    30%, 50%, 70%, 90% {
-        -webkit-transform: scale(1.1) rotate(3deg)
-    }
-    40%, 60%, 80% {
-        -webkit-transform: scale(1.1) rotate(-3deg)
-    }
-    100% {
-        -webkit-transform: scale(1) rotate(0)
-    }
-}
-@-moz-keyframes tada {
-    0% {
-        -moz-transform: scale(1)
-    }
-    10%, 20% {
-        -moz-transform: scale(0.9) rotate(-3deg)
-    }
-    30%, 50%, 70%, 90% {
-        -moz-transform: scale(1.1) rotate(3deg)
-    }
-    40%, 60%, 80% {
-        -moz-transform: scale(1.1) rotate(-3deg)
-    }
-    100% {
-        -moz-transform: scale(1) rotate(0)
-    }
-}
-.has-danger {
-    -webkit-animation: shake 1s .2s ease both;
-    -moz-animation: shake 1s .2s ease both;
-    animation: shake 1s .2s ease both;
-}
-@-webkit-keyframes shake {
-    0%, 100% {
-        -webkit-transform: translateX(0);
-    }
-    10%, 30%, 50%, 70%, 90% {
-        -webkit-transform: translateX(-10px);
-    }
-    20%, 40%, 60%, 80% {
-        -webkit-transform: translateX(10px);
-    }
-}
-@-moz-keyframes shake {
-    0%, 100% {
-        -moz-transform: translateX(0);
-    }
-    10%, 30%, 50%, 70%, 90% {
-        -moz-transform: translateX(-10px);
-    }
-    20%, 40%, 60%, 80% {
-        -moz-transform: translateX(10px);
-    }
-}
-@keyframes shake {
-    0%, 100% {
-        transform: translateX(0);
-    }
-    10%, 30%, 50%, 70%, 90% {
-        transform: translateX(-10px);
-    }
-    20%, 40%, 60%, 80% {
-        transform: translateX(10px);
-    }
-}
-.bottom-content .tab-content .main-data-bottom{
-    height: 200px;
-    overflow: auto;
-}
-.bottom-content .tab-content .ovf-hidden{
-    overflow: hidden;
-}
-.form-signin {
-    max-width: 500px;
-    margin: 150px auto;
-}
-.poj-list, .side-content {
-    overflow: auto;
-}
-.poj-list span.poj-icon {
-  padding-right:7px;
-  color:#ccc
-}
-.poj-list a.tree-open,.poj-list a.tree-close{
-  width:15px;
-  display: inline-block;
-}
-.print-toolsbar{
-  padding:5px
-}
-.print-toolsbar .panel {
-  display:inline-block;
-  vertical-align:top;
-  background:#f7f7f9
-}
-.print-toolsbar .panel .panel-foot{
-  text-align: center;
-  font-size: 12px
-}
-.print-list {
-  border-right:1px solid #ccc
-}
-.print-list .form-list {
-  overflow: auto
-}
-.print-list .list-tools{
-  height:50px;
-  padding:10px 0;
-  border-bottom:1px solid #f2f2f2
-}
-.pageContainer {
-  background: #ededed;
-  text-align: center
-}
-.pageContainer .page{
-  border:9px solid transparent;
-  display: inline-block;
-}
-.pageContainer .page img{
-  width:inherit;
-  height: inherit;
-}
-.modal-fixed-height {
-  height: 400px;
-  overflow-y: auto;
-}

+ 0 - 106
web/maintain/templates/html/bills.html

@@ -1,106 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head lang="en">
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-    <meta http-equiv="x-ua-compatible" content="ie=edge">
-    <title>模板清单-Smartcost</title>
-    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
-    <link rel="stylesheet" href="/web/maintain/templates/css/main.css">
-    <link rel="stylesheet" href="/lib/font-awesome/font-awesome.min.css">
-    <!--SpreadJs-->
-    <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.excel2013lightGray.10.0.1.css" type="text/css">
-    <script>
-        // 这里的变量供页面调用
-        var userAccount = '<%- userAccount %>';
-        var userID = '<%- userID %>';
-    </script>
-</head>
-<body>
-    <div class="header">
-        <nav class="navbar navbar-toggleable-lg navbar-light bg-faded p-0 justify-content-between">
-            <span class="header-logo px-2">Smartcost</span>
-            <div class="float-lg-right navbar-text pt-0">
-                <div class="dropdown d-inline-block">
-                    <button class="btn btn-link btn-sm dropdown-toggle" type="button" data-toggle="dropdown"><%- userAccount %></button>
-                    <div class="dropdown-menu dropdown-menu-right">
-                        <a class="dropdown-item" href="/user/info" target="_blank">账号资料</a>
-                        <a class="dropdown-item" href="/user/buy" target="_blank">产品购买</a>
-                        <a class="dropdown-item" href="/user/set" target="_blank">偏好设置</a>
-                    </div>
-                </div>
-                    <span class="btn btn-link btn-sm new-msg">
-                        <i class="fa fa-envelope-o" aria-hidden="true"></i>&nbsp;2
-                    </span>
-                    <a class="btn btn-link btn-sm" href="/logout">注销</a>
-            </div>
-        </nav>
-    </div>
-<div class="main">
-    <div class="content">
-        <div class="toolsbar px-1 d-flex justify-content-between">
-            <div class="tools-btn btn-group align-top">
-                <a href="" class="btn btn-sm"><i class="fa fa-files-o" aria-hidden="true"></i> 复制</a>
-                <a href="" class="btn btn-sm"><i class="fa fa-scissors" aria-hidden="true"></i> 剪切</a>
-                <a href="" class="btn btn-sm"><i class="fa fa-clipboard" aria-hidden="true"></i> 粘贴</a>
-                <a href="javascript:void(0)" class="btn btn-sm" id="insert"><i class="fa fa-sign-in" aria-hidden="true"></i> 插入</a>
-                <a href="javascript:void(0)" class="btn btn-sm" id="delete"><i class="fa fa-remove" aria-hidden="true"></i> 删除</a>
-                <a href="javascript:void(0)" class="btn btn-sm" id="upLevel"><i class="fa fa-arrow-left" aria-hidden="true"></i> 升级</a>
-                <a href="javascript:void(0)" class="btn btn-sm" id="downLevel"><i class="fa fa-arrow-right" aria-hidden="true"></i> 降级</a>
-                <a href="javascript:void(0)" class="btn btn-sm" id="downMove"><i class="fa fa-arrow-down" aria-hidden="true"></i> 下移</a>
-                <a href="javascript:void(0)" class="btn btn-sm" id="upMove"><i class="fa fa-arrow-up" aria-hidden="true"></i> 上移</a>
-            </div>
-            <div class="side-tabs">
-                <ul class="nav nav-tabs" role="tablist">
-                    <li class="nav-item">
-                        <a class="nav-link active px-3" data-toggle="tab" href="#qd" role="tab">清单规则</a>
-                    </li>
-                </ul>
-            </div>
-        </div>
-        <div class="container-fluid">
-            <div class="row">
-                <div class="main-content col-lg-9 p-0">
-                    <div class="main-data" id="billsSpread" style="height: 600px">
-                    </div>
-                </div>
-                <div class="main-side col-lg-3 p-0">
-                    <div class="tab-content">
-                        <!--清单规则-->
-                        <div class="tab-pane active" id="qd" role="tabpanel">
-                            <div class="warp-p2">
-                                <div>
-                                    <select class="form-control form-control-sm" id="exampleSelect1">
-                                        <option>重庆市房屋建筑与装饰工程工程量计算规则(2013)</option>
-                                    </select>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-            </div>
-        </div>
-    </div>
-</div>
-</body>
-<!-- JS. -->
-<script src="/lib/jquery/jquery.min.js"></script>
-<script src="/lib/tether/tether.min.js"></script>
-<script src="/lib/bootstrap/bootstrap.min.js"></script>
-<script src="/web/maintain/templates/js/global.js"></script>
-<!-- SpreadJs -->
-<script type="text/javascript" src="/lib/spreadjs/sheets/gc.spread.sheets.all.10.0.1.min.js"></script>
-<script>GC.Spread.Sheets.LicenseKey = "559432293813965#A0y3iTOzEDOzkjMyMDN9UTNiojIklkI1pjIEJCLi4TPB9mM5AFNTd4cvZ7SaJUVy3CWKtWYXx4VVhjMpp7dYNGdx2ia9sEVlZGOTh7NRlTUwkWR9wEV4gmbjBDZ4ElR8N7cGdHVvEWVBtCOwIGW0ZmeYVWVr3mI0IyUiwCMzETN8kzNzYTM0IicfJye&Qf35VfiEzRwEkI0IyQiwiIwEjL6ByUKBCZhVmcwNlI0IiTis7W0ICZyBlIsIyNyMzM5ADI5ADNwcTMwIjI0ICdyNkIsIibj9SbvNmL4N7bjRnch56ciojIz5GRiwiI8+Y9sWY9QmZ0Jyp96uL9v6L0wap9biY9qiq95q197Wr9g+89iojIh94Wiqi";</script>
-<!-- Models -->
-<script type="text/javascript" src="/public/web/id_tree.js"></script>
-<!-- Controller -->
-<script type="text/javascript" src="/public/web/tree_sheet/tree_sheet_controller.js"></script>
-<script type="text/javascript" src="/public/web/tree_sheet/tree_sheet_helper.js"></script>
-<!-- service -->
-<script type="text/javascript" src="/web/maintain/templates/js/bills.js"></script>
-<script type="text/javascript" src="/web/maintain/templates/js/tp_bills_setting.js"></script>
-<script type="text/javascript" src="/public/web/common_ajax.js"></script>
-<script>
-    autoFlashHeight();
-</script>
-</html>

+ 0 - 168
web/maintain/templates/js/bills.js

@@ -1,168 +0,0 @@
-/**
- * Created by Mai on 2017/4/17.
- */
-$(document).ready(function () {
-    var tempType = 3;
-    var FormatUpdateData = function (data) {
-        var updateData = {};
-        updateData['user_id'] = userID;
-        updateData['tempType'] = tempType;
-        updateData['updateData'] = data;
-        return updateData;
-    };
-    var RefreshBaseActn = function (tree) {
-        var showButton = function (show, btn) {
-            if (show) {
-                btn.show();
-            } else {
-                btn.hide();
-            }
-        };
-        showButton(tree.selected && tree.selected.canUpLevel(), $('#upLevel'));
-        showButton(tree.selected && tree.selected.canDownLevel(), $('#downLevel'));
-        showButton(tree.selected && tree.selected.canUpMove(), $('#upMove'));
-        showButton(tree.selected && tree.selected.canDownMove(), $('#downMove'));
-        showButton(tree.selected ? true : false, $('#delete'));
-    }
-    var RefreshBillsData = function (datas) {
-        datas.forEach(function (data) {
-            var node = tree.findNode(data.data.ID);
-            if (node) {
-                $.extend(true, node.data, data.data);
-            }
-        });
-    };
-
-    var tree = idTree.createNew({id: 'ID', pid: 'ParentID', nid: 'NextSiblingID', rootId: -1, autoUpdate: true});
-    var billsSpread = new GC.Spread.Sheets.Workbook($('#billsSpread')[0], { sheetCount: 1 });
-    var controller = TREE_SHEET_CONTROLLER.createNew(tree, billsSpread.getActiveSheet(), TEMPLATE_BILLS_SETTING);
-
-    GC.Spread.Common.CultureManager.culture("zh-cn");
-
-    billsSpread.options.tabStripVisible = false;
-    billsSpread.options.scrollbarMaxAlign = true;
-    billsSpread.options.cutCopyIndicatorVisible = false;
-    billsSpread.options.allowCopyPasteExcelStyle = false;
-    controller.bind('refreshBaseActn', RefreshBaseActn);
-
-    billsSpread.bind(GC.Spread.Sheets.Events.EditEnded, function (sender, info) {
-        var node = controller.tree.items[info.row];
-        var fieldName = controller.setting.cols[info.col].data.field;
-        var data = {type: 'update', data: {ID: node.getID()}};
-        data.data[fieldName] = info.editingText;
-        var updateData = FormatUpdateData([data]);
-        CommonAjax.post('/template/bills/api/updateBillsTemplate', updateData, function (data) {
-            node.data[fieldName] = info.editingText;
-            controller.refreshTreeNode([node], false);
-        }, function () {
-            controller.refreshTreeNode([node], false);
-        });
-    });
-    billsSpread.bind(GC.Spread.Sheets.Events.ClipboardPasting, function (sender, args) {
-        console.log("ClipboardPasting");
-    });
-    billsSpread.bind(GC.Spread.Sheets.Events.ClipboardPasted, function (e, info) {
-        console.log("ClipboardPasted");
-        var node, iRow, iCol, curRow, curCol, datas = [], data, fieldName, updateData;
-        for (iRow = 0; iRow < info.cellRange.rowCount; iRow ++) {
-            curRow = info.cellRange.row + iRow;
-            node = controller.tree.items[curRow];
-            if (node) {
-                data = {type: 'update', data: {ID: node.getID()}};
-                for (iCol = 0; iCol < info.cellRange.colCount; iCol++) {
-                    curCol = info.cellRange.col + iCol;
-                    fieldName = controller.setting.cols[curCol].data.field;
-                    data.data[fieldName] = info.sheet.getText(curRow, curCol);
-                }
-                datas.push(data);
-            }
-        };
-        CommonAjax.post('/template/bills/api/updateBillsTemplate', FormatUpdateData(datas), function (data) {
-            RefreshBillsData(data);
-            controller.showTreeData();
-        }, function () {
-            controller.showTreeData();
-        });
-    });
-
-    CommonAjax.post('/template/bills/api/getBillsTemplate', {tempType: tempType}, function (data) {
-        var bills = data;
-        tree.loadDatas(bills);
-        controller.showTreeData();
-        RefreshBaseActn(tree);
-    }, function () {
-        controller.showTreeData();
-        RefreshBaseActn(tree);
-    });
-
-    $('#insert').click(function () {
-        CommonAjax.post('/template/bills/api/getNewBillsTemplateID', {count: 1}, function (data) {
-            var selected = controller.tree.selected, updateData;
-            controller.tree.maxNodeID(data.lowID - 1);
-            controller.tree.rangeNodeID(data.highID);
-            if (selected) {
-                updateData = FormatUpdateData(controller.tree.getInsertData(selected.getParentID(), selected.getNextSiblingID()));
-            } else {
-                updateData = FormatUpdateData(controller.tree.getInsertData());
-            }
-            if (updateData.updateData.length > 0) {
-                CommonAjax.post('/template/bills/api/updateBillsTemplate', updateData, function (data) {
-                    controller.insert();
-                    controller.showTreeData();
-                });
-            } else {
-                alert('新增节点失败, 请重试.');
-            }
-        });
-    });
-    $('#delete').click(function () {
-        var selected = controller.tree.selected, updateData;
-        if (selected) {
-            updateData = FormatUpdateData(controller.tree.getDeleteData(selected));
-            CommonAjax.post('/template/bills/api/updateBillsTemplate', updateData, function (data) {
-                controller.delete();
-                controller.showTreeData();
-            });
-        }
-    });
-    $('#upLevel').click(function () {
-        var selected = controller.tree.selected, updateData;
-        if (selected) {
-            updateData = FormatUpdateData(selected.getUpLevelData());
-            CommonAjax.post('/template/bills/api/updateBillsTemplate', updateData, function (data) {
-                controller.upLevel();
-                controller.showTreeData();
-            });
-        }
-    });
-    $('#downLevel').click(function () {
-        var selected = controller.tree.selected, updateData;
-        if (selected) {
-            updateData = FormatUpdateData(selected.getDownLevelData());
-            CommonAjax.post('/template/bills/api/updateBillsTemplate', updateData, function (data) {
-                controller.downLevel();
-                controller.showTreeData();
-            });
-        }
-    });
-    $('#upMove').click(function () {
-        var selected = controller.tree.selected, updateData;
-        if (selected) {
-            updateData = FormatUpdateData(selected.getUpMoveData());
-            CommonAjax.post('/template/bills/api/updateBillsTemplate', updateData, function (data) {
-                controller.upMove();
-                controller.showTreeData();
-            });
-        }
-    });
-    $('#downMove').click(function () {
-        var selected = controller.tree.selected, updateData;
-        if (selected) {
-            updateData = FormatUpdateData(selected.getDownMoveData());
-            CommonAjax.post('/template/bills/api/updateBillsTemplate', updateData, function (data) {
-                controller.downMove();
-                controller.showTreeData();
-            });
-        }
-    });
-});

+ 0 - 42
web/maintain/templates/js/global.js

@@ -1,42 +0,0 @@
-/*全局自适应高度*/
-function autoFlashHeight(){
-    var headerHeight = $(".header").height();
-    var bottomContentHeight = $(".bottom-content").height();
-    var toolsBar = $(".tools-bar").height();
-    $(".content").height($(window).height()-headerHeight);
-    $(".main-side").height($(window).height()-headerHeight-2);
-    $(".fluid-content").height($(window).height()-headerHeight-1);
-    $(".side-content").height($(window).height()-headerHeight );
-    $(".poj-list").height($(window).height()-headerHeight);
-    $(".form-list").height($(window).height()-headerHeight-50 );
-    $(".main-data-top").height($(window).height()-headerHeight-toolsBar-bottomContentHeight-2);
-    $(".main-data").height($(window).height()-headerHeight);
-};
-$(window).resize(autoFlashHeight);
-/*全局自适应高度结束*/
-$(function(){
-/*侧滑*/
-$(".open-sidebar").click(function(){
-    $(".slide-sidebar").animate({width:"800"}).addClass("open");
-});
-$("body").click(function(event){
-        var e = event || window.event; //浏览器兼容性
-        if(!$(event.target).is('a')) {
-            var elem = event.target || e.srcElement;
-            while (elem) { //循环判断至跟节点,防止点击的是div子元素
-                if (elem.className == "open-sidebar" || elem.className == 'slide-sidebar open') {
-                    return false;
-                }
-                elem = elem.parentNode;
-            }
-            $(".slide-sidebar").animate({width:"0"}).removeClass("open")// 关闭处理
-        }
-
-    });
-/*侧滑*/
-/*工具提示*/
-$('*[data-toggle=tooltip]').mouseover(function() {
- $(this).tooltip('show');
-  });
-/*工具提示*/
-});

+ 0 - 205
web/maintain/templates/js/tp_bills_setting.js

@@ -1,205 +0,0 @@
-/**
- * Created by Mai on 2017/4/17.
- */
-var TEMPLATE_BILLS_SETTING = {
-    "emptyRows":1,
-    "headRows":1,
-    "headRowHeight":[20],
-    "treeCol": 0,
-    "cols":[{
-        "width":200,
-        "readOnly":null,
-        "head":{
-            "titleNames":[
-                "编号"
-            ],
-            "spanCols":[
-                1
-            ],
-            "spanRows":[
-                1
-            ],
-            "vAlign":[
-                1
-            ],
-            "hAlign":[
-                1
-            ],
-            "font":[
-                "12px Arial"
-            ]
-        },
-        "data":{
-            "field":"code",
-            "vAlign":0,
-            "hAlign":3,
-            "font":"14.6667px Calibri"
-        }
-    }, {
-        "width":300,
-        "readOnly":null,
-        "head":{
-            "titleNames":[
-                "名称"
-            ],
-            "spanCols":[
-                1
-            ],
-            "spanRows":[
-                1
-            ],
-            "vAlign":[
-                1
-            ],
-            "hAlign":[
-                1
-            ],
-            "font":[
-                "12px Arial"
-            ]
-        },
-        "data":{
-            "field":"name",
-            "vAlign":0,
-            "hAlign":3,
-            "font":"14.6667px Calibri"
-        }
-    }, {
-        "width":50,
-        "readOnly":null,
-        "head":{
-            "titleNames":[
-                "单位"
-            ],
-            "spanCols":[
-                1
-            ],
-            "spanRows":[
-                1
-            ],
-            "vAlign":[
-                1
-            ],
-            "hAlign":[
-                1
-            ],
-            "font":[
-                "12px Arial"
-            ]
-        },
-        "data":{
-            "field":"unit",
-            "vAlign":0,
-            "hAlign":1,
-            "font":"14.6667px Calibri"
-        }
-    }, {
-        "width":50,
-        "readOnly":null,
-        "head":{
-            "titleNames":[
-                "ID"
-            ],
-            "spanCols":[
-                1
-            ],
-            "spanRows":[
-                1
-            ],
-            "vAlign":[
-                1
-            ],
-            "hAlign":[
-                1
-            ],
-            "font":[
-                "12px Arial"
-            ]
-        },
-        "data":{
-            "field":"ID",
-            "vAlign":0,
-            "hAlign":1,
-            "font":"14.6667px Calibri"/*,
-            "getText": function (node) {
-                if (node) {
-                    return node.getID();
-                } else {
-                    return '';
-                }
-            }*/
-        }
-    }, {
-        "width":50,
-        "readOnly":null,
-        "head":{
-            "titleNames":[
-                "ParentID"
-            ],
-            "spanCols":[
-                1
-            ],
-            "spanRows":[
-                1
-            ],
-            "vAlign":[
-                1
-            ],
-            "hAlign":[
-                1
-            ],
-            "font":[
-                "12px Arial"
-            ]
-        },
-        "data":{
-            "field":"ParentID",
-            "vAlign":0,
-            "hAlign":1,
-            "font":"14.6667px Calibri"/*,
-            "getText": function (node) {
-                if (node) {
-                    return node.getParentID();
-                } else {
-                    return '';
-                }
-            }*/
-        }
-    }, {
-        "width":50,
-        "readOnly":null,
-        "head":{
-            "titleNames":[
-                "NextSiblingID"
-            ],
-            "spanCols":[
-                1
-            ],
-            "spanRows":[
-                1
-            ],
-            "vAlign":[
-                1
-            ],
-            "hAlign":[
-                1
-            ],
-            "font":[
-                "12px Arial"
-            ]
-        },
-        "data":{
-            "field":"NextSiblingID",
-            "vAlign":0,
-            "hAlign":1,
-            "font":"14.6667px Calibri"/*,
-            "getText": function (node) {
-                if (node) {
-                    return node.getNextSiblingID();
-                } else {
-                    return '';
-                }
-            }*/
-        }
-    }]
-};