|
@@ -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 = MWF.xScript || {};
|
|
|
MWF.xScript.ViewEnvironment = function (ev) {
|
|
MWF.xScript.ViewEnvironment = function (ev) {
|
|
|
var _form = ev.view;
|
|
var _form = ev.view;
|
|
@@ -1308,27 +1391,425 @@ MWF.xScript.ViewEnvironment = function (ev) {
|
|
|
|
|
|
|
|
//仅前台对象-----------------------------------------
|
|
//仅前台对象-----------------------------------------
|
|
|
//form
|
|
//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 = {
|
|
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(); }, //视图嵌入的表单或页面的上下文
|
|
"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; },
|
|
"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(); },
|
|
"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(); },
|
|
"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(); },
|
|
"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); },
|
|
"toPage" : function ( pageNumber, callback ) { return _form.toPage(pageNumber, callback); },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 当视图设置了允许多选的时候,可以通过这个方法全部选中当前页面的条目。
|
|
|
|
|
+ * @method selectAll
|
|
|
|
|
+ * @memberOf module:queryView
|
|
|
|
|
+ * @static
|
|
|
|
|
+ * @example
|
|
|
|
|
+ * this.queryView.selectAll();
|
|
|
|
|
+ */
|
|
|
"selectAll" : function () { return _form.selectAll(); },
|
|
"selectAll" : function () { return _form.selectAll(); },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 当视图设置了允许多选的时候,可以通过这个方法取消选中的条目。
|
|
|
|
|
+ * @method unSelectAll
|
|
|
|
|
+ * @memberOf module:queryView
|
|
|
|
|
+ * @static
|
|
|
|
|
+ * @example
|
|
|
|
|
+ * this.queryView.unSelectAll();
|
|
|
|
|
+ */
|
|
|
"unSelectAll" : function () { return _form.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(); },
|
|
"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); },
|
|
"setFilter" : function ( filter, callback ) { return _form.setFilter(filter, callback); },
|
|
|
|
|
+
|
|
|
"setStatementFilter" : function ( filter , parameter, callback) { return _form.setFilter(filter, parameter, 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); },
|
|
"switchView" : function ( options ) { return _form.switchView(options); },
|
|
|
|
|
+
|
|
|
"switchStatement" : function ( options ) { if(_form.switchStatement)_form.switchStatement(options) ; },
|
|
"switchStatement" : function ( options ) { if(_form.switchStatement)_form.switchStatement(options) ; },
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 重新加载视图。
|
|
|
|
|
+ * @method reload
|
|
|
|
|
+ * @methodOf module:queryView
|
|
|
|
|
+ * @static
|
|
|
|
|
+ * @example
|
|
|
|
|
+ * this.queryView.reload();
|
|
|
|
|
+ */
|
|
|
"reload" : function () { _form.reload(); },
|
|
"reload" : function () { _form.reload(); },
|
|
|
|
|
|
|
|
// "getInfor": function () { return ev.pageInfor; },
|
|
// "getInfor": function () { return ev.pageInfor; },
|
|
|
// "infor": ev.pageInfor,
|
|
// "infor": ev.pageInfor,
|
|
|
// "getApp": function () { return _form.app; },
|
|
// "getApp": function () { return _form.app; },
|
|
|
// "app": _form.app,
|
|
// "app": _form.app,
|
|
|
|
|
+
|
|
|
|
|
+ /**获取queryView对应的DOM对象。
|
|
|
|
|
+ * @method node
|
|
|
|
|
+ * @static
|
|
|
|
|
+ * @methodOf module:queryView
|
|
|
|
|
+ * @see module:form.node
|
|
|
|
|
+ */
|
|
|
"node": function () { return _form.node; },
|
|
"node": function () { return _form.node; },
|
|
|
|
|
+
|
|
|
// "get": function (name) { return (_form.all) ? _form.all[name] : null; },
|
|
// "get": function (name) { return (_form.all) ? _form.all[name] : null; },
|
|
|
// "getWidgetModule": function (widget, moduleName) {
|
|
// "getWidgetModule": function (widget, moduleName) {
|
|
|
// if (!_form.widgetModules || !_form.widgetModules[widget]) return null;
|
|
// if (!_form.widgetModules || !_form.widgetModules[widget]) return null;
|
|
@@ -1346,6 +1827,12 @@ MWF.xScript.ViewEnvironment = function (ev) {
|
|
|
// _form.printWork(application, form);
|
|
// _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) {
|
|
"confirm": function (type, title, text, width, height, ok, cancel, callback, mask, style) {
|
|
|
// var p = MWF.getCenter({"x": width, "y": height});
|
|
// var p = MWF.getCenter({"x": width, "y": height});
|
|
|
// e = {"event": {"clientX": p.x,"x": p.x,"clientY": p.y,"y": p.y}};
|
|
// 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);
|
|
_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){
|
|
"alert": function(type, title, text, width, height){
|
|
|
_form.alert(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) {
|
|
"notice": function (content, type, target, where, offset, option) {
|
|
|
_form.notice(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); },
|
|
"addEvent": function (e, f) { _form.addEvent(e, f); },
|
|
|
|
|
+
|
|
|
// "openWindow": function (form, app) {
|
|
// "openWindow": function (form, app) {
|
|
|
// _form.openWindow(form, app);
|
|
// _form.openWindow(form, app);
|
|
|
// },
|
|
// },
|
|
@@ -1384,6 +1893,13 @@ MWF.xScript.ViewEnvironment = function (ev) {
|
|
|
// "toPortal": function (portal, page, par) {
|
|
// "toPortal": function (portal, page, par) {
|
|
|
// _form.app.toPortal(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) {
|
|
"openWork": function (id, completedId, title, options) {
|
|
|
var op = options || {};
|
|
var op = options || {};
|
|
|
op.workId = id;
|
|
op.workId = id;
|
|
@@ -1392,6 +1908,13 @@ MWF.xScript.ViewEnvironment = function (ev) {
|
|
|
op.appId = "process.Work" + (op.workId || op.workCompletedId);
|
|
op.appId = "process.Work" + (op.workId || op.workCompletedId);
|
|
|
return layout.desktop.openApplication(this.event, "process.Work", op);
|
|
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) {
|
|
"openJob": function (id, choice, options) {
|
|
|
var workData = null;
|
|
var workData = null;
|
|
|
o2.Actions.get("x_processplatform_assemble_surface").listWorkByJob(id, function (json) {
|
|
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) {
|
|
"openDocument": function (id, title, options) {
|
|
|
var op = options || {};
|
|
var op = options || {};
|
|
|
op.documentId = id;
|
|
op.documentId = id;
|
|
|
op.docTitle = title || "";
|
|
op.docTitle = title || "";
|
|
|
layout.desktop.openApplication(this.event, "cms.Document", op);
|
|
layout.desktop.openApplication(this.event, "cms.Document", op);
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ /**打开一个门户页面。
|
|
|
|
|
+ * @method openPortal
|
|
|
|
|
+ * @static
|
|
|
|
|
+ * @methodOf module:queryView
|
|
|
|
|
+ * @see module:form.openPortal
|
|
|
|
|
+ */
|
|
|
"openPortal": function (name, page, par) {
|
|
"openPortal": function (name, page, par) {
|
|
|
var action = MWF.Actions.get("x_portal_assemble_surface");
|
|
var action = MWF.Actions.get("x_portal_assemble_surface");
|
|
|
action.getApplication(name, function (json) {
|
|
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) {
|
|
"openCMS": function (name) {
|
|
|
var action = MWF.Actions.get("x_cms_assemble_control");
|
|
var action = MWF.Actions.get("x_cms_assemble_control");
|
|
|
action.getColumn(name, function (json) {
|
|
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) {
|
|
"openProcess": function (name) {
|
|
|
var action = MWF.Actions.get("x_processplatform_assemble_surface");
|
|
var action = MWF.Actions.get("x_processplatform_assemble_surface");
|
|
|
action.getApplication(name, function (json) {
|
|
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) {
|
|
"openApplication": function (name, options) {
|
|
|
layout.desktop.openApplication(null, 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) {
|
|
"createDocument": function (columnOrOptions, category, data, identity, callback, target, latest, selectColumnEnable, ignoreTitle) {
|
|
|
var column = columnOrOptions;
|
|
var column = columnOrOptions;
|
|
|
var onAfterPublish, onPostPublish;
|
|
var onAfterPublish, onPostPublish;
|
|
@@ -1588,6 +2153,13 @@ MWF.xScript.ViewEnvironment = function (ev) {
|
|
|
starter.load();
|
|
starter.load();
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
|
|
+ /** 启动一个流程实例。
|
|
|
|
|
+ * @method startProcess
|
|
|
|
|
+ * @static
|
|
|
|
|
+ * @methodOf module:queryView
|
|
|
|
|
+ * @see module:form.startProcess
|
|
|
|
|
+ */
|
|
|
"startProcess": function (app, process, data, identity, callback, target, latest) {
|
|
"startProcess": function (app, process, data, identity, callback, target, latest) {
|
|
|
|
|
|
|
|
if (arguments.length > 2) {
|
|
if (arguments.length > 2) {
|