@xfe-repo/web-components 1.7.2 → 1.7.3
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/index.css +9 -9
- package/dist/index.d.mts +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +306 -237
- package/dist/index.mjs +256 -187
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -4383,10 +4383,12 @@ var import_antd23 = require("antd");
|
|
|
4383
4383
|
var import_immutable2 = __toESM(require("swr/immutable"));
|
|
4384
4384
|
function useBrandOptions(params) {
|
|
4385
4385
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
4386
|
-
var _ref = (0, import_immutable2.default)(
|
|
4386
|
+
var _ref = (0, import_immutable2.default)(// 只有当 params 存在时才发起请求,避免无效请求
|
|
4387
|
+
params != null ? [
|
|
4387
4388
|
"/product/brand/combo-box",
|
|
4388
4389
|
params
|
|
4389
|
-
], function() {
|
|
4390
|
+
] : null, function(param) {
|
|
4391
|
+
var _param = _sliced_to_array(param, 2), _params = _param[1];
|
|
4390
4392
|
return _async_to_generator(function() {
|
|
4391
4393
|
var _res_data, res, options;
|
|
4392
4394
|
return _ts_generator(this, function(_state) {
|
|
@@ -4397,7 +4399,7 @@ function useBrandOptions(params) {
|
|
|
4397
4399
|
apiService.brandComboBox(_object_spread({
|
|
4398
4400
|
page: 1,
|
|
4399
4401
|
pageSize: 500
|
|
4400
|
-
},
|
|
4402
|
+
}, _params), config)
|
|
4401
4403
|
];
|
|
4402
4404
|
case 1:
|
|
4403
4405
|
res = _state.sent();
|
|
@@ -4718,28 +4720,21 @@ var index_module_default10 = {
|
|
|
4718
4720
|
input: "index_module_input2"
|
|
4719
4721
|
};
|
|
4720
4722
|
// src/EffectSkuTable/index.tsx
|
|
4721
|
-
var
|
|
4723
|
+
var import_antd29 = require("antd");
|
|
4722
4724
|
// src/EffectBrandSelect/index.tsx
|
|
4723
4725
|
var import_react39 = require("react");
|
|
4724
4726
|
var import_react_use10 = require("react-use");
|
|
4725
4727
|
var import_tools7 = require("@xfe-repo/web-utils/tools");
|
|
4726
4728
|
var import_classnames9 = __toESM(require("classnames"));
|
|
4727
|
-
// src/EffectBrandSelect/index.module.less
|
|
4728
|
-
var index_module_default11 = {
|
|
4729
|
-
input: "index_module_input3",
|
|
4730
|
-
select: "index_module_select2"
|
|
4731
|
-
};
|
|
4732
|
-
// src/EffectBrandSelect/index.tsx
|
|
4733
4729
|
var import_antd26 = require("antd");
|
|
4734
|
-
var import_antd27 = require("antd");
|
|
4735
4730
|
// src/EffectSkuSelect/index.tsx
|
|
4736
4731
|
var import_react38 = require("react");
|
|
4737
4732
|
var import_react_use9 = require("react-use");
|
|
4738
4733
|
var import_tools6 = require("@xfe-repo/web-utils/tools");
|
|
4739
4734
|
var import_classnames8 = __toESM(require("classnames"));
|
|
4740
4735
|
// src/EffectSkuSelect/index.module.less
|
|
4741
|
-
var
|
|
4742
|
-
input: "
|
|
4736
|
+
var index_module_default11 = {
|
|
4737
|
+
input: "index_module_input3",
|
|
4743
4738
|
image: "index_module_image",
|
|
4744
4739
|
preview: "index_module_preview",
|
|
4745
4740
|
icon: "index_module_icon",
|
|
@@ -4971,7 +4966,7 @@ var EffectSkuSelect = (0, import_react38.memo)(function(props) {
|
|
|
4971
4966
|
state,
|
|
4972
4967
|
options
|
|
4973
4968
|
]);
|
|
4974
|
-
var
|
|
4969
|
+
var popupRender = (0, import_react38.useCallback)(function(_menu) {
|
|
4975
4970
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectDropdown, {
|
|
4976
4971
|
value: value,
|
|
4977
4972
|
options: options,
|
|
@@ -5003,14 +4998,14 @@ var EffectSkuSelect = (0, import_react38.memo)(function(props) {
|
|
|
5003
4998
|
onSearch: handleOnSearch,
|
|
5004
4999
|
onClear: handleOnClear,
|
|
5005
5000
|
open: openDropDown,
|
|
5006
|
-
|
|
5007
|
-
|
|
5001
|
+
popupRender: popupRender,
|
|
5002
|
+
onOpenChange: setOpenDropDown,
|
|
5008
5003
|
getPopupContainer: function getPopupContainer() {
|
|
5009
5004
|
return document.body;
|
|
5010
5005
|
}
|
|
5011
5006
|
};
|
|
5012
5007
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_antd25.Select, _object_spread({
|
|
5013
|
-
className: (0, import_classnames8.default)(
|
|
5008
|
+
className: (0, import_classnames8.default)(index_module_default11.input, className)
|
|
5014
5009
|
}, selectBrandProps));
|
|
5015
5010
|
});
|
|
5016
5011
|
var SelectDropdown = (0, import_react38.memo)(function(props) {
|
|
@@ -5031,7 +5026,7 @@ var SelectDropdown = (0, import_react38.memo)(function(props) {
|
|
|
5031
5026
|
}, []);
|
|
5032
5027
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", {
|
|
5033
5028
|
id: selectDropdownId,
|
|
5034
|
-
className:
|
|
5029
|
+
className: index_module_default11.select_dropdown,
|
|
5035
5030
|
onMouseDown: handleMouseDown,
|
|
5036
5031
|
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_infinite_scroll_component.default, {
|
|
5037
5032
|
dataLength: options.length,
|
|
@@ -5048,22 +5043,22 @@ var SelectDropdown = (0, import_react38.memo)(function(props) {
|
|
|
5048
5043
|
scrollableTarget: selectDropdownId,
|
|
5049
5044
|
scrollThreshold: "100px",
|
|
5050
5045
|
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", {
|
|
5051
|
-
className:
|
|
5046
|
+
className: index_module_default11.options,
|
|
5052
5047
|
children: options.map(function(item) {
|
|
5053
5048
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", {
|
|
5054
|
-
className: (0, import_classnames8.default)(
|
|
5049
|
+
className: (0, import_classnames8.default)(index_module_default11.option, item.value === value && index_module_default11.active),
|
|
5055
5050
|
onClick: function onClick() {
|
|
5056
5051
|
return handleOnSelect(item);
|
|
5057
5052
|
},
|
|
5058
5053
|
children: [
|
|
5059
5054
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ImageItem, {
|
|
5060
|
-
className:
|
|
5055
|
+
className: index_module_default11.select_image,
|
|
5061
5056
|
item: item,
|
|
5062
5057
|
previewed: item.image === previewImage2,
|
|
5063
5058
|
onPreview: handlePreview
|
|
5064
5059
|
}),
|
|
5065
5060
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", {
|
|
5066
|
-
className:
|
|
5061
|
+
className: index_module_default11.label,
|
|
5067
5062
|
children: item.label
|
|
5068
5063
|
})
|
|
5069
5064
|
]
|
|
@@ -5084,7 +5079,7 @@ var ImageItem = (0, import_react38.memo)(function(props) {
|
|
|
5084
5079
|
]);
|
|
5085
5080
|
var previewProps = (0, import_react38.useMemo)(function() {
|
|
5086
5081
|
return {
|
|
5087
|
-
maskClassName: "".concat(
|
|
5082
|
+
maskClassName: "".concat(index_module_default11.item_mask_img),
|
|
5088
5083
|
visible: previewed,
|
|
5089
5084
|
onVisibleChange: function onVisibleChange(value) {
|
|
5090
5085
|
return !value && (onPreview === null || onPreview === void 0 ? void 0 : onPreview());
|
|
@@ -5095,16 +5090,16 @@ var ImageItem = (0, import_react38.memo)(function(props) {
|
|
|
5095
5090
|
onPreview
|
|
5096
5091
|
]);
|
|
5097
5092
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", {
|
|
5098
|
-
className: (0, import_classnames8.default)(
|
|
5093
|
+
className: (0, import_classnames8.default)(index_module_default11.image, className),
|
|
5099
5094
|
children: [
|
|
5100
5095
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", {
|
|
5101
|
-
className:
|
|
5096
|
+
className: index_module_default11.preview,
|
|
5102
5097
|
onClick: function onClick(event) {
|
|
5103
5098
|
return handlePreview(event);
|
|
5104
5099
|
},
|
|
5105
5100
|
children: [
|
|
5106
5101
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons10.EyeOutlined, {
|
|
5107
|
-
className:
|
|
5102
|
+
className: index_module_default11.icon
|
|
5108
5103
|
}),
|
|
5109
5104
|
" \u9884\u89C8"
|
|
5110
5105
|
]
|
|
@@ -5122,44 +5117,64 @@ var getNumberValue = function getNumberValue(value) {
|
|
|
5122
5117
|
var numValue = Number(value);
|
|
5123
5118
|
return Number.isNaN(numValue) ? void 0 : numValue;
|
|
5124
5119
|
};
|
|
5120
|
+
// src/EffectBrandSelect/index.module.less
|
|
5121
|
+
var index_module_default12 = {
|
|
5122
|
+
input: "index_module_input4",
|
|
5123
|
+
select: "index_module_select2"
|
|
5124
|
+
};
|
|
5125
5125
|
// src/EffectBrandSelect/index.tsx
|
|
5126
5126
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5127
|
+
var OTHER_BRAND_OPTION = {
|
|
5128
|
+
label: "\u5176\u5B83",
|
|
5129
|
+
value: 1310
|
|
5130
|
+
};
|
|
5127
5131
|
var EffectBrandSelect = (0, import_react39.memo)(function(props) {
|
|
5128
|
-
var onChange = props.onChange, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, disabled = props.disabled, mode = props.mode, categoryId = props.categoryId, sysBizTypeId = props.sysBizTypeId, showOtherBrand = props.showOtherBrand, style = props.style;
|
|
5132
|
+
var onChange = props.onChange, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, defaultLabel = props.defaultLabel, disabled = props.disabled, mode = props.mode, categoryId = props.categoryId, sysBizTypeId = props.sysBizTypeId, showOtherBrand = props.showOtherBrand, style = props.style;
|
|
5133
|
+
var initialValue = controlValue !== null && controlValue !== void 0 ? controlValue : defaultValue;
|
|
5134
|
+
var hasDefaultLabel = !!defaultLabel && initialValue !== void 0;
|
|
5129
5135
|
var _ref = _sliced_to_array((0, import_react39.useState)(controlValue || defaultValue), 2), value = _ref[0], setValue = _ref[1];
|
|
5136
|
+
var _ref1 = _sliced_to_array((0, import_react39.useState)(function() {
|
|
5137
|
+
if (hasDefaultLabel) return null;
|
|
5138
|
+
return {
|
|
5139
|
+
/** 兼容 props 分类 Id 异常传入 */ categoryId: getNumberValue(categoryId),
|
|
5140
|
+
sysBizTypeId: sysBizTypeId,
|
|
5141
|
+
brandId: initialValue === null || initialValue === void 0 ? void 0 : initialValue.toString()
|
|
5142
|
+
};
|
|
5143
|
+
}), 2), params = _ref1[0], setParams = _ref1[1];
|
|
5144
|
+
var _ref2 = _sliced_to_array((0, import_react39.useState)(hasDefaultLabel ? [
|
|
5145
|
+
{
|
|
5146
|
+
label: defaultLabel,
|
|
5147
|
+
value: initialValue
|
|
5148
|
+
}
|
|
5149
|
+
] : []), 2), options = _ref2[0], setOptions = _ref2[1];
|
|
5150
|
+
var prevControlValue = (0, import_react_use10.usePrevious)(controlValue);
|
|
5151
|
+
var state = useBrandOptions(params);
|
|
5130
5152
|
var searchFetch = (0, import_react39.useCallback)(function(brandName, brandId) {
|
|
5131
|
-
if (brandId !== void 0) brandId = String(brandId);
|
|
5132
5153
|
setParams({
|
|
5133
|
-
categoryId: getNumberValue(categoryId),
|
|
5154
|
+
/** 兼容 props 分类 Id 异常传入 */ categoryId: getNumberValue(categoryId),
|
|
5134
5155
|
sysBizTypeId: sysBizTypeId,
|
|
5135
|
-
brandName: brandName,
|
|
5136
|
-
brandId: brandId
|
|
5156
|
+
brandName: brandName || void 0,
|
|
5157
|
+
brandId: brandId === null || brandId === void 0 ? void 0 : brandId.toString()
|
|
5137
5158
|
});
|
|
5138
5159
|
}, [
|
|
5139
5160
|
categoryId,
|
|
5140
5161
|
sysBizTypeId
|
|
5141
5162
|
]);
|
|
5142
|
-
var
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5163
|
+
var handleSearch = (0, import_react39.useCallback)((0, import_tools7.debounce)(800, function(searchName) {
|
|
5164
|
+
return searchFetch(searchName);
|
|
5165
|
+
}), [
|
|
5166
|
+
searchFetch
|
|
5167
|
+
]);
|
|
5168
|
+
var handleReset = (0, import_react39.useCallback)(function() {
|
|
5169
|
+
return searchFetch("");
|
|
5170
|
+
}, [
|
|
5171
|
+
searchFetch
|
|
5172
|
+
]);
|
|
5151
5173
|
(0, import_react_use10.useUpdateEffect)(function() {
|
|
5152
5174
|
if (!state.data) return;
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
setOptions(state.data.concat([
|
|
5157
|
-
{
|
|
5158
|
-
label: "\u5176\u5B83",
|
|
5159
|
-
value: 1310
|
|
5160
|
-
}
|
|
5161
|
-
]));
|
|
5162
|
-
}
|
|
5175
|
+
setOptions(showOtherBrand ? _to_consumable_array(state.data).concat([
|
|
5176
|
+
OTHER_BRAND_OPTION
|
|
5177
|
+
]) : state.data);
|
|
5163
5178
|
}, [
|
|
5164
5179
|
state.data,
|
|
5165
5180
|
showOtherBrand
|
|
@@ -5181,7 +5196,7 @@ var EffectBrandSelect = (0, import_react39.memo)(function(props) {
|
|
|
5181
5196
|
}, [
|
|
5182
5197
|
controlValue
|
|
5183
5198
|
]);
|
|
5184
|
-
var
|
|
5199
|
+
var handleChange = function handleChange(_value, _option) {
|
|
5185
5200
|
setValue(_value);
|
|
5186
5201
|
if (mode === "multiple") {
|
|
5187
5202
|
var options2 = _option;
|
|
@@ -5194,73 +5209,41 @@ var EffectBrandSelect = (0, import_react39.memo)(function(props) {
|
|
|
5194
5209
|
onChange === null || onChange === void 0 ? void 0 : onChange(_value, option === null || option === void 0 ? void 0 : option.label);
|
|
5195
5210
|
}
|
|
5196
5211
|
};
|
|
5197
|
-
var handleOnDeselect = function handleOnDeselect(_value) {
|
|
5198
|
-
searchFetch("");
|
|
5199
|
-
};
|
|
5200
|
-
var handleOnSearch = function handleOnSearch(searchName) {
|
|
5201
|
-
return searchFetch(searchName);
|
|
5202
|
-
};
|
|
5203
|
-
var handleOnSearchDebounce = (0, import_react39.useCallback)((0, import_tools7.debounce)(800, handleOnSearch), [
|
|
5204
|
-
categoryId,
|
|
5205
|
-
sysBizTypeId
|
|
5206
|
-
]);
|
|
5207
|
-
var handleOnClear = function handleOnClear() {
|
|
5208
|
-
return searchFetch("");
|
|
5209
|
-
};
|
|
5210
5212
|
if (state.error) {
|
|
5211
5213
|
var _state_error;
|
|
5212
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_antd26.Typography.Text, {
|
|
5213
5215
|
type: "danger",
|
|
5214
5216
|
children: (_state_error = state.error) === null || _state_error === void 0 ? void 0 : _state_error.toString()
|
|
5215
5217
|
});
|
|
5216
5218
|
}
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_antd26.Select, {
|
|
5220
|
+
className: (0, import_classnames9.default)(index_module_default12.input, className),
|
|
5219
5221
|
popupMatchSelectWidth: false,
|
|
5220
|
-
notFoundContent:
|
|
5222
|
+
notFoundContent: state.isLoading ? "\u641C\u7D22\u4E2D" : "\u672A\u67E5\u8BE2\u5230\u76F8\u5173\u54C1\u724C",
|
|
5221
5223
|
placeholder: "\u8BF7\u8F93\u5165\u54C1\u724C\u540D\u79F0",
|
|
5222
5224
|
optionFilterProp: "label",
|
|
5223
5225
|
showSearch: true,
|
|
5224
5226
|
allowClear: true,
|
|
5225
5227
|
defaultActiveFirstOption: false,
|
|
5226
5228
|
filterOption: false,
|
|
5227
|
-
onChange:
|
|
5228
|
-
onSearch:
|
|
5229
|
-
onDeselect:
|
|
5230
|
-
onClear:
|
|
5229
|
+
onChange: handleChange,
|
|
5230
|
+
onSearch: handleSearch,
|
|
5231
|
+
onDeselect: handleReset,
|
|
5232
|
+
onClear: handleReset,
|
|
5231
5233
|
loading: state.isLoading,
|
|
5232
5234
|
value: value,
|
|
5233
5235
|
options: options,
|
|
5234
5236
|
disabled: disabled,
|
|
5235
5237
|
mode: mode,
|
|
5236
5238
|
style: style
|
|
5237
|
-
};
|
|
5238
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_antd26.Select, _object_spread({
|
|
5239
|
-
className: (0, import_classnames9.default)(index_module_default11.input, className)
|
|
5240
|
-
}, selectBrandProps));
|
|
5239
|
+
});
|
|
5241
5240
|
});
|
|
5242
5241
|
// src/EffectSeriesSelect/index.tsx
|
|
5243
5242
|
var import_react40 = require("react");
|
|
5243
|
+
var import_antd27 = require("antd");
|
|
5244
5244
|
var import_react_use11 = require("react-use");
|
|
5245
5245
|
var import_tools8 = require("@xfe-repo/web-utils/tools");
|
|
5246
5246
|
var import_classnames10 = __toESM(require("classnames"));
|
|
5247
|
-
// src/EffectSeriesSelect/index.module.less
|
|
5248
|
-
var index_module_default13 = {
|
|
5249
|
-
input: "index_module_input5",
|
|
5250
|
-
hover: "index_module_hover",
|
|
5251
|
-
dropdown: "index_module_dropdown",
|
|
5252
|
-
img_opt: "index_module_img_opt",
|
|
5253
|
-
item: "index_module_item",
|
|
5254
|
-
icon_preview: "index_module_icon_preview",
|
|
5255
|
-
icon_eye: "index_module_icon_eye",
|
|
5256
|
-
item_img: "index_module_item_img",
|
|
5257
|
-
item_mask_img: "index_module_item_mask_img",
|
|
5258
|
-
item_label: "index_module_item_label",
|
|
5259
|
-
txt_opt: "index_module_txt_opt",
|
|
5260
|
-
active: "index_module_active2"
|
|
5261
|
-
};
|
|
5262
|
-
// src/EffectSeriesSelect/index.tsx
|
|
5263
|
-
var import_antd28 = require("antd");
|
|
5264
5247
|
// src/EffectSeriesSelect/useSeriesOptions.ts
|
|
5265
5248
|
var import_immutable4 = __toESM(require("swr/immutable"));
|
|
5266
5249
|
function useSeriesOptions(params) {
|
|
@@ -5309,6 +5292,21 @@ function useSeriesOptions(params) {
|
|
|
5309
5292
|
mutate: mutate
|
|
5310
5293
|
};
|
|
5311
5294
|
}
|
|
5295
|
+
// src/EffectSeriesSelect/index.module.less
|
|
5296
|
+
var index_module_default13 = {
|
|
5297
|
+
input: "index_module_input5",
|
|
5298
|
+
hover: "index_module_hover",
|
|
5299
|
+
dropdown: "index_module_dropdown",
|
|
5300
|
+
img_opt: "index_module_img_opt",
|
|
5301
|
+
item: "index_module_item",
|
|
5302
|
+
icon_preview: "index_module_icon_preview",
|
|
5303
|
+
icon_eye: "index_module_icon_eye",
|
|
5304
|
+
item_img: "index_module_item_img",
|
|
5305
|
+
item_mask_img: "index_module_item_mask_img",
|
|
5306
|
+
item_label: "index_module_item_label",
|
|
5307
|
+
txt_opt: "index_module_txt_opt",
|
|
5308
|
+
active: "index_module_active2"
|
|
5309
|
+
};
|
|
5312
5310
|
// src/EffectSeriesSelect/index.tsx
|
|
5313
5311
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
5314
5312
|
var EffectSeriesSelect = (0, import_react40.memo)(function(props) {
|
|
@@ -5317,13 +5315,11 @@ var EffectSeriesSelect = (0, import_react40.memo)(function(props) {
|
|
|
5317
5315
|
var _ref1 = _sliced_to_array((0, import_react40.useState)([]), 2), options = _ref1[0], setOptions = _ref1[1];
|
|
5318
5316
|
var _ref2 = _sliced_to_array((0, import_react40.useState)(controlValue || defaultValue), 2), value = _ref2[0], setValue = _ref2[1];
|
|
5319
5317
|
var _ref3 = _sliced_to_array((0, import_react40.useState)(""), 2), searchValue = _ref3[0], setSearchValue = _ref3[1];
|
|
5320
|
-
var pageData = (0, import_react40.
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
};
|
|
5326
|
-
}, []);
|
|
5318
|
+
var pageData = (0, import_react40.useRef)({
|
|
5319
|
+
page: 1,
|
|
5320
|
+
pageSize: 12,
|
|
5321
|
+
hasMore: true
|
|
5322
|
+
});
|
|
5327
5323
|
var conditions = (0, import_react40.useMemo)(function() {
|
|
5328
5324
|
return {
|
|
5329
5325
|
categoryId: categoryId,
|
|
@@ -5333,29 +5329,30 @@ var EffectSeriesSelect = (0, import_react40.memo)(function(props) {
|
|
|
5333
5329
|
categoryId,
|
|
5334
5330
|
brandId
|
|
5335
5331
|
]);
|
|
5336
|
-
var searchFetch = (0, import_react40.useCallback)(function(params2) {
|
|
5337
|
-
var page = params2.page, searchValue2 = params2.searchValue, conditions2 = params2.conditions, value2 = params2.value;
|
|
5338
|
-
var pageSize = pageData.pageSize;
|
|
5339
|
-
var id = getNumberValue(value2);
|
|
5340
|
-
var serviceParams = _object_spread_props(_object_spread({}, conditions2), {
|
|
5341
|
-
id: id,
|
|
5342
|
-
seriesName: searchValue2,
|
|
5343
|
-
page: page,
|
|
5344
|
-
pageSize: pageSize
|
|
5345
|
-
});
|
|
5346
|
-
setParams(serviceParams);
|
|
5347
|
-
}, []);
|
|
5348
5332
|
var _ref4 = _sliced_to_array((0, import_react40.useState)({
|
|
5349
5333
|
categoryId: categoryId,
|
|
5350
5334
|
brandId: brandId,
|
|
5351
|
-
/** 兼容props分类Id 异常传入 */ id: getNumberValue(value),
|
|
5335
|
+
/** 兼容 props 分类 Id 异常传入 */ id: getNumberValue(value),
|
|
5352
5336
|
seriesName: searchValue,
|
|
5353
|
-
page: pageData.page,
|
|
5354
|
-
pageSize: pageData.pageSize
|
|
5337
|
+
page: pageData.current.page,
|
|
5338
|
+
pageSize: pageData.current.pageSize
|
|
5355
5339
|
}), 2), params = _ref4[0], setParams = _ref4[1];
|
|
5356
5340
|
var state = useSeriesOptions(params);
|
|
5357
5341
|
var prevControlValue = (0, import_react_use11.usePrevious)(controlValue);
|
|
5358
|
-
var
|
|
5342
|
+
var searchFetch = (0, import_react40.useCallback)(function(fetchParams) {
|
|
5343
|
+
var page = fetchParams.page, searchValue2 = fetchParams.searchValue, conditions2 = fetchParams.conditions, value2 = fetchParams.value;
|
|
5344
|
+
var pageSize = pageData.current.pageSize;
|
|
5345
|
+
var id = getNumberValue(value2);
|
|
5346
|
+
setParams(_object_spread_props(_object_spread({}, conditions2), {
|
|
5347
|
+
id: id,
|
|
5348
|
+
seriesName: searchValue2,
|
|
5349
|
+
page: page,
|
|
5350
|
+
pageSize: pageSize
|
|
5351
|
+
}));
|
|
5352
|
+
}, []);
|
|
5353
|
+
var debounceSearchFetch = (0, import_react40.useMemo)(function() {
|
|
5354
|
+
return (0, import_tools8.debounce)(300, searchFetch);
|
|
5355
|
+
}, [
|
|
5359
5356
|
searchFetch
|
|
5360
5357
|
]);
|
|
5361
5358
|
(0, import_react40.useEffect)(function() {
|
|
@@ -5371,9 +5368,12 @@ var EffectSeriesSelect = (0, import_react40.memo)(function(props) {
|
|
|
5371
5368
|
brandId: brandId
|
|
5372
5369
|
};
|
|
5373
5370
|
});
|
|
5374
|
-
|
|
5375
|
-
pageData.page
|
|
5376
|
-
pageData.hasMore = pageData.pageSize * pageData.page < state.data.total && newOptions.length > 0;
|
|
5371
|
+
var isFirstPage = state.data.page === 1;
|
|
5372
|
+
pageData.current.page = state.data.page;
|
|
5373
|
+
pageData.current.hasMore = pageData.current.pageSize * pageData.current.page < state.data.total && newOptions.length > 0;
|
|
5374
|
+
setOptions(function(prev) {
|
|
5375
|
+
return isFirstPage ? newOptions : _to_consumable_array(prev).concat(_to_consumable_array(newOptions));
|
|
5376
|
+
});
|
|
5377
5377
|
}, [
|
|
5378
5378
|
state.data
|
|
5379
5379
|
]);
|
|
@@ -5410,8 +5410,8 @@ var EffectSeriesSelect = (0, import_react40.memo)(function(props) {
|
|
|
5410
5410
|
searchValue,
|
|
5411
5411
|
conditions
|
|
5412
5412
|
]);
|
|
5413
|
-
var handleOnSearch = (0, import_react40.useCallback)(function(
|
|
5414
|
-
return setSearchValue(
|
|
5413
|
+
var handleOnSearch = (0, import_react40.useCallback)(function(text) {
|
|
5414
|
+
return setSearchValue(text);
|
|
5415
5415
|
}, []);
|
|
5416
5416
|
var handleOnClear = (0, import_react40.useCallback)(function() {
|
|
5417
5417
|
return setSearchValue("");
|
|
@@ -5424,7 +5424,7 @@ var EffectSeriesSelect = (0, import_react40.memo)(function(props) {
|
|
|
5424
5424
|
return [
|
|
5425
5425
|
4,
|
|
5426
5426
|
searchFetch({
|
|
5427
|
-
page: pageData.page + 1,
|
|
5427
|
+
page: pageData.current.page + 1,
|
|
5428
5428
|
value: value,
|
|
5429
5429
|
searchValue: searchValue,
|
|
5430
5430
|
conditions: conditions
|
|
@@ -5443,11 +5443,11 @@ var EffectSeriesSelect = (0, import_react40.memo)(function(props) {
|
|
|
5443
5443
|
searchValue,
|
|
5444
5444
|
conditions
|
|
5445
5445
|
]);
|
|
5446
|
-
var handleOnChange = (0, import_react40.useCallback)(function(
|
|
5446
|
+
var handleOnChange = (0, import_react40.useCallback)(function(newValue, option) {
|
|
5447
5447
|
var label = (option || {}).label;
|
|
5448
|
-
|
|
5449
|
-
setValue(
|
|
5450
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(
|
|
5448
|
+
var numValue = getNumberValue(newValue);
|
|
5449
|
+
setValue(numValue);
|
|
5450
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(numValue, label);
|
|
5451
5451
|
setOpenDropDown(false);
|
|
5452
5452
|
}, [
|
|
5453
5453
|
onChange
|
|
@@ -5457,27 +5457,25 @@ var EffectSeriesSelect = (0, import_react40.memo)(function(props) {
|
|
|
5457
5457
|
if (options.length) return "\u6CA1\u6709\u66F4\u591A\u4E86~";
|
|
5458
5458
|
return "\u6682\u65E0\u6570\u636E";
|
|
5459
5459
|
}, [
|
|
5460
|
-
state,
|
|
5461
|
-
options
|
|
5462
|
-
brandId
|
|
5460
|
+
state.isLoading,
|
|
5461
|
+
options.length
|
|
5463
5462
|
]);
|
|
5464
|
-
var
|
|
5463
|
+
var popupRender = (0, import_react40.useCallback)(function(_menu) {
|
|
5465
5464
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectDropdown, {
|
|
5466
5465
|
value: value,
|
|
5467
5466
|
options: options,
|
|
5468
5467
|
onLoadMore: handleOnLoadMore,
|
|
5469
|
-
hasMore: pageData.hasMore,
|
|
5468
|
+
hasMore: pageData.current.hasMore,
|
|
5470
5469
|
noMoreText: noMoreText,
|
|
5471
5470
|
onChange: handleOnChange
|
|
5472
5471
|
});
|
|
5473
5472
|
}, [
|
|
5474
5473
|
value,
|
|
5475
5474
|
options,
|
|
5476
|
-
state,
|
|
5477
5475
|
noMoreText,
|
|
5478
5476
|
handleOnChange
|
|
5479
5477
|
]);
|
|
5480
|
-
var
|
|
5478
|
+
var selectProps = {
|
|
5481
5479
|
popupMatchSelectWidth: false,
|
|
5482
5480
|
placeholder: "\u8BF7\u8F93\u5165\u7CFB\u5217\u540D\u79F0",
|
|
5483
5481
|
optionFilterProp: "label",
|
|
@@ -5494,15 +5492,15 @@ var EffectSeriesSelect = (0, import_react40.memo)(function(props) {
|
|
|
5494
5492
|
onSearch: handleOnSearch,
|
|
5495
5493
|
onClear: handleOnClear,
|
|
5496
5494
|
open: openDropDown,
|
|
5497
|
-
|
|
5498
|
-
|
|
5495
|
+
popupRender: popupRender,
|
|
5496
|
+
onOpenChange: setOpenDropDown,
|
|
5499
5497
|
getPopupContainer: function getPopupContainer() {
|
|
5500
5498
|
return document.body;
|
|
5501
5499
|
}
|
|
5502
5500
|
};
|
|
5503
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_antd27.Select, _object_spread({
|
|
5504
5502
|
className: (0, import_classnames10.default)(index_module_default13.input, className)
|
|
5505
|
-
},
|
|
5503
|
+
}, selectProps));
|
|
5506
5504
|
});
|
|
5507
5505
|
// src/EffectSpuSelect/index.tsx
|
|
5508
5506
|
var import_react41 = require("react");
|
|
@@ -5515,7 +5513,7 @@ var index_module_default14 = {
|
|
|
5515
5513
|
select: "index_module_select3"
|
|
5516
5514
|
};
|
|
5517
5515
|
// src/EffectSpuSelect/index.tsx
|
|
5518
|
-
var
|
|
5516
|
+
var import_antd28 = require("antd");
|
|
5519
5517
|
// src/EffectSpuSelect/useSpuOptions.ts
|
|
5520
5518
|
var import_immutable5 = __toESM(require("swr/immutable"));
|
|
5521
5519
|
function useSpuOptions(params) {
|
|
@@ -5727,7 +5725,7 @@ var EffectSpuSelect = (0, import_react41.memo)(function(props) {
|
|
|
5727
5725
|
state,
|
|
5728
5726
|
options
|
|
5729
5727
|
]);
|
|
5730
|
-
var
|
|
5728
|
+
var popupRender = (0, import_react41.useCallback)(function(_menu) {
|
|
5731
5729
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectDropdown, {
|
|
5732
5730
|
value: value,
|
|
5733
5731
|
options: options,
|
|
@@ -5759,19 +5757,19 @@ var EffectSpuSelect = (0, import_react41.memo)(function(props) {
|
|
|
5759
5757
|
onSearch: handleOnSearch,
|
|
5760
5758
|
onClear: handleOnClear,
|
|
5761
5759
|
open: openDropDown,
|
|
5762
|
-
|
|
5763
|
-
|
|
5760
|
+
popupRender: popupRender,
|
|
5761
|
+
onOpenChange: setOpenDropDown,
|
|
5764
5762
|
getPopupContainer: function getPopupContainer() {
|
|
5765
5763
|
return document.body;
|
|
5766
5764
|
}
|
|
5767
5765
|
};
|
|
5768
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_antd28.Select, _object_spread({
|
|
5769
5767
|
className: (0, import_classnames11.default)(index_module_default14.input, className)
|
|
5770
5768
|
}, selectBrandProps));
|
|
5771
5769
|
});
|
|
5772
5770
|
// src/EffectSkuTable/index.tsx
|
|
5773
5771
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
5774
|
-
var
|
|
5772
|
+
var _import_antd29_Table = import_antd29.Table, Column2 = _import_antd29_Table.Column;
|
|
5775
5773
|
var EffectSkuTable = (0, import_react42.memo)(function(props) {
|
|
5776
5774
|
var _curCategoryIds_slice;
|
|
5777
5775
|
var categoryIds = props.categoryIds, brandId = props.brandId, brandName = props.brandName, _props_seriesId = props.seriesId, seriesId = _props_seriesId === void 0 ? 0 : _props_seriesId, seriesName = props.seriesName, spuId = props.spuId, spuName = props.spuName, disabled = props.disabled, value = props.value, _props_showSkuId = props.showSkuId, showSkuId = _props_showSkuId === void 0 ? false : _props_showSkuId, _props_skuType = props.skuType, skuType = _props_skuType === void 0 ? "std" : _props_skuType, onChange = props.onChange;
|
|
@@ -6001,7 +5999,7 @@ var EffectSkuTable = (0, import_react42.memo)(function(props) {
|
|
|
6001
5999
|
skuImage: curSkuImage
|
|
6002
6000
|
}
|
|
6003
6001
|
];
|
|
6004
|
-
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(
|
|
6002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_antd29.Table, _object_spread_props(_object_spread({}, commonTableProps), {
|
|
6005
6003
|
dataSource: skuDataSource,
|
|
6006
6004
|
rowKey: function rowKey(record) {
|
|
6007
6005
|
return record.categoryIds.join("_") || "empty";
|
|
@@ -6049,7 +6047,7 @@ var index_module_default15 = {
|
|
|
6049
6047
|
accept: "index_module_accept"
|
|
6050
6048
|
};
|
|
6051
6049
|
// src/EffectWithFilePanel/index.tsx
|
|
6052
|
-
var
|
|
6050
|
+
var import_antd30 = require("antd");
|
|
6053
6051
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6054
6052
|
var EffectWithFilePanel = (0, import_react43.memo)(function(props) {
|
|
6055
6053
|
var disabled = props.disabled, children = props.children, header = props.header, defaultValue = props.defaultValue, onChange = props.onChange, onSave = props.onSave, max = props.max, accept = props.accept, remote = props.remote, title = props.title;
|
|
@@ -6060,7 +6058,7 @@ var EffectWithFilePanel = (0, import_react43.memo)(function(props) {
|
|
|
6060
6058
|
var handleCLose = function handleCLose() {
|
|
6061
6059
|
if (!uploadLoading) return true;
|
|
6062
6060
|
return new Promise(function(resolve) {
|
|
6063
|
-
|
|
6061
|
+
import_antd30.Modal.confirm({
|
|
6064
6062
|
title: "\u6587\u4EF6\u4E0A\u4F20\u4E2D, \u786E\u5B9A\u5173\u95ED\u4E48\uFF1F",
|
|
6065
6063
|
content: "\u5982\u679C\u5173\u95ED\uFF0C\u6B64\u6B21\u4E0A\u4F20\u4FDD\u5B58\u5C06\u4F1A\u5931\u8D25",
|
|
6066
6064
|
okType: "danger",
|
|
@@ -6078,9 +6076,9 @@ var EffectWithFilePanel = (0, import_react43.memo)(function(props) {
|
|
|
6078
6076
|
setUploadLoading(false);
|
|
6079
6077
|
setSubmitText(disabled ? "\u786E\u5B9A" : "\u4FDD\u5B58");
|
|
6080
6078
|
if (result) {
|
|
6081
|
-
void
|
|
6079
|
+
void import_antd30.message.success(msg || "\u4E0A\u4F20\u6210\u529F");
|
|
6082
6080
|
} else {
|
|
6083
|
-
void
|
|
6081
|
+
void import_antd30.message.error(msg);
|
|
6084
6082
|
}
|
|
6085
6083
|
};
|
|
6086
6084
|
var handleOnUpload = function handleOnUpload() {
|
|
@@ -6148,7 +6146,7 @@ var EffectWithFilePanel = (0, import_react43.memo)(function(props) {
|
|
|
6148
6146
|
});
|
|
6149
6147
|
// src/EffectSkuRecognize/index.tsx
|
|
6150
6148
|
var import_react44 = require("react");
|
|
6151
|
-
var
|
|
6149
|
+
var import_antd31 = require("antd");
|
|
6152
6150
|
var import_react_use14 = require("react-use");
|
|
6153
6151
|
// src/EffectSkuRecognize/index.module.less
|
|
6154
6152
|
var index_module_default16 = {
|
|
@@ -6156,7 +6154,7 @@ var index_module_default16 = {
|
|
|
6156
6154
|
};
|
|
6157
6155
|
// src/EffectSkuRecognize/index.tsx
|
|
6158
6156
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6159
|
-
var
|
|
6157
|
+
var _import_antd31_Typography = import_antd31.Typography, Title = _import_antd31_Typography.Title, Text = _import_antd31_Typography.Text, Link = _import_antd31_Typography.Link;
|
|
6160
6158
|
var EffectSkuRecognize = (0, import_react44.memo)(function(props) {
|
|
6161
6159
|
var categoryId = props.categoryId, brandId = props.brandId, controlledValue = props.value, defaultValue = props.defaultValue, image = props.image, limitSize = props.limitSize, disabled = props.disabled, _props_size = props.size, size = _props_size === void 0 ? "default" : _props_size, _props_skuType = props.skuType, skuType = _props_skuType === void 0 ? "std" : _props_skuType, onChange = props.onChange;
|
|
6162
6160
|
var _ref = _sliced_to_array((0, import_react44.useState)(controlledValue || defaultValue), 2), value = _ref[0], setValue = _ref[1];
|
|
@@ -6271,19 +6269,19 @@ var EffectSkuRecognize = (0, import_react44.memo)(function(props) {
|
|
|
6271
6269
|
countRender: function countRender(current, total) {
|
|
6272
6270
|
var currentItem = skuList[current - 1] || {};
|
|
6273
6271
|
var currentImage = currentItem.image || currentItem.skuImage || "";
|
|
6274
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_antd31.Space, {
|
|
6275
6273
|
children: [
|
|
6276
6274
|
current,
|
|
6277
6275
|
" / ",
|
|
6278
6276
|
total,
|
|
6279
|
-
!disabled && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6277
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_antd31.Button, {
|
|
6280
6278
|
type: "primary",
|
|
6281
6279
|
onClick: function onClick() {
|
|
6282
6280
|
return handleSelected(currentItem);
|
|
6283
6281
|
},
|
|
6284
6282
|
children: "\u5C31\u662F\u5B83"
|
|
6285
6283
|
}),
|
|
6286
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6284
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_antd31.Button, {
|
|
6287
6285
|
onClick: function onClick() {
|
|
6288
6286
|
return window.open(currentImage);
|
|
6289
6287
|
},
|
|
@@ -6311,23 +6309,23 @@ var EffectSkuRecognize = (0, import_react44.memo)(function(props) {
|
|
|
6311
6309
|
})
|
|
6312
6310
|
]
|
|
6313
6311
|
});
|
|
6314
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_antd31.Spin, {
|
|
6315
6313
|
tip: "\u8BC6\u522B\u4E2D...",
|
|
6316
6314
|
spinning: state.loading,
|
|
6317
6315
|
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OSSImage.PreviewGroup, {
|
|
6318
6316
|
preview: previewProps,
|
|
6319
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6317
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_antd31.List, {
|
|
6320
6318
|
grid: gridProps[size],
|
|
6321
6319
|
header: listHeader,
|
|
6322
6320
|
dataSource: skuList,
|
|
6323
6321
|
className: index_module_default16.desc,
|
|
6324
6322
|
renderItem: function renderItem(item) {
|
|
6325
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_antd31.List.Item, {
|
|
6326
6324
|
className: index_module_default16.maring_top,
|
|
6327
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6325
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_antd31.Card, {
|
|
6328
6326
|
hoverable: true,
|
|
6329
6327
|
children: [
|
|
6330
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6328
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_antd31.Badge, {
|
|
6331
6329
|
count: item.score,
|
|
6332
6330
|
overflowCount: 10,
|
|
6333
6331
|
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(OSSImage, {
|
|
@@ -6345,7 +6343,7 @@ var EffectSkuRecognize = (0, import_react44.memo)(function(props) {
|
|
|
6345
6343
|
item.name || item.skuName
|
|
6346
6344
|
]
|
|
6347
6345
|
}),
|
|
6348
|
-
!disabled && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6346
|
+
!disabled && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_antd31.Button, {
|
|
6349
6347
|
type: item.skuId === value ? "primary" : "default",
|
|
6350
6348
|
block: true,
|
|
6351
6349
|
onClick: function onClick() {
|
|
@@ -6433,7 +6431,7 @@ var index_module_default17 = {
|
|
|
6433
6431
|
selector: "index_module_selector"
|
|
6434
6432
|
};
|
|
6435
6433
|
// src/EffectMerchantSelect/index.tsx
|
|
6436
|
-
var
|
|
6434
|
+
var import_antd32 = require("antd");
|
|
6437
6435
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
6438
6436
|
var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
|
|
6439
6437
|
var onChange = props.onChange, className = props.className, controlValue = props.value, disabled = props.disabled, _props_source = props.source, source = _props_source === void 0 ? "businessNo" : _props_source, _props_labelDisplayMode = props.labelDisplayMode, labelDisplayMode = _props_labelDisplayMode === void 0 ? "platformName" : _props_labelDisplayMode;
|
|
@@ -6497,7 +6495,7 @@ var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
|
|
|
6497
6495
|
};
|
|
6498
6496
|
if (state.error) {
|
|
6499
6497
|
var _state_error;
|
|
6500
|
-
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_antd32.Typography.Text, {
|
|
6501
6499
|
type: "danger",
|
|
6502
6500
|
children: (_state_error = state.error) === null || _state_error === void 0 ? void 0 : _state_error.toString()
|
|
6503
6501
|
});
|
|
@@ -6538,18 +6536,86 @@ var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
|
|
|
6538
6536
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", {
|
|
6539
6537
|
className: index_module_default17.merchant_select_wrap,
|
|
6540
6538
|
children: [
|
|
6541
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6542
|
-
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6539
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_antd32.Select, _object_spread({}, addonBeforeProps)),
|
|
6540
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_antd32.Select, _object_spread({
|
|
6543
6541
|
className: (0, import_classnames12.default)(index_module_default17.selector, className)
|
|
6544
6542
|
}, selectBrandProps))
|
|
6545
6543
|
]
|
|
6546
6544
|
});
|
|
6547
6545
|
});
|
|
6548
6546
|
// src/EffectScopeSelect/index.tsx
|
|
6549
|
-
var
|
|
6547
|
+
var import_react47 = require("react");
|
|
6550
6548
|
var import_antd34 = require("antd");
|
|
6551
6549
|
var import_react_use16 = require("react-use");
|
|
6550
|
+
// src/EffectScopeSelect/ScopeViewMode.tsx
|
|
6551
|
+
var import_react46 = require("react");
|
|
6552
|
+
var import_antd33 = require("antd");
|
|
6552
6553
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
6554
|
+
var ScopeViewMode = (0, import_react46.memo)(function(props) {
|
|
6555
|
+
var _ref = props || {}, categoryIds = _ref.categoryIds, categoryName = _ref.categoryName, brandId = _ref.brandId, brandName = _ref.brandName, seriesId = _ref.seriesId, seriesName = _ref.seriesName, spuId = _ref.spuId, spuName = _ref.spuName, skuId = _ref.skuId, skuName = _ref.skuName;
|
|
6556
|
+
var items = [];
|
|
6557
|
+
if ((categoryName === null || categoryName === void 0 ? void 0 : categoryName.length) || (categoryIds === null || categoryIds === void 0 ? void 0 : categoryIds.length)) items.push({
|
|
6558
|
+
label: "\u5206\u7C7B",
|
|
6559
|
+
value: (categoryName === null || categoryName === void 0 ? void 0 : categoryName.join("/")) || (categoryIds === null || categoryIds === void 0 ? void 0 : categoryIds.join(","))
|
|
6560
|
+
});
|
|
6561
|
+
if (brandName || brandId) items.push({
|
|
6562
|
+
label: "\u54C1\u724C",
|
|
6563
|
+
value: brandName || String(brandId)
|
|
6564
|
+
});
|
|
6565
|
+
if (seriesName || seriesId) items.push({
|
|
6566
|
+
label: "\u7CFB\u5217",
|
|
6567
|
+
value: seriesName || String(seriesId)
|
|
6568
|
+
});
|
|
6569
|
+
if (spuName || spuId) items.push({
|
|
6570
|
+
label: "SPU",
|
|
6571
|
+
value: spuName || String(spuId)
|
|
6572
|
+
});
|
|
6573
|
+
if (skuName || skuId) items.push({
|
|
6574
|
+
label: "SKU",
|
|
6575
|
+
value: skuName || String(skuId)
|
|
6576
|
+
});
|
|
6577
|
+
if (items.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd33.Typography.Text, {
|
|
6578
|
+
style: {
|
|
6579
|
+
fontSize: 14
|
|
6580
|
+
},
|
|
6581
|
+
type: "danger",
|
|
6582
|
+
children: "\u8BF7\u5148\u9009\u62E9\u54C1\u7C7B\u4FE1\u606F"
|
|
6583
|
+
});
|
|
6584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd33.Space, {
|
|
6585
|
+
size: 4,
|
|
6586
|
+
children: items.map(function(param) {
|
|
6587
|
+
var label = param.label, value = param.value;
|
|
6588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_antd33.Space, {
|
|
6589
|
+
size: 4,
|
|
6590
|
+
style: {
|
|
6591
|
+
height: 32,
|
|
6592
|
+
padding: "0 36px 0 14px",
|
|
6593
|
+
borderRadius: 6
|
|
6594
|
+
},
|
|
6595
|
+
children: [
|
|
6596
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_antd33.Typography.Text, {
|
|
6597
|
+
style: {
|
|
6598
|
+
fontSize: 14,
|
|
6599
|
+
paddingRight: 16
|
|
6600
|
+
},
|
|
6601
|
+
children: [
|
|
6602
|
+
label,
|
|
6603
|
+
":"
|
|
6604
|
+
]
|
|
6605
|
+
}),
|
|
6606
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd33.Typography.Text, {
|
|
6607
|
+
style: {
|
|
6608
|
+
fontSize: 14
|
|
6609
|
+
},
|
|
6610
|
+
children: value
|
|
6611
|
+
})
|
|
6612
|
+
]
|
|
6613
|
+
}, label);
|
|
6614
|
+
})
|
|
6615
|
+
});
|
|
6616
|
+
});
|
|
6617
|
+
// src/EffectScopeSelect/index.tsx
|
|
6618
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
6553
6619
|
var ScopeLevelEnum = /* @__PURE__ */ function(ScopeLevelEnum2) {
|
|
6554
6620
|
ScopeLevelEnum2[ScopeLevelEnum2["CATEGORY"] = 1] = "CATEGORY";
|
|
6555
6621
|
ScopeLevelEnum2[ScopeLevelEnum2["BRAND"] = 2] = "BRAND";
|
|
@@ -6558,10 +6624,10 @@ var ScopeLevelEnum = /* @__PURE__ */ function(ScopeLevelEnum2) {
|
|
|
6558
6624
|
ScopeLevelEnum2[ScopeLevelEnum2["SKU"] = 5] = "SKU";
|
|
6559
6625
|
return ScopeLevelEnum2;
|
|
6560
6626
|
}(ScopeLevelEnum || {});
|
|
6561
|
-
var EffectScopeSelect = (0,
|
|
6562
|
-
var controlledValue = props.value, defaultValue = props.defaultValue, _props_scopeLevel = props.scopeLevel, scopeLevel = _props_scopeLevel === void 0 ? 5 /* SKU */ : _props_scopeLevel, _props_requireLevel = props.requireLevel, requireLevel = _props_requireLevel === void 0 ? 1 /* CATEGORY */ : _props_requireLevel, categoryChangeOnSelect = props.categoryChangeOnSelect, onChange = props.onChange;
|
|
6563
|
-
var _ref = _sliced_to_array((0,
|
|
6564
|
-
var lastLevelCategoryId = (0,
|
|
6627
|
+
var EffectScopeSelect = (0, import_react47.memo)(function(props) {
|
|
6628
|
+
var controlledValue = props.value, defaultValue = props.defaultValue, _props_scopeLevel = props.scopeLevel, scopeLevel = _props_scopeLevel === void 0 ? 5 /* SKU */ : _props_scopeLevel, _props_requireLevel = props.requireLevel, requireLevel = _props_requireLevel === void 0 ? 1 /* CATEGORY */ : _props_requireLevel, categoryChangeOnSelect = props.categoryChangeOnSelect, onChange = props.onChange, _props_mode = props.mode, mode = _props_mode === void 0 ? "edit" : _props_mode;
|
|
6629
|
+
var _ref = _sliced_to_array((0, import_react47.useState)(_object_spread({}, controlledValue, defaultValue)), 2), value = _ref[0], setValue = _ref[1];
|
|
6630
|
+
var lastLevelCategoryId = (0, import_react47.useMemo)(function() {
|
|
6565
6631
|
var _value_categoryIds;
|
|
6566
6632
|
return (_value_categoryIds = value.categoryIds) === null || _value_categoryIds === void 0 ? void 0 : _value_categoryIds[value.categoryIds.length - 1];
|
|
6567
6633
|
}, [
|
|
@@ -6572,14 +6638,14 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6572
6638
|
}, [
|
|
6573
6639
|
controlledValue
|
|
6574
6640
|
]);
|
|
6575
|
-
var handleChange = (0,
|
|
6641
|
+
var handleChange = (0, import_react47.useCallback)(function(newValue) {
|
|
6576
6642
|
setTimeout(function() {
|
|
6577
6643
|
return onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
6578
6644
|
}, 0);
|
|
6579
6645
|
}, [
|
|
6580
6646
|
onChange
|
|
6581
6647
|
]);
|
|
6582
|
-
var handleCategoryChange = (0,
|
|
6648
|
+
var handleCategoryChange = (0, import_react47.useCallback)(function(_values, selectedList) {
|
|
6583
6649
|
if (!selectedList || !isSingleTreeSelected(selectedList)) {
|
|
6584
6650
|
handleChange === null || handleChange === void 0 ? void 0 : handleChange();
|
|
6585
6651
|
return;
|
|
@@ -6598,7 +6664,7 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6598
6664
|
handleChange,
|
|
6599
6665
|
requireLevel
|
|
6600
6666
|
]);
|
|
6601
|
-
var handleBrandChange = (0,
|
|
6667
|
+
var handleBrandChange = (0, import_react47.useCallback)(function(brandValue) {
|
|
6602
6668
|
var brandId = brandValue === void 0 ? void 0 : Number(brandValue);
|
|
6603
6669
|
setValue(function(prev) {
|
|
6604
6670
|
var newScope = {
|
|
@@ -6614,7 +6680,7 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6614
6680
|
handleChange,
|
|
6615
6681
|
requireLevel
|
|
6616
6682
|
]);
|
|
6617
|
-
var handleSeriesChange = (0,
|
|
6683
|
+
var handleSeriesChange = (0, import_react47.useCallback)(function(seriesValue) {
|
|
6618
6684
|
var seriesId = seriesValue === void 0 ? void 0 : Number(seriesValue);
|
|
6619
6685
|
setValue(function(prev) {
|
|
6620
6686
|
var newScope = {
|
|
@@ -6631,7 +6697,7 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6631
6697
|
handleChange,
|
|
6632
6698
|
requireLevel
|
|
6633
6699
|
]);
|
|
6634
|
-
var handleSpuChange = (0,
|
|
6700
|
+
var handleSpuChange = (0, import_react47.useCallback)(function(spuValue) {
|
|
6635
6701
|
var spuId = spuValue === void 0 ? void 0 : Number(spuValue);
|
|
6636
6702
|
setValue(function(prev) {
|
|
6637
6703
|
var newScope = {
|
|
@@ -6649,7 +6715,7 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6649
6715
|
handleChange,
|
|
6650
6716
|
requireLevel
|
|
6651
6717
|
]);
|
|
6652
|
-
var handleSkuChange = (0,
|
|
6718
|
+
var handleSkuChange = (0, import_react47.useCallback)(function(skuValue) {
|
|
6653
6719
|
var skuId = skuValue === void 0 ? void 0 : Number(skuValue);
|
|
6654
6720
|
setValue(function(prev) {
|
|
6655
6721
|
var newScope = _object_spread_props(_object_spread({}, prev), {
|
|
@@ -6664,18 +6730,18 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6664
6730
|
handleChange,
|
|
6665
6731
|
requireLevel
|
|
6666
6732
|
]);
|
|
6667
|
-
var renderLabel = (0,
|
|
6668
|
-
return /* @__PURE__ */ (0,
|
|
6733
|
+
var renderLabel = (0, import_react47.useCallback)(function(label, required) {
|
|
6734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_antd34.Flex, {
|
|
6669
6735
|
flex: "0 0 auto",
|
|
6670
|
-
children: /* @__PURE__ */ (0,
|
|
6736
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Space, {
|
|
6671
6737
|
children: [
|
|
6672
|
-
required && /* @__PURE__ */ (0,
|
|
6738
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", {
|
|
6673
6739
|
style: {
|
|
6674
6740
|
color: "var(--ant-color-error)"
|
|
6675
6741
|
},
|
|
6676
6742
|
children: "*"
|
|
6677
6743
|
}),
|
|
6678
|
-
/* @__PURE__ */ (0,
|
|
6744
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", {
|
|
6679
6745
|
children: [
|
|
6680
6746
|
label,
|
|
6681
6747
|
":"
|
|
@@ -6685,32 +6751,35 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6685
6751
|
})
|
|
6686
6752
|
});
|
|
6687
6753
|
}, []);
|
|
6688
|
-
|
|
6754
|
+
if (mode === "view") {
|
|
6755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ScopeViewMode, _object_spread({}, value));
|
|
6756
|
+
}
|
|
6757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Flex, {
|
|
6689
6758
|
justify: "flex-start",
|
|
6690
6759
|
align: "center",
|
|
6691
6760
|
wrap: "nowrap",
|
|
6692
6761
|
gap: "15px",
|
|
6693
6762
|
children: [
|
|
6694
|
-
/* @__PURE__ */ (0,
|
|
6763
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Flex, {
|
|
6695
6764
|
align: "center",
|
|
6696
6765
|
gap: "5px",
|
|
6697
6766
|
flex: "0 0 auto",
|
|
6698
6767
|
children: [
|
|
6699
6768
|
renderLabel("\u5206\u7C7B", requireLevel >= 1 /* CATEGORY */ ),
|
|
6700
|
-
/* @__PURE__ */ (0,
|
|
6769
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectCategoryCascade, {
|
|
6701
6770
|
onChange: handleCategoryChange,
|
|
6702
6771
|
changeOnSelect: categoryChangeOnSelect,
|
|
6703
6772
|
value: value.categoryIds
|
|
6704
6773
|
})
|
|
6705
6774
|
]
|
|
6706
6775
|
}),
|
|
6707
|
-
lastLevelCategoryId && scopeLevel >= 2 /* BRAND */ && /* @__PURE__ */ (0,
|
|
6776
|
+
lastLevelCategoryId && scopeLevel >= 2 /* BRAND */ && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Flex, {
|
|
6708
6777
|
align: "center",
|
|
6709
6778
|
gap: "5px",
|
|
6710
6779
|
flex: "0 0 auto",
|
|
6711
6780
|
children: [
|
|
6712
6781
|
renderLabel("\u54C1\u724C", requireLevel >= 2 /* BRAND */ ),
|
|
6713
|
-
/* @__PURE__ */ (0,
|
|
6782
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectBrandSelect, _object_spread_props(_object_spread({
|
|
6714
6783
|
categoryId: lastLevelCategoryId
|
|
6715
6784
|
}, value), {
|
|
6716
6785
|
onChange: handleBrandChange,
|
|
@@ -6718,13 +6787,13 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6718
6787
|
}))
|
|
6719
6788
|
]
|
|
6720
6789
|
}),
|
|
6721
|
-
!!value.brandId && scopeLevel >= 3 /* SERIES */ && /* @__PURE__ */ (0,
|
|
6790
|
+
!!value.brandId && scopeLevel >= 3 /* SERIES */ && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Flex, {
|
|
6722
6791
|
align: "center",
|
|
6723
6792
|
gap: "5px",
|
|
6724
6793
|
flex: "0 0 auto",
|
|
6725
6794
|
children: [
|
|
6726
6795
|
renderLabel("\u7CFB\u5217", requireLevel >= 3 /* SERIES */ ),
|
|
6727
|
-
/* @__PURE__ */ (0,
|
|
6796
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectSeriesSelect, _object_spread_props(_object_spread({
|
|
6728
6797
|
categoryId: lastLevelCategoryId
|
|
6729
6798
|
}, value), {
|
|
6730
6799
|
onChange: handleSeriesChange,
|
|
@@ -6732,13 +6801,13 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6732
6801
|
}))
|
|
6733
6802
|
]
|
|
6734
6803
|
}),
|
|
6735
|
-
!!value.seriesId && scopeLevel >= 4 /* SPU */ && /* @__PURE__ */ (0,
|
|
6804
|
+
!!value.seriesId && scopeLevel >= 4 /* SPU */ && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Flex, {
|
|
6736
6805
|
align: "center",
|
|
6737
6806
|
gap: "5px",
|
|
6738
6807
|
flex: "0 0 auto",
|
|
6739
6808
|
children: [
|
|
6740
6809
|
renderLabel("SPU", requireLevel >= 4 /* SPU */ ),
|
|
6741
|
-
/* @__PURE__ */ (0,
|
|
6810
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectSpuSelect, _object_spread_props(_object_spread({
|
|
6742
6811
|
categoryId: lastLevelCategoryId
|
|
6743
6812
|
}, value), {
|
|
6744
6813
|
onChange: handleSpuChange,
|
|
@@ -6746,13 +6815,13 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6746
6815
|
}))
|
|
6747
6816
|
]
|
|
6748
6817
|
}),
|
|
6749
|
-
!!value.spuId && scopeLevel >= 5 /* SKU */ && /* @__PURE__ */ (0,
|
|
6818
|
+
!!value.spuId && scopeLevel >= 5 /* SKU */ && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Flex, {
|
|
6750
6819
|
align: "center",
|
|
6751
6820
|
gap: "5px",
|
|
6752
6821
|
flex: "0 0 auto",
|
|
6753
6822
|
children: [
|
|
6754
6823
|
renderLabel("SKU", requireLevel >= 5 /* SKU */ ),
|
|
6755
|
-
/* @__PURE__ */ (0,
|
|
6824
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectSkuSelect, _object_spread_props(_object_spread({
|
|
6756
6825
|
categoryId: lastLevelCategoryId
|
|
6757
6826
|
}, value), {
|
|
6758
6827
|
onChange: handleSkuChange,
|
|
@@ -6764,7 +6833,7 @@ var EffectScopeSelect = (0, import_react46.memo)(function(props) {
|
|
|
6764
6833
|
});
|
|
6765
6834
|
});
|
|
6766
6835
|
// src/EffectStaffSelect/index.tsx
|
|
6767
|
-
var
|
|
6836
|
+
var import_react48 = require("react");
|
|
6768
6837
|
var import_react_use17 = require("react-use");
|
|
6769
6838
|
var import_classnames13 = __toESM(require("classnames"));
|
|
6770
6839
|
var import_antd35 = require("antd");
|
|
@@ -6774,12 +6843,12 @@ var index_module_default18 = {
|
|
|
6774
6843
|
select: "index_module_select4"
|
|
6775
6844
|
};
|
|
6776
6845
|
// src/EffectStaffSelect/index.tsx
|
|
6777
|
-
var
|
|
6778
|
-
var EffectStaffSelect = (0,
|
|
6846
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
6847
|
+
var EffectStaffSelect = (0, import_react48.memo)(function(props) {
|
|
6779
6848
|
var _state_value_data, _state_value;
|
|
6780
6849
|
var onChange = props.onChange, deptId = props.deptId, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, disabled = props.disabled, placeholder = props.placeholder, style = props.style;
|
|
6781
|
-
var _ref = _sliced_to_array((0,
|
|
6782
|
-
var _ref1 = _sliced_to_array((0,
|
|
6850
|
+
var _ref = _sliced_to_array((0, import_react48.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
|
|
6851
|
+
var _ref1 = _sliced_to_array((0, import_react48.useState)(controlValue !== null && controlValue !== void 0 ? controlValue : defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
|
|
6783
6852
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
6784
6853
|
var getBusinessOptions = function getBusinessOptions(businessName, currentDeptId) {
|
|
6785
6854
|
return _async_to_generator(function() {
|
|
@@ -6813,10 +6882,10 @@ var EffectStaffSelect = (0, import_react47.memo)(function(props) {
|
|
|
6813
6882
|
deptId,
|
|
6814
6883
|
config
|
|
6815
6884
|
]), 2), state = _ref2[0], searchFetch = _ref2[1];
|
|
6816
|
-
var debounceSearchFetch = (0,
|
|
6885
|
+
var debounceSearchFetch = (0, import_react48.useCallback)((0, import_tools11.debounce)(600, searchFetch), [
|
|
6817
6886
|
searchFetch
|
|
6818
6887
|
]);
|
|
6819
|
-
(0,
|
|
6888
|
+
(0, import_react48.useEffect)(function() {
|
|
6820
6889
|
var _state_value_data, _state_value;
|
|
6821
6890
|
if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : (_state_value_data = _state_value.data) === null || _state_value_data === void 0 ? void 0 : _state_value_data.list)) {
|
|
6822
6891
|
return;
|
|
@@ -6871,7 +6940,7 @@ var EffectStaffSelect = (0, import_react47.memo)(function(props) {
|
|
|
6871
6940
|
}
|
|
6872
6941
|
};
|
|
6873
6942
|
var defaultPlaceholder = deptId ? "\u8BF7\u9009\u62E9\u5458\u5DE5\u59D3\u540D" : "\u8BF7\u5148\u8F93\u5165\u5458\u5DE5\u59D3\u540D";
|
|
6874
|
-
return /* @__PURE__ */ (0,
|
|
6943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_antd35.Select, {
|
|
6875
6944
|
className: (0, import_classnames13.default)(index_module_default18.select, className),
|
|
6876
6945
|
style: style,
|
|
6877
6946
|
notFoundContent: state.loading ? "\u641C\u7D22\u4E2D" : ((_state_value = state.value) === null || _state_value === void 0 ? void 0 : (_state_value_data = _state_value.data) === null || _state_value_data === void 0 ? void 0 : _state_value_data.total) === 0 ? "\u6682\u65E0\u6570\u636E" : defaultPlaceholder,
|
|
@@ -6890,14 +6959,14 @@ var EffectStaffSelect = (0, import_react47.memo)(function(props) {
|
|
|
6890
6959
|
});
|
|
6891
6960
|
});
|
|
6892
6961
|
// src/EffectReservoirSelect/EffectReservoirSelect.tsx
|
|
6893
|
-
var
|
|
6962
|
+
var import_react49 = require("react");
|
|
6894
6963
|
var import_react_use18 = require("react-use");
|
|
6895
6964
|
var import_antd36 = require("antd");
|
|
6896
|
-
var
|
|
6897
|
-
var EffectReservoirSelect = (0,
|
|
6965
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
6966
|
+
var EffectReservoirSelect = (0, import_react49.memo)(function(props) {
|
|
6898
6967
|
var onChange = props.onChange, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, disabled = props.disabled, warehouseId = props.warehouseId, _props_reservoirType = props.reservoirType, reservoirType = _props_reservoirType === void 0 ? "normal" : _props_reservoirType;
|
|
6899
|
-
var _ref = _sliced_to_array((0,
|
|
6900
|
-
var _ref1 = _sliced_to_array((0,
|
|
6968
|
+
var _ref = _sliced_to_array((0, import_react49.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
|
|
6969
|
+
var _ref1 = _sliced_to_array((0, import_react49.useState)(controlValue || defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
|
|
6901
6970
|
var prevControlValue = (0, import_react_use18.usePrevious)(controlValue);
|
|
6902
6971
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
6903
6972
|
var get_reservoir_options = function get_reservoir_options() {
|
|
@@ -6930,7 +6999,7 @@ var EffectReservoirSelect = (0, import_react48.memo)(function(props) {
|
|
|
6930
6999
|
var _ref2 = _sliced_to_array((0, import_react_use18.useAsyncFn)(get_reservoir_options, [
|
|
6931
7000
|
warehouseId
|
|
6932
7001
|
]), 2), state = _ref2[0], fetch = _ref2[1];
|
|
6933
|
-
(0,
|
|
7002
|
+
(0, import_react49.useEffect)(function() {
|
|
6934
7003
|
var _state_value;
|
|
6935
7004
|
if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.data.list)) return;
|
|
6936
7005
|
var options2 = state.value.data.list.map(function(param) {
|
|
@@ -6981,20 +7050,20 @@ var EffectReservoirSelect = (0, import_react48.memo)(function(props) {
|
|
|
6981
7050
|
onChange: handleOnChange,
|
|
6982
7051
|
loading: state.loading
|
|
6983
7052
|
};
|
|
6984
|
-
return /* @__PURE__ */ (0,
|
|
7053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_antd36.Select, _object_spread({
|
|
6985
7054
|
className: className
|
|
6986
7055
|
}, selectBrandProps));
|
|
6987
7056
|
});
|
|
6988
7057
|
// src/EffectReservoirSelect/EffectShelveSelect.tsx
|
|
6989
|
-
var
|
|
7058
|
+
var import_react50 = require("react");
|
|
6990
7059
|
var import_react_use19 = require("react-use");
|
|
6991
7060
|
var import_antd37 = require("antd");
|
|
6992
|
-
var
|
|
6993
|
-
var EffectShelveSelect = (0,
|
|
7061
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
7062
|
+
var EffectShelveSelect = (0, import_react50.memo)(function(props) {
|
|
6994
7063
|
var onChange = props.onChange, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, disabled = props.disabled, warehouseId = props.warehouseId, reservoirId = props.reservoirId;
|
|
6995
7064
|
var _props_valueType = props.valueType, valueType = _props_valueType === void 0 ? "code" : _props_valueType;
|
|
6996
|
-
var _ref = _sliced_to_array((0,
|
|
6997
|
-
var _ref1 = _sliced_to_array((0,
|
|
7065
|
+
var _ref = _sliced_to_array((0, import_react50.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
|
|
7066
|
+
var _ref1 = _sliced_to_array((0, import_react50.useState)(controlValue || defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
|
|
6998
7067
|
var prevControlValue = (0, import_react_use19.usePrevious)(controlValue);
|
|
6999
7068
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
7000
7069
|
var get_shelve_options = function get_shelve_options() {
|
|
@@ -7028,7 +7097,7 @@ var EffectShelveSelect = (0, import_react49.memo)(function(props) {
|
|
|
7028
7097
|
reservoirId,
|
|
7029
7098
|
warehouseId
|
|
7030
7099
|
]), 2), state = _ref2[0], fetch = _ref2[1];
|
|
7031
|
-
(0,
|
|
7100
|
+
(0, import_react50.useEffect)(function() {
|
|
7032
7101
|
var _state_value;
|
|
7033
7102
|
if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.data.list)) return;
|
|
7034
7103
|
var options2 = state.value.data.list.map(function(param) {
|
|
@@ -7081,14 +7150,14 @@ var EffectShelveSelect = (0, import_react49.memo)(function(props) {
|
|
|
7081
7150
|
onChange: handleOnChange,
|
|
7082
7151
|
loading: state.loading
|
|
7083
7152
|
};
|
|
7084
|
-
return /* @__PURE__ */ (0,
|
|
7153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_antd37.Select, _object_spread({
|
|
7085
7154
|
className: className
|
|
7086
7155
|
}, selectBrandProps));
|
|
7087
7156
|
});
|
|
7088
7157
|
// src/EffectWarehouseSelect/index.tsx
|
|
7089
7158
|
var import_antd38 = require("antd");
|
|
7090
7159
|
var import_classnames14 = __toESM(require("classnames"));
|
|
7091
|
-
var
|
|
7160
|
+
var import_react51 = require("react");
|
|
7092
7161
|
// src/EffectWarehouseSelect/useStoreOptions.ts
|
|
7093
7162
|
var import_immutable7 = __toESM(require("swr/immutable"));
|
|
7094
7163
|
var transformStoreData = function transformStoreData() {
|
|
@@ -7151,8 +7220,8 @@ var index_module_default19 = {
|
|
|
7151
7220
|
select: "index_module_select5"
|
|
7152
7221
|
};
|
|
7153
7222
|
// src/EffectWarehouseSelect/index.tsx
|
|
7154
|
-
var
|
|
7155
|
-
var EffectWarehouseSelect = (0,
|
|
7223
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
7224
|
+
var EffectWarehouseSelect = (0, import_react51.memo)(function(props) {
|
|
7156
7225
|
var onChange = props.onChange, className = props.className, value = props.value, disabled = props.disabled, _props_currentMerchantOnly = props.currentMerchantOnly, currentMerchantOnly = _props_currentMerchantOnly === void 0 ? true : _props_currentMerchantOnly, warehouseType = props.warehouseType;
|
|
7157
7226
|
var state = useStoreOptions(currentMerchantOnly, warehouseType);
|
|
7158
7227
|
var handleChange = function handleChange(selectedValue, option) {
|
|
@@ -7162,7 +7231,7 @@ var EffectWarehouseSelect = (0, import_react50.memo)(function(props) {
|
|
|
7162
7231
|
var handleClear = function handleClear() {
|
|
7163
7232
|
onChange === null || onChange === void 0 ? void 0 : onChange(void 0, void 0);
|
|
7164
7233
|
};
|
|
7165
|
-
return /* @__PURE__ */ (0,
|
|
7234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_antd38.Select, {
|
|
7166
7235
|
className: (0, import_classnames14.default)(index_module_default19.select, className),
|
|
7167
7236
|
placeholder: "\u8BF7\u9009\u62E9\u4ED3\u5E93",
|
|
7168
7237
|
notFoundContent: state.isLoading ? "\u52A0\u8F7D\u4E2D..." : "\u6682\u65E0\u4ED3\u5E93\u6570\u636E",
|
|
@@ -7175,7 +7244,7 @@ var EffectWarehouseSelect = (0, import_react50.memo)(function(props) {
|
|
|
7175
7244
|
});
|
|
7176
7245
|
});
|
|
7177
7246
|
// src/EffectAddressCascade/index.tsx
|
|
7178
|
-
var
|
|
7247
|
+
var import_react52 = require("react");
|
|
7179
7248
|
var import_react_use20 = require("react-use");
|
|
7180
7249
|
var import_classnames15 = __toESM(require("classnames"));
|
|
7181
7250
|
// src/EffectAddressCascade/index.module.less
|
|
@@ -7185,12 +7254,12 @@ var index_module_default20 = {
|
|
|
7185
7254
|
};
|
|
7186
7255
|
// src/EffectAddressCascade/index.tsx
|
|
7187
7256
|
var import_antd39 = require("antd");
|
|
7188
|
-
var
|
|
7189
|
-
var EffectAddressCascade = (0,
|
|
7257
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
7258
|
+
var EffectAddressCascade = (0, import_react52.memo)(function(props) {
|
|
7190
7259
|
var _selectedList_;
|
|
7191
7260
|
var className = props.className, disabled = props.disabled, defaultValue = props.defaultValue, onChange = props.onChange;
|
|
7192
|
-
var _ref = _sliced_to_array((0,
|
|
7193
|
-
var _ref1 = _sliced_to_array((0,
|
|
7261
|
+
var _ref = _sliced_to_array((0, import_react52.useState)(), 2), selectedList = _ref[0], setSelectedList = _ref[1];
|
|
7262
|
+
var _ref1 = _sliced_to_array((0, import_react52.useState)(), 2), customTree = _ref1[0], setCustomTree = _ref1[1];
|
|
7194
7263
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
7195
7264
|
var params = {
|
|
7196
7265
|
pid: (selectedList === null || selectedList === void 0 ? void 0 : (_selectedList_ = selectedList[(selectedList === null || selectedList === void 0 ? void 0 : selectedList.length) - 1]) === null || _selectedList_ === void 0 ? void 0 : _selectedList_.value) || ""
|
|
@@ -7216,7 +7285,7 @@ var EffectAddressCascade = (0, import_react51.memo)(function(props) {
|
|
|
7216
7285
|
var _ref2 = _sliced_to_array((0, import_react_use20.useAsyncFn)(getAddress, [
|
|
7217
7286
|
selectedList
|
|
7218
7287
|
]), 2), state = _ref2[0], getAddressFetch = _ref2[1];
|
|
7219
|
-
(0,
|
|
7288
|
+
(0, import_react52.useEffect)(function() {
|
|
7220
7289
|
var _state_value;
|
|
7221
7290
|
if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.data.list)) return;
|
|
7222
7291
|
var list = state.value.data.list;
|
|
@@ -7254,7 +7323,7 @@ var EffectAddressCascade = (0, import_react51.memo)(function(props) {
|
|
|
7254
7323
|
}, [
|
|
7255
7324
|
state
|
|
7256
7325
|
]);
|
|
7257
|
-
(0,
|
|
7326
|
+
(0, import_react52.useEffect)(function() {
|
|
7258
7327
|
if (!state.loading || !customTree || !selectedList) return;
|
|
7259
7328
|
var target = findTargetLeaf(selectedList, customTree);
|
|
7260
7329
|
if (!target) return;
|
|
@@ -7266,7 +7335,7 @@ var EffectAddressCascade = (0, import_react51.memo)(function(props) {
|
|
|
7266
7335
|
(0, import_react_use20.useMount)(function() {
|
|
7267
7336
|
void getAddressFetch();
|
|
7268
7337
|
});
|
|
7269
|
-
(0,
|
|
7338
|
+
(0, import_react52.useEffect)(function() {
|
|
7270
7339
|
var target = findTargetLeaf(selectedList || [], customTree || []);
|
|
7271
7340
|
if ((target === null || target === void 0 ? void 0 : target.isLeaf) || !(selectedList === null || selectedList === void 0 ? void 0 : selectedList.length)) return;
|
|
7272
7341
|
void getAddressFetch();
|
|
@@ -7282,7 +7351,7 @@ var EffectAddressCascade = (0, import_react51.memo)(function(props) {
|
|
|
7282
7351
|
setSelectedList(_selectedList);
|
|
7283
7352
|
if (onChange) onChange(_selectedList);
|
|
7284
7353
|
};
|
|
7285
|
-
return /* @__PURE__ */ (0,
|
|
7354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_antd39.Cascader, {
|
|
7286
7355
|
className: (0, import_classnames15.default)(index_module_default20.input, className),
|
|
7287
7356
|
disabled: disabled,
|
|
7288
7357
|
defaultValue: defaultValue,
|
|
@@ -7317,7 +7386,7 @@ var transformSelectedList = function transformSelectedList(selectedOptions) {
|
|
|
7317
7386
|
});
|
|
7318
7387
|
};
|
|
7319
7388
|
// src/EffectLabelSelect/index.tsx
|
|
7320
|
-
var
|
|
7389
|
+
var import_react53 = require("react");
|
|
7321
7390
|
var import_react_use22 = require("react-use");
|
|
7322
7391
|
var import_classnames16 = __toESM(require("classnames"));
|
|
7323
7392
|
// src/EffectLabelSelect/hooks.ts
|
|
@@ -7367,27 +7436,27 @@ var index_module_default21 = {
|
|
|
7367
7436
|
};
|
|
7368
7437
|
// src/EffectLabelSelect/index.tsx
|
|
7369
7438
|
var import_antd40 = require("antd");
|
|
7370
|
-
var
|
|
7371
|
-
var EffectLabelSelect = (0,
|
|
7439
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
7440
|
+
var EffectLabelSelect = (0, import_react53.memo)(function(props) {
|
|
7372
7441
|
var onChange = props.onChange, className = props.className, value = props.value, disabled = props.disabled, defaultLabel = props.defaultLabel, _props_labelDic = props.labelDic, labelDic = _props_labelDic === void 0 ? defaultLabelDic : _props_labelDic, onFetchData = props.onFetchData, _props_onTransformData = props.onTransformData, onTransformData = _props_onTransformData === void 0 ? defaultTransformDataFn : _props_onTransformData, _props_fetchParams = props.fetchParams, fetchParams = _props_fetchParams === void 0 ? {} : _props_fetchParams, _props_customLabelInValue = props.customLabelInValue, customLabelInValue = _props_customLabelInValue === void 0 ? false : _props_customLabelInValue, optionsDisplayType = props.optionsDisplayType, style = props.style;
|
|
7373
7442
|
var apiService = useRequestConfig().apiService;
|
|
7374
|
-
var _ref = _sliced_to_array((0,
|
|
7443
|
+
var _ref = _sliced_to_array((0, import_react53.useState)(function() {
|
|
7375
7444
|
var _transformObj2Options_, _transformObj2Options;
|
|
7376
7445
|
var defaultLabelFromValue = customLabelInValue ? getSelectValue(value, "labelDicKey") : "";
|
|
7377
7446
|
var defaultLabelFromLabelDic = transformObj2Options === null || transformObj2Options === void 0 ? void 0 : (_transformObj2Options = transformObj2Options(labelDic)) === null || _transformObj2Options === void 0 ? void 0 : (_transformObj2Options_ = _transformObj2Options[0]) === null || _transformObj2Options_ === void 0 ? void 0 : _transformObj2Options_.value;
|
|
7378
7447
|
return defaultLabel || defaultLabelFromValue || defaultLabelFromLabelDic || "";
|
|
7379
7448
|
}), 2), curSelectLabel = _ref[0], setCurSelectLabel = _ref[1];
|
|
7380
|
-
var _ref1 = _sliced_to_array((0,
|
|
7381
|
-
var _ref2 = _sliced_to_array((0,
|
|
7382
|
-
var _ref3 = _sliced_to_array((0,
|
|
7383
|
-
var _ref4 = _sliced_to_array((0,
|
|
7449
|
+
var _ref1 = _sliced_to_array((0, import_react53.useState)(value !== null && value !== void 0 ? value : void 0), 2), curSelectValue = _ref1[0], setCurSelectValue = _ref1[1];
|
|
7450
|
+
var _ref2 = _sliced_to_array((0, import_react53.useState)(), 2), curSelectItem = _ref2[0], setCurSelectItem = _ref2[1];
|
|
7451
|
+
var _ref3 = _sliced_to_array((0, import_react53.useState)(), 2), curSearchValue = _ref3[0], setCurSearchValue = _ref3[1];
|
|
7452
|
+
var _ref4 = _sliced_to_array((0, import_react53.useState)([]), 2), optionsData = _ref4[0], setOptionsData = _ref4[1];
|
|
7384
7453
|
var fetchDataFn = onFetchData || apiService.merchantList;
|
|
7385
7454
|
var fetchDataDeps = _object_spread_props(_object_spread({}, fetchParams), _define_property({}, curSelectLabel, curSearchValue || void 0));
|
|
7386
7455
|
var _useReqData = _sliced_to_array(useReqData(fetchDataFn, _object_spread({
|
|
7387
7456
|
page: 1,
|
|
7388
7457
|
pageSize: 20
|
|
7389
7458
|
}, fetchDataDeps), JSON.stringify(fetchDataDeps)), 1), resState = _useReqData[0];
|
|
7390
|
-
(0,
|
|
7459
|
+
(0, import_react53.useEffect)(function() {
|
|
7391
7460
|
var _resState_value;
|
|
7392
7461
|
if (resState.loading || !((_resState_value = resState.value) === null || _resState_value === void 0 ? void 0 : _resState_value.data.list)) return;
|
|
7393
7462
|
var optionsData2 = resState.value.data.list.map(onTransformData);
|
|
@@ -7457,12 +7526,12 @@ var EffectLabelSelect = (0, import_react52.memo)(function(props) {
|
|
|
7457
7526
|
filterOption: false,
|
|
7458
7527
|
popupMatchSelectWidth: false
|
|
7459
7528
|
};
|
|
7460
|
-
return /* @__PURE__ */ (0,
|
|
7529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_antd40.Space.Compact, {
|
|
7461
7530
|
className: index_module_default21.select_wrap,
|
|
7462
7531
|
style: style,
|
|
7463
7532
|
children: [
|
|
7464
|
-
/* @__PURE__ */ (0,
|
|
7465
|
-
/* @__PURE__ */ (0,
|
|
7533
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_antd40.Select, _object_spread({}, selectLabelProps)),
|
|
7534
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_antd40.Select, _object_spread({}, selectValueProps))
|
|
7466
7535
|
]
|
|
7467
7536
|
});
|
|
7468
7537
|
});
|