Răsfoiți Sursa

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

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

See merge request o2oa/o2oa!1852
蔡祥熠 5 ani în urmă
părinte
comite
7568f98ef2

+ 1 - 0
o2web/.gitignore

@@ -1,6 +1,7 @@
 /.idea/
 /coverage/
 /dest/
+/out/
 /node_modules/
 npm-debug.log
 /test/

+ 1 - 1
o2web/source/x_component_Selector/Person.js

@@ -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);

+ 21 - 0
o2web/source/x_component_process_Xform/$Input.js

@@ -1,4 +1,5 @@
 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;