Browse Source

主从表界面从表高度自适应

zhuth 7 years ago
parent
commit
50c9c29b18

+ 10 - 1
frontend/saas-web/app/view/core/form/field/DetailGridField.js

@@ -8,7 +8,7 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
     enableColumnHide: false,
     border: 1,
     margin: '0 0 10 0', // formpanel的fieldDefaults未生效
-    height: 245,
+    minHeight: 245,
     columnWidth : 1.0, 
 
     requires: [
@@ -67,6 +67,15 @@ Ext.define('saas.view.core.form.field.DetailGridField', {
                 emptyText: '<div style="width: 100%; text-align: center; cursor: pointer; color: green;" class="fa fa-plus" title="新增行" onclick="addRows(\'' + me.id + '\')"></div>',
             },
             listeners: {
+                boxready: function(g) {
+                    var f = g.ownerCt,
+                    c = f.detailCount || 1,
+                    fb = f.getBox(),
+                    fh = fb.height,
+                    h = (fh * 0.5) / c;
+
+                    g.setHeight(h);
+                },
                 edit: function() {
                     this.fireEvent('validChange');
                 },

+ 1 - 1
frontend/saas-web/app/view/main/Main.js

@@ -124,7 +124,7 @@ Ext.define('saas.view.main.Main', {
                     }
                 },
                 {
-                    ui: 'header',
+                    // ui: 'header',
                     arrowVisible: false,
                     cls:' sa-nav-button',   
                     width: 50,

+ 2 - 0
frontend/saas-web/app/view/main/Main.scss

@@ -231,6 +231,8 @@ body > .x-mask {
     color: #34BAF6;
     padding: 0;
     box-shadow: none !important;
+    border: none;
+    background-color: transparent !important;
 
     .x-btn-icon-el {
         color: #34BAF6;