unknown 5 лет назад
Родитель
Сommit
f56cafcd47

+ 19 - 6
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"
                 })
             }

+ 12 - 2
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 );
         }

+ 8 - 7
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();
         }