Jelajahi Sumber

Merge branch 'fix/CMS.refresh_execption' into 'release'

Merge of fix/[内容管理]修复文档发布后,列表界面未刷新的问题;修复表单新建后,表单列表未刷新的问题。 to release

See merge request o2oa/o2oa!421
蔡祥熠 5 tahun lalu
induk
melakukan
5f1c91ba70

+ 6 - 0
o2web/source/x_component_cms_ColumnManager/FormExplorer.js

@@ -99,6 +99,9 @@ MWF.xApplication.cms.ColumnManager.FormExplorer = new Class({
                     "onQueryLoad": function(){
                     "onQueryLoad": function(){
                         this.actions = _self.app.restActions;
                         this.actions = _self.app.restActions;
                         this.application = _self.app.options.application;
                         this.application = _self.app.options.application;
+                    },
+                    "onPostSave" : function () {
+                        _self.reload();
                     }
                     }
                 };
                 };
                 layout.desktop.openApplication(e, "cms.FormDesigner", options);
                 layout.desktop.openApplication(e, "cms.FormDesigner", options);
@@ -112,6 +115,9 @@ MWF.xApplication.cms.ColumnManager.FormExplorer = new Class({
                     "onQueryLoad": function(){
                     "onQueryLoad": function(){
                         this.actions = _self.app.restActions;
                         this.actions = _self.app.restActions;
                         this.application = _self.app.options.application;
                         this.application = _self.app.options.application;
+                    },
+                    "onPostSave" : function () {
+                        _self.reload();
                     }
                     }
                 };
                 };
                 layout.desktop.openApplication(e, "cms.FormDesigner", options);
                 layout.desktop.openApplication(e, "cms.FormDesigner", options);

+ 1 - 0
o2web/source/x_component_cms_Document/Main.js

@@ -366,6 +366,7 @@ MWF.xApplication.cms.Document.Main = new Class({
                     "autoSave" : this.options.autoSave,
                     "autoSave" : this.options.autoSave,
                     "saveOnClose" : this.options.saveOnClose,
                     "saveOnClose" : this.options.saveOnClose,
                     "onPostPublish" : this.options.postPublish,
                     "onPostPublish" : this.options.postPublish,
+                    "onAfterPublish" : this.options.afterPublish,
                     "onPostDelete" : this.options.postDelete
                     "onPostDelete" : this.options.postDelete
                 });
                 });
                 this.appForm.businessData = {
                 this.appForm.businessData = {

+ 1 - 0
o2web/source/x_component_cms_FormDesigner/Main.js

@@ -1421,6 +1421,7 @@ MWF.xApplication.cms.FormDesigner.Main = new Class({
                 //this.fireAppEvent("postSave"); //add by cxy
                 //this.fireAppEvent("postSave"); //add by cxy
                 if (this.pcForm) this.pcForm.fireEvent("postSave");
                 if (this.pcForm) this.pcForm.fireEvent("postSave");
                 if (this.mobileForm) this.mobileForm.fireEvent("postSave");
                 if (this.mobileForm) this.mobileForm.fireEvent("postSave");
+                this.fireEvent("postSave");
 
 
                 this.isSave = false;
                 this.isSave = false;
 
 

+ 5 - 2
o2web/source/x_component_cms_Index/Newer.js

@@ -492,10 +492,13 @@ MWF.xApplication.cms.Index.Newer = new Class({
                 "documentId": id,
                 "documentId": id,
                 "appId": appId,
                 "appId": appId,
                 "onPostPublish" : function(){
                 "onPostPublish" : function(){
+                    this.fireEvent( "postPublish" );
+                }.bind(this),
+                "onAfterPublish" : function () {
                     debugger;
                     debugger;
                     if(_self.view && _self.view.reload )_self.view.reload();
                     if(_self.view && _self.view.reload )_self.view.reload();
-                    this.fireEvent( "postPublish" );
-                }.bind(this)
+                    _self.fireEvent( "afterPublish" );
+                }
             };
             };
             if( typeOf(this.options.autoSave) == "boolean" )options.autoSave = this.options.autoSave;
             if( typeOf(this.options.autoSave) == "boolean" )options.autoSave = this.options.autoSave;
             if( typeOf(this.options.saveOnClose) == "boolean" )options.saveOnClose = this.options.saveOnClose;
             if( typeOf(this.options.saveOnClose) == "boolean" )options.saveOnClose = this.options.saveOnClose;

+ 9 - 10
o2web/source/x_component_cms_Module/Main.js

@@ -226,16 +226,15 @@ MWF.xApplication.cms.Module.Main = new Class({
 						//if(this.options.columnData.ignoreTitle===undefined) this.options.columnData.ignoreTitle = false;
 						//if(this.options.columnData.ignoreTitle===undefined) this.options.columnData.ignoreTitle = false;
 
 
 						this.creater = new MWF.xApplication.cms.Index.Newer( this.options.columnData, null, this, this.view, {
 						this.creater = new MWF.xApplication.cms.Index.Newer( this.options.columnData, null, this, this.view, {
-							restrictToColumn : true,
-							onPostPublish : function () {
-								debugger;
-								try{
-									if(this.view && this.view.reload){
-										this.view.reload();
-									}
-								}catch (e) {
-								}
-							}.bind(this)
+							restrictToColumn : true
+							// onAfterPublish : function () {
+							// 	try{
+							// 		if(this.view && this.view.reload){
+							// 			this.view.reload();
+							// 		}
+							// 	}catch (e) {
+							// 	}
+							// }.bind(this)
 							//ignoreTitle : this.options.columnData.ignoreTitle,
 							//ignoreTitle : this.options.columnData.ignoreTitle,
 							//latest : this.options.columnData.latest
 							//latest : this.options.columnData.latest
 						});
 						});

+ 2 - 0
o2web/source/x_component_cms_Xform/Form.js

@@ -457,6 +457,7 @@ MWF.xApplication.cms.Xform.Form = MWF.CMSForm = new Class({
         delete documentData.attachmentList;
         delete documentData.attachmentList;
         //this.documentAction.saveDocument(documentData, function(){
         //this.documentAction.saveDocument(documentData, function(){
         this.fireEvent("postPublish", [documentData]);
         this.fireEvent("postPublish", [documentData]);
+        if (this.app) if (this.app.fireEvent) this.app.fireEvent("postPublish",[documentData]);
         if (this.officeList) {
         if (this.officeList) {
             this.officeList.each(function (module) {
             this.officeList.each(function (module) {
                 module.save(history);
                 module.save(history);
@@ -465,6 +466,7 @@ MWF.xApplication.cms.Xform.Form = MWF.CMSForm = new Class({
         this.documentAction.publishDocumentComplex(documentData, function (json) {
         this.documentAction.publishDocumentComplex(documentData, function (json) {
             this.businessData.data.isNew = false;
             this.businessData.data.isNew = false;
             this.fireEvent("afterPublish");
             this.fireEvent("afterPublish");
+            if (this.app) if (this.app.fireEvent) this.app.fireEvent("afterPublish");
             if (callback) callback();
             if (callback) callback();
             if (this.app.mobile) {
             if (this.app.mobile) {
                 this.app.content.unmask();
                 this.app.content.unmask();