Main.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. MWF.xApplication.BAM.options.multitask = false;
  2. MWF.xDesktop.requireApp("BAM", "Actions.RestActions", null, false);
  3. MWF.require("MWF.widget.Tab", null, false);
  4. //MWF.require("MWF.widget.UUID", null, false);
  5. MWF.require("MWF.widget.MaskNode", null, false);
  6. MWF.xApplication.BAM.Main = new Class({
  7. Extends: MWF.xApplication.Common.Main,
  8. Implements: [Options, Events],
  9. options: {
  10. "style": "default",
  11. "name": "BAM",
  12. "icon": "icon.png",
  13. "width": "1240",
  14. "height": "700",
  15. "isResize": true,
  16. "isMax": true,
  17. "title": MWF.xApplication.BAM.LP.title
  18. },
  19. onQueryLoad: function(){
  20. this.lp = MWF.xApplication.BAM.LP;
  21. this.actions = MWF.Actions.get("x_processplatform_assemble_bam");
  22. //this.actions = new MWF.xApplication.BAM.Actions.RestActions();
  23. },
  24. loadApplication: function(callback){
  25. this.createNode();
  26. this.createLayout(callback);
  27. },
  28. createNode: function(){
  29. this.contentNode = new Element("div", {
  30. "styles": this.css.contentNode
  31. }).inject(this.content);
  32. this.node = new Element("div", {
  33. "styles": this.css.node
  34. }).inject(this.contentNode);
  35. },
  36. createLayout: function(callback){
  37. this.tabNode = new Element("div", {"styles": this.css.tabNode}).inject(this.node);
  38. this.tab = new MWF.widget.Tab(this.tabNode, {"style": "administrator"});
  39. this.tab.load();
  40. this.summaryNode = new Element("div", {"styles": this.css.summaryNode});
  41. this.monthlyNode = new Element("div", {"styles": this.css.monthlyNode});
  42. this.summaryPage = this.tab.addTab(this.summaryNode, this.lp.summaryTitle);
  43. // 临时隐藏按月统计,等待查询效率提升后再开放。
  44. // this.monthlyPage = this.tab.addTab(this.monthlyNode, this.lp.monthlyTitle);
  45. // this.monthlyPage.addEvent("show", function(){
  46. // this.clearMonthly();
  47. // this.loadMonthly();
  48. // }.bind(this));
  49. this.summaryPage.addEvent("show", function(){
  50. this.clearSummary();
  51. this.loadSummary();
  52. if (callback) callback();
  53. }.bind(this));
  54. this.summaryPage.showTabIm();
  55. },
  56. clearSummary: function(){
  57. if (this.summary){
  58. this.summary.destroy();
  59. this.summary = null;
  60. }
  61. },
  62. loadSummary: function(){
  63. //this.app.content.mask();
  64. this.mask();
  65. MWF.xDesktop.requireApp("BAM", "Summary", function(){
  66. this.summary = new MWF.xApplication.BAM.Summary(this, this.summaryNode, {
  67. "onLoaded": function(){
  68. this.unmask();
  69. }.bind(this)
  70. });
  71. }.bind(this));
  72. },
  73. clearMonthly: function(){
  74. if (this.monthly){
  75. this.monthly.destroy();
  76. this.monthly = null;
  77. }
  78. },
  79. loadMonthly: function(){
  80. //this.app.content.mask();
  81. this.mask();
  82. MWF.xDesktop.requireApp("BAM", "Monthly", function(){
  83. this.monthly = new MWF.xApplication.BAM.Monthly(this, this.monthlyNode, {
  84. "onLoaded": function(){
  85. this.unmask();
  86. }.bind(this)
  87. });
  88. }.bind(this));
  89. },
  90. mask: function(){
  91. if (!this.maskNode){
  92. this.maskNode = new MWF.widget.MaskNode(this.content, {"style": "bam"});
  93. this.maskNode.load();
  94. }
  95. },
  96. unmask: function(){
  97. if (this.maskNode) this.maskNode.hide(function(){
  98. MWF.release(this.maskNode);
  99. this.maskNode = null;
  100. }.bind(this));
  101. }
  102. });