提交 8f13b995 编写于 作者: 蔡祥熠

Merge branch 'fix/Selector.selector_width' into 'wrdp'

Merge of fix/Selector.selector_width  修复提交选人框可能看不到已选框的问题 to wrdp

See merge request o2oa/o2oa!1852
/.idea/
/coverage/
/dest/
/out/
/node_modules/
npm-debug.log
/test/
......
......@@ -1580,7 +1580,7 @@ MWF.xApplication.Selector.Person = new Class({
//if (this.options.count.toInt() !== 1){
var width = nodeWidth - getOffsetX(this.selectNode) - getOffsetX(this.selectedContainerNode);
var halfWidth = this.options.noSelectedContainer ? width : Math.floor(width / 2);
var halfWidth = this.options.noSelectedContainer ? width : ( Math.floor(width / 2) - 2);
this.selectNode.setStyle("width", halfWidth);
//this.searchInput.setStyle("width", halfWidth - 6);
......
MWF.xDesktop.requireApp("process.Xform", "$Module", null, false);
/** Class Input组件 */
MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({
Implements: [Events],
Extends: MWF.APP$Module,
......@@ -222,10 +223,18 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({
var text = (this.node.getFirst()) ? this.node.getFirst().get("text") : this.node.get("text");
return {"value": [value || ""] , "text": [text || value || ""]};
},
/**
* 判断组件值是否为空.
* @return {boolean}.
*/
isEmpty : function(){
var data = this.getData();
return !data || !data.trim();
},
/**
* 获取组件值.
* @return {object/string}.
*/
getData: function(when){
if (this.json.compute == "save") this._setValue(this._computeValue());
return this.getInputData();
......@@ -237,9 +246,16 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({
return this._getBusinessData();
}
},
/**
* 重置组件的值,如果设置了默认值,则设置为默认值,否则置空。
*/
resetData: function(){
this.setData(this.getValue());
},
/**
* 为控件赋值。
* @param {string/number/jsonObject} .
*/
setData: function(data){
this._setBusinessData(data);
if (this.node.getFirst()){
......@@ -433,6 +449,11 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({
}
return true;
},
/**
* 根据组件的校验设置进行校验。
* @param {string} routeName-路由名称.
* @return {boolean} 是否通过校验
*/
validation: function(routeName, opinion){
if (!this.readonly && !this.json.isReadonly){
if (!this.validationConfig(routeName, opinion)) return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册