wt-antd 4.2.48 → 4.2.50
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/BiuCustomSelect/index.d.ts.map +1 -1
- package/dist/esm/component/BiuCustomSelect/index.js +42 -5
- package/dist/esm/component/BiuField/component/carrierInfoSelect.d.ts.map +1 -1
- package/dist/esm/component/BiuField/component/carrierInfoSelect.js +22 -3
- package/dist/esm/package/requestWrapper/utils.d.ts +1 -1
- package/dist/esm/package/requestWrapper/utils.d.ts.map +1 -1
- package/dist/esm/package/requestWrapper/utils.js +5 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AACvC,OAAO,KAAwE,MAAM,OAAO,CAAA;AAG5F,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAiB;AAG9C,KAAK,SAAS,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;AAEtD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CACvB;AAsBD,eAAO,MAAM,eAAe;;;;gCAPC,OAAO,MAAM,EAAE,GAAG,CAAC,YAAY,OAAO,KAAK,OAAO;;yBAEzD,GAAG,KAAK,GAAG;2BACT,SAAS,KAAK,SAAS;+BACnB,GAAG,KAAK,YAAY,EAAE;kGA8KjD,CAAA"}
|
|
@@ -19,7 +19,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
19
19
|
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; }
|
|
20
20
|
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; }
|
|
21
21
|
import { useBoolean } from 'ahooks';
|
|
22
|
-
import React, { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
22
|
+
import React, { forwardRef, useCallback, useEffect, useMemo, useState, useRef } from 'react';
|
|
23
23
|
import { BiuASelect, BiuASelectOption } from "./..";
|
|
24
24
|
import { request } from "../../package";
|
|
25
25
|
|
|
@@ -102,7 +102,44 @@ export var BiuCustomSelect = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(fu
|
|
|
102
102
|
isSelectedValue(currentValue);
|
|
103
103
|
}
|
|
104
104
|
}, [formatValue, isSelectedValue, selectedValue, value]);
|
|
105
|
+
var prevDepsRef = useRef(null);
|
|
105
106
|
useEffect(function () {
|
|
107
|
+
var currentDeps = {
|
|
108
|
+
isOnReady: isOnReady,
|
|
109
|
+
onFetchData: onFetchData,
|
|
110
|
+
optionList: optionList,
|
|
111
|
+
requestConfig: requestConfig,
|
|
112
|
+
requestName: requestName,
|
|
113
|
+
requestParams: requestParams
|
|
114
|
+
};
|
|
115
|
+
if (prevDepsRef.current) {
|
|
116
|
+
var changedDeps = Object.entries(currentDeps).filter(function (_ref) {
|
|
117
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
118
|
+
key = _ref2[0],
|
|
119
|
+
value = _ref2[1];
|
|
120
|
+
var prevValue = prevDepsRef.current[key];
|
|
121
|
+
return JSON.stringify(value) !== JSON.stringify(prevValue);
|
|
122
|
+
});
|
|
123
|
+
if (changedDeps.length > 0) {
|
|
124
|
+
console.groupCollapsed('🔍 BiuCustomSelect 请求触发原因分析');
|
|
125
|
+
console.log('触发时间:', new Date().toLocaleString());
|
|
126
|
+
console.log('变化的依赖项:', changedDeps.map(function (_ref3) {
|
|
127
|
+
var _ref4 = _slicedToArray(_ref3, 1),
|
|
128
|
+
key = _ref4[0];
|
|
129
|
+
return key;
|
|
130
|
+
}));
|
|
131
|
+
changedDeps.forEach(function (_ref5) {
|
|
132
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
133
|
+
key = _ref6[0],
|
|
134
|
+
value = _ref6[1];
|
|
135
|
+
console.log(" \u2022 ".concat(key, ":"));
|
|
136
|
+
console.log(" \u65E7\u503C:", prevDepsRef.current[key]);
|
|
137
|
+
console.log(" \u65B0\u503C:", value);
|
|
138
|
+
});
|
|
139
|
+
console.groupEnd();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
prevDepsRef.current = currentDeps;
|
|
106
143
|
if (isOnReady && isOnReady(requestParams) && requestName) {
|
|
107
144
|
setTrue();
|
|
108
145
|
request({
|
|
@@ -147,10 +184,10 @@ export var BiuCustomSelect = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(fu
|
|
|
147
184
|
isSelectedValue(selectValue);
|
|
148
185
|
if (_onChange) _onChange(selectValue, option);
|
|
149
186
|
},
|
|
150
|
-
children: listSource.map(function (
|
|
151
|
-
var label =
|
|
152
|
-
v =
|
|
153
|
-
options = _objectWithoutProperties(
|
|
187
|
+
children: listSource.map(function (_ref7) {
|
|
188
|
+
var label = _ref7.label,
|
|
189
|
+
v = _ref7.value,
|
|
190
|
+
options = _objectWithoutProperties(_ref7, _excluded2);
|
|
154
191
|
return /*#__PURE__*/_jsx(BiuASelectOption, _objectSpread(_objectSpread({
|
|
155
192
|
value: v
|
|
156
193
|
}, options), {}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"carrierInfoSelect.d.ts","sourceRoot":"","sources":["carrierInfoSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAe,MAAM,gBAAgB,CAAA;AAE5E,OAAO,
|
|
1
|
+
{"version":3,"file":"carrierInfoSelect.d.ts","sourceRoot":"","sources":["carrierInfoSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAe,MAAM,gBAAgB,CAAA;AAE5E,OAAO,KAAwE,MAAM,OAAO,CAAA;;;;;;;;;;;AAkB5F,wBAsJC"}
|
|
@@ -14,7 +14,7 @@ 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
16
|
import { toString } from 'lodash';
|
|
17
|
-
import React, { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';
|
|
17
|
+
import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
18
18
|
import { BiuCustomSelect } from "../..";
|
|
19
19
|
import { GATEWAY_ROUTE_MDM } from "../../../constant";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -59,12 +59,31 @@ export default /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function (props,
|
|
|
59
59
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
60
60
|
carriername = _useState10[0],
|
|
61
61
|
setCarriername = _useState10[1];
|
|
62
|
+
var searchTimerRef = useRef(null);
|
|
62
63
|
var handleSearch = useCallback(function (svalue) {
|
|
63
64
|
if (!clientid && requiredOwner === true) return;
|
|
64
65
|
setNotFoundContent(undefined);
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
|
|
67
|
+
// 清除之前的定时器
|
|
68
|
+
if (searchTimerRef.current) {
|
|
69
|
+
clearTimeout(searchTimerRef.current);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 防抖处理,300ms后才真正触发搜索
|
|
73
|
+
searchTimerRef.current = setTimeout(function () {
|
|
74
|
+
setCarriername(svalue);
|
|
75
|
+
setIsFirstLoadSearch(true);
|
|
76
|
+
}, 300);
|
|
67
77
|
}, [clientid, requiredOwner]);
|
|
78
|
+
|
|
79
|
+
// 组件卸载时清除定时器
|
|
80
|
+
useEffect(function () {
|
|
81
|
+
return function () {
|
|
82
|
+
if (searchTimerRef.current) {
|
|
83
|
+
clearTimeout(searchTimerRef.current);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}, []);
|
|
68
87
|
useEffect(function () {
|
|
69
88
|
if (restProps.labelInValue) {
|
|
70
89
|
setNewValue(value);
|
|
@@ -7,4 +7,4 @@ import type { RequestConfig } from './type';
|
|
|
7
7
|
* @param isMock mock 数据
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
export declare const generalRequestURI: (requestConfig: RequestConfig | undefined, apiName: string, isDubbo
|
|
10
|
+
export declare const generalRequestURI: (requestConfig: RequestConfig | undefined, apiName: string, isDubbo: boolean | number) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAS3C;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,sDAEnB,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAS3C;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,sDAEnB,MAAM,WACN,OAAO,GAAG,MAAM,WAqB1B,CAAA"}
|
|
@@ -22,7 +22,7 @@ var defaultRequestConfig = {
|
|
|
22
22
|
export var generalRequestURI = function generalRequestURI() {
|
|
23
23
|
var requestConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
24
24
|
var apiName = arguments.length > 1 ? arguments[1] : undefined;
|
|
25
|
-
var isDubbo = arguments.length > 2
|
|
25
|
+
var isDubbo = arguments.length > 2 ? arguments[2] : undefined;
|
|
26
26
|
// 前端传入时会覆盖默认环境变量
|
|
27
27
|
var _defaultRequestConfig = _objectSpread(_objectSpread({}, defaultRequestConfig), requestConfig),
|
|
28
28
|
DefaultGateway = _defaultRequestConfig.DefaultGateway,
|
|
@@ -31,9 +31,12 @@ export var generalRequestURI = function generalRequestURI() {
|
|
|
31
31
|
Version = _defaultRequestConfig.Version;
|
|
32
32
|
|
|
33
33
|
// 如果是Dubbo调用,需要调整URI拼接逻辑
|
|
34
|
-
if (isDubbo) {
|
|
34
|
+
if (isDubbo === true) {
|
|
35
35
|
return "".concat(DefaultApiUrl).concat(apiName);
|
|
36
36
|
}
|
|
37
|
+
if (isDubbo === 1) {
|
|
38
|
+
return "".concat(DefaultGateway).concat(apiName);
|
|
39
|
+
}
|
|
37
40
|
// 版本号拼接字符串
|
|
38
41
|
var versionStr = Version && Version !== '' ? "&v=".concat(Version) : '';
|
|
39
42
|
|