提交 759eceb2 编写于 作者: 蔡祥熠

Merge branch 'wrdp' into 'develop'

Wrdp

See merge request o2oa/o2oa!2529
...@@ -90,7 +90,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class( ...@@ -90,7 +90,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class(
} }
/** /**
* 描述信息节点,select\radio\checkbox无此节点,只读情况下无此节点. * @summary 描述信息节点,允许用户手工输入的组件才有此节点,只读情况下无此节点.
* @member {Element} * @member {Element}
*/ */
this.descriptionNode = new Element("div", {"styles": this.form.css.descriptionNode, "text": this.json.description}).inject(this.node); this.descriptionNode = new Element("div", {"styles": this.form.css.descriptionNode, "text": this.json.description}).inject(this.node);
...@@ -284,12 +284,22 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class( ...@@ -284,12 +284,22 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class(
return !data || !data.trim(); return !data || !data.trim();
}, },
/** /**
* 该方法和 this.data.{fieldName} 在绝大部分的时候效果一样。区别如下: * 该方法和 this.data.{fieldName} 在绝大部分的时候效果一样。区别如下:<br/>
* 当使用异步函数生成器(Promise)为组件赋值的时候,getData立即获取数据,可能返回修改前的值,当Promise执行完成以后,会返回修改后的值。 * 当使用异步函数生成器(Promise)为组件赋值的时候,getData立即获取数据,可能返回修改前的值,当Promise执行完成以后,会返回修改后的值。<br/>
* this.data.{fieldName} 立即获取数据,可能获取到异步函数生成器,当Promise执行完成以后,会返回修改后的值。{@link https://www.yuque.com/o2oa/ixsnyt/ws07m0#EggIl|具体差异请查看链接} * this.data.{fieldName} 立即获取数据,可能获取到异步函数生成器,当Promise执行完成以后,会返回修改后的值。<br/>
* {@link https://www.yuque.com/o2oa/ixsnyt/ws07m0#EggIl|具体差异请查看链接}
* @summary 获取组件值。 * @summary 获取组件值。
* @example * @example
* var data = this.form.get('subject').getData(); * var data = this.form.get('subject').getData(); //没有使用promise的情况
* @example
* //使用Promise的情况
* var field = this.form.get("fieldName");
* var dict = new this.Dict("test"); //test为数据字典名称
* var promise = dict.get("tools", true); //异步使用数据字典的get方法时返回Promise,参数true表示异步
* promise.then( function(){
* var data = field.getData(); //此时由于异步请求已经执行完毕,getData方法获取到了数据字典的值
* })
* field.setData( promise );
* @return 组件的数据. * @return 组件的数据.
*/ */
getData: function(when){ getData: function(when){
...@@ -311,9 +321,17 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class( ...@@ -311,9 +321,17 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class(
resetData: function(){ resetData: function(){
this.setData(this.getValue()); this.setData(this.getValue());
}, },
/** /**当参数为Promise的时候,请查看文档: {@link https://www.yuque.com/o2oa/ixsnyt/ws07m0|使用Promise处理表单异步}
* @summary 为控件赋值。 * @summary 为组件赋值。
* @param data{String|Number|JsonObject|Array} . * @param data{String|Promise} .
* @example
* this.form.get("fieldName").setData("test"); //赋文本值
* @example
* //使用Promise
* var field = this.form.get("fieldName");
* var dict = new this.Dict("test"); //test为数据字典名称
* var promise = dict.get("tools", true); //异步使用数据字典的get方法时返回Promise,参数true表示异步
* field.setData( promise );
*/ */
setData: function(data){ setData: function(data){
// if (data && data.isAG){ // if (data && data.isAG){
......
MWF.require("MWF.widget.Common", null, false); MWF.require("MWF.widget.Common", null, false);
/** @classdesc process.$Module 组件类,此类为所有组件的父类。 /** @classdesc process.$Module 组件类,此类为所有组件的父类。
* @class * @class
......
...@@ -1121,7 +1121,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class( ...@@ -1121,7 +1121,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class(
//this.attachmentController = new MWF.widget.ATTER(this.node, this, options); //this.attachmentController = new MWF.widget.ATTER(this.node, this, options);
/** /**
* 附件容器. * @summary 附件容器.
* @member {MWF.xApplication.process.Xform.AttachmentController} * @member {MWF.xApplication.process.Xform.AttachmentController}
* @example * @example
* var attachmentController = this.form.get("fieldName").AttachmentController; //获取附件容器 * var attachmentController = this.form.get("fieldName").AttachmentController; //获取附件容器
...@@ -1176,7 +1176,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class( ...@@ -1176,7 +1176,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class(
} }
}, },
/** /**
* 获取当前组件所有附件的标题.如果没有附件返回null * @summary 获取当前组件所有附件的标题.如果没有附件返回null
* @example * @example
* var getAttachmentNames = this.form.get("name").getData(); * var getAttachmentNames = this.form.get("name").getData();
* @return {StringArray|Null} 附件标题. * @return {StringArray|Null} 附件标题.
...@@ -1659,7 +1659,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class( ...@@ -1659,7 +1659,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class(
return data; return data;
}, },
/** /**
* 为组件重新设置附件,该附件必须已经上传。 * @summary 为组件重新设置附件,该附件必须已经上传。
* @param data{AttachmentData} . * @param data{AttachmentData} .
*/ */
setData: function(data){ setData: function(data){
...@@ -1802,7 +1802,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class( ...@@ -1802,7 +1802,7 @@ MWF.xApplication.process.Xform.Attachment = MWF.APPAttachment = new Class(
return true; return true;
}, },
/** /**
* 根据组件的校验设置进行校验。 * @summary 根据组件的校验设置进行校验。
* @param {String} routeName - 可选,路由名称. * @param {String} routeName - 可选,路由名称.
* @example * @example
* if( !this.form.get('fieldName').validation() ){ * if( !this.form.get('fieldName').validation() ){
......
...@@ -154,7 +154,7 @@ MWF.xApplication.process.Xform.Calendar = MWF.APPCalendar = new Class( ...@@ -154,7 +154,7 @@ MWF.xApplication.process.Xform.Calendar = MWF.APPCalendar = new Class(
}; };
options.baseDate = this.getBaseDate(); options.baseDate = this.getBaseDate();
/** /**
* 日期弹出选择组件,只读情况下无此节点. * @summary 日期弹出选择界面,只读情况下无此成员.
* @member {MWF.widget.Calendar} * @member {MWF.widget.Calendar}
* @example * @example
* var calendar = this.form.get("fieldName").calendar; //获取组件 * var calendar = this.form.get("fieldName").calendar; //获取组件
......
...@@ -98,7 +98,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class( ...@@ -98,7 +98,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
} }
}, },
/** /**
* 重新计算下拉选项,该功能通常用在下拉选项为动态计算的情况. * @summary 重新计算下拉选项,该功能通常用在下拉选项为动态计算的情况.
* @example * @example
* this.form.get('fieldName').resetOption(); * this.form.get('fieldName').resetOption();
*/ */
...@@ -107,7 +107,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class( ...@@ -107,7 +107,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
this.setOptions(); this.setOptions();
}, },
/** /**
* 获取选择项数组. * @summary 获取选择项数组.
* @example * @example
* var array = this.form.get('fieldName').getOptions(); * var array = this.form.get('fieldName').getOptions();
* @return {Array} 选择项数组,如果是脚本返回计算结果. * @return {Array} 选择项数组,如果是脚本返回计算结果.
...@@ -239,7 +239,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class( ...@@ -239,7 +239,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
} }
}, },
/** /**
* 获取选中的值和文本. * @summary 获取选中的值和文本.
* @example * @example
* var array = this.form.get('fieldName').getTextData(); * var array = this.form.get('fieldName').getTextData();
* @return {Object} 返回选中项值和文本,格式为 { 'value' : value, 'text' : text }. * @return {Object} 返回选中项值和文本,格式为 { 'value' : value, 'text' : text }.
...@@ -302,7 +302,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class( ...@@ -302,7 +302,7 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class(
this.setData(this.getValue()); this.setData(this.getValue());
}, },
/** /**
* 为字段赋值,并且使值对应的选项选中。 * @summary 为字段赋值,并且使值对应的选项选中。
* @param data{String} . * @param data{String} .
*/ */
setData: function(data){ setData: function(data){
......
...@@ -1114,7 +1114,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class( ...@@ -1114,7 +1114,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
} }
}, },
/** /**
* 重置组件的值为默认值或置空。 * @summary 重置数据网格的值为默认值或置空。
* @example * @example
* this.form.get('fieldName').resetData(); * this.form.get('fieldName').resetData();
*/ */
...@@ -1122,7 +1122,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class( ...@@ -1122,7 +1122,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
this.setData(this._getValue()); this.setData(this._getValue());
}, },
/** /**
* 为数据网格赋值。 * @summary 为数据网格赋值。
* @param data{Array} - 必选,数组. * @param data{Array} - 必选,数组.
*/ */
setData: function(data){ setData: function(data){
...@@ -1207,7 +1207,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class( ...@@ -1207,7 +1207,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
} }
}, },
/** /**
* 获取总计数据. * @summary 获取总计数据.
* @example * @example
* var totalObject = this.form.get('fieldName').getTotal(); * var totalObject = this.form.get('fieldName').getTotal();
* @return {Object} 总计数据 * @return {Object} 总计数据
...@@ -1217,7 +1217,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class( ...@@ -1217,7 +1217,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
return this.totalResaults; return this.totalResaults;
}, },
/** /**
* 判断数据网格是否为空. * @summary 判断数据网格是否为空.
* @example * @example
* if( this.form.get('fieldName').isEmpty() ){ * if( this.form.get('fieldName').isEmpty() ){
* this.form.notice('至少需要添加一条数据', 'warn'); * this.form.notice('至少需要添加一条数据', 'warn');
...@@ -1234,7 +1234,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class( ...@@ -1234,7 +1234,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
return false; return false;
}, },
/** /**
* 获取数据网格数据. * @summary 获取数据网格数据.
* @example * @example
* var data = this.form.get('fieldName').getData(); * var data = this.form.get('fieldName').getData();
* @return {Object} - 格式如下{ data : [] }. * @return {Object} - 格式如下{ data : [] }.
...@@ -1396,7 +1396,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class( ...@@ -1396,7 +1396,7 @@ MWF.xApplication.process.Xform.DatagridPC = new Class(
return true; return true;
}, },
/** /**
* 根据组件的校验设置进行校验。 * @summary 根据组件的校验设置进行校验。
* @param {String} routeName - 可选,路由名称. * @param {String} routeName - 可选,路由名称.
* @example * @example
* if( !this.form.get('fieldName').validation() ){ * if( !this.form.get('fieldName').validation() ){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册