wt-enjoy-link-antd-repack 4.2.26 → 4.2.27
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/dist/esm/component/BiuAAutoComplete/index.d.ts.map +1 -1
- package/dist/esm/component/BiuAAutoComplete/index.js +1 -1
- package/dist/esm/component/BiuField/component/TableSelectLocal/locationSelect.d.ts +0 -1
- package/dist/esm/component/BiuField/component/TableSelectLocal/locationSelect.d.ts.map +1 -1
- package/dist/esm/component/BiuField/component/TableSelectLocal/locationSelect.js +73 -71
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AA4BA;;GAEG;AACH,eAAO,MAAM,gBAAgB,KAAsC,CAAA"}
|
|
@@ -4,7 +4,7 @@ import { styled } from 'styled-components';
|
|
|
4
4
|
var StyledAutoSelect = styled(AutoComplete).withConfig({
|
|
5
5
|
displayName: "StyledAutoSelect",
|
|
6
6
|
componentId: "wt-enjoy-link-antd-repack__sc-1fel0eg-0"
|
|
7
|
-
})([".ant-select-auto-complete{height:28px !important;}.ant-select-selector,.ant-select-selection-search-input{height:28px !important;}.ant-select-selection-placeholder{line-height:28px !important;}.ant-select-selection-item{height:28px !important;line-height:28px !important;}.ant-select-selection-overflow-item{height:100% !important;}.ant-select-selection-search{height:100% !important;}"]);
|
|
7
|
+
})([".ant-select-auto-complete{height:28px !important;}.ant-select-selector,.ant-select-selection-search-input{height:28px !important;line-height:28px !important;}.ant-select-selection-placeholder{line-height:28px !important;}.ant-select-selection-item{height:28px !important;line-height:28px !important;}.ant-select-selection-overflow-item{height:100% !important;}.ant-select-selection-search{height:100% !important;}"]);
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @description: 为了统一样式,对antd的Select组件进行了封装
|
|
@@ -22,7 +22,6 @@ declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponen
|
|
|
22
22
|
isAutoGenerate?: string | undefined;
|
|
23
23
|
filterInv?: boolean | undefined;
|
|
24
24
|
isGoodType?: string | number | undefined;
|
|
25
|
-
isFirstLoad?: boolean | undefined;
|
|
26
25
|
isQueryScene?: number | undefined;
|
|
27
26
|
} & React.RefAttributes<unknown>>>;
|
|
28
27
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locationSelect.d.ts","sourceRoot":"","sources":["locationSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+D,MAAM,OAAO,CAAA
|
|
1
|
+
{"version":3,"file":"locationSelect.d.ts","sourceRoot":"","sources":["locationSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+D,MAAM,OAAO,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CnF,wBA0IC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["ownerId", "initialValue", "warehouseIds", "warehouseAreaId", "searchTimes", "
|
|
2
|
+
var _excluded = ["ownerId", "initialValue", "warehouseIds", "warehouseAreaId", "searchTimes", "rowLabel", "isDefWth", "goodsId", "batch", "isAutoGenerate", "filterInv", "isGoodType", "isQueryScene"];
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -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 {
|
|
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";
|
|
@@ -63,8 +63,6 @@ export default /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props,
|
|
|
63
63
|
warehouseAreaId = props.warehouseAreaId,
|
|
64
64
|
_props$searchTimes = props.searchTimes,
|
|
65
65
|
searchTimes = _props$searchTimes === void 0 ? 300 : _props$searchTimes,
|
|
66
|
-
_props$isFirstLoad = props.isFirstLoad,
|
|
67
|
-
isFirstLoad = _props$isFirstLoad === void 0 ? false : _props$isFirstLoad,
|
|
68
66
|
_props$rowLabel = props.rowLabel,
|
|
69
67
|
rowLabel = _props$rowLabel === void 0 ? 'locationCode' : _props$rowLabel,
|
|
70
68
|
_props$isDefWth = props.isDefWth,
|
|
@@ -78,81 +76,85 @@ export default /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props,
|
|
|
78
76
|
isGoodType = props.isGoodType,
|
|
79
77
|
isQueryScene = props.isQueryScene,
|
|
80
78
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
81
|
-
var _useState = useState(
|
|
79
|
+
var _useState = useState(),
|
|
82
80
|
_useState2 = _slicedToArray(_useState, 2),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
var _useState3 = useState(),
|
|
81
|
+
locationList = _useState2[0],
|
|
82
|
+
setLocationList = _useState2[1];
|
|
83
|
+
var _useState3 = useState(false),
|
|
86
84
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
var _useState5 = useState(
|
|
85
|
+
loading = _useState4[0],
|
|
86
|
+
setLoading = _useState4[1];
|
|
87
|
+
var _useState5 = useState(),
|
|
90
88
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
var _useState7 = useState(),
|
|
94
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
95
|
-
initSelectValue = _useState8[0],
|
|
96
|
-
setInitSelectValue = _useState8[1];
|
|
89
|
+
initSelectValue = _useState6[0],
|
|
90
|
+
setInitSelectValue = _useState6[1];
|
|
97
91
|
var timerRef = useRef();
|
|
98
92
|
useEffect(function () {
|
|
99
93
|
if (initialValue && !props.initSelectValue && (props.value === initialValue || props.value === undefined || props.value === null)) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
props.onChange
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
props.onChangeData
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
setLocationList([]);
|
|
135
|
-
setInitSelectValue(undefined);
|
|
136
|
-
if (props.onChange) {
|
|
137
|
-
props.onChange(undefined, undefined);
|
|
94
|
+
setLoading(true);
|
|
95
|
+
getWarehouseLoctionList({
|
|
96
|
+
warehouseLocationIds: initialValue,
|
|
97
|
+
warehouseIds: warehouseIds,
|
|
98
|
+
warehouseAreaId: warehouseAreaId,
|
|
99
|
+
goodsId: goodsId,
|
|
100
|
+
ownerId: ownerId,
|
|
101
|
+
defWth: isDefWth,
|
|
102
|
+
batch: batch,
|
|
103
|
+
page: 1,
|
|
104
|
+
size: 20,
|
|
105
|
+
isAutoGenerate: isAutoGenerate,
|
|
106
|
+
filterInv: filterInv,
|
|
107
|
+
isGoodType: isGoodType,
|
|
108
|
+
isQueryScene: isQueryScene
|
|
109
|
+
}).then(function (res) {
|
|
110
|
+
if (res !== null && res !== void 0 && res.length && res[0].id) {
|
|
111
|
+
setLocationList(res);
|
|
112
|
+
setInitSelectValue(res[0][rowLabel]);
|
|
113
|
+
if (props.onChange) {
|
|
114
|
+
props.onChange(initialValue, res[0]);
|
|
115
|
+
}
|
|
116
|
+
if (props.onChangeData) {
|
|
117
|
+
props.onChangeData(initialValue, res[0]);
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
setLocationList([]);
|
|
121
|
+
setInitSelectValue(undefined);
|
|
122
|
+
if (props.onChange) {
|
|
123
|
+
props.onChange(undefined, undefined);
|
|
124
|
+
}
|
|
125
|
+
if (props.onChangeData) {
|
|
126
|
+
props.onChangeData(undefined, {});
|
|
127
|
+
}
|
|
138
128
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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]);
|
|
129
|
+
}).finally(function () {
|
|
130
|
+
setLoading(false);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}, [initialValue, warehouseIds, goodsId, ownerId, isDefWth, batch, warehouseAreaId, props, isAutoGenerate, rowLabel, filterInv, isGoodType, isQueryScene]);
|
|
153
134
|
var onSearch = useCallback(function (sValue) {
|
|
154
|
-
|
|
155
|
-
|
|
135
|
+
if (timerRef.current) clearTimeout(timerRef.current);
|
|
136
|
+
timerRef.current = setTimeout(function () {
|
|
137
|
+
setLoading(true);
|
|
138
|
+
getWarehouseLoctionList({
|
|
139
|
+
warehouseIds: warehouseIds,
|
|
140
|
+
remoteSearchCValue: sValue,
|
|
141
|
+
goodsId: goodsId,
|
|
142
|
+
ownerId: ownerId,
|
|
143
|
+
defWth: isDefWth,
|
|
144
|
+
batch: batch,
|
|
145
|
+
page: 1,
|
|
146
|
+
size: 20,
|
|
147
|
+
isAutoGenerate: isAutoGenerate,
|
|
148
|
+
filterInv: filterInv,
|
|
149
|
+
isGoodType: isGoodType,
|
|
150
|
+
isQueryScene: isQueryScene
|
|
151
|
+
}).then(function (res) {
|
|
152
|
+
setLocationList(res);
|
|
153
|
+
}).finally(function () {
|
|
154
|
+
setLoading(false);
|
|
155
|
+
});
|
|
156
|
+
}, searchTimes);
|
|
157
|
+
}, [searchTimes, warehouseIds, goodsId, ownerId, isDefWth, batch, isAutoGenerate, filterInv, isGoodType, isQueryScene]);
|
|
156
158
|
return /*#__PURE__*/_jsx(TableSelectBase, _objectSpread(_objectSpread({
|
|
157
159
|
ref: ref
|
|
158
160
|
}, restProps), {}, {
|