Parcourir la source

Merge branch 'wrdp' into 'develop'

Wrdp

See merge request o2oa/o2oa!2608
o2null il y a 5 ans
Parent
commit
a0f424ef77

+ 10 - 22
o2server/x_base_core_project/src/main/java/com/x/base/core/project/cache/CacheRedisImpl.java

@@ -9,12 +9,10 @@ import java.util.List;
 import java.util.Optional;
 import java.util.concurrent.LinkedBlockingQueue;
 
-import com.x.base.core.project.tools.RedisTools;
-import org.apache.commons.lang3.StringUtils;
+import javax.script.CompiledScript;
 
-import com.x.base.core.project.config.Cache.Redis;
-import com.x.base.core.project.config.Config;
 import com.x.base.core.project.jaxrs.WrapClearCacheRequest;
+import com.x.base.core.project.tools.RedisTools;
 
 import redis.clients.jedis.Jedis;
 import redis.clients.jedis.params.SetParams;
@@ -40,12 +38,12 @@ public class CacheRedisImpl implements Cache {
 
 	@Override
 	public void put(CacheCategory category, CacheKey key, Object o) throws Exception {
-
-		if (null != o) {
+		// 无法序列化CompiledScript类型,在使用Redis缓存无法缓存CompiledScript类型,直接跳过
+		if ((null != o) && (!(o instanceof CompiledScript))) {
 			Jedis jedis = RedisTools.getJedis();
-			if(jedis != null) {
+			if (jedis != null) {
 				try (ByteArrayOutputStream baos = new ByteArrayOutputStream();
-					 ObjectOutputStream oos = new ObjectOutputStream(baos)) {
+						ObjectOutputStream oos = new ObjectOutputStream(baos)) {
 					oos.writeObject(o);
 					byte[] bytes = baos.toByteArray();
 					jedis.set(concrete(category, key).getBytes(StandardCharsets.UTF_8), bytes, setParams);
@@ -59,12 +57,12 @@ public class CacheRedisImpl implements Cache {
 	@Override
 	public Optional<Object> get(CacheCategory category, CacheKey key) throws Exception {
 		Jedis jedis = RedisTools.getJedis();
-		if(jedis != null) {
+		if (jedis != null) {
 			byte[] bytes = jedis.get(concrete(category, key).getBytes(StandardCharsets.UTF_8));
 			RedisTools.closeJedis(jedis);
 			if ((null != bytes) && bytes.length > 0) {
 				try (ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
-					 ObjectInputStream ois = new ObjectInputStream(bais)) {
+						ObjectInputStream ois = new ObjectInputStream(bais)) {
 					return Optional.ofNullable(ois.readObject());
 				}
 			}
@@ -91,24 +89,14 @@ public class CacheRedisImpl implements Cache {
 		this.notifyQueue.put(wi);
 	}
 
-	/*private Jedis getJedis() throws Exception{
-		Redis redis = Config.cache().getRedis();
-		Jedis jedis = new Jedis(redis.getHost(), redis.getPort(), redis.getConnectionTimeout(), redis.getSocketTimeout(), redis.getSslEnable());
-		if (StringUtils.isNotBlank(redis.getUser()) && StringUtils.isNotBlank(redis.getPassword())) {
-			jedis.auth(redis.getUser(), redis.getPassword());
-		} else if (StringUtils.isNotBlank(redis.getPassword())) {
-			jedis.auth(redis.getPassword());
-		}
-		jedis.select(redis.getIndex());
-		return jedis;
-	}*/
-
 	private String concrete(CacheCategory category, CacheKey key) {
 		return this.application + "&" + category.toString() + "&" + key.toString();
 	}
 
 	public static class Wi extends WrapClearCacheRequest {
 
+		private static final long serialVersionUID = 9200759731216457906L;
+
 	}
 
 }

+ 8 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing.java

@@ -192,6 +192,14 @@ class ActionProcessing extends BaseAction {
 			this.task.setMediaOpinion(this.wi.getMediaOpinion());
 			business.entityManagerContainer().commit();
 		}
+		// 校验路由选择不能为空
+		if (StringUtils.isBlank(this.task.getRouteName())) {
+			throw new ExceptionEmptyRouteName();
+		}
+		// 校验路由在可选择范围内
+		if (!this.task.getRouteNameList().contains(this.task.getRouteName())) {
+			throw new ExceptionErrorRouteName(this.task.getRouteName());
+		}
 	}
 
 	private void seeManualRoute(Business business) throws Exception {

+ 12 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ExceptionEmptyRouteName.java

@@ -0,0 +1,12 @@
+package com.x.processplatform.assemble.surface.jaxrs.task;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionEmptyRouteName extends PromptException {
+
+	private static final long serialVersionUID = 1040883405179987063L;
+
+	ExceptionEmptyRouteName() {
+		super("路由选择不能为空.");
+	}
+}

+ 12 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ExceptionErrorRouteName.java

@@ -0,0 +1,12 @@
+package com.x.processplatform.assemble.surface.jaxrs.task;
+
+import com.x.base.core.project.exception.PromptException;
+
+class ExceptionErrorRouteName extends PromptException {
+
+	private static final long serialVersionUID = 1040883405179987063L;
+
+	ExceptionErrorRouteName(String routeName) {
+		super("路由选择错误:{}.", routeName);
+	}
+}

+ 1 - 0
o2web/.gitignore

@@ -3,6 +3,7 @@
 /dest/
 /out/
 /jsdoc/
+/jsdoc_static/
 /node_modules/
 npm-debug.log
 /test/

+ 8 - 1
o2web/jsdoc.conf.json

@@ -29,7 +29,14 @@
     ],
     "templates": {  //模板参数
         "cleverLinks": false, //@link标签是否呈现为纯文本
-        "monospaceLinks": false
+        "monospaceLinks": false,
+        "default": {
+            "staticFiles": { //静态文件目录
+                "include": [
+                    "./o2web/jsdoc_static"
+                ]
+            }
+        }
     },
     "metadata": {
         "title": "O2OA前台API" //最终生成的文档中标题

+ 52 - 0
o2web/source/o2_core/o2/xScript/CMSEnvironment.js

@@ -32,6 +32,35 @@ MWF.xScript.CMSEnvironment = function(ev){
     //this.inquiredRouteList = null;
 
     //workContext
+    /**
+     * DocumentControl  内容管理的权限对象。
+     * @typedef {Object} DocumentControl
+     * @example
+     {
+        "allowRead": true,              //是否允许阅读文档
+        "allowPublishDocument": true,   //是否允许发布文档
+        "allowSave": true,              //是否允许保存文档
+        "allowPopularDocument": true,   //是否允许设置为热点
+        "allowEditDocument": true,      //是否允许编辑文档
+        "allowDeleteDocument": true     //是否允许删除文档
+    }
+     */
+    /**
+     * DocumentAttachmentData  内容管理的权限对象。
+     * @typedef {Object} DocumentAttachmentData
+     * @example
+     {
+        "id": "a5cc5858-cac5-445a-a0a5-888d224eb2f6",   //附件ID
+        "site": "attachment",                           //附件存储位置(一般用于区分附件在哪个表单元素中显示)
+        "name": "13145352_115454884000_2.jpg",          //附件名称
+        "appId": "c295f34c-9ce1-4122-b795-820267e32b68",  //栏目ID
+        "categoryId": "33fb19f0-0670-464d-875c-32fb86148f7a",  //分类ID
+        "documentId": "ca74cbef-2a7f-401a-80e3-577ac9839348",  //文档ID
+        "creatorUid": "XX@huqi@P",                      //附件上传人
+        "extension": "jpg",
+        "length": 364507,                               //附件大小
+    }
+     */
     /**
      * 你可以通过documentContext获取内容管理实例相关的对象数据。
      * @module documentContext
@@ -49,7 +78,23 @@ MWF.xScript.CMSEnvironment = function(ev){
          * var doc = this.documentContext.getDocument();
          */
         "getDocument": function(){return ev.document },
+        /**
+         * 获取当前人对内容管理实例的权限。
+         * @method getControl
+         * @static
+         * @return {DocumentControl} 当前人对内容管理实例的所拥有的权限.
+         * @example
+         * var control = this.documentContext.getControl();
+         */
         "getControl": function(){return ev.control;},
+        /**
+         * 获取当前流程实例的附件对象列表。
+         * @method getAttachmentList
+         * @static
+         * @return {DocumentAttachment[]} 当前人对内容管理实例的所拥有的权限.
+         * @example
+         * var attachmentList = this.documentContext.getAttachmentList();
+         */
         "getAttachmentList": function(){return ev.attachmentList;}
         //"setTitle": function(title){
         //    if (!this.workAction){
@@ -1510,6 +1555,13 @@ MWF.xScript.CMSEnvironment = function(ev){
             _form.saveDocument(callback);
         },
         "close": function(){_form.closeDocument();},
+
+        /**发布当前文档。<b>(仅内容管理表单中可用)</b>
+         * @method publish
+         * @memberOf module:form
+         * @example
+         this.form.publish();
+         */
         "publish": function(option){
             _form.publishDocument()
         },

Fichier diff supprimé car celui-ci est trop grand
+ 746 - 72
o2web/source/o2_core/o2/xScript/Environment.js


+ 152 - 0
o2web/source/o2_core/o2/xScript/PageEnvironment.js

@@ -1424,30 +1424,90 @@ MWF.xScript.PageEnvironment = function (ev) {
 
     //仅前台对象-----------------------------------------
     //form
+    /**
+     * page对象可在门户页面中可用。它的很多方法与form类似。<b>(仅前端脚本可用)</b><br/>
+     * @module page
+     * @example
+     * //您可以在门户表单中,通过this来获取page对象,如下:
+     * var page = this.page;
+     */
     this.page = this.form = {
+        /**获取当前页面的基本信息
+         * @method getInfor
+         * @static
+         * @see module:form.getInfor
+         */
         "getInfor": function () { return ev.pageInfor; },
         "infor": ev.pageInfor,
+        /**获取打开当前页面的component对象。
+         * @method getApp
+         * @static
+         * @see module:form.getApp
+         */
         "getApp": function () { return _form.app; },
         "app": _form.app,
+        /**获取page对应的DOM对象。
+         * @method node
+         * @static
+         * @see module:form.node
+         */
         "node": function () { return _form.node; },
         //"readonly": _form.options.readonly,
+        /**获取页面元素对象。
+         * @method get
+         * @static
+         * @see module:form.get
+         */
         "get": function (name) { return (_form.all) ? _form.all[name] : null; },
+
+        /**获取指定部件元素对象。<br/>
+         * @method getWidgetModule
+         * @static
+         * @param {String} widget  - 在主页面嵌入部件时用的标识。
+         * @param {String} moduleName  - 部件元素标识。
+         * @return {FormComponent} 请查看本文档的Classes导航下的FormComponents。
+         * @see module:form.get
+         * @example
+         * <caption>
+         * 1、设计了一个部件,包含一个设计元素subject。<br/>
+         * 2、在主页面里两次嵌入1步骤创建的部件,一个标识是widget_1, widget_2。
+         * </caption>
+         * var module = this.page.getWidgetModule( "widget_1", "subject"); //部件widget_1的subject组件
+         * var data2 = this.page.getWidgetModule( "widget_2", "subject").getData(); //部件widget_2的subject组件的值
+         */
         "getWidgetModule": function (widget, moduleName) {
             if (!_form.widgetModules || !_form.widgetModules[widget]) return null;
             var module = _form.widgetModules[widget][moduleName];
             return module || null;
         },
+        /**获取页面中可输入的字段元素对象
+         * @method getField
+         * @static
+         * @see module:form.getField
+         */
         "getField": function (name) { return _forms[name]; },
         "getAction": function () { return _form.workAction },
         "getDesktop": function () { return _form.app.desktop },
+
         "getData": function () { return new MWF.xScript.JSONData(_form.getData()); },
         //"save": function(callback){_form.saveWork(callback);},
+
+        /**关闭当前页面
+         * @method close
+         * @static
+         * @see module:form.close
+         */
         "close": function () { _form.closeWork(); },
 
         "print": function (application, form) {
             _form.printWork(application, form);
         },
 
+        /**弹出一个确认框
+         * @method confirm
+         * @static
+         * @see module:form.confirm
+         */
         "confirm": function (type, title, text, width, height, ok, cancel, callback, mask, style) {
             // var p = MWF.getCenter({"x": width, "y": height});
             // e = {"event": {"clientX": p.x,"x": p.x,"clientY": p.y,"y": p.y}};
@@ -1470,13 +1530,30 @@ MWF.xScript.PageEnvironment = function (ev) {
                 _form.confirm(type, e, title, text, width, height, ok, cancel, callback, mask, style);
             }
         },
+        /**显示一个带关闭按钮的信息框
+         * @method alert
+         * @static
+         * @see module:form.alert
+         */
         "alert": function(type, title, text, width, height){
             _form.alert(type, title, text, width, height);
         },
+
+        /**显示一个信息框
+         * @method notice
+         * @static
+         * @see module:form.notice
+         */
         "notice": function (content, type, target, where, offset, option) {
             _form.notice(content, type, target, where, offset, option);
         },
+        /**给页面添加事件。
+         * @method addEvent
+         * @static
+         * @see module:form.addEvent
+         */
         "addEvent": function (e, f) { _form.addEvent(e, f); },
+
         "openWindow": function (form, app) {
             _form.openWindow(form, app);
         },
@@ -1486,6 +1563,11 @@ MWF.xScript.PageEnvironment = function (ev) {
         "toPortal": function (portal, page, par) {
             _form.app.toPortal(portal, page, par);
         },
+        /**打开一个在流转或已完成的流程实例
+         * @method openWork
+         * @static
+         * @see module:form.openWork
+         */
         "openWork": function (id, completedId, title, options) {
             var op = options || {};
             op.workId = id;
@@ -1494,6 +1576,11 @@ MWF.xScript.PageEnvironment = function (ev) {
             op.appId = "process.Work" + (op.workId || op.workCompletedId);
             return layout.desktop.openApplication(this.event, "process.Work", op);
         },
+        /**使用流程的jobId打开工作
+         * @method openJob
+         * @static
+         * @see module:form.openJob
+         */
         "openJob": function (id, choice, options) {
             var workData = null;
             o2.Actions.get("x_processplatform_assemble_surface").listWorkByJob(id, function (json) {
@@ -1586,12 +1673,22 @@ MWF.xScript.PageEnvironment = function (ev) {
                 }
             }
         },
+        /**打开一个内容管理文档
+         * @method openDocument
+         * @static
+         * @see module:form.openDocument
+         */
         "openDocument": function (id, title, options) {
             var op = options || {};
             op.documentId = id;
             op.docTitle = title || "";
             layout.desktop.openApplication(this.event, "cms.Document", op);
         },
+        /**打开一个门户页面
+         * @method openPortal
+         * @static
+         * @see module:form.openPortal
+         */
         "openPortal": function (name, page, par) {
             var action = MWF.Actions.get("x_portal_assemble_surface");
             action.getApplication(name, function (json) {
@@ -1617,6 +1714,11 @@ MWF.xScript.PageEnvironment = function (ev) {
 
             });
         },
+        /**打开一个内容管理栏目(应用)
+         * @method openCMS
+         * @static
+         * @see module:form.openCMS
+         */
         "openCMS": function (name) {
             var action = MWF.Actions.get("x_cms_assemble_control");
             action.getColumn(name, function (json) {
@@ -1628,6 +1730,11 @@ MWF.xScript.PageEnvironment = function (ev) {
                 }
             });
         },
+        /**打开一个流程应用
+         * @method openProcess
+         * @static
+         * @see module:form.openProcess
+         */
         "openProcess": function (name) {
             var action = MWF.Actions.get("x_processplatform_assemble_surface");
             action.getApplication(name, function (json) {
@@ -1639,9 +1746,19 @@ MWF.xScript.PageEnvironment = function (ev) {
                 }
             });
         },
+        /**打开一个任意一个component应用
+         * @method openApplication
+         * @static
+         * @see module:form.openApplication
+         */
         "openApplication": function (name, options) {
             layout.desktop.openApplication(null, name, options);
         },
+        /**创建一个内容管理文档
+         * @method createDocument
+         * @static
+         * @see module:form.createDocument
+         */
         "createDocument": function (columnOrOptions, category, data, identity, callback, target, latest, selectColumnEnable, ignoreTitle) {
             var column = columnOrOptions;
             var onAfterPublish, onPostPublish;
@@ -1690,6 +1807,11 @@ MWF.xScript.PageEnvironment = function (ev) {
                 starter.load();
             })
         },
+        /**启动一个流程实例
+         * @method startProcess
+         * @static
+         * @see module:form.startProcess
+         */
         "startProcess": function (app, process, data, identity, callback, target, latest) {
             if (arguments.length > 2) {
                 for (var i = 2; i < arguments.length; i++) {
@@ -1748,7 +1870,37 @@ MWF.xScript.PageEnvironment = function (ev) {
                 }
             });
         },
+
+        /**
+         * 在打开的页面的任意脚本中,获取传入的参数。
+         * @member parameters
+         * @static
+         * @return {Boolean} 任意数据类型,根据传入的参数决定。
+         * @example
+         * //打开页面时传入参数:
+         * this.form.openPortal(id, "", {"type": "my type"});
+         *
+         * //在打开的页面的任意脚本中,可以获取parameters:
+         * var par = this.page.parameters;
+         * //par的内容:{"type": "my type"}
+         */
         "parameters": _form.options.parameters,
+
+        /**
+         * 在嵌入部件的时候,可以在主页面上传入参数。通过本方法,可以在对应部件或者部件元素的脚本中获取传入的参数。
+         * @method getWidgetPrameters
+         * @static
+         * @return {Object} 任意数据类型,根据传入的参数决定。
+         * @example
+         * var par = this.page.getWidgetPrameters();
+         * @example
+         * //在主页面嵌入部件的地方传入参数:
+         * return {"type": "my type"};
+         *
+         * //在对应部件脚本中,可以获取parameters:
+         * var par = this.page.getWidgetPrameters();
+         * //par的内容:{"type": "my type"}
+         */
         "getWidgetPrameters": function () {
             if (!this.target) return null;
             if (!this.target.widget) return null;

+ 572 - 0
o2web/source/o2_core/o2/xScript/ViewEnvironment.js

@@ -1,3 +1,86 @@
+/**
+ * StatementInfor 查询配置信息
+ * @typedef {Object} StatementInfor
+ * @example
+ * {
+    "query": "26d21c71-5114-4496-8ca1-a69e56324841", //所属应用id
+    "id": "ee334220-66d3-4f78-afce-8ccf6b995c8c", //查询id
+    "name": "测试查询", //名称
+    "alias": "", //别名
+    "description": "", //描述
+    "table": "", //自建表的id
+    "entityClassName": "com.x.processplatform.core.entity.content.Task", //系统表表名
+    "entityCategory": "official", //表类型 official(系统表) 或 dynamic(自建表)
+    "format": "jpql", //语句类型,jpql 或者 script(脚本)
+    "type": "select", //select/update/delete
+    "data": "SELECT o FROM Task o where o.person = :person", //查询语句
+    "countData": "SELECT count(o.id) FROM Task o where o.person = :person", //总数语句
+    "countScriptText" : "", //总数语句脚本
+    "scriptText" : "", //查询语句脚本
+    "viewJson": { ... } //视图相关信息
+}
+ */
+
+/**
+ * ViewInfor 视图配置信息
+ * @typedef {Object} ViewInfor
+ * @example
+ * {
+      "application": "db9fc893-7dbc-4e0f-a617-99089d2c6323", //视图所在应用
+      "query": "db9fc893-7dbc-4e0f-a617-99089d2c6323",  //视图所在应用,同application
+      "name": "视图自定义测试", //视图名称
+      "viewName": "视图自定义测试",  //视图名称,同name
+      "isExpand": "no",  //如果有分类,默认是否展开开
+      "id": "705ce967-2f9c-425c-8873-3bd729249e1d", //视图id
+      "alias": "", //视图别名
+      "description": "",  //视图描述
+      "display": true, //视图是否显示
+      "type": "cms", //视图嵌入的数据类型, cms 或 process
+      "count": 2000, //最多返回2000条
+      "pageSize": 20, //每页的条数
+      "createTime": "2019-09-02 10:18:27",
+      "updateTime": "2020-03-26 15:53:03"
+    }
+ */
+
+/**
+ * @readonly
+ * @enum {String} ViewFilterDataLogic
+ * @property {String} or color for a white square or piece.
+ * @property {String} and color for a black square or piece.
+ */
+
+/**
+ * ViewFilter 视图过滤条件
+ * @typedef {Object} ViewFilter
+ * @property {String} logic - 可选值:“and”或者“or”,表示和前一个条件的逻辑运算关系。
+ * @property {String} path - 要过滤的data数据的路径。
+ * @property {String} comparison - 比较运算符,可选值:<br/>
+ * <div style='padding-left:150px;'>
+ * <b>equals</b> 或 <b>==</b> 或:表示等于。<br/>
+ * <b>notEquals</b> 或 <b>!=</b> :表示不等于。<br/>
+ * <b>greaterThan</b> 或 <b>></b> :表示大于。<br/>
+ * <b>greaterThanOrEqualTo</b> 或 <b>=></b> :表示大于或等于。<br/>
+ * <b>lessThan</b> 或 <b><</b> :表示小于。<br/>
+ * <b>lessThanOrEqualTo</b> 或 <b><=</b> :表示小于等于。<br/>
+ * <b>like</b> :表示部分匹配。<br/>
+ * <b>notLike</b> :表示不匹配。<br/>
+ * <b>range</b> :表示一定的范围。<br/>
+ * <b>in</b> :表示在某几个特定的值当中。<br/>
+ * </div>
+ * @property {String} formatType  - 过滤数据的数据类型,可选值:
+ * @property {(String|Number|Boolean)} value - 过滤的值,根据formatType提供匹配的数据类型的值,如果是dateTimeValue数据类型,则提供日期格式的字符串,格式如“YYYY-MM-DD HH:MM:SS”。当comparison值为“range”时,此值表示范围中的第一个值。当comparison值为“in”时,多个值用半角逗号","分开。
+ * @property {(String|Number|Boolean)} otherValue  - 当comparison值为“range”时,此值表示范围中的第二个值。当comparison值不为“range”时,忽略此值。
+ * @example
+ *  {
+ *    "logic":"and",
+ *    "path":"$work.title",
+ *    "comparison":"like",
+ *    "value":"7月",
+ *    "formatType":"textValue"
+ * }
+ */
+
 MWF.xScript = MWF.xScript || {};
 MWF.xScript.ViewEnvironment = function (ev) {
     var _form = ev.view;
@@ -1308,27 +1391,425 @@ MWF.xScript.ViewEnvironment = function (ev) {
 
     //仅前台对象-----------------------------------------
     //form
+
+    /**
+     * 当查询设计中使用了select语句,并且配置了视图,可以在查询视图中使用本章API。<br/>
+     * queryStatement对象在查询视图中可用。它的很多方法与queryView类似。<b>(仅前端脚本可用)</b><br/>
+     * @module queryStatement
+     * @borrows module:queryView.confirm as confirm
+     * @borrows module:queryView.alert as alert
+     * @borrows module:queryView.notice as notice
+     * @borrows module:queryView.addEvent as addEvent
+     * @borrows module:queryView.openWork as openWork
+     * @borrows module:queryView.openJob as openJob
+     * @borrows module:queryView.openDocument as openDocument
+     * @borrows module:queryView.openPortal as openPortal
+     * @borrows module:queryView.openCMS as openCMS
+     * @borrows module:queryView.openProcess as openProcess
+     * @borrows module:queryView.openApplication as openApplication
+     * @borrows module:queryView.createDocument as createDocument
+     * @borrows module:queryView.startProcess as startProcess
+     * @example
+     * //您可以在查询视图中,通过this来获取queryStatement对象,如下:
+     * var queryStatement = this.queryStatement;
+     */
+
+    /**
+     * 当查询视图被嵌入到门户页面、流程表单或内容管理表单的时候,可以通过这个方法来获取页面或表单的上下文。
+     * @method getParentEnvironment
+     * @static
+     * @return {MWF.xScript.Environment|MWF.xScript.CMSEnvironment} 页面或表单的上下文.
+     * @example
+     * this.queryStatement.getParentEnvironment();
+     * @example
+     * var env = this.queryStatement.getParentEnvironment(); //当视图被嵌入到页面的时候,可以在视图里获取页面的上下文
+     * env.page.toPortal( "公文门户" ); //调用page的toPage() 跳转到其他门户
+     */
+
+    /**
+     * 获取查询视图当前页的基本信息。
+     * @method getPageInfor
+     * @memberOf module:queryStatement
+     * @static
+     * @return {Object} 当前页的信息,格式如下:
+     *<pre><code class='language-js'>{
+     *     "pages": 3, //总页数
+     *     "perPageCount": 50, //每页的条数
+     *     "currentPageNumber": 1 // 当前页数
+     * }
+     * </pre></code>
+     * @example
+     * this.queryStatement.getPageInfor();
+     */
+
+    /**
+     * 获取当前页的数据。
+     * @method getPageData
+     * @memberOf module:queryStatement
+     * @static
+     * @return {Object[]} 当前页数据。
+     * <div>数据格式和 jpql 语句的写法有关</div>
+     * 如:  "select o from table o" 返回 json数组
+     *<pre><code class='language-js'>[
+     {
+        "id" : "id1",
+        "title" : "title1"
+    },
+     {
+        "id" : "id2",
+        "title" : "title2"
+    },
+     ...
+     *]
+     * </pre></code>
+     * 如:"select id, title from table o" 返回 二维数组:
+     *<pre><code class='language-js'>[
+     ["id1", "title1"],
+     ["id2", "title2"],
+     ...
+     *]
+     *</pre></code>
+     * @example
+     * var data = this.queryStatement.getPageData();
+     */
+
+    /**
+     * 跳转到指定的页面。
+     * @method toPage
+     * @memberOf module:queryStatement
+     * @static
+     * @param {Number} pageNumber - 需要跳转的页码。
+     * @param {Function} [callback ] - 跳转的页面数据加载完成以后的回调方法。
+     * @example
+     * var data = this.queryStatement.toPage( pageNumber, callback );
+     * @example
+     * // 跳转到第2页并且获取该页的数据。
+     * this.queryStatement.toPage( 2, function(){
+     *      var data = this.queryStatement.getPageData();
+     * }.bind(this) )
+     */
+
+    /**
+     * 当查询视图设置了允许多选的时候,可以通过这个方法全部选中当前页面的条目。
+     * @method selectAll
+     * @memberOf module:queryStatement
+     * @static
+     * @example
+     * this.queryStatement.selectAll();
+     */
+
+    /**
+     * 当查询视图设置了允许多选的时候,可以通过这个方法取消选中的条目。
+     * @method unSelectAll
+     * @memberOf module:queryStatement
+     * @static
+     * @example
+     * this.queryStatement.unSelectAll();
+     */
+
+    /**
+     * 获取选中的条目的数据。
+     * @method getSelectedData
+     * @memberOf module:queryStatement
+     * @static
+     * @return {Object[]} 选中的条目的数据。
+     * <div>数据格式和 jpql 语句的写法有关</div>
+     * 如:  "select o from table o" 返回 json数组
+     *<pre><code class='language-js'>[
+     {
+        "id" : "id1",
+        "title" : "title1"
+    },
+     {
+        "id" : "id2",
+        "title" : "title2"
+    },
+     ...
+     *]
+     * </pre></code>
+     * 如:"select id, title from table o" 返回 二维数组:
+     *<pre><code class='language-js'>[
+     ["id1", "title1"],
+     ["id2", "title2"],
+     ...
+     *]
+     *</pre></code>
+     * @example
+     * var data = this.queryStatement.getSelectedData();
+     */
+
+    /**获取queryView对应的DOM对象。
+     * @method node
+     * @static
+     * @methodOf module:queryStatement
+     * @see module:form.node
+     */
+
+
+    /**
+     * queryView对象可在视图中可用。它的很多方法与form类似。<b>(仅前端脚本可用)</b><br/>
+     * @module queryView
+     * @example
+     * //您可以在视图中,通过this来获取queryView对象,如下:
+     * var queryView = this.queryView;
+     */
     this.page = this.form = this.queryView = this.queryStatement = {
+        /**
+         * 当视图被嵌入到门户页面、流程表单或内容管理表单的时候,可以通过这个方法来获取页面或表单的上下文。
+         * @method getParentEnvironment
+         * @static
+         * @return {MWF.xScript.Environment|MWF.xScript.CMSEnvironment} 页面或表单的上下文.
+         * @example
+         * this.queryView.getParentEnvironment();
+         * @example
+         * var env = this.queryView.getParentEnvironment(); //当视图被嵌入到页面的时候,可以在视图里获取页面的上下文
+         * env.page.toPortal( "公文门户" ); //调用page的toPage() 跳转到其他门户
+         */
         "getParentEnvironment" : function () { return _form.getParentEnvironment(); }, //视图嵌入的表单或页面的上下文
+
+        /**
+         * 获取查询的配置信息。
+         * @method getStatementInfor
+         * @memberOf module:queryStatement
+         * @static
+         * @return {StatementInfor} 查询的配置信息.
+         * @example
+         * this.queryStatement.getStatementInfor();
+         */
         "getStatementInfor" : function () { return _form.getStatementInfor ? _form.getStatementInfor() : null; },
+
+        /**
+         * 获取查询的配置信息。
+         * @method getViewInfor
+         * @memberOf module:queryView
+         * @static
+         * @return {ViewInfor} 视图的配置信息.
+         * @example
+         * this.queryView.getViewInfor();
+         */
         "getViewInfor" : function () { return _form.getViewInfor(); },
+
+        /**
+         * 获取视图或查询视图当前页的基本信息。
+         * @method getPageInfor
+         * @memberOf module:queryView
+         * @static
+         * @return {Object} 当前页的信息,格式如下:
+         *<pre><code class='language-js'>{
+         *     "pages": 3, //总页数
+         *     "perPageCount": 50, //每页的条数
+         *     "currentPageNumber": 1 // 当前页数
+         * }
+         * </pre></code>
+         * @example
+         * //视图中的用法
+         * this.queryView.getPageInfor();
+         *
+         * //查询视图中的用法
+         * this.queryStatement.getPageInfor();
+         */
         "getPageInfor" : function () { return _form.getPageInfor(); },
+
+        /**
+         * 获取当前页的数据。
+         * @method getPageData
+         * @memberOf module:queryView
+         * @static
+         * @return {Object[]} 当前页数据。
+         * <div>没有分类时候,数据格式如下:</div>
+         *<pre><code class='language-js'>[
+         *   {
+         *       "bundle": "099ed3c9-dfbc-4094-a8b7-5bfd6c5f7070", //cms 的 documentId, process 的 jobId
+         *      "data": {  //视图中配置的数据
+         *        "title": "考勤管理-配置-统计周期设置", //列名称及列值
+         *        "time": "2018-08-25 11:29:45"
+         *      }
+         *    },
+         *   ...
+         *]
+         * </pre></code>
+         * 有分类的时候,数据格式如下:
+         *<pre><code class='language-js'>[
+         *  {
+         *   "group": "工作日志",  //分类1
+         *   "list": [  //分类下的数据
+         *     {
+         *       "bundle": "001257be-725a-43cf-9679-3892bbab696a", //cms 的 documentId, process 的 jobId
+         *       "data": { //视图中配置的数据
+         *         "title": "标题",  //列名称及列值
+         *         "time": "2018-07-31 15:39:13",
+         *         "category": "工作日志"
+         *       }
+         *     },
+         *     ...
+         *   ]
+         *  },
+         *  ...
+         *]
+         *</pre></code>
+         * @example
+         * var data = this.queryView.getPageData();
+         */
         "getPageData" : function () { return _form.getPageData(); },
+
+        /**
+         * 跳转到指定的页面。
+         * @method toPage
+         * @memberOf module:queryView
+         * @static
+         * @param {Number} pageNumber - 需要跳转的页码。
+         * @param {Function} [callback ] - 跳转的页面数据加载完成以后的回调方法。
+         * @example
+         * var data = this.queryView.toPage( pageNumber, callback );
+         * @example
+         * // 跳转到第2页并且获取该页的数据。
+         * this.queryView.toPage( 2, function(){
+         *      var data = this.queryView.getPageData();
+         * }.bind(this) )
+         */
         "toPage" : function ( pageNumber, callback ) { return _form.toPage(pageNumber, callback); },
+
+        /**
+         * 当视图设置了允许多选的时候,可以通过这个方法全部选中当前页面的条目。
+         * @method selectAll
+         * @memberOf module:queryView
+         * @static
+         * @example
+         * this.queryView.selectAll();
+         */
         "selectAll" : function () { return _form.selectAll(); },
+
+        /**
+         * 当视图设置了允许多选的时候,可以通过这个方法取消选中的条目。
+         * @method unSelectAll
+         * @memberOf module:queryView
+         * @static
+         * @example
+         * this.queryView.unSelectAll();
+         */
         "unSelectAll" : function () { return _form.unSelectAll(); },
+
+        /**
+         * 获取选中的条目的数据。
+         * @method getSelectedData
+         * @memberOf module:queryView
+         * @static
+         * @return {Object[]} 选中的条目的数据。
+         * <div>格式如下:</div>
+         * <pre><code class='language-js'>
+         * [
+            {
+            "bundle": "099ed3c9-dfbc-4094-a8b7-5bfd6c5f7070", //cms 的 documentId, process 的 jobId
+            "data": {  //视图中配置的数据
+              "title": "考勤管理-配置-统计周期设置", //列名称及列值
+              "time": "2018-08-25 11:29:45"
+            }
+          },
+         ...
+         * ]
+         </pre></code>
+         * @example
+         * var data = this.queryView.getSelectedData();
+         */
         "getSelectedData" : function () { return _form.getSelectedData(); },
+
+        /**
+         * 设置视图的过滤条件,该方法不能修改视图中默认的过滤条件(在开发视图的时候添加的过滤条件),而是在这上面新增。
+         * @method setFilter
+         * @memberOf module:queryView
+         * @static
+         * @param {(ViewFilter[]|ViewFilter|Null)} [filter] 过滤条件。<br/>
+         * 当不传参数、参数为null或为空数组的情况下,表示清空非视图默认的过滤条件。<br/>
+         * 如果传入对象或者非空数组的时候,参数如下:
+         * <pre><code class='language-js'>[
+         *    {
+         *       "logic":"and",
+         *       "path":"$work.title",
+         *       "comparison":"like",
+         *       "value":"7月",
+         *       "formatType":"textValue"
+         *   }
+         *]
+         * </pre></code>
+         * @param {Function} [callback] 过滤完成并重新加载数据后的回调方法。
+         * @example
+         * var filter = [
+         *    {
+         *       "logic":"and",
+         *       "path":"$work.title",
+         *       "comparison":"like",
+         *       "value":"7月",
+         *       "formatType":"textValue"
+         *   }
+         *];
+         * this.queryView.setFilter( filter );
+         */
         "setFilter" : function ( filter, callback ) { return _form.setFilter(filter, callback); },
+
         "setStatementFilter" : function ( filter , parameter, callback) { return _form.setFilter(filter, parameter, callback); },
+
+        /**
+         * 把当前视图切换成另外一个视图。
+         * @method switchView
+         * @memberOf module:queryView
+         * @static
+         * @param {Object} options 需要跳转的参数配置。参数说明如下:
+         * <div>下列说明的filter属性参考<a href='global.html#ViewFilter'>ViewFilter</a></div>
+         * <pre><code class='language-js'>{
+         *     "application": application, //必选,视图的所在应用id
+         *     "viewName": viewName, //必选,视图的名称
+         *     "filter": [
+         *         {
+         *            "logic":"and",
+         *             "path":"$work.title",
+         *             "comparison":"like",
+         *             "value":"7月",
+         *             "formatType":"textValue"
+         *         }
+         *     ], //可选,增加视图的过滤条件(ViewFilter),如果不传,则使用原视图的配置;如果需要去掉原视图的配置,则传入空数组 []
+         *     "isTitle": "yes", //可选,是否显示t视图的标题行,可选值有:yes no
+         *     "select": "none", //可选,是否允许新视图选择,如果不传,则使用原视图的配置, 可选值有: 不允许选择 none, 单选 single,多选 multi
+         *     "titleStyles": {
+         *       "color" : "red",
+         *       "font-size" : "14px"
+         *     }, //可选,标题行样式,如果不传,则使用原视图的配置
+         *     "itemStyles": {
+         *       "color" : "#333",
+         *       "font-size" : "12px"
+         *     }, //可选,内容行样式,如果不传,则使用原视图的配置
+         *     "isExpand": "no", //可选,默认是否展开分类,如果不传,则使用原视图的配置, 可选值有:yes no
+         *   }
+         * </pre></code>
+         * @example
+         * this.queryView.switchView( options );
+         */
         "switchView" : function ( options ) { return _form.switchView(options); },
+
         "switchStatement" : function ( options ) { if(_form.switchStatement)_form.switchStatement(options) ; },
+
+        /**
+         * 重新加载视图。
+         * @method reload
+         * @methodOf module:queryView
+         * @static
+         * @example
+         * this.queryView.reload();
+         */
         "reload" : function () { _form.reload(); },
 
         // "getInfor": function () { return ev.pageInfor; },
         // "infor": ev.pageInfor,
         // "getApp": function () { return _form.app; },
         // "app": _form.app,
+
+        /**获取queryView对应的DOM对象。
+         * @method node
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.node
+         */
         "node": function () { return _form.node; },
+
         // "get": function (name) { return (_form.all) ? _form.all[name] : null; },
         // "getWidgetModule": function (widget, moduleName) {
         //     if (!_form.widgetModules || !_form.widgetModules[widget]) return null;
@@ -1346,6 +1827,12 @@ MWF.xScript.ViewEnvironment = function (ev) {
         //     _form.printWork(application, form);
         // },
 
+        /**弹出一个确认框。
+         * @method confirm
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.confirm
+         */
         "confirm": function (type, title, text, width, height, ok, cancel, callback, mask, style) {
             // var p = MWF.getCenter({"x": width, "y": height});
             // e = {"event": {"clientX": p.x,"x": p.x,"clientY": p.y,"y": p.y}};
@@ -1368,13 +1855,35 @@ MWF.xScript.ViewEnvironment = function (ev) {
                 _form.confirm(type, e, title, text, width, height, ok, cancel, callback, mask, style);
             }
         },
+
+        /**显示一个带关闭按钮的信息框。
+         * @method alert
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.alert
+         */
         "alert": function(type, title, text, width, height){
             _form.alert(type, title, text, width, height);
         },
+
+        /**显示一个信息框。
+         * @method notice
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.notice
+         */
         "notice": function (content, type, target, where, offset, option) {
             _form.notice(content, type, target, where, offset, option);
         },
+
+        /** 给视图添加事件。
+         * @method addEvent
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.addEvent
+         */
         "addEvent": function (e, f) { _form.addEvent(e, f); },
+
         // "openWindow": function (form, app) {
         //     _form.openWindow(form, app);
         // },
@@ -1384,6 +1893,13 @@ MWF.xScript.ViewEnvironment = function (ev) {
         // "toPortal": function (portal, page, par) {
         //     _form.app.toPortal(portal, page, par);
         // },
+
+        /**打开一个在流转或已完成的流程实例。
+         * @method openWork
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.openWork
+         */
         "openWork": function (id, completedId, title, options) {
             var op = options || {};
             op.workId = id;
@@ -1392,6 +1908,13 @@ MWF.xScript.ViewEnvironment = function (ev) {
             op.appId = "process.Work" + (op.workId || op.workCompletedId);
             return layout.desktop.openApplication(this.event, "process.Work", op);
         },
+
+        /**根据流程的jobId打开工作。
+         * @method openJob
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.openJob
+         */
         "openJob": function (id, choice, options) {
             var workData = null;
             o2.Actions.get("x_processplatform_assemble_surface").listWorkByJob(id, function (json) {
@@ -1484,12 +2007,26 @@ MWF.xScript.ViewEnvironment = function (ev) {
                 }
             }
         },
+
+        /**打开一个内容管理文档。
+         * @method openDocument
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.openDocument
+         */
         "openDocument": function (id, title, options) {
             var op = options || {};
             op.documentId = id;
             op.docTitle = title || "";
             layout.desktop.openApplication(this.event, "cms.Document", op);
         },
+
+        /**打开一个门户页面。
+         * @method openPortal
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.openPortal
+         */
         "openPortal": function (name, page, par) {
             var action = MWF.Actions.get("x_portal_assemble_surface");
             action.getApplication(name, function (json) {
@@ -1515,6 +2052,13 @@ MWF.xScript.ViewEnvironment = function (ev) {
 
             });
         },
+
+        /**打开一个内容管理栏目。
+         * @method openCMS
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.openCMS
+         */
         "openCMS": function (name) {
             var action = MWF.Actions.get("x_cms_assemble_control");
             action.getColumn(name, function (json) {
@@ -1526,6 +2070,13 @@ MWF.xScript.ViewEnvironment = function (ev) {
                 }
             });
         },
+
+        /**打开一个流程应用。
+         * @method openProcess
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.openProcess
+         */
         "openProcess": function (name) {
             var action = MWF.Actions.get("x_processplatform_assemble_surface");
             action.getApplication(name, function (json) {
@@ -1537,9 +2088,23 @@ MWF.xScript.ViewEnvironment = function (ev) {
                 }
             });
         },
+
+        /**打开一个任意一个component应用。
+         * @method openApplication
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.openApplication
+         */
         "openApplication": function (name, options) {
             layout.desktop.openApplication(null, name, options);
         },
+
+        /**创建一个内容管理文档。
+         * @method createDocument
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.createDocument
+         */
         "createDocument": function (columnOrOptions, category, data, identity, callback, target, latest, selectColumnEnable, ignoreTitle) {
             var column = columnOrOptions;
             var onAfterPublish, onPostPublish;
@@ -1588,6 +2153,13 @@ MWF.xScript.ViewEnvironment = function (ev) {
                 starter.load();
             })
         },
+
+        /** 启动一个流程实例。
+         * @method startProcess
+         * @static
+         * @methodOf module:queryView
+         * @see module:form.startProcess
+         */
         "startProcess": function (app, process, data, identity, callback, target, latest) {
 
             if (arguments.length > 2) {

+ 1 - 3
o2web/source/x_component_Selector/Identity.js

@@ -932,17 +932,15 @@ MWF.xApplication.Selector.Identity.ItemCategory = new Class({
                 }else{
                     var display = this.children.getStyle("display");
                     if (display === "none"){
-                        this.selector.fireEvent("expand", [this] );
                         this.children.setStyles({"display": "block", "height": "auto"});
                         this.actionNode.setStyles(this.selector.css.selectorItemCategoryActionNode_expand);
                         this.isExpand = true;
                         this.selector.fireEvent("expand", [this] );
                     }else{
-                        this.selector.fireEvent("collapse", [this] );
                         this.children.setStyles({"display": "none", "height": "0px"});
                         this.actionNode.setStyles(this.selector.css.selectorItemCategoryActionNode_collapse);
                         this.isExpand = false;
-                        this.selector.fireEvent("expand", [this] );
+                        this.selector.fireEvent("collapse", [this] );
                     }
                 }
                 if(callback)callback();

+ 3 - 3
o2web/source/x_component_process_Xform/Attachment.js

@@ -1036,8 +1036,8 @@ MWF.xApplication.process.Xform.AttachmentController = new Class({
 
 });
 /**
- * 附件数据结构.
- * @typedef {Object} AttachmentData
+ * 流程实例的附件数据结构.
+ * @typedef {Object} WorkAttachmentData
  * @property {String} id - 附件id.
  * @property {String} name - 附件标题.
  * @property {String} person - 上传人.
@@ -1720,7 +1720,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class(
     },
     /**
      * @summary 为组件重新设置附件,该附件必须已经上传。
-     *  @param data{AttachmentData} .
+     *  @param data{WorkAttachmentData} .
      */
     setData: function(data){
         this.attachmentController.clear();

+ 2 - 1
o2web/source/x_component_process_Xform/Form.js

@@ -5,7 +5,7 @@ MWF.xApplication.process.Xform = MWF.xApplication.process.Xform || {};
 MWF.xDesktop.requireApp("process.Xform", "lp." + MWF.language, null, false);
 //MWF.xDesktop.requireApp("process.Xform", "Package", null, false);
 
-/** @class Form 表单。
+/** @class Form 流程表单。
  * @category FormComponents
  * @example
  * //可以在脚本中获取表单
@@ -13,6 +13,7 @@ MWF.xDesktop.requireApp("process.Xform", "lp." + MWF.language, null, false);
  * var form = this.form.getApp().appForm; //获取表单
  * //方法2
  * var form = this.target; //在表单本身的事件脚本中获取
+ * @hideconstructor
  */
 MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class(
     /** @lends MWF.xApplication.process.Xform.Form# */

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff