Browse Source

查询列表pagesize自动计算/从表自动选中

zhuth 7 years ago
parent
commit
59f4c72267

+ 3 - 0
frontend/saas-web/app/util/FormUtil.js

@@ -110,6 +110,9 @@ Ext.define('saas.util.FormUtil', {
                                 
                                 var editor = c.editor;
                                 if(editor) {
+                                    Ext.applyIf(editor, {
+                                        selectOnFocus: true
+                                    });
                                     if(editor.xtype == 'numberfield') {
                                         Ext.applyIf(editor, {
                                             hideTrigger: true, // 隐藏trigger

+ 1 - 0
frontend/saas-web/app/view/core/form/FormPanel.js

@@ -68,6 +68,7 @@ Ext.define('saas.view.core.form.FormPanel', {
             text: '保存',
             handler: 'onSave',
             bind: {
+                hidden: '{'+ me._statusCodeField + ' == "' + me.auditTexts.auditCode + '"}',
                 // disabled: '{!base.valid || '+ me._statusCodeField + ' == "AUDITED" || ' + me._statusCodeField + ' == "OPEN"}'
                 disabled: '{!base.valid || '+ me._statusCodeField + ' == "' + me.auditTexts.auditCode + '"}'
             }

+ 22 - 0
frontend/saas-web/app/view/core/query/QueryGridPanel.js

@@ -212,6 +212,28 @@ Ext.define('saas.view.core.query.QueryGridPanel', {
         me.callParent(arguments);
     },
     listeners: {
+        boxready: function(grid, width, height, eOpts) {
+            var store = grid.getStore(),
+            dockedItems = grid.getDockedItems(),
+            toolbar = dockedItems[0],
+            header = dockedItems[1],
+            pagingtoolbar = dockedItems[2];
+
+            var gridEl = grid.el.dom,
+            gridHeight = gridEl.getBoundingClientRect().height,
+            toolbarEl = toolbar.el.dom,
+            toolbarHeight = toolbarEl.getBoundingClientRect().height,
+            headerEl = header.el.dom,
+            headerHeight = headerEl.getBoundingClientRect().height,
+            pagingtoolbarEl = pagingtoolbar.el.dom,
+            pagingtoolbarHeight = pagingtoolbarEl.getBoundingClientRect().height;
+
+            var gridBodyHeight = gridHeight - toolbarHeight - headerHeight - pagingtoolbarHeight;
+
+            var pageSize = Math.floor(gridBodyHeight / 32);
+
+            store.setPageSize(pageSize);
+        },
         itemClick: function(tableView, record, item, index, e, eOpts) {
             if(e.target.parentElement.classList.contains('x-querygrid-code-column')) {
                 var grid = tableView.up('grid'),

+ 7 - 0
frontend/saas-web/app/view/core/query/QueryPanel.js

@@ -110,6 +110,13 @@ Ext.define('saas.view.core.query.QueryPanel', {
             }
         });
 
+        if(columns[columns.length - 1].flex != 1) {
+            columns.push({
+                flex: 1,
+                allowBlank: true
+            });
+        }
+
         me.queryGridConfig['columns']=columns;
         Ext.apply(queryGrid,me.queryGridConfig);
     },