@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.mjs
CHANGED
|
@@ -4089,10 +4089,12 @@ import { Transfer, Typography as Typography2 } from "antd";
|
|
|
4089
4089
|
import useSWRImmutable2 from "swr/immutable";
|
|
4090
4090
|
function useBrandOptions(params) {
|
|
4091
4091
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
4092
|
-
var _useSWRImmutable2 = useSWRImmutable2(
|
|
4092
|
+
var _useSWRImmutable2 = useSWRImmutable2(// 只有当 params 存在时才发起请求,避免无效请求
|
|
4093
|
+
params != null ? [
|
|
4093
4094
|
"/product/brand/combo-box",
|
|
4094
4095
|
params
|
|
4095
|
-
], function() {
|
|
4096
|
+
] : null, function(param) {
|
|
4097
|
+
var _param = _sliced_to_array(param, 2), _params = _param[1];
|
|
4096
4098
|
return _async_to_generator(function() {
|
|
4097
4099
|
var _res_data, res, options;
|
|
4098
4100
|
return _ts_generator(this, function(_state) {
|
|
@@ -4103,7 +4105,7 @@ function useBrandOptions(params) {
|
|
|
4103
4105
|
apiService.brandComboBox(_object_spread({
|
|
4104
4106
|
page: 1,
|
|
4105
4107
|
pageSize: 500
|
|
4106
|
-
},
|
|
4108
|
+
}, _params), config)
|
|
4107
4109
|
];
|
|
4108
4110
|
case 1:
|
|
4109
4111
|
res = _state.sent();
|
|
@@ -4430,22 +4432,15 @@ import { memo as memo25, useCallback as useCallback18, useState as useState19 }
|
|
|
4430
4432
|
import { usePrevious as usePrevious4, useUpdateEffect as useUpdateEffect9 } from "react-use";
|
|
4431
4433
|
import { debounce as debounce3 } from "@xfe-repo/web-utils/tools";
|
|
4432
4434
|
import classnames8 from "classnames";
|
|
4433
|
-
|
|
4434
|
-
var index_module_default11 = {
|
|
4435
|
-
input: "index_module_input3",
|
|
4436
|
-
select: "index_module_select2"
|
|
4437
|
-
};
|
|
4438
|
-
// src/EffectBrandSelect/index.tsx
|
|
4439
|
-
import { Select as Select4 } from "antd";
|
|
4440
|
-
import { Typography as Typography3 } from "antd";
|
|
4435
|
+
import { Select as Select4, Typography as Typography3 } from "antd";
|
|
4441
4436
|
// src/EffectSkuSelect/index.tsx
|
|
4442
4437
|
import { memo as memo24, useCallback as useCallback17, useEffect as useEffect16, useMemo as useMemo14, useState as useState18 } from "react";
|
|
4443
4438
|
import { useMount, useUpdateEffect as useUpdateEffect8, usePrevious as usePrevious3 } from "react-use";
|
|
4444
4439
|
import { debounce as debounce2, uuid as uuid2 } from "@xfe-repo/web-utils/tools";
|
|
4445
4440
|
import classnames7 from "classnames";
|
|
4446
4441
|
// src/EffectSkuSelect/index.module.less
|
|
4447
|
-
var
|
|
4448
|
-
input: "
|
|
4442
|
+
var index_module_default11 = {
|
|
4443
|
+
input: "index_module_input3",
|
|
4449
4444
|
image: "index_module_image",
|
|
4450
4445
|
preview: "index_module_preview",
|
|
4451
4446
|
icon: "index_module_icon",
|
|
@@ -4677,7 +4672,7 @@ var EffectSkuSelect = memo24(function(props) {
|
|
|
4677
4672
|
state,
|
|
4678
4673
|
options
|
|
4679
4674
|
]);
|
|
4680
|
-
var
|
|
4675
|
+
var popupRender = useCallback17(function(_menu) {
|
|
4681
4676
|
return /* @__PURE__ */ jsx34(SelectDropdown, {
|
|
4682
4677
|
value: value,
|
|
4683
4678
|
options: options,
|
|
@@ -4709,14 +4704,14 @@ var EffectSkuSelect = memo24(function(props) {
|
|
|
4709
4704
|
onSearch: handleOnSearch,
|
|
4710
4705
|
onClear: handleOnClear,
|
|
4711
4706
|
open: openDropDown,
|
|
4712
|
-
|
|
4713
|
-
|
|
4707
|
+
popupRender: popupRender,
|
|
4708
|
+
onOpenChange: setOpenDropDown,
|
|
4714
4709
|
getPopupContainer: function getPopupContainer() {
|
|
4715
4710
|
return document.body;
|
|
4716
4711
|
}
|
|
4717
4712
|
};
|
|
4718
4713
|
return /* @__PURE__ */ jsx34(Select3, _object_spread({
|
|
4719
|
-
className: classnames7(
|
|
4714
|
+
className: classnames7(index_module_default11.input, className)
|
|
4720
4715
|
}, selectBrandProps));
|
|
4721
4716
|
});
|
|
4722
4717
|
var SelectDropdown = memo24(function(props) {
|
|
@@ -4737,7 +4732,7 @@ var SelectDropdown = memo24(function(props) {
|
|
|
4737
4732
|
}, []);
|
|
4738
4733
|
return /* @__PURE__ */ jsx34("div", {
|
|
4739
4734
|
id: selectDropdownId,
|
|
4740
|
-
className:
|
|
4735
|
+
className: index_module_default11.select_dropdown,
|
|
4741
4736
|
onMouseDown: handleMouseDown,
|
|
4742
4737
|
children: /* @__PURE__ */ jsx34(InfiniteScroll, {
|
|
4743
4738
|
dataLength: options.length,
|
|
@@ -4754,22 +4749,22 @@ var SelectDropdown = memo24(function(props) {
|
|
|
4754
4749
|
scrollableTarget: selectDropdownId,
|
|
4755
4750
|
scrollThreshold: "100px",
|
|
4756
4751
|
children: /* @__PURE__ */ jsx34("div", {
|
|
4757
|
-
className:
|
|
4752
|
+
className: index_module_default11.options,
|
|
4758
4753
|
children: options.map(function(item) {
|
|
4759
4754
|
return /* @__PURE__ */ jsxs14("div", {
|
|
4760
|
-
className: classnames7(
|
|
4755
|
+
className: classnames7(index_module_default11.option, item.value === value && index_module_default11.active),
|
|
4761
4756
|
onClick: function onClick() {
|
|
4762
4757
|
return handleOnSelect(item);
|
|
4763
4758
|
},
|
|
4764
4759
|
children: [
|
|
4765
4760
|
/* @__PURE__ */ jsx34(ImageItem, {
|
|
4766
|
-
className:
|
|
4761
|
+
className: index_module_default11.select_image,
|
|
4767
4762
|
item: item,
|
|
4768
4763
|
previewed: item.image === previewImage2,
|
|
4769
4764
|
onPreview: handlePreview
|
|
4770
4765
|
}),
|
|
4771
4766
|
/* @__PURE__ */ jsx34("p", {
|
|
4772
|
-
className:
|
|
4767
|
+
className: index_module_default11.label,
|
|
4773
4768
|
children: item.label
|
|
4774
4769
|
})
|
|
4775
4770
|
]
|
|
@@ -4790,7 +4785,7 @@ var ImageItem = memo24(function(props) {
|
|
|
4790
4785
|
]);
|
|
4791
4786
|
var previewProps = useMemo14(function() {
|
|
4792
4787
|
return {
|
|
4793
|
-
maskClassName: "".concat(
|
|
4788
|
+
maskClassName: "".concat(index_module_default11.item_mask_img),
|
|
4794
4789
|
visible: previewed,
|
|
4795
4790
|
onVisibleChange: function onVisibleChange(value) {
|
|
4796
4791
|
return !value && (onPreview === null || onPreview === void 0 ? void 0 : onPreview());
|
|
@@ -4801,16 +4796,16 @@ var ImageItem = memo24(function(props) {
|
|
|
4801
4796
|
onPreview
|
|
4802
4797
|
]);
|
|
4803
4798
|
return /* @__PURE__ */ jsxs14("div", {
|
|
4804
|
-
className: classnames7(
|
|
4799
|
+
className: classnames7(index_module_default11.image, className),
|
|
4805
4800
|
children: [
|
|
4806
4801
|
/* @__PURE__ */ jsxs14("div", {
|
|
4807
|
-
className:
|
|
4802
|
+
className: index_module_default11.preview,
|
|
4808
4803
|
onClick: function onClick(event) {
|
|
4809
4804
|
return handlePreview(event);
|
|
4810
4805
|
},
|
|
4811
4806
|
children: [
|
|
4812
4807
|
/* @__PURE__ */ jsx34(EyeOutlined2, {
|
|
4813
|
-
className:
|
|
4808
|
+
className: index_module_default11.icon
|
|
4814
4809
|
}),
|
|
4815
4810
|
" \u9884\u89C8"
|
|
4816
4811
|
]
|
|
@@ -4828,44 +4823,64 @@ var getNumberValue = function getNumberValue(value) {
|
|
|
4828
4823
|
var numValue = Number(value);
|
|
4829
4824
|
return Number.isNaN(numValue) ? void 0 : numValue;
|
|
4830
4825
|
};
|
|
4826
|
+
// src/EffectBrandSelect/index.module.less
|
|
4827
|
+
var index_module_default12 = {
|
|
4828
|
+
input: "index_module_input4",
|
|
4829
|
+
select: "index_module_select2"
|
|
4830
|
+
};
|
|
4831
4831
|
// src/EffectBrandSelect/index.tsx
|
|
4832
4832
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
4833
|
+
var OTHER_BRAND_OPTION = {
|
|
4834
|
+
label: "\u5176\u5B83",
|
|
4835
|
+
value: 1310
|
|
4836
|
+
};
|
|
4833
4837
|
var EffectBrandSelect = memo25(function(props) {
|
|
4834
|
-
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;
|
|
4838
|
+
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;
|
|
4839
|
+
var initialValue = controlValue !== null && controlValue !== void 0 ? controlValue : defaultValue;
|
|
4840
|
+
var hasDefaultLabel = !!defaultLabel && initialValue !== void 0;
|
|
4835
4841
|
var _useState19 = _sliced_to_array(useState19(controlValue || defaultValue), 2), value = _useState19[0], setValue = _useState19[1];
|
|
4842
|
+
var _useState191 = _sliced_to_array(useState19(function() {
|
|
4843
|
+
if (hasDefaultLabel) return null;
|
|
4844
|
+
return {
|
|
4845
|
+
/** 兼容 props 分类 Id 异常传入 */ categoryId: getNumberValue(categoryId),
|
|
4846
|
+
sysBizTypeId: sysBizTypeId,
|
|
4847
|
+
brandId: initialValue === null || initialValue === void 0 ? void 0 : initialValue.toString()
|
|
4848
|
+
};
|
|
4849
|
+
}), 2), params = _useState191[0], setParams = _useState191[1];
|
|
4850
|
+
var _useState192 = _sliced_to_array(useState19(hasDefaultLabel ? [
|
|
4851
|
+
{
|
|
4852
|
+
label: defaultLabel,
|
|
4853
|
+
value: initialValue
|
|
4854
|
+
}
|
|
4855
|
+
] : []), 2), options = _useState192[0], setOptions = _useState192[1];
|
|
4856
|
+
var prevControlValue = usePrevious4(controlValue);
|
|
4857
|
+
var state = useBrandOptions(params);
|
|
4836
4858
|
var searchFetch = useCallback18(function(brandName, brandId) {
|
|
4837
|
-
if (brandId !== void 0) brandId = String(brandId);
|
|
4838
4859
|
setParams({
|
|
4839
|
-
categoryId: getNumberValue(categoryId),
|
|
4860
|
+
/** 兼容 props 分类 Id 异常传入 */ categoryId: getNumberValue(categoryId),
|
|
4840
4861
|
sysBizTypeId: sysBizTypeId,
|
|
4841
|
-
brandName: brandName,
|
|
4842
|
-
brandId: brandId
|
|
4862
|
+
brandName: brandName || void 0,
|
|
4863
|
+
brandId: brandId === null || brandId === void 0 ? void 0 : brandId.toString()
|
|
4843
4864
|
});
|
|
4844
4865
|
}, [
|
|
4845
4866
|
categoryId,
|
|
4846
4867
|
sysBizTypeId
|
|
4847
4868
|
]);
|
|
4848
|
-
var
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4869
|
+
var handleSearch = useCallback18(debounce3(800, function(searchName) {
|
|
4870
|
+
return searchFetch(searchName);
|
|
4871
|
+
}), [
|
|
4872
|
+
searchFetch
|
|
4873
|
+
]);
|
|
4874
|
+
var handleReset = useCallback18(function() {
|
|
4875
|
+
return searchFetch("");
|
|
4876
|
+
}, [
|
|
4877
|
+
searchFetch
|
|
4878
|
+
]);
|
|
4857
4879
|
useUpdateEffect9(function() {
|
|
4858
4880
|
if (!state.data) return;
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
setOptions(state.data.concat([
|
|
4863
|
-
{
|
|
4864
|
-
label: "\u5176\u5B83",
|
|
4865
|
-
value: 1310
|
|
4866
|
-
}
|
|
4867
|
-
]));
|
|
4868
|
-
}
|
|
4881
|
+
setOptions(showOtherBrand ? _to_consumable_array(state.data).concat([
|
|
4882
|
+
OTHER_BRAND_OPTION
|
|
4883
|
+
]) : state.data);
|
|
4869
4884
|
}, [
|
|
4870
4885
|
state.data,
|
|
4871
4886
|
showOtherBrand
|
|
@@ -4887,7 +4902,7 @@ var EffectBrandSelect = memo25(function(props) {
|
|
|
4887
4902
|
}, [
|
|
4888
4903
|
controlValue
|
|
4889
4904
|
]);
|
|
4890
|
-
var
|
|
4905
|
+
var handleChange = function handleChange(_value, _option) {
|
|
4891
4906
|
setValue(_value);
|
|
4892
4907
|
if (mode === "multiple") {
|
|
4893
4908
|
var options2 = _option;
|
|
@@ -4900,19 +4915,6 @@ var EffectBrandSelect = memo25(function(props) {
|
|
|
4900
4915
|
onChange === null || onChange === void 0 ? void 0 : onChange(_value, option === null || option === void 0 ? void 0 : option.label);
|
|
4901
4916
|
}
|
|
4902
4917
|
};
|
|
4903
|
-
var handleOnDeselect = function handleOnDeselect(_value) {
|
|
4904
|
-
searchFetch("");
|
|
4905
|
-
};
|
|
4906
|
-
var handleOnSearch = function handleOnSearch(searchName) {
|
|
4907
|
-
return searchFetch(searchName);
|
|
4908
|
-
};
|
|
4909
|
-
var handleOnSearchDebounce = useCallback18(debounce3(800, handleOnSearch), [
|
|
4910
|
-
categoryId,
|
|
4911
|
-
sysBizTypeId
|
|
4912
|
-
]);
|
|
4913
|
-
var handleOnClear = function handleOnClear() {
|
|
4914
|
-
return searchFetch("");
|
|
4915
|
-
};
|
|
4916
4918
|
if (state.error) {
|
|
4917
4919
|
var _state_error;
|
|
4918
4920
|
return /* @__PURE__ */ jsx35(Typography3.Text, {
|
|
@@ -4920,53 +4922,34 @@ var EffectBrandSelect = memo25(function(props) {
|
|
|
4920
4922
|
children: (_state_error = state.error) === null || _state_error === void 0 ? void 0 : _state_error.toString()
|
|
4921
4923
|
});
|
|
4922
4924
|
}
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
+
return /* @__PURE__ */ jsx35(Select4, {
|
|
4926
|
+
className: classnames8(index_module_default12.input, className),
|
|
4925
4927
|
popupMatchSelectWidth: false,
|
|
4926
|
-
notFoundContent:
|
|
4928
|
+
notFoundContent: state.isLoading ? "\u641C\u7D22\u4E2D" : "\u672A\u67E5\u8BE2\u5230\u76F8\u5173\u54C1\u724C",
|
|
4927
4929
|
placeholder: "\u8BF7\u8F93\u5165\u54C1\u724C\u540D\u79F0",
|
|
4928
4930
|
optionFilterProp: "label",
|
|
4929
4931
|
showSearch: true,
|
|
4930
4932
|
allowClear: true,
|
|
4931
4933
|
defaultActiveFirstOption: false,
|
|
4932
4934
|
filterOption: false,
|
|
4933
|
-
onChange:
|
|
4934
|
-
onSearch:
|
|
4935
|
-
onDeselect:
|
|
4936
|
-
onClear:
|
|
4935
|
+
onChange: handleChange,
|
|
4936
|
+
onSearch: handleSearch,
|
|
4937
|
+
onDeselect: handleReset,
|
|
4938
|
+
onClear: handleReset,
|
|
4937
4939
|
loading: state.isLoading,
|
|
4938
4940
|
value: value,
|
|
4939
4941
|
options: options,
|
|
4940
4942
|
disabled: disabled,
|
|
4941
4943
|
mode: mode,
|
|
4942
4944
|
style: style
|
|
4943
|
-
};
|
|
4944
|
-
return /* @__PURE__ */ jsx35(Select4, _object_spread({
|
|
4945
|
-
className: classnames8(index_module_default11.input, className)
|
|
4946
|
-
}, selectBrandProps));
|
|
4945
|
+
});
|
|
4947
4946
|
});
|
|
4948
4947
|
// src/EffectSeriesSelect/index.tsx
|
|
4949
|
-
import { memo as memo26, useCallback as useCallback19,
|
|
4948
|
+
import { memo as memo26, useCallback as useCallback19, useEffect as useEffect17, useMemo as useMemo15, useRef as useRef11, useState as useState20 } from "react";
|
|
4949
|
+
import { Select as Select5 } from "antd";
|
|
4950
4950
|
import { useMount as useMount2, usePrevious as usePrevious5, useUpdateEffect as useUpdateEffect10 } from "react-use";
|
|
4951
4951
|
import { debounce as debounce4 } from "@xfe-repo/web-utils/tools";
|
|
4952
4952
|
import classnames9 from "classnames";
|
|
4953
|
-
// src/EffectSeriesSelect/index.module.less
|
|
4954
|
-
var index_module_default13 = {
|
|
4955
|
-
input: "index_module_input5",
|
|
4956
|
-
hover: "index_module_hover",
|
|
4957
|
-
dropdown: "index_module_dropdown",
|
|
4958
|
-
img_opt: "index_module_img_opt",
|
|
4959
|
-
item: "index_module_item",
|
|
4960
|
-
icon_preview: "index_module_icon_preview",
|
|
4961
|
-
icon_eye: "index_module_icon_eye",
|
|
4962
|
-
item_img: "index_module_item_img",
|
|
4963
|
-
item_mask_img: "index_module_item_mask_img",
|
|
4964
|
-
item_label: "index_module_item_label",
|
|
4965
|
-
txt_opt: "index_module_txt_opt",
|
|
4966
|
-
active: "index_module_active2"
|
|
4967
|
-
};
|
|
4968
|
-
// src/EffectSeriesSelect/index.tsx
|
|
4969
|
-
import { Select as Select5 } from "antd";
|
|
4970
4953
|
// src/EffectSeriesSelect/useSeriesOptions.ts
|
|
4971
4954
|
import useSWRImmutable4 from "swr/immutable";
|
|
4972
4955
|
function useSeriesOptions(params) {
|
|
@@ -5015,6 +4998,21 @@ function useSeriesOptions(params) {
|
|
|
5015
4998
|
mutate: mutate
|
|
5016
4999
|
};
|
|
5017
5000
|
}
|
|
5001
|
+
// src/EffectSeriesSelect/index.module.less
|
|
5002
|
+
var index_module_default13 = {
|
|
5003
|
+
input: "index_module_input5",
|
|
5004
|
+
hover: "index_module_hover",
|
|
5005
|
+
dropdown: "index_module_dropdown",
|
|
5006
|
+
img_opt: "index_module_img_opt",
|
|
5007
|
+
item: "index_module_item",
|
|
5008
|
+
icon_preview: "index_module_icon_preview",
|
|
5009
|
+
icon_eye: "index_module_icon_eye",
|
|
5010
|
+
item_img: "index_module_item_img",
|
|
5011
|
+
item_mask_img: "index_module_item_mask_img",
|
|
5012
|
+
item_label: "index_module_item_label",
|
|
5013
|
+
txt_opt: "index_module_txt_opt",
|
|
5014
|
+
active: "index_module_active2"
|
|
5015
|
+
};
|
|
5018
5016
|
// src/EffectSeriesSelect/index.tsx
|
|
5019
5017
|
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
5020
5018
|
var EffectSeriesSelect = memo26(function(props) {
|
|
@@ -5023,13 +5021,11 @@ var EffectSeriesSelect = memo26(function(props) {
|
|
|
5023
5021
|
var _useState201 = _sliced_to_array(useState20([]), 2), options = _useState201[0], setOptions = _useState201[1];
|
|
5024
5022
|
var _useState202 = _sliced_to_array(useState20(controlValue || defaultValue), 2), value = _useState202[0], setValue = _useState202[1];
|
|
5025
5023
|
var _useState203 = _sliced_to_array(useState20(""), 2), searchValue = _useState203[0], setSearchValue = _useState203[1];
|
|
5026
|
-
var pageData =
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
};
|
|
5032
|
-
}, []);
|
|
5024
|
+
var pageData = useRef11({
|
|
5025
|
+
page: 1,
|
|
5026
|
+
pageSize: 12,
|
|
5027
|
+
hasMore: true
|
|
5028
|
+
});
|
|
5033
5029
|
var conditions = useMemo15(function() {
|
|
5034
5030
|
return {
|
|
5035
5031
|
categoryId: categoryId,
|
|
@@ -5039,29 +5035,30 @@ var EffectSeriesSelect = memo26(function(props) {
|
|
|
5039
5035
|
categoryId,
|
|
5040
5036
|
brandId
|
|
5041
5037
|
]);
|
|
5042
|
-
var searchFetch = useCallback19(function(params2) {
|
|
5043
|
-
var page = params2.page, searchValue2 = params2.searchValue, conditions2 = params2.conditions, value2 = params2.value;
|
|
5044
|
-
var pageSize = pageData.pageSize;
|
|
5045
|
-
var id = getNumberValue(value2);
|
|
5046
|
-
var serviceParams = _object_spread_props(_object_spread({}, conditions2), {
|
|
5047
|
-
id: id,
|
|
5048
|
-
seriesName: searchValue2,
|
|
5049
|
-
page: page,
|
|
5050
|
-
pageSize: pageSize
|
|
5051
|
-
});
|
|
5052
|
-
setParams(serviceParams);
|
|
5053
|
-
}, []);
|
|
5054
5038
|
var _useState204 = _sliced_to_array(useState20({
|
|
5055
5039
|
categoryId: categoryId,
|
|
5056
5040
|
brandId: brandId,
|
|
5057
|
-
/** 兼容props分类Id 异常传入 */ id: getNumberValue(value),
|
|
5041
|
+
/** 兼容 props 分类 Id 异常传入 */ id: getNumberValue(value),
|
|
5058
5042
|
seriesName: searchValue,
|
|
5059
|
-
page: pageData.page,
|
|
5060
|
-
pageSize: pageData.pageSize
|
|
5043
|
+
page: pageData.current.page,
|
|
5044
|
+
pageSize: pageData.current.pageSize
|
|
5061
5045
|
}), 2), params = _useState204[0], setParams = _useState204[1];
|
|
5062
5046
|
var state = useSeriesOptions(params);
|
|
5063
5047
|
var prevControlValue = usePrevious5(controlValue);
|
|
5064
|
-
var
|
|
5048
|
+
var searchFetch = useCallback19(function(fetchParams) {
|
|
5049
|
+
var page = fetchParams.page, searchValue2 = fetchParams.searchValue, conditions2 = fetchParams.conditions, value2 = fetchParams.value;
|
|
5050
|
+
var pageSize = pageData.current.pageSize;
|
|
5051
|
+
var id = getNumberValue(value2);
|
|
5052
|
+
setParams(_object_spread_props(_object_spread({}, conditions2), {
|
|
5053
|
+
id: id,
|
|
5054
|
+
seriesName: searchValue2,
|
|
5055
|
+
page: page,
|
|
5056
|
+
pageSize: pageSize
|
|
5057
|
+
}));
|
|
5058
|
+
}, []);
|
|
5059
|
+
var debounceSearchFetch = useMemo15(function() {
|
|
5060
|
+
return debounce4(300, searchFetch);
|
|
5061
|
+
}, [
|
|
5065
5062
|
searchFetch
|
|
5066
5063
|
]);
|
|
5067
5064
|
useEffect17(function() {
|
|
@@ -5077,9 +5074,12 @@ var EffectSeriesSelect = memo26(function(props) {
|
|
|
5077
5074
|
brandId: brandId
|
|
5078
5075
|
};
|
|
5079
5076
|
});
|
|
5080
|
-
|
|
5081
|
-
pageData.page
|
|
5082
|
-
pageData.hasMore = pageData.pageSize * pageData.page < state.data.total && newOptions.length > 0;
|
|
5077
|
+
var isFirstPage = state.data.page === 1;
|
|
5078
|
+
pageData.current.page = state.data.page;
|
|
5079
|
+
pageData.current.hasMore = pageData.current.pageSize * pageData.current.page < state.data.total && newOptions.length > 0;
|
|
5080
|
+
setOptions(function(prev) {
|
|
5081
|
+
return isFirstPage ? newOptions : _to_consumable_array(prev).concat(_to_consumable_array(newOptions));
|
|
5082
|
+
});
|
|
5083
5083
|
}, [
|
|
5084
5084
|
state.data
|
|
5085
5085
|
]);
|
|
@@ -5116,8 +5116,8 @@ var EffectSeriesSelect = memo26(function(props) {
|
|
|
5116
5116
|
searchValue,
|
|
5117
5117
|
conditions
|
|
5118
5118
|
]);
|
|
5119
|
-
var handleOnSearch = useCallback19(function(
|
|
5120
|
-
return setSearchValue(
|
|
5119
|
+
var handleOnSearch = useCallback19(function(text) {
|
|
5120
|
+
return setSearchValue(text);
|
|
5121
5121
|
}, []);
|
|
5122
5122
|
var handleOnClear = useCallback19(function() {
|
|
5123
5123
|
return setSearchValue("");
|
|
@@ -5130,7 +5130,7 @@ var EffectSeriesSelect = memo26(function(props) {
|
|
|
5130
5130
|
return [
|
|
5131
5131
|
4,
|
|
5132
5132
|
searchFetch({
|
|
5133
|
-
page: pageData.page + 1,
|
|
5133
|
+
page: pageData.current.page + 1,
|
|
5134
5134
|
value: value,
|
|
5135
5135
|
searchValue: searchValue,
|
|
5136
5136
|
conditions: conditions
|
|
@@ -5149,11 +5149,11 @@ var EffectSeriesSelect = memo26(function(props) {
|
|
|
5149
5149
|
searchValue,
|
|
5150
5150
|
conditions
|
|
5151
5151
|
]);
|
|
5152
|
-
var handleOnChange = useCallback19(function(
|
|
5152
|
+
var handleOnChange = useCallback19(function(newValue, option) {
|
|
5153
5153
|
var label = (option || {}).label;
|
|
5154
|
-
|
|
5155
|
-
setValue(
|
|
5156
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(
|
|
5154
|
+
var numValue = getNumberValue(newValue);
|
|
5155
|
+
setValue(numValue);
|
|
5156
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(numValue, label);
|
|
5157
5157
|
setOpenDropDown(false);
|
|
5158
5158
|
}, [
|
|
5159
5159
|
onChange
|
|
@@ -5163,27 +5163,25 @@ var EffectSeriesSelect = memo26(function(props) {
|
|
|
5163
5163
|
if (options.length) return "\u6CA1\u6709\u66F4\u591A\u4E86~";
|
|
5164
5164
|
return "\u6682\u65E0\u6570\u636E";
|
|
5165
5165
|
}, [
|
|
5166
|
-
state,
|
|
5167
|
-
options
|
|
5168
|
-
brandId
|
|
5166
|
+
state.isLoading,
|
|
5167
|
+
options.length
|
|
5169
5168
|
]);
|
|
5170
|
-
var
|
|
5169
|
+
var popupRender = useCallback19(function(_menu) {
|
|
5171
5170
|
return /* @__PURE__ */ jsx36(SelectDropdown, {
|
|
5172
5171
|
value: value,
|
|
5173
5172
|
options: options,
|
|
5174
5173
|
onLoadMore: handleOnLoadMore,
|
|
5175
|
-
hasMore: pageData.hasMore,
|
|
5174
|
+
hasMore: pageData.current.hasMore,
|
|
5176
5175
|
noMoreText: noMoreText,
|
|
5177
5176
|
onChange: handleOnChange
|
|
5178
5177
|
});
|
|
5179
5178
|
}, [
|
|
5180
5179
|
value,
|
|
5181
5180
|
options,
|
|
5182
|
-
state,
|
|
5183
5181
|
noMoreText,
|
|
5184
5182
|
handleOnChange
|
|
5185
5183
|
]);
|
|
5186
|
-
var
|
|
5184
|
+
var selectProps = {
|
|
5187
5185
|
popupMatchSelectWidth: false,
|
|
5188
5186
|
placeholder: "\u8BF7\u8F93\u5165\u7CFB\u5217\u540D\u79F0",
|
|
5189
5187
|
optionFilterProp: "label",
|
|
@@ -5200,15 +5198,15 @@ var EffectSeriesSelect = memo26(function(props) {
|
|
|
5200
5198
|
onSearch: handleOnSearch,
|
|
5201
5199
|
onClear: handleOnClear,
|
|
5202
5200
|
open: openDropDown,
|
|
5203
|
-
|
|
5204
|
-
|
|
5201
|
+
popupRender: popupRender,
|
|
5202
|
+
onOpenChange: setOpenDropDown,
|
|
5205
5203
|
getPopupContainer: function getPopupContainer() {
|
|
5206
5204
|
return document.body;
|
|
5207
5205
|
}
|
|
5208
5206
|
};
|
|
5209
5207
|
return /* @__PURE__ */ jsx36(Select5, _object_spread({
|
|
5210
5208
|
className: classnames9(index_module_default13.input, className)
|
|
5211
|
-
},
|
|
5209
|
+
}, selectProps));
|
|
5212
5210
|
});
|
|
5213
5211
|
// src/EffectSpuSelect/index.tsx
|
|
5214
5212
|
import { memo as memo27, useCallback as useCallback20, useEffect as useEffect18, useMemo as useMemo16, useState as useState21 } from "react";
|
|
@@ -5433,7 +5431,7 @@ var EffectSpuSelect = memo27(function(props) {
|
|
|
5433
5431
|
state,
|
|
5434
5432
|
options
|
|
5435
5433
|
]);
|
|
5436
|
-
var
|
|
5434
|
+
var popupRender = useCallback20(function(_menu) {
|
|
5437
5435
|
return /* @__PURE__ */ jsx37(SelectDropdown, {
|
|
5438
5436
|
value: value,
|
|
5439
5437
|
options: options,
|
|
@@ -5465,8 +5463,8 @@ var EffectSpuSelect = memo27(function(props) {
|
|
|
5465
5463
|
onSearch: handleOnSearch,
|
|
5466
5464
|
onClear: handleOnClear,
|
|
5467
5465
|
open: openDropDown,
|
|
5468
|
-
|
|
5469
|
-
|
|
5466
|
+
popupRender: popupRender,
|
|
5467
|
+
onOpenChange: setOpenDropDown,
|
|
5470
5468
|
getPopupContainer: function getPopupContainer() {
|
|
5471
5469
|
return document.body;
|
|
5472
5470
|
}
|
|
@@ -5749,7 +5747,7 @@ var EffectSkuTable = memo28(function(props) {
|
|
|
5749
5747
|
}));
|
|
5750
5748
|
});
|
|
5751
5749
|
// src/EffectWithFilePanel/index.tsx
|
|
5752
|
-
import { memo as memo29, useRef as
|
|
5750
|
+
import { memo as memo29, useRef as useRef12, useState as useState23 } from "react";
|
|
5753
5751
|
// src/EffectWithFilePanel/index.module.less
|
|
5754
5752
|
var index_module_default15 = {
|
|
5755
5753
|
accept: "index_module_accept"
|
|
@@ -5762,7 +5760,7 @@ var EffectWithFilePanel = memo29(function(props) {
|
|
|
5762
5760
|
var _useState23 = _sliced_to_array(useState23(false), 2), uploadLoading = _useState23[0], setUploadLoading = _useState23[1];
|
|
5763
5761
|
var _useState231 = _sliced_to_array(useState23(disabled ? "\u786E\u5B9A" : "\u4FDD\u5B58"), 2), submitText = _useState231[0], setSubmitText = _useState231[1];
|
|
5764
5762
|
var drawerTitle = title || (disabled ? "\u67E5\u770B\u9644\u4EF6" : "\u4E0A\u4F20\u9644\u4EF6");
|
|
5765
|
-
var uploadRef =
|
|
5763
|
+
var uploadRef = useRef12(null);
|
|
5766
5764
|
var handleCLose = function handleCLose() {
|
|
5767
5765
|
if (!uploadLoading) return true;
|
|
5768
5766
|
return new Promise(function(resolve) {
|
|
@@ -6252,10 +6250,78 @@ var EffectMerchantSelect = memo31(function(props) {
|
|
|
6252
6250
|
});
|
|
6253
6251
|
});
|
|
6254
6252
|
// src/EffectScopeSelect/index.tsx
|
|
6255
|
-
import { memo as
|
|
6256
|
-
import { Flex as Flex3, Space as
|
|
6253
|
+
import { memo as memo33, useCallback as useCallback23, useMemo as useMemo18, useState as useState26 } from "react";
|
|
6254
|
+
import { Flex as Flex3, Space as Space4 } from "antd";
|
|
6257
6255
|
import { useUpdateEffect as useUpdateEffect14 } from "react-use";
|
|
6256
|
+
// src/EffectScopeSelect/ScopeViewMode.tsx
|
|
6257
|
+
import { memo as memo32 } from "react";
|
|
6258
|
+
import { Space as Space3, Typography as Typography6 } from "antd";
|
|
6258
6259
|
import { jsx as jsx42, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
6260
|
+
var ScopeViewMode = memo32(function(props) {
|
|
6261
|
+
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;
|
|
6262
|
+
var items = [];
|
|
6263
|
+
if ((categoryName === null || categoryName === void 0 ? void 0 : categoryName.length) || (categoryIds === null || categoryIds === void 0 ? void 0 : categoryIds.length)) items.push({
|
|
6264
|
+
label: "\u5206\u7C7B",
|
|
6265
|
+
value: (categoryName === null || categoryName === void 0 ? void 0 : categoryName.join("/")) || (categoryIds === null || categoryIds === void 0 ? void 0 : categoryIds.join(","))
|
|
6266
|
+
});
|
|
6267
|
+
if (brandName || brandId) items.push({
|
|
6268
|
+
label: "\u54C1\u724C",
|
|
6269
|
+
value: brandName || String(brandId)
|
|
6270
|
+
});
|
|
6271
|
+
if (seriesName || seriesId) items.push({
|
|
6272
|
+
label: "\u7CFB\u5217",
|
|
6273
|
+
value: seriesName || String(seriesId)
|
|
6274
|
+
});
|
|
6275
|
+
if (spuName || spuId) items.push({
|
|
6276
|
+
label: "SPU",
|
|
6277
|
+
value: spuName || String(spuId)
|
|
6278
|
+
});
|
|
6279
|
+
if (skuName || skuId) items.push({
|
|
6280
|
+
label: "SKU",
|
|
6281
|
+
value: skuName || String(skuId)
|
|
6282
|
+
});
|
|
6283
|
+
if (items.length === 0) return /* @__PURE__ */ jsx42(Typography6.Text, {
|
|
6284
|
+
style: {
|
|
6285
|
+
fontSize: 14
|
|
6286
|
+
},
|
|
6287
|
+
type: "danger",
|
|
6288
|
+
children: "\u8BF7\u5148\u9009\u62E9\u54C1\u7C7B\u4FE1\u606F"
|
|
6289
|
+
});
|
|
6290
|
+
return /* @__PURE__ */ jsx42(Space3, {
|
|
6291
|
+
size: 4,
|
|
6292
|
+
children: items.map(function(param) {
|
|
6293
|
+
var label = param.label, value = param.value;
|
|
6294
|
+
return /* @__PURE__ */ jsxs19(Space3, {
|
|
6295
|
+
size: 4,
|
|
6296
|
+
style: {
|
|
6297
|
+
height: 32,
|
|
6298
|
+
padding: "0 36px 0 14px",
|
|
6299
|
+
borderRadius: 6
|
|
6300
|
+
},
|
|
6301
|
+
children: [
|
|
6302
|
+
/* @__PURE__ */ jsxs19(Typography6.Text, {
|
|
6303
|
+
style: {
|
|
6304
|
+
fontSize: 14,
|
|
6305
|
+
paddingRight: 16
|
|
6306
|
+
},
|
|
6307
|
+
children: [
|
|
6308
|
+
label,
|
|
6309
|
+
":"
|
|
6310
|
+
]
|
|
6311
|
+
}),
|
|
6312
|
+
/* @__PURE__ */ jsx42(Typography6.Text, {
|
|
6313
|
+
style: {
|
|
6314
|
+
fontSize: 14
|
|
6315
|
+
},
|
|
6316
|
+
children: value
|
|
6317
|
+
})
|
|
6318
|
+
]
|
|
6319
|
+
}, label);
|
|
6320
|
+
})
|
|
6321
|
+
});
|
|
6322
|
+
});
|
|
6323
|
+
// src/EffectScopeSelect/index.tsx
|
|
6324
|
+
import { jsx as jsx43, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
6259
6325
|
var ScopeLevelEnum = /* @__PURE__ */ function(ScopeLevelEnum2) {
|
|
6260
6326
|
ScopeLevelEnum2[ScopeLevelEnum2["CATEGORY"] = 1] = "CATEGORY";
|
|
6261
6327
|
ScopeLevelEnum2[ScopeLevelEnum2["BRAND"] = 2] = "BRAND";
|
|
@@ -6264,8 +6330,8 @@ var ScopeLevelEnum = /* @__PURE__ */ function(ScopeLevelEnum2) {
|
|
|
6264
6330
|
ScopeLevelEnum2[ScopeLevelEnum2["SKU"] = 5] = "SKU";
|
|
6265
6331
|
return ScopeLevelEnum2;
|
|
6266
6332
|
}(ScopeLevelEnum || {});
|
|
6267
|
-
var EffectScopeSelect =
|
|
6268
|
-
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;
|
|
6333
|
+
var EffectScopeSelect = memo33(function(props) {
|
|
6334
|
+
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;
|
|
6269
6335
|
var _useState26 = _sliced_to_array(useState26(_object_spread({}, controlledValue, defaultValue)), 2), value = _useState26[0], setValue = _useState26[1];
|
|
6270
6336
|
var lastLevelCategoryId = useMemo18(function() {
|
|
6271
6337
|
var _value_categoryIds;
|
|
@@ -6371,17 +6437,17 @@ var EffectScopeSelect = memo32(function(props) {
|
|
|
6371
6437
|
requireLevel
|
|
6372
6438
|
]);
|
|
6373
6439
|
var renderLabel = useCallback23(function(label, required) {
|
|
6374
|
-
return /* @__PURE__ */
|
|
6440
|
+
return /* @__PURE__ */ jsx43(Flex3, {
|
|
6375
6441
|
flex: "0 0 auto",
|
|
6376
|
-
children: /* @__PURE__ */
|
|
6442
|
+
children: /* @__PURE__ */ jsxs20(Space4, {
|
|
6377
6443
|
children: [
|
|
6378
|
-
required && /* @__PURE__ */
|
|
6444
|
+
required && /* @__PURE__ */ jsx43("span", {
|
|
6379
6445
|
style: {
|
|
6380
6446
|
color: "var(--ant-color-error)"
|
|
6381
6447
|
},
|
|
6382
6448
|
children: "*"
|
|
6383
6449
|
}),
|
|
6384
|
-
/* @__PURE__ */
|
|
6450
|
+
/* @__PURE__ */ jsxs20("span", {
|
|
6385
6451
|
children: [
|
|
6386
6452
|
label,
|
|
6387
6453
|
":"
|
|
@@ -6391,32 +6457,35 @@ var EffectScopeSelect = memo32(function(props) {
|
|
|
6391
6457
|
})
|
|
6392
6458
|
});
|
|
6393
6459
|
}, []);
|
|
6394
|
-
|
|
6460
|
+
if (mode === "view") {
|
|
6461
|
+
return /* @__PURE__ */ jsx43(ScopeViewMode, _object_spread({}, value));
|
|
6462
|
+
}
|
|
6463
|
+
return /* @__PURE__ */ jsxs20(Flex3, {
|
|
6395
6464
|
justify: "flex-start",
|
|
6396
6465
|
align: "center",
|
|
6397
6466
|
wrap: "nowrap",
|
|
6398
6467
|
gap: "15px",
|
|
6399
6468
|
children: [
|
|
6400
|
-
/* @__PURE__ */
|
|
6469
|
+
/* @__PURE__ */ jsxs20(Flex3, {
|
|
6401
6470
|
align: "center",
|
|
6402
6471
|
gap: "5px",
|
|
6403
6472
|
flex: "0 0 auto",
|
|
6404
6473
|
children: [
|
|
6405
6474
|
renderLabel("\u5206\u7C7B", requireLevel >= 1 /* CATEGORY */ ),
|
|
6406
|
-
/* @__PURE__ */
|
|
6475
|
+
/* @__PURE__ */ jsx43(EffectCategoryCascade, {
|
|
6407
6476
|
onChange: handleCategoryChange,
|
|
6408
6477
|
changeOnSelect: categoryChangeOnSelect,
|
|
6409
6478
|
value: value.categoryIds
|
|
6410
6479
|
})
|
|
6411
6480
|
]
|
|
6412
6481
|
}),
|
|
6413
|
-
lastLevelCategoryId && scopeLevel >= 2 /* BRAND */ && /* @__PURE__ */
|
|
6482
|
+
lastLevelCategoryId && scopeLevel >= 2 /* BRAND */ && /* @__PURE__ */ jsxs20(Flex3, {
|
|
6414
6483
|
align: "center",
|
|
6415
6484
|
gap: "5px",
|
|
6416
6485
|
flex: "0 0 auto",
|
|
6417
6486
|
children: [
|
|
6418
6487
|
renderLabel("\u54C1\u724C", requireLevel >= 2 /* BRAND */ ),
|
|
6419
|
-
/* @__PURE__ */
|
|
6488
|
+
/* @__PURE__ */ jsx43(EffectBrandSelect, _object_spread_props(_object_spread({
|
|
6420
6489
|
categoryId: lastLevelCategoryId
|
|
6421
6490
|
}, value), {
|
|
6422
6491
|
onChange: handleBrandChange,
|
|
@@ -6424,13 +6493,13 @@ var EffectScopeSelect = memo32(function(props) {
|
|
|
6424
6493
|
}))
|
|
6425
6494
|
]
|
|
6426
6495
|
}),
|
|
6427
|
-
!!value.brandId && scopeLevel >= 3 /* SERIES */ && /* @__PURE__ */
|
|
6496
|
+
!!value.brandId && scopeLevel >= 3 /* SERIES */ && /* @__PURE__ */ jsxs20(Flex3, {
|
|
6428
6497
|
align: "center",
|
|
6429
6498
|
gap: "5px",
|
|
6430
6499
|
flex: "0 0 auto",
|
|
6431
6500
|
children: [
|
|
6432
6501
|
renderLabel("\u7CFB\u5217", requireLevel >= 3 /* SERIES */ ),
|
|
6433
|
-
/* @__PURE__ */
|
|
6502
|
+
/* @__PURE__ */ jsx43(EffectSeriesSelect, _object_spread_props(_object_spread({
|
|
6434
6503
|
categoryId: lastLevelCategoryId
|
|
6435
6504
|
}, value), {
|
|
6436
6505
|
onChange: handleSeriesChange,
|
|
@@ -6438,13 +6507,13 @@ var EffectScopeSelect = memo32(function(props) {
|
|
|
6438
6507
|
}))
|
|
6439
6508
|
]
|
|
6440
6509
|
}),
|
|
6441
|
-
!!value.seriesId && scopeLevel >= 4 /* SPU */ && /* @__PURE__ */
|
|
6510
|
+
!!value.seriesId && scopeLevel >= 4 /* SPU */ && /* @__PURE__ */ jsxs20(Flex3, {
|
|
6442
6511
|
align: "center",
|
|
6443
6512
|
gap: "5px",
|
|
6444
6513
|
flex: "0 0 auto",
|
|
6445
6514
|
children: [
|
|
6446
6515
|
renderLabel("SPU", requireLevel >= 4 /* SPU */ ),
|
|
6447
|
-
/* @__PURE__ */
|
|
6516
|
+
/* @__PURE__ */ jsx43(EffectSpuSelect, _object_spread_props(_object_spread({
|
|
6448
6517
|
categoryId: lastLevelCategoryId
|
|
6449
6518
|
}, value), {
|
|
6450
6519
|
onChange: handleSpuChange,
|
|
@@ -6452,13 +6521,13 @@ var EffectScopeSelect = memo32(function(props) {
|
|
|
6452
6521
|
}))
|
|
6453
6522
|
]
|
|
6454
6523
|
}),
|
|
6455
|
-
!!value.spuId && scopeLevel >= 5 /* SKU */ && /* @__PURE__ */
|
|
6524
|
+
!!value.spuId && scopeLevel >= 5 /* SKU */ && /* @__PURE__ */ jsxs20(Flex3, {
|
|
6456
6525
|
align: "center",
|
|
6457
6526
|
gap: "5px",
|
|
6458
6527
|
flex: "0 0 auto",
|
|
6459
6528
|
children: [
|
|
6460
6529
|
renderLabel("SKU", requireLevel >= 5 /* SKU */ ),
|
|
6461
|
-
/* @__PURE__ */
|
|
6530
|
+
/* @__PURE__ */ jsx43(EffectSkuSelect, _object_spread_props(_object_spread({
|
|
6462
6531
|
categoryId: lastLevelCategoryId
|
|
6463
6532
|
}, value), {
|
|
6464
6533
|
onChange: handleSkuChange,
|
|
@@ -6470,7 +6539,7 @@ var EffectScopeSelect = memo32(function(props) {
|
|
|
6470
6539
|
});
|
|
6471
6540
|
});
|
|
6472
6541
|
// src/EffectStaffSelect/index.tsx
|
|
6473
|
-
import { memo as
|
|
6542
|
+
import { memo as memo34, useCallback as useCallback24, useEffect as useEffect22, useState as useState27 } from "react";
|
|
6474
6543
|
import { useAsyncFn as useAsyncFn4, useMount as useMount5, useUpdateEffect as useUpdateEffect15 } from "react-use";
|
|
6475
6544
|
import classnames12 from "classnames";
|
|
6476
6545
|
import { Select as Select8 } from "antd";
|
|
@@ -6480,8 +6549,8 @@ var index_module_default18 = {
|
|
|
6480
6549
|
select: "index_module_select4"
|
|
6481
6550
|
};
|
|
6482
6551
|
// src/EffectStaffSelect/index.tsx
|
|
6483
|
-
import { jsx as
|
|
6484
|
-
var EffectStaffSelect =
|
|
6552
|
+
import { jsx as jsx44 } from "react/jsx-runtime";
|
|
6553
|
+
var EffectStaffSelect = memo34(function(props) {
|
|
6485
6554
|
var _state_value_data, _state_value;
|
|
6486
6555
|
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;
|
|
6487
6556
|
var _useState27 = _sliced_to_array(useState27([]), 2), options = _useState27[0], setOptions = _useState27[1];
|
|
@@ -6577,7 +6646,7 @@ var EffectStaffSelect = memo33(function(props) {
|
|
|
6577
6646
|
}
|
|
6578
6647
|
};
|
|
6579
6648
|
var defaultPlaceholder = deptId ? "\u8BF7\u9009\u62E9\u5458\u5DE5\u59D3\u540D" : "\u8BF7\u5148\u8F93\u5165\u5458\u5DE5\u59D3\u540D";
|
|
6580
|
-
return /* @__PURE__ */
|
|
6649
|
+
return /* @__PURE__ */ jsx44(Select8, {
|
|
6581
6650
|
className: classnames12(index_module_default18.select, className),
|
|
6582
6651
|
style: style,
|
|
6583
6652
|
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,
|
|
@@ -6596,11 +6665,11 @@ var EffectStaffSelect = memo33(function(props) {
|
|
|
6596
6665
|
});
|
|
6597
6666
|
});
|
|
6598
6667
|
// src/EffectReservoirSelect/EffectReservoirSelect.tsx
|
|
6599
|
-
import { memo as
|
|
6668
|
+
import { memo as memo35, useEffect as useEffect23, useState as useState28 } from "react";
|
|
6600
6669
|
import { useAsyncFn as useAsyncFn5, useMount as useMount6, usePrevious as usePrevious7, useUpdateEffect as useUpdateEffect16 } from "react-use";
|
|
6601
6670
|
import { Select as Select9 } from "antd";
|
|
6602
|
-
import { jsx as
|
|
6603
|
-
var EffectReservoirSelect =
|
|
6671
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
6672
|
+
var EffectReservoirSelect = memo35(function(props) {
|
|
6604
6673
|
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;
|
|
6605
6674
|
var _useState28 = _sliced_to_array(useState28([]), 2), options = _useState28[0], setOptions = _useState28[1];
|
|
6606
6675
|
var _useState281 = _sliced_to_array(useState28(controlValue || defaultValue), 2), value = _useState281[0], setValue = _useState281[1];
|
|
@@ -6687,16 +6756,16 @@ var EffectReservoirSelect = memo34(function(props) {
|
|
|
6687
6756
|
onChange: handleOnChange,
|
|
6688
6757
|
loading: state.loading
|
|
6689
6758
|
};
|
|
6690
|
-
return /* @__PURE__ */
|
|
6759
|
+
return /* @__PURE__ */ jsx45(Select9, _object_spread({
|
|
6691
6760
|
className: className
|
|
6692
6761
|
}, selectBrandProps));
|
|
6693
6762
|
});
|
|
6694
6763
|
// src/EffectReservoirSelect/EffectShelveSelect.tsx
|
|
6695
|
-
import { memo as
|
|
6764
|
+
import { memo as memo36, useEffect as useEffect24, useState as useState29 } from "react";
|
|
6696
6765
|
import { useAsyncFn as useAsyncFn6, useMount as useMount7, usePrevious as usePrevious8, useUpdateEffect as useUpdateEffect17 } from "react-use";
|
|
6697
6766
|
import { Select as Select10 } from "antd";
|
|
6698
|
-
import { jsx as
|
|
6699
|
-
var EffectShelveSelect =
|
|
6767
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
6768
|
+
var EffectShelveSelect = memo36(function(props) {
|
|
6700
6769
|
var onChange = props.onChange, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, disabled = props.disabled, warehouseId = props.warehouseId, reservoirId = props.reservoirId;
|
|
6701
6770
|
var _props_valueType = props.valueType, valueType = _props_valueType === void 0 ? "code" : _props_valueType;
|
|
6702
6771
|
var _useState29 = _sliced_to_array(useState29([]), 2), options = _useState29[0], setOptions = _useState29[1];
|
|
@@ -6787,14 +6856,14 @@ var EffectShelveSelect = memo35(function(props) {
|
|
|
6787
6856
|
onChange: handleOnChange,
|
|
6788
6857
|
loading: state.loading
|
|
6789
6858
|
};
|
|
6790
|
-
return /* @__PURE__ */
|
|
6859
|
+
return /* @__PURE__ */ jsx46(Select10, _object_spread({
|
|
6791
6860
|
className: className
|
|
6792
6861
|
}, selectBrandProps));
|
|
6793
6862
|
});
|
|
6794
6863
|
// src/EffectWarehouseSelect/index.tsx
|
|
6795
6864
|
import { Select as Select11 } from "antd";
|
|
6796
6865
|
import classnames13 from "classnames";
|
|
6797
|
-
import { memo as
|
|
6866
|
+
import { memo as memo37 } from "react";
|
|
6798
6867
|
// src/EffectWarehouseSelect/useStoreOptions.ts
|
|
6799
6868
|
import useSWRImmutable7 from "swr/immutable";
|
|
6800
6869
|
var transformStoreData = function transformStoreData() {
|
|
@@ -6857,8 +6926,8 @@ var index_module_default19 = {
|
|
|
6857
6926
|
select: "index_module_select5"
|
|
6858
6927
|
};
|
|
6859
6928
|
// src/EffectWarehouseSelect/index.tsx
|
|
6860
|
-
import { jsx as
|
|
6861
|
-
var EffectWarehouseSelect =
|
|
6929
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
6930
|
+
var EffectWarehouseSelect = memo37(function(props) {
|
|
6862
6931
|
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;
|
|
6863
6932
|
var state = useStoreOptions(currentMerchantOnly, warehouseType);
|
|
6864
6933
|
var handleChange = function handleChange(selectedValue, option) {
|
|
@@ -6868,7 +6937,7 @@ var EffectWarehouseSelect = memo36(function(props) {
|
|
|
6868
6937
|
var handleClear = function handleClear() {
|
|
6869
6938
|
onChange === null || onChange === void 0 ? void 0 : onChange(void 0, void 0);
|
|
6870
6939
|
};
|
|
6871
|
-
return /* @__PURE__ */
|
|
6940
|
+
return /* @__PURE__ */ jsx47(Select11, {
|
|
6872
6941
|
className: classnames13(index_module_default19.select, className),
|
|
6873
6942
|
placeholder: "\u8BF7\u9009\u62E9\u4ED3\u5E93",
|
|
6874
6943
|
notFoundContent: state.isLoading ? "\u52A0\u8F7D\u4E2D..." : "\u6682\u65E0\u4ED3\u5E93\u6570\u636E",
|
|
@@ -6881,7 +6950,7 @@ var EffectWarehouseSelect = memo36(function(props) {
|
|
|
6881
6950
|
});
|
|
6882
6951
|
});
|
|
6883
6952
|
// src/EffectAddressCascade/index.tsx
|
|
6884
|
-
import { memo as
|
|
6953
|
+
import { memo as memo38, useEffect as useEffect25, useState as useState30 } from "react";
|
|
6885
6954
|
import { useAsyncFn as useAsyncFn7, useMount as useMount8 } from "react-use";
|
|
6886
6955
|
import classnames14 from "classnames";
|
|
6887
6956
|
// src/EffectAddressCascade/index.module.less
|
|
@@ -6891,8 +6960,8 @@ var index_module_default20 = {
|
|
|
6891
6960
|
};
|
|
6892
6961
|
// src/EffectAddressCascade/index.tsx
|
|
6893
6962
|
import { Cascader as Cascader2 } from "antd";
|
|
6894
|
-
import { jsx as
|
|
6895
|
-
var EffectAddressCascade =
|
|
6963
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
6964
|
+
var EffectAddressCascade = memo38(function(props) {
|
|
6896
6965
|
var _selectedList_;
|
|
6897
6966
|
var className = props.className, disabled = props.disabled, defaultValue = props.defaultValue, onChange = props.onChange;
|
|
6898
6967
|
var _useState30 = _sliced_to_array(useState30(), 2), selectedList = _useState30[0], setSelectedList = _useState30[1];
|
|
@@ -6988,7 +7057,7 @@ var EffectAddressCascade = memo37(function(props) {
|
|
|
6988
7057
|
setSelectedList(_selectedList);
|
|
6989
7058
|
if (onChange) onChange(_selectedList);
|
|
6990
7059
|
};
|
|
6991
|
-
return /* @__PURE__ */
|
|
7060
|
+
return /* @__PURE__ */ jsx48(Cascader2, {
|
|
6992
7061
|
className: classnames14(index_module_default20.input, className),
|
|
6993
7062
|
disabled: disabled,
|
|
6994
7063
|
defaultValue: defaultValue,
|
|
@@ -7023,7 +7092,7 @@ var transformSelectedList = function transformSelectedList(selectedOptions) {
|
|
|
7023
7092
|
});
|
|
7024
7093
|
};
|
|
7025
7094
|
// src/EffectLabelSelect/index.tsx
|
|
7026
|
-
import { memo as
|
|
7095
|
+
import { memo as memo39, useEffect as useEffect26, useState as useState31 } from "react";
|
|
7027
7096
|
import { useUpdateEffect as useUpdateEffect18 } from "react-use";
|
|
7028
7097
|
import classnames15 from "classnames";
|
|
7029
7098
|
// src/EffectLabelSelect/hooks.ts
|
|
@@ -7072,9 +7141,9 @@ var index_module_default21 = {
|
|
|
7072
7141
|
select: "index_module_select7"
|
|
7073
7142
|
};
|
|
7074
7143
|
// src/EffectLabelSelect/index.tsx
|
|
7075
|
-
import { Select as Select12, Space as
|
|
7076
|
-
import { jsx as
|
|
7077
|
-
var EffectLabelSelect =
|
|
7144
|
+
import { Select as Select12, Space as Space5 } from "antd";
|
|
7145
|
+
import { jsx as jsx49, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
7146
|
+
var EffectLabelSelect = memo39(function(props) {
|
|
7078
7147
|
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;
|
|
7079
7148
|
var apiService = useRequestConfig().apiService;
|
|
7080
7149
|
var _useState31 = _sliced_to_array(useState31(function() {
|
|
@@ -7163,12 +7232,12 @@ var EffectLabelSelect = memo38(function(props) {
|
|
|
7163
7232
|
filterOption: false,
|
|
7164
7233
|
popupMatchSelectWidth: false
|
|
7165
7234
|
};
|
|
7166
|
-
return /* @__PURE__ */
|
|
7235
|
+
return /* @__PURE__ */ jsxs21(Space5.Compact, {
|
|
7167
7236
|
className: index_module_default21.select_wrap,
|
|
7168
7237
|
style: style,
|
|
7169
7238
|
children: [
|
|
7170
|
-
/* @__PURE__ */
|
|
7171
|
-
/* @__PURE__ */
|
|
7239
|
+
/* @__PURE__ */ jsx49(Select12, _object_spread({}, selectLabelProps)),
|
|
7240
|
+
/* @__PURE__ */ jsx49(Select12, _object_spread({}, selectValueProps))
|
|
7172
7241
|
]
|
|
7173
7242
|
});
|
|
7174
7243
|
});
|