From f56cafcd473d155772fb179aa1fd2e54ac3ecd64 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 May 2020 18:43:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- o2web/source/o2_core/o2/xDesktop/Dialog.js | 25 ++++++++++++++----- .../x_component_process_Work/Processor.js | 14 +++++++++-- .../source/x_component_process_Xform/Form.js | 15 +++++------ 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/o2web/source/o2_core/o2/xDesktop/Dialog.js b/o2web/source/o2_core/o2/xDesktop/Dialog.js index f58dd5762f..08f8a3529f 100644 --- a/o2web/source/o2_core/o2/xDesktop/Dialog.js +++ b/o2web/source/o2_core/o2/xDesktop/Dialog.js @@ -317,6 +317,14 @@ o2.xDesktop.Dialog = o2.DDL = new Class({ (node.getStyle("border-left-width").toInt() || 0 ) + (node.getStyle("border-right-width").toInt() || 0 ); }, + getMarginY : function(node){ + return (node.getStyle("margin-top").toInt() || 0 ) + + (node.getStyle("margin-bottom").toInt() || 0 ); + }, + getMarginX : function(node){ + return (node.getStyle("margin-left").toInt() || 0 ) + + (node.getStyle("margin-right").toInt() || 0 ); + }, setContentHeightAuto : function(){ var maxHeight = this.getMaxHeight(); @@ -327,7 +335,7 @@ o2.xDesktop.Dialog = o2.DDL = new Class({ if( this.bottom )offsetY = offsetY + this.getOffsetY( this.bottom ) + this.bottom.getSize().y; if( this.button && !this.buttonDisable )offsetY = offsetY + this.getOffsetY( this.button ) + this.button.getSize().y; if( this.content ){ - offsetY = offsetY + this.getOffsetY( this.content ); + offsetY = offsetY + this.getMarginY( this.content ); y = offsetY + this.content.getSize().y; }else{ y = offsetY; @@ -379,6 +387,10 @@ o2.xDesktop.Dialog = o2.DDL = new Class({ if( typeOf(maxHeightPercent) === "string" && maxHeightPercent.substr(maxHeightPercent.length - 1, 1) === "%" ) { var containerHeight = ( this.options.positionNode || this.options.container || $(document.body)).getSize().y; maxHeightPercent = parseInt(containerHeight * parseInt(maxHeightPercent) / 100); + + if( maxHeightPercent + (this.options.minTop || 0) > containerHeight ){ + maxHeightPercent = containerHeight - (this.options.minTop) + } } } @@ -644,7 +656,7 @@ o2.xDesktop.Dialog = o2.DDL = new Class({ var offsetX = 0; var x = 0; if( this.content ){ - offsetX = offsetX + this.getOffsetX( this.content ); + offsetX = offsetX + this.getMarginX( this.content ); x = offsetX + this.content.getSize().x; }else{ x = offsetX; @@ -663,10 +675,11 @@ o2.xDesktop.Dialog = o2.DDL = new Class({ this.node.setStyles({ "width": maxWidth }); - this.contentWidth = maxWidth - offsetX; + + this.contentWidth = maxWidth - this.getOffsetX(this.content); if (this.content) { this.content.setStyles({ - "width" : maxWidth - offsetX, + "width" : this.contentWidth, "overflow-x": "auto" }) } @@ -682,10 +695,10 @@ o2.xDesktop.Dialog = o2.DDL = new Class({ this.node.setStyles({ "width": x }); - this.contentWidth = x - offsetX; + this.contentWidth = x - this.getOffsetX(this.content); if (this.content) { this.content.setStyles({ - "width" : x - offsetX, + "width" : this.contentWidth, "overflow-x": "hidden" }) } diff --git a/o2web/source/x_component_process_Work/Processor.js b/o2web/source/x_component_process_Work/Processor.js index 27d296a615..009365873f 100644 --- a/o2web/source/x_component_process_Work/Processor.js +++ b/o2web/source/x_component_process_Work/Processor.js @@ -216,6 +216,7 @@ MWF.xApplication.process.Work.Processor = new Class({ list.push( this.splitByStartNumber( k).name ) }.bind(this)); + var flag = false; list.each( function( routeGroupName ){ var routeList = this.routeGroupObject[routeGroupName]; var routeGroupNode = new Element("div", {"styles": this.css.routeGroupNode, "text": routeGroupName}).inject(this.routeGroupArea); @@ -231,9 +232,12 @@ MWF.xApplication.process.Work.Processor = new Class({ if ( keys.length === 1 ){ this.selectRouteGroup(routeGroupNode); }else{ - this.setSize(0); + flag = true; } }.bind(this)) + if( flag ){ + this.setSize(0); + } }, overRouteGroup: function(node){ if (this.selectedRouteGroup){ @@ -321,6 +325,7 @@ MWF.xApplication.process.Work.Processor = new Class({ //this.task.routeNameList = ["送审核", "送办理", "送公司领导阅"]; if( !routeList )routeList = this.getRouteDataList(); //this.task.routeNameList.each(function(route, i){ + var flag = false; routeList.each(function(route, i){ if( route.hiddenScriptText && this.form && this.form.Macro ){ if( this.form.Macro.exec(route.hiddenScriptText, this).toString() === "true" )return; @@ -344,10 +349,13 @@ MWF.xApplication.process.Work.Processor = new Class({ if (routeList.length==1 || route.sole ){ //sole表示优先路由 this.selectRoute(routeNode); }else{ - this.setSize(0); + flag = true; } }.bind(this)); + if( flag ){ + this.setSize(0); + } }, overRoute: function(node){ if (this.selectedRoute){ @@ -1389,6 +1397,7 @@ MWF.xApplication.process.Work.Processor = new Class({ //if( this.buttonsArea )height = height + this.getOffsetY(this.buttonsArea) + this.buttonsArea.getStyle("height").toInt(); if( lines > 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 ); @@ -1396,6 +1405,7 @@ MWF.xApplication.process.Work.Processor = new Class({ //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 )); }else{ + if(this.orgsArea)this.orgsArea.hide(); this.node.setStyle( "height", height ); //this.node.store("height", 401 ); } diff --git a/o2web/source/x_component_process_Xform/Form.js b/o2web/source/x_component_process_Xform/Form.js index 8f8a97e76e..e9b80df16f 100644 --- a/o2web/source/x_component_process_Xform/Form.js +++ b/o2web/source/x_component_process_Xform/Form.js @@ -1763,14 +1763,15 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class({ "height": size.y, "width": size.x }); + debugger; var s = dlg.setContentSize(); - if (dlg.content.getStyle("overflow-y") === "auto" && dlg.content.getStyle("overflow-x") !== "auto") { - var paddingRight = (dlg.content.getStyle("padding-right").toInt() || 0 ); - if( paddingRight < 20 ){ - dlg.node.setStyle("width", dlg.node.getStyle("width").toInt() + 20 + "px"); - dlg.content.setStyle("width", dlg.content.getStyle("width").toInt() + 20 + "px"); - } - } + // if ( dlg.content.getStyle("overflow-y") === "auto" && dlg.content.getStyle("overflow-x") !== "auto" ) { + // var paddingRight = (dlg.content.getStyle("padding-right").toInt() || 0 ); + // if( paddingRight < 20 ){ + // dlg.node.setStyle("width", dlg.node.getStyle("width").toInt() + 20 + "px"); + // dlg.content.setStyle("width", dlg.content.getStyle("width").toInt() + 20 + "px"); + // } + // } if (!notRecenter) dlg.reCenter(); } -- GitLab