vap1 0.6.7 → 0.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -248,7 +248,7 @@ var VTableRoot = (0, react_1.forwardRef)(function (props, ref) {
248
248
  };
249
249
  }, [selectedRowKeys, param]);
250
250
  var boxBaseProps = (0, react_1.useMemo)(function () {
251
- var boxProps = lodash_1.default.pick(props, ['selectBar', 'style', 'className', 'default', 'mode']);
251
+ var boxProps = lodash_1.default.pick(props, ['selectBar', 'style', 'className', 'default', 'defaultParam', 'mode']);
252
252
  if (props.actionBar) {
253
253
  if (lodash_1.default.isArray(props.actionBar)) {
254
254
  if (props.actionBar.length) {
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"vap1","version":"0.6.7","description":"vap1, Both support MicroService and SAP FrameWork, Support IE>9","main":"index.js","author":"Xiang da","license":"ISC"}
1
+ {"name":"vap1","version":"0.6.8","description":"vap1, Both support MicroService and SAP FrameWork, Support IE>9","main":"index.js","author":"Xiang da","license":"ISC"}
package/utils/VAP.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ type VapLoadFn = () => void;
1
2
  /**
2
3
  * VAP 是系统配置工具类,用于读取 xxx_conf 表的配置
3
4
  */
@@ -32,11 +33,15 @@ export type VAP = {
32
33
  * 获取浮点数配置
33
34
  */
34
35
  getFloat: (key: string, defaultValue?: number) => number;
36
+ /**
37
+ * 初始化后调用方式
38
+ */
39
+ ready: (fn: VapLoadFn) => void;
35
40
  };
36
41
  declare const _VAP: VAP;
37
42
  export declare const _SET: (key: string, text: string) => void;
38
43
  /**
39
44
  * 初始化,仅在入口脚本里面使用
40
45
  */
41
- export declare const _INIT: (confs: Record<string, string>[]) => void[];
46
+ export declare const _INIT: (confs: Record<string, string>[]) => void;
42
47
  export default _VAP;
package/utils/VAP.js CHANGED
@@ -45,8 +45,18 @@ var _Support_1 = require("./_Support");
45
45
  var Ajax_1 = require("./Ajax");
46
46
  var Global_1 = require("./Global");
47
47
  var StringUtil_1 = require("./StringUtil");
48
+ var _VAP_LOAD_FN = (0, _Support_1.globalDefault)('_VAP_LOAD_FN', { loaded: false, fns: [] });
48
49
  var defaultVAP = function () {
49
50
  return {
51
+ // loaded:false,
52
+ ready: function (fn) {
53
+ if (_VAP_LOAD_FN.loaded) {
54
+ fn();
55
+ }
56
+ else {
57
+ _VAP_LOAD_FN.fns.push(fn);
58
+ }
59
+ },
50
60
  KEYMAP: new Map(),
51
61
  system_version: '',
52
62
  has: function (key) { return _VAP.KEYMAP.has(key); },
@@ -96,13 +106,23 @@ exports._SET = _SET;
96
106
  /**
97
107
  * 初始化,仅在入口脚本里面使用
98
108
  */
99
- var _INIT = function (confs) { return (confs || []).map(function (item) {
100
- var value = lodash_1.default.trim(item.confValue);
101
- if (value)
102
- _VAP.KEYMAP.set(item.confId, value);
103
- if (item.confId == 'system_version') {
104
- _VAP.system_version = value;
109
+ var _INIT = function (confs) {
110
+ (confs || []).map(function (item) {
111
+ var value = lodash_1.default.trim(item.confValue);
112
+ if (value)
113
+ _VAP.KEYMAP.set(item.confId, value);
114
+ if (item.confId == 'system_version') {
115
+ _VAP.system_version = value;
116
+ }
117
+ });
118
+ _VAP_LOAD_FN.loaded = true;
119
+ // console.log('load', _VAP_LOAD_FN.fns)
120
+ while (_VAP_LOAD_FN.fns.length > 0) {
121
+ var fn = _VAP_LOAD_FN.fns.shift();
122
+ if (typeof fn == 'function') {
123
+ fn();
124
+ }
105
125
  }
106
- }); };
126
+ };
107
127
  exports._INIT = _INIT;
108
128
  exports.default = _VAP;