Преглед на файлове

Merge branch 'fix/TaskCenter.refresh_while_readed' into 'develop'

Merge of fix/TaskCenter.refresh_while_readed to develop

See merge request o2oa/o2oa!1410
蔡祥熠 преди 5 години
родител
ревизия
186b462e5b

+ 9 - 9
o2web/source/x_component_Selector/Unit.js

@@ -1,7 +1,7 @@
 MWF.xApplication.Selector = MWF.xApplication.Selector || {};
 MWF.xDesktop.requireApp("Selector", "Identity", null, false);
 MWF.xApplication.Selector.Unit = new Class({
-	Extends: MWF.xApplication.Selector.Identity,
+    Extends: MWF.xApplication.Selector.Identity,
     options: {
         "style": "default",
         "count": 0,
@@ -202,7 +202,7 @@ MWF.xApplication.Selector.Unit = new Class({
 });
 
 MWF.xApplication.Selector.Unit.Item = new Class({
-	Extends: MWF.xApplication.Selector.Identity.Item,
+    Extends: MWF.xApplication.Selector.Identity.Item,
     load : function(){
         if( this.selector.isFlatCategory ){
             if( !this.justItem && this.selector.options.expandSubEnable && this.data.subDirectUnitCount ){
@@ -682,12 +682,12 @@ MWF.xApplication.Selector.Unit.Item = new Class({
                 subJson.data.each(function(subData){
                     if( !this.selector.isExcluded( subData ) ) {
                         //if( !subData.subDirectUnitCount ){
-                            var category = this.selector._newItem(subData, this.selector, this.children, this.level + 1, this, true);
-                            category.justItem = true;
-                            category.load();
-                            this.selector.items.push( category );
-                            if( !this.subItems )this.subItems = [];
-                            this.subItems.push( category );
+                        var category = this.selector._newItem(subData, this.selector, this.children, this.level + 1, this, true);
+                        category.justItem = true;
+                        category.load();
+                        this.selector.items.push( category );
+                        if( !this.subItems )this.subItems = [];
+                        this.subItems.push( category );
                         //}
                     }
                 }.bind(this));
@@ -748,7 +748,7 @@ MWF.xApplication.Selector.Unit.SearchItem = new Class({
 });
 
 MWF.xApplication.Selector.Unit.ItemSelected = new Class({
-	Extends: MWF.xApplication.Selector.Identity.ItemSelected,
+    Extends: MWF.xApplication.Selector.Identity.ItemSelected,
     getData: function(callback){
         if (callback) callback();
     },

+ 28 - 0
o2web/source/x_component_process_TaskCenter/ReadList.js

@@ -163,6 +163,34 @@ MWF.xApplication.process.TaskCenter.ReadList.Item = new Class({
             this.close();
         }, null, this.list.app.content);
     },
+    openWorkByTaskCompleted: function(e, id){
+        var _self = this;
+        var options = {"workId": id, "readonly": true, "appId": "process.Work"+id,
+            "onQueryLoadForm" : function () {
+                this.appForm.addEvent("afterReaded", function () {
+                    _self.node.destroy();
+                    _self.list.refresh();
+                })
+            }, "onPostLoadForm" :function () {
+
+            }
+        };
+        this.list.app.desktop.openApplication(e, "process.Work", options);
+    },
+    openWorkCompleteedByTaskCompleted: function(e, id){
+        var _self = this;
+        var options = {"workCompletedId": id, "readonly": true, "appId": "process.Work"+id,
+            "onQueryLoadForm" : function () {
+                this.appForm.addEvent("afterReaded", function () {
+                    _self.node.destroy();
+                    _self.list.refresh();
+                })
+            }, "onPostLoadForm" :function () {
+
+            }
+        };
+        this.list.app.desktop.openApplication(e, "process.Work", options);
+    },
     closeTaskCompleted: function(callback){
 
         this.closeTaskCompletedNode.setStyle("display", "none");

+ 10 - 0
o2web/source/x_component_process_Work/Main.js

@@ -572,6 +572,13 @@ MWF.xApplication.process.Work.Main = new Class({
                 };
                 this.appForm.workAction = this.action;
                 this.appForm.app = this;
+
+                if( this.$events && this.$events.queryLoadForm ){
+                    this.appForm.addEvent( "queryLoad", function () {
+                        this.fireEvent("queryLoadForm");
+                    }.bind(this));
+                }
+
                 this.appForm.load(function(){
                     if (this.mask) this.mask.hide();
                     if (window.o2android && window.o2android.appFormLoaded){
@@ -582,6 +589,9 @@ MWF.xApplication.process.Work.Main = new Class({
                         layout.appForm = this.appForm;
                         window.webkit.messageHandlers.appFormLoaded.postMessage(JSON.stringify(this.appForm.mobileTools));
                     }
+
+                    this.fireEvent("postLoadForm");
+
                 }.bind(this));
             }.bind(this));
         }