bills.js 796 B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * Created by Mai on 2017/4/1.
  3. */
  4. var Bills = {
  5. createNew: function (project) {
  6. var billsTreeSetting = {
  7. id: 'ID',
  8. pid: 'ParentID',
  9. nid: 'NextSiblingID',
  10. rootId: -1
  11. };
  12. // 用户定义private方法
  13. var tools = {};
  14. // 所有通过this访问的属性,都不应在此单元外部进行写入操作
  15. var bills = function (proj) {
  16. this.project = proj;
  17. this.datas = null;
  18. this.tree = null;
  19. };
  20. // prototype用于定义public方法
  21. bills.prototype.loadDatas = function (datas) {
  22. this.datas = datas;
  23. this.tree = idTree.createNew(billsTreeSetting);
  24. this.tree.loadDatas(this.datas);
  25. };
  26. return new bills(project);
  27. }
  28. };