提交 bcbd599c 编写于 作者: U unknown

jsdoc

上级 f21654e2
......@@ -16,7 +16,7 @@
]
},
"source": {
"include": ["./o2web/source/x_component_process_Xform","./o2web/source/x_component_cms_Xform"],
"include": ["./o2web/source/x_component_process_Xform","./o2web/source/o2_core/o2/xScript"],
"includePattern": ".+\\.js(doc|x)?$",
"excludePattern": "(^|\\/|\\\\)_"
},
......
......@@ -44,7 +44,22 @@ MWF.xScript.Environment = function(ev){
//workContext
/**
* 你可以通过workContext获取和流程相关的流程实例对象数据。
* @namespace
* @module workContext
* @example
* //您可以在表单或流程的各个嵌入脚本中,通过this来获取当前流程实例数据,如下:
* var context = this.workContext;
*/
this.workContext = {
/**
* 当前流程实例正在流转中,并且当前用户有待办,则返回当前用户的待办对象,否则返回null。
* @summary 获取当前流程与当前用户相关的待办对象:task对象。
* @method getTask
* @static
* @return {string} The blended color.
*/
"getTask": function(){return ev.task || null;},
"getWork": function(){return ev.work || ev.workCompleted;},
"getActivity": function(){return ev.activity || null;},
......@@ -238,9 +253,20 @@ MWF.xScript.Environment = function(ev){
return [(t==="object") ? (name.distinguishedName || name.id || name.unique || name.name) : name];
}
};
/**
* 你可以通过workContext获取和流程相关的流程实例对象数据。
* @module this.org
* @example
* //您可以在表单或流程的各个嵌入脚本中,通过this来获取当前流程实例数据,如下:
* var context = this.workContext;
*/
this.org = {
//群组***************
//获取群组--返回群组的对象数组
/**
根据群组标识获取对应的群组对象数组:group对象数组
*/
getGroup: function(name, async){
getOrgActions();
var data = {"groupList": getNameFlag(name)};
......
......@@ -592,7 +592,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class(
},
/**
* @summary 根据组件的校验设置进行校验。
* @param {String} routeName - 可选,路由名称.
* @param {String} [routeName] - 可选,路由名称.
* @example
* if( !this.form.get('fieldName').validation() ){
* return false;
......
......@@ -8,6 +8,28 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module = new Class(
{
Implements: [Events],
options: {
// /**
// * 组件加载前事件。<br/>
// * 平台执行queryLoad事件的时候,组件还没有开始加载,这个时候可以根据条件修改组件的配置信息
// * @event MWF.xApplication.process.Xform.$Module#queryLoad
// * @example
// * var field = this.form.get("fieldName");
// * field.addEvent("queryLoad", function(){
// *
// * };
// */
// /**
// * Event reporting that a snowball has been hurled.
// *
// * @event MWF.xApplication.process.Xform.$Module#load
// * @property {number} velocity - The snowball's velocity, in meters per second.
// */
// /**
// * Event reporting that a snowball has been hurled.
// *
// * @event MWF.xApplication.process.Xform.$Module#postLoad
// * @property {number} velocity - The snowball's velocity, in meters per second.
// */
"moduleEvents": ["load", "queryLoad", "postLoad"]
},
initialize: function(node, json, form, options){
......@@ -19,7 +41,6 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module = new Class(
* //可以在脚本中获取该组件
* var field = this.form.get("fieldName"); //获取组件对象
* field.node.setStyle("font-size","12px"); //给节点设置样式
* @extends MWF.xApplication.process.Xform.$Input
*/
this.node = $(node);
this.node.store("module", this);
......@@ -75,7 +96,6 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module = new Class(
if (this.iconNode) this.iconNode.setStyle("display", "block");
},
load: function(){
this._loadModuleEvents();
if (this.fireEvent("queryLoad")){
this._queryLoaded();
......
......@@ -1803,7 +1803,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class(
},
/**
* @summary 根据组件的校验设置进行校验。
* @param {String} routeName - 可选,路由名称.
* @param {String} [routeName] - 可选,路由名称.
* @example
* if( !this.form.get('fieldName').validation() ){
* return false;
......
......@@ -1728,7 +1728,7 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class(
},
/**
* @summary 根据组件的校验设置进行校验。
* @param {String} routeName - 可选,路由名称.
* @param {String} [routeName] - 可选,路由名称.
* @example
* if( !this.form.get('fieldName').validation() ){
* return false;
......
......@@ -1501,7 +1501,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
},
/**
* @summary 根据组件的校验设置进行校验。
* @param {String} routeName - 可选,路由名称.
* @param {String} [routeName] - 可选,路由名称.
* @example
* if( !this.form.get('fieldName').validation() ){
* return false;
......
......@@ -54,8 +54,10 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
this.active();
}
},
/**激活板式文件编辑
* 设置了延迟加载的时候,可以通过这个方法来激活
/**
* 激活公文编辑器编辑。设置了延迟加载的时候,可以通过这个方法来激活
* @example
* this.form.get("fieldName").active();
*/
active: function(){
this._loadModuleEvents();
......@@ -1703,6 +1705,11 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
this.scaleTo(v);
}.bind(this));
},
/**缩放文件内容
* @param scale{Number} 缩放的比率
* @example
* this.form.get("fieldName").scaleTo(0.5);
*/
scaleTo: function(scale){
this._returnScale();
this.scale = scale;
......@@ -2498,7 +2505,10 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
var data = this._getBusinessData();
},
/**重新计算板式文件的所有字段,当字段是脚本时可以使用该方法立即更新
/**重新计算公文编辑器的所有字段,当字段是脚本时可以使用该方法立即更新
* @summary 重新计算公文编辑器的所有字段
* @example
* this.form.get("fieldName").reload();
*/
reload: function(){
this.resetData();
......@@ -2522,12 +2532,24 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
this._repage();
}.bind(this));
},
/**
* @summary 判断公文编辑器的正文内容是否已经填写
* @return {Boolean} 是否为空
* @example
* if( this.form.get("fieldName").isEmpty() ){
* this.form.notice('请填写正文内容')
* }
*/
isEmpty: function(){
var data = this.getData();
if( typeOf(data) !== "object" )return true;
return !data.filetext || data.filetext===this.json.defaultValue.filetext;
},
/*获取板式文件数据,返回Object
/*
* 获取公文编辑器数据
* @return {Object} 公文编辑器的数据
* @example
* var data = this.form.get("fieldName").getData();
*/
getData: function(){
//if (this.editMode){
......@@ -2612,7 +2634,12 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
tmpdiv.destroy();
}
},
/**设置
/**设置公文编辑器数据
* @param data{Object}
* @example
* var data = this.form.get("fieldName").getData();
* data.filetext = "测试内容";
* this.form.get("fieldName").getData(data);
*/
setData: function(data, diffFiletext){
if (data){
......@@ -2888,7 +2915,15 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
}
return true;
},
/**
* @summary 根据组件的校验设置进行校验。
* @param {String} [routeName] - 可选,路由名称.
* @example
* if( !this.form.get('fieldName').validation() ){
* return false;
* }
* @return {Boolean} 是否通过校验
*/
validation: function(routeName, opinion){
if (!this.validationConfig(routeName, opinion)) return false;
......@@ -2920,7 +2955,10 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
}
return node;
},
/*将板式文件内容以html形式输出
/**将公文编辑器内容以html形式输出
* @return {String}
* @example
* var html = this.form.get("fieldName").getDocumentHtml();
*/
getDocumentHtml: function(){
var tmpNode = this.contentNode.getFirst().getFirst().clone(true);
......@@ -2946,8 +2984,15 @@ MWF.xApplication.process.Xform.Documenteditor = MWF.APPDocumenteditor = new Cla
tmpNode.destroy();
return "<html xmlns:v=\"urn:schemas-microsoft-com:vml\"><head><meta charset=\"UTF-8\" /></head><body>"+htmlStr+"</body></html>";
},
/*将板式文件转换成附件,转换的文件名和格式等信息与配置有关
* */
/**
* @summary 将公文编辑器转换成附件,转换的文件名和格式等信息与配置有关
* @param {Function} [callback] 转换后的回调方法,参数是附件数据.
* @param {string} [name] - 如果为空或者不传,转换的文件名和格式等信息与配置有关.
* @example
* this.form.get("fieldName").toWord( function(attachmentData){
* //attachmentData 转换后的附件数据
* })
*/
toWord: function(callback, name){
var docNmae = name || "";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册