| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793 |
- MWF.xApplication.Execution = MWF.xApplication.Execution || {};
- MWF.xDesktop.requireApp("Template", "Explorer", null, false);
- MWF.require("MWF.widget.Identity", null,false);
- MWF.xApplication.Execution.WorkReportList = new Class({
- Extends: MWF.widget.Common,
- Implements: [Options, Events],
- options: {
- "style": "default",
- "workNavi1" : ""
- },
- initialize: function (node, app, actions, options) {
- this.setOptions(options);
- this.app = app;
- this.lp = app.lp.WorkReportList;
- this.path = "../x_component_Execution/$WorkReportList/";
- this.loadCss();
- this.actions = actions;
- this.node = $(node);
- },
- loadCss: function () {
- this.cssPath = "../x_component_Execution/$WorkReportList/" + this.options.style + "/css.wcss";
- this._loadCss();
- },
- load: function () {
- this.tabLocation = "";
- this.middleContent = this.app.middleContent;
- this.middleContent.setStyles({"margin-top":"0px","border":"0px solid #f00"});
- this.createNaviContent();
- this.createContentDiv();
- this.resizeWindow();
- this.app.addEvent("resize", function(){
- this.resizeWindow();
- }.bind(this));
- },
- resizeWindow: function(){
- var size = this.app.middleContent.getSize();
- this.naviDiv.setStyles({"height":(size.y-60)+"px"});
- this.naviContentDiv.setStyles({"height":(size.y-180)+"px"});
- this.contentDiv.setStyles({"height":(size.y-60)+"px"});
- this.rightContentDiv.setStyles({"height":(size.y-40-100)+"px"});
- },
- createNaviContent: function(){
- this.naviDiv = new Element("div.naviDiv",{
- "styles":this.css.naviDiv
- }).inject(this.middleContent);
- this.naviTitleDiv = new Element("div.naviTitleDiv",{
- "styles":this.css.naviTitleDiv,
- "text":this.lp.title
- }).inject(this.naviDiv);
- this.naviContentDiv = new Element("div.naviContentDiv",{"styles":this.css.naviContentDiv}).inject(this.naviDiv);
- this.naviBottomDiv = new Element("div.naviBottomDiv",{"styles":this.css.naviBottomDiv}).inject(this.naviDiv);
- var naviContentLi = new Element("li.naviContentLi",{"styles":this.css.naviContentLi}).inject(this.naviContentDiv)
- .addEvents({
- "click":function(){
- this.app.openTask()
- }.bind(this)
- });
- var naviContentImg = new Element("img.naviContentImg",{
- "styles":this.css.naviContentImg,
- "src":"../x_component_Execution/$WorkReportList/default/icon/Prototype-100.png"
- }).inject(naviContentLi);
- var naviContentSpan = new Element("span.naviContentSpan",{
- "styles":this.css.naviContentSpan,
- "text":this.lp.naviItem.workDeploy
- }).inject(naviContentLi);
- //var naviContentLi = new Element("li.naviContentLi",{"styles":this.css.naviContentLi}).inject(this.naviContentDiv);
- //var naviContentImg = new Element("img.naviContentImg",{
- // "styles":this.css.naviContentImg,
- // "src":"../x_component_Execution/$WorkReportList/default/icon/Conference-100.png"
- //}).inject(naviContentLi);
- //var naviContentSpan = new Element("span.naviContentSpan",{
- // "styles":this.css.naviContentSpan,
- // "text":this.lp.naviItem.workConsult
- //}).inject(naviContentLi)
- //
- //var naviContentLi = new Element("li.naviContentLi",{"styles":this.css.naviContentLi}).inject(this.naviContentDiv);
- //var naviContentImg = new Element("img.naviContentImg",{
- // "styles":this.css.naviContentImg,
- // "src":"../x_component_Execution/$WorkReportList/default/icon/Department-100.png"
- //}).inject(naviContentLi);
- //var naviContentSpan = new Element("span.naviContentSpan",{
- // "styles":this.css.naviContentSpan,
- // "text":this.lp.naviItem.workStat
- //}).inject(naviContentLi)
- },
- createContentDiv: function(){
- this.contentDiv = new Element("div.contentDiv",{"styles":this.css.contentDiv}).inject(this.middleContent);
- this.createCategoryItemDiv();
- this.createSearchDiv();
- this.createRightContentDiv();
- },
- createCategoryItemDiv: function(){
- this.rightCategoryDiv = new Element("div.rightCategoryDiv",{"styles":this.css.rightCategoryDiv}).inject(this.contentDiv);
- this.rightCategoryItemDiv = new Element("div.rightCategoryItemDiv",{"styles":this.css.rightCategoryItemDiv}).inject(this.rightCategoryDiv);
- this.drafterLi = new Element("li.drafterLi",{
- "styles":this.css.rightCategoryItemLi,
- "text": this.lp.drafterTab
- }).inject(this.rightCategoryItemDiv)
- .addEvents({
- "click":function(){
- //alert("草稿箱点击");
- //this.rightContentDiv.destroy();
- //this.createCenterWorkSearchDiv();
- this.createView( "drafter" );
- }.bind(this)
- });
- this.todoLi = new Element("li.todoLi",{
- "styles":this.css.rightCategoryItemCurrentLi,
- "text": this.lp.todoTab
- }).inject(this.rightCategoryItemDiv)
- .addEvents({
- "click":function(){
- //alert("待处理点击");
- //this.rightContentDiv.destroy();
- this.createView( "todo" );
- //this.createBaseWorkSearchDiv();
- //this.createRightContentDiv("base");
- }.bind(this)
- });
- this.doneLi = new Element("li.doneLi",{
- "styles":this.css.rightCategoryItemLi,
- "text": this.lp.doneTab
- }).inject(this.rightCategoryItemDiv)
- .addEvents({
- "click":function(){
- //alert("已处理点击");
- //this.rightContentDiv.destroy();
- //this.createBaseWorkSearchDiv();
- this.createView( "done" );
- }.bind(this)
- });
- this.archiveLi = new Element("li.archiveLi",{
- "styles":this.css.rightCategoryItemLi,
- "text": this.lp.archiveTab
- }).inject(this.rightCategoryItemDiv)
- .addEvents({
- "click":function(){
- //alert("已处理点击");
- //this.rightContentDiv.destroy();
- //this.createBaseWorkSearchDiv();
- this.createView( "archive" );
- }.bind(this)
- })
- },
- createView : function( str ){
- this.workNavi1 = str || "todo";
- if( str == "done" ){
- this.drafterLi.setStyles({"border-bottom":""});
- this.todoLi.setStyles({"border-bottom":""});
- this.doneLi.setStyles({"border-bottom":"2px solid #124c93"});
- this.archiveLi.setStyles({"border-bottom":""});
- this.createDoneView();
- }else if(str == "drafter"){
- this.drafterLi.setStyles({"border-bottom":"2px solid #124c93"});
- this.todoLi.setStyles({"border-bottom":""});
- this.doneLi.setStyles({"border-bottom":""});
- this.archiveLi.setStyles({"border-bottom":""});
- this.createDrafterView();
- }else if(str=="archive"){
- this.drafterLi.setStyles({"border-bottom":""});
- this.todoLi.setStyles({"border-bottom":""});
- this.doneLi.setStyles({"border-bottom":""});
- this.archiveLi.setStyles({"border-bottom":"2px solid #124c93"});
- this.createArchiveView();
- }else{
- this.drafterLi.setStyles({"border-bottom":""});
- this.todoLi.setStyles({"border-bottom":"2px solid #124c93"});
- this.doneLi.setStyles({"border-bottom":""});
- this.archiveLi.setStyles({"border-bottom":""});
- this.createTodoView();
- }
- },
- createSearchDiv:function(){
- this.rightSearchDiv = new Element("div.rightSearchDiv",{"styles":this.css.rightSearchDiv}).inject(this.contentDiv);
- rightSearchBarSpan = new Element("span.rightSearchBarSpan",{
- "styles":this.css.rightSearchBarSpan
- }).inject(this.rightSearchDiv);
- this.rightSearchBarInput = new Element("input",{
- "styles":this.css.rightSearchBarInput,
- "type":"text"
- }).inject(rightSearchBarSpan)
- .addEvents({
- "keyup": function(e){
- if(e.code == 13){
- this.searchAction();
- }
- }.bind(this)
- });
- this.rightSearchBarSearch = new Element("div.rightSearchBarSearch",{
- "styles":this.css.rightSearchBarSearch,
- "text" : MWF.xApplication.Execution.LP.workTask.search
- }).inject(rightSearchBarSpan)
- .addEvents({
- "click":function(){
- this.searchAction();
- }.bind(this)
- })
- },
- searchAction: function(){
- var filterData = {};
- filterData.title = this.rightSearchBarInput.get("value");
- if(this.drafterView) this.createDrafterView(filterData);
- if(this.todoView) this.createTodoView(filterData);
- if(this.doneView) this.createDoneView(filterData)
- },
- createRightContentDiv: function(){
- if(this.rightContentDiv)this.rightContentDiv.destroy();
- this.rightContentDiv = new Element("div.rightContentDiv",{
- "styles":this.css.rightContentDiv
- }).inject(this.contentDiv);
- //MWF.require("MWF.widget.ScrollBar", function () {
- // new MWF.widget.ScrollBar(this.rightContentDiv, {
- // "indent": false,
- // "style": "xApp_TaskList",
- // "where": "before",
- // "distance": 30,
- // "friction": 4,
- // "axis": {"x": false, "y": true},
- // "onScroll": function (y) {
- // var scrollSize = this.rightContentDiv.getScrollSize();
- // var clientSize = this.rightContentDiv.getSize();
- // var scrollHeight = scrollSize.y - clientSize.y;
- // var view = this.baseView || this.centerView;
- // if (y + 200 > scrollHeight && view && view.loadElementList) {
- // if (! view.isItemsLoaded) view.loadElementList();
- // }
- // }.bind(this)
- // });
- //}.bind(this));
- this.createView( this.options.workNavi1 );
- },
- createTodoView: function(filterData){
- if( this.drafterView )delete this.drafterView;
- if( this.todoView )delete this.todoView;
- if( this.doneView )delete this.doneView;
- if( this.archiveView) delete this.archiveView;
- //if(this.rightContentDiv) this.rightContentDiv.empty();
- this.reloadRightContentDiv();
- this.rightContentDiv.setStyles({"height":this.app.middleContent.getSize().y-40-100+"px"});
- if(this.scrollBar && this.scrollBar.scrollVAreaNode){
- this.scrollBar.scrollVAreaNode.destroy()
- }
- MWF.require("MWF.widget.ScrollBar", function () {
- //if(this.scrollBar) this.scrollBar.destroy()
- this.scrollBar = new MWF.widget.ScrollBar(this.rightContentDiv, {
- "indent": false,
- "style": "xApp_TaskList",
- "where": "before",
- "distance": 30,
- "friction": 4,
- "axis": {"x": false, "y": true},
- "onScroll": function (y) {
- var scrollSize = this.rightContentDiv.getScrollSize();
- var clientSize = this.rightContentDiv.getSize();
- var scrollHeight = scrollSize.y - clientSize.y;
- var view = this.todoView;
- if (y + 200 > scrollHeight && view && view.loadElementList) {
- if (! view.isItemsLoaded) view.loadElementList();
- }
- }.bind(this)
- });
- }.bind(this),false);
- this.todoView = new MWF.xApplication.Execution.WorkReportList.todoView(this.rightContentDiv, this.app, this, { templateUrl : this.path+"listItem_todo.json",filterData: filterData },{lp: this.lp.view} );
- this.todoView.load();
- },
- createDrafterView: function(filterData){
- if( this.drafterView )delete this.drafterView;
- if( this.todoView )delete this.todoView;
- if( this.doneView )delete this.doneView;
- if( this.archiveView) delete this.archiveView;
- //if(this.rightContentDiv) this.rightContentDiv.empty();
- this.reloadRightContentDiv();
- this.rightContentDiv.setStyles({"height":this.app.middleContent.getSize().y-40-100+"px"});
- if(this.scrollBar && this.scrollBar.scrollVAreaNode){
- this.scrollBar.scrollVAreaNode.destroy()
- }
- MWF.require("MWF.widget.ScrollBar", function () {
- //if(this.scrollBar) this.scrollBar.destroy()
- this.scrollBar = new MWF.widget.ScrollBar(this.rightContentDiv, {
- "indent": false,
- "style": "xApp_TaskList",
- "where": "before",
- "distance": 30,
- "friction": 4,
- "axis": {"x": false, "y": true},
- "onScroll": function (y) {
- var scrollSize = this.rightContentDiv.getScrollSize();
- var clientSize = this.rightContentDiv.getSize();
- var scrollHeight = scrollSize.y - clientSize.y;
- var view = this.drafterView;
- if (y + 200 > scrollHeight && view && view.loadElementList) {
- if (! view.isItemsLoaded) view.loadElementList();
- }
- }.bind(this)
- });
- }.bind(this),false);
- this.drafterView = new MWF.xApplication.Execution.WorkReportList.DrafterView(this.rightContentDiv, this.app, this, {
- templateUrl : this.path+"listItem_drafter.json",
- filterData: filterData
- },{lp: this.lp.view} );
- this.drafterView.load();
- },
- reloadRightContentDiv : function(){
- if(this.rightContentDiv)this.rightContentDiv.destroy();
- this.rightContentDiv = new Element("div.rightContentDiv",{
- "styles":this.css.rightContentDiv
- }).inject(this.contentDiv);
- },
- createDoneView: function(filterData){
- if( this.drafterView )delete this.drafterView;
- if( this.todoView )delete this.todoView;
- if( this.doneView )delete this.doneView;
- if( this.archiveView) delete this.archiveView;
- //if(this.rightContentDiv) this.rightContentDiv.empty();
- this.reloadRightContentDiv();
- this.rightContentDiv.setStyles({"height":this.app.middleContent.getSize().y-40-100+"px"});
- if(this.scrollBar && this.scrollBar.scrollVAreaNode){
- this.scrollBar.scrollVAreaNode.destroy()
- }
- MWF.require("MWF.widget.ScrollBar", function () {
- //if(this.scrollBar) this.scrollBar.destroy()
- this.scrollBar = new MWF.widget.ScrollBar(this.rightContentDiv, {
- "indent": false,
- "style": "xApp_TaskList",
- "where": "before",
- "distance": 30,
- "friction": 4,
- "axis": {"x": false, "y": true},
- "onScroll": function (y) {
- var scrollSize = this.rightContentDiv.getScrollSize();
- var clientSize = this.rightContentDiv.getSize();
- var scrollHeight = scrollSize.y - clientSize.y;
- if (y + 200 > scrollHeight && this.doneView && this.doneView.loadElementList) {
- if (! this.doneView.isItemsLoaded) this.doneView.loadElementList();
- }
- }.bind(this)
- });
- }.bind(this),false);
- this.doneView = new MWF.xApplication.Execution.WorkReportList.doneView(this.rightContentDiv, this.app, this, { templateUrl : this.path+"listItem_done.json",filterData: filterData },{lp: this.lp.view} )
- this.doneView.load();
- },
- createArchiveView: function(filterData){
- if( this.drafterView )delete this.drafterView;
- if( this.todoView )delete this.todoView;
- if( this.doneView )delete this.doneView;
- if( this.archiveView) delete this.archiveView;
- //if(this.rightContentDiv) this.rightContentDiv.empty();
- this.reloadRightContentDiv();
- this.rightContentDiv.setStyles({"height":this.app.middleContent.getSize().y-40-100+"px"});
- if(this.scrollBar && this.scrollBar.scrollVAreaNode){
- this.scrollBar.scrollVAreaNode.destroy()
- }
- MWF.require("MWF.widget.ScrollBar", function () {
- //if(this.scrollBar) this.scrollBar.destroy()
- this.scrollBar = new MWF.widget.ScrollBar(this.rightContentDiv, {
- "indent": false,
- "style": "xApp_TaskList",
- "where": "before",
- "distance": 30,
- "friction": 4,
- "axis": {"x": false, "y": true},
- "onScroll": function (y) {
- var scrollSize = this.rightContentDiv.getScrollSize();
- var clientSize = this.rightContentDiv.getSize();
- var scrollHeight = scrollSize.y - clientSize.y;
- if (y + 200 > scrollHeight && this.archiveView && this.archiveView.loadElementList) {
- if (! this.archiveView.isItemsLoaded) this.archiveView.loadElementList();
- }
- }.bind(this)
- });
- }.bind(this),false);
- this.archiveView = new MWF.xApplication.Execution.WorkReportList.archiveView(this.rightContentDiv, this.app, this, { templateUrl : this.path+"listItem_archive.json",filterData: filterData },{lp: this.lp.view} );
- this.archiveView.load();
- }
- });
- MWF.xApplication.Execution.WorkReportList.DrafterView = new Class({
- Extends: MWF.xApplication.Template.Explorer.ComplexView,
- _createDocument: function(data){
- return new MWF.xApplication.Execution.WorkReportList.DrafterDocument(this.viewNode, data, this.explorer, this);
- },
- _getCurrentPageData: function(callback, count){
- if (!count)count = 20;
- var id = (this.items.length) ? this.items[this.items.length - 1].data.id : "(0)";
- if(id=="(0)")this.app.createShade();
- var filter = this.options.filterData || {};
- this.actions.getWorkReportDrafterNext(id, count, filter,function(json){
- if (callback)callback(json);
- this.app.destroyShade();
- }.bind(this))
- },
- _removeDocument: function(documentData, all){
- this.actions.deleteWortReport(documentData.id, function(json){
- if(json.type && json.type == "success"){
- this.explorer.createDrafterView();
- this.app.notice(this.explorer.lp.prompt.deleteWortReport, "success");
- }
- }.bind(this),function(xhr,text,error){
- var errorText = error;
- if (xhr) errorMessage = xhr.responseText;
- var e = JSON.parse(errorMessage);
- if(e.message){
- this.app.notice( e.message,"error");
- }else{
- this.app.notice( errorText,"error");
- }
- }.bind(this));
- },
- _create: function(){
- },
- _openDocument: function( documentData ){
- MWF.xDesktop.requireApp("Execution", "WorkReport", function(){
- var data = {
- workReportId : documentData.id,
- workId : documentData.workId
- };
- this.workReport = new MWF.xApplication.Execution.WorkReport(this, this.actions,data,{
- "isEdited":false,
- onReloadView : function( data ){
- this.explorer.createDrafterView();
- }.bind(this)
- } );
- this.workReport.load();
- }.bind(this));
- },
- _queryCreateViewNode: function(){
- },
- _postCreateViewNode: function( viewNode ){
- },
- _queryCreateViewHead:function(){
- },
- _postCreateViewHead: function( headNode ){
- }
- });
- MWF.xApplication.Execution.WorkReportList.DrafterDocument = new Class({
- Extends: MWF.xApplication.Template.Explorer.ComplexDocument,
- action_open:function(){
- },
- _queryCreateDocumentNode:function( itemData ){
- },
- _postCreateDocumentNode: function( itemNode, itemData ){
- if(itemNode.getElements("div[item='title']")){
- itemNode.getElements("div[item='title']").set("title",itemData.title)
- }
- },
- removeCenterWork : function(itemData){
- return false;
- }
- });
- MWF.xApplication.Execution.WorkReportList.todoView = new Class({
- Extends: MWF.xApplication.Template.Explorer.ComplexView,
- _createDocument: function(data){
- return new MWF.xApplication.Execution.WorkReportList.todoDocument(this.viewNode, data, this.explorer, this);
- },
- _getCurrentPageData: function(callback, count){
- if (!count)count = 20;
- var id = (this.items.length) ? this.items[this.items.length - 1].data.id : "(0)";
- if(id=="(0)")this.app.createShade();
- var filter = this.options.filterData || {};
- this.actions.getWorkReportTodoNext(id, count, filter,function(json){
- if (callback)callback(json);
- this.app.destroyShade();
- }.bind(this))
- },
- _removeDocument: function(documentData, all){
- this.actions.deleteCenterWork(documentData.id, function(json){
- if(this.tabLocation == "centerDrafter"){
- this.app.workTask.loadCenterWorkList("drafter")
- }else if(this.tabLocation == "centerDeploy"){
- this.app.workTask.loadCenterWorkList("deploy")
- }
- this.app.notice(this.app.lp.deleteDocumentOK, "success");
- }.bind(this));
- },
- _create: function(){
- },
- _openDocument: function( documentData ){
- MWF.xDesktop.requireApp("Execution", "WorkReport", function(){
- var data = {
- workReportId : documentData.workReportId,
- workId : documentData.workId
- };
- this.workReport = new MWF.xApplication.Execution.WorkReport(this, this.actions,data,{
- "isEdited":false,
- onReloadView : function( data ){
- this.explorer.createTodoView();
- }.bind(this)
- } );
- this.workReport.load();
- }.bind(this));
- },
- _queryCreateViewNode: function(){
- },
- _postCreateViewNode: function( viewNode ){
- },
- _queryCreateViewHead:function(){
- },
- _postCreateViewHead: function( headNode ){
- }
- });
- MWF.xApplication.Execution.WorkReportList.todoDocument = new Class({
- Extends: MWF.xApplication.Template.Explorer.ComplexDocument,
- action_open:function(){
- },
- _queryCreateDocumentNode:function( itemData ){
- },
- _postCreateDocumentNode: function( itemNode, itemData ){
- if(itemNode.getElements("div[item='title']")){
- itemNode.getElements("div[item='title']").set("title",itemData.title)
- }
- },
- removeCenterWork : function(itemData){
- return false;
- }
- });
- MWF.xApplication.Execution.WorkReportList.doneView = new Class({
- Extends: MWF.xApplication.Template.Explorer.ComplexView,
- _createDocument: function(data){
- return new MWF.xApplication.Execution.WorkReportList.doneDocument(this.viewNode, data, this.explorer, this);
- },
- _getCurrentPageData: function(callback, count){
- if (!count)count = 20;
- var id = (this.items.length) ? this.items[this.items.length - 1].data.id : "(0)";
- if(id=="(0)")this.app.createShade();
- var filter = this.options.filterData || {};
- this.actions.getWorkReportDoneNext(id, count, filter,function(json){
- if (callback)callback(json);
- this.app.destroyShade();
- }.bind(this))
- },
- _removeDocument: function(documentData, all){
- this.actions.deleteCenterWork(documentData.id, function(json){
- if(this.tabLocation == "centerDrafter"){
- this.app.workTask.loadCenterWorkList("drafter")
- }else if(this.tabLocation == "centerDeploy"){
- this.app.workTask.loadCenterWorkList("deploy")
- }
- this.app.notice(this.app.lp.deleteDocumentOK, "success");
- }.bind(this));
- },
- _create: function(){
- },
- _openDocument: function( documentData ){
- MWF.xDesktop.requireApp("Execution", "WorkReport", function(){
- var data = {
- workReportId : documentData.workReportId,
- workId : documentData.workId
- };
- this.workReport = new MWF.xApplication.Execution.WorkReport(this, this.actions,data,{
- "isEdited":false,
- onReloadView : function( data ){
- this.explorer.createDoneView();
- }.bind(this)
- } );
- this.workReport.load();
- }.bind(this));
- },
- _queryCreateViewNode: function(){
- },
- _postCreateViewNode: function( viewNode ){
- },
- _queryCreateViewHead:function(){
- },
- _postCreateViewHead: function( headNode ){
- }
- });
- MWF.xApplication.Execution.WorkReportList.doneDocument = new Class({
- Extends: MWF.xApplication.Template.Explorer.ComplexDocument,
- action_open:function(){
- MWF.xDesktop.requireApp("Execution", "WorkDeploy", function(){
- var isEditedBool = (this.view.tabLocation == "centerDrafter" || this.view.tabLocation == "baseDrafter") ? true : false;
- this.workDeploy = new MWF.xApplication.Execution.WorkDeploy(this.view, this.view.app.restActions,{"id":this.data.id},{"isEdited":isEditedBool,"centerWorkId":this.data.id} );
- this.workDeploy.load();
- }.bind(this))
- },
- _queryCreateDocumentNode:function( itemData ){
- },
- _postCreateDocumentNode: function( itemNode, itemData ){
- if(itemNode.getElements("div[item='title']")){
- itemNode.getElements("div[item='title']").set("title",itemData.title)
- }
- },
- removeCenterWork : function(itemData){
- return false;
- }
- });
- MWF.xApplication.Execution.WorkReportList.archiveView = new Class({
- Extends: MWF.xApplication.Template.Explorer.ComplexView,
- _createDocument: function(data){
- return new MWF.xApplication.Execution.WorkReportList.archiveDocument(this.viewNode, data, this.explorer, this);
- },
- _getCurrentPageData: function(callback, count){
- if (!count)count = 20;
- var id = (this.items.length) ? this.items[this.items.length - 1].data.id : "(0)";
- if(id=="(0)")this.app.createShade();
- var filter = this.options.filterData || {};
- this.actions.getWorkReportArchiveNext(id, count, filter,function(json){
- if (callback)callback(json);
- this.app.destroyShade();
- }.bind(this))
- },
- _removeDocument: function(documentData, all){
- this.actions.deleteCenterWork(documentData.id, function(json){
- if(this.tabLocation == "centerDrafter"){
- this.app.workTask.loadCenterWorkList("drafter")
- }else if(this.tabLocation == "centerDeploy"){
- this.app.workTask.loadCenterWorkList("deploy")
- }
- this.app.notice(this.app.lp.deleteDocumentOK, "success");
- }.bind(this));
- },
- _create: function(){
- },
- _openDocument: function( documentData ){
- MWF.xDesktop.requireApp("Execution", "WorkReport", function(){
- var data = {
- workReportId : documentData.workReportId,
- workId : documentData.workId
- };
- this.workReport = new MWF.xApplication.Execution.WorkReport(this, this.actions,data,{
- "isEdited":false,
- onReloadView : function( data ){
- this.explorer.createDoneView();
- }.bind(this)
- } );
- this.workReport.load();
- }.bind(this));
- },
- _queryCreateViewNode: function(){
- },
- _postCreateViewNode: function( viewNode ){
- },
- _queryCreateViewHead:function(){
- },
- _postCreateViewHead: function( headNode ){
- }
- });
- MWF.xApplication.Execution.WorkReportList.archiveDocument = new Class({
- Extends: MWF.xApplication.Template.Explorer.ComplexDocument,
- action_open:function(){
- MWF.xDesktop.requireApp("Execution", "WorkDeploy", function(){
- var isEditedBool = (this.view.tabLocation == "centerDrafter" || this.view.tabLocation == "baseDrafter") ? true : false
- this.workDeploy = new MWF.xApplication.Execution.WorkDeploy(this.view, this.view.app.restActions,{"id":this.data.id},{"isEdited":isEditedBool,"centerWorkId":this.data.id} );
- this.workDeploy.load();
- }.bind(this))
- },
- _queryCreateDocumentNode:function( itemData ){
- },
- _postCreateDocumentNode: function( itemNode, itemData ){
- if(itemNode.getElements("div[item='title']")){
- itemNode.getElements("div[item='title']").set("title",itemData.title)
- }
- },
- removeCenterWork : function(itemData){
- return false;
- }
- });
|