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