wt-enjoy-link-antd-repack 4.2.24 → 4.2.26

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.
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @description: 为了统一样式,对antd的Select组件进行了封装
3
+ */
4
+ export declare const BiuAAutoComplete: any;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AA2BA;;GAEG;AACH,eAAO,MAAM,gBAAgB,KAAsC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { AutoComplete } from 'antd';
2
+ import React from 'react';
3
+ import { styled } from 'styled-components';
4
+ var StyledAutoSelect = styled(AutoComplete).withConfig({
5
+ displayName: "StyledAutoSelect",
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;}"]);
8
+
9
+ /**
10
+ * @description: 为了统一样式,对antd的Select组件进行了封装
11
+ */
12
+ export var BiuAAutoComplete = /*#__PURE__*/React.memo(StyledAutoSelect);
13
+ BiuAAutoComplete.displayName = 'BiuAAutoComplete';
@@ -3,16 +3,16 @@ export declare const BiuAButton: React.MemoExoticComponent<import("styled-compon
3
3
  href: string;
4
4
  target?: string | undefined;
5
5
  onClick?: React.MouseEventHandler<HTMLElement> | undefined;
6
- } & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "type" | "onClick"> & {
6
+ } & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "onClick" | "type"> & {
7
7
  htmlType?: "button" | "submit" | "reset" | undefined;
8
8
  onClick?: React.MouseEventHandler<HTMLElement> | undefined;
9
- } & Omit<React.ButtonHTMLAttributes<any>, "type" | "onClick">> & React.RefAttributes<HTMLElement>, never>> & Omit<React.ForwardRefExoticComponent<Partial<{
9
+ } & Omit<React.ButtonHTMLAttributes<any>, "onClick" | "type">> & React.RefAttributes<HTMLElement>, never>> & Omit<React.ForwardRefExoticComponent<Partial<{
10
10
  href: string;
11
11
  target?: string | undefined;
12
12
  onClick?: React.MouseEventHandler<HTMLElement> | undefined;
13
- } & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "type" | "onClick"> & {
13
+ } & import("antd/lib/button/button").BaseButtonProps & Omit<React.AnchorHTMLAttributes<any>, "onClick" | "type"> & {
14
14
  htmlType?: "button" | "submit" | "reset" | undefined;
15
15
  onClick?: React.MouseEventHandler<HTMLElement> | undefined;
16
- } & Omit<React.ButtonHTMLAttributes<any>, "type" | "onClick">> & React.RefAttributes<HTMLElement>> & {
16
+ } & Omit<React.ButtonHTMLAttributes<any>, "onClick" | "type">> & React.RefAttributes<HTMLElement>> & {
17
17
  Group: React.FC<import("antd/lib/button").ButtonGroupProps>;
18
18
  }, keyof React.Component<any, {}, any>>>;
@@ -22,5 +22,7 @@ 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
+ isQueryScene?: number | undefined;
25
27
  } & React.RefAttributes<unknown>>>;
26
28
  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;;;;;;;;;;;;;;;;;;;;;;;;;AA0CnF,wBAqIC"}
1
+ {"version":3,"file":"locationSelect.d.ts","sourceRoot":"","sources":["locationSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAA+D,MAAM,OAAO,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CnF,wBAoIC"}
@@ -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", "rowLabel", "isDefWth", "goodsId", "batch", "isAutoGenerate", "filterInv", "isGoodType"];
2
+ var _excluded = ["ownerId", "initialValue", "warehouseIds", "warehouseAreaId", "searchTimes", "isFirstLoad", "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 { isNil } from 'lodash';
16
+ import { debounce, 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,6 +63,8 @@ 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,
66
68
  _props$rowLabel = props.rowLabel,
67
69
  rowLabel = _props$rowLabel === void 0 ? 'locationCode' : _props$rowLabel,
68
70
  _props$isDefWth = props.isDefWth,
@@ -74,84 +76,83 @@ export default /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props,
74
76
  _props$filterInv = props.filterInv,
75
77
  filterInv = _props$filterInv === void 0 ? false : _props$filterInv,
76
78
  isGoodType = props.isGoodType,
79
+ isQueryScene = props.isQueryScene,
77
80
  restProps = _objectWithoutProperties(props, _excluded);
78
- var _useState = useState(),
81
+ var _useState = useState(isFirstLoad),
79
82
  _useState2 = _slicedToArray(_useState, 2),
80
- locationList = _useState2[0],
81
- setLocationList = _useState2[1];
82
- var _useState3 = useState(false),
83
+ isFirstLoadSearch = _useState2[0],
84
+ setIsFirstLoadSearch = _useState2[1];
85
+ var _useState3 = useState(),
83
86
  _useState4 = _slicedToArray(_useState3, 2),
84
- loading = _useState4[0],
85
- setLoading = _useState4[1];
86
- var _useState5 = useState(),
87
+ locationList = _useState4[0],
88
+ setLocationList = _useState4[1];
89
+ var _useState5 = useState(false),
87
90
  _useState6 = _slicedToArray(_useState5, 2),
88
- initSelectValue = _useState6[0],
89
- setInitSelectValue = _useState6[1];
91
+ loading = _useState6[0],
92
+ setLoading = _useState6[1];
93
+ var _useState7 = useState(),
94
+ _useState8 = _slicedToArray(_useState7, 2),
95
+ initSelectValue = _useState8[0],
96
+ setInitSelectValue = _useState8[1];
90
97
  var timerRef = useRef();
91
98
  useEffect(function () {
92
99
  if (initialValue && !props.initSelectValue && (props.value === initialValue || props.value === undefined || props.value === null)) {
93
- setLoading(true);
94
- getWarehouseLoctionList({
95
- warehouseLocationIds: initialValue,
96
- warehouseIds: warehouseIds,
97
- warehouseAreaId: warehouseAreaId,
98
- goodsId: goodsId,
99
- ownerId: ownerId,
100
- defWth: isDefWth,
101
- batch: batch,
102
- page: 1,
103
- size: 20,
104
- isAutoGenerate: isAutoGenerate,
105
- filterInv: filterInv,
106
- isGoodType: isGoodType
107
- }).then(function (res) {
108
- if (res !== null && res !== void 0 && res.length && res[0].id) {
109
- setLocationList(res);
110
- setInitSelectValue(res[0][rowLabel]);
111
- if (props.onChange) {
112
- props.onChange(initialValue, res[0]);
113
- }
114
- if (props.onChangeData) {
115
- props.onChangeData(initialValue, res[0]);
116
- }
117
- } else {
118
- setLocationList([]);
119
- setInitSelectValue(undefined);
120
- if (props.onChange) {
121
- props.onChange(undefined, undefined);
122
- }
123
- if (props.onChangeData) {
124
- props.onChangeData(undefined, {});
125
- }
126
- }
127
- }).finally(function () {
128
- setLoading(false);
129
- });
100
+ debounceFetchData();
130
101
  }
131
- }, [initialValue, warehouseIds, goodsId, ownerId, isDefWth, batch, warehouseAreaId, props, isAutoGenerate, rowLabel, filterInv, isGoodType]);
132
- var onSearch = useCallback(function (sValue) {
133
- if (timerRef.current) clearTimeout(timerRef.current);
134
- timerRef.current = setTimeout(function () {
135
- setLoading(true);
136
- getWarehouseLoctionList({
137
- warehouseIds: warehouseIds,
138
- remoteSearchCValue: sValue,
139
- goodsId: goodsId,
140
- ownerId: ownerId,
141
- defWth: isDefWth,
142
- batch: batch,
143
- page: 1,
144
- size: 20,
145
- isAutoGenerate: isAutoGenerate,
146
- filterInv: filterInv,
147
- isGoodType: isGoodType
148
- }).then(function (res) {
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) {
149
125
  setLocationList(res);
150
- }).finally(function () {
151
- setLoading(false);
152
- });
153
- }, searchTimes);
154
- }, [searchTimes, warehouseIds, goodsId, ownerId, isDefWth, batch, isAutoGenerate, filterInv, isGoodType]);
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);
138
+ }
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]);
153
+ var onSearch = useCallback(function (sValue) {
154
+ debounceFetchData(sValue);
155
+ }, []);
155
156
  return /*#__PURE__*/_jsx(TableSelectBase, _objectSpread(_objectSpread({
156
157
  ref: ref
157
158
  }, restProps), {}, {
@@ -1 +1 @@
1
- {"version":3,"file":"lpnSelectNew.d.ts","sourceRoot":"","sources":["lpnSelectNew.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAEvC,OAAO,KAAuD,MAAM,OAAO,CAAA;;;;;;;;;;;;;;;AAgC3E,wBAsJC"}
1
+ {"version":3,"file":"lpnSelectNew.d.ts","sourceRoot":"","sources":["lpnSelectNew.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AACvC,OAAO,KAAuD,MAAM,OAAO,CAAA;;;;;;;;;;;;;;;AAiC3E,wBAsJC"}
@@ -13,12 +13,12 @@ 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 { AutoComplete } from 'antd';
17
16
  import React, { forwardRef, useCallback, useEffect, useState } from 'react';
18
17
  import { BiuASelect, BiuASelectOption } from "../../BiuASelect";
19
18
  import { GATEWAY_ROUTE_WMS } from "../../../constant";
20
19
  import { request } from "../../../package";
21
20
  import { debounce } from 'lodash';
21
+ import { BiuAAutoComplete } from "../../BiuAAutoComplete";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
23
23
  import { Fragment as _Fragment } from "react/jsx-runtime";
24
24
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -137,7 +137,7 @@ export default /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props,
137
137
  setLpnCode(value);
138
138
  }, []);
139
139
  return /*#__PURE__*/_jsxs(_Fragment, {
140
- children: [isAutoComplete && /*#__PURE__*/_jsx(AutoComplete, {
140
+ children: [isAutoComplete && /*#__PURE__*/_jsx(BiuAAutoComplete, {
141
141
  popupClassName: "certain-category-search-dropdown"
142
142
  // dropdownMatchSelectWidth={100}
143
143
  ,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0E,MAAM,OAAO,CAAA;AAG9F,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,QAAQ,CAAA;AA0D3D,eAAO,MAAM,OAAO;;;;;;;;;;kFAgOnB,CAAA;AACD,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0E,MAAM,OAAO,CAAA;AAG9F,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,QAAQ,CAAA;AA0D3D,eAAO,MAAM,OAAO;;;;;;;;;;kFA8NnB,CAAA;AACD,cAAc,QAAQ,CAAA"}
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { DownOutlined, ReloadOutlined, SearchOutlined, UpOutlined } from '@ant-design/icons';
13
+ import { DownOutlined, UpOutlined } from '@ant-design/icons';
14
14
  import { Col, Row, Space, Tooltip } from 'antd';
15
15
  import { pick } from 'lodash';
16
16
  import moment from 'moment';
@@ -243,13 +243,11 @@ export var BiuForm = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (
243
243
  children: btn.label
244
244
  }, index);
245
245
  }) : null, !((searchBtns === null || searchBtns === void 0 ? void 0 : searchBtns.length) > 0) ? /*#__PURE__*/_jsx(BiuAButton, {
246
- icon: /*#__PURE__*/_jsx(SearchOutlined, {}),
247
246
  type: "primary",
248
247
  htmlType: "submit",
249
248
  children: "\u67E5\u8BE2"
250
249
  }) : null, /*#__PURE__*/_jsx(BiuAButton, {
251
250
  onClick: onFormReset,
252
- icon: /*#__PURE__*/_jsx(ReloadOutlined, {}),
253
251
  children: "\u91CD\u7F6E"
254
252
  }), formInLine ? null : /*#__PURE__*/_jsxs(BiuAButton, {
255
253
  type: "link",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wt-enjoy-link-antd-repack",
3
- "version": "4.2.24",
3
+ "version": "4.2.26",
4
4
  "description": "万通业务组件",
5
5
  "sideEffects": false,
6
6
  "main": "dist/esm/index.js",