Explorar el Código

Merge branch 'feature/task_pause' into 'wrdp'

增加挂起和恢复操作及相关脚本

See merge request o2oa/o2oa!2680
胡起 hace 5 años
padre
commit
7d3c6c9b1c
Se han modificado 33 ficheros con 378 adiciones y 212 borrados
  1. 2 1
      o2web/source/o2_core/o2/widget/$Toolbar/xform_blue_simple/css.wcss
  2. 2 1
      o2web/source/o2_core/o2/widget/$Toolbar/xform_red_simple/css.wcss
  3. 3 0
      o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.json
  4. 18 0
      o2web/source/o2_core/o2/xScript/Environment.js
  5. BIN
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/default/pause.png
  6. BIN
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/default/pause_gray.png
  7. BIN
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/default/resume.png
  8. BIN
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/default/resume_gray.png
  9. BIN
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/pause.png
  10. BIN
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/pause_gray.png
  11. BIN
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/resume.png
  12. BIN
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/resume_gray.png
  13. BIN
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/pause.png
  14. BIN
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/pause_gray.png
  15. BIN
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/resume.png
  16. BIN
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/resume_gray.png
  17. 22 0
      o2web/source/x_component_process_FormDesigner/Module/Actionbar/toolbars.json
  18. 4 2
      o2web/source/x_component_process_FormDesigner/Module/Form/template/form_cms_publish.json
  19. 4 2
      o2web/source/x_component_process_FormDesigner/Module/Form/template/form_common.json
  20. 4 2
      o2web/source/x_component_process_FormDesigner/Module/Form/template/form_file.json
  21. 4 2
      o2web/source/x_component_process_FormDesigner/Module/Form/template/form_project.json
  22. 4 2
      o2web/source/x_component_process_FormDesigner/Module/Form/template/form_tab.json
  23. 4 2
      o2web/source/x_component_process_FormDesigner/Module/Form/template/form_tab_red.json
  24. BIN
      o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/icon/downloadAll.png
  25. BIN
      o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/icon/pause.png
  26. BIN
      o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/icon/resume.png
  27. BIN
      o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/tools/downloadAll.png
  28. BIN
      o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/tools/pause.png
  29. BIN
      o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/tools/resume.png
  30. 6 0
      o2web/source/x_component_process_ProcessDesigner/$Process/manual.html
  31. 229 197
      o2web/source/x_component_process_Xform/Actionbar.js
  32. 65 0
      o2web/source/x_component_process_Xform/Form.js
  33. 7 1
      o2web/source/x_component_process_Xform/lp/zh-cn.js

+ 2 - 1
o2web/source/o2_core/o2/widget/$Toolbar/xform_blue_simple/css.wcss

@@ -62,7 +62,8 @@
 		"padding-left": "2px",
 		"padding-right": "2px",
 		"line-height": "30px",
-		"cursor": "pointer"
+		"cursor": "pointer",
+		"color": "#000000"
 	},
 
 	"buttonDisable": {

+ 2 - 1
o2web/source/o2_core/o2/widget/$Toolbar/xform_red_simple/css.wcss

@@ -62,7 +62,8 @@
 		"padding-left": "2px",
 		"padding-right": "2px",
 		"line-height": "30px",
-		"cursor": "pointer"
+		"cursor": "pointer",
+		"color": "#000000"
 	},
 
 	"buttonDisable": {

+ 3 - 0
o2web/source/o2_core/o2/xAction/services/x_processplatform_assemble_surface.json

@@ -95,6 +95,9 @@
 
   "press": {"uri": "/jaxrs/taskcompleted/press/work/{work}"},
 
+  "pauseTask": {"uri": "/jaxrs/task/v2/{id}/pause"},
+  "resumeTask": {"uri": "/jaxrs/task/v2/{id}/resume"},
+
   "getCount": {"uri": "/jaxrs/work/count/{credential}"},
 
   "listApplicationStartable": {"uri": "/jaxrs/application/list/complex"},

+ 18 - 0
o2web/source/o2_core/o2/xScript/Environment.js

@@ -2287,6 +2287,24 @@ MWF.xScript.Environment = function(ev){
          */
         "close": function(){_form.closeWork();},
 
+        /**
+         *挂起当前待办
+         * @method pauseTask
+         * @static
+         * @example
+         * this.form.pauseTask();
+         */
+        "pauseTask": function(){_form.pauseTask();},
+
+        /**
+         *将待办从挂起状态恢复为正常状态
+         * @method resumeTask
+         * @static
+         * @example
+         * this.form.resumeTask();
+         */
+        "resumeTask": function(){_form.resumeTask();},
+
         /**本校验不包括校验意见,校验路由;通常用在弹出提交界面时候的校验
          * @summary 根据表单中所有组件的校验设置和“流转校验”脚本进行校验。
          * @method verify

BIN
o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/default/pause.png


BIN
o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/default/pause_gray.png


BIN
o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/default/resume.png


BIN
o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/default/resume_gray.png


BIN
o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/pause.png


BIN
o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/pause_gray.png


BIN
o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/resume.png


BIN
o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/resume_gray.png


BIN
o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/pause.png


BIN
o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/pause_gray.png


BIN
o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/resume.png


BIN
o2web/source/x_component_process_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/resume_gray.png


+ 22 - 0
o2web/source/x_component_process_FormDesigner/Module/Actionbar/toolbars.json

@@ -119,6 +119,28 @@
     "condition": "",
     "read": true
   },
+  {
+    "type": "MWFToolBarButton",
+    "img": "pause.png",
+    "title": "待办挂起",
+    "action": "pauseTask",
+    "text": "挂起",
+    "id": "action_pause",
+    "control": "allowPause",
+    "condition": "",
+    "read": true
+  },
+  {
+    "type": "MWFToolBarButton",
+    "img": "resume.png",
+    "title": "挂起恢复",
+    "action": "resumeTask",
+    "text": "挂起恢复",
+    "id": "action_resume",
+    "control": "allowResume",
+    "condition": "",
+    "read": true
+  },
   {
     "type": "MWFToolBarButton",
     "img": "downloadAll.png",

+ 4 - 2
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_cms_publish.json

@@ -252,7 +252,8 @@
               "padding-left": "2px",
               "padding-right": "2px",
               "line-height": "30px",
-              "cursor": "pointer"
+              "cursor": "pointer",
+              "color": "#000000"
             },
             "buttonDisable": {
               "color": "#999"
@@ -825,7 +826,8 @@
               "padding-left": "2px",
               "padding-right": "2px",
               "line-height": "30px",
-              "cursor": "pointer"
+              "cursor": "pointer",
+              "color": "#000000"
             },
             "buttonDisable": {
               "color": "#999"

+ 4 - 2
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_common.json

@@ -251,7 +251,8 @@
               "padding-left": "2px",
               "padding-right": "2px",
               "line-height": "30px",
-              "cursor": "pointer"
+              "cursor": "pointer",
+              "color": "#000000"
             },
             "buttonDisable": {
               "color": "#999"
@@ -1069,7 +1070,8 @@
               "padding-left": "2px",
               "padding-right": "2px",
               "line-height": "30px",
-              "cursor": "pointer"
+              "cursor": "pointer",
+              "color": "#000000"
             },
             "buttonDisable": {
               "color": "#999"

+ 4 - 2
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_file.json

@@ -239,7 +239,8 @@
               "padding-left": "2px",
               "padding-right": "2px",
               "line-height": "30px",
-              "cursor": "pointer"
+              "cursor": "pointer",
+              "color": "#000000"
             },
             "buttonDisable": {
               "color": "#999"
@@ -1756,7 +1757,8 @@
               "padding-left": "2px",
               "padding-right": "2px",
               "line-height": "30px",
-              "cursor": "pointer"
+              "cursor": "pointer",
+              "color": "#000000"
             },
             "buttonDisable": {
               "color": "#999"

+ 4 - 2
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_project.json

@@ -251,7 +251,8 @@
               "padding-left": "2px",
               "padding-right": "2px",
               "line-height": "30px",
-              "cursor": "pointer"
+              "cursor": "pointer",
+              "color": "#000000"
             },
             "buttonDisable": {
               "color": "#999"
@@ -955,7 +956,8 @@
               "padding-left": "2px",
               "padding-right": "2px",
               "line-height": "30px",
-              "cursor": "pointer"
+              "cursor": "pointer",
+              "color": "#000000"
             },
             "buttonDisable": {
               "color": "#999"

+ 4 - 2
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_tab.json

@@ -253,7 +253,8 @@
               "padding-left": "2px",
               "padding-right": "2px",
               "line-height": "30px",
-              "cursor": "pointer"
+              "cursor": "pointer",
+              "color": "#000000"
             },
             "buttonDisable": {
               "color": "#999"
@@ -953,7 +954,8 @@
               "padding-left": "2px",
               "padding-right": "2px",
               "line-height": "30px",
-              "cursor": "pointer"
+              "cursor": "pointer",
+              "color": "#000000"
             },
             "buttonDisable": {
               "color": "#999"

+ 4 - 2
o2web/source/x_component_process_FormDesigner/Module/Form/template/form_tab_red.json

@@ -254,7 +254,8 @@
               "padding-left": "2px",
               "padding-right": "2px",
               "line-height": "30px",
-              "cursor": "pointer"
+              "cursor": "pointer",
+              "color": "#000000"
             },
             "buttonDisable": {
               "color": "#999"
@@ -954,7 +955,8 @@
               "padding-left": "2px",
               "padding-right": "2px",
               "line-height": "30px",
-              "cursor": "pointer"
+              "cursor": "pointer",
+              "color": "#000000"
             },
             "buttonDisable": {
               "color": "#999"

BIN
o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/icon/downloadAll.png


BIN
o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/icon/pause.png


BIN
o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/icon/resume.png


BIN
o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/tools/downloadAll.png


BIN
o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/tools/pause.png


BIN
o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/tools/resume.png


+ 6 - 0
o2web/source/x_component_process_ProcessDesigner/$Process/manual.html

@@ -341,6 +341,12 @@
                     <input class="editTableRadio" name="allowPress" text{(!$.allowPress)?'checked':''} type="radio" value="false"/>否</td>
             </tr>
         </table>
+        <table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
+            <tr>
+                <td class="editTableValue"  colspan="2"><b>允许挂起:</b><input class="editTableRadio" name="allowPause" text{($.allowPause)?'checked':''} type="radio" value="true"/>是
+                    <input class="editTableRadio" name="allowPause" text{(!$.allowPause)?'checked':''} type="radio" value="false"/>否</td>
+            </tr>
+        </table>
 
     </div>
     <div title="事件"  class="MWFTab" data-o2-advanced="yes">

+ 229 - 197
o2web/source/x_component_process_Xform/Actionbar.js

@@ -17,44 +17,44 @@ MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
 MWF.xApplication.process.Xform.Actionbar = MWF.APPActionbar =  new Class(
     /** @lends MWF.xApplication.process.Xform.Actionbar# */
     {
-	Extends: MWF.APP$Module,
-    options: {
+        Extends: MWF.APP$Module,
+        options: {
+            /**
+             * 组件加载前触发。
+             * @event MWF.xApplication.process.Xform.Actionbar#queryLoad
+             * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
+             */
+            /**
+             * 组件加载时触发。
+             * @event MWF.xApplication.process.Xform.Actionbar#load
+             * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
+             */
+            /**
+             * 组件加载后事件.由于加载过程中有异步处理,这个时候操作条有可能还未生成。
+             * @event MWF.xApplication.process.Xform.Actionbar#postLoad
+             * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
+             */
+            /**
+             * 组件加载后事件。这个时候操作条已生成
+             * @event MWF.xApplication.process.Xform.Actionbar#afterLoad
+             * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
+             */
+            "moduleEvents": ["load", "queryLoad", "postLoad", "afterLoad"]
+        },
         /**
-         * 组件加载前触发。
-         * @event MWF.xApplication.process.Xform.Actionbar#queryLoad
-         * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
+         * @summary 重新加载操作条.
+         * @example
+         * this.form.get("name").reload(); //显示操作条
          */
-        /**
-         * 组件加载时触发。
-         * @event MWF.xApplication.process.Xform.Actionbar#load
-         * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
-         */
-        /**
-         * 组件加载后事件.由于加载过程中有异步处理,这个时候操作条有可能还未生成。
-         * @event MWF.xApplication.process.Xform.Actionbar#postLoad
-         * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
-         */
-        /**
-         * 组件加载后事件。这个时候操作条已生成
-         * @event MWF.xApplication.process.Xform.Actionbar#afterLoad
-         * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
-         */
-        "moduleEvents": ["load", "queryLoad", "postLoad", "afterLoad"]
-    },
-    /**
-     * @summary 重新加载操作条.
-     * @example
-     * this.form.get("name").reload(); //显示操作条
-     */
-    reload : function(){
-	    this._loadUserInterface();
-    },
-	_loadUserInterface: function(){
-        // if (this.form.json.mode == "Mobile"){
-        //     this.node.empty();
-        // }else if (COMMON.Browser.Platform.isMobile){
-        //     this.node.empty();
-        // }else{
+        reload : function(){
+            this._loadUserInterface();
+        },
+        _loadUserInterface: function(){
+            // if (this.form.json.mode == "Mobile"){
+            //     this.node.empty();
+            // }else if (COMMON.Browser.Platform.isMobile){
+            //     this.node.empty();
+            // }else{
             this.toolbarNode = this.node.getFirst("div");
             if(!this.toolbarNode)return;
 
@@ -145,182 +145,214 @@ MWF.xApplication.process.Xform.Actionbar = MWF.APPActionbar =  new Class(
                     }
                 }
             }.bind(this));
-        // }
-	},
+            // }
+        },
 
-    setCustomToolbars: function(tools, node){
-        var path = "../x_component_process_FormDesigner/Module/Actionbar/";
-        var iconPath = "";
-        if( this.json.customIconStyle ){
-            iconPath = this.json.customIconStyle+"/";
-        }
-        tools.each(function(tool){
-            var flag = true;
-            if (this.readonly){
-                flag = tool.readShow;
-            }else{
-                flag = tool.editShow;
+        setCustomToolbars: function(tools, node){
+            var path = "../x_component_process_FormDesigner/Module/Actionbar/";
+            var iconPath = "";
+            if( this.json.customIconStyle ){
+                iconPath = this.json.customIconStyle+"/";
             }
-            if (flag){
-                flag = true;
-                if (tool.control){
-                    flag = this.form.businessData.control[tool.control]
-                }
-                if (tool.condition){
-                    var hideFlag = this.form.Macro.exec(tool.condition, this);
-                    flag = !hideFlag;
+            tools.each(function(tool){
+                var flag = true;
+                if (this.readonly){
+                    flag = tool.readShow;
+                }else{
+                    flag = tool.editShow;
                 }
                 if (flag){
-                    var actionNode = new Element("div", {
-                        "id": tool.id,
-                        "MWFnodetype": tool.type,
-                        "MWFButtonImage": path+""+this.form.options.style+"/custom/"+iconPath+tool.img,
-                        "title": tool.title,
-                        "MWFButtonAction": "runCustomAction",
-                        "MWFButtonText": tool.text
-                    }).inject(node);
-                    if( this.json.customIconOverStyle ){
-                        actionNode.set("MWFButtonImageOver" , path+""+this.form.options.style +"/custom/"+this.json.customIconOverStyle+ "/" +tool.img );
+                    flag = true;
+                    if (tool.control){
+                        flag = this.form.businessData.control[tool.control]
                     }
-                    if( tool.properties ){
-                        actionNode.set(tool.properties);
+                    if (tool.condition){
+                        var hideFlag = this.form.Macro.exec(tool.condition, this);
+                        flag = !hideFlag;
                     }
-                    if (tool.actionScript){
-                        actionNode.store("script", tool.actionScript);
-                    }
-                    if (tool.sub){
-                        var subNode = node.getLast();
-                        this.setCustomToolbars(tool.sub, subNode);
+                    if (flag){
+                        var actionNode = new Element("div", {
+                            "id": tool.id,
+                            "MWFnodetype": tool.type,
+                            "MWFButtonImage": path+""+this.form.options.style+"/custom/"+iconPath+tool.img,
+                            "title": tool.title,
+                            "MWFButtonAction": "runCustomAction",
+                            "MWFButtonText": tool.text
+                        }).inject(node);
+                        if( this.json.customIconOverStyle ){
+                            actionNode.set("MWFButtonImageOver" , path+""+this.form.options.style +"/custom/"+this.json.customIconOverStyle+ "/" +tool.img );
+                        }
+                        if( tool.properties ){
+                            actionNode.set(tool.properties);
+                        }
+                        if (tool.actionScript){
+                            actionNode.store("script", tool.actionScript);
+                        }
+                        if (tool.sub){
+                            var subNode = node.getLast();
+                            this.setCustomToolbars(tool.sub, subNode);
+                        }
                     }
                 }
-            }
-        }.bind(this));
-    },
+            }.bind(this));
+        },
 
-    setToolbarItem: function(tool, node, readonly, noCondition){
-        var path = "../x_component_process_FormDesigner/Module/Actionbar/";
-        var flag = true;
-        if (tool.control){
-            flag = this.form.businessData.control[tool.control]
-        }
-        if (!noCondition) if (tool.condition){
-            var hideFlag = this.form.Macro.exec(tool.condition, this);
-            flag = flag && (!hideFlag);
-        }
-        // if (tool.id == "action_processWork"){
-        //     if (!this.form.businessData.task){
-        //         flag = false;
-        //     }
-        // }
-        if (tool.id == "action_downloadAll" || tool.id == "action_print"){
-            if (!this.form.businessData.work.startTime){
-                flag = false;
+        setToolbarItem: function(tool, node, readonly, noCondition){
+            var path = "../x_component_process_FormDesigner/Module/Actionbar/";
+            var flag = true;
+            if (tool.control){
+                flag = this.form.businessData.control[tool.control]
             }
-        }
-        if (tool.id == "action_delete"){
-            if (!this.form.businessData.work || !this.form.businessData.work.id){
-                flag = false;
+            if (!noCondition) if (tool.condition){
+                var hideFlag = this.form.Macro.exec(tool.condition, this);
+                flag = flag && (!hideFlag);
+            }
+            // if (tool.id == "action_processWork"){
+            //     if (!this.form.businessData.task){
+            //         flag = false;
+            //     }
+            // }
+            if (tool.id == "action_downloadAll" || tool.id == "action_print"){
+                if (!this.form.businessData.work.startTime){
+                    flag = false;
+                }
+            }
+            if (tool.id == "action_delete"){
+                if (!this.form.businessData.work || !this.form.businessData.work.id){
+                    flag = false;
+                }
             }
-        }
 
 
-        if (tool.id == "action_rollback") tool.read = true;
-        if (readonly) if (!tool.read) flag = false;
-        if (flag){
-            var actionNode = new Element("div", {
-                "id": tool.id,
-                "MWFnodetype": tool.type,
-                //"MWFButtonImage": this.form.path+""+this.form.options.style+"/actionbar/"+tool.img,
-                "MWFButtonImage": path+(this.options.style||"default") +"/tools/"+ (this.json.style || "default") +"/"+tool.img,
-                "title": tool.title,
-                "MWFButtonAction": tool.action,
-                "MWFButtonText": tool.text
-            }).inject(node);
-            if( this.json.iconOverStyle ){
-                actionNode.set("MWFButtonImageOver" , path+""+(this.options.style||"default")+"/tools/"+( this.json.iconOverStyle || "default" )+"/"+tool.img );
+            if (tool.id == "action_rollback") tool.read = true;
+            if (readonly) if (!tool.read) flag = false;
+            if (flag){
+                var actionNode = new Element("div", {
+                    "id": tool.id,
+                    "MWFnodetype": tool.type,
+                    //"MWFButtonImage": this.form.path+""+this.form.options.style+"/actionbar/"+tool.img,
+                    "MWFButtonImage": path+(this.options.style||"default") +"/tools/"+ (this.json.style || "default") +"/"+tool.img,
+                    "title": tool.title,
+                    "MWFButtonAction": tool.action,
+                    "MWFButtonText": tool.text
+                }).inject(node);
+                if( this.json.iconOverStyle ){
+                    actionNode.set("MWFButtonImageOver" , path+""+(this.options.style||"default")+"/tools/"+( this.json.iconOverStyle || "default" )+"/"+tool.img );
+                }
+                if( tool.properties ){
+                    actionNode.set(tool.properties);
+                }
+                if (tool.sub){
+                    var subNode = node.getLast();
+                    this.setToolbars(tool.sub, subNode, readonly, noCondition);
+                }
             }
-            if( tool.properties ){
-                actionNode.set(tool.properties);
+        },
+        /**
+         * @summary 根据操作id获取操作,该方法在操作条的afterLoad事件中有效,操作的操作脚本有效。
+         *  @param {String} id - 必选,操作id.
+         *  @return {o2.widget.ToolbarButton} 操作
+         *  @example
+         *  var actionbar = this.form.get("name"); //获取操作条
+         *  var item = actionbar.getItem( "action_delete" ); //获取删除操作
+         *  item.node.hide(); //隐藏删除操作的节点
+         *  item.node.click(); //触发操作的click事件
+         */
+        getItem : function( id ){
+            if( this.toolbarWidget && id ){
+                return this.toolbarWidget.items[id]
+            }
+        },
+        /**
+         * @summary 获取所有操作,该方法在操作条的afterLoad事件中有效,操作的操作脚本有效。
+         *  @return {Array} 操作数组
+         *  @example
+         *  var actionbar = this.form.get("name"); //获取操作条
+         *  var itemList = actionbar.getAllItem(); //获取操作数组
+         *  itemList[1].node.hide(); //隐藏第一个操作
+         */
+        getAllItem : function(){
+            return this.toolbarWidget ? this.toolbarWidget.childrenButton : [];
+        },
+        setToolbars: function(tools, node, readonly, noCondition){
+            tools.each(function(tool){
+                this.setToolbarItem(tool, node, readonly, noCondition);
+            }.bind(this));
+        },
+        runCustomAction: function(bt){
+            var script = bt.node.retrieve("script");
+            this.form.Macro.exec(script, this);
+        },
+        saveWork: function(){
+            this.form.saveWork();
+        },
+        closeWork: function(){
+            this.form.closeWork();
+        },
+        processWork: function(){
+            this.form.processWork();
+        },
+        resetWork: function(){
+            this.form.resetWork();
+        },
+        retractWork: function(e, ev){
+            this.form.retractWork(e, ev);
+        },
+        rerouteWork: function(e, ev){
+            this.form.rerouteWork(e, ev);
+        },
+        deleteWork: function(){
+            this.form.deleteWork();
+        },
+        printWork: function(){
+            this.form.printWork();
+        },
+        readedWork: function(b,e){
+            this.form.readedWork(e);
+        },
+        addSplit: function(e){
+            this.form.addSplit(e);
+        },
+        rollback: function(e){
+            this.form.rollback(e);
+        },
+        downloadAll: function(e){
+            this.form.downloadAll(e);
+        },
+        pressWork: function(e){
+            this.form.pressWork(e);
+        },
+        pauseTask: function(e){
+            var p = this.form.pauseTask(e);
+            if (p){
+                p.then(function(){
+                    e.setText(MWF.xApplication.process.Xform.LP.resume);
+                    e.options.action = "resumeTask";
+
+                    var img = e.picNode.getElement("img");
+                    var src = img.get("src");
+                    src = src.substr(0, src.lastIndexOf("/"));
+                    src = src+"/resume.png";
+                    img.set("src", src);
+
+                }.bind(this), function(){});
             }
-            if (tool.sub){
-                var subNode = node.getLast();
-                this.setToolbars(tool.sub, subNode, readonly, noCondition);
+        },
+        resumeTask: function(e){
+            var p = this.form.resumeTask(e);
+            if (p){
+                p.then(function(){
+                    e.setText( MWF.xApplication.process.Xform.LP.pause);
+                    e.options.action = "pauseTask";
+
+                    var img = e.picNode.getElement("img");
+                    var src = img.get("src");
+                    src = src.substr(0, src.lastIndexOf("/"));
+                    src = src+"/pause.png";
+                    img.set("src", src);
+
+                }.bind(this), function(){});
             }
         }
-    },
-    /**
-     * @summary 根据操作id获取操作,该方法在操作条的afterLoad事件中有效,操作的操作脚本有效。
-     *  @param {String} id - 必选,操作id.
-     *  @return {o2.widget.ToolbarButton} 操作
-     *  @example
-     *  var actionbar = this.form.get("name"); //获取操作条
-     *  var item = actionbar.getItem( "action_delete" ); //获取删除操作
-     *  item.node.hide(); //隐藏删除操作的节点
-     *  item.node.click(); //触发操作的click事件
-     */
-    getItem : function( id ){
-        if( this.toolbarWidget && id ){
-            return this.toolbarWidget.items[id]
-        }
-    },
-    /**
-     * @summary 获取所有操作,该方法在操作条的afterLoad事件中有效,操作的操作脚本有效。
-     *  @return {Array} 操作数组
-     *  @example
-     *  var actionbar = this.form.get("name"); //获取操作条
-     *  var itemList = actionbar.getAllItem(); //获取操作数组
-     *  itemList[1].node.hide(); //隐藏第一个操作
-     */
-    getAllItem : function(){
-        return this.toolbarWidget ? this.toolbarWidget.childrenButton : [];
-    },
-    setToolbars: function(tools, node, readonly, noCondition){
-        tools.each(function(tool){
-            this.setToolbarItem(tool, node, readonly, noCondition);
-        }.bind(this));
-    },
-    runCustomAction: function(bt){
-        var script = bt.node.retrieve("script");
-        this.form.Macro.exec(script, this);
-    },
-    saveWork: function(){
-        this.form.saveWork();
-    },
-    closeWork: function(){
-        this.form.closeWork();
-    },
-    processWork: function(){
-        this.form.processWork();
-    },
-    resetWork: function(){
-        this.form.resetWork();
-    },
-    retractWork: function(e, ev){
-        this.form.retractWork(e, ev);
-    },
-    rerouteWork: function(e, ev){
-        this.form.rerouteWork(e, ev);
-    },
-    deleteWork: function(){
-        this.form.deleteWork();
-    },
-    printWork: function(){
-        this.form.printWork();
-    },
-    readedWork: function(b,e){
-        this.form.readedWork(e);
-    },
-    addSplit: function(e){
-        this.form.addSplit(e);
-    },
-    rollback: function(e){
-        this.form.rollback(e);
-    },
-    downloadAll: function(e){
-        this.form.downloadAll(e);
-    },
-    pressWork: function(e){
-        this.form.pressWork(e);
-    }
 
-}); 
+    });

+ 65 - 0
o2web/source/x_component_process_Xform/Form.js

@@ -3126,6 +3126,71 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class(
             }
         });
     },
+
+    /**
+     * 需要判断权限
+     * @summary 将待办设置为挂起状态,不计算工作时长.
+     * @example
+     * if( this.workContext.getControl().allowPause ){ //判断流程节点是否设置了允许挂起
+     *     this.form.getApp().appForm.pauseTask();
+     * }
+     */
+    pauseTask: function (e) {
+        if (this.businessData.task){
+            if (e && e.disable) e.disable(true);
+            return o2.Actions.get("x_processplatform_assemble_surface").pauseTask(this.businessData.task.id, function (json) {
+                this.app.notice(MWF.xApplication.process.Xform.LP.pauseWork, "success");
+                if (e && e.enable) e.enable(false);
+            }.bind(this), function (xhr, text, error) {
+                //e.setDisable(false);
+                if (xhr.status != 0) {
+                    var errorText = error;
+                    if (xhr) {
+                        var json = JSON.decode(xhr.responseText);
+                        if (json) {
+                            errorText = json.message.trim() || "request json error";
+                        } else {
+                            errorText = "request json error: " + xhr.responseText;
+                        }
+                    }
+                    MWF.xDesktop.notice("error", { x: "right", y: "top" }, errorText);
+                }
+            });
+        }
+    },
+
+    /**
+     * 需要判断权限
+     * @summary 将待办从挂起状态恢复为正常状态.
+     * @example
+     * if( this.workContext.getControl().allowResume ){ //判断当前待办是否可以进行挂起恢复操作
+     *     this.form.getApp().appForm.resumeTask();
+     * }
+     */
+    resumeTask: function (e) {
+        if (this.businessData.task){
+            if (e && e.disable) e.disable(true);
+            return o2.Actions.get("x_processplatform_assemble_surface").resumeTask(this.businessData.task.id, function (json) {
+                this.app.notice(MWF.xApplication.process.Xform.LP.resumeWork, "success");
+                if (e && e.enable) e.enable(false);
+            }.bind(this), function (xhr, text, error) {
+                //e.setDisable(false);
+                if (xhr.status != 0) {
+                    var errorText = error;
+                    if (xhr) {
+                        var json = JSON.decode(xhr.responseText);
+                        if (json) {
+                            errorText = json.message.trim() || "request json error";
+                        } else {
+                            errorText = "request json error: " + xhr.responseText;
+                        }
+                    }
+                    MWF.xDesktop.notice("error", { x: "right", y: "top" }, errorText);
+                }
+            });
+        }
+    },
+
     downloadAll: function () {
         var htmlFormId = "";
         o2.Actions.load("x_processplatform_assemble_surface").AttachmentAction.uploadWorkInfo(this.businessData.work.id, "pdf", {

+ 7 - 1
o2web/source/x_component_process_Xform/lp/zh-cn.js

@@ -239,7 +239,13 @@ MWF.xApplication.process.Xform.LP = {
     },
     "subjectEmpty": "标题不能为空",
     "issuanceUnitEmpty": "发文单位不能为空",
-    "fullWidth": "已启用半角空格自动转换为全角空格,如需输入半角空格,请使用:SHIFT+空格"
+    "fullWidth": "已启用半角空格自动转换为全角空格,如需输入半角空格,请使用:SHIFT+空格",
+
+    "pauseWork": "当前待办已进入挂起状态",
+    "resumeWork": "当前待办已从挂起状态中恢复",
+
+    "resume": "挂起恢复",
+    "pause": "挂起"
 
 };
 MWF.xApplication.process.Xform["lp."+o2.language] = MWF.xApplication.process.Xform.LP;