Sfoglia il codice sorgente

完成查看、切换、启用流程版本等功能

huqi 5 anni fa
parent
commit
717faf1b26
38 ha cambiato i file con 482 aggiunte e 62 eliminazioni
  1. 49 0
      o2web/source/o2_core/o2/o2.core.js
  2. 24 5
      o2web/source/o2_core/o2/widget/$Dialog/o2/css.wcss
  3. 2 2
      o2web/source/o2_core/o2/widget/$Dialog/o2/dialog.html
  4. BIN
      o2web/source/o2_core/o2/widget/$Dialog/o2/img/close.png
  5. BIN
      o2web/source/o2_core/o2/widget/$Dialog/o2/img/max.png
  6. BIN
      o2web/source/o2_core/o2/widget/$Dialog/o2/img/min.png
  7. BIN
      o2web/source/o2_core/o2/widget/$Dialog/o2/img/return.png
  8. 28 9
      o2web/source/o2_core/o2/widget/$Dialog/user/css.wcss
  9. 7 7
      o2web/source/o2_core/o2/widget/$Dialog/user/dialog.html
  10. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user/img/close.png
  11. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user/img/max.png
  12. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user/img/min.png
  13. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user/img/return.png
  14. 88 0
      o2web/source/o2_core/o2/widget/$Dialog/user4/css.wcss
  15. 15 0
      o2web/source/o2_core/o2/widget/$Dialog/user4/dialog.html
  16. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user4/img/bottom-bg.gif
  17. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user4/img/bottom-left.gif
  18. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user4/img/bottom-right.gif
  19. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user4/img/close.png
  20. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user4/img/max.gif
  21. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user4/img/max.png
  22. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user4/img/resize.png
  23. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user4/img/return.gif
  24. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user4/img/return.png
  25. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user4/img/title-bg.gif
  26. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user4/img/title-left.gif
  27. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user4/img/title-right.gif
  28. 3 0
      o2web/source/o2_core/o2/widget/Dialog.js
  29. 2 1
      o2web/source/o2_core/o2/xDesktop/$Default/applications.json
  30. 3 0
      o2web/source/o2_core/o2/xDesktop/Dialog.js
  31. 14 0
      o2web/source/x_component_process_ProcessDesigner/$Process/activity.json
  32. 1 1
      o2web/source/x_component_process_ProcessDesigner/$Process/process.html
  33. 2 0
      o2web/source/x_component_process_ProcessDesigner/Activity.js
  34. 1 0
      o2web/source/x_component_process_ProcessDesigner/Process.js
  35. 1 1
      o2web/source/x_component_process_ProcessDesigner/Route.js
  36. 8 8
      o2web/source/x_component_process_ProcessDesigner/lp/zh-cn.js
  37. 4 1
      o2web/source/x_component_process_ProcessDesigner/widget/$EditionList/default/css.wcss
  38. 230 27
      o2web/source/x_component_process_ProcessDesigner/widget/EditionList.js

+ 49 - 0
o2web/source/o2_core/o2/o2.core.js

@@ -412,6 +412,55 @@
         }
         return obj;
     };
+    if (!Array.prototype.findIndex) {
+        Object.defineProperty(Array.prototype, 'findIndex', {
+            value: function(predicate) {
+                if (this == null) {
+                    throw new TypeError('"this" is null or not defined');
+                }
+                var o = Object(this);
+                var len = o.length >>> 0;
+                if (typeof predicate !== 'function') {
+                    throw new TypeError('predicate must be a function');
+                }
+                var thisArg = arguments[1];
+                var k = 0;
+                while (k < len) {
+                    var kValue = o[k];
+                    if (predicate.call(thisArg, kValue, k, o)) {
+                        return k;
+                    }
+                    k++;
+                }
+                return -1;
+            }
+        });
+    }
+    if (!Array.prototype.find) {
+        Object.defineProperty(Array.prototype, 'find', {
+            value: function(predicate) {
+                if (this == null) {
+                    throw new TypeError('"this" is null or not defined');
+                }
+                var o = Object(this);
+                var len = o.length >>> 0;
+                if (typeof predicate !== 'function') {
+                    throw new TypeError('predicate must be a function');
+                }
+                var thisArg = arguments[1];
+                var k = 0;
+                while (k < len) {
+                    var kValue = o[k];
+                    if (predicate.call(thisArg, kValue, k, o)) {
+                        return kValue;
+                    }
+                    k++;
+                }
+                return undefined;
+            }
+        });
+    }
+
     var _txt = function(v){
         var t = v.replace(/\</g, "&lt;");
         t = t.replace(/\</g, "&gt;");

+ 24 - 5
o2web/source/o2_core/o2/widget/$Dialog/o2/css.wcss

@@ -16,14 +16,14 @@
 		"padding": "3px",
 
 		"opacity": 0,
-        "border-radius": "5px"
+        "border-radius": "8px"
 	},
 	"to": {
 		"background-color": "#fff",
 		"border-style": "solid",
 		"border-color": "#fff",
 		"border-width": "1",
-		"box-shadow": "0px 0px 20px #999",
+		"box-shadow": "0px 0px 18px 0px rgba(153,153,153,1)",
 		"z-index": "20000",
 		"overflow": "hidden",
 		"font-size": "14px",
@@ -34,7 +34,7 @@
 		"top": "0",
 		"left": "0",
 		"opacity": 1,
-		"border-radius": "5px"
+		"border-radius": "8px"
 	},
 	"mark": {
 		"height": "0",
@@ -53,8 +53,27 @@
 		"background-color": "#3C76B7",
 		"color": "#fff",
 		"height": "30px",
-		"border-radius": "5px",
+		"border-radius": "20px",
 		"min-width": "80px",
 		"margin": "10px 5px"
-	}
+	},
+	"okButton": {
+        "border": "0px",
+        "background-color": "#3C76B7",
+        "color": "#fff",
+        "height": "30px",
+        "border-radius": "20px",
+        "min-width": "80px",
+        "margin": "10px 5px"
+    },
+    cancelButton: {
+        "border": "0px",
+        "height": "30px",
+        "border-radius": "20px",
+        "min-width": "80px",
+        "margin": "10px 5px",
+        "color": "#fff",
+        "background-color": "#999999 !important",
+
+    },
 }

File diff suppressed because it is too large
+ 2 - 2
o2web/source/o2_core/o2/widget/$Dialog/o2/dialog.html


BIN
o2web/source/o2_core/o2/widget/$Dialog/o2/img/close.png


BIN
o2web/source/o2_core/o2/widget/$Dialog/o2/img/max.png


BIN
o2web/source/o2_core/o2/widget/$Dialog/o2/img/min.png


BIN
o2web/source/o2_core/o2/widget/$Dialog/o2/img/return.png


+ 28 - 9
o2web/source/o2_core/o2/widget/$Dialog/user/css.wcss

@@ -7,10 +7,10 @@
 		"left": $(document.body).getSize().x/2,
 		"border-style": "solid",
 		"border-color": "#3C76B7",
-		"border-width": "1",
+		"border-width": "0",
 	    "overflow": "hidden",
-		"background-color": "#f3f3f3",
-		"box-shadow": "0px 0px 20px #999999",
+		"background-color": "#ffffff",
+		"box-shadow": "0px 0px 18px 0px rgba(153,153,153,1)",
 		"z-index": "1000",
 		
 		"padding": "3px",
@@ -19,11 +19,11 @@
         "border-radius": "5px"
 	},
 	"to": {
-		"background-color": "#f3f3f3",
+		"background-color": "#ffffff",
 		"border-style": "solid",
 		"border-color": "#3C76B7",
-		"border-width": "1",
-		"box-shadow": "0px 0px 20px #999999",
+		"border-width": "0",
+		"box-shadow": "0px 0px 18px 0px rgba(153,153,153,1)",
 		"z-index": "1000",
 		"overflow": "hidden",
 		"font-size": "14px",
@@ -34,7 +34,7 @@
 		"top": "0",
 		"left": "0",
 		"opacity": 1,
-		"border-radius": "5px"
+		"border-radius": "8px"
 	},
 	"mark": {
 		"height": "0",
@@ -49,14 +49,33 @@
 		"background-color": "#CCC"
 	},
 	"button": {
-		"border": "1px solid #999",
+		"border": "0px solid #999",
 		"background-color": "#3C76B7",
 		"color": "#fff",
 		"height": "30px",
-		"border-radius": "5px",
+		"border-radius": "20px",
 		"min-width": "80px",
 		"margin": "10px 5px"
 	},
+	"okButton": {
+        "border": "0px",
+        "background-color": "#3C76B7",
+        "color": "#fff",
+        "height": "30px",
+        "border-radius": "20px",
+        "min-width": "80px",
+        "margin": "10px 5px"
+    },
+	cancelButton: {
+        "border": "0px",
+        "height": "30px",
+        "border-radius": "20px",
+        "min-width": "80px",
+        "margin": "10px 5px",
+        "color": "#fff",
+        "background-color": "#999999 !important",
+
+    },
 	"closeAction": {
 	    "height": "40px",
 	    "width": "30px",

+ 7 - 7
o2web/source/o2_core/o2/widget/$Dialog/user/dialog.html

@@ -1,15 +1,15 @@
-<div style="background-color: #f3f3f3;">
-    <div style="border-top-left-radius: 3px; border-top-right-radius: 3px; height:40px; font-size:14px; line-height:40px; color: #FFFFFF; background-color: #3C76B7; cursor: move; color: #ffffff" class="MWF_dialod_title">
-		<div style="height: 40px; float:left; padding-left:20px;" class="MWF_dialod_title_text"></div>
+<div style="background-color: #ffffff;">
+    <div style="border-top-left-radius: 8px; border-top-right-radius: 8px; height:40px; font-size:16px; line-height:50px; cursor: move; color: #333333" class="MWF_dialod_title">
+		<div style="height: 40px; float:left; padding-left:30px;" class="MWF_dialod_title_text"></div>
 		<div style="height: 40px; float:right;" class="MWF_dialod_title_action"></div>
     </div>
-    <div style="margin-top: 3px; background-color: #f3f3f3; overflow:hidden">
-        <div class="MWF_dialod_content" style="overflow: auto; text-align: left; background-color: #f3f3f3; line-height:20px;"></div>
+    <div style="margin-top: 3px; background-color: #ffffff; overflow:hidden">
+        <div class="MWF_dialod_content" style="overflow: auto; text-align: left; line-height:20px; padding: 0 20px"></div>
     </div>
-	<div style="height:50px; text-align: right; background-color: #f3f3f3;padding-right:10px;" class="MWF_dialod_button">
+	<div style="height:50px; text-align: right; background-color: #ffffff;padding-right:20px;" class="MWF_dialod_button">
         
     </div>
-    <div class="MWF_dialod_bottom" style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; background-color: #f3f3f3; margin-bottom: 3px; height: 8px;">
+    <div class="MWF_dialod_bottom" style="border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; background-color: #ffffff; margin-bottom: 3px; height: 8px;">
         <div class="MWF_dialod_bottom_resize" style="cursor: nw-resize;height: 5px; width: 5px; float:right;"></div>
     </div>
 </div>

BIN
o2web/source/o2_core/o2/widget/$Dialog/user/img/close.png


BIN
o2web/source/o2_core/o2/widget/$Dialog/user/img/max.png


BIN
o2web/source/o2_core/o2/widget/$Dialog/user/img/min.png


BIN
o2web/source/o2_core/o2/widget/$Dialog/user/img/return.png


+ 88 - 0
o2web/source/o2_core/o2/widget/$Dialog/user4/css.wcss

@@ -0,0 +1,88 @@
+{
+	"from": {
+		"width": "1px",
+		"height": "1px",
+		"position": "absolute",
+		"top": $(document.body).getSize().y/2,
+		"left": $(document.body).getSize().x/2,
+		"border-style": "solid",
+		"border-color": "#3C76B7",
+		"border-width": "1",
+	    "overflow": "hidden",
+		"background-color": "#f3f3f3",
+		"box-shadow": "0px 0px 20px #999999",
+		"z-index": "1000",
+		
+		"padding": "3px",
+
+		"opacity": 0,
+        "border-radius": "5px"
+	},
+	"to": {
+		"background-color": "#f3f3f3",
+		"border-style": "solid",
+		"border-color": "#3C76B7",
+		"border-width": "1",
+		"box-shadow": "0px 0px 20px #999999",
+		"z-index": "1000",
+		"overflow": "hidden",
+		"font-size": "14px",
+		"height": "60",
+		"padding": "0px",
+		"width": "300",
+		"position": "absolute",
+		"top": "0",
+		"left": "0",
+		"opacity": 1,
+		"border-radius": "5px"
+	},
+	"mark": {
+		"height": "0",
+		"width": "0",
+		"opacity": 0.3,
+		"position": "absolute",
+		"top": "0px",
+		"left": "0px",
+		"z-index": "999",
+		"border-style": "none",
+		"border-width": "0",
+		"background-color": "#CCC"
+	},
+	"button": {
+		"border": "1px solid #999",
+		"background-color": "#3C76B7",
+		"color": "#fff",
+		"height": "30px",
+		"border-radius": "5px",
+		"min-width": "80px",
+		"margin": "10px 5px"
+	},
+	"closeAction": {
+	    "height": "40px",
+	    "width": "30px",
+	    "float": "right",
+	    "cursor": "pointer",
+	    "background": "url("+o2.session.path+"/widget/$Dialog/user/img/close.png) center center no-repeat",
+	},
+	"maxAction": {
+	    "height": "40px",
+        "width": "20px",
+        "float": "right",
+        "cursor": "pointer",
+        "background": "url("+o2.session.path+"/widget/$Dialog/user/img/max.png) center center no-repeat"
+	},
+	"restoreAction": {
+        "height": "40px",
+        "width": "20px",
+        "float": "right",
+        "cursor": "pointer",
+        "background": "url("+o2.session.path+"/widget/$Dialog/user/img/return.png) center center no-repeat"
+    },
+	"MWF_dialod_bottom_resize": {
+	    "height": "8px",
+        "width": "8px",
+        "float": "right",
+        "cursor": "nw-resize",
+        "background": "url("+o2.session.path+"/widget/$Dialog/user/img/resize.png) center center no-repeat",
+	}
+}

+ 15 - 0
o2web/source/o2_core/o2/widget/$Dialog/user4/dialog.html

@@ -0,0 +1,15 @@
+<div style="background-color: #f3f3f3;">
+    <div style="border-top-left-radius: 3px; border-top-right-radius: 3px; height:40px; font-size:14px; line-height:40px; color: #FFFFFF; background-color: #3C76B7; cursor: move; color: #ffffff" class="MWF_dialod_title">
+		<div style="height: 40px; float:left; padding-left:20px;" class="MWF_dialod_title_text"></div>
+		<div style="height: 40px; float:right;" class="MWF_dialod_title_action"></div>
+    </div>
+    <div style="margin-top: 3px; background-color: #f3f3f3; overflow:hidden">
+        <div class="MWF_dialod_content" style="overflow: auto; text-align: left; background-color: #f3f3f3; line-height:20px;"></div>
+    </div>
+	<div style="height:50px; text-align: right; background-color: #f3f3f3;padding-right:10px;" class="MWF_dialod_button">
+        
+    </div>
+    <div class="MWF_dialod_bottom" style="border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; background-color: #f3f3f3; margin-bottom: 3px; height: 8px;">
+        <div class="MWF_dialod_bottom_resize" style="cursor: nw-resize;height: 5px; width: 5px; float:right;"></div>
+    </div>
+</div>

BIN
o2web/source/o2_core/o2/widget/$Dialog/user4/img/bottom-bg.gif


BIN
o2web/source/o2_core/o2/widget/$Dialog/user4/img/bottom-left.gif


BIN
o2web/source/o2_core/o2/widget/$Dialog/user4/img/bottom-right.gif


BIN
o2web/source/o2_core/o2/widget/$Dialog/user4/img/close.png


BIN
o2web/source/o2_core/o2/widget/$Dialog/user4/img/max.gif


BIN
o2web/source/o2_core/o2/widget/$Dialog/user4/img/max.png


BIN
o2web/source/o2_core/o2/widget/$Dialog/user4/img/resize.png


BIN
o2web/source/o2_core/o2/widget/$Dialog/user4/img/return.gif


BIN
o2web/source/o2_core/o2/widget/$Dialog/user4/img/return.png


BIN
o2web/source/o2_core/o2/widget/$Dialog/user4/img/title-bg.gif


BIN
o2web/source/o2_core/o2/widget/$Dialog/user4/img/title-left.gif


BIN
o2web/source/o2_core/o2/widget/$Dialog/user4/img/title-right.gif


+ 3 - 0
o2web/source/o2_core/o2/widget/Dialog.js

@@ -228,12 +228,14 @@ o2.widget.Dialog = o2.DL = new Class({
 			var button = new Element("input", {
 				"type": "button",
 				"value": i,
+				"class": "mainColor_bg",
 				"styles": this.css.button,
 				"events": {
 					"click": this.options.buttons[i].bind(this)
 				}
 			}).inject(this.button);
 		}
+		debugger;
 		if (this.options.buttonList){
 			this.options.buttonList.each(function(bt){
 				var styles = this.css.button;
@@ -244,6 +246,7 @@ o2.widget.Dialog = o2.DL = new Class({
 					"type": "button",
 					"value": bt.text,
 					"title": bt.title,
+					"class": "mainColor_bg",
 					"styles": styles,
 					"events": {
 						"click": function(e){bt.action.call(this, this, e)}.bind(this)

+ 2 - 1
o2web/source/o2_core/o2/xDesktop/$Default/applications.json

@@ -4,7 +4,8 @@
     "path": "Setting",
     "title": "系统设置",
     "iconPath": "appicon.png",
-    "allowList": ["xadmin", "Manager"]
+    "allowList": ["xadmin", "Manager"],
+    "denyList": []
   },
   {
     "name": "AppMarket",

+ 3 - 0
o2web/source/o2_core/o2/xDesktop/Dialog.js

@@ -114,11 +114,13 @@ o2.xDesktop.Dialog = o2.DDL = new Class({
                 "type": "button",
                 "value": i,
                 "styles": this.css.button,
+                "class": "mainColor_bg",
                 "events": {
                     "click": this.options.buttons[i].bind(this)
                 }
             }).inject(this.button);
         }
+        debugger;
         if (this.options.buttonList){
             this.options.buttonList.each(function(bt){
                 var styles = this.css.button;
@@ -141,6 +143,7 @@ o2.xDesktop.Dialog = o2.DDL = new Class({
                     "value": bt.text,
                     "title": bt.title,
                     "styles": styles,
+                    "class": "mainColor_bg",
                     "events": {
                         "click": function(e){bt.action.call(this, this, e)}.bind(this)
                     }

+ 14 - 0
o2web/source/x_component_process_ProcessDesigner/$Process/activity.json

@@ -9,6 +9,7 @@
     "createTime": "",
     "updateTime": "",
     "extension": "",
+    "edition": "",
     "form": "",
 
 
@@ -94,6 +95,7 @@
     "createTime": "",
     "updateTime": "",
     "extension": "",
+    "edition": "",
     "form": "",
 
     "readIdentityList": [],
@@ -140,6 +142,7 @@
     "createTime": "",
     "updateTime": "",
     "extension": "",
+    "edition": "",
     "form": "",
 
     "readIdentityList": [],
@@ -180,6 +183,7 @@
     "createTime": "",
     "updateTime": "",
     "extension": "",
+    "edition": "",
     "form": "",
 
     "readIdentityList": [],
@@ -220,6 +224,7 @@
     "createTime": "",
     "updateTime": "",
     "extension": "",
+    "edition": "",
     "form": "",
 
     "readIdentityList": [],
@@ -269,6 +274,7 @@
     "createTime": "",
     "updateTime": "",
     "extension": "",
+    "edition": "",
     "form": "",
 
     "readIdentityList": [],
@@ -319,6 +325,7 @@
     "createTime": "",
     "updateTime": "",
     "extension": "",
+    "edition": "",
     "form": "",
 
     "readIdentityList": [],
@@ -365,6 +372,7 @@
     "createTime": "",
     "updateTime": "",
     "extension": "",
+    "edition": "",
     "form": "",
 
     "readIdentityList": [],
@@ -411,6 +419,7 @@
     "createTime": "",
     "updateTime": "",
     "extension": "",
+    "edition": "",
     "form": "",
 
     "readIdentityList": [],
@@ -457,6 +466,7 @@
     "createTime": "",
     "updateTime": "",
     "extension": "",
+    "edition": "",
     "form": "",
     "async": false,
 
@@ -525,6 +535,7 @@
     "createTime": "",
     "updateTime": "",
     "extension": "",
+    "edition": "",
     "form": "",
 
     "readIdentityList": [],
@@ -573,6 +584,7 @@
     "id":"",
     "version":1,
     "createTime":"",
+    "edition": "",
     "type": "service",
 
     "beforeArriveScript": "",
@@ -608,6 +620,7 @@
     "createTime": "",
     "updateTime": "",
     "extension": "",
+    "edition": "",
     "form": "",
     "async": false,
 
@@ -676,6 +689,7 @@
     "process": "",
     "type": "delay",
     "form": "",
+    "edition": "",
     "extension": "",
 
     "readIdentityList": [],

+ 1 - 1
o2web/source/x_component_process_ProcessDesigner/$Process/process.html

@@ -44,7 +44,7 @@
             </tr>
             <tr>
                 <td class="editTableTitle">版本描述:</td>
-                <td class="editTableValue"><textarea  name="description" class="editTableTextarea">text{$.editionDes}</textarea></td>
+                <td class="editTableValue"><textarea  name="editionDes" class="editTableTextarea">text{$.editionDes}</textarea></td>
             </tr>
             <tr>
                 <td class="editTableTitle">图标:</td>

+ 2 - 0
o2web/source/x_component_process_ProcessDesigner/Activity.js

@@ -6,6 +6,8 @@ MWF.xApplication.process.ProcessDesigner.Activity = new Class({
         this.process = process;
         this.paper = this.process.paper;
 
+        if (!this.data.edition) this.data.edition = (new o2.widget.UUID()).toString();
+
         this.routes = [];
         this.fromRoutes = [];
 

+ 1 - 0
o2web/source/x_component_process_ProcessDesigner/Process.js

@@ -569,6 +569,7 @@ MWF.xApplication.process.ProcessDesigner.Process = new Class({
 						}
 					}
 				},{
+					"type": "cancel",
 					"text": this.designer.lp.cancel,
 					"action": function(){
 						this.close();

+ 1 - 1
o2web/source/x_component_process_ProcessDesigner/Route.js

@@ -5,6 +5,7 @@ MWF.xApplication.process.ProcessDesigner.Route = new Class({
         this.data = data;
         this.process = process;
         this.paper = this.process.paper;
+        if (!this.data.edition) this.data.edition = (new o2.widget.UUID()).toString();
 
         this.loaded = false;
 
@@ -36,7 +37,6 @@ MWF.xApplication.process.ProcessDesigner.Route = new Class({
             this.listItem = new MWF.APPPD.Route.List(this);
             this.listItem.load();
         }
-
     },
     getRoutePoint: function () {
         var points = [];

+ 8 - 8
o2web/source/x_component_process_ProcessDesigner/lp/zh-cn.js

@@ -149,14 +149,14 @@ MWF.xApplication.process.ProcessDesigner.LP = {
 		"newProcess": "创建了新的流程。",
 		"an": "个",
 
-		"modifyProcess": "修改了流程的 <b>\"{field}\"</b>,从:<span style='color: #ff0000'>\"{old}\"</span>,修改为:<span style='color: #0000ff'>\"{new}\"</span>",
-		"modifyActivity": "修改了<b>“{name}”</b>活动的 <b>\"{field}\"</b>,从:<span style='color: #ff0000'>\"{old}\"</span>,修改为:<span style='color: #0000ff'>\"{new}\"</span>",
-		"modifyActivity_addRoute": "增加了<b>“{name}”</b>活动的路由,指向<span style='color: #0000ff'>“{next}”</span>",
-		"modifyActivity_deleteRoute": "删除了<b>“{name}”</b>活动的路由,指向<span style='color: #ff0000'>“{next}”</span>",
-		"modifyActivity_modifyRouteNext": "修改了<b>“{name}”</b>活动的路由,从指向<span style='color: #ff0000'>“{oldnext}”</span>,修改为指向<span style='color: #0000ff'>“{newnext}”</span>",
-		"modifyActivity_modifyRouteField": "修改了<b>“{name}”</b>活动的路由,指向“{next}”, <b>\"{field}\"</b> 从:<span style='color: #ff0000'>\"{old}\"</span>,修改为:<span style='color: #0000ff'>\"{new}\"</span>",
-		"deleteActivity": "删除了活动<b style='color: #ff0000'>“{name}”</b>",
-		"addActivity": "增加了活动<b style='color: #0000ff'>“{name}”</b>",
+		"modifyProcess": "[流程] 修改了流程的属性 <b>\"{field}\"</b>,从:<span style='color: #ff0000'>\"{old}\"</span>,修改为:<span style='color: #0000ff'>\"{new}\"</span>",
+		"modifyActivity": "[活动] 修改了<b>“{name}”</b>活动的属性 <b>\"{field}\"</b>,从:<span style='color: #ff0000'>\"{old}\"</span>,修改为:<span style='color: #0000ff'>\"{new}\"</span>",
+		"modifyActivity_addRoute": "[路由] 增加了<b>“{name}”</b>活动的路由<b>“{rname}”</b>,指向<span style='color: #0000ff'>“{next}”</span>",
+		"modifyActivity_deleteRoute": "[路由] 删除了<b>“{name}”</b>活动的路由<b>“{rname}”</b>,指向<span style='color: #ff0000'>“{next}”</span>",
+		"modifyActivity_modifyRouteNext": "[路由] 修改了<b>“{name}”</b>活动的路由<b>“{rname}”</b>,从指向<span style='color: #ff0000'>“{oldnext}”</span>,修改为指向<span style='color: #0000ff'>“{newnext}”</span>",
+		"modifyActivity_modifyRouteField": "[路由] 修改了<b>“{name}”</b>活动的路由<b>“{rname}”</b>, 属性<b>\"{field}\"</b> 从:<span style='color: #ff0000'>\"{old}\"</span>,修改为:<span style='color: #0000ff'>\"{new}\"</span>",
+		"deleteActivity": "[活动] 删除了活动<b style='color: #ff0000'>“{name}”</b>",
+		"addActivity": "[活动] 增加了活动<b style='color: #0000ff'>“{name}”</b>",
 		"noDiffs": "与上一版本无差异",
 		"hasDiffs": "与上一版本差异:",
 

+ 4 - 1
o2web/source/x_component_process_ProcessDesigner/widget/$EditionList/default/css.wcss

@@ -29,10 +29,12 @@
         "cursor": "col-resize"
     },
     "diffNode": {
+        "padding": "0px 3px 0px 20px",
         "height": "100%",
         "background-color": "#ffffff",
         "border": "1px solid #cccccc",
         "float-left": "20px",
+        "margin": "0px",
         "margin-left": "10px",
         "font-size": "12px",
         "overflow": "auto"
@@ -98,7 +100,8 @@
     },
 
     "diffLine": {
-        "padding": "5px 10px 0px 10px"
+        "padding": "5px 10px 0px 0px",
+        "list-style-position": "outside"
     },
 
     "enableAction": {

+ 230 - 27
o2web/source/x_component_process_ProcessDesigner/widget/EditionList.js

@@ -30,13 +30,13 @@ MWF.xApplication.process.ProcessDesigner.widget.EditionList = new Class({
         this.listNode = new Element("div", {"styles": this.css.listNode}).inject(this.leftNode);
 
         this.resizeNode = new Element("div", {"styles": this.css.resizeNode}).inject(this.rightNode);
-        this.diffNode = new Element("div", {"styles": this.css.diffNode}).inject(this.rightNode);
+        this.diffNode = new Element("ul", {"styles": this.css.diffNode}).inject(this.rightNode);
 
         this.createListTable();
         this.show();
     },
     createListTable: function(){
-        var tableHtml = "<table width='100%' cellspacing='0' cellpadding='3'><tr>" +
+        var tableHtml = "<table width='100%' cellspacing='0' cellpadding='3' style='margin-top: 1px'><tr>" +
             "<th></th>" +
             "<th>"+this.lp.edition_list.number+"</th>" +
             "<th>"+this.lp.edition_list.update+"</th>" +
@@ -79,6 +79,7 @@ MWF.xApplication.process.ProcessDesigner.widget.EditionList = new Class({
                         "title": this.lp.edition_list.openInfor
                     },
                     {
+                        "type": "cancel",
                         "text": MWF.xApplication.process.ProcessDesigner.LP.close,
                         "action": function(){ this.close(); }
                     }
@@ -90,10 +91,12 @@ MWF.xApplication.process.ProcessDesigner.widget.EditionList = new Class({
         }
     },
     listEditionDlg: function(){
+	    //for (var i=0; i<10; i++){
         this.editionList.each(function(edition){
             var item = new MWF.xApplication.process.ProcessDesigner.widget.EditionList.Item(this, edition);
             this.items.push(item);
         }.bind(this));
+        //}
     },
     setEvent: function(){
         var buttons = this.dlg.button.getElements("input");
@@ -268,62 +271,262 @@ MWF.xApplication.process.ProcessDesigner.widget.EditionList.Item = new Class({
 
     },
     appendDiffLine: function(text){
-        new Element("div", {"styles": this.css.diffLine, "html": text}).inject(this.list.diffNode);
+        new Element("li", {"styles": this.css.diffLine, "html": text}).inject(this.list.diffNode);
     },
     getDiffWithProcess: function(process){
-        debugger;
         var diffs = [];
         var notDiffFields = ["id", "editionName", "editionEnable", "editionNumber", "createTime", "updateTime", "creatorPerson", "lastUpdateTime", "lastUpdatePerson"];
         Object.each(process, function(v, k){
             var t = o2.typeOf(v);
             if (t!="array" && t!="object"){
-                if (this.edition.fullProcess[k]!=v){
-                    if (notDiffFields.indexOf(k)==-1){
-                        var infor = this.lp.edition_list.modifyProcess;
-                        var oldV = (v.length>60) ? v.substring(0,60)+" ..." : v;
-                        var newV = (this.edition.fullProcess[k].length>60) ? this.edition.fullProcess[k].substring(0,60)+" ..." : this.edition.fullProcess[k];
-                        infor = infor.replace(/\{field\}/, k).replace(/\{old\}/, oldV).replace(/\{new\}/, newV);
-                        diffs.push(infor);
+                if (notDiffFields.indexOf(k)==-1){
+                    if (this.edition.fullProcess[k]!=v){
+                        diffs.push(this.getModifyFieldDiffInfor("modifyProcess", v, k, this.edition.fullProcess[k]));
+                    }
+                }
+            }else if (k=="controllerList" || k=="startableIdentityList" || k=="startableUnitList"){
+                var newArrValue = JSON.stringify(o2.name.cns(this.edition.fullProcess[k]));
+                var oldArrValue = JSON.stringify(o2.name.cns(v));
+                if (newArrValue!=oldArrValue){
+                    if (this.edition.fullProcess[k]!=v){
+                        diffs.push(this.getModifyFieldDiffInfor("modifyProcess", oldArrValue, k, newArrValue));
                     }
                 }
             }
         }.bind(this));
 
-        diffs = diffs.concat(this.getDiffActivityListCount(process, diffs));
+        var diffActivitys = this.getAllDiffActivitys(process);
+        diffs = diffs.concat(this.getDiffActivityListAddDelete(diffActivitys));
+        diffs = diffs.concat(this.getDiffActivityListModify(diffActivitys, process));
 
         return diffs;
     },
-    getDiffActivityListCount: function(process){
+    getModifyFieldDiffInfor: function(lp, v, k, nv, next, act, rname){
+        var infor = this.lp.edition_list[lp];
+        var oldV = (v.length>60) ? v.substring(0,60)+" ..." : v;
+        var newV = (nv.length>60) ? nv.substring(0,60)+" ..." : nv;
+        infor = infor.replace(/\{field\}/, k).replace(/\{old\}/, oldV).replace(/\{new\}/, newV).replace(/\{next\}/, next).replace(/\{name\}/, act).replace(/\{rname\}/, rname);
+        return infor;
+    },
+
+    getAllDiffActivitys: function(process){
+        var diffActivitys ={ "addActivitys": [], "deleteActivitys": [], "sameActivitys": [] };
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys([process.begin], [this.edition.fullProcess.begin]));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.manualList, this.edition.fullProcess.manualList));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.conditionList, this.edition.fullProcess.conditionList));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.choiceList, this.edition.fullProcess.choiceList));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.splitList, this.edition.fullProcess.splitList));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.parallelList, this.edition.fullProcess.parallelList));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.mergeList, this.edition.fullProcess.mergeList));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.embedList, this.edition.fullProcess.embedList));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.delayList, this.edition.fullProcess.delayList));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.invokeList, this.edition.fullProcess.invokeList));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.serviceList, this.edition.fullProcess.serviceList));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.agentList, this.edition.fullProcess.agentList));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.messageList, this.edition.fullProcess.messageList));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.cancelList, this.edition.fullProcess.cancelList));
+        this.concatDiffActivitys(diffActivitys, this.getDiffActivitys(process.endList, this.edition.fullProcess.endList));
+
+
+        return diffActivitys;
+    },
+    concatDiffActivitys:function(diffActivitys, diffActivity){
+        diffActivitys.addActivitys = diffActivitys.addActivitys.concat(diffActivity.addActivitys);
+        diffActivitys.deleteActivitys = diffActivitys.deleteActivitys.concat(diffActivity.deleteActivitys);
+        diffActivitys.sameActivitys = diffActivitys.sameActivitys.concat(diffActivity.sameActivitys);
+    },
+    getDiffActivitys: function(prevList, currentList){
+        prevList = prevList || [];
+        currentList = currentList || [];
+        var deleteActivitys = [];
+        var addActivitys = [];
+        var sameActivitys = [];
+        deleteActivitys = prevList.filter(function(item){
+            var i = currentList.findIndex(function(n){
+                return (item.edition==n.edition);
+            });
+            if (i!=-1){
+                sameActivitys.push({"prev": item, "current": currentList[i]});
+                return false;
+            }
+            return true;
+        });
+        addActivitys = currentList.filter(function(item){
+            var i = prevList.findIndex(function(n){
+                return (item.edition==n.edition);
+            });
+            return (i==-1);
+        });
+        return {"addActivitys": addActivitys, "deleteActivitys": deleteActivitys, "sameActivitys": sameActivitys};
+    },
+
+    getDiffActivityListAddDelete: function(diffActivitys){
         var diffs = [];
-        diffs = diffs.concat(this.getDiffActivityCount(process.endList, this.edition.fullProcess.endList));
-        diffs = diffs.concat(this.getDiffActivityCount(process.manualList, this.edition.fullProcess.manualList));
+        diffActivitys.addActivitys.each(function(n){
+            var infor = this.lp.edition_list.addActivity;
+            infor = infor.replace(/\{name\}/, n.name);
+            diffs.push(infor);
+        }.bind(this));
+
+        diffActivitys.deleteActivitys.each(function(n){
+            var infor = this.lp.edition_list.deleteActivity;
+            infor = infor.replace(/\{name\}/, n.name);
+            diffs.push(infor);
+        }.bind(this));
+
         return diffs;
     },
-    getDiffActivityCount: function(prevList, currentList){
+    getDiffActivityListModify: function(diffActivitys, process){
         var diffs = [];
-        var prevNames = prevList.map(function(item){ return item.name; });
-        var currentNames = currentList.map(function(item){ return item.name; });
+        var notDiffFields = ["id", "process", "edition", "createTime", "updateTime", "routeList", "route", "position"];
+        var unitFields = [
+            "readIdentityList", "readUnitList", "readGroupList", "readDataPathList",
+            "reviewIdentityList", "reviewUnitList", "reviewIdentityList", "reviewUnitList",
+            "taskIdentityList", "taskUnitList", "taskGroupList", "taskDataPathList"
+        ];
 
-        var deleteNames = prevNames.filter(function(name){
-            var i = currentNames.indexOf(name);
+        diffActivitys.sameActivitys.each(function(activity){
+            var cur = activity.current;
+            Object.each(activity.prev, function(v, k){
+                var t = o2.typeOf(v);
+                if (k=="routeList" || k=="route") {
+                    var prevRouteList = this.getProcessRoutes(((k == "route") ? [v] : v), process);
+                    var curRouteList = this.getProcessRoutes(((k == "route") ? [cur[k]] : cur[k]), this.edition.fullProcess);
+                    var diffRoutes = this.getDiffRoutes(prevRouteList, curRouteList)
+
+                    diffs = diffs.concat(this.getDiffRouteListAddDelete(diffRoutes, cur));
+                    diffs = diffs.concat(this.getDiffRouteListModify(diffRoutes, cur, process));
+                }else if (t!="array" && t!="object"){
+                    if (notDiffFields.indexOf(k)==-1){
+                        if (cur[k]!=v){
+                            diffs.push(this.getModifyFieldDiffInfor("modifyActivity", v, k, cur[k], "", cur.name));
+                        }
+                    }
+                }else if (unitFields.indexOf(k)!==-1){
+                    var newArrValue = JSON.stringify(o2.name.cns(cur[k]));
+                    var oldArrValue = JSON.stringify(o2.name.cns(v));
+                    if (newArrValue!=oldArrValue){
+                        if (this.edition.fullProcess[k]!=v){
+                            diffs.push(this.getModifyFieldDiffInfor("modifyActivity", oldArrValue, k, newArrValue, "", cur.name));
+                        }
+                    }
+                }
+            }.bind(this));
+        }.bind(this));
+        return diffs;
+    },
+    getDiffRoutes: function(prevRouteList, curRouteList){
+        prevRouteList = prevRouteList || [];
+        curRouteList = curRouteList || [];
+        var deleteRoutes = [];
+        var addRoutes = [];
+        var sameRoutes = [];
+
+        deleteRoutes = prevRouteList.filter(function(item){
+            var i = curRouteList.findIndex(function(n){
+                return (item.edition==n.edition);
+            });
             if (i!=-1){
-                currentNames.splice(i, 1);
+                sameRoutes.push({"prev": item, "current": curRouteList[i]});
                 return false;
             }
             return true;
         });
-        currentNames.each(function(name){
-            var infor = this.lp.edition_list.addActivity;
-            infor = infor.replace(/\{name\}/, name);
+        addRoutes = curRouteList.filter(function(item){
+            var i = prevRouteList.findIndex(function(n){
+                return (item.edition==n.edition);
+            });
+            return (i==-1);
+        });
+
+        return {"addRoutes": addRoutes, "deleteRoutes": deleteRoutes, "sameRoutes": sameRoutes};
+    },
+    getDiffRouteListAddDelete: function(diffRoutes, activity, toActivity){
+        var diffs = [];
+        diffRoutes.addRoutes.each(function(n){
+            var infor = this.lp.edition_list.modifyActivity_addRoute;
+            infor = infor.replace(/\{name\}/, activity.name).replace(/\{next\}/, n.toActivity.name).replace(/\{rname\}/, n.name);
             diffs.push(infor);
         }.bind(this));
-        deleteNames.each(function(name){
-            var infor = this.lp.edition_list.deleteActivity;
-            infor = infor.replace(/\{name\}/, name);
+
+        diffRoutes.deleteRoutes.each(function(n){
+            var infor = this.lp.edition_list.modifyActivity_deleteRoute;
+            infor = infor.replace(/\{name\}/, activity.name).replace(/\{next\}/, n.toActivity.name).replace(/\{rname\}/, n.name);
             diffs.push(infor);
         }.bind(this));
+
         return diffs;
     },
+    getDiffRouteListModify: function(diffRoutes, curActivity, process){
+        var diffs = [];
+        var notDiffFields = ["id", "process", "edition", "createTime", "updateTime", "activityType", "activity"];
+        diffRoutes.sameRoutes.each(function(route){
+            var cur = route.current;
+            Object.each(route.prev, function(v, k){
+                var t = o2.typeOf(v);
+                if (k=="activity"){
+                    var newToActivity = this.getProcessActivity(cur[k], cur["activityType"], this.edition.fullProcess);
+                    var oldToActivity = this.getProcessActivity(v, route.prev["activityType"], process);
+                    if ((newToActivity && oldToActivity) && newToActivity.edition!=oldToActivity.edition){
+                        var infor = this.lp.edition_list.modifyActivity_modifyRouteNext;
+                        infor = infor.replace(/\{name\}/, curActivity.name).replace(/\{oldnext\}/, oldToActivity.name).replace(/\{newnext\}/, newToActivity.name).replace(/\{rname\}/, cur.name);
+                        diffs.push(infor);
+                    }
+                }else if (t!="array" && t!="object"){
+                    if (notDiffFields.indexOf(k)==-1){
+                        if (cur[k]!=v){
+                            var toActivity = this.getProcessActivity(cur["activity"], cur["activityType"], this.edition.fullProcess) || {};
+                            diffs.push(this.getModifyFieldDiffInfor("modifyActivity_modifyRouteField", v, k, cur[k], (toActivity.name || ""), curActivity.name, cur.name));
+                        }
+                    }
+                }
+            }.bind(this));
+        }.bind(this));
+        return diffs;
+    },
+
+    getProcessRoutes: function(idList, process){
+        var routes = [];
+        idList.each(function(id){
+            var route = process.routeList.find(function(r){ return id== r.id;});
+            if (route){
+                route.toActivity = this.getProcessActivity(route.activity, route.activityType, process);
+                routes.push(route);
+            }
+        }.bind(this));
+        return routes;
+    },
+    getProcessActivity: function(id, tp, process){
+        return process[tp+"List"].find(function(a){ return id== a.id;})
+    },
+    //
+    // getDiffActivityCount: function(prevList, currentList){
+    //     var diffs = [];
+    //     var prevItems = prevList.map(function(item){ return {"name": item.name, "id": item.edition}; });
+    //     var currentItems = currentList.map(function(item){ return{"name": item.name, "id": item.edition}; });
+    //
+    //     var deleteItems = prevItems.filter(function(item){
+    //         var i = currentItems.findIndex(function(n){
+    //             return (item.id==n.id);
+    //         });
+    //         if (i!=-1){
+    //             currentItems.splice(i, 1);
+    //             return false;
+    //         }
+    //         return true;
+    //     });
+    //     currentItems.each(function(n){
+    //         var infor = this.lp.edition_list.addActivity;
+    //         infor = infor.replace(/\{name\}/, n.name);
+    //         diffs.push(infor);
+    //     }.bind(this));
+    //     deleteItems.each(function(n){
+    //         var infor = this.lp.edition_list.deleteActivity;
+    //         infor = infor.replace(/\{name\}/, n.name);
+    //         diffs.push(infor);
+    //     }.bind(this));
+    //     return diffs;
+    // },
 
     getNewProcessInfor: function(){
         //this.getFullProcess(function(){

Some files were not shown because too many files changed in this diff