@bit-sun/business-component 2.0.1 → 2.0.4

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
@@ -1932,6 +1932,19 @@ var CaretLeftOutlined$1 = function CaretLeftOutlined$1(props, ref) {
1932
1932
  CaretLeftOutlined$1.displayName = 'CaretLeftOutlined';
1933
1933
  var CaretLeftOutlined$2 = /*#__PURE__*/React.forwardRef(CaretLeftOutlined$1);
1934
1934
 
1935
+ // This icon file is generated automatically.
1936
+ var CloseCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z" } }, { "tag": "path", "attrs": { "d": "M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "close-circle", "theme": "outlined" };
1937
+
1938
+ var CloseCircleOutlined$1 = function CloseCircleOutlined$1(props, ref) {
1939
+ return /*#__PURE__*/React.createElement(Icon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
1940
+ ref: ref,
1941
+ icon: CloseCircleOutlined
1942
+ }));
1943
+ };
1944
+
1945
+ CloseCircleOutlined$1.displayName = 'CloseCircleOutlined';
1946
+ var CloseCircleOutlined$2 = /*#__PURE__*/React.forwardRef(CloseCircleOutlined$1);
1947
+
1935
1948
  // This icon file is generated automatically.
1936
1949
  var CopyOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z" } }] }, "name": "copy", "theme": "outlined" };
1937
1950
 
@@ -2361,16 +2374,26 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
2361
2374
  var _this$props = _this.props,
2362
2375
  validDataUrl = _this$props.validDataUrl,
2363
2376
  updateData = _this$props.updateData,
2364
- columns = _this$props.columns;
2377
+ columns = _this$props.columns,
2378
+ isBrandAuth = _this$props.isBrandAuth;
2365
2379
 
2366
2380
  var resultData = _this.getData().filter(function (d) {
2367
2381
  return ___default['default'].compact(Object.values(d)).length;
2368
- });
2382
+ }); // 处理业务参数
2369
2383
 
2370
- axios__default['default'].post(validDataUrl, {
2384
+
2385
+ var otherParams = {};
2386
+
2387
+ if (isBrandAuth) {
2388
+ otherParams = {
2389
+ brandAuth: 'ctl-withAuth'
2390
+ };
2391
+ }
2392
+
2393
+ axios__default['default'].post(validDataUrl, _objectSpread2(_objectSpread2({}, otherParams), {}, {
2371
2394
  columns: columns,
2372
2395
  data: resultData
2373
- }).then(function (result) {
2396
+ })).then(function (result) {
2374
2397
  result = result.data;
2375
2398
 
2376
2399
  if (result.status !== '0') {
@@ -2960,7 +2983,6 @@ var DataImport = /*#__PURE__*/function (_React$Component) {
2960
2983
  console.time();
2961
2984
  var sheetData = luckysheet$1.getSheetData();
2962
2985
  var data = JSON.parse(JSON.stringify(sheetData)).filter(function (item) {
2963
- debugger;
2964
2986
  return item[0];
2965
2987
  }).map(function (item) {
2966
2988
  var obj = {};
@@ -4384,88 +4406,8 @@ var SearchSelect = function SearchSelect(props) {
4384
4406
  }), " \u5168\u9009\u6240\u6709\u9875\u9762") : '')))));
4385
4407
  };
4386
4408
 
4387
- var shopFileType = [{
4388
- text: "线上",
4389
- value: 'online'
4390
- }, {
4391
- text: "线下",
4392
- value: 'offline'
4393
- }];
4394
- var shopFile2Type = [{
4395
- text: "第三方线上",
4396
- value: 'online'
4397
- }, {
4398
- text: "线下",
4399
- value: 'offline'
4400
- }, {
4401
- text: "自营B2B",
4402
- value: 'B2B'
4403
- }, {
4404
- text: "自营B2C",
4405
- value: 'B2C'
4406
- }];
4407
- var arrivalPaySupportList = [{
4408
- text: "支持",
4409
- value: 1
4410
- }, {
4411
- text: "不支持",
4412
- value: 0
4413
- }];
4414
- var sharingType = [{
4415
- text: "共享",
4416
- value: '10'
4417
- }, {
4418
- text: "私有",
4419
- value: '20'
4420
- }];
4421
-
4422
- var getDicData = function getDicData(dicCode) {
4423
- var dicData = {};
4424
-
4425
- {
4426
- var storageDic = localStorage.getItem('dicData') ? JSON.parse(localStorage.getItem('dicData') || '{}') : {};
4427
- dicData = storageDic[dicCode];
4428
- } // @ts-ignore
4429
-
4430
-
4431
- if (!dicData || !dicData.length) ;
4432
-
4433
- return dicData;
4434
- };
4435
-
4436
- var getDictionarySource = function getDictionarySource(dicCode) {
4437
- var needConvertInterger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4438
- var dicData = getDicData(dicCode);
4439
-
4440
- try {
4441
- if (needConvertInterger) {
4442
- // @ts-ignore
4443
- dicData = dicData.map(function (item) {
4444
- return _objectSpread2(_objectSpread2({}, item), {}, {
4445
- value: parseFloat(item.value)
4446
- });
4447
- });
4448
- }
4449
- } catch (e) {}
4450
-
4451
- return dicData;
4452
- };
4453
-
4454
- var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value) {
4455
- var dicData = getDicData(dicCode);
4456
- if (value === undefined) return ''; // @ts-ignore
4457
-
4458
- var dicItemArray = dicData === null || dicData === void 0 ? void 0 : dicData.filter(function (item) {
4459
- return item.value === value.toString();
4460
- });
4461
-
4462
- if (!(dicItemArray === null || dicItemArray === void 0 ? void 0 : dicItemArray.length)) {
4463
- // throw new Error(`当前${dicCode}字典值合没有${value}的数据`)
4464
- return value;
4465
- }
4466
-
4467
- return dicItemArray[0].text;
4468
- };
4409
+ var css_248z$4 = ".add_select_show {\n display: flex;\n}\n.add_select_expand_button {\n position: relative;\n width: 30px;\n color: #ffffff;\n cursor: pointer;\n}\n.add_select_expand_button span {\n position: absolute;\n height: 20px;\n line-height: 14px;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.add_select_header {\n border-bottom: 1px solid #D9D9D9;\n height: 24px;\n height: 40px;\n font-family: PingFangSC-Medium;\n font-weight: 500;\n font-size: 18px;\n color: #000000;\n letter-spacing: 0;\n line-height: 40px;\n margin-bottom: 10px;\n padding-left: 10px;\n}\n.add_select_header > span {\n margin-left: 20px;\n font-weight: 400;\n font-size: 12px;\n color: #666666;\n letter-spacing: 0;\n line-height: 40px;\n}\n.add_select_header > span > span {\n color: #ff0000;\n}\n.add_select_header_close span {\n position: absolute;\n color: black !important;\n right: 10px;\n top: 10px;\n}\n.add_select_wrapper {\n position: relative;\n display: flex;\n max-height: 60vh;\n overflow: hidden;\n font-size: 14px;\n margin: 5px 10px;\n}\n.add_select_wrapper .ant-table-pagination.ant-pagination {\n margin: 5px;\n padding-right: 5px;\n}\n.add_select_wrapper .ant-checkbox-wrapper {\n justify-content: center;\n}\n.add_select_wrapper .ant-form-item-label {\n padding: 0PX;\n line-height: 23px !important;\n}\n.add_select_wrapper .ant-form-item-label > label {\n font-size: 12px;\n}\n.add_select_wrapper .ant-table-thead th {\n height: 20px !important;\n padding: 0px 8px !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n line-height: 20px !important;\n}\n.add_select_wrapper .ant-modal-body {\n padding: 10px;\n}\n.add_select_wrapper .ant-table-wrapper {\n padding: 0px !important;\n}\n.add_select_wrapper .row-class {\n height: 24px;\n}\n.add_select_wrapper .row-class td {\n font-size: 12px !important;\n height: 24px !important;\n padding: 0px 8px !important;\n line-height: 20px !important;\n}\n.add_select_wrapper .ant-table-body {\n height: 240px;\n overflow-y: auto !important;\n}\n.add_select_wrapper .ant-row.ant-form-item {\n margin-bottom: 10px;\n}\n.add_select_wrapper_click_flag {\n position: absolute;\n z-index: 10;\n}\n.add_select_wrapper_click_flag_arrow {\n transform: rotate(0deg);\n transition: transform 0.5s;\n}\n.add_select_wrapper_click_flag_arrow_1 {\n transform: rotate(-180deg);\n transition: transform 0.5s;\n}\n.add_select_wrapper_left {\n flex-basis: 298px;\n width: 298px;\n overflow-y: hidden;\n transition: all 0.3s;\n margin-right: 10px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n}\n.add_select_wrapper_left1 {\n width: 0;\n height: 0;\n transition: all 0.3s;\n display: none;\n}\n.add_select_wrapper_right {\n width: 872px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n}\n.add_select_wrapper_right1 {\n width: 100%;\n margin-left: 10px;\n}\n.add_select_wrapper_right,\n.add_select_wrapper_right1 {\n overflow-x: auto;\n}\n.add_select_wrapper .select_list_columns {\n height: 272px;\n overflow-y: auto;\n border-bottom: 1px solid #D9D9D9;\n}\n.add_select_wrapper .select_list_columns_tips {\n background: #eee;\n padding: 6px 20px;\n margin-bottom: 10px;\n}\n.add_select_wrapper .select_list_columns_formItems {\n padding: 7px 10px;\n}\n.add_select_wrapper .select_list_searchButton {\n display: flex;\n margin: 10px;\n justify-content: flex-end;\n}\n.add_select_wrapper .select_list_button_space {\n margin-right: 10px;\n}\n.add_select_wrapper .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 24px;\n font-size: 12px;\n line-height: 24px;\n background: #F7F8FB;\n padding: 0 5px;\n border-bottom: 1px solid #D9D9D9;\n}\n.add_select_wrapper .select_list_selectAll {\n position: relative;\n top: -40px;\n left: 20px;\n width: 160px;\n}\n.add_select_wrapper_select {\n margin-top: 4px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n margin: 5px 10px;\n}\n.add_select_wrapper_select .ant-table-pagination.ant-pagination {\n margin: 9px;\n padding-right: 5px;\n}\n.add_select_wrapper_select .ant-modal-body {\n padding: 10px;\n}\n.add_select_wrapper_select .ant-table-wrapper {\n padding: 0px !important;\n}\n.add_select_wrapper_select .ant-table-thead th {\n height: 23px !important;\n padding: 0px 8px !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n line-height: 23px !important;\n}\n.add_select_wrapper_select .ant-modal-close-x {\n height: 30px;\n}\n.add_select_wrapper_select .row-class {\n height: 30px;\n}\n.add_select_wrapper_select .row-class td {\n font-size: 12px !important;\n height: 30px !important;\n padding: 4px 8px !important;\n}\n.add_select_wrapper_select .ant-table-body {\n height: 200px;\n overflow-y: auto !important;\n}\n.add_select_wrapper_select .ant-row.ant-form-item {\n margin-bottom: 10px;\n}\n.add_select_wrapper_select .ant-input-number-input {\n height: auto;\n}\n.add_select_wrapper_select .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 24px;\n font-size: 12px;\n line-height: 24px;\n background: #F7F8FB;\n padding: 0 3px;\n border-bottom: 1px solid #D9D9D9;\n}\n";
4410
+ styleInject(css_248z$4);
4469
4411
 
4470
4412
  var loadSelectSource = function loadSelectSource(url, params) {
4471
4413
  return new Promise(function (resolve, reject) {
@@ -4486,123 +4428,1243 @@ var loadSelectSource = function loadSelectSource(url, params) {
4486
4428
  });
4487
4429
  };
4488
4430
 
4489
- var handleDefaultPrefixUrl = function handleDefaultPrefixUrl(type) {
4490
- var result;
4491
-
4492
- switch (type) {
4493
- case 'supplier2':
4494
- case 'customer2':
4495
- case 'shopFile2':
4496
- result = '/channel-manage';
4497
- break;
4498
-
4499
- case 'skuCommodity':
4500
- case 'skuPropertyValue':
4501
- case 'spuCommodity':
4502
- result = '/items';
4503
- break;
4431
+ var formatSource = function formatSource(reData, position, changePosition, changeSearchForm) {
4432
+ var _reData$position;
4504
4433
 
4505
- case 'physicalWarehouse':
4506
- case 'realWarehouse':
4507
- case 'virtualWarehouse':
4508
- case 'channelWarehouse':
4509
- result = '/stock';
4510
- break;
4434
+ var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['code', 'name'];
4435
+ var data = reData && ((_reData$position = reData[position]) === null || _reData$position === void 0 ? void 0 : _reData$position.data);
4436
+ var list = Array.isArray(data) ? data : (data === null || data === void 0 ? void 0 : data.items) || (data === null || data === void 0 ? void 0 : data.list) || (data === null || data === void 0 ? void 0 : data.children) || [];
4437
+ var formatData = (list === null || list === void 0 ? void 0 : list.length) ? list.map(function (v) {
4438
+ return {
4439
+ text: v[resKeyValue[1]],
4440
+ value: v[resKeyValue[0]]
4441
+ };
4442
+ }) : [];
4443
+ changeSearchForm[changePosition] = _objectSpread2(_objectSpread2({}, changeSearchForm[changePosition]), {}, {
4444
+ initialSource: formatData
4445
+ });
4446
+ }; // 格式化树选择器数据源
4511
4447
 
4512
- case 'inventoryOrg2':
4513
- case 'purchaseOrg':
4514
- case 'salesOrg':
4515
- case 'employee2':
4516
- result = '/user';
4517
- break;
4518
4448
 
4519
- case 'deliveryMode':
4520
- result = '/basic';
4521
- break;
4449
+ var mapSearchTree = function mapSearchTree(treeDataItem, resKeyValue) {
4450
+ var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
4451
+ return {
4452
+ title: treeDataItem[resKeyValue[1]],
4453
+ value: treeDataItem[resKeyValue[0]],
4454
+ parentId: treeDataItem.parent,
4455
+ data: _objectSpread2({}, treeDataItem),
4456
+ isLeaf: !haveChildren,
4457
+ disabled: haveChildren,
4458
+ children: haveChildren ? treeDataItem.children.map(function (i) {
4459
+ return mapSearchTree(i, resKeyValue);
4460
+ }) : []
4461
+ };
4462
+ };
4522
4463
 
4523
- default:
4524
- result = '/bop/api';
4525
- break;
4526
- }
4464
+ var formatTreeDataSource = function formatTreeDataSource(reData, position, changePosition, changeSearchForm) {
4465
+ var _reData$position2;
4527
4466
 
4528
- return result;
4467
+ var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['id', 'name'];
4468
+ var data = reData && ((_reData$position2 = reData[position]) === null || _reData$position2 === void 0 ? void 0 : _reData$position2.data);
4469
+ var formatData = data && Array.isArray(data) && data.length && data.map(function (ites) {
4470
+ return mapSearchTree(ites, resKeyValue);
4471
+ }) || [];
4472
+ changeSearchForm[changePosition].field.props.treeData = formatData;
4529
4473
  };
4530
4474
 
4531
- var _getDictionarySource;
4532
- var hasDictSharingType = (_getDictionarySource = getDictionarySource('UC000013')) === null || _getDictionarySource === void 0 ? void 0 : _getDictionarySource.length;
4533
- var sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType;
4534
- function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4535
- // 默认type === 'supplier' 供应商选择器
4536
- var requestConfig = _objectSpread2({
4537
- url: "".concat(prefixUrl.selectPrefix, "/supplier"),
4538
- filter: 'qp-name,code-orGroup,like',
4539
- otherParams: {
4540
- sorter: 'desc-id'
4541
- }
4542
- }, requestConfigProp);
4543
- /*
4544
- * 处理 格式化下拉框数据源
4545
- * reData 必传 promise返回响应的数据 格式为[{},{},{},...] Promise.all第一个参数数组有多少个数组长度就是多少,其中每个对象为每次请求的结果数据
4546
- * 每个结果数据格式为{ status: '0', msg: 'success', data: { items: [], total: 1, size: 1, page: 1 }, traceId: 'baba..'}
4547
- * position 必传 为获取Promise.all请求结果的位置
4548
- * changePosition 必传 为搜索表单Form中需要更改数据源的Item项的位置
4549
- * changeSearchForm 必传 为搜索表单Form数据
4550
- * */
4475
+ var Option$1 = antd.Select.Option;
4551
4476
 
4477
+ var AddSelect = function AddSelect(props) {
4478
+ var value = props.value,
4479
+ onChange = props.onChange,
4480
+ _props$selectProps = props.selectProps,
4481
+ selectProps = _props$selectProps === void 0 ? {} : _props$selectProps,
4482
+ _props$modalTableProp = props.modalTableProps,
4483
+ modalTableProps = _props$modalTableProp === void 0 ? {} : _props$modalTableProp,
4484
+ _props$labelInValue = props.labelInValue,
4485
+ labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
4486
+ requestConfig = props.requestConfig,
4487
+ ctx = props.ctx,
4488
+ sourceName = props.sourceName,
4489
+ _props$needModalTable = props.needModalTable,
4490
+ needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
4491
+ _props$getPopupContai = props.getPopupContainer,
4492
+ onSaveCallback = props.onSaveCallback,
4493
+ _props$buttonText = props.buttonText,
4494
+ buttonText = _props$buttonText === void 0 ? '添加' : _props$buttonText,
4495
+ beforeShowModal = props.beforeShowModal;
4552
4496
 
4553
- var formatSource = function formatSource(reData, position, changePosition, changeSearchForm) {
4554
- var _reData$position;
4497
+ var _ref = requestConfig || {},
4498
+ url = _ref.url,
4499
+ otherParams = _ref.otherParams,
4500
+ isMap = _ref.isMap,
4501
+ fixedparameter = _ref.fixedparameter,
4502
+ fieldValToParam = _ref.fieldValToParam,
4503
+ _ref$mappingTextField = _ref.mappingTextField,
4504
+ mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
4505
+ mappingTextShowKeyField = _ref.mappingTextShowKeyField,
4506
+ _ref$mappingValueFiel = _ref.mappingValueField,
4507
+ mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel,
4508
+ mappingTextShowTextField = _ref.mappingTextShowTextField;
4555
4509
 
4556
- var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['code', 'name'];
4557
- var data = reData && ((_reData$position = reData[position]) === null || _reData$position === void 0 ? void 0 : _reData$position.data);
4558
- var list = Array.isArray(data) ? data : (data === null || data === void 0 ? void 0 : data.items) || (data === null || data === void 0 ? void 0 : data.list) || (data === null || data === void 0 ? void 0 : data.children) || [];
4559
- var formatData = (list === null || list === void 0 ? void 0 : list.length) ? list.map(function (v) {
4560
- return {
4561
- text: v[resKeyValue[1]],
4562
- value: v[resKeyValue[0]]
4563
- };
4564
- }) : [];
4565
- changeSearchForm[changePosition] = _objectSpread2(_objectSpread2({}, changeSearchForm[changePosition]), {}, {
4566
- initialSource: formatData
4567
- });
4568
- }; // 格式化树选择器数据源
4510
+ var resultSourceKey = sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || 'supplierCode';
4511
+ var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
4569
4512
 
4513
+ var initVal = value || (selectMode ? [] : null);
4514
+ var pageSize = 100; // 下拉框默认分页 条数
4570
4515
 
4571
- var mapSearchTree = function mapSearchTree(treeDataItem, resKeyValue) {
4572
- var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
4573
- return {
4574
- title: treeDataItem[resKeyValue[1]],
4575
- value: treeDataItem[resKeyValue[0]],
4576
- parentId: treeDataItem.parent,
4577
- data: _objectSpread2({}, treeDataItem),
4578
- isLeaf: !haveChildren,
4579
- disabled: haveChildren,
4580
- children: haveChildren ? treeDataItem.children.map(function (i) {
4581
- return mapSearchTree(i, resKeyValue);
4582
- }) : []
4583
- };
4584
- };
4516
+ var tableInitPageSize = 10; // 弹框默认分页 条数
4585
4517
 
4586
- var formatTreeDataSource = function formatTreeDataSource(reData, position, changePosition, changeSearchForm) {
4587
- var _reData$position2;
4518
+ var currentPage = 1;
4519
+ var selectParamsKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filter) || 'qp-codeAndName-like';
4520
+ var selectParamsInitKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filterInit) || selectParamsKey;
4588
4521
 
4589
- var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['id', 'name'];
4590
- var data = reData && ((_reData$position2 = reData[position]) === null || _reData$position2 === void 0 ? void 0 : _reData$position2.data);
4591
- var formatData = data && Array.isArray(data) && data.length && data.map(function (ites) {
4592
- return mapSearchTree(ites, resKeyValue);
4593
- }) || [];
4594
- changeSearchForm[changePosition].field.props.treeData = formatData;
4595
- };
4522
+ var currentSelectProps = _objectSpread2(_objectSpread2({}, selectProps), {}, {
4523
+ // 以下属性不可更改----设计配置项
4524
+ showSearch: false,
4525
+ filterOption: false,
4526
+ allowClear: true,
4527
+ listHeight: 160,
4528
+ optionLabelProp: "label",
4529
+ autoClearSearchValue: false
4530
+ });
4596
4531
 
4597
- var tableSearchForm = [];
4532
+ var _useState = React.useState([]),
4533
+ _useState2 = _slicedToArray(_useState, 2),
4534
+ items = _useState2[0],
4535
+ setItems = _useState2[1];
4598
4536
 
4599
- var modalTableProps = _objectSpread2({
4600
- modalTableTitle: '',
4601
- tableSearchForm: tableSearchForm,
4602
- tableColumns: []
4603
- }, modalTableBusProps);
4537
+ var _useState3 = React.useState(1),
4538
+ _useState4 = _slicedToArray(_useState3, 2),
4539
+ scrollPage = _useState4[0],
4540
+ setScrollPage = _useState4[1];
4604
4541
 
4605
- var needModalTable = (modalTableBusProps === null || modalTableBusProps === void 0 ? void 0 : modalTableBusProps.needModalTable) !== undefined ? modalTableBusProps === null || modalTableBusProps === void 0 ? void 0 : modalTableBusProps.needModalTable : true; // 供应商选择器
4542
+ var _useState5 = React.useState(0),
4543
+ _useState6 = _slicedToArray(_useState5, 2),
4544
+ itemsTotal = _useState6[0],
4545
+ setItemsTotal = _useState6[1];
4546
+
4547
+ var _useState7 = React.useState(false),
4548
+ _useState8 = _slicedToArray(_useState7, 2),
4549
+ fetching = _useState8[0],
4550
+ setFetching = _useState8[1];
4551
+
4552
+ var _useState9 = React.useState(''),
4553
+ _useState10 = _slicedToArray(_useState9, 2),
4554
+ searchValue = _useState10[0],
4555
+ setSearchValue = _useState10[1];
4556
+
4557
+ var _useState11 = React.useState(false),
4558
+ _useState12 = _slicedToArray(_useState11, 2),
4559
+ isModalVisible = _useState12[0],
4560
+ setIsModalVisible = _useState12[1];
4561
+
4562
+ var _useState13 = React.useState(initVal),
4563
+ _useState14 = _slicedToArray(_useState13, 2),
4564
+ popvalue = _useState14[0],
4565
+ setPopValue = _useState14[1];
4566
+
4567
+ var _useState15 = React.useState(sourceName),
4568
+ _useState16 = _slicedToArray(_useState15, 2),
4569
+ uniqueValue = _useState16[0],
4570
+ setUniqueValue = _useState16[1];
4571
+
4572
+ var _useDebounceFn = ahooks.useDebounceFn(function (v) {
4573
+ // 优化搜索参数 支持传多个
4574
+ var searchParams = {};
4575
+
4576
+ if (typeof selectParamsKey === 'string') {
4577
+ searchParams = v ? _defineProperty({}, selectParamsInitKey, initVal) : _defineProperty({}, selectParamsKey, searchValue);
4578
+ }
4579
+
4580
+ if (Array.isArray(selectParamsKey)) {
4581
+ selectParamsKey.forEach(function (i) {
4582
+ searchParams = _objectSpread2(_objectSpread2({}, searchParams), {}, _defineProperty({}, i, searchValue));
4583
+ });
4584
+ } // 防抖函数 待定
4585
+
4586
+
4587
+ getData(searchParams);
4588
+ }, {
4589
+ wait: 1000
4590
+ }),
4591
+ run = _useDebounceFn.run;
4592
+
4593
+ var _Form$useForm = antd.Form.useForm(),
4594
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
4595
+ form = _Form$useForm2[0];
4596
+
4597
+ var _useState17 = React.useState(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm),
4598
+ _useState18 = _slicedToArray(_useState17, 2),
4599
+ tableSearchForm = _useState18[0],
4600
+ setTableSearchForm = _useState18[1];
4601
+
4602
+ var _useState19 = React.useState(true),
4603
+ _useState20 = _slicedToArray(_useState19, 2),
4604
+ caretLeftFlag = _useState20[0],
4605
+ setCaretLeftFlag = _useState20[1];
4606
+
4607
+ var _useState21 = React.useState([]),
4608
+ _useState22 = _slicedToArray(_useState21, 2),
4609
+ tableData = _useState22[0],
4610
+ setTableData = _useState22[1];
4611
+
4612
+ var _useState23 = React.useState({
4613
+ total: 0,
4614
+ size: "small",
4615
+ current: 1,
4616
+ pageSize: tableInitPageSize
4617
+ }),
4618
+ _useState24 = _slicedToArray(_useState23, 2),
4619
+ tablePagination = _useState24[0],
4620
+ setTablePagination = _useState24[1];
4621
+
4622
+ var _useState25 = React.useState([]),
4623
+ _useState26 = _slicedToArray(_useState25, 2),
4624
+ selectedRowKeys = _useState26[0],
4625
+ setSelectedRowKeys = _useState26[1];
4626
+
4627
+ var _useState27 = React.useState([]),
4628
+ _useState28 = _slicedToArray(_useState27, 2),
4629
+ doubleArr = _useState28[0],
4630
+ setDoubleArr = _useState28[1]; // 存放双数组的数组
4631
+
4632
+
4633
+ var _useState29 = React.useState(false),
4634
+ _useState30 = _slicedToArray(_useState29, 2),
4635
+ checkedAll = _useState30[0],
4636
+ setCheckedAll = _useState30[1];
4637
+
4638
+ var _useState31 = React.useState(false),
4639
+ _useState32 = _slicedToArray(_useState31, 2),
4640
+ indeterminate = _useState32[0],
4641
+ setIndeterminate = _useState32[1];
4642
+
4643
+ var _useState33 = React.useState({}),
4644
+ _useState34 = _slicedToArray(_useState33, 2),
4645
+ tableFormParams = _useState34[0],
4646
+ setTableFormParams = _useState34[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
4647
+
4648
+
4649
+ var getData = function getData() {
4650
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4651
+ var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
4652
+ if (!requestConfig) return;
4653
+ setFetching(true); // 处理dependence参数
4654
+
4655
+ var fixedParam = {};
4656
+
4657
+ if (fixedparameter && fieldValToParam && ctx) {
4658
+ fixedparameter.forEach(function (item, index) {
4659
+ var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
4660
+
4661
+ if (fixedParamVal) {
4662
+ fixedParam[item] = fixedParamVal;
4663
+ form.setFieldsValue(_objectSpread2(_objectSpread2({}, form === null || form === void 0 ? void 0 : form.getFieldsValue()), {}, _defineProperty({}, item, fixedParamVal)));
4664
+ }
4665
+ });
4666
+ } // 数组对象处理,对带有特殊标记的name进行处理
4667
+
4668
+
4669
+ for (var key in params) {
4670
+ if (Object.prototype.hasOwnProperty.call(params, key)) {
4671
+ (function () {
4672
+ var element = params[key];
4673
+
4674
+ if (element && key.indexOf('*number*') >= 0) {
4675
+ var dataParams = key.split('*number*');
4676
+ dataParams.forEach(function (value, index) {
4677
+ params[value] = element[index];
4678
+ });
4679
+ delete params[key];
4680
+ } else if (element && key.indexOf('*address*') >= 0) {
4681
+ var _dataParams = key.split('*address*');
4682
+
4683
+ _dataParams.forEach(function (value, index) {
4684
+ params[value] = element.PCDCode[index];
4685
+ });
4686
+
4687
+ delete params[key];
4688
+ } else if (element && key.indexOf('*costType*') >= 0) {
4689
+ var _dataParams2 = key.split('*costType*'); // eslint-disable-next-line prefer-destructuring
4690
+
4691
+
4692
+ params[_dataParams2[0]] = element[1];
4693
+ delete params[key];
4694
+ } else if (element && key.indexOf('*fullDate*') >= 0) {
4695
+ var _dataParams3 = key.split('*fullDate*');
4696
+
4697
+ _dataParams3.forEach(function (value, index) {
4698
+ if (index === 0) {
4699
+ params[value] = moment(element[index]).millisecond(0).second(0).minute(0).hour(0).format('YYYY-MM-DD HH:mm:ss');
4700
+ } else {
4701
+ params[value] = moment(element[index]).millisecond(59).second(59).minute(59).hour(23).format('YYYY-MM-DD HH:mm:ss');
4702
+ }
4703
+ });
4704
+
4705
+ delete params[key];
4706
+ } else if (typeof element === 'boolean' && key.indexOf('*checkBox*') >= 0) {
4707
+ var _dataParams4 = key.split('*checkBox*');
4708
+
4709
+ if (element) {
4710
+ params[_dataParams4[0]] = 0;
4711
+ }
4712
+
4713
+ delete params[key];
4714
+ } else if (element && key.indexOf('*cascader*') >= 0) {
4715
+ var _dataParams5 = key.split('*cascader*');
4716
+
4717
+ params[_dataParams5[0]] = element[element.length - 1];
4718
+ delete params[key];
4719
+ } else if (element && key.indexOf('*date*') >= 0) {
4720
+ var _dataParams6 = key.split('*date*');
4721
+
4722
+ _dataParams6.forEach(function (value, index) {
4723
+ if (index === 0) {
4724
+ params[value] = moment(element[index]).format('YYYY-MM-DD');
4725
+ } else {
4726
+ params[value] = moment(element[index]).format('YYYY-MM-DD');
4727
+ }
4728
+ });
4729
+
4730
+ delete params[key];
4731
+ } else if (element && key.indexOf('*') >= 0) {
4732
+ var _dataParams7 = key.split('*');
4733
+
4734
+ _dataParams7.forEach(function (value, index) {
4735
+ params[value] = element[index].format('YYYY-MM-DD HH:mm:ss');
4736
+ });
4737
+
4738
+ delete params[key];
4739
+ } else if (element && key.indexOf('_selectNumberRange') >= 0) {
4740
+ // key = xxxxx_selectNumberRange qp-xxxxx-gt
4741
+ var _dataParams8 = key.split('_selectNumberRange')[0];
4742
+
4743
+ if (params[key][0] === 'range') {
4744
+ if (params[key][1][0]) {
4745
+ params["qp-".concat(_dataParams8, "-ge")] = params[key][1][0];
4746
+ }
4747
+
4748
+ if (params[key][1][1]) {
4749
+ params["qp-".concat(_dataParams8, "-le")] = params[key][1][1];
4750
+ }
4751
+ } else {
4752
+ params["qp-".concat(_dataParams8, "-").concat(params[key][0])] = params[key][1];
4753
+ }
4754
+
4755
+ delete params[key];
4756
+ } else if (Array.isArray(element)) {
4757
+ params[key] = element.join(',');
4758
+ } else if (element == null || element === undefined || String(element).trim() === '') {
4759
+ delete params[key];
4760
+ }
4761
+ })();
4762
+ }
4763
+ }
4764
+
4765
+ var queryParams = _objectSpread2(_objectSpread2(_objectSpread2({
4766
+ pageSize: pageSize,
4767
+ currentPage: currentPage
4768
+ }, otherParams), fixedParam), params);
4769
+
4770
+ axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(queryParams))).then(function (result) {
4771
+ var _result3, _result4;
4772
+
4773
+ setFetching(false);
4774
+ result = result.data;
4775
+
4776
+ if (((_result3 = result) === null || _result3 === void 0 ? void 0 : _result3.status) && result.status !== '0' || ((_result4 = result) === null || _result4 === void 0 ? void 0 : _result4.code) && result.code !== '000000') {
4777
+ antd.message.error(result.msg);
4778
+ return;
4779
+ }
4780
+
4781
+ var res = result.data;
4782
+ var source = [];
4783
+
4784
+ if (isMap) {
4785
+ source = Object.keys(res).map(function (d, i) {
4786
+ return {
4787
+ text: Object.values(res)[i],
4788
+ value: d
4789
+ };
4790
+ });
4791
+ } else {
4792
+ var keys = res.list ? 'list' : 'items';
4793
+ source = res ? res[keys] ? res[keys].map(function (item) {
4794
+ var _item$packingUnitList, _item$packingUnitList2;
4795
+
4796
+ var textShowText = item[mappingTextField];
4797
+
4798
+ if (mappingTextShowTextField) {
4799
+ textShowText = [];
4800
+
4801
+ if (Array.isArray(mappingTextShowTextField)) {
4802
+ mappingTextShowTextField.forEach(function (r) {
4803
+ textShowText.push(item[r]);
4804
+ });
4805
+ } else {
4806
+ textShowText = item[mappingTextShowTextField];
4807
+ }
4808
+ }
4809
+
4810
+ return _objectSpread2(_objectSpread2({}, item), {}, {
4811
+ text: item[mappingTextField],
4812
+ textShowText: textShowText,
4813
+ textShowKey: item[mappingTextShowKeyField || mappingValueField],
4814
+ value: item[mappingValueField],
4815
+ baseUnitCode: item === null || item === void 0 ? void 0 : (_item$packingUnitList = item.packingUnitList) === null || _item$packingUnitList === void 0 ? void 0 : (_item$packingUnitList2 = _item$packingUnitList.find(function (item) {
4816
+ return item.baseUnit === true;
4817
+ })) === null || _item$packingUnitList2 === void 0 ? void 0 : _item$packingUnitList2.unitCode
4818
+ });
4819
+ }) : Array.isArray(res) && (res === null || res === void 0 ? void 0 : res.map(function (item) {
4820
+ var _item$packingUnitList3, _item$packingUnitList4;
4821
+
4822
+ var textShowText = item[mappingTextField];
4823
+
4824
+ if (mappingTextShowTextField) {
4825
+ textShowText = [];
4826
+
4827
+ if (Array.isArray(mappingTextShowTextField)) {
4828
+ mappingTextShowTextField.forEach(function (r) {
4829
+ textShowText.push(item[r]);
4830
+ });
4831
+ } else {
4832
+ textShowText = item[mappingTextShowTextField];
4833
+ }
4834
+ }
4835
+
4836
+ return _objectSpread2(_objectSpread2({}, item), {}, {
4837
+ text: item[mappingTextField],
4838
+ textShowText: textShowText,
4839
+ textShowKey: item[mappingTextShowKeyField || mappingValueField],
4840
+ value: item[mappingValueField],
4841
+ baseUnitCode: item === null || item === void 0 ? void 0 : (_item$packingUnitList3 = item.packingUnitList) === null || _item$packingUnitList3 === void 0 ? void 0 : (_item$packingUnitList4 = _item$packingUnitList3.find(function (item) {
4842
+ return item.baseUnit === true;
4843
+ })) === null || _item$packingUnitList4 === void 0 ? void 0 : _item$packingUnitList4.unitCode
4844
+ });
4845
+ })) : [];
4846
+ }
4847
+
4848
+ source = Array.isArray(source) ? source : [];
4849
+
4850
+ if (type === 1) {
4851
+ var _ctx$form;
4852
+
4853
+ ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(resultSourceKey, source);
4854
+ setItems(source);
4855
+ setItemsTotal(Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length));
4856
+ } else {
4857
+ setTableData(source);
4858
+ setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), {}, {
4859
+ total: Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length),
4860
+ pageSize: Number((res === null || res === void 0 ? void 0 : res.size) || (res === null || res === void 0 ? void 0 : res.pageSize) || (params === null || params === void 0 ? void 0 : params.pageSize) || pageSize),
4861
+ current: Number((res === null || res === void 0 ? void 0 : res.page) || (res === null || res === void 0 ? void 0 : res.currentPage) || (params === null || params === void 0 ? void 0 : params.currentPage) || currentPage)
4862
+ }));
4863
+ }
4864
+ }).catch(function (err) {
4865
+ setFetching(false);
4866
+ });
4867
+ };
4868
+
4869
+ React.useEffect(function () {
4870
+ Promise.all([loadSelectSource("/items/brand/queryBrandList", {
4871
+ pageSize: 5000,
4872
+ currentPage: 1,
4873
+ 'ctl-withAuth': true
4874
+ }), loadSelectSource("/items/category/queryCategoryTree", {
4875
+ pageSize: 5000,
4876
+ currentPage: 1
4877
+ })]).then(function (x) {
4878
+ formatSource(x, 0, 2, tableSearchForm, ['id', 'name']);
4879
+ formatTreeDataSource(x, 1, 3, tableSearchForm);
4880
+ });
4881
+ }, []);
4882
+ React.useEffect(function () {
4883
+ if (value) {
4884
+ setPopValue(value);
4885
+ }
4886
+ }, [value]);
4887
+ React.useEffect(function () {
4888
+ makeUniqueValue();
4889
+ }, [sourceName]);
4890
+
4891
+ var showModal = function showModal() {
4892
+ // getData({ pageSize: tableInitPageSize, currentPage: 1 }, 2)
4893
+ setIsModalVisible(true); // 回显
4894
+
4895
+ if (value) {
4896
+ if (selectMode) {
4897
+ setSelectedRowKeys(labelInValue ? value.map(function (i) {
4898
+ return i.key;
4899
+ }) : value);
4900
+ setPopValue(labelInValue ? value.map(function (i) {
4901
+ return {
4902
+ value: i.key,
4903
+ text: i.label
4904
+ };
4905
+ }) : value.map(function (i) {
4906
+ return {
4907
+ value: i
4908
+ };
4909
+ }));
4910
+ setIndeterminate(!!value.length && value.length < itemsTotal);
4911
+ setCheckedAll(itemsTotal && value.length === itemsTotal); // 需清空数据
4912
+
4913
+ if (!value.length) {
4914
+ setDoubleArr([]);
4915
+ }
4916
+ } else {
4917
+ setSelectedRowKeys(labelInValue ? [value.key] : [value]);
4918
+ setPopValue(labelInValue ? [{
4919
+ value: value.key,
4920
+ text: value.label
4921
+ }] : [{
4922
+ value: value
4923
+ }]);
4924
+ }
4925
+ }
4926
+
4927
+ setTimeout(function () {
4928
+ var _document$getElementB;
4929
+
4930
+ (_document$getElementB = document.getElementById("first-query")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.focus();
4931
+ }, 50);
4932
+ };
4933
+
4934
+ var handleShowModal = function handleShowModal() {
4935
+ if (beforeShowModal) {
4936
+ beforeShowModal(popvalue).then(function (res) {
4937
+ showModal();
4938
+ }).catch(function (Error) {
4939
+ antd.message.warning(Error);
4940
+ });
4941
+ } else {
4942
+ showModal();
4943
+ }
4944
+ };
4945
+
4946
+ var handleOk = function handleOk(isContinue) {
4947
+ if (!popvalue.length) {
4948
+ antd.message.warning('至少选中一条数据');
4949
+ return;
4950
+ } // handleSelectOver(popvalue)
4951
+
4952
+
4953
+ if (onSaveCallback) {
4954
+ onSaveCallback(popvalue).then(function (res) {
4955
+ {
4956
+ var _document$getElementB2;
4957
+
4958
+ antd.message.success('保存成功');
4959
+ deleteSelectRows();
4960
+ (_document$getElementB2 = document.getElementById('first-query')) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.focus();
4961
+ !isContinue && handleCancel();
4962
+ }
4963
+ }).catch(function (Error) {
4964
+ antd.message.error(Error);
4965
+ });
4966
+ } else {
4967
+ !isContinue && handleCancel();
4968
+ }
4969
+ };
4970
+
4971
+ var handleCancel = function handleCancel() {
4972
+ form.resetFields();
4973
+ setTableFormParams({});
4974
+ setIsModalVisible(false);
4975
+ setTableData([]); // if (selectMode) {
4976
+ // run();
4977
+ // }
4978
+ };
4979
+
4980
+ var onSearchTable = function onSearchTable() {
4981
+ var params = form.getFieldsValue();
4982
+ setTableFormParams(params);
4983
+ getData(_objectSpread2(_objectSpread2({}, params), {}, {
4984
+ pageSize: tableInitPageSize
4985
+ }), 2);
4986
+
4987
+ if (selectMode) {
4988
+ getData(params);
4989
+ }
4990
+ };
4991
+
4992
+ var onResetTable = function onResetTable() {
4993
+ form.resetFields();
4994
+ setTableFormParams({});
4995
+ getData({
4996
+ pageSize: tableInitPageSize,
4997
+ currentPage: 1
4998
+ }, 2);
4999
+ };
5000
+
5001
+ var handleTableChange = function handleTableChange(pagination) {
5002
+ getData(_objectSpread2(_objectSpread2({}, tableFormParams), {}, {
5003
+ pageSize: pagination.pageSize,
5004
+ currentPage: pagination.current
5005
+ }), 2);
5006
+ }; // 扁平化二维数组的方法
5007
+
5008
+ var onChangeSelectedKeys = function onChangeSelectedKeys(selectKeys, selectRows) {
5009
+ if (selectKeys.length - selectedRowKeys.length > 0) {
5010
+ if (selectKeys.length - selectedRowKeys.length === 1) {
5011
+ selectRows[selectRows.length - 1]['needFocus'] = true;
5012
+ } else {
5013
+ selectRows[selectedRowKeys.length]['needFocus'] = true;
5014
+ }
5015
+ }
5016
+
5017
+ setPopValue(selectRows);
5018
+ setSelectedRowKeys(selectKeys); // setIndeterminate(!!filterRows.length && filterRows.length < tablePagination?.total);
5019
+ // setCheckedAll(filterRows.length === tablePagination?.total);
5020
+ }; // 生成唯一值
5021
+
5022
+
5023
+ var makeUniqueValue = function makeUniqueValue() {
5024
+ var generateUnitKey = ((1 + Math.random()) * 0x10000 | 0).toString(16);
5025
+ setUniqueValue(generateUnitKey);
5026
+ return generateUnitKey;
5027
+ };
5028
+
5029
+ var rowSelection = {
5030
+ type: 'checkbox',
5031
+ selectedRowKeys: selectedRowKeys,
5032
+ preserveSelectedRowKeys: true,
5033
+ onChange: function onChange(sks, srs) {
5034
+ onChangeSelectedKeys(sks, srs);
5035
+ },
5036
+ getCheckboxProps: function getCheckboxProps() {
5037
+ return {
5038
+ disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
5039
+ };
5040
+ }
5041
+ };
5042
+
5043
+ var onDoubleClickSelect = function onDoubleClickSelect(e, record) {
5044
+ if (!selectMode) {
5045
+ var srs = [JSON.parse(JSON.stringify(record))];
5046
+ var sks = srs.map(function (i) {
5047
+ return i.value;
5048
+ });
5049
+ onChangeSelectedKeys(sks, srs);
5050
+ }
5051
+ };
5052
+
5053
+ var themeColor = {
5054
+ color: '#005CFF'
5055
+ };
5056
+
5057
+ var formItem = function formItem(list) {
5058
+ if (isModalVisible && (list === null || list === void 0 ? void 0 : list.length)) {
5059
+ return list.map(function (i, index) {
5060
+ var _i$field, _i$field3, _i$field5, _i$field6, _i$field7;
5061
+
5062
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'select' || (i === null || i === void 0 ? void 0 : (_i$field = i.field) === null || _i$field === void 0 ? void 0 : _i$field.type) === 'select') {
5063
+ var _i$field2, _i$initialSource;
5064
+
5065
+ return /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
5066
+ name: i.name,
5067
+ label: i.label,
5068
+ key: i.name
5069
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2({
5070
+ style: {
5071
+ width: '100%'
5072
+ },
5073
+ placeholder: "\u8BF7\u9009\u62E9"
5074
+ }, i === null || i === void 0 ? void 0 : (_i$field2 = i.field) === null || _i$field2 === void 0 ? void 0 : _i$field2.props), (i === null || i === void 0 ? void 0 : (_i$initialSource = i.initialSource) === null || _i$initialSource === void 0 ? void 0 : _i$initialSource.length) && (i === null || i === void 0 ? void 0 : i.initialSource.map(function (m) {
5075
+ return /*#__PURE__*/React__default['default'].createElement(Option$1, {
5076
+ value: m.value,
5077
+ key: m.value
5078
+ }, m.text);
5079
+ }))));
5080
+ }
5081
+
5082
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'treeSelect' || (i === null || i === void 0 ? void 0 : (_i$field3 = i.field) === null || _i$field3 === void 0 ? void 0 : _i$field3.type) === 'treeSelect') {
5083
+ var _i$field4;
5084
+
5085
+ return /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
5086
+ name: i.name,
5087
+ label: i.label,
5088
+ key: i.name
5089
+ }, /*#__PURE__*/React__default['default'].createElement(antd.TreeSelect, _objectSpread2({
5090
+ style: {
5091
+ width: '100%'
5092
+ },
5093
+ placeholder: "\u8BF7\u9009\u62E9"
5094
+ }, i === null || i === void 0 ? void 0 : (_i$field4 = i.field) === null || _i$field4 === void 0 ? void 0 : _i$field4.props)));
5095
+ }
5096
+
5097
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'BusinessSearchSelect' || (i === null || i === void 0 ? void 0 : (_i$field5 = i.field) === null || _i$field5 === void 0 ? void 0 : _i$field5.type) === 'BusinessSearchSelect') {
5098
+ return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
5099
+ name: i.name,
5100
+ label: i.label,
5101
+ key: i.name
5102
+ }, /*#__PURE__*/React__default['default'].createElement(BusinessSearchSelect$1, _objectSpread2({}, i.field.props))));
5103
+ }
5104
+
5105
+ if ((i === null || i === void 0 ? void 0 : i.type) === 'multipleQueryInput' || (i === null || i === void 0 ? void 0 : (_i$field6 = i.field) === null || _i$field6 === void 0 ? void 0 : _i$field6.type) === 'multipleQueryInput') {
5106
+ return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
5107
+ name: i.name,
5108
+ label: i.label,
5109
+ key: i.name
5110
+ }, /*#__PURE__*/React__default['default'].createElement(QueryMutipleInput, {
5111
+ onValueChange: function onValueChange(value) {
5112
+ form.setFieldsValue(_defineProperty({}, i.name, value));
5113
+ }
5114
+ })));
5115
+ } // 默认type是input
5116
+
5117
+
5118
+ return /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
5119
+ name: i.name,
5120
+ label: i.label,
5121
+ key: i.name
5122
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, _objectSpread2({
5123
+ id: index === 0 ? "first-query" : 'index',
5124
+ style: {
5125
+ width: '100%'
5126
+ },
5127
+ onKeyDown: function onKeyDown(e) {
5128
+ if (e.keyCode === 13) {
5129
+ onSearchTable();
5130
+ }
5131
+ },
5132
+ placeholder: "\u8BF7\u8F93\u5165",
5133
+ allowClear: true,
5134
+ maxLength: 100
5135
+ }, i === null || i === void 0 ? void 0 : (_i$field7 = i.field) === null || _i$field7 === void 0 ? void 0 : _i$field7.props)));
5136
+ });
5137
+ } else {
5138
+ return null;
5139
+ }
5140
+ };
5141
+
5142
+ var deleteSelectRows = function deleteSelectRows() {
5143
+ setPopValue([]);
5144
+ setSelectedRowKeys([]);
5145
+ };
5146
+
5147
+ var deleteRecord = function deleteRecord(record) {
5148
+ setPopValue(popvalue.filter(function (item) {
5149
+ return item.skuCode !== record.skuCode;
5150
+ }));
5151
+ setSelectedRowKeys(_toConsumableArray(selectedRowKeys.filter(function (item) {
5152
+ return item !== record.skuCode;
5153
+ })));
5154
+ };
5155
+
5156
+ var inputIndex = 0;
5157
+ var selectColumns = [].concat(_toConsumableArray(modalTableProps.selectColumn.map(function (item) {
5158
+ var inputLength = modalTableProps.selectColumn.filter(function (item) {
5159
+ return item.isInputItem;
5160
+ }).length;
5161
+ var currentIndex = inputIndex;
5162
+
5163
+ if (item.isInputItem) {
5164
+ inputIndex++;
5165
+ return _objectSpread2(_objectSpread2({}, item), {}, {
5166
+ render: function render(text, record, index) {
5167
+ // let
5168
+ if (record.needFocus === true && currentIndex === 0) ;
5169
+
5170
+ return /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
5171
+ defaultValue: text || 0,
5172
+ min: 0,
5173
+ autoFocus: record.needFocus,
5174
+ keyboard: false,
5175
+ onChange: function onChange(value) {
5176
+ record[item.dataIndex] = value;
5177
+ },
5178
+ // onFocus={(e)=> {
5179
+ // let dom1 = e.currentTarget;
5180
+ // dom1.setSelectionRange(100, 0);
5181
+ // dom1.select(text);
5182
+ // }}
5183
+ onKeyDown: function onKeyDown(e) {
5184
+ if (e.keyCode === 13 && e.ctrlKey) {
5185
+ var _document$getElementB3;
5186
+
5187
+ handleOk(true);
5188
+ (_document$getElementB3 = document.getElementById("first-query")) === null || _document$getElementB3 === void 0 ? void 0 : _document$getElementB3.focus();
5189
+ }
5190
+
5191
+ if (e.keyCode === 8 && e.ctrlKey) {
5192
+ var _e$nativeEvent$path$;
5193
+
5194
+ antd.message.success('删除当前行');
5195
+ e.stopPropagation();
5196
+ e.preventDefault();
5197
+ var dom = (_e$nativeEvent$path$ = e.nativeEvent.path[5].children[index + 2]) === null || _e$nativeEvent$path$ === void 0 ? void 0 : _e$nativeEvent$path$.getElementsByTagName('input')[currentIndex];
5198
+
5199
+ if (dom) {
5200
+ dom.select();
5201
+ dom.focus();
5202
+ dom.scrollIntoView(false);
5203
+ }
5204
+
5205
+ dom = null;
5206
+ deleteRecord(record);
5207
+ }
5208
+
5209
+ if (e.keyCode === 37 && e.shiftKey) {
5210
+ var _e$nativeEvent$path$2;
5211
+
5212
+ // 左滑动
5213
+ e.stopPropagation();
5214
+ e.preventDefault();
5215
+
5216
+ var _dom = (_e$nativeEvent$path$2 = e.nativeEvent.path[5].children[index + 1]) === null || _e$nativeEvent$path$2 === void 0 ? void 0 : _e$nativeEvent$path$2.getElementsByTagName('input')[currentIndex - 1];
5217
+
5218
+ if (_dom) {
5219
+ _dom.select();
5220
+
5221
+ _dom.focus();
5222
+
5223
+ _dom.scrollIntoView(false);
5224
+ }
5225
+
5226
+ _dom = null;
5227
+ }
5228
+
5229
+ if (e.keyCode === 39 && e.shiftKey) {
5230
+ var _e$nativeEvent$path$3;
5231
+
5232
+ // 右滑
5233
+ e.stopPropagation();
5234
+ e.preventDefault();
5235
+
5236
+ var _dom2 = (_e$nativeEvent$path$3 = e.nativeEvent.path[5].children[index + 1]) === null || _e$nativeEvent$path$3 === void 0 ? void 0 : _e$nativeEvent$path$3.getElementsByTagName('input')[currentIndex + 1];
5237
+
5238
+ if (_dom2) {
5239
+ _dom2.select();
5240
+
5241
+ _dom2.focus();
5242
+
5243
+ _dom2.scrollIntoView(false);
5244
+ }
5245
+
5246
+ _dom2 = null;
5247
+ }
5248
+
5249
+ if (e.keyCode === 40) {
5250
+ var _e$nativeEvent$path$4;
5251
+
5252
+ e.stopPropagation();
5253
+ e.preventDefault();
5254
+
5255
+ var _dom3 = (_e$nativeEvent$path$4 = e.nativeEvent.path[5].children[index + 2]) === null || _e$nativeEvent$path$4 === void 0 ? void 0 : _e$nativeEvent$path$4.getElementsByTagName('input')[currentIndex];
5256
+
5257
+ if (_dom3) {
5258
+ _dom3.select();
5259
+
5260
+ _dom3.focus();
5261
+
5262
+ _dom3.scrollIntoView(false);
5263
+ }
5264
+
5265
+ _dom3 = null;
5266
+ } else if (e.keyCode === 38) {
5267
+ var _e$nativeEvent$path$5;
5268
+
5269
+ e.stopPropagation();
5270
+ e.preventDefault();
5271
+ var dom1 = (_e$nativeEvent$path$5 = e.nativeEvent.path[5].children[index]) === null || _e$nativeEvent$path$5 === void 0 ? void 0 : _e$nativeEvent$path$5.getElementsByTagName('input')[currentIndex];
5272
+
5273
+ if (dom1) {
5274
+ // dom1.value=""
5275
+ // dom1.setSelectionRange(100, 0);
5276
+ dom1.select();
5277
+ dom1.focus();
5278
+ dom1.scrollIntoViewIfNeeded(false); // dom1.value=record['count']
5279
+ }
5280
+
5281
+ dom1 = null;
5282
+ } else if (e.keyCode === 9 && index === selectedRowKeys.length - 1 && currentIndex === inputLength - 1) {
5283
+ e.stopPropagation();
5284
+ e.preventDefault();
5285
+ }
5286
+ }
5287
+ });
5288
+ }
5289
+ });
5290
+ }
5291
+
5292
+ return item;
5293
+ })), [{
5294
+ title: '操作',
5295
+ width: 50,
5296
+ fixed: 'right',
5297
+ render: function render(text, record, index) {
5298
+ return /*#__PURE__*/React__default['default'].createElement("span", {
5299
+ style: {
5300
+ cursor: 'pointer',
5301
+ color: '#005CFF'
5302
+ },
5303
+ onClick: function onClick() {
5304
+ deleteRecord(record);
5305
+ },
5306
+ type: "text"
5307
+ }, "\u5220\u9664");
5308
+ }
5309
+ }]);
5310
+ return /*#__PURE__*/React__default['default'].createElement("div", {
5311
+ className: 'add_select'
5312
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5313
+ className: "add_select_show",
5314
+ id: "add_select_div_".concat(uniqueValue)
5315
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
5316
+ onClick: handleShowModal,
5317
+ type: "primary"
5318
+ }, buttonText)), needModalTable && isModalVisible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
5319
+ width: '1200px',
5320
+ style: {
5321
+ top: 20
5322
+ },
5323
+ bodyStyle: {
5324
+ padding: '0px'
5325
+ },
5326
+ // title={modalTableProps?.modalTableTitle}
5327
+ visible: isModalVisible,
5328
+ onOk: handleOk,
5329
+ closable: false,
5330
+ onCancel: handleCancel,
5331
+ footer: selectMode ? [/*#__PURE__*/React__default['default'].createElement(antd.Button, {
5332
+ key: "back",
5333
+ onClick: handleCancel
5334
+ }, "\u53D6\u6D88"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
5335
+ key: "submit",
5336
+ style: {
5337
+ color: '#005CFF',
5338
+ borderColor: '#005CFF'
5339
+ },
5340
+ onClick: function onClick() {
5341
+ handleOk(true);
5342
+ },
5343
+ disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
5344
+ }, "\u4FDD\u5B58\u5E76\u7EE7\u7EED"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
5345
+ key: "submit",
5346
+ type: "primary",
5347
+ onClick: function onClick() {
5348
+ handleOk(false);
5349
+ },
5350
+ disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
5351
+ }, "\u786E\u5B9A")] : null
5352
+ }, /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
5353
+ className: 'add_select_header'
5354
+ }, modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalTableTitle, /*#__PURE__*/React__default['default'].createElement("span", null, /*#__PURE__*/React__default['default'].createElement("span", null, "*"), " \xA0\u5FEB\u6377\u952E\uFF1A\u3010Tab\u3011-\u8DF3\u683C\u5207\u6362\uFF1B\u3010Shift+\u2190\u3001\u2192\u3011-\u5F53\u524D\u884C\u5DE6\u3001\u53F3\u79FB\u52A8\uFF1B\u3010 \u2191\u3001\u2193\u3011-\u5F53\u524D\u5217\u4E0A\u3001\u4E0B\u79FB\u52A8\uFF1B\u3010ctrl+Enter\u3011-\u4FDD\u5B58\u5E76\u7EE7\u7EED\uFF1B\u3010ctrl+Delete\u3011-\u5220\u9664\u5F53\u524D\u884C\uFF1B"), /*#__PURE__*/React__default['default'].createElement("span", {
5355
+ className: 'add_select_header_close'
5356
+ }, /*#__PURE__*/React__default['default'].createElement(CloseCircleOutlined$2, {
5357
+ style: {
5358
+ fontSize: '20px'
5359
+ },
5360
+ onClick: handleCancel
5361
+ }))), /*#__PURE__*/React__default['default'].createElement("div", {
5362
+ className: 'add_select_wrapper'
5363
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5364
+ className: caretLeftFlag ? 'add_select_wrapper_left' : 'add_select_wrapper_left1'
5365
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5366
+ className: 'select_list_columns'
5367
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5368
+ className: 'select_list_columns_formItems'
5369
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
5370
+ form: form,
5371
+ layout: 'vertical',
5372
+ key: 'modalForm'
5373
+ }, formItem(tableSearchForm)))), /*#__PURE__*/React__default['default'].createElement("div", {
5374
+ className: 'select_list_searchButton'
5375
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
5376
+ key: 'reset',
5377
+ className: 'select_list_button_space',
5378
+ onClick: onResetTable
5379
+ }, "\u91CD\u7F6E"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
5380
+ key: 'search',
5381
+ type: "primary",
5382
+ onClick: onSearchTable
5383
+ }, "\u67E5\u8BE2"))), /*#__PURE__*/React__default['default'].createElement("div", {
5384
+ className: caretLeftFlag ? 'add_select_wrapper_right' : 'add_select_wrapper_right1'
5385
+ }, /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
5386
+ className: 'select_list_selectTips'
5387
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5388
+ style: {
5389
+ marginLeft: 8
5390
+ }
5391
+ }, "\u641C\u7D22\u7ED3\u679C\u5171\xA0", /*#__PURE__*/React__default['default'].createElement("span", {
5392
+ style: themeColor
5393
+ }, (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total) || 0), "\xA0\u9879", selectMode ? /*#__PURE__*/React__default['default'].createElement("span", null, "\uFF0C \u672C\u6B21\u5DF2\u9009\xA0", /*#__PURE__*/React__default['default'].createElement("span", {
5394
+ style: themeColor
5395
+ }, (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) || 0), "\xA0\u9879") : '')), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
5396
+ size: 'small',
5397
+ rowSelection: rowSelection,
5398
+ columns: _toConsumableArray(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableColumns),
5399
+ dataSource: tableData,
5400
+ pagination: tablePagination,
5401
+ loading: fetching,
5402
+ onChange: handleTableChange,
5403
+ rowKey: mappingValueField,
5404
+ rowClassName: 'row-class',
5405
+ scroll: {
5406
+ y: 500
5407
+ }
5408
+ })))), /*#__PURE__*/React__default['default'].createElement("div", {
5409
+ className: 'add_select_wrapper_select'
5410
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5411
+ className: 'select_list_selectTips'
5412
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
5413
+ style: {
5414
+ marginLeft: 8
5415
+ }
5416
+ }, /*#__PURE__*/React__default['default'].createElement("span", null, "\u672C\u6B21\u5DF2\u9009\xA0", /*#__PURE__*/React__default['default'].createElement("span", {
5417
+ style: themeColor
5418
+ }, (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) || 0), "\xA0\u9879")), /*#__PURE__*/React__default['default'].createElement("div", {
5419
+ style: {
5420
+ marginRight: 8
5421
+ }
5422
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
5423
+ onClick: deleteSelectRows,
5424
+ style: _objectSpread2(_objectSpread2({}, themeColor), {}, {
5425
+ cursor: 'pointer'
5426
+ })
5427
+ }, "\u6E05\u7A7A\u6240\u9009\u5546\u54C1"))), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
5428
+ size: 'small',
5429
+ // rowSelection={rowSelection}
5430
+ columns: selectColumns,
5431
+ dataSource: popvalue,
5432
+ pagination: false,
5433
+ // onChange={handleTableChange}
5434
+ rowKey: mappingValueField,
5435
+ rowClassName: 'row-class',
5436
+ scroll: {
5437
+ y: 500
5438
+ },
5439
+ onRow: function onRow(record) {
5440
+ return {
5441
+ onDoubleClick: function onDoubleClick(event) {
5442
+ return onDoubleClickSelect(event, record);
5443
+ }
5444
+ };
5445
+ }
5446
+ })))));
5447
+ };
5448
+
5449
+ var shopFileType = [{
5450
+ text: "线上",
5451
+ value: 'online'
5452
+ }, {
5453
+ text: "线下",
5454
+ value: 'offline'
5455
+ }];
5456
+ var shopFile2Type = [{
5457
+ text: "第三方线上",
5458
+ value: 'online'
5459
+ }, {
5460
+ text: "线下",
5461
+ value: 'offline'
5462
+ }, {
5463
+ text: "自营B2B",
5464
+ value: 'B2B'
5465
+ }, {
5466
+ text: "自营B2C",
5467
+ value: 'B2C'
5468
+ }];
5469
+ var arrivalPaySupportList = [{
5470
+ text: "支持",
5471
+ value: 1
5472
+ }, {
5473
+ text: "不支持",
5474
+ value: 0
5475
+ }];
5476
+ var sharingType = [{
5477
+ text: "共享",
5478
+ value: '10'
5479
+ }, {
5480
+ text: "私有",
5481
+ value: '20'
5482
+ }];
5483
+
5484
+ var getDicData = function getDicData(dicCode) {
5485
+ var dicData = {};
5486
+
5487
+ {
5488
+ var storageDic = localStorage.getItem('dicData') ? JSON.parse(localStorage.getItem('dicData') || '{}') : {};
5489
+ dicData = storageDic[dicCode];
5490
+ } // @ts-ignore
5491
+
5492
+
5493
+ if (!dicData || !dicData.length) ;
5494
+
5495
+ return dicData;
5496
+ };
5497
+
5498
+ var getDictionarySource = function getDictionarySource(dicCode) {
5499
+ var needConvertInterger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
5500
+ var dicData = getDicData(dicCode);
5501
+
5502
+ try {
5503
+ if (needConvertInterger) {
5504
+ // @ts-ignore
5505
+ dicData = dicData.map(function (item) {
5506
+ return _objectSpread2(_objectSpread2({}, item), {}, {
5507
+ value: parseFloat(item.value)
5508
+ });
5509
+ });
5510
+ }
5511
+ } catch (e) {}
5512
+
5513
+ return dicData;
5514
+ };
5515
+
5516
+ var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value) {
5517
+ var dicData = getDicData(dicCode);
5518
+ if (value === undefined) return ''; // @ts-ignore
5519
+
5520
+ var dicItemArray = dicData === null || dicData === void 0 ? void 0 : dicData.filter(function (item) {
5521
+ return item.value === value.toString();
5522
+ });
5523
+
5524
+ if (!(dicItemArray === null || dicItemArray === void 0 ? void 0 : dicItemArray.length)) {
5525
+ // throw new Error(`当前${dicCode}字典值合没有${value}的数据`)
5526
+ return value;
5527
+ }
5528
+
5529
+ return dicItemArray[0].text;
5530
+ };
5531
+
5532
+ var loadSelectSource$1 = function loadSelectSource(url, params) {
5533
+ return new Promise(function (resolve, reject) {
5534
+ axios__default['default'].get("".concat(url, "?").concat(querystring.stringify(params))).then(function (result) {
5535
+ var _result, _result2;
5536
+
5537
+ result = result.data;
5538
+
5539
+ if (((_result = result) === null || _result === void 0 ? void 0 : _result.status) && result.status !== '0' || ((_result2 = result) === null || _result2 === void 0 ? void 0 : _result2.code) && result.code !== '000000') {
5540
+ antd.message.error(result.msg);
5541
+ return;
5542
+ }
5543
+
5544
+ resolve(result);
5545
+ }).catch(function (err) {
5546
+ reject(err);
5547
+ });
5548
+ });
5549
+ };
5550
+
5551
+ var handleDefaultPrefixUrl = function handleDefaultPrefixUrl(type) {
5552
+ var result;
5553
+
5554
+ switch (type) {
5555
+ case 'supplier2':
5556
+ case 'customer2':
5557
+ case 'shopFile2':
5558
+ result = '/channel-manage';
5559
+ break;
5560
+
5561
+ case 'skuCommodity':
5562
+ case 'skuPropertyValue':
5563
+ case 'spuCommodity':
5564
+ result = '/items';
5565
+ break;
5566
+
5567
+ case 'physicalWarehouse':
5568
+ case 'realWarehouse':
5569
+ case 'virtualWarehouse':
5570
+ case 'channelWarehouse':
5571
+ result = '/stock';
5572
+ break;
5573
+
5574
+ case 'inventoryOrg2':
5575
+ case 'purchaseOrg':
5576
+ case 'salesOrg':
5577
+ case 'employee2':
5578
+ result = '/user';
5579
+ break;
5580
+
5581
+ case 'deliveryMode':
5582
+ result = '/basic';
5583
+ break;
5584
+
5585
+ default:
5586
+ result = '/bop/api';
5587
+ break;
5588
+ }
5589
+
5590
+ return result;
5591
+ };
5592
+
5593
+ var _getDictionarySource;
5594
+ var hasDictSharingType = (_getDictionarySource = getDictionarySource('UC000013')) === null || _getDictionarySource === void 0 ? void 0 : _getDictionarySource.length;
5595
+ var sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType;
5596
+ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5597
+ // 默认type === 'supplier' 供应商选择器
5598
+ var requestConfig = _objectSpread2({
5599
+ url: "".concat(prefixUrl.selectPrefix, "/supplier"),
5600
+ filter: 'qp-name,code-orGroup,like',
5601
+ otherParams: {
5602
+ sorter: 'desc-id'
5603
+ }
5604
+ }, requestConfigProp);
5605
+ /*
5606
+ * 处理 格式化下拉框数据源
5607
+ * reData 必传 promise返回响应的数据 格式为[{},{},{},...] Promise.all第一个参数数组有多少个数组长度就是多少,其中每个对象为每次请求的结果数据
5608
+ * 每个结果数据格式为{ status: '0', msg: 'success', data: { items: [], total: 1, size: 1, page: 1 }, traceId: 'baba..'}
5609
+ * position 必传 为获取Promise.all请求结果的位置
5610
+ * changePosition 必传 为搜索表单Form中需要更改数据源的Item项的位置
5611
+ * changeSearchForm 必传 为搜索表单Form数据
5612
+ * */
5613
+
5614
+
5615
+ var formatSource = function formatSource(reData, position, changePosition, changeSearchForm) {
5616
+ var _reData$position;
5617
+
5618
+ var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['code', 'name'];
5619
+ var data = reData && ((_reData$position = reData[position]) === null || _reData$position === void 0 ? void 0 : _reData$position.data);
5620
+ var list = Array.isArray(data) ? data : (data === null || data === void 0 ? void 0 : data.items) || (data === null || data === void 0 ? void 0 : data.list) || (data === null || data === void 0 ? void 0 : data.children) || [];
5621
+ var formatData = (list === null || list === void 0 ? void 0 : list.length) ? list.map(function (v) {
5622
+ return {
5623
+ text: v[resKeyValue[1]],
5624
+ value: v[resKeyValue[0]]
5625
+ };
5626
+ }) : [];
5627
+ changeSearchForm[changePosition] = _objectSpread2(_objectSpread2({}, changeSearchForm[changePosition]), {}, {
5628
+ initialSource: formatData
5629
+ });
5630
+ }; // 格式化树选择器数据源
5631
+
5632
+
5633
+ var mapSearchTree = function mapSearchTree(treeDataItem, resKeyValue) {
5634
+ var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
5635
+ return {
5636
+ title: treeDataItem[resKeyValue[1]],
5637
+ value: treeDataItem[resKeyValue[0]],
5638
+ parentId: treeDataItem.parent,
5639
+ data: _objectSpread2({}, treeDataItem),
5640
+ isLeaf: !haveChildren,
5641
+ disabled: haveChildren,
5642
+ children: haveChildren ? treeDataItem.children.map(function (i) {
5643
+ return mapSearchTree(i, resKeyValue);
5644
+ }) : []
5645
+ };
5646
+ };
5647
+
5648
+ var formatTreeDataSource = function formatTreeDataSource(reData, position, changePosition, changeSearchForm) {
5649
+ var _reData$position2;
5650
+
5651
+ var resKeyValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : ['id', 'name'];
5652
+ var data = reData && ((_reData$position2 = reData[position]) === null || _reData$position2 === void 0 ? void 0 : _reData$position2.data);
5653
+ var formatData = data && Array.isArray(data) && data.length && data.map(function (ites) {
5654
+ return mapSearchTree(ites, resKeyValue);
5655
+ }) || [];
5656
+ changeSearchForm[changePosition].field.props.treeData = formatData;
5657
+ };
5658
+
5659
+ var tableSearchForm = [];
5660
+
5661
+ var modalTableProps = _objectSpread2({
5662
+ modalTableTitle: '',
5663
+ tableSearchForm: tableSearchForm,
5664
+ tableColumns: []
5665
+ }, modalTableBusProps);
5666
+
5667
+ var needModalTable = (modalTableBusProps === null || modalTableBusProps === void 0 ? void 0 : modalTableBusProps.needModalTable) !== undefined ? modalTableBusProps === null || modalTableBusProps === void 0 ? void 0 : modalTableBusProps.needModalTable : true; // 供应商选择器
4606
5668
 
4607
5669
  if (type === 'supplier') {
4608
5670
  tableSearchForm = [{
@@ -4674,14 +5736,14 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4674
5736
  label: '共享类型',
4675
5737
  initialSource: sharingTypeDataList
4676
5738
  }];
4677
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
5739
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
4678
5740
  pageSize: 5000,
4679
5741
  currentPage: 1,
4680
5742
  'qp-companyType-eq': '30'
4681
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
5743
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
4682
5744
  pageSize: 5000,
4683
5745
  currentPage: 1
4684
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
5746
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
4685
5747
  pageSize: 5000,
4686
5748
  currentPage: 1,
4687
5749
  'qp-companyType-eq': '20'
@@ -4769,7 +5831,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4769
5831
  }
4770
5832
  }
4771
5833
  }];
4772
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
5834
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
4773
5835
  formatSource(x, 0, 2, tableSearchForm);
4774
5836
  formatSource(x, 1, 3, tableSearchForm);
4775
5837
  });
@@ -4999,14 +6061,14 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
4999
6061
  }
5000
6062
  }
5001
6063
  }];
5002
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
6064
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
5003
6065
  pageSize: 5000,
5004
6066
  currentPage: 1,
5005
6067
  'ctl-withAuth': true
5006
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
6068
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
5007
6069
  pageSize: 5000,
5008
6070
  currentPage: 1
5009
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
6071
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
5010
6072
  pageSize: 5000,
5011
6073
  currentPage: 1
5012
6074
  })]).then(function (x) {
@@ -5162,14 +6224,14 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5162
6224
  }
5163
6225
  }
5164
6226
  }];
5165
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
6227
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/brand/queryBrandList"), {
5166
6228
  pageSize: 5000,
5167
6229
  currentPage: 1,
5168
6230
  'ctl-withAuth': true
5169
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
6231
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/category/queryCategoryTree"), {
5170
6232
  pageSize: 5000,
5171
6233
  currentPage: 1
5172
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
6234
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/class/withProperty"), {
5173
6235
  pageSize: 5000,
5174
6236
  currentPage: 1
5175
6237
  })]).then(function (x) {
@@ -5260,7 +6322,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5260
6322
  }
5261
6323
  }
5262
6324
  }];
5263
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
6325
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
5264
6326
  pageSize: 5000,
5265
6327
  currentPage: 1,
5266
6328
  'qp-companyType-eq': 20
@@ -5448,14 +6510,14 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5448
6510
  label: '共享类型',
5449
6511
  initialSource: sharingTypeDataList
5450
6512
  }];
5451
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
6513
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
5452
6514
  pageSize: 5000,
5453
6515
  currentPage: 1,
5454
6516
  'qp-companyType-eq': '30'
5455
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
6517
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
5456
6518
  pageSize: 5000,
5457
6519
  currentPage: 1
5458
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
6520
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
5459
6521
  pageSize: 5000,
5460
6522
  currentPage: 1,
5461
6523
  'qp-companyType-eq': '20'
@@ -5553,7 +6615,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5553
6615
  }
5554
6616
  }
5555
6617
  }];
5556
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
6618
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {}), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
5557
6619
  formatSource(x, 0, 2, tableSearchForm);
5558
6620
  formatSource(x, 1, 3, tableSearchForm);
5559
6621
  });
@@ -5676,19 +6738,19 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5676
6738
  }
5677
6739
  }
5678
6740
  }];
5679
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
6741
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
5680
6742
  pageSize: 5000,
5681
6743
  currentPage: 1,
5682
6744
  'qp-companyType-eq': '30'
5683
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
6745
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
5684
6746
  pageSize: 5000,
5685
6747
  currentPage: 1,
5686
6748
  'qp-companyType-eq': '20'
5687
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/platformRecord/getPlatformRecordList"), {
6749
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/platformRecord/getPlatformRecordList"), {
5688
6750
  // pageSize: 5000,
5689
6751
  // currentPage: 1,
5690
6752
  'qp-status-eq': '1'
5691
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
6753
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
5692
6754
  pageSize: 5000,
5693
6755
  currentPage: 1
5694
6756
  })]).then(function (x) {
@@ -5776,7 +6838,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5776
6838
  }
5777
6839
  }
5778
6840
  }];
5779
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/orgView/getTree/sales-organizational-view"), {
6841
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/orgView/getTree/sales-organizational-view"), {
5780
6842
  'qp-employeeCode-eq': (_JSON$parse = JSON.parse(localStorage.getItem('userInfo') || '{}')) === null || _JSON$parse === void 0 ? void 0 : (_JSON$parse$employeeR = _JSON$parse.employeeResVo) === null || _JSON$parse$employeeR === void 0 ? void 0 : _JSON$parse$employeeR.employeeNumber,
5781
6843
  'qp-realOrg-eq': true,
5782
6844
  'qp-status-eq': 10
@@ -5903,7 +6965,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5903
6965
  name: 'qp-officeTelephone-like',
5904
6966
  label: '手机号'
5905
6967
  }];
5906
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
6968
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/company"), {
5907
6969
  pageSize: 5000,
5908
6970
  currentPage: 1,
5909
6971
  'qp-companyType-eq': 20
@@ -5978,7 +7040,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
5978
7040
  name: 'qp-officeTelephone-like',
5979
7041
  label: '手机号'
5980
7042
  }];
5981
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
7043
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/org/listNoPage"), {})]).then(function (x) {
5982
7044
  formatSource(x, 0, 2, tableSearchForm);
5983
7045
  });
5984
7046
  modalTableProps = _objectSpread2({
@@ -6074,10 +7136,10 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
6074
7136
  name: 'qp-remark-like',
6075
7137
  label: '备注'
6076
7138
  }];
6077
- Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/logisCompany"), {
7139
+ Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/logisCompany"), {
6078
7140
  pageSize: 5000,
6079
7141
  currentPage: 1
6080
- }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/printTemplate"), {
7142
+ }), loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/printTemplate"), {
6081
7143
  pageSize: 5000,
6082
7144
  currentPage: 1
6083
7145
  })]).then(function (x) {
@@ -6165,18 +7227,334 @@ var BusinessSearchSelect$1 = /*#__PURE__*/React__default['default'].memo(Busines
6165
7227
  return true;
6166
7228
  });
6167
7229
 
7230
+ var AddSkuSelect = function AddSkuSelect(parProps) {
7231
+ var selectProps = {
7232
+ mode: 'multiple'
7233
+ };
7234
+
7235
+ var _useState = React.useState((selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode) ? [] : null),
7236
+ _useState2 = _slicedToArray(_useState, 2),
7237
+ value = _useState2[0],
7238
+ setValue = _useState2[1];
7239
+
7240
+ var props = {
7241
+ buttonText: parProps.buttonText || '新增',
7242
+ value: value,
7243
+ // labelInValue: true, // 非必填 默认为false
7244
+ requestConfig: {
7245
+ url: "/items/sku/pager/v2",
7246
+ filter: 'qp-name-like',
7247
+ otherParams: {},
7248
+ mappingTextField: 'name',
7249
+ mappingValueField: 'skuCode'
7250
+ },
7251
+ selectProps: selectProps,
7252
+ onChange: function onChange(value) {
7253
+ console.log(value);
7254
+ setValue(value);
7255
+ },
7256
+ beforeShowModal: parProps === null || parProps === void 0 ? void 0 : parProps.beforeShowModal,
7257
+ onSaveCallback: parProps.onSaveCallback // onSaveCallback: (rows) => {
7258
+ // console.log('save call', rows);
7259
+ // // return Promise.resolve(true);
7260
+ // // return Promise.reject('FAILE')
7261
+ // }
7262
+
7263
+ };
7264
+ var modalTableProps = {
7265
+ modalTableTitle: '选择商品',
7266
+ tableSearchForm: [{
7267
+ name: 'qp-skuCode-like',
7268
+ label: 'SKU编码'
7269
+ }, {
7270
+ name: 'qp-skuName-like',
7271
+ label: 'SKU名称'
7272
+ }, {
7273
+ name: 'qp-brandId-in',
7274
+ type: 'select',
7275
+ label: '品牌',
7276
+ field: {
7277
+ type: 'select',
7278
+ props: {
7279
+ mode: 'multiple',
7280
+ notFoundContent: '暂无数据',
7281
+ allowClear: true,
7282
+ showSearch: true,
7283
+ showArrow: true,
7284
+ maxTagCount: 1,
7285
+ optionFilterProp: 'children',
7286
+ filterOption: function filterOption(input, option) {
7287
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
7288
+ }
7289
+ }
7290
+ }
7291
+ }, {
7292
+ name: 'qp-categoryId-in',
7293
+ type: 'treeSelect',
7294
+ label: '类目',
7295
+ field: {
7296
+ type: 'treeSelect',
7297
+ props: {
7298
+ treeData: [],
7299
+ treeCheckable: true,
7300
+ showSearch: true,
7301
+ allowClear: true,
7302
+ showArrow: true,
7303
+ treeNodeFilterProp: 'title',
7304
+ treeDefaultExpandAll: true,
7305
+ maxTagCount: 1,
7306
+ placeholder: '请选择',
7307
+ style: {
7308
+ width: '100%'
7309
+ },
7310
+ dropdownStyle: {
7311
+ maxHeight: 400,
7312
+ maxWidth: 100,
7313
+ overflow: 'auto'
7314
+ }
7315
+ }
7316
+ }
7317
+ }],
7318
+ tableColumns: [{
7319
+ title: 'SKU编码',
7320
+ width: 150,
7321
+ dataIndex: 'skuCode'
7322
+ }, {
7323
+ title: 'SKU名称',
7324
+ width: 200,
7325
+ ellipsis: {
7326
+ showTitle: false
7327
+ },
7328
+ render: function render(text) {
7329
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7330
+ placement: "topLeft",
7331
+ title: text
7332
+ }, text);
7333
+ },
7334
+ dataIndex: 'name'
7335
+ }, {
7336
+ title: '国际条码',
7337
+ width: 100,
7338
+ ellipsis: {
7339
+ showTitle: false
7340
+ },
7341
+ dataIndex: 'barCode',
7342
+ render: function render(text) {
7343
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7344
+ placement: "topLeft",
7345
+ title: text
7346
+ }, text);
7347
+ }
7348
+ }, {
7349
+ title: '所属SPU名称',
7350
+ width: 100,
7351
+ ellipsis: {
7352
+ showTitle: false
7353
+ },
7354
+ dataIndex: 'itemName',
7355
+ render: function render(text) {
7356
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7357
+ placement: "topLeft",
7358
+ title: text
7359
+ }, text);
7360
+ }
7361
+ }, {
7362
+ title: '所属SPU编码',
7363
+ width: 100,
7364
+ ellipsis: {
7365
+ showTitle: false
7366
+ },
7367
+ dataIndex: 'itemCode',
7368
+ render: function render(text) {
7369
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7370
+ placement: "topLeft",
7371
+ title: text
7372
+ }, text);
7373
+ }
7374
+ }, {
7375
+ title: '外部编码',
7376
+ width: 100,
7377
+ ellipsis: {
7378
+ showTitle: false
7379
+ },
7380
+ render: function render(text) {
7381
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7382
+ placement: "topLeft",
7383
+ title: text
7384
+ }, text);
7385
+ },
7386
+ dataIndex: 'externalCode'
7387
+ }, {
7388
+ title: '规格',
7389
+ width: 100,
7390
+ ellipsis: {
7391
+ showTitle: false
7392
+ },
7393
+ render: function render(text) {
7394
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7395
+ placement: "topLeft",
7396
+ title: text
7397
+ }, text);
7398
+ },
7399
+ dataIndex: 'propertyNameAndValue'
7400
+ }, {
7401
+ title: '类目',
7402
+ width: 100,
7403
+ ellipsis: {
7404
+ showTitle: false
7405
+ },
7406
+ render: function render(text) {
7407
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7408
+ placement: "topLeft",
7409
+ title: text
7410
+ }, text);
7411
+ },
7412
+ dataIndex: 'categoryName'
7413
+ }, {
7414
+ title: '品类',
7415
+ width: 100,
7416
+ ellipsis: {
7417
+ showTitle: false
7418
+ },
7419
+ render: function render(text) {
7420
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7421
+ placement: "topLeft",
7422
+ title: text
7423
+ }, text);
7424
+ },
7425
+ dataIndex: 'className'
7426
+ }, {
7427
+ title: '品牌',
7428
+ width: 100,
7429
+ ellipsis: {
7430
+ showTitle: false
7431
+ },
7432
+ render: function render(text) {
7433
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7434
+ placement: "topLeft",
7435
+ title: text
7436
+ }, text);
7437
+ },
7438
+ dataIndex: 'brandName'
7439
+ }],
7440
+ selectColumn: [{
7441
+ title: 'SKU编码',
7442
+ width: 150,
7443
+ dataIndex: 'skuCode'
7444
+ }, {
7445
+ title: 'SKU名称',
7446
+ width: 200,
7447
+ ellipsis: {
7448
+ showTitle: false
7449
+ },
7450
+ render: function render(text) {
7451
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7452
+ placement: "topLeft",
7453
+ title: text
7454
+ }, text);
7455
+ },
7456
+ dataIndex: 'name'
7457
+ }, {
7458
+ title: '数量',
7459
+ width: 100,
7460
+ isInputItem: true,
7461
+ dataIndex: 'count'
7462
+ }, {
7463
+ title: '单位',
7464
+ dataIndex: 'selectUnitCode',
7465
+ width: 80,
7466
+ ellipsis: {
7467
+ showTitle: false
7468
+ },
7469
+ render: function render(text, record) {
7470
+ var baseUnitCode = '';
7471
+
7472
+ if (record === null || record === void 0 ? void 0 : record.packingUnitList) {
7473
+ var base = record.packingUnitList.filter(function (item) {
7474
+ return item.unitCode;
7475
+ });
7476
+
7477
+ if (base.length) {
7478
+ var _base$;
7479
+
7480
+ baseUnitCode = base[0].unitCode;
7481
+ record.selectUnitCode = base[0].unitCode;
7482
+ record.selectedScale = ((_base$ = base[0]) === null || _base$ === void 0 ? void 0 : _base$.baseUnitScale) || 1;
7483
+ }
7484
+ }
7485
+
7486
+ if (baseUnitCode) {
7487
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
7488
+ defaultValue: baseUnitCode,
7489
+ onChange: function onChange(value) {
7490
+ var _record$packingUnitLi, _record$packingUnitLi2;
7491
+
7492
+ record.selectUnitCode = value;
7493
+ record.selectedScale = (record === null || record === void 0 ? void 0 : (_record$packingUnitLi = record.packingUnitList) === null || _record$packingUnitLi === void 0 ? void 0 : (_record$packingUnitLi2 = _record$packingUnitLi.find(function (item) {
7494
+ return item.unitCode === value;
7495
+ })) === null || _record$packingUnitLi2 === void 0 ? void 0 : _record$packingUnitLi2.baseUnitScale) || 1;
7496
+ },
7497
+ style: {
7498
+ width: '60px'
7499
+ }
7500
+ }, record.packingUnitList && record.packingUnitList.map(function (item) {
7501
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
7502
+ value: item.unitCode
7503
+ }, item.name);
7504
+ })));
7505
+ }
7506
+
7507
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
7508
+ }
7509
+ }, {
7510
+ title: '所属SPU编码',
7511
+ width: 150,
7512
+ ellipsis: {
7513
+ showTitle: false
7514
+ },
7515
+ dataIndex: 'itemCode',
7516
+ render: function render(text) {
7517
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7518
+ placement: "topLeft",
7519
+ title: text
7520
+ }, text);
7521
+ }
7522
+ }, {
7523
+ title: '规格',
7524
+ width: 200,
7525
+ ellipsis: {
7526
+ showTitle: false
7527
+ },
7528
+ render: function render(text) {
7529
+ return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
7530
+ placement: "topLeft",
7531
+ title: text
7532
+ }, text);
7533
+ },
7534
+ dataIndex: 'propertyNameAndValue'
7535
+ }]
7536
+ };
7537
+ return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(AddSelect, _objectSpread2(_objectSpread2({}, props), {}, {
7538
+ modalTableProps: modalTableProps
7539
+ })));
7540
+ };
7541
+
6168
7542
  var CommodityEntry = function CommodityEntry(props) {
6169
7543
  var dataValidationRef = React.useRef();
6170
7544
  var _props$buttonName = props.buttonName,
6171
7545
  buttonName = _props$buttonName === void 0 ? ' + 录入商品' : _props$buttonName,
6172
7546
  _props$modalTitle = props.modalTitle,
6173
7547
  modalTitle = _props$modalTitle === void 0 ? '录入商品' : _props$modalTitle,
7548
+ _props$buttonProps = props.buttonProps,
7549
+ buttonProps = _props$buttonProps === void 0 ? {} : _props$buttonProps,
6174
7550
  callbackHideModal = props.callbackHideModal,
6175
7551
  callbackHandleOk = props.callbackHandleOk,
6176
7552
  _props$columns = props.columns,
6177
7553
  columns = _props$columns === void 0 ? ["skuCode", "quantity", "price"] : _props$columns,
6178
7554
  _props$validDataUrl = props.validDataUrl,
6179
- validDataUrl = _props$validDataUrl === void 0 ? "/items/api/recordDetailImport/check" : _props$validDataUrl;
7555
+ validDataUrl = _props$validDataUrl === void 0 ? "/items/sku/import/check" : _props$validDataUrl,
7556
+ _props$isBrandAuth = props.isBrandAuth,
7557
+ isBrandAuth = _props$isBrandAuth === void 0 ? true : _props$isBrandAuth;
6180
7558
 
6181
7559
  var _useState = React.useState({
6182
7560
  maskClosable: false,
@@ -6227,9 +7605,9 @@ var CommodityEntry = function CommodityEntry(props) {
6227
7605
  modalProps.hideModal();
6228
7606
  };
6229
7607
 
6230
- return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
7608
+ return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Button, _objectSpread2({
6231
7609
  onClick: handleShowModal
6232
- }, buttonName), modalProps.visible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, _objectSpread2(_objectSpread2({}, modalProps), {}, {
7610
+ }, buttonProps), buttonName), modalProps.visible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, _objectSpread2(_objectSpread2({}, modalProps), {}, {
6233
7611
  onOk: handleOk,
6234
7612
  onCancel: handleCancel,
6235
7613
  destroyOnClose: true,
@@ -6239,7 +7617,8 @@ var CommodityEntry = function CommodityEntry(props) {
6239
7617
  dataValidationRef = ref;
6240
7618
  },
6241
7619
  columns: columns,
6242
- validDataUrl: validDataUrl
7620
+ validDataUrl: validDataUrl,
7621
+ isBrandAuth: isBrandAuth
6243
7622
  })) || '');
6244
7623
  };
6245
7624
 
@@ -6631,6 +8010,8 @@ if (localStorage.getItem('x-user-auth-context')) {
6631
8010
  axios__default['default'].defaults.headers.common['x-user-auth-context'] = localStorage.getItem('x-user-auth-context');
6632
8011
  }
6633
8012
 
8013
+ exports.AddSelect = AddSelect;
8014
+ exports.AddSkuSelect = AddSkuSelect;
6634
8015
  exports.BusinessSearchSelect = BusinessSearchSelect$1;
6635
8016
  exports.BusinessTreeSearchSelect = index$1;
6636
8017
  exports.CheckOneUser = index;