From f04fceb0b24335ebe8c1452daed4bfc8b8b2573d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E7=A5=A5=E7=86=A0?= Date: Sun, 26 Jul 2020 14:25:09 +0000 Subject: [PATCH] Merge branch 'fix/Process.process_errorText_overflow' into 'wrdp' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge of fix/Process.process_errorText_overflow to wrdp See merge request o2oa/o2oa!1254 (cherry picked from commit 4c446c5729ba3c595f447aae9369bfddf44790d7) 674a7d1e 修复提交框人员选择超过高度不显示的问题 6ed912b6 修复提交框人员选择校验超长时不显示的问题 21a34054 清空组织所选人 --- .../$Processor/blue_flat/css.wcss | 6 +- .../$Processor/default/css.wcss | 3 +- .../$Processor/process/css.wcss | 3 +- .../x_component_process_Work/Processor.js | 91 ++++++++++++++++--- 4 files changed, 85 insertions(+), 18 deletions(-) diff --git a/o2web/source/x_component_process_Work/$Processor/blue_flat/css.wcss b/o2web/source/x_component_process_Work/$Processor/blue_flat/css.wcss index 335a13a80f..2a058a111a 100644 --- a/o2web/source/x_component_process_Work/$Processor/blue_flat/css.wcss +++ b/o2web/source/x_component_process_Work/$Processor/blue_flat/css.wcss @@ -264,8 +264,9 @@ "border-left": "25px solid #ffffff" }, "selectorTitle": { - "height": "26px", + "min-height": "26px", "line-height": "26px", + "height" : "auto", "font-size": "14px", "color": "#333333", "padding-left" : "2px", @@ -301,7 +302,8 @@ "width" : "16px", "height" : "16px", "right" : "10px", - "top" : "3px", +// "top" : "3px", + "top" : "calc(50% - 8px)", "cursor" : "pointer" }, "selectorContent": { diff --git a/o2web/source/x_component_process_Work/$Processor/default/css.wcss b/o2web/source/x_component_process_Work/$Processor/default/css.wcss index b2bbbca312..085dbcbd76 100644 --- a/o2web/source/x_component_process_Work/$Processor/default/css.wcss +++ b/o2web/source/x_component_process_Work/$Processor/default/css.wcss @@ -216,8 +216,9 @@ "border-left": "5px solid #ffffff" }, "selectorTitle": { - "height": "26px", + "min-height": "26px", "line-height": "26px", + "height" : "auto", "font-size": "14px", "font-weight": "bold", "color": "#333333" diff --git a/o2web/source/x_component_process_Work/$Processor/process/css.wcss b/o2web/source/x_component_process_Work/$Processor/process/css.wcss index a2240ef682..67ce31112b 100644 --- a/o2web/source/x_component_process_Work/$Processor/process/css.wcss +++ b/o2web/source/x_component_process_Work/$Processor/process/css.wcss @@ -339,7 +339,8 @@ "border-left": "5px solid #ffffff" }, "selectorTitle": { - "height": "26px", + "height": "auto", + "min-height" : "26px", "line-height": "26px", "font-size": "14px", "color": "#333333", diff --git a/o2web/source/x_component_process_Work/Processor.js b/o2web/source/x_component_process_Work/Processor.js index df95a6dbc6..ae653ea936 100644 --- a/o2web/source/x_component_process_Work/Processor.js +++ b/o2web/source/x_component_process_Work/Processor.js @@ -1272,8 +1272,8 @@ MWF.xApplication.process.Work.Processor = new Class({ var lines = ((len+1)/2).toInt(); for (var n=0; n 0 ){ if(this.orgsArea)this.orgsArea.show(); - if( this.orgsTile )height = height + this.getOffsetY(this.orgsTile) + this.orgsTile.getStyle("height").toInt(); - height = height + lines*this.options.orgHeight + this.getOffsetY(this.orgsArea); - this.node.setStyle( "height", height ); - //flag = (lines*this.options.orgHeight + 431) > Math.floor( this.form.app.content.getSize().y * 0.9); - //this.node.store("height", Math.min( Math.floor( this.form.app.content.getSize().y * 0.9) , lines*this.options.orgHeight + 431 )); + if( flag ){ + // if( this.orgsTile )height = height + this.getOffsetY(this.orgsTile) + this.orgsTile.getStyle("height").toInt(); + this.orgsArea.getChildren().each( function(el){ + height += el.getSize().y + this.getOffsetY( el ); + }.bind(this)) + this.node.setStyle( "height", height ); + }else{ + if( this.orgsTile )height = height + this.getOffsetY(this.orgsTile) + this.orgsTile.getStyle("height").toInt(); + height = height + lines*this.options.orgHeight + this.getOffsetY(this.orgsArea); + this.node.setStyle( "height", height ); + } }else{ if(this.orgsArea)this.orgsArea.hide(); this.node.setStyle( "height", height ); @@ -1438,12 +1460,31 @@ MWF.xApplication.process.Work.Processor = new Class({ this.selectIdeaNode.setStyles( this.css.selectIdeaNode ); } }, + isErrorHeightOverflow : function(){ + var hasOverflow = false; + ( this.orgItems || [] ).each( function(item){ + if( item.errorHeightOverflow ){ + hasOverflow = true; + } + }.bind(this)); + return hasOverflow; + }, + checkErrorHeightOverflow : function( force ){ + if( force || this.isErrorHeightOverflow() ){ + this.setSize(this.orgItems.length, true); + } + }, + errorHeightChange : function(){ + debugger; + this.checkErrorHeightOverflow( true ) + }, validationOrgs : function(){ if( !this.orgItems || !this.orgItems.length )return true; var flag = true; this.orgItems.each( function(item){ if( !item.validation() )flag = false; }.bind(this)); + this.checkErrorHeightOverflow(); return flag; }, isOrgsHasEmpower: function(){ @@ -1988,6 +2029,7 @@ if( MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form ){ if( this.validation() ){ return true; }else{ + this.processor.checkErrorHeightOverflow(); return false; } }else{ @@ -2003,6 +2045,10 @@ if( MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form ){ this.selector.selector.setSelectedItem(); } }, + setDataToOriginal : function(){ + var v = this._computeValue(); + this.setData(v || ""); + }, resetData: function(){ var v = this.getValue(); //this.setData((v) ? v.join(", ") : ""); @@ -2362,6 +2408,7 @@ if( MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form ){ }, createErrorNode: function(text){ + var _self = this; var node; if( this.processor.css.errorContentNode ){ node = new Element("div",{ @@ -2374,6 +2421,10 @@ if( MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form ){ "events": { "click" : function(){ this.destroy(); + if( _self.errorHeightOverflow ){ + _self.errorHeightOverflow = false; + _self.processor.errorHeightChange(); + } }.bind(node) } }).inject(node); @@ -2390,11 +2441,12 @@ if( MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form ){ }).inject(node); var textNode = new Element("div", { "styles": { - "height": "20px", + "height" : "auto", + "min-height": "20px", "line-height": "20px", "margin-left": "20px", "color": "red", - "word-break": "keep-all" + "word-break": "break-all" }, "text": text }).inject(node); @@ -2414,6 +2466,12 @@ if( MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form ){ }else{ this.errNode.inject(this.container, "after"); } + var errorSize = this.errNode.getSize(); + debugger; + if( !layout.mobile && errorSize.y > 26 ){ + this.errorHeightOverflow = true; + } + //this.showNotValidationMode(this.node); //if (!this.node.isIntoView()) this.node.scrollIntoView(); } @@ -2440,10 +2498,15 @@ if( MWF.xApplication.process.Xform && MWF.xApplication.process.Xform.Form ){ } if (flag.toString()!="true"){ this.notValidationMode(flag); + this.processor.errorHeightChange(); return false; }else if(this.errNode){ this.errNode.destroy(); this.errNode = null; + if( this.errorHeightOverflow ){ + this.errorHeightOverflow = false; + this.processor.errorHeightChange(); + } } return true; }, -- GitLab