MWF.xApplication.Homepage.FileContent = new Class({ Extends: MWF.xApplication.Homepage.TaskContent, Implements: [Options, Events], options: { "view": "fileContent.html" }, load: function(){ this.tabs = {}; this.container.loadHtml(this.viewPath, {"bind": {"lp": this.app.lp}, "module": this}, function(){ this.initSize(); this.loadMyFile(function(){ this.fireEvent("load"); }.bind(this)); // //是否需要定时自动刷新 @todo // this.startProcessAction.addEvent("click", this.startProcess.bind(this)); //this.moreInforAction.addEvent("click", this.moreInfor.bind(this)); }.bind(this)); }, openFile: function(e){ layout.openApplication(e, "File"); }, setContentSize: function(){ var total = this.container.getSize().y; var titleHeight = this.taskTitleNode.getSize().y+this.taskTitleNode.getEdgeHeight(); var bottomHeight = this.pageAreaNode.getSize().y+this.pageAreaNode.getEdgeHeight(); var thisHeight = this.itemContentNode.getEdgeHeight(); var contentHeight = total-titleHeight-bottomHeight-thisHeight; this.itemContentNode.setStyle("height", ""+contentHeight+"px"); this.contentHeight = contentHeight; //this.pageSize = (this.options.itemHeight/this.contentHeight).toInt(); if (this.noItemNode){ var m = (this.contentHeight- this.noItemNode.getSize().y)/2; this.noItemNode.setStyle("margin-top", ""+m+"px"); } }, loadMyFile: function(callback){ this.loadFile(null, callback); }, loadFile: function(e, callback){ if (!this.isLoading) { if (!this.fileContentTab){ this.fileContentTab = new MWF.xApplication.Homepage.FileContent.File(this, this.fileTab, { "onLoad": function(){ if (callback) callback(); } }); }else{ this.fileContentTab.load(); } this.currentTab = this.fileContentTab; } } }); MWF.xApplication.Homepage.FileContent.File = new Class({ Extends: MWF.xApplication.Homepage.TaskContent.Task, Implements: [Options, Events], options: { "itemHeight": 50, "type": "file" }, getIconJson: function(callback){ if (!this.iconJson){ o2.JSON.get("../x_component_File/$Main/icon.json", function(iconJson){ this.iconJson = iconJson; if (callback) callback(); }.bind(this)); }else{ if (callback) callback(); } }, loadItemsRes: function(){ o2.Actions.load("x_file_assemble_control").AttachmentAction.listTop(function(json){ if (json.data && json.data.length){ this.getIconJson(function(){ this.loadItems(json.data); }.bind(this)); }else{ this.emptyLoadContent(); } this.fireEvent("load"); }.bind(this)); }, emptyLoadContent: function(){ this.container.empty(); this.container.removeClass("o2_homepage_area_content_loading").removeClass("icon_loading"); this.content.pageAreaNode.empty(); //this.itemContentNode.addClass("o2_homepage_task_area_content_empty").addClass("icon_notask"); this.content.noItemNode = new Element("div.o2_homepage_file_area_content_empty_node", {"text": this.app.lp.noFile}).inject(this.container); this.content.noItemNode.addEvent("click", function(e){ layout.openApplication(e, "File"); }); var m = (this.content.contentHeight- this.content.noItemNode.getSize().y)/2; this.content.noItemNode.setStyle("margin-top", ""+m+"px"); this.content.isLoading = false; }, loadItems: function(data){ for (var i=0; i"+startStr+" - "+completedStr+""); // // var locationNode = new Element("div.o2_homepage_meeting_item_location").inject(inforArea); // locationNode.set("html", this.app.lp.meetingLocation+": "+d.woRoom.name+""); // // // return row; // }, // });