@xfe-repo/web-components 1.8.0 → 1.8.2
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 +34 -18
- package/dist/index.d.mts +41 -47
- package/dist/index.d.ts +41 -47
- package/dist/index.js +508 -400
- package/dist/index.mjs +465 -341
- package/package.json +1 -1
- package/skills/xfe-web-components/GUIDE.md +2 -2
- package/skills/xfe-web-components/SKILL.md +2 -2
- package/skills/xfe-web-components/references/EffectMerchantSelect.md +13 -28
- package/skills/xfe-web-components/references/EffectSearchSelect.md +260 -0
- package/skills/xfe-web-components/references/EffectStaffSelect.md +4 -4
- package/skills/xfe-web-components/references/commonFn.md +0 -82
- package/skills/xfe-web-components/references/EffectLabelSelect.md +0 -222
package/dist/index.js
CHANGED
|
@@ -460,9 +460,6 @@ __export(index_exports, {
|
|
|
460
460
|
EffectFileUpload: function EffectFileUpload1() {
|
|
461
461
|
return EffectFileUpload;
|
|
462
462
|
},
|
|
463
|
-
EffectLabelSelect: function EffectLabelSelect1() {
|
|
464
|
-
return EffectLabelSelect;
|
|
465
|
-
},
|
|
466
463
|
EffectMerchantSelect: function EffectMerchantSelect1() {
|
|
467
464
|
return EffectMerchantSelect;
|
|
468
465
|
},
|
|
@@ -472,6 +469,9 @@ __export(index_exports, {
|
|
|
472
469
|
EffectScopeSelect: function EffectScopeSelect1() {
|
|
473
470
|
return EffectScopeSelect;
|
|
474
471
|
},
|
|
472
|
+
EffectSearchSelect: function EffectSearchSelect1() {
|
|
473
|
+
return EffectSearchSelect;
|
|
474
|
+
},
|
|
475
475
|
EffectSeriesSelect: function EffectSeriesSelect1() {
|
|
476
476
|
return EffectSeriesSelect;
|
|
477
477
|
},
|
|
@@ -580,6 +580,9 @@ __export(index_exports, {
|
|
|
580
580
|
commonYesOrNoSelectOptionsMap: function commonYesOrNoSelectOptionsMap1() {
|
|
581
581
|
return commonYesOrNoSelectOptionsMap;
|
|
582
582
|
},
|
|
583
|
+
defaultMerchantSearchSources: function defaultMerchantSearchSources1() {
|
|
584
|
+
return defaultMerchantSearchSources;
|
|
585
|
+
},
|
|
583
586
|
formatClock: function formatClock1() {
|
|
584
587
|
return formatClock;
|
|
585
588
|
},
|
|
@@ -595,24 +598,9 @@ __export(index_exports, {
|
|
|
595
598
|
getCommonTableProps: function getCommonTableProps1() {
|
|
596
599
|
return getCommonTableProps;
|
|
597
600
|
},
|
|
598
|
-
getFirstValue: function getFirstValue1() {
|
|
599
|
-
return getFirstValue;
|
|
600
|
-
},
|
|
601
|
-
getInitialValue: function getInitialValue1() {
|
|
602
|
-
return getInitialValue;
|
|
603
|
-
},
|
|
604
601
|
getNumberValue: function getNumberValue1() {
|
|
605
602
|
return getNumberValue;
|
|
606
603
|
},
|
|
607
|
-
getSecondValue: function getSecondValue1() {
|
|
608
|
-
return getSecondValue;
|
|
609
|
-
},
|
|
610
|
-
getSelectValue: function getSelectValue1() {
|
|
611
|
-
return getSelectValue;
|
|
612
|
-
},
|
|
613
|
-
getStrValue: function getStrValue1() {
|
|
614
|
-
return getStrValue;
|
|
615
|
-
},
|
|
616
604
|
isSingleTreeSelected: function isSingleTreeSelected1() {
|
|
617
605
|
return isSingleTreeSelected;
|
|
618
606
|
},
|
|
@@ -3358,6 +3346,7 @@ var index_module_default6 = {
|
|
|
3358
3346
|
text: "index_module_text",
|
|
3359
3347
|
button: "index_module_button",
|
|
3360
3348
|
remote: "index_module_remote",
|
|
3349
|
+
paste_tip: "index_module_paste_tip",
|
|
3361
3350
|
upload_mask: "index_module_upload_mask"
|
|
3362
3351
|
};
|
|
3363
3352
|
// src/FileUpload/index.tsx
|
|
@@ -4128,16 +4117,19 @@ var FileUpload = function FileUpload(props) {
|
|
|
4128
4117
|
var renderPicCardUploadButton = (0, import_react34.useCallback)(function() {
|
|
4129
4118
|
if (max && fileList.length >= max) return null;
|
|
4130
4119
|
if (children) return children;
|
|
4131
|
-
if (disabled) return null;
|
|
4132
4120
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", {
|
|
4133
4121
|
className: index_module_default6.upload_btn,
|
|
4134
4122
|
children: [
|
|
4123
|
+
pastable && !disabled && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", {
|
|
4124
|
+
className: index_module_default6.paste_tip,
|
|
4125
|
+
children: "\u53EF\u7C98\u8D34\u4E0A\u4F20"
|
|
4126
|
+
}),
|
|
4135
4127
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_icons9.PlusOutlined, {}),
|
|
4136
4128
|
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", {
|
|
4137
4129
|
className: index_module_default6.text,
|
|
4138
4130
|
children: "\u4E0A\u4F20"
|
|
4139
4131
|
}),
|
|
4140
|
-
remote && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(RemoteUpload, {
|
|
4132
|
+
remote && !disabled && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(RemoteUpload, {
|
|
4141
4133
|
max: max,
|
|
4142
4134
|
onAddFile: setBufferAddFile
|
|
4143
4135
|
})
|
|
@@ -6385,13 +6377,13 @@ function useMerchantOptions(params) {
|
|
|
6385
6377
|
params
|
|
6386
6378
|
], function() {
|
|
6387
6379
|
return _async_to_generator(function() {
|
|
6388
|
-
var _res_data, _ref, enabled,
|
|
6380
|
+
var _res_data, _ref, enabled, _ref_source, source, searchParams, res, options;
|
|
6389
6381
|
return _ts_generator(this, function(_state) {
|
|
6390
6382
|
switch(_state.label){
|
|
6391
6383
|
case 0:
|
|
6392
|
-
_ref = params || {}, enabled = _ref.enabled,
|
|
6384
|
+
_ref = params || {}, enabled = _ref.enabled, _ref_source = _ref.source, source = _ref_source === void 0 ? "enterpriseNo" : _ref_source, searchParams = _object_without_properties(_ref, [
|
|
6393
6385
|
"enabled",
|
|
6394
|
-
"
|
|
6386
|
+
"source"
|
|
6395
6387
|
]);
|
|
6396
6388
|
if (enabled === false) return [
|
|
6397
6389
|
2,
|
|
@@ -6402,7 +6394,7 @@ function useMerchantOptions(params) {
|
|
|
6402
6394
|
apiService.merchantList(_object_spread({
|
|
6403
6395
|
page: 1,
|
|
6404
6396
|
pageSize: 20
|
|
6405
|
-
},
|
|
6397
|
+
}, searchParams), config)
|
|
6406
6398
|
];
|
|
6407
6399
|
case 1:
|
|
6408
6400
|
res = _state.sent();
|
|
@@ -6410,9 +6402,8 @@ function useMerchantOptions(params) {
|
|
|
6410
6402
|
throw new Error((res === null || res === void 0 ? void 0 : res.msg) || "\u63A5\u53E3\u8BF7\u6C42\u9519\u8BEF~");
|
|
6411
6403
|
}
|
|
6412
6404
|
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
6405
|
return {
|
|
6415
|
-
label:
|
|
6406
|
+
label: getMerchantSourceLabel(item, source),
|
|
6416
6407
|
value: item.enterpriseNo,
|
|
6417
6408
|
originalName: item.platformName,
|
|
6418
6409
|
data: item
|
|
@@ -6435,6 +6426,20 @@ function useMerchantOptions(params) {
|
|
|
6435
6426
|
mutate: mutate
|
|
6436
6427
|
};
|
|
6437
6428
|
}
|
|
6429
|
+
var getMerchantSourceLabel = function getMerchantSourceLabel(item, sourceValue) {
|
|
6430
|
+
var sourceLabelMap = {
|
|
6431
|
+
enterpriseNo: item.enterpriseNo,
|
|
6432
|
+
platformName: item.platformName,
|
|
6433
|
+
name: item.name,
|
|
6434
|
+
// 目前接口没有手机号,先放空字符串,后续如果接口增加了手机号字段再修改这里
|
|
6435
|
+
phone: ""
|
|
6436
|
+
};
|
|
6437
|
+
return sourceLabelMap[sourceValue] || [
|
|
6438
|
+
item.enterpriseNo,
|
|
6439
|
+
item.platformName,
|
|
6440
|
+
item.name
|
|
6441
|
+
].filter(Boolean).join(" - ");
|
|
6442
|
+
};
|
|
6438
6443
|
// src/EffectMerchantSelect/index.tsx
|
|
6439
6444
|
var import_tools10 = require("@xfe-repo/web-utils/tools");
|
|
6440
6445
|
var import_classnames12 = __toESM(require("classnames"));
|
|
@@ -6447,15 +6452,34 @@ var index_module_default17 = {
|
|
|
6447
6452
|
// src/EffectMerchantSelect/index.tsx
|
|
6448
6453
|
var import_antd32 = require("antd");
|
|
6449
6454
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
6455
|
+
var defaultMerchantSearchSources = [
|
|
6456
|
+
{
|
|
6457
|
+
label: "\u5546\u6237\u53F7",
|
|
6458
|
+
value: "enterpriseNo"
|
|
6459
|
+
},
|
|
6460
|
+
{
|
|
6461
|
+
label: "\u5E73\u53F0\u540D",
|
|
6462
|
+
value: "platformName"
|
|
6463
|
+
},
|
|
6464
|
+
{
|
|
6465
|
+
label: "\u5546\u6237\u540D",
|
|
6466
|
+
value: "name"
|
|
6467
|
+
},
|
|
6468
|
+
{
|
|
6469
|
+
label: "\u4E3B\u624B\u673A\u53F7",
|
|
6470
|
+
value: "phone"
|
|
6471
|
+
}
|
|
6472
|
+
];
|
|
6450
6473
|
var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
|
|
6451
|
-
var
|
|
6452
|
-
var
|
|
6453
|
-
var _ref1 = _sliced_to_array((0, import_react45.useState)(
|
|
6454
|
-
var _ref2 = _sliced_to_array((0, import_react45.useState)(), 2),
|
|
6455
|
-
var _ref3 = _sliced_to_array((0, import_react45.useState)(
|
|
6456
|
-
var _ref4 = _sliced_to_array((0, import_react45.useState)(), 2),
|
|
6474
|
+
var _ref;
|
|
6475
|
+
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;
|
|
6476
|
+
var _ref1 = _sliced_to_array((0, import_react45.useState)(), 2), searchValue = _ref1[0], setSearchValue = _ref1[1];
|
|
6477
|
+
var _ref2 = _sliced_to_array((0, import_react45.useState)(controlValue), 2), value = _ref2[0], setValue = _ref2[1];
|
|
6478
|
+
var _ref3 = _sliced_to_array((0, import_react45.useState)(), 2), name = _ref3[0], setName = _ref3[1];
|
|
6479
|
+
var _ref4 = _sliced_to_array((0, import_react45.useState)(source), 2), sourceControl = _ref4[0], setSourceControl = _ref4[1];
|
|
6480
|
+
var _ref5 = _sliced_to_array((0, import_react45.useState)(), 2), params = _ref5[0], setParams = _ref5[1];
|
|
6457
6481
|
var state = useMerchantOptions(params);
|
|
6458
|
-
var
|
|
6482
|
+
var _ref6 = _sliced_to_array((0, import_react45.useState)(state.data || []), 2), options = _ref6[0], setOptions = _ref6[1];
|
|
6459
6483
|
(0, import_react_use15.useUpdateEffect)(function() {
|
|
6460
6484
|
if (!state.data) return;
|
|
6461
6485
|
setOptions(state.data);
|
|
@@ -6465,12 +6489,11 @@ var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
|
|
|
6465
6489
|
(0, import_react45.useEffect)(function() {
|
|
6466
6490
|
if (controlValue !== value) setValue(controlValue);
|
|
6467
6491
|
if (controlValue) setParams({
|
|
6468
|
-
|
|
6469
|
-
|
|
6492
|
+
enterpriseNo: controlValue,
|
|
6493
|
+
source: sourceControl
|
|
6470
6494
|
});
|
|
6471
6495
|
}, [
|
|
6472
|
-
controlValue
|
|
6473
|
-
labelDisplayMode
|
|
6496
|
+
controlValue
|
|
6474
6497
|
]);
|
|
6475
6498
|
(0, import_react_use15.useUpdateEffect)(function() {
|
|
6476
6499
|
var changeValue = (value !== null && value !== void 0 ? value : "") === "" ? void 0 : String(value);
|
|
@@ -6484,24 +6507,23 @@ var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
|
|
|
6484
6507
|
setName(option === null || option === void 0 ? void 0 : option.originalName);
|
|
6485
6508
|
};
|
|
6486
6509
|
var handleOnSearch = function handleOnSearch(searchValue2) {
|
|
6510
|
+
setSearchValue(searchValue2);
|
|
6487
6511
|
var _obj;
|
|
6488
|
-
if (searchValue2) setParams((_obj = {}, _define_property(_obj, sourceControl, searchValue2), _define_property(_obj, "
|
|
6512
|
+
if (searchValue2) setParams((_obj = {}, _define_property(_obj, sourceControl, searchValue2), _define_property(_obj, "source", sourceControl), _obj));
|
|
6489
6513
|
};
|
|
6490
6514
|
var handleOnSearchDebounce = (0, import_react45.useCallback)((0, import_tools10.debounce)(800, handleOnSearch), [
|
|
6491
|
-
sourceControl
|
|
6492
|
-
labelDisplayMode
|
|
6515
|
+
sourceControl
|
|
6493
6516
|
]);
|
|
6494
6517
|
var handleOnClear = function handleOnClear() {
|
|
6495
6518
|
setSearchValue(void 0);
|
|
6496
6519
|
setOptions([]);
|
|
6497
6520
|
};
|
|
6498
|
-
var
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
var
|
|
6504
|
-
var handleAddonChange = function handleAddonChange(value2, _option) {
|
|
6521
|
+
var currentSource = defaultMerchantSearchSources.find(function(s) {
|
|
6522
|
+
return s.value === sourceControl;
|
|
6523
|
+
});
|
|
6524
|
+
var currentSourceLabel = (_ref = currentSource === null || currentSource === void 0 ? void 0 : currentSource.label) !== null && _ref !== void 0 ? _ref : "";
|
|
6525
|
+
var notFoundContent = state.isLoading ? "\u641C\u7D22\u4E2D" : searchValue ? "输入的".concat(currentSourceLabel, "未查询到商户信息") : "请输入".concat(currentSourceLabel);
|
|
6526
|
+
var handleAddonChange = function handleAddonChange(value2) {
|
|
6505
6527
|
setSourceControl(value2);
|
|
6506
6528
|
setValue(void 0);
|
|
6507
6529
|
setSearchValue(void 0);
|
|
@@ -6519,13 +6541,7 @@ var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
|
|
|
6519
6541
|
popupMatchSelectWidth: false,
|
|
6520
6542
|
disabled: disabled,
|
|
6521
6543
|
defaultValue: sourceControl,
|
|
6522
|
-
options:
|
|
6523
|
-
var _param = _sliced_to_array(param, 2), value2 = _param[0], label = _param[1];
|
|
6524
|
-
return {
|
|
6525
|
-
value: value2,
|
|
6526
|
-
label: label
|
|
6527
|
-
};
|
|
6528
|
-
}),
|
|
6544
|
+
options: defaultMerchantSearchSources,
|
|
6529
6545
|
onChange: handleAddonChange,
|
|
6530
6546
|
style: {
|
|
6531
6547
|
width: 140
|
|
@@ -6533,12 +6549,13 @@ var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
|
|
|
6533
6549
|
};
|
|
6534
6550
|
var selectBrandProps = {
|
|
6535
6551
|
notFoundContent: notFoundContent,
|
|
6536
|
-
placeholder: "请输入".concat(
|
|
6552
|
+
placeholder: "请输入".concat(currentSourceLabel),
|
|
6537
6553
|
optionFilterProp: "label",
|
|
6538
6554
|
showSearch: true,
|
|
6539
6555
|
allowClear: true,
|
|
6540
6556
|
defaultActiveFirstOption: false,
|
|
6541
6557
|
filterOption: false,
|
|
6558
|
+
popupMatchSelectWidth: false,
|
|
6542
6559
|
value: value,
|
|
6543
6560
|
options: options,
|
|
6544
6561
|
disabled: disabled,
|
|
@@ -6557,15 +6574,339 @@ var EffectMerchantSelect = (0, import_react45.memo)(function(props) {
|
|
|
6557
6574
|
]
|
|
6558
6575
|
});
|
|
6559
6576
|
});
|
|
6560
|
-
// src/
|
|
6561
|
-
var
|
|
6562
|
-
var import_antd34 = require("antd");
|
|
6577
|
+
// src/EffectSearchSelect/index.tsx
|
|
6578
|
+
var import_react46 = __toESM(require("react"));
|
|
6563
6579
|
var import_react_use16 = require("react-use");
|
|
6564
|
-
|
|
6565
|
-
var import_react46 = require("react");
|
|
6580
|
+
var import_classnames13 = __toESM(require("classnames"));
|
|
6566
6581
|
var import_antd33 = require("antd");
|
|
6582
|
+
// src/EffectSearchSelect/index.module.less
|
|
6583
|
+
var index_module_default18 = {
|
|
6584
|
+
search_select_wrap: "index_module_search_select_wrap",
|
|
6585
|
+
source_select: "index_module_source_select",
|
|
6586
|
+
value_select: "index_module_value_select"
|
|
6587
|
+
};
|
|
6588
|
+
// src/EffectSearchSelect/useEffectSearchOptions.ts
|
|
6589
|
+
var import_immutable7 = __toESM(require("swr/immutable"));
|
|
6590
|
+
// src/EffectSearchSelect/utils.ts
|
|
6591
|
+
var DEFAULT_SEARCH_PAGE_SIZE = 20;
|
|
6592
|
+
var DEFAULT_SEARCH_MIN_LENGTH = 1;
|
|
6593
|
+
var DEFAULT_MERCHANT_SEARCH_CACHE_KEY = "merchant/list";
|
|
6594
|
+
var DEFAULT_MERCHANT_SOURCE_VALUE = "enterpriseNo";
|
|
6595
|
+
var defaultMerchantSearchSources2 = [
|
|
6596
|
+
{
|
|
6597
|
+
label: "\u5546\u6237\u53F7",
|
|
6598
|
+
value: "enterpriseNo"
|
|
6599
|
+
},
|
|
6600
|
+
{
|
|
6601
|
+
label: "\u5E73\u53F0\u540D",
|
|
6602
|
+
value: "platformName"
|
|
6603
|
+
},
|
|
6604
|
+
{
|
|
6605
|
+
label: "\u5546\u6237\u540D",
|
|
6606
|
+
value: "name"
|
|
6607
|
+
},
|
|
6608
|
+
{
|
|
6609
|
+
label: "\u4E3B\u624B\u673A\u53F7",
|
|
6610
|
+
value: "phone"
|
|
6611
|
+
}
|
|
6612
|
+
];
|
|
6613
|
+
var defaultTransformMerchantOptions = function defaultTransformMerchantOptions(data, context) {
|
|
6614
|
+
return (data.list || []).map(function(item) {
|
|
6615
|
+
return {
|
|
6616
|
+
label: getMerchantSourceLabel2(item, context.source.value),
|
|
6617
|
+
value: item.enterpriseNo,
|
|
6618
|
+
raw: item
|
|
6619
|
+
};
|
|
6620
|
+
});
|
|
6621
|
+
};
|
|
6622
|
+
var getMerchantSourceLabel2 = function getMerchantSourceLabel2(item, sourceValue) {
|
|
6623
|
+
var sourceLabelMap = {
|
|
6624
|
+
enterpriseNo: item.enterpriseNo,
|
|
6625
|
+
platformName: item.platformName,
|
|
6626
|
+
name: item.name,
|
|
6627
|
+
// 目前接口没有手机号,先放空字符串,后续如果接口增加了手机号字段再修改这里
|
|
6628
|
+
phone: ""
|
|
6629
|
+
};
|
|
6630
|
+
return sourceLabelMap[sourceValue] || [
|
|
6631
|
+
item.enterpriseNo,
|
|
6632
|
+
item.platformName,
|
|
6633
|
+
item.name
|
|
6634
|
+
].filter(Boolean).join(" - ");
|
|
6635
|
+
};
|
|
6636
|
+
var getDefaultSourceValue = function getDefaultSourceValue(sources, defaultSourceValue) {
|
|
6637
|
+
var _sources_;
|
|
6638
|
+
if (defaultSourceValue && sources.some(function(source) {
|
|
6639
|
+
return source.value === defaultSourceValue;
|
|
6640
|
+
})) {
|
|
6641
|
+
return defaultSourceValue;
|
|
6642
|
+
}
|
|
6643
|
+
return (_sources_ = sources[0]) === null || _sources_ === void 0 ? void 0 : _sources_.value;
|
|
6644
|
+
};
|
|
6645
|
+
var getCurrentSource = function getCurrentSource(sources, selectedSourceValue) {
|
|
6646
|
+
return sources.find(function(source) {
|
|
6647
|
+
return source.value === selectedSourceValue;
|
|
6648
|
+
}) || sources[0];
|
|
6649
|
+
};
|
|
6650
|
+
var buildDefaultSearchParams = function buildDefaultSearchParams(keyword, source, baseParams, pageSize) {
|
|
6651
|
+
return _object_spread_props(_object_spread({
|
|
6652
|
+
page: 1,
|
|
6653
|
+
pageSize: pageSize
|
|
6654
|
+
}, baseParams), _define_property({}, source.value, keyword));
|
|
6655
|
+
};
|
|
6656
|
+
var normalizeSelectValue = function normalizeSelectValue(value) {
|
|
6657
|
+
return value === null ? void 0 : value;
|
|
6658
|
+
};
|
|
6659
|
+
var normalizeSelectedOption = function normalizeSelectedOption(option) {
|
|
6660
|
+
var selectedOption = Array.isArray(option) ? option[0] : option;
|
|
6661
|
+
return selectedOption ? selectedOption : void 0;
|
|
6662
|
+
};
|
|
6663
|
+
var resolveMergedDefaultSourceValue = function resolveMergedDefaultSourceValue(sources, defaultSourceValue, hasCustomSources) {
|
|
6664
|
+
var _sources_;
|
|
6665
|
+
if (defaultSourceValue) return defaultSourceValue;
|
|
6666
|
+
return hasCustomSources ? (_sources_ = sources[0]) === null || _sources_ === void 0 ? void 0 : _sources_.value : DEFAULT_MERCHANT_SOURCE_VALUE;
|
|
6667
|
+
};
|
|
6668
|
+
var resolveNotFoundContent = function resolveNotFoundContent(params) {
|
|
6669
|
+
var error = params.error, isLoading = params.isLoading, keyword = params.keyword, sourceLabel = params.sourceLabel, defaultPlaceholder = params.defaultPlaceholder;
|
|
6670
|
+
if (error) return error.message || "\u67E5\u8BE2\u5931\u8D25";
|
|
6671
|
+
if (isLoading) return "\u641C\u7D22\u4E2D";
|
|
6672
|
+
if (keyword) return "输入的".concat(sourceLabel, "未查询到信息");
|
|
6673
|
+
return defaultPlaceholder;
|
|
6674
|
+
};
|
|
6675
|
+
// src/EffectSearchSelect/useEffectSearchOptions.ts
|
|
6676
|
+
function useEffectSearchOptions(params) {
|
|
6677
|
+
var config = useRequestConfig().config;
|
|
6678
|
+
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;
|
|
6679
|
+
var swrKey = enabled && source ? [
|
|
6680
|
+
"EffectSearchSelect",
|
|
6681
|
+
cacheKey,
|
|
6682
|
+
source.value,
|
|
6683
|
+
keyword,
|
|
6684
|
+
fetchParams,
|
|
6685
|
+
pageSize
|
|
6686
|
+
] : null;
|
|
6687
|
+
var _ref = (0, import_immutable7.default)(swrKey, function() {
|
|
6688
|
+
return _async_to_generator(function() {
|
|
6689
|
+
var requestParams, response;
|
|
6690
|
+
return _ts_generator(this, function(_state) {
|
|
6691
|
+
switch(_state.label){
|
|
6692
|
+
case 0:
|
|
6693
|
+
if (!source) return [
|
|
6694
|
+
2,
|
|
6695
|
+
[]
|
|
6696
|
+
];
|
|
6697
|
+
requestParams = buildParams ? buildParams(keyword, source, fetchParams) : buildDefaultSearchParams(keyword, source, fetchParams, pageSize);
|
|
6698
|
+
return [
|
|
6699
|
+
4,
|
|
6700
|
+
request(requestParams, config)
|
|
6701
|
+
];
|
|
6702
|
+
case 1:
|
|
6703
|
+
response = _state.sent();
|
|
6704
|
+
if ((response === null || response === void 0 ? void 0 : response.code) !== 200) {
|
|
6705
|
+
throw new Error((response === null || response === void 0 ? void 0 : response.msg) || "\u63A5\u53E3\u8BF7\u6C42\u9519\u8BEF~");
|
|
6706
|
+
}
|
|
6707
|
+
return [
|
|
6708
|
+
2,
|
|
6709
|
+
transformOptions(response.data, {
|
|
6710
|
+
source: source,
|
|
6711
|
+
keyword: keyword
|
|
6712
|
+
})
|
|
6713
|
+
];
|
|
6714
|
+
}
|
|
6715
|
+
});
|
|
6716
|
+
})();
|
|
6717
|
+
}, {
|
|
6718
|
+
errorRetryCount: 0,
|
|
6719
|
+
shouldRetryOnError: false
|
|
6720
|
+
}), data = _ref.data, error = _ref.error, isLoading = _ref.isLoading, mutate = _ref.mutate;
|
|
6721
|
+
return {
|
|
6722
|
+
options: data || [],
|
|
6723
|
+
error: error,
|
|
6724
|
+
isLoading: isLoading,
|
|
6725
|
+
mutate: mutate
|
|
6726
|
+
};
|
|
6727
|
+
}
|
|
6728
|
+
// src/EffectSearchSelect/index.tsx
|
|
6567
6729
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
6568
|
-
var
|
|
6730
|
+
var EMPTY_FETCH_PARAMS = {};
|
|
6731
|
+
var EffectSearchSelectBase = function EffectSearchSelectBase(props) {
|
|
6732
|
+
var _ref;
|
|
6733
|
+
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, [
|
|
6734
|
+
"className",
|
|
6735
|
+
"style",
|
|
6736
|
+
"value",
|
|
6737
|
+
"defaultValue",
|
|
6738
|
+
"disabled",
|
|
6739
|
+
"placeholder",
|
|
6740
|
+
"notFoundContent",
|
|
6741
|
+
"sources",
|
|
6742
|
+
"defaultSourceValue",
|
|
6743
|
+
"fetchParams",
|
|
6744
|
+
"pageSize",
|
|
6745
|
+
"request",
|
|
6746
|
+
"buildParams",
|
|
6747
|
+
"transformOptions",
|
|
6748
|
+
"onChange",
|
|
6749
|
+
"onClear"
|
|
6750
|
+
]);
|
|
6751
|
+
var apiService = useRequestConfig().apiService;
|
|
6752
|
+
var valueControlledRef = (0, import_react46.useRef)(Object.prototype.hasOwnProperty.call(props, "value"));
|
|
6753
|
+
var valueControlled = valueControlledRef.current;
|
|
6754
|
+
var hasCustomSources = Boolean(sources === null || sources === void 0 ? void 0 : sources.length);
|
|
6755
|
+
var mergedSources = (0, import_react46.useMemo)(function() {
|
|
6756
|
+
return hasCustomSources ? sources : defaultMerchantSearchSources2;
|
|
6757
|
+
}, [
|
|
6758
|
+
hasCustomSources,
|
|
6759
|
+
sources
|
|
6760
|
+
]);
|
|
6761
|
+
var mergedDefaultSourceValue = (0, import_react46.useMemo)(function() {
|
|
6762
|
+
return resolveMergedDefaultSourceValue(mergedSources, defaultSourceValue, hasCustomSources);
|
|
6763
|
+
}, [
|
|
6764
|
+
defaultSourceValue,
|
|
6765
|
+
hasCustomSources,
|
|
6766
|
+
mergedSources
|
|
6767
|
+
]);
|
|
6768
|
+
var _ref1 = _sliced_to_array((0, import_react46.useState)(function() {
|
|
6769
|
+
return getDefaultSourceValue(mergedSources, mergedDefaultSourceValue);
|
|
6770
|
+
}), 2), innerSourceValue = _ref1[0], setInnerSourceValue = _ref1[1];
|
|
6771
|
+
var currentSource = getCurrentSource(mergedSources, innerSourceValue);
|
|
6772
|
+
var currentSourceValue = currentSource === null || currentSource === void 0 ? void 0 : currentSource.value;
|
|
6773
|
+
(0, import_react46.useEffect)(function() {
|
|
6774
|
+
var isCurrentSourceValid = mergedSources.some(function(source) {
|
|
6775
|
+
return source.value === innerSourceValue;
|
|
6776
|
+
});
|
|
6777
|
+
if (!isCurrentSourceValid) {
|
|
6778
|
+
setInnerSourceValue(getDefaultSourceValue(mergedSources, mergedDefaultSourceValue));
|
|
6779
|
+
}
|
|
6780
|
+
}, [
|
|
6781
|
+
innerSourceValue,
|
|
6782
|
+
mergedDefaultSourceValue,
|
|
6783
|
+
mergedSources
|
|
6784
|
+
]);
|
|
6785
|
+
var _ref2 = _sliced_to_array((0, import_react46.useState)(function() {
|
|
6786
|
+
return normalizeSelectValue(value !== null && value !== void 0 ? value : defaultValue);
|
|
6787
|
+
}), 2), innerValue = _ref2[0], setInnerValue = _ref2[1];
|
|
6788
|
+
var mergedValue = valueControlled ? normalizeSelectValue(value) : innerValue;
|
|
6789
|
+
var _ref3 = _sliced_to_array((0, import_react46.useState)(""), 2), searchText = _ref3[0], setSearchText = _ref3[1];
|
|
6790
|
+
var _ref4 = _sliced_to_array((0, import_react46.useState)(""), 2), keyword = _ref4[0], setKeyword = _ref4[1];
|
|
6791
|
+
(0, import_react_use16.useDebounce)(function() {
|
|
6792
|
+
setKeyword(searchText.trim());
|
|
6793
|
+
}, 600, [
|
|
6794
|
+
searchText
|
|
6795
|
+
]);
|
|
6796
|
+
var requestFn = request || apiService.merchantList;
|
|
6797
|
+
var transformOptionsFn = transformOptions || defaultTransformMerchantOptions;
|
|
6798
|
+
var searchEnabled = Boolean(currentSource && keyword.length >= DEFAULT_SEARCH_MIN_LENGTH);
|
|
6799
|
+
var searchCacheKey = request ? request.name || "custom" : DEFAULT_MERCHANT_SEARCH_CACHE_KEY;
|
|
6800
|
+
var _useEffectSearchOptions = useEffectSearchOptions({
|
|
6801
|
+
cacheKey: searchCacheKey,
|
|
6802
|
+
keyword: keyword,
|
|
6803
|
+
source: currentSource,
|
|
6804
|
+
enabled: searchEnabled,
|
|
6805
|
+
fetchParams: fetchParams,
|
|
6806
|
+
pageSize: pageSize,
|
|
6807
|
+
request: requestFn,
|
|
6808
|
+
buildParams: buildParams,
|
|
6809
|
+
transformOptions: transformOptionsFn
|
|
6810
|
+
}), options = _useEffectSearchOptions.options, isLoading = _useEffectSearchOptions.isLoading, error = _useEffectSearchOptions.error;
|
|
6811
|
+
var resetSearchAndValue = (0, import_react46.useCallback)(function() {
|
|
6812
|
+
setSearchText("");
|
|
6813
|
+
setKeyword("");
|
|
6814
|
+
if (!valueControlled) {
|
|
6815
|
+
setInnerValue(void 0);
|
|
6816
|
+
}
|
|
6817
|
+
}, [
|
|
6818
|
+
valueControlled
|
|
6819
|
+
]);
|
|
6820
|
+
var handleSourceChange = (0, import_react46.useCallback)(function(nextSourceValue) {
|
|
6821
|
+
setInnerSourceValue(nextSourceValue);
|
|
6822
|
+
resetSearchAndValue();
|
|
6823
|
+
}, [
|
|
6824
|
+
resetSearchAndValue
|
|
6825
|
+
]);
|
|
6826
|
+
var handleSearch = (0, import_react46.useCallback)(function(nextSearchText) {
|
|
6827
|
+
setSearchText(nextSearchText);
|
|
6828
|
+
}, []);
|
|
6829
|
+
var handleChange = (0, import_react46.useCallback)(function(nextValue, option) {
|
|
6830
|
+
var selectedOption = normalizeSelectedOption(option);
|
|
6831
|
+
var normalizedValue = normalizeSelectValue(nextValue);
|
|
6832
|
+
if (!valueControlled) {
|
|
6833
|
+
setInnerValue(normalizedValue);
|
|
6834
|
+
}
|
|
6835
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(normalizedValue, selectedOption);
|
|
6836
|
+
}, [
|
|
6837
|
+
onChange,
|
|
6838
|
+
valueControlled
|
|
6839
|
+
]);
|
|
6840
|
+
var handleClear = (0, import_react46.useCallback)(function() {
|
|
6841
|
+
resetSearchAndValue();
|
|
6842
|
+
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
6843
|
+
}, [
|
|
6844
|
+
onClear,
|
|
6845
|
+
resetSearchAndValue
|
|
6846
|
+
]);
|
|
6847
|
+
var sourceOptions = (0, import_react46.useMemo)(function() {
|
|
6848
|
+
return mergedSources.map(function(param) {
|
|
6849
|
+
var label = param.label, val = param.value;
|
|
6850
|
+
return {
|
|
6851
|
+
label: label,
|
|
6852
|
+
value: val
|
|
6853
|
+
};
|
|
6854
|
+
});
|
|
6855
|
+
}, [
|
|
6856
|
+
mergedSources
|
|
6857
|
+
]);
|
|
6858
|
+
var sourceLabel = (_ref = currentSource === null || currentSource === void 0 ? void 0 : currentSource.label) !== null && _ref !== void 0 ? _ref : "";
|
|
6859
|
+
var defaultPlaceholder = sourceLabel ? "请输入".concat(sourceLabel) : "\u8BF7\u8F93\u5165";
|
|
6860
|
+
var defaultNotFoundContent = resolveNotFoundContent({
|
|
6861
|
+
error: error,
|
|
6862
|
+
isLoading: isLoading,
|
|
6863
|
+
keyword: keyword,
|
|
6864
|
+
sourceLabel: sourceLabel,
|
|
6865
|
+
defaultPlaceholder: defaultPlaceholder
|
|
6866
|
+
});
|
|
6867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_antd33.Space.Compact, {
|
|
6868
|
+
className: index_module_default18.search_select_wrap,
|
|
6869
|
+
style: style,
|
|
6870
|
+
children: [
|
|
6871
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd33.Select, {
|
|
6872
|
+
className: index_module_default18.source_select,
|
|
6873
|
+
disabled: disabled,
|
|
6874
|
+
value: currentSourceValue,
|
|
6875
|
+
options: sourceOptions,
|
|
6876
|
+
popupMatchSelectWidth: false,
|
|
6877
|
+
onChange: handleSourceChange
|
|
6878
|
+
}),
|
|
6879
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_antd33.Select, _object_spread_props(_object_spread({}, selectProps), {
|
|
6880
|
+
className: (0, import_classnames13.default)(index_module_default18.value_select, className),
|
|
6881
|
+
disabled: disabled,
|
|
6882
|
+
value: mergedValue,
|
|
6883
|
+
options: options,
|
|
6884
|
+
loading: isLoading,
|
|
6885
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : defaultPlaceholder,
|
|
6886
|
+
notFoundContent: notFoundContent !== null && notFoundContent !== void 0 ? notFoundContent : defaultNotFoundContent,
|
|
6887
|
+
showSearch: true,
|
|
6888
|
+
allowClear: true,
|
|
6889
|
+
defaultActiveFirstOption: false,
|
|
6890
|
+
filterOption: false,
|
|
6891
|
+
popupMatchSelectWidth: false,
|
|
6892
|
+
optionFilterProp: "label",
|
|
6893
|
+
onSearch: handleSearch,
|
|
6894
|
+
onChange: handleChange,
|
|
6895
|
+
onClear: handleClear
|
|
6896
|
+
}))
|
|
6897
|
+
]
|
|
6898
|
+
});
|
|
6899
|
+
};
|
|
6900
|
+
var EffectSearchSelect = import_react46.default.memo(EffectSearchSelectBase);
|
|
6901
|
+
// src/EffectScopeSelect/index.tsx
|
|
6902
|
+
var import_react48 = require("react");
|
|
6903
|
+
var import_antd35 = require("antd");
|
|
6904
|
+
var import_react_use17 = require("react-use");
|
|
6905
|
+
// src/EffectScopeSelect/ScopeViewMode.tsx
|
|
6906
|
+
var import_react47 = require("react");
|
|
6907
|
+
var import_antd34 = require("antd");
|
|
6908
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
6909
|
+
var ScopeViewMode = (0, import_react47.memo)(function(props) {
|
|
6569
6910
|
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
6911
|
var items = [];
|
|
6571
6912
|
if ((categoryName === null || categoryName === void 0 ? void 0 : categoryName.length) || (categoryIds === null || categoryIds === void 0 ? void 0 : categoryIds.length)) items.push({
|
|
@@ -6588,18 +6929,18 @@ var ScopeViewMode = (0, import_react46.memo)(function(props) {
|
|
|
6588
6929
|
label: "SKU",
|
|
6589
6930
|
value: skuName || String(skuId)
|
|
6590
6931
|
});
|
|
6591
|
-
if (items.length === 0) return /* @__PURE__ */ (0,
|
|
6932
|
+
if (items.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_antd34.Typography.Text, {
|
|
6592
6933
|
style: {
|
|
6593
6934
|
fontSize: 14
|
|
6594
6935
|
},
|
|
6595
6936
|
type: "danger",
|
|
6596
6937
|
children: "\u8BF7\u5148\u9009\u62E9\u54C1\u7C7B\u4FE1\u606F"
|
|
6597
6938
|
});
|
|
6598
|
-
return /* @__PURE__ */ (0,
|
|
6939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_antd34.Space, {
|
|
6599
6940
|
size: 4,
|
|
6600
6941
|
children: items.map(function(param) {
|
|
6601
6942
|
var label = param.label, value = param.value;
|
|
6602
|
-
return /* @__PURE__ */ (0,
|
|
6943
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Space, {
|
|
6603
6944
|
size: 4,
|
|
6604
6945
|
style: {
|
|
6605
6946
|
height: 32,
|
|
@@ -6607,7 +6948,7 @@ var ScopeViewMode = (0, import_react46.memo)(function(props) {
|
|
|
6607
6948
|
borderRadius: 6
|
|
6608
6949
|
},
|
|
6609
6950
|
children: [
|
|
6610
|
-
/* @__PURE__ */ (0,
|
|
6951
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_antd34.Typography.Text, {
|
|
6611
6952
|
style: {
|
|
6612
6953
|
fontSize: 14,
|
|
6613
6954
|
paddingRight: 16
|
|
@@ -6617,7 +6958,7 @@ var ScopeViewMode = (0, import_react46.memo)(function(props) {
|
|
|
6617
6958
|
":"
|
|
6618
6959
|
]
|
|
6619
6960
|
}),
|
|
6620
|
-
/* @__PURE__ */ (0,
|
|
6961
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_antd34.Typography.Text, {
|
|
6621
6962
|
style: {
|
|
6622
6963
|
fontSize: 14
|
|
6623
6964
|
},
|
|
@@ -6629,7 +6970,7 @@ var ScopeViewMode = (0, import_react46.memo)(function(props) {
|
|
|
6629
6970
|
});
|
|
6630
6971
|
});
|
|
6631
6972
|
// src/EffectScopeSelect/index.tsx
|
|
6632
|
-
var
|
|
6973
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
6633
6974
|
var ScopeLevelEnum = /* @__PURE__ */ function(ScopeLevelEnum2) {
|
|
6634
6975
|
ScopeLevelEnum2[ScopeLevelEnum2["CATEGORY"] = 1] = "CATEGORY";
|
|
6635
6976
|
ScopeLevelEnum2[ScopeLevelEnum2["BRAND"] = 2] = "BRAND";
|
|
@@ -6638,28 +6979,28 @@ var ScopeLevelEnum = /* @__PURE__ */ function(ScopeLevelEnum2) {
|
|
|
6638
6979
|
ScopeLevelEnum2[ScopeLevelEnum2["SKU"] = 5] = "SKU";
|
|
6639
6980
|
return ScopeLevelEnum2;
|
|
6640
6981
|
}(ScopeLevelEnum || {});
|
|
6641
|
-
var EffectScopeSelect = (0,
|
|
6982
|
+
var EffectScopeSelect = (0, import_react48.memo)(function(props) {
|
|
6642
6983
|
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,
|
|
6644
|
-
var lastLevelCategoryId = (0,
|
|
6984
|
+
var _ref = _sliced_to_array((0, import_react48.useState)(_object_spread({}, controlledValue, defaultValue)), 2), value = _ref[0], setValue = _ref[1];
|
|
6985
|
+
var lastLevelCategoryId = (0, import_react48.useMemo)(function() {
|
|
6645
6986
|
var _value_categoryIds;
|
|
6646
6987
|
return (_value_categoryIds = value.categoryIds) === null || _value_categoryIds === void 0 ? void 0 : _value_categoryIds[value.categoryIds.length - 1];
|
|
6647
6988
|
}, [
|
|
6648
6989
|
value.categoryIds
|
|
6649
6990
|
]);
|
|
6650
|
-
(0,
|
|
6991
|
+
(0, import_react_use17.useUpdateEffect)(function() {
|
|
6651
6992
|
setValue(_object_spread({}, controlledValue));
|
|
6652
6993
|
}, [
|
|
6653
6994
|
controlledValue
|
|
6654
6995
|
]);
|
|
6655
|
-
var handleChange = (0,
|
|
6996
|
+
var handleChange = (0, import_react48.useCallback)(function(newValue) {
|
|
6656
6997
|
setTimeout(function() {
|
|
6657
6998
|
return onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
6658
6999
|
}, 0);
|
|
6659
7000
|
}, [
|
|
6660
7001
|
onChange
|
|
6661
7002
|
]);
|
|
6662
|
-
var handleCategoryChange = (0,
|
|
7003
|
+
var handleCategoryChange = (0, import_react48.useCallback)(function(_values, selectedList) {
|
|
6663
7004
|
if (!selectedList || !isSingleTreeSelected(selectedList)) {
|
|
6664
7005
|
handleChange === null || handleChange === void 0 ? void 0 : handleChange();
|
|
6665
7006
|
return;
|
|
@@ -6678,7 +7019,7 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
|
|
|
6678
7019
|
handleChange,
|
|
6679
7020
|
requireLevel
|
|
6680
7021
|
]);
|
|
6681
|
-
var handleBrandChange = (0,
|
|
7022
|
+
var handleBrandChange = (0, import_react48.useCallback)(function(brandValue) {
|
|
6682
7023
|
var brandId = brandValue === void 0 ? void 0 : Number(brandValue);
|
|
6683
7024
|
setValue(function(prev) {
|
|
6684
7025
|
var newScope = {
|
|
@@ -6694,7 +7035,7 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
|
|
|
6694
7035
|
handleChange,
|
|
6695
7036
|
requireLevel
|
|
6696
7037
|
]);
|
|
6697
|
-
var handleSeriesChange = (0,
|
|
7038
|
+
var handleSeriesChange = (0, import_react48.useCallback)(function(seriesValue) {
|
|
6698
7039
|
var seriesId = seriesValue === void 0 ? void 0 : Number(seriesValue);
|
|
6699
7040
|
setValue(function(prev) {
|
|
6700
7041
|
var newScope = {
|
|
@@ -6711,7 +7052,7 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
|
|
|
6711
7052
|
handleChange,
|
|
6712
7053
|
requireLevel
|
|
6713
7054
|
]);
|
|
6714
|
-
var handleSpuChange = (0,
|
|
7055
|
+
var handleSpuChange = (0, import_react48.useCallback)(function(spuValue) {
|
|
6715
7056
|
var spuId = spuValue === void 0 ? void 0 : Number(spuValue);
|
|
6716
7057
|
setValue(function(prev) {
|
|
6717
7058
|
var newScope = {
|
|
@@ -6729,7 +7070,7 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
|
|
|
6729
7070
|
handleChange,
|
|
6730
7071
|
requireLevel
|
|
6731
7072
|
]);
|
|
6732
|
-
var handleSkuChange = (0,
|
|
7073
|
+
var handleSkuChange = (0, import_react48.useCallback)(function(skuValue) {
|
|
6733
7074
|
var skuId = skuValue === void 0 ? void 0 : Number(skuValue);
|
|
6734
7075
|
setValue(function(prev) {
|
|
6735
7076
|
var newScope = _object_spread_props(_object_spread({}, prev), {
|
|
@@ -6744,18 +7085,18 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
|
|
|
6744
7085
|
handleChange,
|
|
6745
7086
|
requireLevel
|
|
6746
7087
|
]);
|
|
6747
|
-
var renderLabel = (0,
|
|
6748
|
-
return /* @__PURE__ */ (0,
|
|
7088
|
+
var renderLabel = (0, import_react48.useCallback)(function(label, required) {
|
|
7089
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_antd35.Flex, {
|
|
6749
7090
|
flex: "0 0 auto",
|
|
6750
|
-
children: /* @__PURE__ */ (0,
|
|
7091
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Space, {
|
|
6751
7092
|
children: [
|
|
6752
|
-
required && /* @__PURE__ */ (0,
|
|
7093
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", {
|
|
6753
7094
|
style: {
|
|
6754
7095
|
color: "var(--ant-color-error)"
|
|
6755
7096
|
},
|
|
6756
7097
|
children: "*"
|
|
6757
7098
|
}),
|
|
6758
|
-
/* @__PURE__ */ (0,
|
|
7099
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("span", {
|
|
6759
7100
|
children: [
|
|
6760
7101
|
label,
|
|
6761
7102
|
":"
|
|
@@ -6766,34 +7107,34 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
|
|
|
6766
7107
|
});
|
|
6767
7108
|
}, []);
|
|
6768
7109
|
if (mode === "view") {
|
|
6769
|
-
return /* @__PURE__ */ (0,
|
|
7110
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ScopeViewMode, _object_spread({}, value));
|
|
6770
7111
|
}
|
|
6771
|
-
return /* @__PURE__ */ (0,
|
|
7112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Flex, {
|
|
6772
7113
|
justify: "flex-start",
|
|
6773
7114
|
align: "center",
|
|
6774
7115
|
wrap: "nowrap",
|
|
6775
7116
|
gap: "15px",
|
|
6776
7117
|
children: [
|
|
6777
|
-
/* @__PURE__ */ (0,
|
|
7118
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Flex, {
|
|
6778
7119
|
align: "center",
|
|
6779
7120
|
gap: "5px",
|
|
6780
7121
|
flex: "0 0 auto",
|
|
6781
7122
|
children: [
|
|
6782
7123
|
renderLabel("\u5206\u7C7B", requireLevel >= 1 /* CATEGORY */ ),
|
|
6783
|
-
/* @__PURE__ */ (0,
|
|
7124
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(EffectCategoryCascade, {
|
|
6784
7125
|
onChange: handleCategoryChange,
|
|
6785
7126
|
changeOnSelect: categoryChangeOnSelect,
|
|
6786
7127
|
value: value.categoryIds
|
|
6787
7128
|
})
|
|
6788
7129
|
]
|
|
6789
7130
|
}),
|
|
6790
|
-
lastLevelCategoryId && scopeLevel >= 2 /* BRAND */ && /* @__PURE__ */ (0,
|
|
7131
|
+
lastLevelCategoryId && scopeLevel >= 2 /* BRAND */ && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Flex, {
|
|
6791
7132
|
align: "center",
|
|
6792
7133
|
gap: "5px",
|
|
6793
7134
|
flex: "0 0 auto",
|
|
6794
7135
|
children: [
|
|
6795
7136
|
renderLabel("\u54C1\u724C", requireLevel >= 2 /* BRAND */ ),
|
|
6796
|
-
/* @__PURE__ */ (0,
|
|
7137
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(EffectBrandSelect, _object_spread_props(_object_spread({
|
|
6797
7138
|
categoryId: lastLevelCategoryId
|
|
6798
7139
|
}, value), {
|
|
6799
7140
|
onChange: handleBrandChange,
|
|
@@ -6801,13 +7142,13 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
|
|
|
6801
7142
|
}))
|
|
6802
7143
|
]
|
|
6803
7144
|
}),
|
|
6804
|
-
!!value.brandId && scopeLevel >= 3 /* SERIES */ && /* @__PURE__ */ (0,
|
|
7145
|
+
!!value.brandId && scopeLevel >= 3 /* SERIES */ && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Flex, {
|
|
6805
7146
|
align: "center",
|
|
6806
7147
|
gap: "5px",
|
|
6807
7148
|
flex: "0 0 auto",
|
|
6808
7149
|
children: [
|
|
6809
7150
|
renderLabel("\u7CFB\u5217", requireLevel >= 3 /* SERIES */ ),
|
|
6810
|
-
/* @__PURE__ */ (0,
|
|
7151
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(EffectSeriesSelect, _object_spread_props(_object_spread({
|
|
6811
7152
|
categoryId: lastLevelCategoryId
|
|
6812
7153
|
}, value), {
|
|
6813
7154
|
onChange: handleSeriesChange,
|
|
@@ -6815,13 +7156,13 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
|
|
|
6815
7156
|
}))
|
|
6816
7157
|
]
|
|
6817
7158
|
}),
|
|
6818
|
-
!!value.seriesId && scopeLevel >= 4 /* SPU */ && /* @__PURE__ */ (0,
|
|
7159
|
+
!!value.seriesId && scopeLevel >= 4 /* SPU */ && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Flex, {
|
|
6819
7160
|
align: "center",
|
|
6820
7161
|
gap: "5px",
|
|
6821
7162
|
flex: "0 0 auto",
|
|
6822
7163
|
children: [
|
|
6823
7164
|
renderLabel("SPU", requireLevel >= 4 /* SPU */ ),
|
|
6824
|
-
/* @__PURE__ */ (0,
|
|
7165
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(EffectSpuSelect, _object_spread_props(_object_spread({
|
|
6825
7166
|
categoryId: lastLevelCategoryId
|
|
6826
7167
|
}, value), {
|
|
6827
7168
|
onChange: handleSpuChange,
|
|
@@ -6829,13 +7170,13 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
|
|
|
6829
7170
|
}))
|
|
6830
7171
|
]
|
|
6831
7172
|
}),
|
|
6832
|
-
!!value.spuId && scopeLevel >= 5 /* SKU */ && /* @__PURE__ */ (0,
|
|
7173
|
+
!!value.spuId && scopeLevel >= 5 /* SKU */ && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_antd35.Flex, {
|
|
6833
7174
|
align: "center",
|
|
6834
7175
|
gap: "5px",
|
|
6835
7176
|
flex: "0 0 auto",
|
|
6836
7177
|
children: [
|
|
6837
7178
|
renderLabel("SKU", requireLevel >= 5 /* SKU */ ),
|
|
6838
|
-
/* @__PURE__ */ (0,
|
|
7179
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(EffectSkuSelect, _object_spread_props(_object_spread({
|
|
6839
7180
|
categoryId: lastLevelCategoryId
|
|
6840
7181
|
}, value), {
|
|
6841
7182
|
onChange: handleSkuChange,
|
|
@@ -6847,22 +7188,22 @@ var EffectScopeSelect = (0, import_react47.memo)(function(props) {
|
|
|
6847
7188
|
});
|
|
6848
7189
|
});
|
|
6849
7190
|
// src/EffectStaffSelect/index.tsx
|
|
6850
|
-
var
|
|
6851
|
-
var
|
|
6852
|
-
var
|
|
6853
|
-
var
|
|
7191
|
+
var import_react49 = require("react");
|
|
7192
|
+
var import_react_use18 = require("react-use");
|
|
7193
|
+
var import_classnames14 = __toESM(require("classnames"));
|
|
7194
|
+
var import_antd36 = require("antd");
|
|
6854
7195
|
var import_tools11 = require("@xfe-repo/web-utils/tools");
|
|
6855
7196
|
// src/EffectStaffSelect/index.module.less
|
|
6856
|
-
var
|
|
7197
|
+
var index_module_default19 = {
|
|
6857
7198
|
select: "index_module_select4"
|
|
6858
7199
|
};
|
|
6859
7200
|
// src/EffectStaffSelect/index.tsx
|
|
6860
|
-
var
|
|
6861
|
-
var EffectStaffSelect = (0,
|
|
7201
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
7202
|
+
var EffectStaffSelect = (0, import_react49.memo)(function(props) {
|
|
6862
7203
|
var _state_value_data, _state_value;
|
|
6863
7204
|
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,
|
|
6865
|
-
var _ref1 = _sliced_to_array((0,
|
|
7205
|
+
var _ref = _sliced_to_array((0, import_react49.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
|
|
7206
|
+
var _ref1 = _sliced_to_array((0, import_react49.useState)(controlValue !== null && controlValue !== void 0 ? controlValue : defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
|
|
6866
7207
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
6867
7208
|
var getBusinessOptions = function getBusinessOptions(businessName, currentDeptId) {
|
|
6868
7209
|
return _async_to_generator(function() {
|
|
@@ -6892,14 +7233,14 @@ var EffectStaffSelect = (0, import_react48.memo)(function(props) {
|
|
|
6892
7233
|
});
|
|
6893
7234
|
})();
|
|
6894
7235
|
};
|
|
6895
|
-
var _ref2 = _sliced_to_array((0,
|
|
7236
|
+
var _ref2 = _sliced_to_array((0, import_react_use18.useAsyncFn)(getBusinessOptions, [
|
|
6896
7237
|
deptId,
|
|
6897
7238
|
config
|
|
6898
7239
|
]), 2), state = _ref2[0], searchFetch = _ref2[1];
|
|
6899
|
-
var debounceSearchFetch = (0,
|
|
7240
|
+
var debounceSearchFetch = (0, import_react49.useCallback)((0, import_tools11.debounce)(600, searchFetch), [
|
|
6900
7241
|
searchFetch
|
|
6901
7242
|
]);
|
|
6902
|
-
(0,
|
|
7243
|
+
(0, import_react49.useEffect)(function() {
|
|
6903
7244
|
var _state_value_data, _state_value;
|
|
6904
7245
|
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
7246
|
return;
|
|
@@ -6915,12 +7256,12 @@ var EffectStaffSelect = (0, import_react48.memo)(function(props) {
|
|
|
6915
7256
|
}, [
|
|
6916
7257
|
state
|
|
6917
7258
|
]);
|
|
6918
|
-
(0,
|
|
7259
|
+
(0, import_react_use18.useMount)(function() {
|
|
6919
7260
|
if (deptId) {
|
|
6920
7261
|
void searchFetch("", deptId);
|
|
6921
7262
|
}
|
|
6922
7263
|
});
|
|
6923
|
-
(0,
|
|
7264
|
+
(0, import_react_use18.useUpdateEffect)(function() {
|
|
6924
7265
|
setValue(controlValue);
|
|
6925
7266
|
if (!controlValue && deptId) {
|
|
6926
7267
|
void searchFetch("", deptId);
|
|
@@ -6929,7 +7270,7 @@ var EffectStaffSelect = (0, import_react48.memo)(function(props) {
|
|
|
6929
7270
|
controlValue,
|
|
6930
7271
|
deptId
|
|
6931
7272
|
]);
|
|
6932
|
-
(0,
|
|
7273
|
+
(0, import_react_use18.useUpdateEffect)(function() {
|
|
6933
7274
|
setOptions([]);
|
|
6934
7275
|
if (deptId) {
|
|
6935
7276
|
void searchFetch("", deptId);
|
|
@@ -6954,8 +7295,8 @@ var EffectStaffSelect = (0, import_react48.memo)(function(props) {
|
|
|
6954
7295
|
}
|
|
6955
7296
|
};
|
|
6956
7297
|
var defaultPlaceholder = deptId ? "\u8BF7\u9009\u62E9\u5458\u5DE5\u59D3\u540D" : "\u8BF7\u5148\u8F93\u5165\u5458\u5DE5\u59D3\u540D";
|
|
6957
|
-
return /* @__PURE__ */ (0,
|
|
6958
|
-
className: (0,
|
|
7298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_antd36.Select, {
|
|
7299
|
+
className: (0, import_classnames14.default)(index_module_default19.select, className),
|
|
6959
7300
|
style: style,
|
|
6960
7301
|
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
7302
|
placeholder: placeholder || defaultPlaceholder,
|
|
@@ -6973,15 +7314,15 @@ var EffectStaffSelect = (0, import_react48.memo)(function(props) {
|
|
|
6973
7314
|
});
|
|
6974
7315
|
});
|
|
6975
7316
|
// src/EffectReservoirSelect/EffectReservoirSelect.tsx
|
|
6976
|
-
var
|
|
6977
|
-
var
|
|
6978
|
-
var
|
|
6979
|
-
var
|
|
6980
|
-
var EffectReservoirSelect = (0,
|
|
7317
|
+
var import_react50 = require("react");
|
|
7318
|
+
var import_react_use19 = require("react-use");
|
|
7319
|
+
var import_antd37 = require("antd");
|
|
7320
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
7321
|
+
var EffectReservoirSelect = (0, import_react50.memo)(function(props) {
|
|
6981
7322
|
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,
|
|
6983
|
-
var _ref1 = _sliced_to_array((0,
|
|
6984
|
-
var prevControlValue = (0,
|
|
7323
|
+
var _ref = _sliced_to_array((0, import_react50.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
|
|
7324
|
+
var _ref1 = _sliced_to_array((0, import_react50.useState)(controlValue || defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
|
|
7325
|
+
var prevControlValue = (0, import_react_use19.usePrevious)(controlValue);
|
|
6985
7326
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
6986
7327
|
var get_reservoir_options = function get_reservoir_options() {
|
|
6987
7328
|
return _async_to_generator(function() {
|
|
@@ -7010,10 +7351,10 @@ var EffectReservoirSelect = (0, import_react49.memo)(function(props) {
|
|
|
7010
7351
|
});
|
|
7011
7352
|
})();
|
|
7012
7353
|
};
|
|
7013
|
-
var _ref2 = _sliced_to_array((0,
|
|
7354
|
+
var _ref2 = _sliced_to_array((0, import_react_use19.useAsyncFn)(get_reservoir_options, [
|
|
7014
7355
|
warehouseId
|
|
7015
7356
|
]), 2), state = _ref2[0], fetch = _ref2[1];
|
|
7016
|
-
(0,
|
|
7357
|
+
(0, import_react50.useEffect)(function() {
|
|
7017
7358
|
var _state_value;
|
|
7018
7359
|
if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.data.list)) return;
|
|
7019
7360
|
var options2 = state.value.data.list.map(function(param) {
|
|
@@ -7028,10 +7369,10 @@ var EffectReservoirSelect = (0, import_react49.memo)(function(props) {
|
|
|
7028
7369
|
}, [
|
|
7029
7370
|
state
|
|
7030
7371
|
]);
|
|
7031
|
-
(0,
|
|
7372
|
+
(0, import_react_use19.useMount)(function() {
|
|
7032
7373
|
return void fetch();
|
|
7033
7374
|
});
|
|
7034
|
-
(0,
|
|
7375
|
+
(0, import_react_use19.useUpdateEffect)(function() {
|
|
7035
7376
|
if (controlValue && controlValue === prevControlValue) {
|
|
7036
7377
|
setValue(void 0);
|
|
7037
7378
|
onChange === null || onChange === void 0 ? void 0 : onChange();
|
|
@@ -7040,7 +7381,7 @@ var EffectReservoirSelect = (0, import_react49.memo)(function(props) {
|
|
|
7040
7381
|
}, [
|
|
7041
7382
|
warehouseId
|
|
7042
7383
|
]);
|
|
7043
|
-
(0,
|
|
7384
|
+
(0, import_react_use19.useUpdateEffect)(function() {
|
|
7044
7385
|
if (value === controlValue) return;
|
|
7045
7386
|
setValue(controlValue);
|
|
7046
7387
|
}, [
|
|
@@ -7064,21 +7405,21 @@ var EffectReservoirSelect = (0, import_react49.memo)(function(props) {
|
|
|
7064
7405
|
onChange: handleOnChange,
|
|
7065
7406
|
loading: state.loading
|
|
7066
7407
|
};
|
|
7067
|
-
return /* @__PURE__ */ (0,
|
|
7408
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_antd37.Select, _object_spread({
|
|
7068
7409
|
className: className
|
|
7069
7410
|
}, selectBrandProps));
|
|
7070
7411
|
});
|
|
7071
7412
|
// src/EffectReservoirSelect/EffectShelveSelect.tsx
|
|
7072
|
-
var
|
|
7073
|
-
var
|
|
7074
|
-
var
|
|
7075
|
-
var
|
|
7076
|
-
var EffectShelveSelect = (0,
|
|
7413
|
+
var import_react51 = require("react");
|
|
7414
|
+
var import_react_use20 = require("react-use");
|
|
7415
|
+
var import_antd38 = require("antd");
|
|
7416
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
7417
|
+
var EffectShelveSelect = (0, import_react51.memo)(function(props) {
|
|
7077
7418
|
var onChange = props.onChange, className = props.className, defaultValue = props.defaultValue, controlValue = props.value, disabled = props.disabled, warehouseId = props.warehouseId, reservoirId = props.reservoirId;
|
|
7078
7419
|
var _props_valueType = props.valueType, valueType = _props_valueType === void 0 ? "code" : _props_valueType;
|
|
7079
|
-
var _ref = _sliced_to_array((0,
|
|
7080
|
-
var _ref1 = _sliced_to_array((0,
|
|
7081
|
-
var prevControlValue = (0,
|
|
7420
|
+
var _ref = _sliced_to_array((0, import_react51.useState)([]), 2), options = _ref[0], setOptions = _ref[1];
|
|
7421
|
+
var _ref1 = _sliced_to_array((0, import_react51.useState)(controlValue || defaultValue), 2), value = _ref1[0], setValue = _ref1[1];
|
|
7422
|
+
var prevControlValue = (0, import_react_use20.usePrevious)(controlValue);
|
|
7082
7423
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
7083
7424
|
var get_shelve_options = function get_shelve_options() {
|
|
7084
7425
|
return _async_to_generator(function() {
|
|
@@ -7107,11 +7448,11 @@ var EffectShelveSelect = (0, import_react50.memo)(function(props) {
|
|
|
7107
7448
|
});
|
|
7108
7449
|
})();
|
|
7109
7450
|
};
|
|
7110
|
-
var _ref2 = _sliced_to_array((0,
|
|
7451
|
+
var _ref2 = _sliced_to_array((0, import_react_use20.useAsyncFn)(get_shelve_options, [
|
|
7111
7452
|
reservoirId,
|
|
7112
7453
|
warehouseId
|
|
7113
7454
|
]), 2), state = _ref2[0], fetch = _ref2[1];
|
|
7114
|
-
(0,
|
|
7455
|
+
(0, import_react51.useEffect)(function() {
|
|
7115
7456
|
var _state_value;
|
|
7116
7457
|
if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.data.list)) return;
|
|
7117
7458
|
var options2 = state.value.data.list.map(function(param) {
|
|
@@ -7127,10 +7468,10 @@ var EffectShelveSelect = (0, import_react50.memo)(function(props) {
|
|
|
7127
7468
|
}, [
|
|
7128
7469
|
state
|
|
7129
7470
|
]);
|
|
7130
|
-
(0,
|
|
7471
|
+
(0, import_react_use20.useMount)(function() {
|
|
7131
7472
|
return void fetch();
|
|
7132
7473
|
});
|
|
7133
|
-
(0,
|
|
7474
|
+
(0, import_react_use20.useUpdateEffect)(function() {
|
|
7134
7475
|
if (controlValue && controlValue === prevControlValue) {
|
|
7135
7476
|
setValue(void 0);
|
|
7136
7477
|
onChange === null || onChange === void 0 ? void 0 : onChange();
|
|
@@ -7140,7 +7481,7 @@ var EffectShelveSelect = (0, import_react50.memo)(function(props) {
|
|
|
7140
7481
|
reservoirId,
|
|
7141
7482
|
warehouseId
|
|
7142
7483
|
]);
|
|
7143
|
-
(0,
|
|
7484
|
+
(0, import_react_use20.useUpdateEffect)(function() {
|
|
7144
7485
|
if (value === controlValue) return;
|
|
7145
7486
|
setValue(controlValue);
|
|
7146
7487
|
}, [
|
|
@@ -7164,16 +7505,16 @@ var EffectShelveSelect = (0, import_react50.memo)(function(props) {
|
|
|
7164
7505
|
onChange: handleOnChange,
|
|
7165
7506
|
loading: state.loading
|
|
7166
7507
|
};
|
|
7167
|
-
return /* @__PURE__ */ (0,
|
|
7508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_antd38.Select, _object_spread({
|
|
7168
7509
|
className: className
|
|
7169
7510
|
}, selectBrandProps));
|
|
7170
7511
|
});
|
|
7171
7512
|
// src/EffectWarehouseSelect/index.tsx
|
|
7172
|
-
var
|
|
7173
|
-
var
|
|
7174
|
-
var
|
|
7513
|
+
var import_antd39 = require("antd");
|
|
7514
|
+
var import_classnames15 = __toESM(require("classnames"));
|
|
7515
|
+
var import_react52 = require("react");
|
|
7175
7516
|
// src/EffectWarehouseSelect/useStoreOptions.ts
|
|
7176
|
-
var
|
|
7517
|
+
var import_immutable8 = __toESM(require("swr/immutable"));
|
|
7177
7518
|
var transformStoreData = function transformStoreData() {
|
|
7178
7519
|
var list = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
|
|
7179
7520
|
return list.map(function(item) {
|
|
@@ -7186,7 +7527,7 @@ var transformStoreData = function transformStoreData() {
|
|
|
7186
7527
|
function useStoreOptions() {
|
|
7187
7528
|
var currentMerchantOnly = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true, warehouseType = arguments.length > 1 ? arguments[1] : void 0;
|
|
7188
7529
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
7189
|
-
var _ref = (0,
|
|
7530
|
+
var _ref = (0, import_immutable8.default)([
|
|
7190
7531
|
"warehouse/store/combo-box",
|
|
7191
7532
|
currentMerchantOnly,
|
|
7192
7533
|
warehouseType
|
|
@@ -7230,12 +7571,12 @@ function useStoreOptions() {
|
|
|
7230
7571
|
};
|
|
7231
7572
|
}
|
|
7232
7573
|
// src/EffectWarehouseSelect/index.module.less
|
|
7233
|
-
var
|
|
7574
|
+
var index_module_default20 = {
|
|
7234
7575
|
select: "index_module_select5"
|
|
7235
7576
|
};
|
|
7236
7577
|
// src/EffectWarehouseSelect/index.tsx
|
|
7237
|
-
var
|
|
7238
|
-
var EffectWarehouseSelect = (0,
|
|
7578
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
7579
|
+
var EffectWarehouseSelect = (0, import_react52.memo)(function(props) {
|
|
7239
7580
|
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
7581
|
var state = useStoreOptions(currentMerchantOnly, warehouseType);
|
|
7241
7582
|
var handleChange = function handleChange(selectedValue, option) {
|
|
@@ -7245,8 +7586,8 @@ var EffectWarehouseSelect = (0, import_react51.memo)(function(props) {
|
|
|
7245
7586
|
var handleClear = function handleClear() {
|
|
7246
7587
|
onChange === null || onChange === void 0 ? void 0 : onChange(void 0, void 0);
|
|
7247
7588
|
};
|
|
7248
|
-
return /* @__PURE__ */ (0,
|
|
7249
|
-
className: (0,
|
|
7589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_antd39.Select, {
|
|
7590
|
+
className: (0, import_classnames15.default)(index_module_default20.select, className),
|
|
7250
7591
|
placeholder: "\u8BF7\u9009\u62E9\u4ED3\u5E93",
|
|
7251
7592
|
notFoundContent: state.isLoading ? "\u52A0\u8F7D\u4E2D..." : "\u6682\u65E0\u4ED3\u5E93\u6570\u636E",
|
|
7252
7593
|
loading: state.isLoading,
|
|
@@ -7258,22 +7599,22 @@ var EffectWarehouseSelect = (0, import_react51.memo)(function(props) {
|
|
|
7258
7599
|
});
|
|
7259
7600
|
});
|
|
7260
7601
|
// src/EffectAddressCascade/index.tsx
|
|
7261
|
-
var
|
|
7262
|
-
var
|
|
7263
|
-
var
|
|
7602
|
+
var import_react53 = require("react");
|
|
7603
|
+
var import_react_use21 = require("react-use");
|
|
7604
|
+
var import_classnames16 = __toESM(require("classnames"));
|
|
7264
7605
|
// src/EffectAddressCascade/index.module.less
|
|
7265
|
-
var
|
|
7606
|
+
var index_module_default21 = {
|
|
7266
7607
|
input: "index_module_input7",
|
|
7267
7608
|
select: "index_module_select6"
|
|
7268
7609
|
};
|
|
7269
7610
|
// src/EffectAddressCascade/index.tsx
|
|
7270
|
-
var
|
|
7271
|
-
var
|
|
7272
|
-
var EffectAddressCascade = (0,
|
|
7611
|
+
var import_antd40 = require("antd");
|
|
7612
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
7613
|
+
var EffectAddressCascade = (0, import_react53.memo)(function(props) {
|
|
7273
7614
|
var _selectedList_;
|
|
7274
7615
|
var className = props.className, disabled = props.disabled, defaultValue = props.defaultValue, onChange = props.onChange;
|
|
7275
|
-
var _ref = _sliced_to_array((0,
|
|
7276
|
-
var _ref1 = _sliced_to_array((0,
|
|
7616
|
+
var _ref = _sliced_to_array((0, import_react53.useState)(), 2), selectedList = _ref[0], setSelectedList = _ref[1];
|
|
7617
|
+
var _ref1 = _sliced_to_array((0, import_react53.useState)(), 2), customTree = _ref1[0], setCustomTree = _ref1[1];
|
|
7277
7618
|
var _useRequestConfig = useRequestConfig(), config = _useRequestConfig.config, apiService = _useRequestConfig.apiService;
|
|
7278
7619
|
var params = {
|
|
7279
7620
|
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 +7637,10 @@ var EffectAddressCascade = (0, import_react52.memo)(function(props) {
|
|
|
7296
7637
|
});
|
|
7297
7638
|
})();
|
|
7298
7639
|
};
|
|
7299
|
-
var _ref2 = _sliced_to_array((0,
|
|
7640
|
+
var _ref2 = _sliced_to_array((0, import_react_use21.useAsyncFn)(getAddress, [
|
|
7300
7641
|
selectedList
|
|
7301
7642
|
]), 2), state = _ref2[0], getAddressFetch = _ref2[1];
|
|
7302
|
-
(0,
|
|
7643
|
+
(0, import_react53.useEffect)(function() {
|
|
7303
7644
|
var _state_value;
|
|
7304
7645
|
if (state.loading || !((_state_value = state.value) === null || _state_value === void 0 ? void 0 : _state_value.data.list)) return;
|
|
7305
7646
|
var list = state.value.data.list;
|
|
@@ -7337,7 +7678,7 @@ var EffectAddressCascade = (0, import_react52.memo)(function(props) {
|
|
|
7337
7678
|
}, [
|
|
7338
7679
|
state
|
|
7339
7680
|
]);
|
|
7340
|
-
(0,
|
|
7681
|
+
(0, import_react53.useEffect)(function() {
|
|
7341
7682
|
if (!state.loading || !customTree || !selectedList) return;
|
|
7342
7683
|
var target = findTargetLeaf(selectedList, customTree);
|
|
7343
7684
|
if (!target) return;
|
|
@@ -7346,10 +7687,10 @@ var EffectAddressCascade = (0, import_react52.memo)(function(props) {
|
|
|
7346
7687
|
}, [
|
|
7347
7688
|
state
|
|
7348
7689
|
]);
|
|
7349
|
-
(0,
|
|
7690
|
+
(0, import_react_use21.useMount)(function() {
|
|
7350
7691
|
void getAddressFetch();
|
|
7351
7692
|
});
|
|
7352
|
-
(0,
|
|
7693
|
+
(0, import_react53.useEffect)(function() {
|
|
7353
7694
|
var target = findTargetLeaf(selectedList || [], customTree || []);
|
|
7354
7695
|
if ((target === null || target === void 0 ? void 0 : target.isLeaf) || !(selectedList === null || selectedList === void 0 ? void 0 : selectedList.length)) return;
|
|
7355
7696
|
void getAddressFetch();
|
|
@@ -7365,8 +7706,8 @@ var EffectAddressCascade = (0, import_react52.memo)(function(props) {
|
|
|
7365
7706
|
setSelectedList(_selectedList);
|
|
7366
7707
|
if (onChange) onChange(_selectedList);
|
|
7367
7708
|
};
|
|
7368
|
-
return /* @__PURE__ */ (0,
|
|
7369
|
-
className: (0,
|
|
7709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_antd40.Cascader, {
|
|
7710
|
+
className: (0, import_classnames16.default)(index_module_default21.input, className),
|
|
7370
7711
|
disabled: disabled,
|
|
7371
7712
|
defaultValue: defaultValue,
|
|
7372
7713
|
multiple: false,
|
|
@@ -7399,235 +7740,6 @@ var transformSelectedList = function transformSelectedList(selectedOptions) {
|
|
|
7399
7740
|
};
|
|
7400
7741
|
});
|
|
7401
7742
|
};
|
|
7402
|
-
// 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"));
|
|
7406
|
-
// src/EffectLabelSelect/hooks.ts
|
|
7407
|
-
var import_react_use21 = require("react-use");
|
|
7408
|
-
var useReqData = function useReqData(fn, reqParams, dependency) {
|
|
7409
|
-
var _useRequestConfig = useRequestConfig(), reqConfig = _useRequestConfig.config;
|
|
7410
|
-
var reqDataFn = function reqDataFn() {
|
|
7411
|
-
return _async_to_generator(function() {
|
|
7412
|
-
return _ts_generator(this, function(_state) {
|
|
7413
|
-
switch(_state.label){
|
|
7414
|
-
case 0:
|
|
7415
|
-
return [
|
|
7416
|
-
4,
|
|
7417
|
-
fn === null || fn === void 0 ? void 0 : fn(reqParams, reqConfig)
|
|
7418
|
-
];
|
|
7419
|
-
case 1:
|
|
7420
|
-
return [
|
|
7421
|
-
2,
|
|
7422
|
-
_state.sent()
|
|
7423
|
-
];
|
|
7424
|
-
}
|
|
7425
|
-
});
|
|
7426
|
-
})();
|
|
7427
|
-
};
|
|
7428
|
-
var _ref = _sliced_to_array((0, import_react_use21.useAsyncFn)(reqDataFn, [
|
|
7429
|
-
dependency
|
|
7430
|
-
]), 2), resState = _ref[0], fetchData = _ref[1];
|
|
7431
|
-
(0, import_react_use21.useDebounce)(function() {
|
|
7432
|
-
var shouldFetchData = Object.keys(JSON.parse(dependency || "{}")).length > 0;
|
|
7433
|
-
if (shouldFetchData) {
|
|
7434
|
-
void fetchData();
|
|
7435
|
-
}
|
|
7436
|
-
}, 600, [
|
|
7437
|
-
dependency
|
|
7438
|
-
]);
|
|
7439
|
-
return [
|
|
7440
|
-
resState,
|
|
7441
|
-
fetchData
|
|
7442
|
-
];
|
|
7443
|
-
};
|
|
7444
|
-
// src/EffectLabelSelect/index.module.less
|
|
7445
|
-
var index_module_default21 = {
|
|
7446
|
-
select_wrap: "index_module_select_wrap",
|
|
7447
|
-
select_label: "index_module_select_label",
|
|
7448
|
-
value_select: "index_module_value_select",
|
|
7449
|
-
select: "index_module_select7"
|
|
7450
|
-
};
|
|
7451
|
-
// 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) {
|
|
7455
|
-
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
|
-
var apiService = useRequestConfig().apiService;
|
|
7457
|
-
var _ref = _sliced_to_array((0, import_react53.useState)(function() {
|
|
7458
|
-
var _transformObj2Options_, _transformObj2Options;
|
|
7459
|
-
var defaultLabelFromValue = customLabelInValue ? getSelectValue(value, "labelDicKey") : "";
|
|
7460
|
-
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
|
-
return defaultLabel || defaultLabelFromValue || defaultLabelFromLabelDic || "";
|
|
7462
|
-
}), 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];
|
|
7467
|
-
var fetchDataFn = onFetchData || apiService.merchantList;
|
|
7468
|
-
var fetchDataDeps = _object_spread_props(_object_spread({}, fetchParams), _define_property({}, curSelectLabel, curSearchValue || void 0));
|
|
7469
|
-
var _useReqData = _sliced_to_array(useReqData(fetchDataFn, _object_spread({
|
|
7470
|
-
page: 1,
|
|
7471
|
-
pageSize: 20
|
|
7472
|
-
}, fetchDataDeps), JSON.stringify(fetchDataDeps)), 1), resState = _useReqData[0];
|
|
7473
|
-
(0, import_react53.useEffect)(function() {
|
|
7474
|
-
var _resState_value;
|
|
7475
|
-
if (resState.loading || !((_resState_value = resState.value) === null || _resState_value === void 0 ? void 0 : _resState_value.data.list)) return;
|
|
7476
|
-
var optionsData2 = resState.value.data.list.map(onTransformData);
|
|
7477
|
-
setOptionsData(optionsData2);
|
|
7478
|
-
}, [
|
|
7479
|
-
resState
|
|
7480
|
-
]);
|
|
7481
|
-
(0, import_react_use22.useUpdateEffect)(function() {
|
|
7482
|
-
var changedValue = (curSelectValue !== null && curSelectValue !== void 0 ? curSelectValue : "") === "" ? void 0 : String(curSelectValue);
|
|
7483
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(changedValue, curSelectItem);
|
|
7484
|
-
}, [
|
|
7485
|
-
curSelectValue
|
|
7486
|
-
]);
|
|
7487
|
-
var handleLabelChange = function handleLabelChange(param) {
|
|
7488
|
-
setCurSelectLabel(param);
|
|
7489
|
-
setCurSelectValue(void 0);
|
|
7490
|
-
handleValueClear();
|
|
7491
|
-
};
|
|
7492
|
-
var handleValueChange = function handleValueChange(valueParam, _option) {
|
|
7493
|
-
var option = _option;
|
|
7494
|
-
if (customLabelInValue) {
|
|
7495
|
-
setCurSelectValue(getStrValue("label", option === null || option === void 0 ? void 0 : option.value, option === null || option === void 0 ? void 0 : option.label, curSelectLabel));
|
|
7496
|
-
} else {
|
|
7497
|
-
setCurSelectValue(valueParam);
|
|
7498
|
-
}
|
|
7499
|
-
setCurSelectItem(option);
|
|
7500
|
-
};
|
|
7501
|
-
var handleValueSearch = function handleValueSearch(param) {
|
|
7502
|
-
setCurSearchValue(param);
|
|
7503
|
-
};
|
|
7504
|
-
var handleValueClear = function handleValueClear() {
|
|
7505
|
-
setCurSearchValue(void 0);
|
|
7506
|
-
setCurSelectValue(void 0);
|
|
7507
|
-
setOptionsData([]);
|
|
7508
|
-
};
|
|
7509
|
-
var selectLabelProps = {
|
|
7510
|
-
className: index_module_default21.select_label,
|
|
7511
|
-
disabled: disabled,
|
|
7512
|
-
defaultValue: curSelectLabel,
|
|
7513
|
-
options: transformObj2Options(labelDic),
|
|
7514
|
-
onChange: handleLabelChange,
|
|
7515
|
-
popupMatchSelectWidth: false
|
|
7516
|
-
};
|
|
7517
|
-
var labelText = labelDic[curSelectLabel] || "";
|
|
7518
|
-
var notFoundContent = resState.loading ? "\u641C\u7D22\u4E2D" : curSearchValue ? "输入的".concat(labelText, "未查询到信息") : "请输入".concat(labelText);
|
|
7519
|
-
var mergedValue = customLabelInValue ? getSelectValue(curSelectValue, optionsDisplayType) : curSelectValue;
|
|
7520
|
-
var mergedOptionsData = optionsDisplayType === "labelAndValue" ? optionsData.map(function(item) {
|
|
7521
|
-
return _object_spread_props(_object_spread({}, item), {
|
|
7522
|
-
label: getInitialValue(item.label, item.value)
|
|
7523
|
-
});
|
|
7524
|
-
}) : optionsData;
|
|
7525
|
-
var selectValueProps = {
|
|
7526
|
-
className: (0, import_classnames16.default)(index_module_default21.value_select, className),
|
|
7527
|
-
notFoundContent: notFoundContent,
|
|
7528
|
-
value: mergedValue,
|
|
7529
|
-
options: mergedOptionsData,
|
|
7530
|
-
disabled: disabled,
|
|
7531
|
-
loading: resState.loading,
|
|
7532
|
-
placeholder: "请输入".concat(labelText),
|
|
7533
|
-
onChange: handleValueChange,
|
|
7534
|
-
onSearch: handleValueSearch,
|
|
7535
|
-
onClear: handleValueClear,
|
|
7536
|
-
optionFilterProp: "label",
|
|
7537
|
-
showSearch: true,
|
|
7538
|
-
allowClear: true,
|
|
7539
|
-
defaultActiveFirstOption: false,
|
|
7540
|
-
filterOption: false,
|
|
7541
|
-
popupMatchSelectWidth: false
|
|
7542
|
-
};
|
|
7543
|
-
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_antd40.Space.Compact, {
|
|
7544
|
-
className: index_module_default21.select_wrap,
|
|
7545
|
-
style: style,
|
|
7546
|
-
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))
|
|
7549
|
-
]
|
|
7550
|
-
});
|
|
7551
|
-
});
|
|
7552
|
-
var defaultLabelDic = {
|
|
7553
|
-
businessNo: "\u5546\u6237\u53F7",
|
|
7554
|
-
name: "\u5546\u6237\u540D"
|
|
7555
|
-
};
|
|
7556
|
-
var defaultTransformDataFn = function defaultTransformDataFn(_0) {
|
|
7557
|
-
var name = _0.name, enterpriseNo = _0.enterpriseNo, otherParams = _object_without_properties(_0, [
|
|
7558
|
-
"name",
|
|
7559
|
-
"enterpriseNo"
|
|
7560
|
-
]);
|
|
7561
|
-
return {
|
|
7562
|
-
label: name,
|
|
7563
|
-
value: enterpriseNo,
|
|
7564
|
-
customFields: otherParams
|
|
7565
|
-
};
|
|
7566
|
-
};
|
|
7567
|
-
var transformObj2Options = function transformObj2Options(obj) {
|
|
7568
|
-
var options = [];
|
|
7569
|
-
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
7570
|
-
try {
|
|
7571
|
-
for(var _iterator = Object.entries(obj)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
7572
|
-
var _step_value = _sliced_to_array(_step.value, 2), value = _step_value[0], key = _step_value[1];
|
|
7573
|
-
options.push({
|
|
7574
|
-
value: value,
|
|
7575
|
-
label: key
|
|
7576
|
-
});
|
|
7577
|
-
}
|
|
7578
|
-
} catch (err) {
|
|
7579
|
-
_didIteratorError = true;
|
|
7580
|
-
_iteratorError = err;
|
|
7581
|
-
} finally{
|
|
7582
|
-
try {
|
|
7583
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
7584
|
-
_iterator.return();
|
|
7585
|
-
}
|
|
7586
|
-
} finally{
|
|
7587
|
-
if (_didIteratorError) {
|
|
7588
|
-
throw _iteratorError;
|
|
7589
|
-
}
|
|
7590
|
-
}
|
|
7591
|
-
}
|
|
7592
|
-
return options;
|
|
7593
|
-
};
|
|
7594
|
-
var getStrValue = function getStrValue(displayType) {
|
|
7595
|
-
var value = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "", label = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "", labelDicKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
|
|
7596
|
-
if (!value) {
|
|
7597
|
-
return void 0;
|
|
7598
|
-
}
|
|
7599
|
-
return "".concat(displayType, ";").concat(value, ";").concat(label, ";").concat(labelDicKey);
|
|
7600
|
-
};
|
|
7601
|
-
var getSelectValue = function getSelectValue(str, returnType) {
|
|
7602
|
-
if (str === "null" || typeof str === "undefined") {
|
|
7603
|
-
return void 0;
|
|
7604
|
-
}
|
|
7605
|
-
var _String_split = _sliced_to_array(String(str).split(";"), 4), displayType = _String_split[0], value = _String_split[1], label = _String_split[2], labelDicKey = _String_split[3];
|
|
7606
|
-
if (returnType === "labelAndValue") {
|
|
7607
|
-
return (label === null || label === void 0 ? void 0 : label.includes("-")) ? label : getInitialValue(label, value);
|
|
7608
|
-
} else if (returnType === "labelDicKey") {
|
|
7609
|
-
return labelDicKey;
|
|
7610
|
-
} else if (returnType === "value" || displayType === "value") {
|
|
7611
|
-
return value;
|
|
7612
|
-
} else if (returnType === "label" || displayType === "label") {
|
|
7613
|
-
return label;
|
|
7614
|
-
}
|
|
7615
|
-
return void 0;
|
|
7616
|
-
};
|
|
7617
|
-
var getInitialValue = function getInitialValue() {
|
|
7618
|
-
var label = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", value = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
7619
|
-
return label && value ? "".concat(value, " - ").concat(label) : value;
|
|
7620
|
-
};
|
|
7621
|
-
var getFirstValue = function getFirstValue() {
|
|
7622
|
-
var str = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
7623
|
-
var _str_split_, _str_split;
|
|
7624
|
-
return str === null || str === void 0 ? void 0 : (_str_split = str.split("-")) === null || _str_split === void 0 ? void 0 : (_str_split_ = _str_split[0]) === null || _str_split_ === void 0 ? void 0 : _str_split_.trim();
|
|
7625
|
-
};
|
|
7626
|
-
var getSecondValue = function getSecondValue() {
|
|
7627
|
-
var str = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
7628
|
-
var _this;
|
|
7629
|
-
return (_this = (str === null || str === void 0 ? void 0 : str.includes("-")) ? str.split("-")[1] : str) === null || _this === void 0 ? void 0 : _this.trim();
|
|
7630
|
-
};
|
|
7631
7743
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7632
7744
|
0 && (module.exports = {
|
|
7633
7745
|
CInput: CInput,
|
|
@@ -7644,10 +7756,10 @@ var getSecondValue = function getSecondValue() {
|
|
|
7644
7756
|
EffectBrandTransfer: EffectBrandTransfer,
|
|
7645
7757
|
EffectCategoryCascade: EffectCategoryCascade,
|
|
7646
7758
|
EffectFileUpload: EffectFileUpload,
|
|
7647
|
-
EffectLabelSelect: EffectLabelSelect,
|
|
7648
7759
|
EffectMerchantSelect: EffectMerchantSelect,
|
|
7649
7760
|
EffectReservoirSelect: EffectReservoirSelect,
|
|
7650
7761
|
EffectScopeSelect: EffectScopeSelect,
|
|
7762
|
+
EffectSearchSelect: EffectSearchSelect,
|
|
7651
7763
|
EffectSeriesSelect: EffectSeriesSelect,
|
|
7652
7764
|
EffectSeriesSelectV2: EffectSeriesSelectV2,
|
|
7653
7765
|
EffectShelveSelect: EffectShelveSelect,
|
|
@@ -7684,17 +7796,13 @@ var getSecondValue = function getSecondValue() {
|
|
|
7684
7796
|
commonStatusSelectOptions: commonStatusSelectOptions,
|
|
7685
7797
|
commonYesOrNoSelectOptions: commonYesOrNoSelectOptions,
|
|
7686
7798
|
commonYesOrNoSelectOptionsMap: commonYesOrNoSelectOptionsMap,
|
|
7799
|
+
defaultMerchantSearchSources: defaultMerchantSearchSources,
|
|
7687
7800
|
formatClock: formatClock,
|
|
7688
7801
|
formatDate: formatDate,
|
|
7689
7802
|
getCTable: getCTable,
|
|
7690
7803
|
getCommonSelectProps: getCommonSelectProps,
|
|
7691
7804
|
getCommonTableProps: getCommonTableProps,
|
|
7692
|
-
getFirstValue: getFirstValue,
|
|
7693
|
-
getInitialValue: getInitialValue,
|
|
7694
7805
|
getNumberValue: getNumberValue,
|
|
7695
|
-
getSecondValue: getSecondValue,
|
|
7696
|
-
getSelectValue: getSelectValue,
|
|
7697
|
-
getStrValue: getStrValue,
|
|
7698
7806
|
isSingleTreeSelected: isSingleTreeSelected,
|
|
7699
7807
|
replaceRgbWithHex: replaceRgbWithHex,
|
|
7700
7808
|
saasApiService: saasApiService,
|