@xfe-repo/web-components 1.8.0 → 1.8.1

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.js CHANGED
@@ -472,6 +472,9 @@ __export(index_exports, {
472
472
  EffectScopeSelect: function EffectScopeSelect1() {
473
473
  return EffectScopeSelect;
474
474
  },
475
+ EffectSearchSelect: function EffectSearchSelect1() {
476
+ return EffectSearchSelect;
477
+ },
475
478
  EffectSeriesSelect: function EffectSeriesSelect1() {
476
479
  return EffectSeriesSelect;
477
480
  },
@@ -580,6 +583,9 @@ __export(index_exports, {
580
583
  commonYesOrNoSelectOptionsMap: function commonYesOrNoSelectOptionsMap1() {
581
584
  return commonYesOrNoSelectOptionsMap;
582
585
  },
586
+ defaultMerchantSearchSources: function defaultMerchantSearchSources1() {
587
+ return defaultMerchantSearchSources;
588
+ },
583
589
  formatClock: function formatClock1() {
584
590
  return formatClock;
585
591
  },
@@ -3358,6 +3364,7 @@ var index_module_default6 = {
3358
3364
  text: "index_module_text",
3359
3365
  button: "index_module_button",
3360
3366
  remote: "index_module_remote",
3367
+ paste_tip: "index_module_paste_tip",
3361
3368
  upload_mask: "index_module_upload_mask"
3362
3369
  };
3363
3370
  // src/FileUpload/index.tsx
@@ -4128,16 +4135,19 @@ var FileUpload = function FileUpload(props) {
4128
4135
  var renderPicCardUploadButton = (0, import_react34.useCallback)(function() {
4129
4136
  if (max && fileList.length >= max) return null;
4130
4137
  if (children) return children;
4131
- if (disabled) return null;
4132
4138
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", {
4133
4139
  className: index_module_default6.upload_btn,
4134
4140
  children: [
4141
+ pastable && !disabled && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", {
4142
+ className: index_module_default6.paste_tip,
4143
+ children: "\u53EF\u7C98\u8D34\u4E0A\u4F20"
4144
+ }),
4135
4145
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_icons9.PlusOutlined, {}),
4136
4146
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", {
4137
4147
  className: index_module_default6.text,
4138
4148
  children: "\u4E0A\u4F20"
4139
4149
  }),
4140
- remote && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(RemoteUpload, {
4150
+ remote && !disabled && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(RemoteUpload, {
4141
4151
  max: max,
4142
4152
  onAddFile: setBufferAddFile
4143
4153
  })
@@ -6385,13 +6395,13 @@ function useMerchantOptions(params) {
6385
6395
  params
6386
6396
  ], function() {
6387
6397
  return _async_to_generator(function() {
6388
- var _res_data, _ref, enabled, _ref_labelDisplayMode, labelDisplayMode, otherParams, res, options;
6398
+ var _res_data, _ref, enabled, source, searchParams, res, options;
6389
6399
  return _ts_generator(this, function(_state) {
6390
6400
  switch(_state.label){
6391
6401
  case 0:
6392
- _ref = params || {}, enabled = _ref.enabled, _ref_labelDisplayMode = _ref.labelDisplayMode, labelDisplayMode = _ref_labelDisplayMode === void 0 ? "platformName" : _ref_labelDisplayMode, otherParams = _object_without_properties(_ref, [
6402
+ _ref = params || {}, enabled = _ref.enabled, source = _ref.source, searchParams = _object_without_properties(_ref, [
6393
6403
  "enabled",
6394
- "labelDisplayMode"
6404
+ "source"
6395
6405
  ]);
6396
6406
  if (enabled === false) return [
6397
6407
  2,
@@ -6402,7 +6412,7 @@ function useMerchantOptions(params) {
6402
6412
  apiService.merchantList(_object_spread({
6403
6413
  page: 1,
6404
6414
  pageSize: 20
6405
- }, otherParams), config)
6415
+ }, searchParams), config)
6406
6416
  ];
6407
6417
  case 1:
6408
6418
  res = _state.sent();
@@ -6410,9 +6420,12 @@ function useMerchantOptions(params) {
6410
6420
  throw new Error((res === null || res === void 0 ? void 0 : res.msg) || "\u63A5\u53E3\u8BF7\u6C42\u9519\u8BEF~");
6411
6421
  }
6412
6422
  options = (_res_data = res.data) === null || _res_data === void 0 ? void 0 : _res_data.list.map(function(item) {
6413
- var label = labelDisplayMode === "platformName-enterpriseNo" ? "".concat(item.platformName, " - ").concat(item.enterpriseNo) : item.platformName;
6414
6423
  return {
6415
- label: label,
6424
+ label: [
6425
+ item.enterpriseNo,
6426
+ item.platformName,
6427
+ item.name
6428
+ ].filter(Boolean).join(" - "),
6416
6429
  value: item.enterpriseNo,
6417
6430
  originalName: item.platformName,
6418
6431
  data: item
@@ -6447,15 +6460,34 @@ var index_module_default17 = {
6447
6460
  // src/EffectMerchantSelect/index.tsx
6448
6461
  var import_antd32 = require("antd");
6449
6462
  var import_jsx_runtime41 = require("react/jsx-runtime");
6463
+ var defaultMerchantSearchSources = [
6464
+ {
6465
+ label: "\u5546\u6237\u53F7",
6466
+ value: "enterpriseNo"
6467
+ },
6468
+ {
6469
+ label: "\u5E73\u53F0\u540D",
6470
+ value: "platformName"
6471
+ },
6472
+ {
6473
+ label: "\u5546\u6237\u540D",
6474
+ value: "name"
6475
+ },
6476
+ {
6477
+ label: "\u6CE8\u518C\u624B\u673A\u53F7",
6478
+ value: "phone"
6479
+ }
6480
+ ];
6450
6481
  var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
6451
- 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;
6452
- var _ref = _sliced_to_array((0, import_react45.useState)(), 2), searchValue = _ref[0], setSearchValue = _ref[1];
6453
- var _ref1 = _sliced_to_array((0, import_react45.useState)(controlValue), 2), value = _ref1[0], setValue = _ref1[1];
6454
- var _ref2 = _sliced_to_array((0, import_react45.useState)(), 2), name = _ref2[0], setName = _ref2[1];
6455
- var _ref3 = _sliced_to_array((0, import_react45.useState)(source), 2), sourceControl = _ref3[0], setSourceControl = _ref3[1];
6456
- var _ref4 = _sliced_to_array((0, import_react45.useState)(), 2), params = _ref4[0], setParams = _ref4[1];
6482
+ var _ref;
6483
+ var onChange = props.onChange, className = props.className, controlValue = props.value, disabled = props.disabled, _props_source = props.source, source = _props_source === void 0 ? "enterpriseNo" : _props_source;
6484
+ var _ref1 = _sliced_to_array((0, import_react45.useState)(), 2), searchValue = _ref1[0], setSearchValue = _ref1[1];
6485
+ var _ref2 = _sliced_to_array((0, import_react45.useState)(controlValue), 2), value = _ref2[0], setValue = _ref2[1];
6486
+ var _ref3 = _sliced_to_array((0, import_react45.useState)(), 2), name = _ref3[0], setName = _ref3[1];
6487
+ var _ref4 = _sliced_to_array((0, import_react45.useState)(source), 2), sourceControl = _ref4[0], setSourceControl = _ref4[1];
6488
+ var _ref5 = _sliced_to_array((0, import_react45.useState)(), 2), params = _ref5[0], setParams = _ref5[1];
6457
6489
  var state = useMerchantOptions(params);
6458
- var _ref5 = _sliced_to_array((0, import_react45.useState)(state.data || []), 2), options = _ref5[0], setOptions = _ref5[1];
6490
+ var _ref6 = _sliced_to_array((0, import_react45.useState)(state.data || []), 2), options = _ref6[0], setOptions = _ref6[1];
6459
6491
  (0, import_react_use15.useUpdateEffect)(function() {
6460
6492
  if (!state.data) return;
6461
6493
  setOptions(state.data);
@@ -6465,12 +6497,11 @@ var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
6465
6497
  (0, import_react45.useEffect)(function() {
6466
6498
  if (controlValue !== value) setValue(controlValue);
6467
6499
  if (controlValue) setParams({
6468
- businessNo: controlValue,
6469
- labelDisplayMode: labelDisplayMode
6500
+ enterpriseNo: controlValue,
6501
+ source: sourceControl
6470
6502
  });
6471
6503
  }, [
6472
- controlValue,
6473
- labelDisplayMode
6504
+ controlValue
6474
6505
  ]);
6475
6506
  (0, import_react_use15.useUpdateEffect)(function() {
6476
6507
  var changeValue = (value !== null && value !== void 0 ? value : "") === "" ? void 0 : String(value);
@@ -6484,24 +6515,23 @@ var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
6484
6515
  setName(option === null || option === void 0 ? void 0 : option.originalName);
6485
6516
  };
6486
6517
  var handleOnSearch = function handleOnSearch(searchValue2) {
6518
+ setSearchValue(searchValue2);
6487
6519
  var _obj;
6488
- if (searchValue2) setParams((_obj = {}, _define_property(_obj, sourceControl, searchValue2), _define_property(_obj, "labelDisplayMode", labelDisplayMode), _obj));
6520
+ if (searchValue2) setParams((_obj = {}, _define_property(_obj, sourceControl, searchValue2), _define_property(_obj, "source", sourceControl), _obj));
6489
6521
  };
6490
6522
  var handleOnSearchDebounce = (0, import_react45.useCallback)((0, import_tools10.debounce)(800, handleOnSearch), [
6491
- sourceControl,
6492
- labelDisplayMode
6523
+ sourceControl
6493
6524
  ]);
6494
6525
  var handleOnClear = function handleOnClear() {
6495
6526
  setSearchValue(void 0);
6496
6527
  setOptions([]);
6497
6528
  };
6498
- var sourceLabel = {
6499
- businessNo: "\u5546\u6237\u53F7",
6500
- platformName: "\u5546\u6237\u5E73\u53F0\u540D",
6501
- phone: "\u4E3B\u8D26\u53F7\u624B\u673A\u53F7"
6502
- };
6503
- var notFoundContent = state.isLoading ? "\u641C\u7D22\u4E2D" : searchValue ? "输入的".concat(sourceLabel[sourceControl], "未查询到商户信息") : "请输入".concat(sourceLabel[sourceControl]);
6504
- var handleAddonChange = function handleAddonChange(value2, _option) {
6529
+ var currentSource = defaultMerchantSearchSources.find(function(s) {
6530
+ return s.value === sourceControl;
6531
+ });
6532
+ var currentSourceLabel = (_ref = currentSource === null || currentSource === void 0 ? void 0 : currentSource.label) !== null && _ref !== void 0 ? _ref : "";
6533
+ var notFoundContent = state.isLoading ? "\u641C\u7D22\u4E2D" : searchValue ? "输入的".concat(currentSourceLabel, "未查询到商户信息") : "请输入".concat(currentSourceLabel);
6534
+ var handleAddonChange = function handleAddonChange(value2) {
6505
6535
  setSourceControl(value2);
6506
6536
  setValue(void 0);
6507
6537
  setSearchValue(void 0);
@@ -6519,13 +6549,7 @@ var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
6519
6549
  popupMatchSelectWidth: false,
6520
6550
  disabled: disabled,
6521
6551
  defaultValue: sourceControl,
6522
- options: Object.entries(sourceLabel).map(function(param) {
6523
- var _param = _sliced_to_array(param, 2), value2 = _param[0], label = _param[1];
6524
- return {
6525
- value: value2,
6526
- label: label
6527
- };
6528
- }),
6552
+ options: defaultMerchantSearchSources,
6529
6553
  onChange: handleAddonChange,
6530
6554
  style: {
6531
6555
  width: 140
@@ -6533,12 +6557,13 @@ var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
6533
6557
  };
6534
6558
  var selectBrandProps = {
6535
6559
  notFoundContent: notFoundContent,
6536
- placeholder: "请输入".concat(sourceLabel[sourceControl]),
6560
+ placeholder: "请输入".concat(currentSourceLabel),
6537
6561
  optionFilterProp: "label",
6538
6562
  showSearch: true,
6539
6563
  allowClear: true,
6540
6564
  defaultActiveFirstOption: false,
6541
6565
  filterOption: false,
6566
+ popupMatchSelectWidth: false,
6542
6567
  value: value,
6543
6568
  options: options,
6544
6569
  disabled: disabled,
@@ -6557,15 +6582,339 @@ var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
6557
6582
  ]
6558
6583
  });
6559
6584
  });
6560
- // src/EffectScopeSelect/index.tsx
6561
- var import_react47 = require("react");
6562
- var import_antd34 = require("antd");
6585
+ // src/EffectSearchSelect/index.tsx
6586
+ var import_react46 = __toESM(require("react"));
6563
6587
  var import_react_use16 = require("react-use");
6564
- // src/EffectScopeSelect/ScopeViewMode.tsx
6565
- var import_react46 = require("react");
6588
+ var import_classnames13 = __toESM(require("classnames"));
6566
6589
  var import_antd33 = require("antd");
6590
+ // src/EffectSearchSelect/index.module.less
6591
+ var index_module_default18 = {
6592
+ search_select_wrap: "index_module_search_select_wrap",
6593
+ source_select: "index_module_source_select",
6594
+ value_select: "index_module_value_select"
6595
+ };
6596
+ // src/EffectSearchSelect/useEffectSearchOptions.ts
6597
+ var import_immutable7 = __toESM(require("swr/immutable"));
6598
+ // src/EffectSearchSelect/utils.ts
6599
+ var DEFAULT_SEARCH_PAGE_SIZE = 20;
6600
+ var DEFAULT_SEARCH_MIN_LENGTH = 1;
6601
+ var DEFAULT_MERCHANT_SEARCH_CACHE_KEY = "merchant/list";
6602
+ var DEFAULT_MERCHANT_SOURCE_VALUE = "enterpriseNo";
6603
+ var defaultMerchantSearchSources2 = [
6604
+ {
6605
+ label: "\u5546\u6237\u53F7",
6606
+ value: "enterpriseNo"
6607
+ },
6608
+ {
6609
+ label: "\u5E73\u53F0\u540D",
6610
+ value: "platformName"
6611
+ },
6612
+ {
6613
+ label: "\u5546\u6237\u540D",
6614
+ value: "name"
6615
+ },
6616
+ {
6617
+ label: "\u4E3B\u624B\u673A\u53F7",
6618
+ value: "phone"
6619
+ }
6620
+ ];
6621
+ var defaultTransformMerchantOptions = function defaultTransformMerchantOptions(data, context) {
6622
+ return (data.list || []).map(function(item) {
6623
+ return {
6624
+ label: getMerchantSourceLabel(item, context.source.value),
6625
+ value: item.enterpriseNo,
6626
+ raw: item
6627
+ };
6628
+ });
6629
+ };
6630
+ var getMerchantSourceLabel = function getMerchantSourceLabel(item, sourceValue) {
6631
+ var sourceLabelMap = {
6632
+ enterpriseNo: item.enterpriseNo,
6633
+ platformName: item.platformName,
6634
+ name: item.name,
6635
+ // 目前接口没有手机号,先放空字符串,后续如果接口增加了手机号字段再修改这里
6636
+ phone: ""
6637
+ };
6638
+ return sourceLabelMap[sourceValue] || [
6639
+ item.enterpriseNo,
6640
+ item.platformName,
6641
+ item.name
6642
+ ].filter(Boolean).join(" - ");
6643
+ };
6644
+ var getDefaultSourceValue = function getDefaultSourceValue(sources, defaultSourceValue) {
6645
+ var _sources_;
6646
+ if (defaultSourceValue && sources.some(function(source) {
6647
+ return source.value === defaultSourceValue;
6648
+ })) {
6649
+ return defaultSourceValue;
6650
+ }
6651
+ return (_sources_ = sources[0]) === null || _sources_ === void 0 ? void 0 : _sources_.value;
6652
+ };
6653
+ var getCurrentSource = function getCurrentSource(sources, selectedSourceValue) {
6654
+ return sources.find(function(source) {
6655
+ return source.value === selectedSourceValue;
6656
+ }) || sources[0];
6657
+ };
6658
+ var buildDefaultSearchParams = function buildDefaultSearchParams(keyword, source, baseParams, pageSize) {
6659
+ return _object_spread_props(_object_spread({
6660
+ page: 1,
6661
+ pageSize: pageSize
6662
+ }, baseParams), _define_property({}, source.value, keyword));
6663
+ };
6664
+ var normalizeSelectValue = function normalizeSelectValue(value) {
6665
+ return value === null ? void 0 : value;
6666
+ };
6667
+ var normalizeSelectedOption = function normalizeSelectedOption(option) {
6668
+ var selectedOption = Array.isArray(option) ? option[0] : option;
6669
+ return selectedOption ? selectedOption : void 0;
6670
+ };
6671
+ var resolveMergedDefaultSourceValue = function resolveMergedDefaultSourceValue(sources, defaultSourceValue, hasCustomSources) {
6672
+ var _sources_;
6673
+ if (defaultSourceValue) return defaultSourceValue;
6674
+ return hasCustomSources ? (_sources_ = sources[0]) === null || _sources_ === void 0 ? void 0 : _sources_.value : DEFAULT_MERCHANT_SOURCE_VALUE;
6675
+ };
6676
+ var resolveNotFoundContent = function resolveNotFoundContent(params) {
6677
+ var error = params.error, isLoading = params.isLoading, keyword = params.keyword, sourceLabel = params.sourceLabel, defaultPlaceholder = params.defaultPlaceholder;
6678
+ if (error) return error.message || "\u67E5\u8BE2\u5931\u8D25";
6679
+ if (isLoading) return "\u641C\u7D22\u4E2D";
6680
+ if (keyword) return "输入的".concat(sourceLabel, "未查询到信息");
6681
+ return defaultPlaceholder;
6682
+ };
6683
+ // src/EffectSearchSelect/useEffectSearchOptions.ts
6684
+ function useEffectSearchOptions(params) {
6685
+ var config = useRequestConfig().config;
6686
+ var cacheKey = params.cacheKey, keyword = params.keyword, source = params.source, enabled = params.enabled, fetchParams = params.fetchParams, pageSize = params.pageSize, request = params.request, buildParams = params.buildParams, transformOptions = params.transformOptions;
6687
+ var swrKey = enabled && source ? [
6688
+ "EffectSearchSelect",
6689
+ cacheKey,
6690
+ source.value,
6691
+ keyword,
6692
+ fetchParams,
6693
+ pageSize
6694
+ ] : null;
6695
+ var _ref = (0, import_immutable7.default)(swrKey, function() {
6696
+ return _async_to_generator(function() {
6697
+ var requestParams, response;
6698
+ return _ts_generator(this, function(_state) {
6699
+ switch(_state.label){
6700
+ case 0:
6701
+ if (!source) return [
6702
+ 2,
6703
+ []
6704
+ ];
6705
+ requestParams = buildParams ? buildParams(keyword, source, fetchParams) : buildDefaultSearchParams(keyword, source, fetchParams, pageSize);
6706
+ return [
6707
+ 4,
6708
+ request(requestParams, config)
6709
+ ];
6710
+ case 1:
6711
+ response = _state.sent();
6712
+ if ((response === null || response === void 0 ? void 0 : response.code) !== 200) {
6713
+ throw new Error((response === null || response === void 0 ? void 0 : response.msg) || "\u63A5\u53E3\u8BF7\u6C42\u9519\u8BEF~");
6714
+ }
6715
+ return [
6716
+ 2,
6717
+ transformOptions(response.data, {
6718
+ source: source,
6719
+ keyword: keyword
6720
+ })
6721
+ ];
6722
+ }
6723
+ });
6724
+ })();
6725
+ }, {
6726
+ errorRetryCount: 0,
6727
+ shouldRetryOnError: false
6728
+ }), data = _ref.data, error = _ref.error, isLoading = _ref.isLoading, mutate = _ref.mutate;
6729
+ return {
6730
+ options: data || [],
6731
+ error: error,
6732
+ isLoading: isLoading,
6733
+ mutate: mutate
6734
+ };
6735
+ }
6736
+ // src/EffectSearchSelect/index.tsx
6567
6737
  var import_jsx_runtime42 = require("react/jsx-runtime");
6568
- var ScopeViewMode = (0, import_react46.memo)(function(props) {
6738
+ var EMPTY_FETCH_PARAMS = {};
6739
+ var EffectSearchSelectBase = function EffectSearchSelectBase(props) {
6740
+ var _ref;
6741
+ var className = props.className, style = props.style, value = props.value, defaultValue = props.defaultValue, disabled = props.disabled, placeholder = props.placeholder, notFoundContent = props.notFoundContent, sources = props.sources, defaultSourceValue = props.defaultSourceValue, _props_fetchParams = props.fetchParams, fetchParams = _props_fetchParams === void 0 ? EMPTY_FETCH_PARAMS : _props_fetchParams, _props_pageSize = props.pageSize, pageSize = _props_pageSize === void 0 ? DEFAULT_SEARCH_PAGE_SIZE : _props_pageSize, request = props.request, buildParams = props.buildParams, transformOptions = props.transformOptions, onChange = props.onChange, onClear = props.onClear, selectProps = _object_without_properties(props, [
6742
+ "className",
6743
+ "style",
6744
+ "value",
6745
+ "defaultValue",
6746
+ "disabled",
6747
+ "placeholder",
6748
+ "notFoundContent",
6749
+ "sources",
6750
+ "defaultSourceValue",
6751
+ "fetchParams",
6752
+ "pageSize",
6753
+ "request",
6754
+ "buildParams",
6755
+ "transformOptions",
6756
+ "onChange",
6757
+ "onClear"
6758
+ ]);
6759
+ var apiService = useRequestConfig().apiService;
6760
+ var valueControlledRef = (0, import_react46.useRef)(Object.prototype.hasOwnProperty.call(props, "value"));
6761
+ var valueControlled = valueControlledRef.current;
6762
+ var hasCustomSources = Boolean(sources === null || sources === void 0 ? void 0 : sources.length);
6763
+ var mergedSources = (0, import_react46.useMemo)(function() {
6764
+ return hasCustomSources ? sources : defaultMerchantSearchSources2;
6765
+ }, [
6766
+ hasCustomSources,
6767
+ sources
6768
+ ]);
6769
+ var mergedDefaultSourceValue = (0, import_react46.useMemo)(function() {
6770
+ return resolveMergedDefaultSourceValue(mergedSources, defaultSourceValue, hasCustomSources);
6771
+ }, [
6772
+ defaultSourceValue,
6773
+ hasCustomSources,
6774
+ mergedSources
6775
+ ]);
6776
+ var _ref1 = _sliced_to_array((0, import_react46.useState)(function() {
6777
+ return getDefaultSourceValue(mergedSources, mergedDefaultSourceValue);
6778
+ }), 2), innerSourceValue = _ref1[0], setInnerSourceValue = _ref1[1];
6779
+ var currentSource = getCurrentSource(mergedSources, innerSourceValue);
6780
+ var currentSourceValue = currentSource === null || currentSource === void 0 ? void 0 : currentSource.value;
6781
+ (0, import_react46.useEffect)(function() {
6782
+ var isCurrentSourceValid = mergedSources.some(function(source) {
6783
+ return source.value === innerSourceValue;
6784
+ });
6785
+ if (!isCurrentSourceValid) {
6786
+ setInnerSourceValue(getDefaultSourceValue(mergedSources, mergedDefaultSourceValue));
6787
+ }
6788
+ }, [
6789
+ innerSourceValue,
6790
+ mergedDefaultSourceValue,
6791
+ mergedSources
6792
+ ]);
6793
+ var _ref2 = _sliced_to_array((0, import_react46.useState)(function() {
6794
+ return normalizeSelectValue(value !== null && value !== void 0 ? value : defaultValue);
6795
+ }), 2), innerValue = _ref2[0], setInnerValue = _ref2[1];
6796
+ var mergedValue = valueControlled ? normalizeSelectValue(value) : innerValue;
6797
+ var _ref3 = _sliced_to_array((0, import_react46.useState)(""), 2), searchText = _ref3[0], setSearchText = _ref3[1];
6798
+ var _ref4 = _sliced_to_array((0, import_react46.useState)(""), 2), keyword = _ref4[0], setKeyword = _ref4[1];
6799
+ (0, import_react_use16.useDebounce)(function() {
6800
+ setKeyword(searchText.trim());
6801
+ }, 600, [
6802
+ searchText
6803
+ ]);
6804
+ var requestFn = request || apiService.merchantList;
6805
+ var transformOptionsFn = transformOptions || defaultTransformMerchantOptions;
6806
+ var searchEnabled = Boolean(currentSource && keyword.length >= DEFAULT_SEARCH_MIN_LENGTH);
6807
+ var searchCacheKey = request ? request.name || "custom" : DEFAULT_MERCHANT_SEARCH_CACHE_KEY;
6808
+ var _useEffectSearchOptions = useEffectSearchOptions({
6809
+ cacheKey: searchCacheKey,
6810
+ keyword: keyword,
6811
+ source: currentSource,
6812
+ enabled: searchEnabled,
6813
+ fetchParams: fetchParams,
6814
+ pageSize: pageSize,
6815
+ request: requestFn,
6816
+ buildParams: buildParams,
6817
+ transformOptions: transformOptionsFn
6818
+ }), options = _useEffectSearchOptions.options, isLoading = _useEffectSearchOptions.isLoading, error = _useEffectSearchOptions.error;
6819
+ var resetSearchAndValue = (0, import_react46.useCallback)(function() {
6820
+ setSearchText("");
6821
+ setKeyword("");
6822
+ if (!valueControlled) {
6823
+ setInnerValue(void 0);
6824
+ }
6825
+ }, [
6826
+ valueControlled
6827
+ ]);
6828
+ var handleSourceChange = (0, import_react46.useCallback)(function(nextSourceValue) {
6829
+ setInnerSourceValue(nextSourceValue);
6830
+ resetSearchAndValue();
6831
+ }, [
6832
+ resetSearchAndValue
6833
+ ]);
6834
+ var handleSearch = (0, import_react46.useCallback)(function(nextSearchText) {
6835
+ setSearchText(nextSearchText);
6836
+ }, []);
6837
+ var handleChange = (0, import_react46.useCallback)(function(nextValue, option) {
6838
+ var selectedOption = normalizeSelectedOption(option);
6839
+ var normalizedValue = normalizeSelectValue(nextValue);
6840
+ if (!valueControlled) {
6841
+ setInnerValue(normalizedValue);
6842
+ }
6843
+ onChange === null || onChange === void 0 ? void 0 : onChange(normalizedValue, selectedOption);
6844
+ }, [
6845
+ onChange,
6846
+ valueControlled
6847
+ ]);
6848
+ var handleClear = (0, import_react46.useCallback)(function() {
6849
+ resetSearchAndValue();
6850
+ onClear === null || onClear === void 0 ? void 0 : onClear();
6851
+ }, [
6852
+ onClear,
6853
+ resetSearchAndValue
6854
+ ]);
6855
+ var sourceOptions = (0, import_react46.useMemo)(function() {
6856
+ return mergedSources.map(function(param) {
6857
+ var label = param.label, val = param.value;
6858
+ return {
6859
+ label: label,
6860
+ value: val
6861
+ };
6862
+ });
6863
+ }, [
6864
+ mergedSources
6865
+ ]);
6866
+ var sourceLabel = (_ref = currentSource === null || currentSource === void 0 ? void 0 : currentSource.label) !== null && _ref !== void 0 ? _ref : "";
6867
+ var defaultPlaceholder = sourceLabel ? "请输入".concat(sourceLabel) : "\u8BF7\u8F93\u5165";
6868
+ var defaultNotFoundContent = resolveNotFoundContent({
6869
+ error: error,
6870
+ isLoading: isLoading,
6871
+ keyword: keyword,
6872
+ sourceLabel: sourceLabel,
6873
+ defaultPlaceholder: defaultPlaceholder
6874
+ });
6875
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_antd33.Space.Compact, {
6876
+ className: index_module_default18.search_select_wrap,
6877
+ style: style,
6878
+ children: [
6879
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd33.Select, {
6880
+ className: index_module_default18.source_select,
6881
+ disabled: disabled,
6882
+ value: currentSourceValue,
6883
+ options: sourceOptions,
6884
+ popupMatchSelectWidth: false,
6885
+ onChange: handleSourceChange
6886
+ }),
6887
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd33.Select, _object_spread_props(_object_spread({}, selectProps), {
6888
+ className: (0, import_classnames13.default)(index_module_default18.value_select, className),
6889
+ disabled: disabled,
6890
+ value: mergedValue,
6891
+ options: options,
6892
+ loading: isLoading,
6893
+ placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : defaultPlaceholder,
6894
+ notFoundContent: notFoundContent !== null && notFoundContent !== void 0 ? notFoundContent : defaultNotFoundContent,
6895
+ showSearch: true,
6896
+ allowClear: true,
6897
+ defaultActiveFirstOption: false,
6898
+ filterOption: false,
6899
+ popupMatchSelectWidth: false,
6900
+ optionFilterProp: "label",
6901
+ onSearch: handleSearch,
6902
+ onChange: handleChange,
6903
+ onClear: handleClear
6904
+ }))
6905
+ ]
6906
+ });
6907
+ };
6908
+ var EffectSearchSelect = import_react46.default.memo(EffectSearchSelectBase);
6909
+ // src/EffectScopeSelect/index.tsx
6910
+ var import_react48 = require("react");
6911
+ var import_antd35 = require("antd");
6912
+ var import_react_use17 = require("react-use");
6913
+ // src/EffectScopeSelect/ScopeViewMode.tsx
6914
+ var import_react47 = require("react");
6915
+ var import_antd34 = require("antd");
6916
+ var import_jsx_runtime43 = require("react/jsx-runtime");
6917
+ var ScopeViewMode = (0, import_react47.memo)(function(props) {
6569
6918
  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;
6570
6919
  var items = [];
6571
6920
  if ((categoryName === null || categoryName === void 0 ? void 0 : categoryName.length) || (categoryIds === null || categoryIds === void 0 ? void 0 : categoryIds.length)) items.push({
@@ -6588,18 +6937,18 @@ var ScopeViewMode = (0, import_react46.memo)(function(props) {
6588
6937
  label: "SKU",
6589
6938
  value: skuName || String(skuId)
6590
6939
  });
6591
- if (items.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd33.Typography.Text, {
6940
+ if (items.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_antd34.Typography.Text, {
6592
6941
  style: {
6593
6942
  fontSize: 14
6594
6943
  },
6595
6944
  type: "danger",
6596
6945
  children: "\u8BF7\u5148\u9009\u62E9\u54C1\u7C7B\u4FE1\u606F"
6597
6946
  });
6598
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd33.Space, {
6947
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_antd34.Space, {
6599
6948
  size: 4,
6600
6949
  children: items.map(function(param) {
6601
6950
  var label = param.label, value = param.value;
6602
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_antd33.Space, {
6951
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Space, {
6603
6952
  size: 4,
6604
6953
  style: {
6605
6954
  height: 32,
@@ -6607,7 +6956,7 @@ var ScopeViewMode = (0, import_react46.memo)(function(props) {
6607
6956
  borderRadius: 6
6608
6957
  },
6609
6958
  children: [
6610
- /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_antd33.Typography.Text, {
6959
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Typography.Text, {
6611
6960
  style: {
6612
6961
  fontSize: 14,
6613
6962
  paddingRight: 16
@@ -6617,7 +6966,7 @@ var ScopeViewMode = (0, import_react46.memo)(function(props) {
6617
6966
  ":"
6618
6967
  ]
6619
6968
  }),
6620
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd33.Typography.Text, {
6969
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_antd34.Typography.Text, {
6621
6970
  style: {
6622
6971
  fontSize: 14
6623
6972
  },
@@ -6629,7 +6978,7 @@ var ScopeViewMode = (0, import_react46.memo)(function(props) {
6629
6978
  });
6630
6979
  });
6631
6980
  // src/EffectScopeSelect/index.tsx
6632
- var import_jsx_runtime43 = require("react/jsx-runtime");
6981
+ var import_jsx_runtime44 = require("react/jsx-runtime");
6633
6982
  var ScopeLevelEnum = /* @__PURE__ */ function(ScopeLevelEnum2) {
6634
6983
  ScopeLevelEnum2[ScopeLevelEnum2["CATEGORY"] = 1] = "CATEGORY";
6635
6984
  ScopeLevelEnum2[ScopeLevelEnum2["BRAND"] = 2] = "BRAND";
@@ -6638,28 +6987,28 @@ var ScopeLevelEnum = /* @__PURE__ */ function(ScopeLevelEnum2) {
6638
6987
  ScopeLevelEnum2[ScopeLevelEnum2["SKU"] = 5] = "SKU";
6639
6988
  return ScopeLevelEnum2;
6640
6989
  }(ScopeLevelEnum || {});
6641
- var EffectScopeSelect = (0, import_react47.memo)(function(props) {
6990
+ var EffectScopeSelect = (0, import_react48.memo)(function(props) {
6642
6991
  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;
6643
- var _ref = _sliced_to_array((0, import_react47.useState)(_object_spread({}, controlledValue, defaultValue)), 2), value = _ref[0], setValue = _ref[1];
6644
- var lastLevelCategoryId = (0, import_react47.useMemo)(function() {
6992
+ var _ref = _sliced_to_array((0, import_react48.useState)(_object_spread({}, controlledValue, defaultValue)), 2), value = _ref[0], setValue = _ref[1];
6993
+ var lastLevelCategoryId = (0, import_react48.useMemo)(function() {
6645
6994
  var _value_categoryIds;
6646
6995
  return (_value_categoryIds = value.categoryIds) === null || _value_categoryIds === void 0 ? void 0 : _value_categoryIds[value.categoryIds.length - 1];
6647
6996
  }, [
6648
6997
  value.categoryIds
6649
6998
  ]);
6650
- (0, import_react_use16.useUpdateEffect)(function() {
6999
+ (0, import_react_use17.useUpdateEffect)(function() {
6651
7000
  setValue(_object_spread({}, controlledValue));
6652
7001
  }, [
6653
7002
  controlledValue
6654
7003
  ]);
6655
- var handleChange = (0, import_react47.useCallback)(function(newValue) {
7004
+ var handleChange = (0, import_react48.useCallback)(function(newValue) {
6656
7005
  setTimeout(function() {
6657
7006
  return onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
6658
7007
  }, 0);
6659
7008
  }, [
6660
7009
  onChange
6661
7010
  ]);
6662
- var handleCategoryChange = (0, import_react47.useCallback)(function(_values, selectedList) {
7011
+ var handleCategoryChange = (0, import_react48.useCallback)(function(_values, selectedList) {
6663
7012
  if (!selectedList || !isSingleTreeSelected(selectedList)) {
6664
7013
  handleChange === null || handleChange === void 0 ? void 0 : handleChange();
6665
7014
  return;
@@ -6678,7 +7027,7 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
6678
7027
  handleChange,
6679
7028
  requireLevel
6680
7029
  ]);
6681
- var handleBrandChange = (0, import_react47.useCallback)(function(brandValue) {
7030
+ var handleBrandChange = (0, import_react48.useCallback)(function(brandValue) {
6682
7031
  var brandId = brandValue === void 0 ? void 0 : Number(brandValue);
6683
7032
  setValue(function(prev) {
6684
7033
  var newScope = {
@@ -6694,7 +7043,7 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
6694
7043
  handleChange,
6695
7044
  requireLevel
6696
7045
  ]);
6697
- var handleSeriesChange = (0, import_react47.useCallback)(function(seriesValue) {
7046
+ var handleSeriesChange = (0, import_react48.useCallback)(function(seriesValue) {
6698
7047
  var seriesId = seriesValue === void 0 ? void 0 : Number(seriesValue);
6699
7048
  setValue(function(prev) {
6700
7049
  var newScope = {
@@ -6711,7 +7060,7 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
6711
7060
  handleChange,
6712
7061
  requireLevel
6713
7062
  ]);
6714
- var handleSpuChange = (0, import_react47.useCallback)(function(spuValue) {
7063
+ var handleSpuChange = (0, import_react48.useCallback)(function(spuValue) {
6715
7064
  var spuId = spuValue === void 0 ? void 0 : Number(spuValue);
6716
7065
  setValue(function(prev) {
6717
7066
  var newScope = {
@@ -6729,7 +7078,7 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
6729
7078
  handleChange,
6730
7079
  requireLevel
6731
7080
  ]);
6732
- var handleSkuChange = (0, import_react47.useCallback)(function(skuValue) {
7081
+ var handleSkuChange = (0, import_react48.useCallback)(function(skuValue) {
6733
7082
  var skuId = skuValue === void 0 ? void 0 : Number(skuValue);
6734
7083
  setValue(function(prev) {
6735
7084
  var newScope = _object_spread_props(_object_spread({}, prev), {
@@ -6744,18 +7093,18 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
6744
7093
  handleChange,
6745
7094
  requireLevel
6746
7095
  ]);
6747
- var renderLabel = (0, import_react47.useCallback)(function(label, required) {
6748
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_antd34.Flex, {
7096
+ var renderLabel = (0, import_react48.useCallback)(function(label, required) {
7097
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_antd35.Flex, {
6749
7098
  flex: "0 0 auto",
6750
- children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Space, {
7099
+ children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Space, {
6751
7100
  children: [
6752
- required && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", {
7101
+ required && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", {
6753
7102
  style: {
6754
7103
  color: "var(--ant-color-error)"
6755
7104
  },
6756
7105
  children: "*"
6757
7106
  }),
6758
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", {
7107
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", {
6759
7108
  children: [
6760
7109
  label,
6761
7110
  ":"
@@ -6766,34 +7115,34 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
6766
7115
  });
6767
7116
  }, []);
6768
7117
  if (mode === "view") {
6769
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ScopeViewMode, _object_spread({}, value));
7118
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ScopeViewMode, _object_spread({}, value));
6770
7119
  }
6771
- return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Flex, {
7120
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Flex, {
6772
7121
  justify: "flex-start",
6773
7122
  align: "center",
6774
7123
  wrap: "nowrap",
6775
7124
  gap: "15px",
6776
7125
  children: [
6777
- /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Flex, {
7126
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Flex, {
6778
7127
  align: "center",
6779
7128
  gap: "5px",
6780
7129
  flex: "0 0 auto",
6781
7130
  children: [
6782
7131
  renderLabel("\u5206\u7C7B", requireLevel >= 1 /* CATEGORY */ ),
6783
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectCategoryCascade, {
7132
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(EffectCategoryCascade, {
6784
7133
  onChange: handleCategoryChange,
6785
7134
  changeOnSelect: categoryChangeOnSelect,
6786
7135
  value: value.categoryIds
6787
7136
  })
6788
7137
  ]
6789
7138
  }),
6790
- lastLevelCategoryId && scopeLevel >= 2 /* BRAND */ && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Flex, {
7139
+ lastLevelCategoryId && scopeLevel >= 2 /* BRAND */ && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Flex, {
6791
7140
  align: "center",
6792
7141
  gap: "5px",
6793
7142
  flex: "0 0 auto",
6794
7143
  children: [
6795
7144
  renderLabel("\u54C1\u724C", requireLevel >= 2 /* BRAND */ ),
6796
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectBrandSelect, _object_spread_props(_object_spread({
7145
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(EffectBrandSelect, _object_spread_props(_object_spread({
6797
7146
  categoryId: lastLevelCategoryId
6798
7147
  }, value), {
6799
7148
  onChange: handleBrandChange,
@@ -6801,13 +7150,13 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
6801
7150
  }))
6802
7151
  ]
6803
7152
  }),
6804
- !!value.brandId && scopeLevel >= 3 /* SERIES */ && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Flex, {
7153
+ !!value.brandId && scopeLevel >= 3 /* SERIES */ && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Flex, {
6805
7154
  align: "center",
6806
7155
  gap: "5px",
6807
7156
  flex: "0 0 auto",
6808
7157
  children: [
6809
7158
  renderLabel("\u7CFB\u5217", requireLevel >= 3 /* SERIES */ ),
6810
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectSeriesSelect, _object_spread_props(_object_spread({
7159
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(EffectSeriesSelect, _object_spread_props(_object_spread({
6811
7160
  categoryId: lastLevelCategoryId
6812
7161
  }, value), {
6813
7162
  onChange: handleSeriesChange,
@@ -6815,13 +7164,13 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
6815
7164
  }))
6816
7165
  ]
6817
7166
  }),
6818
- !!value.seriesId && scopeLevel >= 4 /* SPU */ && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Flex, {
7167
+ !!value.seriesId && scopeLevel >= 4 /* SPU */ && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Flex, {
6819
7168
  align: "center",
6820
7169
  gap: "5px",
6821
7170
  flex: "0 0 auto",
6822
7171
  children: [
6823
7172
  renderLabel("SPU", requireLevel >= 4 /* SPU */ ),
6824
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectSpuSelect, _object_spread_props(_object_spread({
7173
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(EffectSpuSelect, _object_spread_props(_object_spread({
6825
7174
  categoryId: lastLevelCategoryId
6826
7175
  }, value), {
6827
7176
  onChange: handleSpuChange,
@@ -6829,13 +7178,13 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
6829
7178
  }))
6830
7179
  ]
6831
7180
  }),
6832
- !!value.spuId && scopeLevel >= 5 /* SKU */ && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Flex, {
7181
+ !!value.spuId && scopeLevel >= 5 /* SKU */ && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Flex, {
6833
7182
  align: "center",
6834
7183
  gap: "5px",
6835
7184
  flex: "0 0 auto",
6836
7185
  children: [
6837
7186
  renderLabel("SKU", requireLevel >= 5 /* SKU */ ),
6838
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(EffectSkuSelect, _object_spread_props(_object_spread({
7187
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(EffectSkuSelect, _object_spread_props(_object_spread({
6839
7188
  categoryId: lastLevelCategoryId
6840
7189
  }, value), {
6841
7190
  onChange: handleSkuChange,
@@ -6847,22 +7196,22 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
6847
7196
  });
6848
7197
  });
6849
7198
  // src/EffectStaffSelect/index.tsx
6850
- var import_react48 = require("react");
6851
- var import_react_use17 = require("react-use");
6852
- var import_classnames13 = __toESM(require("classnames"));
6853
- var import_antd35 = require("antd");
7199
+ var import_react49 = require("react");
7200
+ var import_react_use18 = require("react-use");
7201
+ var import_classnames14 = __toESM(require("classnames"));
7202
+ var import_antd36 = require("antd");
6854
7203
  var import_tools11 = require("@xfe-repo/web-utils/tools");
6855
7204
  // src/EffectStaffSelect/index.module.less
6856
- var index_module_default18 = {
7205
+ var index_module_default19 = {
6857
7206
  select: "index_module_select4"
6858
7207
  };
6859
7208
  // src/EffectStaffSelect/index.tsx
6860
- var import_jsx_runtime44 = require("react/jsx-runtime");
6861
- var EffectStaffSelect = (0, import_react48.memo)(function(props) {
7209
+ var import_jsx_runtime45 = require("react/jsx-runtime");
7210
+ var EffectStaffSelect = (0, import_react49.memo)(function(props) {
6862
7211
  var _state_value_data, _state_value;
6863
7212
  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;
6864
- var _ref = _sliced_to_array((0, import_react48.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
6865
- var _ref1 = _sliced_to_array((0, import_react48.useState)(controlValue !== null && controlValue !== void 0 ? controlValue : defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
7213
+ var _ref = _sliced_to_array((0, import_react49.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
7214
+ var _ref1 = _sliced_to_array((0, import_react49.useState)(controlValue !== null && controlValue !== void 0 ? controlValue : defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
6866
7215
  var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
6867
7216
  var getBusinessOptions = function getBusinessOptions(businessName, currentDeptId) {
6868
7217
  return _async_to_generator(function() {
@@ -6892,14 +7241,14 @@ var EffectStaffSelect = (0, import_react48.memo)(function(props) {
6892
7241
  });
6893
7242
  })();
6894
7243
  };
6895
- var _ref2 = _sliced_to_array((0, import_react_use17.useAsyncFn)(getBusinessOptions, [
7244
+ var _ref2 = _sliced_to_array((0, import_react_use18.useAsyncFn)(getBusinessOptions, [
6896
7245
  deptId,
6897
7246
  config
6898
7247
  ]), 2), state = _ref2[0], searchFetch = _ref2[1];
6899
- var debounceSearchFetch = (0, import_react48.useCallback)((0, import_tools11.debounce)(600, searchFetch), [
7248
+ var debounceSearchFetch = (0, import_react49.useCallback)((0, import_tools11.debounce)(600, searchFetch), [
6900
7249
  searchFetch
6901
7250
  ]);
6902
- (0, import_react48.useEffect)(function() {
7251
+ (0, import_react49.useEffect)(function() {
6903
7252
  var _state_value_data, _state_value;
6904
7253
  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)) {
6905
7254
  return;
@@ -6915,12 +7264,12 @@ var EffectStaffSelect = (0, import_react48.memo)(function(props) {
6915
7264
  }, [
6916
7265
  state
6917
7266
  ]);
6918
- (0, import_react_use17.useMount)(function() {
7267
+ (0, import_react_use18.useMount)(function() {
6919
7268
  if (deptId) {
6920
7269
  void searchFetch("", deptId);
6921
7270
  }
6922
7271
  });
6923
- (0, import_react_use17.useUpdateEffect)(function() {
7272
+ (0, import_react_use18.useUpdateEffect)(function() {
6924
7273
  setValue(controlValue);
6925
7274
  if (!controlValue && deptId) {
6926
7275
  void searchFetch("", deptId);
@@ -6929,7 +7278,7 @@ var EffectStaffSelect = (0, import_react48.memo)(function(props) {
6929
7278
  controlValue,
6930
7279
  deptId
6931
7280
  ]);
6932
- (0, import_react_use17.useUpdateEffect)(function() {
7281
+ (0, import_react_use18.useUpdateEffect)(function() {
6933
7282
  setOptions([]);
6934
7283
  if (deptId) {
6935
7284
  void searchFetch("", deptId);
@@ -6954,8 +7303,8 @@ var EffectStaffSelect = (0, import_react48.memo)(function(props) {
6954
7303
  }
6955
7304
  };
6956
7305
  var defaultPlaceholder = deptId ? "\u8BF7\u9009\u62E9\u5458\u5DE5\u59D3\u540D" : "\u8BF7\u5148\u8F93\u5165\u5458\u5DE5\u59D3\u540D";
6957
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_antd35.Select, {
6958
- className: (0, import_classnames13.default)(index_module_default18.select, className),
7306
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_antd36.Select, {
7307
+ className: (0, import_classnames14.default)(index_module_default19.select, className),
6959
7308
  style: style,
6960
7309
  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,
6961
7310
  placeholder: placeholder || defaultPlaceholder,
@@ -6973,15 +7322,15 @@ var EffectStaffSelect = (0, import_react48.memo)(function(props) {
6973
7322
  });
6974
7323
  });
6975
7324
  // src/EffectReservoirSelect/EffectReservoirSelect.tsx
6976
- var import_react49 = require("react");
6977
- var import_react_use18 = require("react-use");
6978
- var import_antd36 = require("antd");
6979
- var import_jsx_runtime45 = require("react/jsx-runtime");
6980
- var EffectReservoirSelect = (0, import_react49.memo)(function(props) {
7325
+ var import_react50 = require("react");
7326
+ var import_react_use19 = require("react-use");
7327
+ var import_antd37 = require("antd");
7328
+ var import_jsx_runtime46 = require("react/jsx-runtime");
7329
+ var EffectReservoirSelect = (0, import_react50.memo)(function(props) {
6981
7330
  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;
6982
- var _ref = _sliced_to_array((0, import_react49.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
6983
- var _ref1 = _sliced_to_array((0, import_react49.useState)(controlValue || defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
6984
- var prevControlValue = (0, import_react_use18.usePrevious)(controlValue);
7331
+ var _ref = _sliced_to_array((0, import_react50.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
7332
+ var _ref1 = _sliced_to_array((0, import_react50.useState)(controlValue || defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
7333
+ var prevControlValue = (0, import_react_use19.usePrevious)(controlValue);
6985
7334
  var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
6986
7335
  var get_reservoir_options = function get_reservoir_options() {
6987
7336
  return _async_to_generator(function() {
@@ -7010,10 +7359,10 @@ var EffectReservoirSelect = (0, import_react49.memo)(function(props) {
7010
7359
  });
7011
7360
  })();
7012
7361
  };
7013
- var _ref2 = _sliced_to_array((0, import_react_use18.useAsyncFn)(get_reservoir_options, [
7362
+ var _ref2 = _sliced_to_array((0, import_react_use19.useAsyncFn)(get_reservoir_options, [
7014
7363
  warehouseId
7015
7364
  ]), 2), state = _ref2[0], fetch = _ref2[1];
7016
- (0, import_react49.useEffect)(function() {
7365
+ (0, import_react50.useEffect)(function() {
7017
7366
  var _state_value;
7018
7367
  if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.data.list)) return;
7019
7368
  var options2 = state.value.data.list.map(function(param) {
@@ -7028,10 +7377,10 @@ var EffectReservoirSelect = (0, import_react49.memo)(function(props) {
7028
7377
  }, [
7029
7378
  state
7030
7379
  ]);
7031
- (0, import_react_use18.useMount)(function() {
7380
+ (0, import_react_use19.useMount)(function() {
7032
7381
  return void fetch();
7033
7382
  });
7034
- (0, import_react_use18.useUpdateEffect)(function() {
7383
+ (0, import_react_use19.useUpdateEffect)(function() {
7035
7384
  if (controlValue && controlValue === prevControlValue) {
7036
7385
  setValue(void 0);
7037
7386
  onChange === null || onChange === void 0 ? void 0 : onChange();
@@ -7040,7 +7389,7 @@ var EffectReservoirSelect = (0, import_react49.memo)(function(props) {
7040
7389
  }, [
7041
7390
  warehouseId
7042
7391
  ]);
7043
- (0, import_react_use18.useUpdateEffect)(function() {
7392
+ (0, import_react_use19.useUpdateEffect)(function() {
7044
7393
  if (value === controlValue) return;
7045
7394
  setValue(controlValue);
7046
7395
  }, [
@@ -7064,21 +7413,21 @@ var EffectReservoirSelect = (0, import_react49.memo)(function(props) {
7064
7413
  onChange: handleOnChange,
7065
7414
  loading: state.loading
7066
7415
  };
7067
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_antd36.Select, _object_spread({
7416
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_antd37.Select, _object_spread({
7068
7417
  className: className
7069
7418
  }, selectBrandProps));
7070
7419
  });
7071
7420
  // src/EffectReservoirSelect/EffectShelveSelect.tsx
7072
- var import_react50 = require("react");
7073
- var import_react_use19 = require("react-use");
7074
- var import_antd37 = require("antd");
7075
- var import_jsx_runtime46 = require("react/jsx-runtime");
7076
- var EffectShelveSelect = (0, import_react50.memo)(function(props) {
7421
+ var import_react51 = require("react");
7422
+ var import_react_use20 = require("react-use");
7423
+ var import_antd38 = require("antd");
7424
+ var import_jsx_runtime47 = require("react/jsx-runtime");
7425
+ var EffectShelveSelect = (0, import_react51.memo)(function(props) {
7077
7426
  var onChange = props.onChange, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, disabled = props.disabled, warehouseId = props.warehouseId, reservoirId = props.reservoirId;
7078
7427
  var _props_valueType = props.valueType, valueType = _props_valueType === void 0 ? "code" : _props_valueType;
7079
- var _ref = _sliced_to_array((0, import_react50.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
7080
- var _ref1 = _sliced_to_array((0, import_react50.useState)(controlValue || defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
7081
- var prevControlValue = (0, import_react_use19.usePrevious)(controlValue);
7428
+ var _ref = _sliced_to_array((0, import_react51.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
7429
+ var _ref1 = _sliced_to_array((0, import_react51.useState)(controlValue || defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
7430
+ var prevControlValue = (0, import_react_use20.usePrevious)(controlValue);
7082
7431
  var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
7083
7432
  var get_shelve_options = function get_shelve_options() {
7084
7433
  return _async_to_generator(function() {
@@ -7107,11 +7456,11 @@ var EffectShelveSelect = (0, import_react50.memo)(function(props) {
7107
7456
  });
7108
7457
  })();
7109
7458
  };
7110
- var _ref2 = _sliced_to_array((0, import_react_use19.useAsyncFn)(get_shelve_options, [
7459
+ var _ref2 = _sliced_to_array((0, import_react_use20.useAsyncFn)(get_shelve_options, [
7111
7460
  reservoirId,
7112
7461
  warehouseId
7113
7462
  ]), 2), state = _ref2[0], fetch = _ref2[1];
7114
- (0, import_react50.useEffect)(function() {
7463
+ (0, import_react51.useEffect)(function() {
7115
7464
  var _state_value;
7116
7465
  if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.data.list)) return;
7117
7466
  var options2 = state.value.data.list.map(function(param) {
@@ -7127,10 +7476,10 @@ var EffectShelveSelect = (0, import_react50.memo)(function(props) {
7127
7476
  }, [
7128
7477
  state
7129
7478
  ]);
7130
- (0, import_react_use19.useMount)(function() {
7479
+ (0, import_react_use20.useMount)(function() {
7131
7480
  return void fetch();
7132
7481
  });
7133
- (0, import_react_use19.useUpdateEffect)(function() {
7482
+ (0, import_react_use20.useUpdateEffect)(function() {
7134
7483
  if (controlValue && controlValue === prevControlValue) {
7135
7484
  setValue(void 0);
7136
7485
  onChange === null || onChange === void 0 ? void 0 : onChange();
@@ -7140,7 +7489,7 @@ var EffectShelveSelect = (0, import_react50.memo)(function(props) {
7140
7489
  reservoirId,
7141
7490
  warehouseId
7142
7491
  ]);
7143
- (0, import_react_use19.useUpdateEffect)(function() {
7492
+ (0, import_react_use20.useUpdateEffect)(function() {
7144
7493
  if (value === controlValue) return;
7145
7494
  setValue(controlValue);
7146
7495
  }, [
@@ -7164,16 +7513,16 @@ var EffectShelveSelect = (0, import_react50.memo)(function(props) {
7164
7513
  onChange: handleOnChange,
7165
7514
  loading: state.loading
7166
7515
  };
7167
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_antd37.Select, _object_spread({
7516
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_antd38.Select, _object_spread({
7168
7517
  className: className
7169
7518
  }, selectBrandProps));
7170
7519
  });
7171
7520
  // src/EffectWarehouseSelect/index.tsx
7172
- var import_antd38 = require("antd");
7173
- var import_classnames14 = __toESM(require("classnames"));
7174
- var import_react51 = require("react");
7521
+ var import_antd39 = require("antd");
7522
+ var import_classnames15 = __toESM(require("classnames"));
7523
+ var import_react52 = require("react");
7175
7524
  // src/EffectWarehouseSelect/useStoreOptions.ts
7176
- var import_immutable7 = __toESM(require("swr/immutable"));
7525
+ var import_immutable8 = __toESM(require("swr/immutable"));
7177
7526
  var transformStoreData = function transformStoreData() {
7178
7527
  var list = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
7179
7528
  return list.map(function(item) {
@@ -7186,7 +7535,7 @@ var transformStoreData = function transformStoreData() {
7186
7535
  function useStoreOptions() {
7187
7536
  var currentMerchantOnly = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, warehouseType = arguments.length > 1 ? arguments[1] : void 0;
7188
7537
  var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
7189
- var _ref = (0, import_immutable7.default)([
7538
+ var _ref = (0, import_immutable8.default)([
7190
7539
  "warehouse/store/combo-box",
7191
7540
  currentMerchantOnly,
7192
7541
  warehouseType
@@ -7230,12 +7579,12 @@ function useStoreOptions() {
7230
7579
  };
7231
7580
  }
7232
7581
  // src/EffectWarehouseSelect/index.module.less
7233
- var index_module_default19 = {
7582
+ var index_module_default20 = {
7234
7583
  select: "index_module_select5"
7235
7584
  };
7236
7585
  // src/EffectWarehouseSelect/index.tsx
7237
- var import_jsx_runtime47 = require("react/jsx-runtime");
7238
- var EffectWarehouseSelect = (0, import_react51.memo)(function(props) {
7586
+ var import_jsx_runtime48 = require("react/jsx-runtime");
7587
+ var EffectWarehouseSelect = (0, import_react52.memo)(function(props) {
7239
7588
  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;
7240
7589
  var state = useStoreOptions(currentMerchantOnly, warehouseType);
7241
7590
  var handleChange = function handleChange(selectedValue, option) {
@@ -7245,8 +7594,8 @@ var EffectWarehouseSelect = (0, import_react51.memo)(function(props) {
7245
7594
  var handleClear = function handleClear() {
7246
7595
  onChange === null || onChange === void 0 ? void 0 : onChange(void 0, void 0);
7247
7596
  };
7248
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_antd38.Select, {
7249
- className: (0, import_classnames14.default)(index_module_default19.select, className),
7597
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_antd39.Select, {
7598
+ className: (0, import_classnames15.default)(index_module_default20.select, className),
7250
7599
  placeholder: "\u8BF7\u9009\u62E9\u4ED3\u5E93",
7251
7600
  notFoundContent: state.isLoading ? "\u52A0\u8F7D\u4E2D..." : "\u6682\u65E0\u4ED3\u5E93\u6570\u636E",
7252
7601
  loading: state.isLoading,
@@ -7258,22 +7607,22 @@ var EffectWarehouseSelect = (0, import_react51.memo)(function(props) {
7258
7607
  });
7259
7608
  });
7260
7609
  // src/EffectAddressCascade/index.tsx
7261
- var import_react52 = require("react");
7262
- var import_react_use20 = require("react-use");
7263
- var import_classnames15 = __toESM(require("classnames"));
7610
+ var import_react53 = require("react");
7611
+ var import_react_use21 = require("react-use");
7612
+ var import_classnames16 = __toESM(require("classnames"));
7264
7613
  // src/EffectAddressCascade/index.module.less
7265
- var index_module_default20 = {
7614
+ var index_module_default21 = {
7266
7615
  input: "index_module_input7",
7267
7616
  select: "index_module_select6"
7268
7617
  };
7269
7618
  // src/EffectAddressCascade/index.tsx
7270
- var import_antd39 = require("antd");
7271
- var import_jsx_runtime48 = require("react/jsx-runtime");
7272
- var EffectAddressCascade = (0, import_react52.memo)(function(props) {
7619
+ var import_antd40 = require("antd");
7620
+ var import_jsx_runtime49 = require("react/jsx-runtime");
7621
+ var EffectAddressCascade = (0, import_react53.memo)(function(props) {
7273
7622
  var _selectedList_;
7274
7623
  var className = props.className, disabled = props.disabled, defaultValue = props.defaultValue, onChange = props.onChange;
7275
- var _ref = _sliced_to_array((0, import_react52.useState)(), 2), selectedList = _ref[0], setSelectedList = _ref[1];
7276
- var _ref1 = _sliced_to_array((0, import_react52.useState)(), 2), customTree = _ref1[0], setCustomTree = _ref1[1];
7624
+ var _ref = _sliced_to_array((0, import_react53.useState)(), 2), selectedList = _ref[0], setSelectedList = _ref[1];
7625
+ var _ref1 = _sliced_to_array((0, import_react53.useState)(), 2), customTree = _ref1[0], setCustomTree = _ref1[1];
7277
7626
  var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
7278
7627
  var params = {
7279
7628
  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) || ""
@@ -7296,10 +7645,10 @@ var EffectAddressCascade = (0, import_react52.memo)(function(props) {
7296
7645
  });
7297
7646
  })();
7298
7647
  };
7299
- var _ref2 = _sliced_to_array((0, import_react_use20.useAsyncFn)(getAddress, [
7648
+ var _ref2 = _sliced_to_array((0, import_react_use21.useAsyncFn)(getAddress, [
7300
7649
  selectedList
7301
7650
  ]), 2), state = _ref2[0], getAddressFetch = _ref2[1];
7302
- (0, import_react52.useEffect)(function() {
7651
+ (0, import_react53.useEffect)(function() {
7303
7652
  var _state_value;
7304
7653
  if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.data.list)) return;
7305
7654
  var list = state.value.data.list;
@@ -7337,7 +7686,7 @@ var EffectAddressCascade = (0, import_react52.memo)(function(props) {
7337
7686
  }, [
7338
7687
  state
7339
7688
  ]);
7340
- (0, import_react52.useEffect)(function() {
7689
+ (0, import_react53.useEffect)(function() {
7341
7690
  if (!state.loading || !customTree || !selectedList) return;
7342
7691
  var target = findTargetLeaf(selectedList, customTree);
7343
7692
  if (!target) return;
@@ -7346,10 +7695,10 @@ var EffectAddressCascade = (0, import_react52.memo)(function(props) {
7346
7695
  }, [
7347
7696
  state
7348
7697
  ]);
7349
- (0, import_react_use20.useMount)(function() {
7698
+ (0, import_react_use21.useMount)(function() {
7350
7699
  void getAddressFetch();
7351
7700
  });
7352
- (0, import_react52.useEffect)(function() {
7701
+ (0, import_react53.useEffect)(function() {
7353
7702
  var target = findTargetLeaf(selectedList || [], customTree || []);
7354
7703
  if ((target === null || target === void 0 ? void 0 : target.isLeaf) || !(selectedList === null || selectedList === void 0 ? void 0 : selectedList.length)) return;
7355
7704
  void getAddressFetch();
@@ -7365,8 +7714,8 @@ var EffectAddressCascade = (0, import_react52.memo)(function(props) {
7365
7714
  setSelectedList(_selectedList);
7366
7715
  if (onChange) onChange(_selectedList);
7367
7716
  };
7368
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_antd39.Cascader, {
7369
- className: (0, import_classnames15.default)(index_module_default20.input, className),
7717
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_antd40.Cascader, {
7718
+ className: (0, import_classnames16.default)(index_module_default21.input, className),
7370
7719
  disabled: disabled,
7371
7720
  defaultValue: defaultValue,
7372
7721
  multiple: false,
@@ -7400,11 +7749,11 @@ var transformSelectedList = function transformSelectedList(selectedOptions) {
7400
7749
  });
7401
7750
  };
7402
7751
  // src/EffectLabelSelect/index.tsx
7403
- var import_react53 = require("react");
7404
- var import_react_use22 = require("react-use");
7405
- var import_classnames16 = __toESM(require("classnames"));
7752
+ var import_react54 = require("react");
7753
+ var import_react_use23 = require("react-use");
7754
+ var import_classnames17 = __toESM(require("classnames"));
7406
7755
  // src/EffectLabelSelect/hooks.ts
7407
- var import_react_use21 = require("react-use");
7756
+ var import_react_use22 = require("react-use");
7408
7757
  var useReqData = function useReqData(fn, reqParams, dependency) {
7409
7758
  var _useRequestConfig = useRequestConfig(), reqConfig = _useRequestConfig.config;
7410
7759
  var reqDataFn = function reqDataFn() {
@@ -7425,10 +7774,10 @@ var useReqData = function useReqData(fn, reqParams, dependency) {
7425
7774
  });
7426
7775
  })();
7427
7776
  };
7428
- var _ref = _sliced_to_array((0, import_react_use21.useAsyncFn)(reqDataFn, [
7777
+ var _ref = _sliced_to_array((0, import_react_use22.useAsyncFn)(reqDataFn, [
7429
7778
  dependency
7430
7779
  ]), 2), resState = _ref[0], fetchData = _ref[1];
7431
- (0, import_react_use21.useDebounce)(function() {
7780
+ (0, import_react_use22.useDebounce)(function() {
7432
7781
  var shouldFetchData = Object.keys(JSON.parse(dependency || "{}")).length > 0;
7433
7782
  if (shouldFetchData) {
7434
7783
  void fetchData();
@@ -7442,43 +7791,44 @@ var useReqData = function useReqData(fn, reqParams, dependency) {
7442
7791
  ];
7443
7792
  };
7444
7793
  // src/EffectLabelSelect/index.module.less
7445
- var index_module_default21 = {
7794
+ var index_module_default22 = {
7446
7795
  select_wrap: "index_module_select_wrap",
7447
7796
  select_label: "index_module_select_label",
7448
- value_select: "index_module_value_select",
7797
+ value_select: "index_module_value_select2",
7449
7798
  select: "index_module_select7"
7450
7799
  };
7451
7800
  // src/EffectLabelSelect/index.tsx
7452
- var import_antd40 = require("antd");
7453
- var import_jsx_runtime49 = require("react/jsx-runtime");
7454
- var EffectLabelSelect = (0, import_react53.memo)(function(props) {
7801
+ var import_antd41 = require("antd");
7802
+ var import_jsx_runtime50 = require("react/jsx-runtime");
7803
+ var EffectLabelSelect = (0, import_react54.memo)(function(props) {
7455
7804
  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;
7456
7805
  var apiService = useRequestConfig().apiService;
7457
- var _ref = _sliced_to_array((0, import_react53.useState)(function() {
7806
+ var _ref = _sliced_to_array((0, import_react54.useState)(function() {
7458
7807
  var _transformObj2Options_, _transformObj2Options;
7459
7808
  var defaultLabelFromValue = customLabelInValue ? getSelectValue(value, "labelDicKey") : "";
7460
7809
  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;
7461
7810
  return defaultLabel || defaultLabelFromValue || defaultLabelFromLabelDic || "";
7462
7811
  }), 2), curSelectLabel = _ref[0], setCurSelectLabel = _ref[1];
7463
- var _ref1 = _sliced_to_array((0, import_react53.useState)(value !== null && value !== void 0 ? value : void 0), 2), curSelectValue = _ref1[0], setCurSelectValue = _ref1[1];
7464
- var _ref2 = _sliced_to_array((0, import_react53.useState)(), 2), curSelectItem = _ref2[0], setCurSelectItem = _ref2[1];
7465
- var _ref3 = _sliced_to_array((0, import_react53.useState)(), 2), curSearchValue = _ref3[0], setCurSearchValue = _ref3[1];
7466
- var _ref4 = _sliced_to_array((0, import_react53.useState)([]), 2), optionsData = _ref4[0], setOptionsData = _ref4[1];
7812
+ var _ref1 = _sliced_to_array((0, import_react54.useState)(value !== null && value !== void 0 ? value : void 0), 2), curSelectValue = _ref1[0], setCurSelectValue = _ref1[1];
7813
+ var _ref2 = _sliced_to_array((0, import_react54.useState)(), 2), curSelectItem = _ref2[0], setCurSelectItem = _ref2[1];
7814
+ var _ref3 = _sliced_to_array((0, import_react54.useState)(), 2), curSearchValue = _ref3[0], setCurSearchValue = _ref3[1];
7815
+ var _ref4 = _sliced_to_array((0, import_react54.useState)([]), 2), optionsData = _ref4[0], setOptionsData = _ref4[1];
7467
7816
  var fetchDataFn = onFetchData || apiService.merchantList;
7468
7817
  var fetchDataDeps = _object_spread_props(_object_spread({}, fetchParams), _define_property({}, curSelectLabel, curSearchValue || void 0));
7469
7818
  var _useReqData = _sliced_to_array(useReqData(fetchDataFn, _object_spread({
7470
7819
  page: 1,
7471
7820
  pageSize: 20
7472
7821
  }, fetchDataDeps), JSON.stringify(fetchDataDeps)), 1), resState = _useReqData[0];
7473
- (0, import_react53.useEffect)(function() {
7822
+ (0, import_react54.useEffect)(function() {
7474
7823
  var _resState_value;
7475
7824
  if (resState.loading || !((_resState_value = resState.value) === null || _resState_value === void 0 ? void 0 : _resState_value.data.list)) return;
7476
7825
  var optionsData2 = resState.value.data.list.map(onTransformData);
7477
7826
  setOptionsData(optionsData2);
7478
7827
  }, [
7479
- resState
7828
+ resState.loading,
7829
+ resState.value
7480
7830
  ]);
7481
- (0, import_react_use22.useUpdateEffect)(function() {
7831
+ (0, import_react_use23.useUpdateEffect)(function() {
7482
7832
  var changedValue = (curSelectValue !== null && curSelectValue !== void 0 ? curSelectValue : "") === "" ? void 0 : String(curSelectValue);
7483
7833
  onChange === null || onChange === void 0 ? void 0 : onChange(changedValue, curSelectItem);
7484
7834
  }, [
@@ -7507,7 +7857,7 @@ var EffectLabelSelect = (0, import_react53.memo)(function(props) {
7507
7857
  setOptionsData([]);
7508
7858
  };
7509
7859
  var selectLabelProps = {
7510
- className: index_module_default21.select_label,
7860
+ className: index_module_default22.select_label,
7511
7861
  disabled: disabled,
7512
7862
  defaultValue: curSelectLabel,
7513
7863
  options: transformObj2Options(labelDic),
@@ -7523,7 +7873,7 @@ var EffectLabelSelect = (0, import_react53.memo)(function(props) {
7523
7873
  });
7524
7874
  }) : optionsData;
7525
7875
  var selectValueProps = {
7526
- className: (0, import_classnames16.default)(index_module_default21.value_select, className),
7876
+ className: (0, import_classnames17.default)(index_module_default22.value_select, className),
7527
7877
  notFoundContent: notFoundContent,
7528
7878
  value: mergedValue,
7529
7879
  options: mergedOptionsData,
@@ -7540,12 +7890,12 @@ var EffectLabelSelect = (0, import_react53.memo)(function(props) {
7540
7890
  filterOption: false,
7541
7891
  popupMatchSelectWidth: false
7542
7892
  };
7543
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_antd40.Space.Compact, {
7544
- className: index_module_default21.select_wrap,
7893
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_antd41.Space.Compact, {
7894
+ className: index_module_default22.select_wrap,
7545
7895
  style: style,
7546
7896
  children: [
7547
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_antd40.Select, _object_spread({}, selectLabelProps)),
7548
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_antd40.Select, _object_spread({}, selectValueProps))
7897
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_antd41.Select, _object_spread({}, selectLabelProps)),
7898
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_antd41.Select, _object_spread({}, selectValueProps))
7549
7899
  ]
7550
7900
  });
7551
7901
  });
@@ -7648,6 +7998,7 @@ var getSecondValue = function getSecondValue() {
7648
7998
  EffectMerchantSelect: EffectMerchantSelect,
7649
7999
  EffectReservoirSelect: EffectReservoirSelect,
7650
8000
  EffectScopeSelect: EffectScopeSelect,
8001
+ EffectSearchSelect: EffectSearchSelect,
7651
8002
  EffectSeriesSelect: EffectSeriesSelect,
7652
8003
  EffectSeriesSelectV2: EffectSeriesSelectV2,
7653
8004
  EffectShelveSelect: EffectShelveSelect,
@@ -7684,6 +8035,7 @@ var getSecondValue = function getSecondValue() {
7684
8035
  commonStatusSelectOptions: commonStatusSelectOptions,
7685
8036
  commonYesOrNoSelectOptions: commonYesOrNoSelectOptions,
7686
8037
  commonYesOrNoSelectOptionsMap: commonYesOrNoSelectOptionsMap,
8038
+ defaultMerchantSearchSources: defaultMerchantSearchSources,
7687
8039
  formatClock: formatClock,
7688
8040
  formatDate: formatDate,
7689
8041
  getCTable: getCTable,