Pārlūkot izejas kodu

Report 报表二开

luoyifan 3 gadi atpakaļ
vecāks
revīzija
15239354d8
2 mainītis faili ar 44 papildinājumiem un 2 dzēšanām
  1. 43 1
      dist/yvan-ext.js
  2. 1 1
      dist/yvan-ext.js.map

+ 43 - 1
dist/yvan-ext.js

@@ -109,6 +109,7 @@ define(['exports'], function (exports) { 'use strict';
         viewConfig: {
             enableTextSelection: true,
             sortOnClick: false,
+            emptyText: '没有数据'
         },
         selModel: {
             type: 'checkboxmodel',
@@ -95307,6 +95308,48 @@ define(['exports'], function (exports) { 'use strict';
                     return r;
                 });
             },
+            rowMoveUp: function () {
+                var grid = this;
+                if (!grid.selection) {
+                    msg('无法对多行进行移动');
+                    return;
+                }
+                var record = grid.selection;
+                // const records = grid.selModel.getSelection()
+                // if (records.length !== 1) {
+                //     msg('无法对多行进行移动')
+                //     return
+                // }
+                //
+                // const [record] = records
+                var index = grid.store.indexOf(record);
+                if (index > 0) {
+                    grid.store.removeAt(index);
+                    grid.store.insert(index - 1, record);
+                    grid.getView().refresh();
+                    grid.selModel.select([record]);
+                }
+            },
+            rowMoveDown: function () {
+                var grid = this;
+                // const records = grid.selModel.getSelection()
+                // if (records.length !== 1) {
+                //     msg('无法对多行进行移动')
+                //     return
+                // }
+                if (!grid.selection) {
+                    msg('无法对多行进行移动');
+                    return;
+                }
+                var record = grid.selection;
+                var index = grid.store.indexOf(record);
+                if (index < grid.store.getCount() - 1) {
+                    grid.store.removeAt(index);
+                    grid.store.insert(index + 1, record);
+                    grid.getView().refresh();
+                    grid.selModel.select([record]);
+                }
+            },
             getEditRecord: function () {
                 var _a, _b;
                 var me = this;
@@ -95990,7 +96033,6 @@ define(['exports'], function (exports) { 'use strict';
         }
         // throw new TypeError('无法识别的调用方法')
     }
-    //# sourceMappingURL=grid.js.map
 
     function initTextfield () {
         var cc = Ext.form.field.Text.prototype.constructor;

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 1 - 1
dist/yvan-ext.js.map