Main.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. MWF.xApplication.ExeManager = MWF.xApplication.ExeManager || {};
  2. MWF.require("MWF.widget.Identity", null,false);
  3. MWF.xDesktop.requireApp("ExeManager", "Actions.RestActions", null, false);
  4. MWF.xDesktop.requireApp("Template", "Explorer", null, false);
  5. MWF.xApplication.ExeManager.options = {
  6. multitask: false,
  7. executable: true
  8. }
  9. MWF.xApplication.ExeManager.Main = new Class({
  10. Extends: MWF.xApplication.Common.Main,
  11. Implements: [Options, Events],
  12. options: {
  13. "style": "default",
  14. "name": "ExeManager",
  15. "icon": "icon1.png",
  16. "width": "1270",
  17. "height": "700",
  18. "isResize": false,
  19. "isMax": true,
  20. "title": MWF.xApplication.ExeManager.LP.main.topBartitle
  21. },
  22. onQueryLoad: function(){
  23. this.lp = MWF.xApplication.ExeManager.LP;
  24. },
  25. loadApplication: function(callback){
  26. this.restActions = new MWF.xApplication.ExeManager.Actions.RestActions();
  27. this.createContainer();
  28. this.createTopBar();
  29. //this.createMiddleContent();
  30. },
  31. createContainer : function(){
  32. if( !this.container ){
  33. this.content.setStyle("overflow", "hidden");
  34. this.container = new Element("div", {
  35. "styles": this.css.container
  36. }).inject(this.content);
  37. }
  38. },
  39. createTopBar: function(){
  40. this.currentTopBarTab = "todo";
  41. if( this.topBar ){
  42. this.topBar.empty();
  43. }else{
  44. this.topBar = new Element("div.topBar", {
  45. "styles": this.css.topBar
  46. }).inject(this.container);
  47. }
  48. this.topBarContent = new Element("div", {"styles": this.css.topBarContent}).inject(this.topBar);
  49. this.topBarTitleLi = new Element("li", {"styles": this.css.topBarTitleLi}).inject(this.topBarContent);
  50. this.topBarLog = new Element("img",{"styles": this.css.topBarLog,"src": this.path+"default/icon/okr.png"}).inject(this.topBarTitleLi);
  51. this.topBarTitleSpan = new Element("span",{ "styles": this.css.topBarTitleSpan,"text":this.lp.main.topBartitle}).inject(this.topBarTitleLi);
  52. var topList = this.lp.main.topBarList;
  53. for(var l in topList){
  54. var topBarLi = new Element("li.topBarLi",{"styles": this.css.topBarLi,"id":l}).inject(this.topBarContent);
  55. var _self = this
  56. topBarLi.addEvents({
  57. "mouseover":function(){ //alert(_self.currentTopBarTab)
  58. if(_self.currentTopBarTab!=this.get("id")){
  59. this.setStyles({"background-color":"#124c93"})
  60. }
  61. },
  62. "mouseout":function(){
  63. if(_self.currentTopBarTab!=this.get("id")){
  64. this.setStyles({"background-color":"#5c97e1"})
  65. }
  66. },
  67. "click" : function(){
  68. _self.openContent( this );
  69. }
  70. })
  71. //this.topBarTodoImg = new Element("img",{"styles": this.css.topBarTodoImg,"src": this.path+"default/icon/Outline-104.png"}).inject(this.topBarTodoLi);
  72. var topBarSpan = new Element("span",{"styles": this.css.topBarSpan,"text":topList[l]}).inject(topBarLi);
  73. }
  74. this.topBarContent.getElementById("topTodo").click()
  75. },
  76. openContent: function(obj){
  77. this.currentTopBarTab = obj.get("id")
  78. this.topBarContent.getElements("li").each(function(d){
  79. if(d.className=="topBarLi"){
  80. d.setStyles({"background-color":"#5c97e1"})
  81. }
  82. })
  83. obj.setStyles({"background-color":"#124c93"})
  84. if( !this.middleContent ){
  85. this.middleContent = new Element("div.middleContent",{
  86. "styles": this.css.middleContent
  87. }).inject(this.container)
  88. }
  89. if(this.currentTopBarTab=="topTodo"){
  90. if(this.middleContent){
  91. this.middleContent.empty()
  92. }
  93. MWF.xDesktop.requireApp("ExeManager", "TodoList", function(){
  94. var explorer = new MWF.xApplication.ExeManager.TodoList(this.middleContent, this, this.restActions, {});
  95. explorer.load();
  96. }.bind(this), true);
  97. }else if(this.currentTopBarTab=="topCenterWork"){
  98. if(this.middleContent)this.middleContent.empty();
  99. MWF.xDesktop.requireApp("ExeManager", "CenterWorkList", function(){
  100. var explorer = new MWF.xApplication.ExeManager.CenterWorkList(this.middleContent, this, this.restActions, {});
  101. explorer.load();
  102. }.bind(this) ,true);
  103. }else if(this.currentTopBarTab=="topBaseWork"){
  104. if(this.middleContent)this.middleContent.empty();
  105. MWF.xDesktop.requireApp("ExeManager", "BaseWorkList", function(){
  106. var explorer = new MWF.xApplication.ExeManager.BaseWorkList(this.middleContent, this, this.restActions, {});
  107. explorer.load();
  108. }.bind(this) ,true);
  109. }
  110. },
  111. createMiddleContent: function(){
  112. if( !this.middleContent ){
  113. this.middleContent = new Element("div.middleContent",{
  114. "styles": this.css.middleContent
  115. }).inject(this.container)
  116. }
  117. }
  118. });