wt-enjoy-link-antd-repack 4.2.30 → 4.2.34

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.
@@ -1 +1 @@
1
- {"version":3,"file":"locationSelect.d.ts","sourceRoot":"","sources":["locationSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+D,MAAM,OAAO,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CnF,wBAoIC"}
1
+ {"version":3,"file":"locationSelect.d.ts","sourceRoot":"","sources":["locationSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+D,MAAM,OAAO,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CnF,wBA4IC"}
@@ -13,7 +13,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
13
13
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
14
14
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
15
15
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
- import { debounce, isNil } from 'lodash';
16
+ import { isNil } from 'lodash';
17
17
  import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
18
18
  import TableSelectBase from "./base";
19
19
  import { GATEWAY_ROUTE_WMS } from "../../../../constant";
@@ -97,62 +97,70 @@ export default /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props,
97
97
  var timerRef = useRef();
98
98
  useEffect(function () {
99
99
  if (initialValue && !props.initSelectValue && (props.value === initialValue || props.value === undefined || props.value === null)) {
100
- debounceFetchData();
101
- }
102
- }, [initialValue, warehouseIds, goodsId, ownerId, isDefWth, batch, warehouseAreaId, isAutoGenerate, rowLabel, isQueryScene, filterInv, isGoodType, props.value]);
103
- var fetchData = useCallback(function (sValue) {
104
- setLoading(true);
105
- // 1 查 locationType in (1,2,4,5,9) or locationCode = 'RETURN'
106
- // 2 查 locationType in (1,2,4,5,6,7,9)
107
- // 3 查 locationType in (1,2,4,5,6,7,9) or locationCode = 'RETURN'
108
- getWarehouseLoctionList({
109
- remoteSearchCValue: sValue,
110
- warehouseLocationIds: initialValue,
111
- warehouseIds: warehouseIds,
112
- warehouseAreaId: warehouseAreaId,
113
- goodsId: goodsId,
114
- ownerId: ownerId,
115
- defWth: isDefWth,
116
- batch: batch,
117
- page: 1,
118
- size: 20,
119
- isAutoGenerate: isAutoGenerate,
120
- filterInv: filterInv,
121
- isGoodType: isGoodType,
122
- isQueryScene: isQueryScene
123
- }).then(function (res) {
124
- if (res !== null && res !== void 0 && res.length && res[0].id) {
125
- setLocationList(res);
126
- setInitSelectValue(res[0][rowLabel]);
127
- if (props.onChange) {
128
- props.onChange(initialValue, res[0]);
129
- }
130
- if (props.onChangeData) {
131
- props.onChangeData(initialValue, res[0]);
132
- }
133
- } else {
134
- setLocationList([]);
135
- setInitSelectValue(undefined);
136
- if (props.onChange) {
137
- props.onChange(undefined, undefined);
100
+ setLoading(true);
101
+ getWarehouseLoctionList({
102
+ warehouseLocationIds: initialValue,
103
+ warehouseIds: warehouseIds,
104
+ warehouseAreaId: warehouseAreaId,
105
+ goodsId: goodsId,
106
+ ownerId: ownerId,
107
+ defWth: isDefWth,
108
+ batch: batch,
109
+ page: 1,
110
+ size: 20,
111
+ isAutoGenerate: isAutoGenerate,
112
+ filterInv: filterInv,
113
+ isGoodType: isGoodType,
114
+ isQueryScene: isQueryScene
115
+ }).then(function (res) {
116
+ if (res !== null && res !== void 0 && res.length && res[0].id) {
117
+ setLocationList(res);
118
+ setInitSelectValue(res[0][rowLabel]);
119
+ if (props.onChange) {
120
+ props.onChange(initialValue, res[0]);
121
+ }
122
+ if (props.onChangeData) {
123
+ props.onChangeData(initialValue, res[0]);
124
+ }
125
+ } else {
126
+ setLocationList([]);
127
+ setInitSelectValue(undefined);
128
+ if (props.onChange) {
129
+ props.onChange(undefined, undefined);
130
+ }
131
+ if (props.onChangeData) {
132
+ props.onChangeData(undefined, {});
133
+ }
138
134
  }
139
- if (props.onChangeData) {
140
- props.onChangeData(undefined, {});
141
- }
142
- }
143
- }).finally(function () {
144
- setLoading(false);
145
- });
146
- }, [warehouseIds, goodsId, ownerId, isDefWth, batch, warehouseAreaId, isAutoGenerate, rowLabel, filterInv, isGoodType, isQueryScene]);
147
- var debounceFetchData = debounce(function (sValue) {
148
- return fetchData(sValue);
149
- }, searchTimes);
150
- useEffect(function () {
151
- if (isFirstLoadSearch) debounceFetchData();
152
- }, [isFirstLoadSearch]);
135
+ }).finally(function () {
136
+ setLoading(false);
137
+ });
138
+ }
139
+ }, [initialValue, warehouseIds, goodsId, ownerId, isDefWth, batch, warehouseAreaId, props, isAutoGenerate, rowLabel, filterInv, isGoodType, isQueryScene]);
153
140
  var onSearch = useCallback(function (sValue) {
154
- debounceFetchData(sValue);
155
- }, []);
141
+ if (timerRef.current) clearTimeout(timerRef.current);
142
+ timerRef.current = setTimeout(function () {
143
+ setLoading(true);
144
+ getWarehouseLoctionList({
145
+ warehouseIds: warehouseIds,
146
+ remoteSearchCValue: sValue,
147
+ goodsId: goodsId,
148
+ ownerId: ownerId,
149
+ defWth: isDefWth,
150
+ batch: batch,
151
+ page: 1,
152
+ size: 20,
153
+ isAutoGenerate: isAutoGenerate,
154
+ filterInv: filterInv,
155
+ isGoodType: isGoodType,
156
+ isQueryScene: isQueryScene
157
+ }).then(function (res) {
158
+ setLocationList(res);
159
+ }).finally(function () {
160
+ setLoading(false);
161
+ });
162
+ }, searchTimes);
163
+ }, [searchTimes, warehouseIds, goodsId, ownerId, isDefWth, batch, isAutoGenerate, filterInv, isGoodType, isQueryScene]);
156
164
  return /*#__PURE__*/_jsx(TableSelectBase, _objectSpread(_objectSpread({
157
165
  ref: ref
158
166
  }, restProps), {}, {
@@ -1,5 +1,5 @@
1
1
  import { TrackEvent } from "../types/track";
2
- export declare const useUmeng: () => {
2
+ export declare const useUmeng: (debug?: boolean) => {
3
3
  trackPageView: (pageName?: string, pageUrl?: string) => void;
4
4
  trackEvent: (event: TrackEvent) => false | undefined;
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useUmeng.d.ts","sourceRoot":"","sources":["useUmeng.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,UAAU,EAAgB,uBAAqB;AAIzE,eAAO,MAAM,QAAQ;+BAyHL,MAAM,YAAY,MAAM;wBA7BX,UAAU;CAyEtC,CAAA"}
1
+ {"version":3,"file":"useUmeng.d.ts","sourceRoot":"","sources":["useUmeng.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,UAAU,EAAgB,uBAAqB;AAIzE,eAAO,MAAM,QAAQ;+BAuHL,MAAM,YAAY,MAAM;wBA7BX,UAAU;CAyEtC,CAAA"}
@@ -3,7 +3,7 @@ import { UmengButtonType, UmengSysType } from "../types/track";
3
3
  import { getButtonFunction, getButtonType } from "../utils/umeng";
4
4
  import { useCallback } from 'react';
5
5
  export var useUmeng = function useUmeng() {
6
- var debug = true;
6
+ var debug = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
7
7
  var isParentWindow = window !== window.parent;
8
8
 
9
9
  // 日志函数
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wt-enjoy-link-antd-repack",
3
- "version": "4.2.30",
3
+ "version": "4.2.34",
4
4
  "description": "万通业务组件",
5
5
  "sideEffects": false,
6
6
  "main": "dist/esm/index.js",