luoyifan 3 лет назад
Родитель
Сommit
1f9fcb7fc4
2 измененных файлов с 108 добавлено и 6 удалено
  1. 107 5
      dist/yvan-ext-mobile.js
  2. 1 1
      dist/yvan-ext-mobile.js.map

+ 107 - 5
dist/yvan-ext-mobile.js

@@ -37747,6 +37747,7 @@ define(['exports'], function (exports) { 'use strict';
           }
       });
   }
+  //# sourceMappingURL=lib.js.map
 
   var Scope = /** @class */ (function () {
       function Scope(_a) {
@@ -38119,6 +38120,7 @@ define(['exports'], function (exports) { 'use strict';
       Scope.SHOW_PAGE_STACK = [];
       return Scope;
   }());
+  //# sourceMappingURL=Scope.js.map
 
   /**
    * 全局 ajax 方法
@@ -38216,6 +38218,7 @@ define(['exports'], function (exports) { 'use strict';
       });
       return found >= ws.length;
   }
+  //# sourceMappingURL=config.js.map
 
   function initComponent () {
       var ct = Ext.Component.prototype.constructor;
@@ -38232,7 +38235,23 @@ define(['exports'], function (exports) { 'use strict';
           }
       });
   }
-
+  //# sourceMappingURL=component.js.map
+
+  var labelWidth = 80;
+  var date = {
+      labelTextAlign: 'right',
+      // picker: 'edge',
+      picker: {
+          xtype: 'datepicker',
+          slotOrder: ['year', 'month', 'day'],
+          yearFrom: 1900,
+          yearTo: 2099,
+      },
+      maxDate: moment('2099-12-31').toDate(),
+      minDate: moment('1900-01-01').toDate(),
+      // picker: 'floated',
+      labelWidth: labelWidth,
+  };
   var column = {
       menuDisabled: true
   };
@@ -38287,6 +38306,47 @@ define(['exports'], function (exports) { 'use strict';
           flex: 1
       },
   };
+  //# sourceMappingURL=Defaults.js.map
+
+  function initDate () {
+      var cc = Ext.field.Date.prototype.constructor;
+      var _a = Ext.field.Date.prototype, initialize = _a.initialize, getValue = _a.getValue, valueToRaw = _a.valueToRaw;
+      Ext.field.Date.override({
+          dateFormat: 'Y-m-d',
+          altFormats: 'Y-m-d',
+          constructor: function (config) {
+              var newConfig = lodash.defaultsDeep({
+              // 强制属性
+              }, date, config);
+              cc.call(this, newConfig);
+          },
+          getValue: function () {
+              var ov = getValue.call(this);
+              var nv = Ext.util.Format.date(ov, 'Y-m-d');
+              // console.log('cc:', nv, ov)
+              return nv;
+          },
+          initialize: function () {
+              this.on({
+                  expand: function (sender, opts) {
+                      var value = sender.getRawValue();
+                      if (value) {
+                          //@ts-ignore
+                          var dt_1 = moment(value).toDate();
+                          var picker_1 = sender.getPicker();
+                          picker_1.setValue(dt_1);
+                          // 延迟200毫秒后再设定一次值,动画会造成 bug
+                          setTimeout(function () {
+                              picker_1.setValue(dt_1);
+                          }, 200);
+                      }
+                  },
+              });
+              initialize.call(this);
+          },
+      });
+  }
+  //# sourceMappingURL=datefield.js.map
 
   /**
    * 构建所有组件的公共属性
@@ -38333,6 +38393,7 @@ define(['exports'], function (exports) { 'use strict';
       }
       return config;
   }
+  //# sourceMappingURL=base.js.map
 
   function initCols () {
       Ext.define('Yvan.Cols', {
@@ -38349,6 +38410,7 @@ define(['exports'], function (exports) { 'use strict';
           },
       });
   }
+  //# sourceMappingURL=cols.js.map
 
   var PropertyDescription = /** @class */ (function () {
       function PropertyDescription() {
@@ -38390,6 +38452,7 @@ define(['exports'], function (exports) { 'use strict';
       };
       return PropertyDescription;
   }());
+  //# sourceMappingURL=PropertyDescription.js.map
 
   var PropertyDescriptionTable = new Map();
   PropertyDescriptionTable.set('tabCell', new PropertyDescription({
@@ -38721,6 +38784,7 @@ define(['exports'], function (exports) { 'use strict';
           width, height
       ]
   }));
+  //# sourceMappingURL=PropertyDescriptionTable.js.map
 
   function prompt(message, multiLine, value) {
       if (multiLine === void 0) { multiLine = false; }
@@ -38826,6 +38890,7 @@ define(['exports'], function (exports) { 'use strict';
           $w.remove();
       }, 3000);
   }
+  //# sourceMappingURL=message.js.map
 
   var SIMPLE_RE = /^(?:\{(?:(\d+)|([a-z_][\w\.]*))\})$/i;
   /**
@@ -39211,15 +39276,16 @@ define(['exports'], function (exports) { 'use strict';
       if (sender.$className === 'Ext.field.Select') {
           getDictFn(bizKey, function (r) {
               var _a, _b;
+              // const options = r.data
               var options = lodash.map(r.data, function (r) {
                   return {
                       value: r.id,
                       text: r.text,
                   };
               });
-              if (sender.getOptions()) {
+              if (sender.getStore()) {
                   // 异步回传
-                  sender.setOptions(options);
+                  sender.setStore(options);
                   // 这里有个bug, 异步回传完毕之后, 需要强制刷新一下
                   // 否则在 forceSelection 的模式下。displayField 不会强制做变更
                   var realValue = (_b = (_a = sender.bind) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.getValue();
@@ -39229,7 +39295,30 @@ define(['exports'], function (exports) { 'use strict';
               }
               else {
                   // 同步回传
-                  sender.setOptions(options);
+                  if (sender.isRendered()) {
+                      sender.setOptions(options);
+                  }
+                  else {
+                      // setOptions 会出现 reference not define 的bug,需要连续3次 defer 才能解决
+                      lodash.defer(function () {
+                          if (sender.isRendered()) {
+                              sender.setOptions(options);
+                          }
+                          else {
+                              lodash.defer(function () {
+                                  if (sender.isRendered()) {
+                                      sender.setOptions(options);
+                                  }
+                                  else {
+                                      lodash.defer(function () {
+                                          sender.setOptions(options);
+                                      });
+                                  }
+                              });
+                          }
+                      });
+                  }
+                  // sender.setStore(options)
               }
           });
           return;
@@ -40148,6 +40237,7 @@ define(['exports'], function (exports) { 'use strict';
           }
       });
   }
+  //# sourceMappingURL=stores.js.map
 
   function initGrid () {
       Ext.define('Yvan.Grid', {
@@ -40631,6 +40721,7 @@ define(['exports'], function (exports) { 'use strict';
       }
       // throw new TypeError('无法识别的调用方法')
   }
+  //# sourceMappingURL=grid.js.map
 
   function initGridColumn () {
       var ct = Ext.grid.column.Column.prototype.constructor;
@@ -40663,6 +40754,7 @@ define(['exports'], function (exports) { 'use strict';
       //     }
       // });
   }
+  //# sourceMappingURL=gridcolumn.js.map
 
   function initLocale() {
       Ext.define('Ext.locale.zh_CN.Panel', {
@@ -40706,12 +40798,14 @@ define(['exports'], function (exports) { 'use strict';
       //     }
       // });
   }
+  //# sourceMappingURL=locale-zh_CN.js.map
 
   var FixClass = /** @class */ (function () {
       function FixClass() {
       }
       FixClass.prototype.fix = function (me, config) {
           var _this = this;
+          var _a;
           var fix = config.fix;
           if (!fix) {
               return;
@@ -40723,7 +40817,10 @@ define(['exports'], function (exports) { 'use strict';
           var scope;
           if (config.$initParent) {
               // 在面板上的组件
-              scope = config.$initParent.lookupReferenceHolder().yvanScope; //lookupScope(me)
+              scope = (_a = config.$initParent.lookupReferenceHolder()) === null || _a === void 0 ? void 0 : _a.yvanScope; //lookupScope(me)
+              if (!scope) {
+                  scope = config.$initParent.yvanScope;
+              }
           }
           else if (config.column) {
               // 在列上的组件
@@ -40748,8 +40845,10 @@ define(['exports'], function (exports) { 'use strict';
       ], FixClass.prototype, "fix", null);
       return FixClass;
   }());
+  //# sourceMappingURL=fix.js.map
 
   function init() {
+      Ext.util.Format.defaultDateFormat = 'Y-m-d';
       /**
        * 改变事件的触发方式
        */
@@ -40817,12 +40916,14 @@ define(['exports'], function (exports) { 'use strict';
       }
       lodash.extend(window['system'], SystemLib);
       initComponent();
+      initDate();
       initCols();
       initLocale();
       initGridColumn();
       initGrid();
       initStores();
   }
+  //# sourceMappingURL=init.js.map
 
   /**
    * 创建一个 Ajax 客户端
@@ -40995,6 +41096,7 @@ define(['exports'], function (exports) { 'use strict';
       };
       xhr.send(formData);
   }
+  //# sourceMappingURL=ajax.js.map
 
   exports.Lib = Lib;
   exports.LibParam = LibParam;

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/yvan-ext-mobile.js.map