Просмотр исходного кода

修复流程表单复原没有已阅的问题

unknown 5 лет назад
Родитель
Сommit
7b9c8fc34f

+ 27 - 4
o2web/source/x_component_process_ApplicationExplorer/Main.js

@@ -319,7 +319,7 @@ MWF.xApplication.process.ApplicationExplorer.Main = new Class({
 		var size = this.content.getSize();
 		var topSize = this.topNode.getComputedSize();
 		var bottomSize = this.bottomNode.getComputedSize();
-		var pt = this.contentArea.getStyle("padding-top").toInt() || 0;;
+		var pt = this.contentArea.getStyle("padding-top").toInt() || 0;
 		var pb = this.contentArea.getStyle("padding-bottom").toInt() || 0;
 
 		var h = size.y-topSize.totalHeight-bottomSize.totalHeight-pt-pb;
@@ -355,7 +355,7 @@ MWF.xApplication.process.ApplicationExplorer.Main = new Class({
 		}
 		e.stopPropagation();
 	},
-	loadApplicationCategoryList: function(){
+	loadApplicationCategoryList: function( currentCategoryName, noRefreshContent ){
 		if (this.control.canCreate){
 			this.restActions.listApplicationCategory(function(json){
 
@@ -370,9 +370,29 @@ MWF.xApplication.process.ApplicationExplorer.Main = new Class({
 				}.bind(this));
 
 				if (this.categoryAreaNode.getScrollSize().y>this.categoryAreaNode.getSize().y) this.createCategoryExpandButton();
+
+				if( currentCategoryName ){
+					var itemList = this.categoryAreaNode.getElements("div.o2_process_AppExp_categoryItem");
+					if( itemList.length > 0 ){
+						for( var i=0; i<itemList.length; i++ ){
+							if( itemList[i].retrieve("categoryName") === currentCategoryName ){
+								this.clickCategoryNode( itemList[i], noRefreshContent)
+							}
+						}
+					}
+				}
+
 			}.bind(this));
 		}
 	},
+	reloadApplicationCategoryList: function( noRefreshContent ){
+		var categoryName = "";
+		if( this.category ){
+			categoryName = this.category.retrieve("categoryName") || "";
+		}
+		this.categoryAreaNode.empty();
+		this.loadApplicationCategoryList( categoryName, noRefreshContent );
+	},
 	createCategoryItemNode: function(text, count){
 
 		var categoryName = text;
@@ -391,7 +411,7 @@ MWF.xApplication.process.ApplicationExplorer.Main = new Class({
 		});
 	},
 
-	clickCategoryNode: function(item){
+	clickCategoryNode: function(item, noRefreshContent){
 		// var node = this.categoryListAreaNode.getFirst("div");
 		// node.setStyles(this.css.allCategoryItemNode);
 		if (this.category){
@@ -408,7 +428,9 @@ MWF.xApplication.process.ApplicationExplorer.Main = new Class({
 		if (p.y>=size.y) item.inject(this.categoryAreaNode, "top");
 
 		this.category = item;
-		this.loadApplicationList(item);
+		if( !noRefreshContent ){
+			this.loadApplicationList(item);
+		}
 	},
 
 	getApplicationDimension: function(){
@@ -534,6 +556,7 @@ MWF.xApplication.process.ApplicationExplorer.Main = new Class({
 
 				var complete = function(){
 					if (doCount == readyCount){
+						_self.reloadApplicationCategoryList();
 						if (errorText){
 							_self.app.notice(errorText, "error");
 						}

+ 1 - 1
o2web/source/x_component_process_FormDesigner/Module/Form/form.html

@@ -112,7 +112,7 @@
 
 	</div>
     <div title="操作"  class="MWFTab" style="overflow: hidden; display: text{($.mode=='Mobile')?'block':'none'}">
-        <div class="MWFDefaultActionArea" name="defaultTools"></div>
+        <div class="MWFDefaultActionArea" name="defaultTools" data-target="mobileForm"></div>
         <div class="MWFActionArea" name="tools"></div>
     </div>
 	<div title="事件"  class="MWFTab">

+ 1 - 0
o2web/source/x_component_process_FormDesigner/Property.js

@@ -1562,6 +1562,7 @@ debugger;
                     "noDelete": false,
                     "noCode": true,
                     "noReadShow": true,
+                    "target" : node.get("data-target"),
                     "noEditShow": true,
                     "onChange": function(){
                         this.data[name] = actionEditor.data;

+ 14 - 0
o2web/source/x_component_process_FormDesigner/widget/ActionsEditor.js

@@ -91,6 +91,7 @@ MWF.xApplication.process.FormDesigner.widget.ActionsEditor = new Class({
             }).inject(this.actionTitleArea);
 
             this.restoreActionButtonButton.addEvent("click", function(){
+                debugger;
                 this.restoreButtonAction();
             }.bind(this));
         }
@@ -100,6 +101,19 @@ MWF.xApplication.process.FormDesigner.widget.ActionsEditor = new Class({
         if( !this.defaultTools ){
             MWF.getJSON( this.options.systemToolsAddress, function(tools){
                 this.defaultTools = tools;
+                if( this.options.target && this.options.target === "mobileForm" ){
+                    this.defaultTools.push({
+                        "type": "MWFToolBarButton",
+                        "img": "read.png",
+                        "title": "标记为已阅",
+                        "action": "readedWork",
+                        "text": "已阅",
+                        "id": "action_readed",
+                        "control": "allowReadProcessing",
+                        "condition": "",
+                        "read": true
+                    });
+                }
             }.bind(this), false);
         }
         this.defaultTools.each( function( tool ){