Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

houaj 3 gadi atpakaļ
vecāks
revīzija
656c85fb41
2 mainītis faili ar 64 papildinājumiem un 15 dzēšanām
  1. 63 14
      dist/yvan-ext.js
  2. 1 1
      dist/yvan-ext.js.map

+ 63 - 14
dist/yvan-ext.js

@@ -62169,6 +62169,34 @@ define(['exports'], function (exports) { 'use strict';
         });
     }
     /**
+     * 替换内部结构中,所有 N/A
+     */
+    function replaceNA(obj) {
+        if (obj === 'N/A') {
+            return '';
+        }
+        if (lodash.isArray(obj)) {
+            lodash.forEach(obj, function (value, idx) {
+                if (value === 'N/A') {
+                    obj[idx] = '';
+                }
+                else {
+                    replaceNA(value);
+                }
+            });
+        }
+        else if (lodash.isPlainObject(obj)) {
+            lodash.forOwn(obj, function (value, key) {
+                if (value === 'N/A') {
+                    obj[key] = '';
+                }
+                else {
+                    replaceNA(value);
+                }
+            });
+        }
+    }
+    /**
      * 根据表达式进入写值
      * express="{query.a}"   写值就是 viewModel.set('query.a', value)
      * express="test-{query.a}"   写值就会失败
@@ -63181,7 +63209,6 @@ define(['exports'], function (exports) { 'use strict';
     function getGridEditRows(grid) {
         return grid.getGridEditRows();
     }
-    //# sourceMappingURL=systemLib.js.map
 
     var SystemLib = /*#__PURE__*/Object.freeze({
         __proto__: null,
@@ -63190,6 +63217,7 @@ define(['exports'], function (exports) { 'use strict';
         calcObjectFlat: calcObjectFlat,
         mergeViewModel: mergeViewModel,
         flatRow: flatRow,
+        replaceNA: replaceNA,
         tryWriteByExpress: tryWriteByExpress,
         tryWriteObject: tryWriteObject,
         tryVarSimple: tryVarSimple,
@@ -94881,6 +94909,9 @@ define(['exports'], function (exports) { 'use strict';
                         successProperty: 'success',
                         messageProperty: 'msg',
                         transform: function (data) {
+                            if (typeof window['ajaxProcess'] === 'function') {
+                                window['ajaxProcess'](data);
+                            }
                             if (typeof grid._transform === 'function') {
                                 // 系统转换函数
                                 grid._transform(data.data);
@@ -95025,6 +95056,7 @@ define(['exports'], function (exports) { 'use strict';
             xtype: 'yvgrid',
             constructor: function (config) {
                 var _this = this;
+                var _a, _b, _c, _d, _e, _f;
                 var dataSource = config.dataSource;
                 if (!window["IS_DESIGN_MODE"]) {
                     this.columnConfigCacheKey = this.makeColumnConfigCacheKey(config);
@@ -95058,7 +95090,7 @@ define(['exports'], function (exports) { 'use strict';
                 // syncRowHeight: false,
                 }, baseConfig(config, 'row-item'), config, grid);
                 // 在面板上的组件
-                var scope = newConfig.$initParent.yvanScope || newConfig.$initParent.lookupReferenceHolder().yvanScope;
+                var scope = ((_a = newConfig.$initParent) === null || _a === void 0 ? void 0 : _a.yvanScope) || ((_c = (_b = newConfig.$initParent) === null || _b === void 0 ? void 0 : _b.lookupReferenceHolder()) === null || _c === void 0 ? void 0 : _c.yvanScope) || ((_d = config.$vmParent) === null || _d === void 0 ? void 0 : _d.yvanScope) || ((_f = (_e = newConfig.$vmParent) === null || _e === void 0 ? void 0 : _e._parent) === null || _f === void 0 ? void 0 : _f.yvanScope);
                 var buttons = [];
                 var getRowClass = newConfig.getRowClass;
                 if (typeof getRowClass === 'string' && (lodash.startsWith(getRowClass, "scope.") ||
@@ -95287,22 +95319,36 @@ define(['exports'], function (exports) { 'use strict';
             },
             setStore: function (store) {
                 var me = this;
+                if (lodash.isArray(store)) {
+                    var value = store;
+                    this._transform(value);
+                    var storeOpt = {
+                        fields: getFileds(this),
+                        data: value,
+                    };
+                    if (this.groupField) {
+                        storeOpt.groupField = this.groupField;
+                    }
+                    store = new Ext.data.Store(storeOpt);
+                }
                 me.superclass.setStore.call(this, store);
                 var reference = this.reference;
                 if (reference) {
                     lookupScope(this).viewModel.set(reference + '.ischanged', false);
                 }
-                store.on({
-                    add: function (store, records, index, eOpts) {
-                        me._raiseChange(store, 'add');
-                    },
-                    remove: function (store, records, index, isMove, eOpts) {
-                        me._raiseChange(store, 'remove');
-                    },
-                    datachanged: function (sender, opt) {
-                        me._raiseChange(store, 'datachanged');
-                    }
-                });
+                if (store) {
+                    store.on({
+                        add: function (store, records, index, eOpts) {
+                            me._raiseChange(store, 'add');
+                        },
+                        remove: function (store, records, index, isMove, eOpts) {
+                            me._raiseChange(store, 'remove');
+                        },
+                        datachanged: function (sender, opt) {
+                            me._raiseChange(store, 'datachanged');
+                        }
+                    });
+                }
             },
             _raiseChange: function (store, type) {
                 var _a, _b;
@@ -95603,7 +95649,8 @@ define(['exports'], function (exports) { 'use strict';
             },
             // 生成列自定义的缓存key
             makeColumnConfigCacheKey: function (config) {
-                var scope = config.$initParent.yvanScope || config.$initParent.lookupReferenceHolder().yvanScope;
+                var _a, _b, _c, _d, _e, _f;
+                var scope = ((_a = config.$initParent) === null || _a === void 0 ? void 0 : _a.yvanScope) || ((_c = (_b = config.$initParent) === null || _b === void 0 ? void 0 : _b.lookupReferenceHolder()) === null || _c === void 0 ? void 0 : _c.yvanScope) || ((_d = config.$vmParent) === null || _d === void 0 ? void 0 : _d.yvanScope) || ((_f = (_e = config.$vmParent) === null || _e === void 0 ? void 0 : _e._parent) === null || _f === void 0 ? void 0 : _f.yvanScope);
                 var key = "gridColumnCache-" + scope.scopeKey + "-";
                 if (config.reference) {
                     key += config.reference;
@@ -95906,6 +95953,7 @@ define(['exports'], function (exports) { 'use strict';
         }
         // throw new TypeError('无法识别的调用方法')
     }
+    //# sourceMappingURL=grid.js.map
 
     function initTextfield () {
         var cc = Ext.form.field.Text.prototype.constructor;
@@ -131904,6 +131952,7 @@ define(['exports'], function (exports) { 'use strict';
     exports.raiseClick = raiseClick;
     exports.recast = main$3;
     exports.reloadGrid = reloadGrid;
+    exports.replaceNA = replaceNA;
     exports.serverInvokeUrlTransform = serverInvokeUrlTransform;
     exports.setComboStore = setComboStore;
     exports.setDesignMode = setDesignMode;

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