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

Merge branch 'feature/process_edition' into 'develop'

Merge of feature/process_edition to develop 完成查看流程版本功能

See merge request o2oa/o2oa!243
胡起 5 лет назад
Родитель
Сommit
2b151fb8df
39 измененных файлов с 1130 добавлено и 33 удалено
  1. 19 13
      o2web/gulpfile.js
  2. 15 1
      o2web/source/o2_core/o2/widget/$Dialog/user/css.wcss
  3. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user/img/max.gif
  4. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user/img/max.png
  5. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user/img/return.gif
  6. BIN
      o2web/source/o2_core/o2/widget/$Dialog/user/img/return.png
  7. 102 0
      o2web/source/o2_core/o2/widget/$Menu/Process/css.wcss
  8. 2 2
      o2web/source/o2_core/o2/widget/$Panel/default/css.wcss
  9. 116 0
      o2web/source/o2_core/o2/widget/$Toolbar/Process/css.wcss
  10. BIN
      o2web/source/o2_core/o2/widget/$Toolbar/Process/downicon.gif
  11. BIN
      o2web/source/o2_core/o2/widget/$Toolbar/Process/separatorbg.gif
  12. 1 0
      o2web/source/o2_core/o2/widget/Dialog.js
  13. 2 1
      o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_designer.json
  14. 3 0
      o2web/source/o2_core/o2/xDesktop/$Default/blue/style-skin.css
  15. 8 0
      o2web/source/o2_core/o2/xDesktop/$Default/cyan/style-skin.css
  16. 3 0
      o2web/source/o2_core/o2/xDesktop/$Default/darkgreen/style-skin.css
  17. 6 0
      o2web/source/o2_core/o2/xDesktop/$Default/gray/style-skin.css
  18. 6 0
      o2web/source/o2_core/o2/xDesktop/$Default/green/style-skin.css
  19. 3 0
      o2web/source/o2_core/o2/xDesktop/$Default/navy/style-skin.css
  20. 6 0
      o2web/source/o2_core/o2/xDesktop/$Default/orange/style-skin.css
  21. 6 0
      o2web/source/o2_core/o2/xDesktop/$Default/purple/style-skin.css
  22. 6 0
      o2web/source/o2_core/o2/xDesktop/$Default/red/style-skin.css
  23. 3 0
      o2web/source/o2_core/o2/xDesktop/$Default/tan/style-skin.css
  24. 0 1
      o2web/source/o2_core/o2/xDesktop/Default.js
  25. 1 0
      o2web/source/o2_core/o2/xDesktop/Dialog.js
  26. 18 0
      o2web/source/x_component_process_ProcessDesigner/$Main/default/css.wcss
  27. BIN
      o2web/source/x_component_process_ProcessDesigner/$Main/default/toolbarIcon/edition.png
  28. 15 7
      o2web/source/x_component_process_ProcessDesigner/$Main/processToolbars.html
  29. 8 0
      o2web/source/x_component_process_ProcessDesigner/$Process/process.html
  30. 10 1
      o2web/source/x_component_process_ProcessDesigner/Main.js
  31. 186 6
      o2web/source/x_component_process_ProcessDesigner/Process.js
  32. 65 1
      o2web/source/x_component_process_ProcessDesigner/lp/zh-cn.js
  33. 124 0
      o2web/source/x_component_process_ProcessDesigner/widget/$EditionList/default/css.wcss
  34. BIN
      o2web/source/x_component_process_ProcessDesigner/widget/$EditionList/default/icon/check.png
  35. BIN
      o2web/source/x_component_process_ProcessDesigner/widget/$EditionList/default/icon/select.png
  36. BIN
      o2web/source/x_component_process_ProcessDesigner/widget/$EditionList/default/icon/unselect.png
  37. 369 0
      o2web/source/x_component_process_ProcessDesigner/widget/EditionList.js
  38. 24 0
      o2web/source/x_component_process_ProcessManager/ProcessExplorer.js
  39. 3 0
      o2web/source/x_component_process_ProcessManager/lp/zh-cn.js

+ 19 - 13
o2web/gulpfile.js

@@ -23,22 +23,28 @@ var o_options = minimist(process.argv.slice(2), {//upload: local ftp or sftp
 var options = {};
 
 var uploadOptions = ftpconfig.dev;
-if (o_options.ev && o_options.ev=="dev"){
-    options.ev = "dev";
-    uploadOptions = ftpconfig.dev;
-}else if (o_options.ev && o_options.ev=="release"){
-    options.ev = "release";
-    uploadOptions = ftpconfig.release;
-}else if (o_options.ev && o_options.ev=="wrdp"){
-    options.ev = "wrdp";
-    uploadOptions = ftpconfig.wrdp;
-}else if (o_options.ev && o_options.ev=="develop"){
-    options.ev = "develop";
-    uploadOptions = ftpconfig.develop;
-}else{
+options.ev = o_options.ev;
+uploadOptions = (ftpconfig[o_options.ev]) || null;
+if (!uploadOptions){
     options.ev = "dev";
     uploadOptions = ftpconfig.dev;
 }
+// if (o_options.ev && o_options.ev=="dev"){
+//     options.ev = "dev";
+//     uploadOptions = ftpconfig.dev;
+// }else if (o_options.ev && o_options.ev=="release"){
+//     options.ev = "release";
+//     uploadOptions = ftpconfig.release;
+// }else if (o_options.ev && o_options.ev=="wrdp"){
+//     options.ev = "wrdp";
+//     uploadOptions = ftpconfig.wrdp;
+// }else if (o_options.ev && o_options.ev=="develop"){
+//     options.ev = "develop";
+//     uploadOptions = ftpconfig.develop;
+// }else{
+//     options.ev = "dev";
+//     uploadOptions = ftpconfig.dev;
+// }
 
 options.upload = o_options.upload || "";
 options.location = o_options.location || uploadOptions.location;

+ 15 - 1
o2web/source/o2_core/o2/widget/$Dialog/user/css.wcss

@@ -59,11 +59,25 @@
 	},
 	"closeAction": {
 	    "height": "40px",
-	    "width": "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",

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


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


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


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


+ 102 - 0
o2web/source/o2_core/o2/widget/$Menu/Process/css.wcss

@@ -0,0 +1,102 @@
+{
+	"container": {
+		"border-top": "1px solid #738ab5",
+		"border-left": "1px solid #738ab5",
+		"border-right": "1px solid #3c5b94",
+		"border-bottom": "1px solid #3c5b94",
+		"background-color": "#f7f3f7",
+		"padding-top": "2px",
+		"padding-bottom": "2px",
+		"padding-left": "2px",
+		"padding-right": "2px",
+		"overflow": "hidden",
+		"font-size": "12px",
+		"display": "none",
+		"z-index": "10000",
+		"opacity": 0,
+		"position": "absolute",
+		"float": "left",
+		"min-width": "120px",
+		"box-shadow": "3px 3px 10px #AAA", 
+		"cursor": "default"
+	},
+	"menuItem": {
+		"display":"block",
+		"position": "static",
+		"height": "24px",
+		"line-height": "24px",
+		"border": "1px solid #f7f3f7",
+		"background-color": "#f7f3f7"
+	},
+
+	"menuItemImgDiv": {
+		"display":"block",
+		"float": "left",
+		"width": "24px",
+		"height": "24px",
+		"text-align": "center"
+	},
+	"menuItemImg": {
+		"height": "16px",
+		"width": "16px",
+		"margin-top": "3px"
+	},
+	"menuItemSeparator": {
+		"display":"block",
+		"float": "left",
+		"height": "24px",
+		"width": "1px",
+		"background-color": "#CCCCCC",
+		"border-right": "1px solid #FFFFFF",
+		"overflow": "hidden"
+	},
+	"menuItemText": {
+		"display":"block",
+		"position": "static",
+		"height": "24px",
+		"margin-left": "35px",
+		"margin-right": "30px",
+		"line-height": "24px"
+	},
+	"menuLine": {
+		"position": "static",
+		"display":"block",
+		"height": "1px",
+		"overflow": "hidden",
+		"margin-left": "28px",
+		"background-color": "#CCCCCC",
+		"border-bottom": "1px solid #FFFFFF"
+	},
+	"menuItemDisable": {
+		"color": "#999"
+	},
+
+	"menuOver": {
+		"border": "1px solid #8d9cc3",
+		//"background-color": "#b5bed6"
+		"background-color": "#e3e7f1"
+	},
+	"menuOut": {
+		"border": "1px solid #f7f3f7",
+		"background-color": "#f7f3f7"
+	},
+	"menuDown": {
+		"border": "1px solid #000000",
+		"background-color": "#c6cde0"
+	},
+	"menuUp": {
+		"border": "1px solid #8d9cc3",
+		//"background-color": "#b5bed6"
+		"background-color": "#e3e7f1"
+	},
+	"toolbarButtonDownNode": {
+		"display":"block",
+		"float": "left",
+		"padding-left": "2px",
+		"padding-right": "2px",
+		"padding-top": "0px",
+		"height": "18px",
+		"color": "#ff0000",
+		"cursor": "pointer"
+	}
+}

+ 2 - 2
o2web/source/o2_core/o2/widget/$Panel/default/css.wcss

@@ -12,7 +12,7 @@
 
 	//	"box-shadow": "0px 2px 5px #999", 
 		
-		"z-index": "10000"
+		"z-index": "200"
 	},
 	"container": {
 		"border-top": "1px solid #999",
@@ -27,7 +27,7 @@
 
 	//	"box-shadow": "0px 2px 5px #999", 
 		
-		"z-index": "10000"
+		"z-index": "200"
 	},
 	"panelTitleNode": {
 		"display":"block",

+ 116 - 0
o2web/source/o2_core/o2/widget/$Toolbar/Process/css.wcss

@@ -0,0 +1,116 @@
+{
+	"container": {
+		"border-top": "0px solid #cccccc",
+		"border-left": "0px solid #cccccc",
+		"border-right": "0px solid #888888",
+		"border-bottom": "1px solid #888888",
+		"background-color": "#eeeeee",
+
+		"word-wrap" : "normal",
+		"word-break" : "keep-all",
+		"cursor": "pointer",
+		"overflow": "hidden",
+		"height": "32px",
+		"display":"block",
+		"font-size": "12px"
+	},
+	"toolbarSeparator": {
+		"display":"block",
+		"float": "left",
+		"margin-bottom": "2px",
+		"margin-top": "6px",
+		"height": "20px",
+		"width": "1px",
+		"background-color": "#888888",
+		"border-right": "1px solid #FFFFFF",
+		"overflow": "hidden"
+	},
+
+	"button": {
+		"display":"block",
+		"position": "static",
+		"float": "left",
+		"border": "1px solid #eeeeee",
+		"background-color": "#eeeeee",
+		"height": "20px",
+		"margin-top": "4px",
+		"margin-right": "2px",
+		"padding-left": "2px",
+		"padding-right": "2px",
+		"cursor": "pointer"
+	},
+	"buttonImgDiv": {
+		"display":"block",
+		"float": "left",
+		"padding-top": "1px",
+		"padding-bottom": "1px",
+		"padding-left": "1px",
+		"padding-right": "1px",
+		"cursor": "pointer"
+	},
+	"buttonImg": {
+		"height": "16px",
+		"width": "16px",
+		"cursor": "pointer",
+		"margin-top": "0px"
+	},
+	"buttonTextDiv": {
+		"display":"block",
+		"float": "left",
+		"height": "20px",
+		"padding-left": "2px",
+		"padding-right": "2px",
+		"line-height": "18px",
+		"margin-left": "3px",
+		"color": "#333333",
+		"cursor": "pointer"
+	},
+	"buttonTextDivDown": {
+        "display":"block",
+        "float": "left",
+        "height": "20px",
+        "color": "#eeeeee",
+        "padding-left": "2px",
+        "padding-right": "2px",
+        "line-height": "18px",
+        "margin-left": "3px",
+        "cursor": "pointer"
+    },
+
+	"buttonDisable": {
+		"color": "#999"
+	},
+	"buttonImgDivDisable": {
+		"color": "#999"
+	},
+	"buttonTextDivDisable": {
+		"color": "#999"
+	},
+
+	"buttonOver": {
+		"border": "1px solid #000000",
+		"background-color": "#b5bed6"
+	},
+	"buttonOut": {
+		"border": "1px solid #eeeeee",
+		"background-color": "#eeeeee"
+	},
+	"buttonDown": {
+		"border": "1px solid #000000",
+		"background-color": "#8492b5"
+	},
+	"buttonUp": {
+		"border": "1px solid #000000",
+		"background-color": "#b5bed6"
+	},
+	"toolbarButtonDownNode": {
+		"display":"block",
+		"float": "left",
+		"padding-left": "2px",
+		"padding-right": "2px",
+		"padding-top": "0px",
+		"height": "18px",
+		"color": "#ff0000",
+		"cursor": "pointer"
+	}
+}

BIN
o2web/source/o2_core/o2/widget/$Toolbar/Process/downicon.gif


BIN
o2web/source/o2_core/o2/widget/$Toolbar/Process/separatorbg.gif


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

@@ -243,6 +243,7 @@ o2.widget.Dialog = o2.DL = new Class({
 				var button = new Element("input", {
 					"type": "button",
 					"value": bt.text,
+					"title": bt.title,
 					"styles": styles,
 					"events": {
 						"click": function(e){bt.action.call(this, this, e)}.bind(this)

+ 2 - 1
o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_designer.json

@@ -33,7 +33,8 @@
 
   "getProcess": {"uri": "/jaxrs/process/{id}"},
   "addProcess": {"uri": "/jaxrs/process","method": "POST"},
-  "removeProcess": {"uri": "/jaxrs/process/{id}/true","method": "DELETE"},
+  //"removeProcess": {"uri": "/jaxrs/process/{id}/true","method": "DELETE"},
+  "removeProcess": {"uri": "/jaxrs/process/{id}/true/edition","method": "DELETE"},
   "updataProcess": {"uri": "/jaxrs/process/{id}","method": "PUT"},
 
   "listFormCategory": {"uri": "/jaxrs/formCategory/list/{id}/next/{count}"},

+ 3 - 0
o2web/source/o2_core/o2/xDesktop/$Default/blue/style-skin.css

@@ -84,6 +84,9 @@
 .grayColor_bg {
     background-color: #e6e6e6 !important;
 }
+.lightColor_bg {
+    background-color: #F7FBFF !important;
+}
 
 .logo_o2_40 {
     background-image: url(/o2_core/o2/xDesktop/$Default/blue/icons/logo_o2_40.png) !important;

+ 8 - 0
o2web/source/o2_core/o2/xDesktop/$Default/cyan/style-skin.css

@@ -38,6 +38,14 @@
 .badgeColor_border {
     border-color: #66CC80 !important;
 }
+
+.grayColor_bg {
+    background-color: #e6e6e6 !important;
+}
+.lightColor_bg {
+    background-color: #F7FFF9 !important;
+}
+
 .logo_o2_40 {
     background-image: url(/o2_core/o2/xDesktop/$Default/cyan/icons/logo_o2_40.png) !important;
 }

+ 3 - 0
o2web/source/o2_core/o2/xDesktop/$Default/darkgreen/style-skin.css

@@ -41,6 +41,9 @@
 .grayColor_bg {
     background-color: #e6e6e6 !important;
 }
+.lightColor_bg {
+    background-color: #FAFFF7 !important;
+}
 
 .logo_o2_40 {
     background-image: url(/o2_core/o2/xDesktop/$Default/darkgreen/icons/logo_o2_40.png) !important;

+ 6 - 0
o2web/source/o2_core/o2/xDesktop/$Default/gray/style-skin.css

@@ -38,6 +38,12 @@
 .badgeColor_border {
     border-color: #66CC80 !important;
 }
+.grayColor_bg {
+    background-color: #e6e6e6 !important;
+}
+.lightColor_bg {
+    background-color: #F7F7F7 !important;
+}
 .logo_o2_40 {
     background-image: url(/o2_core/o2/xDesktop/$Default/gray/icons/logo_o2_40.png) !important;
 }

+ 6 - 0
o2web/source/o2_core/o2/xDesktop/$Default/green/style-skin.css

@@ -38,6 +38,12 @@
 .badgeColor_border {
     border-color: #66CC80 !important;
 }
+.grayColor_bg {
+    background-color: #e6e6e6 !important;
+}
+.lightColor_bg {
+    background-color: #F7FFF9 !important;
+}
 .logo_o2_40 {
     background-image: url(/o2_core/o2/xDesktop/$Default/green/icons/logo_o2_40.png) !important;
 }

+ 3 - 0
o2web/source/o2_core/o2/xDesktop/$Default/navy/style-skin.css

@@ -41,6 +41,9 @@
 .grayColor_bg {
     background-color: #e6e6e6 !important;
 }
+.lightColor_bg {
+    background-color: #F7F7FF !important;
+}
 
 .logo_o2_40 {
     background-image: url(/o2_core/o2/xDesktop/$Default/navy/icons/logo_o2_40.png) !important;

+ 6 - 0
o2web/source/o2_core/o2/xDesktop/$Default/orange/style-skin.css

@@ -38,6 +38,12 @@
 .badgeColor_border {
     border-color: #66CC80 !important;
 }
+.grayColor_bg {
+    background-color: #e6e6e6 !important;
+}
+.lightColor_bg {
+    background-color: #FFFBF7 !important;
+}
 .logo_o2_40 {
     background-image: url(/o2_core/o2/xDesktop/$Default/orange/icons/logo_o2_40.png) !important;
 }

+ 6 - 0
o2web/source/o2_core/o2/xDesktop/$Default/purple/style-skin.css

@@ -38,6 +38,12 @@
 .badgeColor_border {
     border-color: #66CC80 !important;
 }
+.grayColor_bg {
+    background-color: #e6e6e6 !important;
+}
+.lightColor_bg {
+    background-color: #FFF7FC !important;
+}
 .logo_o2_40 {
     background-image: url(/o2_core/o2/xDesktop/$Default/purple/icons/logo_o2_40.png) !important;
 }

+ 6 - 0
o2web/source/o2_core/o2/xDesktop/$Default/red/style-skin.css

@@ -38,6 +38,12 @@
 .badgeColor_border {
     border-color: #66CC80 !important;
 }
+.grayColor_bg {
+    background-color: #e6e6e6 !important;
+}
+.lightColor_bg {
+    background-color: #FFF7F7 !important;
+}
 .logo_o2_40 {
     background-image: url(/o2_core/o2/xDesktop/$Default/red/icons/logo_o2_40.png) !important;
 }

+ 3 - 0
o2web/source/o2_core/o2/xDesktop/$Default/tan/style-skin.css

@@ -41,6 +41,9 @@
 .grayColor_bg {
     background-color: #e6e6e6 !important;
 }
+.lightColor_bg {
+    background-color: #FFFBF7 !important;
+}
 
 .logo_o2_40 {
     background-image: url(/o2_core/o2/xDesktop/$Default/tan/icons/logo_o2_40.png) !important;

+ 0 - 1
o2web/source/o2_core/o2/xDesktop/Default.js

@@ -245,7 +245,6 @@ o2.xDesktop.Default = new Class({
 
                     this.apps[appStatus.appId] = app;
                     if ((this.status.currentApp === appStatus.appId)) currentTaskitem=taskitem;
-
                 }.bind(this));
 
                 if (currentTaskitem) {

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

@@ -139,6 +139,7 @@ o2.xDesktop.Dialog = o2.DDL = new Class({
                 }
                 button.set({
                     "value": bt.text,
+                    "title": bt.title,
                     "styles": styles,
                     "events": {
                         "click": function(e){bt.action.call(this, this, e)}.bind(this)

+ 18 - 0
o2web/source/x_component_process_ProcessDesigner/$Main/default/css.wcss

@@ -140,5 +140,23 @@
 	},
 	"paperInNode": {
 	    "height": "100%"
+	},
+	"saveNewEditionNode": {
+	    "padding": "10px 10px 10px 30px",
+	    "overflow": "hidden",
+	    "width": "500px"
+	},
+	"editionDescriptionNode": {
+	    "padding": "10px 0px",
+	    "overflow": "hidden"
+	},
+	"descriptionTitleNode": {
+	    "color": "#666666",
+	    "font-weight": "bold"
+	},
+	"descriptionTextAreaNode": {
+	    "width": "95%",
+	    "height": "80px",
+	    "overflow": "auto"
 	}
 }

BIN
o2web/source/x_component_process_ProcessDesigner/$Main/default/toolbarIcon/edition.png


+ 15 - 7
o2web/source/x_component_process_ProcessDesigner/$Main/processToolbars.html

@@ -1,8 +1,8 @@
 <div id="MWFProcessToolbar">
 	<span MWFnodetype="MWFToolBarSeparator"></span>
 	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="save.gif" title="保存流程" MWFButtonAction="saveProcess" MWFButtonText=""></span>
-	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="saveNew.gif" title="保存为新流程" MWFButtonAction="saveNewProcess" MWFButtonText=""></span>
-	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="processProperty.gif" title="流程属性" MWFButtonAction="editProcess" MWFButtonText=""></span>
+<!--	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="saveNew.gif" title="保存为新流程" MWFButtonAction="saveNewProcess" MWFButtonText=""></span>-->
+<!--	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="processProperty.gif" title="流程属性" MWFButtonAction="editProcess" MWFButtonText=""></span>-->
 	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="print.gif" title="打印流程" MWFButtonAction="printProcess" MWFButtonText=""></span>
 	
 	<span MWFnodetype="MWFToolBarSeparator"></span>
@@ -29,14 +29,22 @@
 	<!--<span MWFnodetype="MWFToolBarButton" MWFButtonImage="deleteRouter.gif" title="删除路由" MWFButtonAction="deleteRoute" MWFButtonText="" MWFButtonDisable="true"></span>-->
 	
 	<span MWFnodetype="MWFToolBarSeparator"></span>
+
+	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="saveNew.gif" title="保存为新版本" MWFButtonAction="saveNewEdition" MWFButtonText=""></span>
+	<span MWFnodetype="MWFToolBarButton" MWFButtonImage="edition.png" title="查看所有版本" MWFButtonAction="listEdition" MWFButtonText=""></span>
 	
 	<!--<span MWFnodetype="MWFToolBarButton" MWFButtonImage="checkProcess.gif" title="流程检查" MWFButtonAction="checkProcess" MWFButtonText=""></span>-->
 	<!--<span MWFnodetype="MWFToolBarButton" MWFButtonImage="processExplode.gif" title="流程导出" MWFButtonAction="processExplode" MWFButtonText=""></span>-->
 	<!--<span MWFnodetype="MWFToolBarButton" MWFButtonImage="processImplode.gif" title="流程导入" MWFButtonAction="processImplode" MWFButtonText=""></span>-->
 	
-	<!--样式:<select>-->
-		<!--<option value="default">default</option>-->
-		<!--<option value="style1">style1</option>-->
-		<!--<option value="flat">flat</option>-->
-	<!--</select>-->
+<!--	样式:<select>-->
+<!--		<option value="default">default</option>-->
+<!--		<option value="style1">style1</option>-->
+<!--		<option value="flat">flat</option>-->
+<!--	</select>-->
+
+	<span class="mainColor_bg processEdition" style="background-color:#cccccc; color:#333333; margin-top: 3px; line-height: 14px; float: right; margin-right: 10px; padding: 5px 8px; border-radius: 30px;"></span>
+	<span class="processEditionInfor" style="line-height: 32px; float: right; margin-right: 10px"></span>
+
+
 </div>

+ 8 - 0
o2web/source/x_component_process_ProcessDesigner/$Process/process.html

@@ -38,6 +38,14 @@
                 <td class="editTableTitle">描述:</td>
                 <td class="editTableValue"><textarea  name="description" class="editTableTextarea">text{$.description}</textarea></td>
             </tr>
+            <tr>
+                <td class="editTableTitle">版本:</td>
+                <td class="editTableValue">text{$.editionName}</td>
+            </tr>
+            <tr>
+                <td class="editTableTitle">版本描述:</td>
+                <td class="editTableValue"><textarea  name="description" class="editTableTextarea">text{$.editionDes}</textarea></td>
+            </tr>
             <tr>
                 <td class="editTableTitle">图标:</td>
                 <td class="editTableValue"><div class="MWFIcon" name="icon"></div></td>

+ 10 - 1
o2web/source/x_component_process_ProcessDesigner/Main.js

@@ -621,7 +621,7 @@ MWF.xApplication.process.ProcessDesigner.Main = new Class({
 
             $(toolbarNode).inject(this.toolbarNode);
             MWF.require("MWF.widget.Toolbar", function(){
-                this.processToolbar = new MWF.widget.Toolbar(toolbarNode, {"style": "ProcessCategory"}, this);
+                this.processToolbar = new MWF.widget.Toolbar(toolbarNode, {"style": "Process"}, this);
                 this.processToolbar.load();
                 if (callback) callback();
             }.bind(this));
@@ -633,6 +633,8 @@ MWF.xApplication.process.ProcessDesigner.Main = new Class({
                 }.bind(this));
             }
 
+            this.processEditionNode = toolbarNode.getElement(".processEdition");
+            this.processEditionInforNode = toolbarNode.getElement(".processEditionInfor");
         }.bind(this));
     },
     getProcessToolbarHTML: function(callback){
@@ -732,6 +734,7 @@ MWF.xApplication.process.ProcessDesigner.Main = new Class({
         }
     },
     recordStatus: function(){
+        debugger;
         return {"id": this.options.id};
     },
     saveProcess: function(){
@@ -787,6 +790,12 @@ MWF.xApplication.process.ProcessDesigner.Main = new Class({
     processExplode: function(){
         this.process.explode();
     },
+    saveNewEdition: function(el, e){
+        this.process.saveNewEdition(e);
+    },
+    listEdition: function(el, e){
+        this.process.listEdition(e);
+    },
 
     onPostClose: function() {
         if (this.process) {

+ 186 - 6
o2web/source/x_component_process_ProcessDesigner/Process.js

@@ -126,6 +126,7 @@ MWF.xApplication.process.ProcessDesigner.Process = new Class({
 		this.setEvent();
 		this.setMenu();
 		this.showProperty();
+		this.showEditionInfor();
 	},
 	checkLoadRoutes: function(){
 		Object.each(this.routes, function(route){
@@ -173,7 +174,6 @@ MWF.xApplication.process.ProcessDesigner.Process = new Class({
 			for (var i=0; i<this.activitys.length; i++){
 				this.activitys[i].checkUUID();
 			}
-			//
 		}.bind(this));
 	},
 	
@@ -190,6 +190,7 @@ MWF.xApplication.process.ProcessDesigner.Process = new Class({
 		this.reload(this.process);
 	},
 	reload: function(process){
+		debugger;
 		//this.process = process;
 		this.panel.destroy();
 		this.paper.clear();
@@ -205,6 +206,16 @@ MWF.xApplication.process.ProcessDesigner.Process = new Class({
 		//	this.loadActivityDecisions();
 		}.bind(this));
 		this.showProperty();
+		this.showEditionInfor();
+		if (process && this.designer.options.id != process.id){
+			var app = layout.desktop.apps["process.ProcessDesigner"+this.designer.options.id];
+			if (app){
+				delete layout.desktop.apps["process.ProcessDesigner"+this.designer.options.id];
+				this.designer.appId = "process.ProcessDesigner"+process.id;
+				layout.desktop.apps[this.designer.appId] = this.designer;
+			}
+			this.designer.setOptions({"id": process.id});
+		}
 	},
 	setEvent: function(){
 		this.paper.canvas.addEvent("selectstart", function(e){e.preventDefault();e.stopPropagation();});
@@ -366,6 +377,48 @@ MWF.xApplication.process.ProcessDesigner.Process = new Class({
 		}
     //    this.isFocus = true;
 	},
+	showEditionInfor: function(){
+		if (this.process.edition){
+			if (this.designer.processEditionNode){
+				this.designer.processEditionNode.removeEvents("click");
+				if (this.process.editionEnable){
+					this.designer.processEditionNode.set("text", this.designer.lp.enable);
+					this.designer.processEditionNode.addClass("mainColor_bg");
+				}else{
+					this.designer.processEditionNode.set("text", this.designer.lp.notEnable);
+					this.designer.processEditionNode.removeClass("mainColor_bg");
+
+					this.designer.processEditionNode.addEvent("click", function(e){
+						this.enableCurrentEdition(e);
+					}.bind(this));
+				}
+			}
+			if (this.designer.processEditionInforNode){
+				var text = this.designer.lp.currentEdition+": <span class='mainColor_color'>"+this.process.editionNumber+"</span> "+this.designer.lp.editionUpdate+": <span class='mainColor_color'>"+o2.name.cn(this.process.lastUpdatePerson)+" ("+this.process.updateTime+")</span>";
+				this.designer.processEditionInforNode.set("html", text);
+
+				this.designer.processEditionInforNode.addEvent("click", function(e){
+					this.listEdition(e);
+				}.bind(this));
+			}
+		}
+	},
+	enableCurrentEdition: function(e){
+		var _self = this;
+		this.designer.confirm("infor", e, this.designer.lp.edition_list.enabledProcessTitle, {"html": this.designer.lp.edition_list.enabledProcessInfor}, 600, 120, function(){
+			_self.save(function(){
+				var actions = o2.Actions.load("x_processplatform_assemble_designer").ProcessAction;
+				actions.enableProcess(this.process.id, function(json){
+					actions.get(this.process.id, function(json){
+						this.reload(json.data);
+					}.bind(this))
+				}.bind(this));
+			}.bind(_self));
+			this.close();
+		},function(){this.close();})
+
+	},
+
 	unSelected: function(e){
 		//var els = this.paper.getElementsByPoint(e.event.layerX, e.event.layerY);
 		var els = this.paper.getElementsByPoint(e.event.offsetX, e.event.offsetY);
@@ -373,7 +426,7 @@ MWF.xApplication.process.ProcessDesigner.Process = new Class({
 			this.unSelectedAll();
 			this.showProperty();
 	//		if (this.currentSelected){
-	//			this.currentSelected.unSelected();		
+	//			this.currentSelected.unSelected();
 	//		} 
 		}
 	},
@@ -483,6 +536,126 @@ MWF.xApplication.process.ProcessDesigner.Process = new Class({
 		//unrealized
 		this.designer.alert("error", e, "", MWF.APPPD.LP.unrealized, 220, 100);
 	},
+	saveNewEdition: function(e){
+		if (this.process.isNewProcess){
+			this.save();
+		}else{
+			var node = new Element("div", {"styles":this.designer.css.saveNewEditionNode});
+			var inforNode = new Element("div", {"html":this.designer.lp.upgradeInfor}).inject(node);
+			var descriptionNode = new Element("div", {"styles": this.designer.css.editionDescriptionNode}).inject(node);
+			var descriptionTitleNode = new Element("div", {"styles": this.designer.css.descriptionTitleNode, "text": this.designer.lp.editionDiscription}).inject(descriptionNode);
+			var descriptionTextAreaNode = new Element("textarea", {"styles": this.designer.css.descriptionTextAreaNode}).inject(descriptionNode);
+
+			var _self = this;
+			o2.DL.open({
+				"content": node,
+				"title": this.designer.lp.upgradeConfirm,
+				"offset": {"y": -100},
+				"height": 330,
+				"buttonList": [{
+					"type": "ok",
+					"text": this.designer.lp.ok,
+					"action": function(){
+						var textarea = this.content.getElement("textarea");
+						var discription = textarea.get("value");
+						if (!discription) {
+							_self.designer.notice(_self.designer.lp.inputDiscription, "error", descriptionNode);
+						}else{
+							var checkbox = this.content.getElement("input");
+							var enable = (!!checkbox && checkbox.get("checked"));
+
+							_self.doSaveNewEdition(enable, discription);
+							this.close();
+						}
+					}
+				},{
+					"text": this.designer.lp.cancel,
+					"action": function(){
+						this.close();
+					}
+				}]
+			});
+
+			// var _self = this;
+			// this.designer.confirm("infor", e, this.designer.lp.upgradeConfirm, {"html": this.designer.lp.upgradeInfor}, 520, 210, function(){
+			// 	var checkbox = this.content.getElement("input");
+			// 	var enable = (!!checkbox && checkbox.get("checked"));
+			// 	_self.doSaveNewEdition(enable);
+			// 	this.close();
+			// }, function(){
+			// 	this.close();
+			// });
+		}
+	},
+	doSaveNewEdition: function(enable, description){
+		debugger;
+		var process = Object.clone(this.process);
+		process.editionDes = description;
+		var oldIds = [];
+		oldIds.push(process.id);
+		if (process.begin) oldIds.push(process.begin.id);
+		if (process.endList) process.endList.each(function(a){oldIds.push(a.id);});
+		if (process.agentList) process.agentList.each(function(a){oldIds.push(a.id);});
+		if (process.manualList) process.manualList.each(function(a){oldIds.push(a.id);});
+		if (process.conditionList) process.conditionList.each(function(a){oldIds.push(a.id);});
+		if (process.choiceList) process.choiceList.each(function(a){oldIds.push(a.id);});
+		if (process.parallelList) process.parallelList.each(function(a){oldIds.push(a.id);});
+		if (process.splitList) process.splitList.each(function(a){oldIds.push(a.id);});
+		if (process.mergeList) process.mergeList.each(function(a){oldIds.push(a.id);});
+		if (process.embedList) process.embedList.each(function(a){oldIds.push(a.id);});
+		if (process.invokeList) process.invokeList.each(function(a){oldIds.push(a.id);});
+		if (process.cancelList) process.cancelList.each(function(a){oldIds.push(a.id);});
+		if (process.delayList) process.delayList.each(function(a){oldIds.push(a.id);});
+		if (process.messageList) process.messageList.each(function(a){oldIds.push(a.id);});
+		if (process.serviceList) process.serviceList.each(function(a){oldIds.push(a.id);});
+		if (process.routeList) process.routeList.each(function(a){oldIds.push(a.id);});
+
+		var actions = o2.Actions.load("x_processplatform_assemble_designer");
+		this.designer.actions.getId(oldIds.length, function(ids) {
+			var checkUUIDs = ids.data;
+			var processStr = JSON.encode(process);
+			oldIds.each(function(oid, i){
+				var reg = new RegExp(oid, "ig");
+				processStr = processStr.replace(reg, checkUUIDs[i].id);
+			}.bind(this));
+			process = JSON.decode(processStr);
+			actions.ProcessAction.upgrade(this.process.id, process, function(json){
+				var processId = json.data.id;
+				if (enable){
+					actions.ProcessAction.enableProcess(processId, function(processJson){
+						actions.ProcessAction.get(processId, function(processJson){
+							this.reload(processJson.data);
+						}.bind(this))
+					}.bind(this))
+				}else{
+					actions.ProcessAction.get(processId, function(processJson){
+						this.reload(processJson.data);
+					}.bind(this))
+				}
+			}.bind(this));
+		}.bind(this));
+	},
+
+	listEdition: function(){
+		if (this.process.edition){
+			MWF.xDesktop.requireApp("process.ProcessDesigner", "widget.EditionList", function(){
+				var list = new MWF.xApplication.process.ProcessDesigner.widget.EditionList(this.process.application, this.process.edition, this);
+				list.load();
+			}.bind(this));
+
+			// o2.Actions.load("x_processplatform_assemble_designer").ProcessAction.listEdition(this.process.application, this.process.edition, function(json){
+			// 	var editionList = json.data;
+			// 	this.listEditionDlg(json.data);
+			// }.bind(this));
+		}else{
+			this.designer.notice("infor", this.designer.lp.save_process);
+		}
+	},
+	listEditionDlg: function(editionList){
+
+		//var node = new Element("div", )
+	},
+
 	switchGrid: function(item){
 		if (this.isGrid){
 			this.hideGrid();
@@ -744,16 +917,21 @@ MWF.xApplication.process.ProcessDesigner.Process = new Class({
             this.isSave = true;
             //check empty routeList
 			this.checkEmptyRouteList();
+			var reload = !!this.process.isNewProcess;
             this.designer.actions.saveProcess(this.process, function(responseJSON){
                 this.isSave = false;
                 this.process.isNewProcess = false;
                 this.designer.notice(MWF.APPPD.LP.notice["save_success"], "ok", null, {x: "left", y:"bottom"} );
                 this.isNewProcess = false;
-                //this.designer.actions.getProcess(responseJSON.data.id, function(json){
-                //    this.reload(json.data);
-                //    if (callback) callback();
-                //}.bind(this));
                 this.designer.options.id = responseJSON.data.id;
+				if (reload){
+					this.designer.actions.getProcess(responseJSON.data.id, function(json){
+						this.reload(json.data);
+						if (callback) callback();
+					}.bind(this));
+				}else{
+					if (callback) callback();
+				}
             }.bind(this), function(xhr, text, error){
                 this.isSave = false;
 
@@ -831,6 +1009,8 @@ MWF.xApplication.process.ProcessDesigner.Process = new Class({
             activityData.process = this.process.id;
             activityData.createTime = new Date().format('db');
             activityData.updateTime = new Date().format('db');
+
+			activityData.position = position.x+","+position.y;
             activity = new MWF.APPPD.Activity[c](activityData, this);
             activity.create(position);
 

+ 65 - 1
o2web/source/x_component_process_ProcessDesigner/lp/zh-cn.js

@@ -17,10 +17,14 @@ MWF.xApplication.process.ProcessDesigner.LP = {
     "selectScript": "点击选择脚本: ",
     "condition": "条件",
     "unCategory": "未分类",
+	"ok": "确定",
+	"close": "关闭",
+	"cancel": "取消",
 
 	"notice":{
         "no_name": "请先输入流程名称",
 		"save_success": "流程保存成功!",
+		"save_process": "请先保存流程!",
 		"one_begin": "每个流程只允许有一个“开始”活动",
 		"deleteRoute": "您确定要删除选中的路由吗?",
 		"deleteRouteTitle": "删除路由确认",
@@ -40,6 +44,12 @@ MWF.xApplication.process.ProcessDesigner.LP = {
 			"merge": "合并活动",
 			"embed": "子流程活动",
 			"invoke": "调用活动",
+			"service": "服务活动",
+			"agent": "脚本活动",
+			"delay": "定时活动",
+			"message": "消息活动",
+			"choice": "选择活动",
+			"cancel": "取消活动",
 			"begin": "开始活动",
 			"end": "结束活动"
 		},
@@ -114,5 +124,59 @@ MWF.xApplication.process.ProcessDesigner.LP = {
 	"projectionRunTitle": "立即执行确认",
 	"projectionRunText": "请确认立即执行数据映射",
 	"projectionRunSuccess": "数据映射已开始执行",
-	"projectionRunError": "不需要执行数据映射"
+	"projectionRunError": "不需要执行数据映射",
+
+	"enable": "已启用",
+	"notEnable": "未启用",
+	"currentEdition": "当前版本",
+	"editionUpdate": "最后修改",
+	"editionDiscription":"请输入版本描述",
+
+	"upgradeConfirm": "保存为新版本确认",
+	"upgradeInfor": "<div style='overflow: hidden; line-height: 26px'>您是否确定要将当前流程保存为新版?<br/>选中\"同时启用新版本\"在保存完成之后,会将新版本设置为启用版本.</div><div style='margin-top:10px'><input type='checkbox' checked>同时启用新版本</div>",
+	"inputDiscription": "请先输入版本描述",
+
+	"edition_list":{
+		"editionList": "查看流程版本",
+		"number": "版本号",
+		"update": "更新时间",
+		"updatePerson": "更新人",
+		"description": "版本描述",
+		"enabled": "启用",
+		"action": "操作",
+		"yes": "是",
+		"no": "否",
+		"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>",
+		"noDiffs": "与上一版本无差异",
+		"hasDiffs": "与上一版本差异:",
+
+		"open": "切换",
+		"enable": "启用",
+		"rollback": "回滚",
+		"override": "覆盖",
+		"del": "删除",
+
+		"openInfor": "保存当前打开的版本,并打开版本”{v}“。",
+		"enableInfor": "启用流程版本”{v}“",
+		"rollbackInfor": "将流程设计回滚所选版本,所有所选版本之后的版本会被删除。",
+		"overrideInfor": "用所选版本的设计覆盖当前版本。",
+		"delInfor": "删除流程版本”{v}“。",
+
+		"enabledProcessTitle": "启用流程确认",
+		"enabledProcessInfor": "将当前流程设置为”启用“,原来已启用的流程版本将被设置为”未启用“。<br><br>已经在流转的流程实例不会受到影响,下次启动流程时,会以已启用的流程版本为模板创建流程实例。<br><br>您确定要将当前流程设置为”启用“吗?",
+
+		"deleteEditionTitle": "删除版本确认",
+		"deleteEditionInfor": "删除选中的流程版本”{v}“,同时也会删除流程版本”{v}“的流转中实例。您确定要删除流程版本”{v}“吗?",
+	}
+
 };

+ 124 - 0
o2web/source/x_component_process_ProcessDesigner/widget/$EditionList/default/css.wcss

@@ -0,0 +1,124 @@
+{
+    "node": {
+        "min-height": "300px",
+        "margin": "20px",
+        "min-width": "500px",
+        "height": "90%"
+    },
+    "leftNode": {
+        "height": "100%",
+        "float": "left",
+        "width": "60%"
+    },
+    "rightNode": {
+        "height": "100%",
+        "float": "right",
+        "width": "40%"
+    },
+    "listNode": {
+        "height": "100%",
+        "background-color": "#ffffff",
+        "border": "1px solid #cccccc",
+        "font-size": "12px",
+        "overflow": "auto"
+    },
+    "resizeNode": {
+        "float": "left",
+        "width": "10px",
+        "height": "100%",
+        "cursor": "col-resize"
+    },
+    "diffNode": {
+        "height": "100%",
+        "background-color": "#ffffff",
+        "border": "1px solid #cccccc",
+        "float-left": "20px",
+        "margin-left": "10px",
+        "font-size": "12px",
+        "overflow": "auto"
+    },
+
+    "listTable_th": {
+        "border-bottom": "1px solid #cccccc",
+        "border-right": "1px solid #cccccc",
+        "background-color": "#eeeeee",
+        "color": "#666666"
+    },
+
+    "itemTr": {
+        "background-color": "#ffffff"
+    },
+
+    "listTable_td": {
+        "border-bottom": "1px solid #cccccc",
+        "border-right": "1px solid #cccccc",
+        "color": "#666666",
+        "cursor": "pointer",
+        "text-align": "center"
+    },
+    "listTable_td_current": {
+        "border-bottom": "1px solid #cccccc",
+        "border-right": "1px solid #cccccc",
+        "color": "#0000ff",
+        "cursor": "pointer",
+        "text-align": "center",
+        "font-weight": "bold"
+    },
+    "listTable_td_right": {
+        "border-right-width": "0px"
+    },
+    "listTable_td_icon": {
+        "width": "20px"
+    },
+    "listTable_td_action": {
+        "width": "80px"
+    },
+    "unselectIcon": {
+        "width": "12px",
+        "height": "12px",
+        "margin": "4px auto",
+        "cursor": "pointer",
+        "border": "1px solid #dddddd",
+        "border-radius": "8px",
+        "background": "transparent"
+    },
+    "selectIcon": {
+        "width": "14px",
+        "height": "14px",
+        "margin": "4px auto",
+        "cursor": "pointer",
+        "border": "0px solid #dddddd",
+        "border-radius": "8px",
+        "background": "url("+"/x_component_process_ProcessDesigner/widget/$EditionList/default/icon/check.png) no-repeat center center",
+        "background-color": "#4A90E2"
+    },
+
+    "itemTr_selected": {
+        "background-color": "#F7FBFF"
+    },
+
+    "diffLine": {
+        "padding": "5px 10px 0px 10px"
+    },
+
+    "enableAction": {
+        "width": "30px",
+        "padding": "0px 3px",
+        "border-radius": "20px",
+        "color": "#ffffff",
+        "background-color": "#4A90E2",
+        "float": "left",
+        "margin-right": "2px",
+        "text-align": "center",
+        "font-weight": "100"
+    },
+    "delAction": {
+        "width": "30px",
+        "padding": "0px 3px",
+        "border-radius": "20px",
+        "color": "#ffffff",
+        "background-color": "#c04444",
+        "float": "left",
+        "text-align": "center"
+    }
+}

BIN
o2web/source/x_component_process_ProcessDesigner/widget/$EditionList/default/icon/check.png


BIN
o2web/source/x_component_process_ProcessDesigner/widget/$EditionList/default/icon/select.png


BIN
o2web/source/x_component_process_ProcessDesigner/widget/$EditionList/default/icon/unselect.png


+ 369 - 0
o2web/source/x_component_process_ProcessDesigner/widget/EditionList.js

@@ -0,0 +1,369 @@
+MWF.xApplication.process.ProcessDesigner.widget = MWF.xApplication.process.ProcessDesigner.widget || {};
+MWF.xApplication.process.ProcessDesigner.widget.EditionList = new Class({
+	Implements: [Options, Events],
+	Extends: MWF.widget.Common,
+	options: {
+		"style": "default"
+	},
+	initialize: function(application, edition, process, options){
+		this.setOptions(options);
+		this.application = application;
+        this.edition = edition;
+        this.process = process;
+		this.path = "/x_component_process_ProcessDesigner/widget/$EditionList/";
+		this.cssPath = "/x_component_process_ProcessDesigner/widget/$EditionList/"+this.options.style+"/css.wcss";
+		this._loadCss();
+        this.currentItem = null;
+        this.items = [];
+        this.lp = MWF.xApplication.process.ProcessDesigner.LP;
+	},
+    load: function(){
+        o2.Actions.load("x_processplatform_assemble_designer").ProcessAction.listEdition(this.application, this.edition, function(json){
+            this.editionList = json.data;
+            this.listEditionDlg();
+        }.bind(this));
+
+        this.node = new Element("div", {"styles": this.css.node});
+        this.leftNode = new Element("div", {"styles": this.css.leftNode}).inject(this.node);
+        this.rightNode = new Element("div", {"styles": this.css.rightNode}).inject(this.node);
+
+        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.createListTable();
+        this.show();
+    },
+    createListTable: function(){
+        var tableHtml = "<table width='100%' cellspacing='0' cellpadding='3'><tr>" +
+            "<th></th>" +
+            "<th>"+this.lp.edition_list.number+"</th>" +
+            "<th>"+this.lp.edition_list.update+"</th>" +
+            "<th>"+this.lp.edition_list.updatePerson+"</th>" +
+            "<th>"+this.lp.edition_list.enabled+"</th>" +
+            "<th>"+this.lp.edition_list.description+"</th>" +
+            "<th>"+this.lp.edition_list.action+"</th>" +
+            "</tr></table>";
+        this.listNode.set("html", tableHtml);
+        this.listTable = this.listNode.getElement("table");
+        this.listTable.setStyles(this.css.listTable);
+        var ths = this.listNode.getElements("th").setStyles(this.css.listTable_th);
+        ths[ths.length-1].setStyles(this.css.listTable_td_right);
+    },
+    reloadList: function(){
+	    debugger;
+        this.items = [];
+        this.listNode.empty();
+        this.diffNode.empty();
+
+        this.createListTable();
+        o2.Actions.load("x_processplatform_assemble_designer").ProcessAction.listEdition(this.application, this.edition, function(json){
+            this.editionList = json.data;
+            this.listEditionDlg();
+        }.bind(this));
+    },
+    show: function(){
+	    if (!this.dlg){
+	        this.dlg = o2.DL.open({
+                "title": this.lp.edition_list.editionList,
+                "content": this.node,
+                "offset": {"y": -100},
+                "isMax": true,
+                "width": 900,
+                "height": 500,
+                "buttonList": [
+                    {
+                        "text": this.lp.edition_list.open,
+                        "action": function(){ this.openCurrentEdition(); this.dlg.close();}.bind(this),
+                        "title": this.lp.edition_list.openInfor
+                    },
+                    {
+                        "text": MWF.xApplication.process.ProcessDesigner.LP.close,
+                        "action": function(){ this.close(); }
+                    }
+                ],
+                "onPostShow": function(){
+                    this.setEvent();
+                }.bind(this)
+            });
+        }
+    },
+    listEditionDlg: function(){
+        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");
+	    this.openCurrentEditionButton = buttons[0];
+	    var display = this.openCurrentEditionButton.getStyle("display");
+        this.openCurrentEditionButton.store("dsp", display);
+        this.openCurrentEditionButton.setStyle("display", "none");
+        var size, leftSize;
+	    var drag = new Drag(this.resizeNode, {
+            "onSnap": function(el){
+                el.setStyle("background", "#cccccc");
+            },
+            "onStart": function(el, e){
+                size = this.node.getSize();
+                leftSize = this.leftNode.getSize();
+                drag.x = e.event.x;
+            }.bind(this),
+            "onComplete": function(el){
+                el.setStyle("background-color", "transparent");
+            },
+	        "onDrag": function(el, e){
+                var x = drag.x - e.event.x;
+                var w = leftSize.x-x;
+                w = (w/size.x)*100;
+                if (w<30) w = 30;
+                if (w>70) w = 70;
+                this.leftNode.setStyle("width", ""+w+"%");
+                w = 100-w;
+                this.rightNode.setStyle("width", ""+w+"%");
+            }.bind(this)
+        });
+    },
+    openCurrentEdition: function(){
+	    if (this.currentItem && this.currentItem.edition.fullProcess.id != this.process.process.id){
+	        this.process.save(function(){
+                this.process.reload(this.currentItem.edition.fullProcess);
+            }.bind(this));
+        }
+    },
+    checkButtonDisable: function(){
+	    if (this.currentItem && this.currentItem.edition.fullProcess.id != this.process.process.id){
+            this.openCurrentEditionButton.setStyle("display", this.openCurrentEditionButton.retrieve("dsp"));
+        }else{
+            this.openCurrentEditionButton.setStyle("display", "none");
+        }
+    }
+});
+
+MWF.xApplication.process.ProcessDesigner.widget.EditionList.Item = new Class({
+    initialize: function(list, edition){
+        this.list = list;
+        this.edition = edition;
+        this.table = this.list.listTable;
+        this.css = this.list.css;
+        this.lp = this.list.lp;
+        this.isCurrentEdition = (this.list.process.process.id == this.edition.id);
+        this.load();
+    },
+    load: function(){
+        this.node = new Element("tr").inject(this.table);
+        var html = "<td></td>" +
+            "<td>"+this.edition.editionNumber+"</td>" +
+            "<td>"+this.edition.updateTime+"</td>" +
+            "<td>"+o2.name.cn(this.edition.lastUpdatePerson)+"</td>" +
+            "<td>"+(this.edition.editionEnable ? this.lp.edition_list.yes : this.lp.edition_list.no)+"</td>"+
+            "<td>"+(this.edition.editionDes || "")+"</td>"+
+            "<td></td>";
+        this.node.set("html", html);
+
+        var tds = this.node.getElements("td").setStyles((this.isCurrentEdition) ? this.css.listTable_td_current : this.css.listTable_td);
+        tds[tds.length-1].setStyles(this.css.listTable_td_right);
+        this.iconTd = tds[0].setStyles(this.css.listTable_td_icon);
+        this.selectIconNode = new Element("div", {"styles": this.css.unselectIcon}).inject(this.iconTd);
+
+        this.actionTd = tds[tds.length-1].setStyles(this.css.listTable_td_action);
+        this.createActions();
+
+        this.setEvent();
+    },
+    createActions: function(){
+        if (!this.edition.editionEnable){
+            this.enableAction = new Element("div.mainColor_bg", {"styles": this.css.enableAction, "text": this.lp.edition_list.enable}).inject(this.actionTd);
+            var text = this.lp.edition_list.enableInfor.replace(/{v}/, this.edition.editionNumber);
+            this.enableAction.set("title", text);
+        }
+        if (!this.isCurrentEdition && !this.edition.editionEnable){
+            this.delAction = new Element("div", {"styles": this.css.delAction, "text": this.lp.edition_list.del}).inject(this.actionTd);
+            text = this.lp.edition_list.delInfor.replace(/{v}/, this.edition.editionNumber);
+            this.delAction.set("title", text);
+        }
+    },
+    setEvent: function(){
+        this.node.addEvent("click", function(){
+            this.selected();
+        }.bind(this));
+
+        if (this.enableAction) this.enableAction.addEvents({
+            "click": function(e){ this.enable(e); e.stopPropagation();}.bind(this),
+        });
+
+        if (this.delAction) this.delAction.addEvents({
+            "click": function(e){ this.del(e); e.stopPropagation();}.bind(this),
+        });
+    },
+    enable: function(e){
+        var actions = o2.Actions.load("x_processplatform_assemble_designer").ProcessAction;
+        var _self = this;
+        this.list.process.designer.confirm("infor", e, this.lp.edition_list.enabledProcessTitle, {"html": this.lp.edition_list.enabledProcessInfor}, 600, 120, function(){
+            _self.list.process.save(function(){
+                actions.enableProcess(this.edition.id, function(json){
+                    this.list.reloadList();
+                    actions.get(this.list.process.process.id, function(processJson){
+                        this.list.process.reload(processJson.data);
+                    }.bind(this));
+                }.bind(this));
+            }.bind(_self));
+            this.close();
+        },function(){this.close();})
+    },
+    del: function(e){
+        var _self = this;
+        var infor = this.lp.edition_list.deleteEditionInfor.replace(/{v}/g, this.edition.editionNumber);
+        this.list.process.designer.confirm("warn", e, this.lp.edition_list.deleteEditionTitle, infor, 460, 120, function(){
+            _self.deleteEdition();
+            this.close();
+        }, function(){
+            this.close();
+        });
+    },
+    deleteEdition: function(callback){
+        o2.Actions.load("x_processplatform_assemble_designer").ProcessAction["delete"](this.edition.id, "true", function(){
+            this.unSelected();
+            this.node.destroy();
+            if (callback) callback();
+        }.bind(this));
+    },
+    selected: function(){
+        if (this.list.currentItem) this.list.currentItem.unSelected();
+        this.node.setStyles(this.css.itemTr_selected).addClass("lightColor_bg");
+        this.selectIconNode.setStyles(this.css.selectIcon).addClass("mainColor_bg");
+        this.list.currentItem = this;
+        this.checkDiff();
+        this.list.checkButtonDisable();
+    },
+    unSelected: function(){
+        this.node.setStyles(this.css.itemTr).removeClass("lightColor_bg");
+        this.selectIconNode.setStyles(this.css.unselectIcon).removeClass("mainColor_bg");
+        this.list.currentItem = null;
+        this.list.diffNode.empty();
+    },
+    checkDiff: function(){
+        this.getFullProcess(function(){
+            var prevItem  = this.getPrevItem();
+            if (prevItem){
+                prevItem.getFullProcess();
+                var diffs = this.getDiffWithProcess(prevItem.edition.fullProcess);
+                if (diffs.length){
+                    this.appendDiffLine(this.lp.edition_list.hasDiffs);
+                    //for (var i=0; i<10; i++){
+                        diffs.each(function(v){
+                            this.appendDiffLine(v);
+                        }.bind(this));
+                    //}
+                }else{
+                    this.appendDiffLine(this.lp.edition_list.noDiffs);
+                }
+            }else{
+                this.appendDiffLine(this.lp.edition_list.newProcess);
+                this.appendDiffLine(this.getNewProcessInfor());
+            }
+        }.bind(this));
+
+    },
+    appendDiffLine: function(text){
+        new Element("div", {"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);
+                    }
+                }
+            }
+        }.bind(this));
+
+        diffs = diffs.concat(this.getDiffActivityListCount(process, diffs));
+
+        return diffs;
+    },
+    getDiffActivityListCount: function(process){
+        var diffs = [];
+        diffs = diffs.concat(this.getDiffActivityCount(process.endList, this.edition.fullProcess.endList));
+        diffs = diffs.concat(this.getDiffActivityCount(process.manualList, this.edition.fullProcess.manualList));
+        return diffs;
+    },
+    getDiffActivityCount: function(prevList, currentList){
+        var diffs = [];
+        var prevNames = prevList.map(function(item){ return item.name; });
+        var currentNames = currentList.map(function(item){ return item.name; });
+
+        var deleteNames = prevNames.filter(function(name){
+            var i = currentNames.indexOf(name);
+            if (i!=-1){
+                currentNames.splice(i, 1);
+                return false;
+            }
+            return true;
+        });
+        currentNames.each(function(name){
+            var infor = this.lp.edition_list.addActivity;
+            infor = infor.replace(/\{name\}/, name);
+            diffs.push(infor);
+        }.bind(this));
+        deleteNames.each(function(name){
+            var infor = this.lp.edition_list.deleteActivity;
+            infor = infor.replace(/\{name\}/, name);
+            diffs.push(infor);
+        }.bind(this));
+        return diffs;
+    },
+
+    getNewProcessInfor: function(){
+        //this.getFullProcess(function(){
+            var process = this.edition.fullProcess;
+            var activityInfor = "";
+            var an = this.lp.edition_list.an;
+            activityInfor = "1 "+an+this.lp.menu.newActivityType.begin;
+            if (process.endList && process.endList.length) activityInfor += ", "+process.endList.length + " "+an +this.lp.menu.newActivityType.end;
+            if (process.agentList && process.agentList.length) activityInfor += ", "+process.agentList.length + " "+an +this.lp.menu.newActivityType.agent;
+            if (process.manualList && process.manualList.length) activityInfor += ", "+process.manualList.length + " "+an +this.lp.menu.newActivityType.manual;
+            if (process.conditionList && process.conditionList.length) activityInfor += ", "+process.conditionList.length + " "+an +this.lp.menu.newActivityType.condition;
+            if (process.choiceList && process.choiceList.length) activityInfor += ", "+process.choiceList.length + " "+an +this.lp.menu.newActivityType.choice;
+            if (process.parallelList && process.parallelList.length) activityInfor += ", "+process.parallelList.length + " "+an +this.lp.menu.newActivityType.parallel;
+            if (process.splitList && process.splitList.length) activityInfor += ", "+process.splitList.length + " "+an +this.lp.menu.newActivityType.split;
+            if (process.mergeList && process.mergeList.length) activityInfor += ", "+process.mergeList.length + " "+an +this.lp.menu.newActivityType.merge;
+            if (process.embedList && process.embedList.length) activityInfor += ", "+process.embedList.length + " "+an +this.lp.menu.newActivityType.embed;
+            if (process.invokeList && process.invokeList.length) activityInfor += ", "+process.invokeList.length + " "+an +this.lp.menu.newActivityType.invoke;
+            if (process.cancelList && process.cancelList.length) activityInfor += ", "+process.cancelList.length + " "+an +this.lp.menu.newActivityType.cancel;
+            if (process.delayList && process.delayList.length) activityInfor += ", "+process.delayList.length + " "+an +this.lp.menu.newActivityType.delay;
+            if (process.messageList && process.messageList.length) activityInfor += ", "+process.messageList.length + " "+an +this.lp.menu.newActivityType.message;
+            if (process.serviceList && process.serviceList.length) activityInfor += ", "+process.serviceList.length + " "+an +this.lp.menu.newActivityType.service;
+
+            return activityInfor;
+        //}.bind(this));
+    },
+    getFullProcess: function(callback, async){
+        if (this.edition.fullProcess){
+            if (callback) callback();
+        }else{
+            var asyncGet = !!async;
+            o2.Actions.load("x_processplatform_assemble_designer").ProcessAction.get(this.edition.id, function(json){
+                this.edition.fullProcess = json.data;
+                if (callback) callback();
+            }.bind(this), null, asyncGet);
+        }
+    },
+    getPrevItem: function(){
+        var idx = this.list.items.indexOf(this);
+        idx++;
+        if (idx<this.list.items.length) return this.list.items[idx];
+        return null;
+    }
+});

+ 24 - 0
o2web/source/x_component_process_ProcessManager/ProcessExplorer.js

@@ -284,6 +284,30 @@ MWF.xApplication.process.ProcessManager.ProcessExplorer = new Class({
     _getItemObject: function(item){
         return new MWF.xApplication.process.ProcessManager.ProcessExplorer.Process(this, item)
     },
+    showDeleteAction: function(){
+        if (!this.deleteItemsAction){
+            this.deleteItemsAction = new Element("div", {
+                "styles": this.css.deleteItemsAction,
+                "text": this.app.lp.deleteItems
+            }).inject(this.node);
+            this.deleteItemsAction.fade("in");
+            this.deleteItemsAction.position({
+                relativeTo: this.elementContentListNode,
+                position: 'centerTop',
+                edge: 'centerTop',
+                "offset": {"y": this.elementContentNode.getScroll().y}
+            });
+            this.deleteItemsAction.addEvent("click", function(){
+                var _self = this;
+                this.app.confirm("warn", this.deleteItemsAction, MWF.APPPM.LP.deleteProcessTitle, MWF.APPPM.LP.deleteProcess, 430, 120, function(){
+                    _self.deleteItems();
+                    this.close();
+                }, function(){
+                    this.close();
+                });
+            }.bind(this));
+        }
+    },
     deleteItems: function(){
         this.hideDeleteAction();
         while (this.deleteMarkItems.length){

+ 3 - 0
o2web/source/x_component_process_ProcessManager/lp/zh-cn.js

@@ -28,6 +28,9 @@ MWF.xApplication.process.ProcessManager.LP = {
     "deleteElementTitle": "删除设计确认",
     "deleteElement": "是否确定要删除选中的设计元素?",
 
+    "deleteProcessTitle": "删除设计确认",
+    "deleteProcess": "删除选中的流程,同时也会删除选中流程的流转中实例。确定要删除选中的流程吗?",
+
 	"process": {
         "create": "新建流程",
         "search": "搜索流程",