ls-pro-common 3.1.16 → 3.1.18

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.
package/es/http/index.js CHANGED
@@ -14,7 +14,7 @@ var httpStatus = {
14
14
  503: '请求的服务器异常',
15
15
  504: '请求服务超时'
16
16
  };
17
- var browserId = getCache('browserId') || '';
17
+ var browserId = '';
18
18
  (function () {
19
19
  setTimeout(function () {
20
20
  getBrowserId().then(function (id) {
@@ -58,9 +58,15 @@ request.interceptors.request.use(function (url, options) {
58
58
  // @ts-ignore
59
59
  options.headers.browserId = browserId;
60
60
  } else {
61
- getBrowserId().then(function (id) {
62
- browserId = id;
63
- });
61
+ if (getCache('browserId')) {
62
+ browserId = getCache('browserId');
63
+ // @ts-ignore
64
+ options.headers.browserId = browserId;
65
+ } else {
66
+ getBrowserId().then(function (id) {
67
+ browserId = id;
68
+ });
69
+ }
64
70
  }
65
71
  // 处理门店
66
72
  var shopNo = getCacheSessionFirst('shopNo');
@@ -48,7 +48,7 @@ export declare type InputTableProps = ProFormItemProps<InputProps> & {
48
48
  /** @name 选择行事件 */
49
49
  onSelectChange?: (item: any, formRef?: any) => void;
50
50
  /** @name 加载之前事件,param为查询条件对象,可以通过此方法调整 */
51
- beforeLoad?: (param: any) => void;
51
+ beforeLoad?: (param: any) => any;
52
52
  /** @name 加载之后事件,row为接口返回数据,可以通过此方法调整 */
53
53
  afterLoad?: (rows: any[]) => void;
54
54
  getPopupContainer?: (triggerNode: any) => HTMLElement;
@@ -108,7 +108,7 @@ declare const InputTable: React.ForwardRefExoticComponent<{
108
108
  /** @name 选择行事件 */
109
109
  onSelectChange?: ((item: any, formRef?: any) => void) | undefined;
110
110
  /** @name 加载之前事件,param为查询条件对象,可以通过此方法调整 */
111
- beforeLoad?: ((param: any) => void) | undefined;
111
+ beforeLoad?: ((param: any) => any) | undefined;
112
112
  /** @name 加载之后事件,row为接口返回数据,可以通过此方法调整 */
113
113
  afterLoad?: ((rows: any[]) => void) | undefined;
114
114
  getPopupContainer?: ((triggerNode: any) => HTMLElement) | undefined;
@@ -141,7 +141,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
141
141
  };
142
142
  var loadData = /*#__PURE__*/function () {
143
143
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(param) {
144
- var current, pageSize, restParams, _selectRowRef$current, _rows, data, _tableRef$current2, _tableRef$current2$cl, result, rows, formValue, val, _selectRowRef$current2, arr, pageSelectedRows;
144
+ var current, pageSize, restParams, _selectRowRef$current, _rows, data, _tableRef$current2, _tableRef$current2$cl, _param, result, rows, formValue, val, _selectRowRef$current2, arr, pageSelectedRows;
145
145
  return _regeneratorRuntime.wrap(function _callee$(_context) {
146
146
  while (1) switch (_context.prev = _context.next) {
147
147
  case 0:
@@ -185,7 +185,10 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
185
185
  (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$cl = _tableRef$current2.clearSelected) === null || _tableRef$current2$cl === void 0 ? void 0 : _tableRef$current2$cl.call(_tableRef$current2);
186
186
  }
187
187
  if (beforeLoad) {
188
- beforeLoad(data);
188
+ _param = beforeLoad(data);
189
+ if (typeof _param !== 'boolean' && _param !== undefined) {
190
+ data = _param;
191
+ }
189
192
  }
190
193
  if (!(method !== 'GET')) {
191
194
  _context.next = 20;
@@ -36,7 +36,7 @@ declare function useDtl(dtlParam: DtlParamType): {
36
36
  onRemoveDtl: (rows?: any) => void;
37
37
  onSaveDtl: (formData: any) => Promise<boolean>;
38
38
  onLoadDtl: (params: Record<string, any>, sort: Record<string, any>, filter: Record<string, any>) => Promise<any>;
39
- onAddDtl: (item?: any) => Promise<boolean>;
39
+ onAddDtl: (item?: any) => Promise<boolean | undefined>;
40
40
  onEditDtl: (item?: any) => Promise<boolean>;
41
41
  onSaveMst: (values: any) => Promise<boolean>;
42
42
  onSaveMstDtl: (isDelete?: boolean) => Promise<boolean | undefined>;