@kmkf-fe-packages/basic-components 2.0.79-beta.82 → 2.0.79-beta.83

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.esm.js CHANGED
@@ -21306,8 +21306,6 @@ var CustomizeUpload = function CustomizeUpload(_ref) {
21306
21306
  }))), renderImages());
21307
21307
  };
21308
21308
 
21309
- var expressDateInstance = ExpressData.getInstance();
21310
- var expressData = expressDateInstance.expressData;
21311
21309
  var refundTypeMap = {
21312
21310
  0: '其他',
21313
21311
  1: '已发货仅退款',
@@ -21367,216 +21365,218 @@ var consignTypeOptions = Object.entries(consignTypeMap).map(function (_ref5) {
21367
21365
  value: key
21368
21366
  };
21369
21367
  });
21370
- var orderSubformColumns = [{
21371
- dataIndex: 'title',
21372
- title: '商品名称',
21373
- widget: 'input',
21374
- widgetProps: {},
21375
- width: 150
21376
- }, {
21377
- dataIndex: 'productCode',
21378
- title: '商品编码',
21379
- widget: 'input',
21380
- width: 150,
21381
- widgetProps: {}
21382
- }, {
21383
- dataIndex: 'picUrl',
21384
- title: '图片',
21385
- widget: 'upload',
21386
- widgetProps: {},
21387
- width: 100,
21388
- customizeComponent: function customizeComponent(config) {
21389
- return /*#__PURE__*/React.createElement(CustomizeUpload, {
21390
- value: config.value,
21391
- onChange: config.onChange,
21392
- maxCount: config.maxCount,
21393
- maxSize: config.maxSize
21394
- });
21395
- }
21396
- }, {
21397
- dataIndex: 'numIid',
21398
- title: '商品id',
21399
- widget: 'input',
21400
- widgetProps: {},
21401
- width: 150
21402
- }, {
21403
- dataIndex: 'quantity',
21404
- title: '商品数量',
21405
- widget: 'inputNumber',
21406
- width: 100,
21407
- widgetProps: {
21408
- precision: 0,
21409
- min: 0
21410
- }
21411
- }, {
21412
- dataIndex: 'skuId',
21413
- title: 'SKU ID',
21414
- widget: 'input',
21415
- width: 150,
21416
- widgetProps: {}
21417
- }, {
21418
- dataIndex: 'outerSkuId',
21419
- title: 'SKU 编码',
21420
- widget: 'input',
21421
- width: 150,
21422
- widgetProps: {}
21423
- }, {
21424
- dataIndex: 'propertiesName',
21425
- title: 'SKU 信息',
21426
- widget: 'input',
21427
- width: 200,
21428
- widgetProps: {}
21429
- }, {
21430
- dataIndex: 'oid',
21431
- title: '子订单号',
21432
- widget: 'input',
21433
- width: 150,
21434
- widgetProps: {}
21435
- }, {
21436
- dataIndex: 'price',
21437
- title: '商品单价',
21438
- widget: 'inputNumber',
21439
- width: 100,
21440
- widgetProps: {
21441
- precision: 2,
21442
- min: 0
21443
- }
21444
- }, {
21445
- dataIndex: 'actualPayment',
21446
- title: '[子]实付金额',
21447
- widget: 'inputNumber',
21448
- width: 100,
21449
- widgetProps: {
21450
- precision: 2,
21451
- min: 0
21452
- }
21453
- }, {
21454
- dataIndex: 'expressLogisticsCode',
21455
- title: '[子]运单号',
21456
- widget: 'input',
21457
- width: 150,
21458
- widgetProps: {}
21459
- }, {
21460
- dataIndex: 'expressLogisticsCompany',
21461
- title: '[子]发货快递',
21462
- widget: 'select',
21463
- width: 150,
21464
- widgetProps: {
21465
- options: expressData,
21466
- showSearch: true,
21467
- allowClear: true
21468
- }
21469
- }, {
21470
- dataIndex: 'refundId',
21471
- title: '退款单ID',
21472
- widget: 'input',
21473
- width: 150,
21474
- widgetProps: {}
21475
- }, {
21476
- dataIndex: 'returnExpressLogisticsCode',
21477
- title: '退货物流单号',
21478
- widget: 'input',
21479
- width: 150,
21480
- widgetProps: {}
21481
- }, {
21482
- dataIndex: 'returnExpressLogisticsCompany',
21483
- title: '退货物流公司',
21484
- widget: 'select',
21485
- width: 150,
21486
- widgetProps: {
21487
- options: expressData,
21488
- showSearch: true,
21489
- allowClear: true
21490
- }
21491
- }, {
21492
- dataIndex: 'reason',
21493
- title: '退款原因',
21494
- widget: 'input',
21495
- width: 200,
21496
- widgetProps: {}
21497
- }, {
21498
- dataIndex: 'refundAmount',
21499
- title: '退款金额',
21500
- widget: 'inputNumber',
21501
- width: 100,
21502
- widgetProps: {
21503
- precision: 2,
21504
- min: 0
21505
- }
21506
- }, {
21507
- dataIndex: 'afterSaleType',
21508
- title: '退款类型',
21509
- widget: 'select',
21510
- width: 150,
21511
- widgetProps: {
21512
- options: refundTypeOptions,
21513
- showSearch: true,
21514
- allowClear: true
21515
- }
21516
- }, {
21517
- dataIndex: 'platformStatus',
21518
- title: '退款状态(平台)',
21519
- widget: 'input',
21520
- width: 150,
21521
- widgetProps: {}
21522
- }, {
21523
- dataIndex: 'onlineStatus',
21524
- title: '退款状态(快麦)',
21525
- widget: 'select',
21526
- width: 150,
21527
- widgetProps: {
21528
- options: onlineStatusOptions,
21529
- showSearch: true,
21530
- allowClear: true
21531
- }
21532
- }, {
21533
- dataIndex: 'applyTime',
21534
- title: '退款申请时间',
21535
- widget: 'datePicker',
21536
- width: 150,
21537
- widgetProps: {
21538
- showTime: true,
21539
- format: 'YYYY-MM-DD HH:mm:ss'
21540
- }
21541
- }, {
21542
- dataIndex: 'returnFreeShipping',
21543
- title: '退货免运费',
21544
- widget: 'input',
21545
- width: 150,
21546
- widgetProps: {}
21547
- }, {
21548
- dataIndex: 'isCNShipment',
21549
- title: '是否菜鸟仓发货',
21550
- widget: 'select',
21551
- width: 100,
21552
- widgetProps: {
21553
- options: consignTypeOptions,
21554
- showSearch: true,
21555
- allowClear: true
21556
- }
21557
- }];
21558
- var orderSubformColumnMap = orderSubformColumns.reduce(function (prv, next) {
21559
- prv[next.dataIndex] = next;
21560
- return prv;
21561
- }, {});
21562
- var selectWidgetMap = {
21563
- expressCode: function expressCode(code) {
21564
- return expressDateInstance === null || expressDateInstance === void 0 ? void 0 : expressDateInstance.getExpressNameByCode(code);
21565
- },
21566
- subExpressCode: function subExpressCode(code) {
21567
- return expressDateInstance === null || expressDateInstance === void 0 ? void 0 : expressDateInstance.getExpressNameByCode(code);
21568
- },
21569
- refundType: refundTypeMap,
21570
- consignType: consignTypeMap,
21571
- kmRefundStatus: onlineStatusMap
21368
+ var getOrderSubformColumns = function getOrderSubformColumns(parmas) {
21369
+ var _ref7 = parmas || {},
21370
+ _ref7$expressData = _ref7.expressData,
21371
+ expressData = _ref7$expressData === void 0 ? [] : _ref7$expressData;
21372
+ return [{
21373
+ dataIndex: 'title',
21374
+ title: '商品名称',
21375
+ widget: 'input',
21376
+ widgetProps: {},
21377
+ width: 150
21378
+ }, {
21379
+ dataIndex: 'productCode',
21380
+ title: '商品编码',
21381
+ widget: 'input',
21382
+ width: 150,
21383
+ widgetProps: {}
21384
+ }, {
21385
+ dataIndex: 'picUrl',
21386
+ title: '图片',
21387
+ widget: 'upload',
21388
+ widgetProps: {},
21389
+ width: 100,
21390
+ customizeComponent: function customizeComponent(config) {
21391
+ return /*#__PURE__*/React.createElement(CustomizeUpload, {
21392
+ value: config.value,
21393
+ onChange: config.onChange,
21394
+ maxCount: config.maxCount,
21395
+ maxSize: config.maxSize
21396
+ });
21397
+ }
21398
+ }, {
21399
+ dataIndex: 'numIid',
21400
+ title: '商品id',
21401
+ widget: 'input',
21402
+ widgetProps: {},
21403
+ width: 150
21404
+ }, {
21405
+ dataIndex: 'quantity',
21406
+ title: '商品数量',
21407
+ widget: 'inputNumber',
21408
+ width: 100,
21409
+ widgetProps: {
21410
+ precision: 0,
21411
+ min: 0
21412
+ }
21413
+ }, {
21414
+ dataIndex: 'skuId',
21415
+ title: 'SKU ID',
21416
+ widget: 'input',
21417
+ width: 150,
21418
+ widgetProps: {}
21419
+ }, {
21420
+ dataIndex: 'outerSkuId',
21421
+ title: 'SKU 编码',
21422
+ widget: 'input',
21423
+ width: 150,
21424
+ widgetProps: {}
21425
+ }, {
21426
+ dataIndex: 'propertiesName',
21427
+ title: 'SKU 信息',
21428
+ widget: 'input',
21429
+ width: 200,
21430
+ widgetProps: {}
21431
+ }, {
21432
+ dataIndex: 'oid',
21433
+ title: '子订单号',
21434
+ widget: 'input',
21435
+ width: 150,
21436
+ widgetProps: {}
21437
+ }, {
21438
+ dataIndex: 'price',
21439
+ title: '商品单价',
21440
+ widget: 'inputNumber',
21441
+ width: 100,
21442
+ widgetProps: {
21443
+ precision: 2,
21444
+ min: 0
21445
+ }
21446
+ }, {
21447
+ dataIndex: 'actualPayment',
21448
+ title: '[子]实付金额',
21449
+ widget: 'inputNumber',
21450
+ width: 100,
21451
+ widgetProps: {
21452
+ precision: 2,
21453
+ min: 0
21454
+ }
21455
+ }, {
21456
+ dataIndex: 'expressLogisticsCode',
21457
+ title: '[子]运单号',
21458
+ widget: 'input',
21459
+ width: 150,
21460
+ widgetProps: {}
21461
+ }, {
21462
+ dataIndex: 'expressLogisticsCompany',
21463
+ title: '[子]发货快递',
21464
+ widget: 'select',
21465
+ width: 150,
21466
+ widgetProps: {
21467
+ options: expressData,
21468
+ showSearch: true,
21469
+ allowClear: true
21470
+ }
21471
+ }, {
21472
+ dataIndex: 'refundId',
21473
+ title: '退款单ID',
21474
+ widget: 'input',
21475
+ width: 150,
21476
+ widgetProps: {}
21477
+ }, {
21478
+ dataIndex: 'returnExpressLogisticsCode',
21479
+ title: '退货物流单号',
21480
+ widget: 'input',
21481
+ width: 150,
21482
+ widgetProps: {}
21483
+ }, {
21484
+ dataIndex: 'returnExpressLogisticsCompany',
21485
+ title: '退货物流公司',
21486
+ widget: 'select',
21487
+ width: 150,
21488
+ widgetProps: {
21489
+ options: expressData,
21490
+ showSearch: true,
21491
+ allowClear: true
21492
+ }
21493
+ }, {
21494
+ dataIndex: 'reason',
21495
+ title: '退款原因',
21496
+ widget: 'input',
21497
+ width: 200,
21498
+ widgetProps: {}
21499
+ }, {
21500
+ dataIndex: 'refundAmount',
21501
+ title: '退款金额',
21502
+ widget: 'inputNumber',
21503
+ width: 100,
21504
+ widgetProps: {
21505
+ precision: 2,
21506
+ min: 0
21507
+ }
21508
+ }, {
21509
+ dataIndex: 'afterSaleType',
21510
+ title: '退款类型',
21511
+ widget: 'select',
21512
+ width: 150,
21513
+ widgetProps: {
21514
+ options: refundTypeOptions,
21515
+ showSearch: true,
21516
+ allowClear: true
21517
+ }
21518
+ }, {
21519
+ dataIndex: 'platformStatusText',
21520
+ title: '退款状态(平台)',
21521
+ widget: 'input',
21522
+ width: 150,
21523
+ widgetProps: {}
21524
+ }, {
21525
+ dataIndex: 'onlineStatus',
21526
+ title: '退款状态(快麦)',
21527
+ widget: 'select',
21528
+ width: 150,
21529
+ widgetProps: {
21530
+ options: onlineStatusOptions,
21531
+ showSearch: true,
21532
+ allowClear: true
21533
+ }
21534
+ }, {
21535
+ dataIndex: 'applyTime',
21536
+ title: '退款申请时间',
21537
+ widget: 'datePicker',
21538
+ width: 150,
21539
+ widgetProps: {
21540
+ showTime: true,
21541
+ format: 'YYYY-MM-DD HH:mm:ss'
21542
+ }
21543
+ }, {
21544
+ dataIndex: 'returnFreeShipping',
21545
+ title: '退货免运费',
21546
+ widget: 'input',
21547
+ width: 150,
21548
+ widgetProps: {}
21549
+ }, {
21550
+ dataIndex: 'isCNShipment',
21551
+ title: '是否菜鸟仓发货',
21552
+ widget: 'select',
21553
+ width: 100,
21554
+ widgetProps: {
21555
+ options: consignTypeOptions,
21556
+ showSearch: true,
21557
+ allowClear: true
21558
+ }
21559
+ }];
21560
+ };
21561
+ var getSelectWidgetMap = function getSelectWidgetMap(expressDateInstance) {
21562
+ return {
21563
+ expressLogisticsCompany: function expressLogisticsCompany(code) {
21564
+ return expressDateInstance === null || expressDateInstance === void 0 ? void 0 : expressDateInstance.getExpressNameByCode(code);
21565
+ },
21566
+ returnExpressLogisticsCompany: function returnExpressLogisticsCompany(code) {
21567
+ return expressDateInstance === null || expressDateInstance === void 0 ? void 0 : expressDateInstance.getExpressNameByCode(code);
21568
+ },
21569
+ afterSaleType: refundTypeMap,
21570
+ isCNShipment: consignTypeMap,
21571
+ onlineStatus: onlineStatusMap
21572
+ };
21572
21573
  };
21573
21574
  var orderSubFormConstants = {
21574
- orderSubformColumns: orderSubformColumns,
21575
- selectWidgetMap: selectWidgetMap,
21576
- orderSubformColumnMap: orderSubformColumnMap
21575
+ getSelectWidgetMap: getSelectWidgetMap,
21576
+ getOrderSubformColumns: getOrderSubformColumns
21577
21577
  };
21578
21578
 
21579
- var selectWidgetMap$1 = orderSubFormConstants.selectWidgetMap;
21579
+ var getSelectWidgetMap$1 = orderSubFormConstants.getSelectWidgetMap;
21580
21580
  var singletonMap$8 = new Map();
21581
21581
  var getOrderListSingleton$3 = function getOrderListSingleton(parmas) {
21582
21582
  var orderNo = parmas.orderNo,
@@ -21681,7 +21681,6 @@ var renderDate = function renderDate(value) {
21681
21681
  return value ? hooks(value).format('YYYY-MM-DD HH:mm:ss') : '';
21682
21682
  };
21683
21683
  var renderImages = function renderImages(value) {
21684
- console.log('renderImages', value);
21685
21684
  var list = value ? value.split(',') : [];
21686
21685
  return list.map(function (url) {
21687
21686
  var finalSrc = (url === null || url === void 0 ? void 0 : url.startsWith('http')) ? url : "https://kefu.kuaimai.com/".concat(url);
@@ -21695,11 +21694,13 @@ var renderImages = function renderImages(value) {
21695
21694
  var renderDetailItem = function renderDetailItem(_ref2) {
21696
21695
  var item = _ref2.item,
21697
21696
  val = _ref2.val;
21697
+ var expressDateInstance = ExpressData.getInstance();
21698
21698
  var Component = /*#__PURE__*/React.createElement(React.Fragment, null, "\u4E0D\u652F\u6301\u7684\u7C7B\u578B\u7EC4\u4EF6\uFF1A", JSON.stringify(item.widget));
21699
21699
  if (['input', 'inputNumber'].includes(item.widget)) {
21700
21700
  Component = val;
21701
21701
  } else if (item.widget === 'select') {
21702
- var mapValue = selectWidgetMap$1 === null || selectWidgetMap$1 === void 0 ? void 0 : selectWidgetMap$1[item.dataIndex];
21702
+ var _getSelectWidgetMap;
21703
+ var mapValue = (_getSelectWidgetMap = getSelectWidgetMap$1(expressDateInstance)) === null || _getSelectWidgetMap === void 0 ? void 0 : _getSelectWidgetMap[item.dataIndex];
21703
21704
  var selectValue;
21704
21705
  if (mapValue && typeof mapValue === 'function') {
21705
21706
  selectValue = mapValue === null || mapValue === void 0 ? void 0 : mapValue(val);
@@ -21720,8 +21721,7 @@ var utils = {
21720
21721
  renderDetailItem: renderDetailItem
21721
21722
  };
21722
21723
 
21723
- var orderSubformColumns$1 = orderSubFormConstants.orderSubformColumns,
21724
- orderSubformColumnMap$1 = orderSubFormConstants.orderSubformColumnMap;
21724
+ var getOrderSubformColumns$1 = orderSubFormConstants.getOrderSubformColumns;
21725
21725
  var renderEditItem$1 = utils.renderEditItem,
21726
21726
  renderDetailItem$1 = utils.renderDetailItem,
21727
21727
  getOrderListSingleton$4 = utils.getOrderListSingleton;
@@ -21736,38 +21736,46 @@ var OrderSubForm = function OrderSubForm(props) {
21736
21736
  manual = props.manual,
21737
21737
  correlationList = props.subConfig.correlationList,
21738
21738
  effects = props.effects;
21739
- console.log('orderForm', value);
21739
+ var valueRef = useRef(value);
21740
+ useEffect(function () {
21741
+ valueRef.current = value;
21742
+ return;
21743
+ }, [value]);
21740
21744
  var _useState = useState(null),
21741
21745
  _useState2 = _slicedToArray(_useState, 2),
21742
21746
  hoveredRowIndex = _useState2[0],
21743
21747
  setHoveredRowIndex = _useState2[1];
21744
- var updateHandle = function updateHandle(val, index, type) {
21745
- var _value$subOrderList;
21746
- if (value === null || value === void 0 ? void 0 : (_value$subOrderList = value.subOrderList) === null || _value$subOrderList === void 0 ? void 0 : _value$subOrderList.length) {
21747
- var subOrderList = JSON.parse(JSON.stringify(value === null || value === void 0 ? void 0 : value.subOrderList));
21748
+ var updateHandle = useCallback(function (val, index, type) {
21749
+ var _valueRef$current, _valueRef$current$sub;
21750
+ if ((_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : (_valueRef$current$sub = _valueRef$current.subOrderList) === null || _valueRef$current$sub === void 0 ? void 0 : _valueRef$current$sub.length) {
21751
+ var _valueRef$current2;
21752
+ var subOrderList = JSON.parse(JSON.stringify((_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.subOrderList));
21748
21753
  subOrderList[index][type] = val;
21749
- onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
21754
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
21750
21755
  subOrderList: subOrderList
21751
21756
  }));
21752
21757
  }
21753
- };
21758
+ }, [value === null || value === void 0 ? void 0 : value.subOrderList]);
21759
+ var orderSubformColumns = useMemo(function () {
21760
+ return getOrderSubformColumns$1({
21761
+ expressData: ExpressData.getInstance().getExpressData()
21762
+ });
21763
+ }, [ExpressData]);
21764
+ var orderSubformColumnMap = useMemo(function () {
21765
+ return orderSubformColumns.reduce(function (prv, next) {
21766
+ prv[next.dataIndex] = next;
21767
+ return prv;
21768
+ }, {});
21769
+ }, [orderSubformColumns]);
21754
21770
  var initColumns = useMemo(function () {
21755
21771
  return correlationList && (correlationList === null || correlationList === void 0 ? void 0 : correlationList.length) ? correlationList.map(function (t) {
21756
- return orderSubformColumnMap$1[t.dataIndex];
21757
- }) : orderSubformColumns$1;
21758
- }, [correlationList]);
21759
- // const initColumnsMap = useMemo(
21760
- // () =>
21761
- // initColumns.reduce((prv: any, next) => {
21762
- // prv[next.dataIndex] = next;
21763
- // return prv;
21764
- // }, {}),
21765
- // [initColumns],
21766
- // );
21772
+ return orderSubformColumnMap === null || orderSubformColumnMap === void 0 ? void 0 : orderSubformColumnMap[t === null || t === void 0 ? void 0 : t.dataIndex];
21773
+ }) : orderSubformColumns;
21774
+ }, [correlationList, orderSubformColumns]);
21767
21775
  var newTableHeader = useMemo(function () {
21768
21776
  return initColumns.reduce(function (prv, next) {
21769
21777
  var t = tableHeader.find(function (t) {
21770
- return t.key === next.dataIndex;
21778
+ return t.key === (next === null || next === void 0 ? void 0 : next.dataIndex);
21771
21779
  }) || {
21772
21780
  isShow: true,
21773
21781
  isEdit: false,
@@ -21775,77 +21783,80 @@ var OrderSubForm = function OrderSubForm(props) {
21775
21783
  width: 150
21776
21784
  };
21777
21785
  if (t && t.isShow) {
21778
- prv.push(_objectSpread2(_objectSpread2({}, next), t));
21786
+ prv.push(_objectSpread2(_objectSpread2(_objectSpread2({}, next), t), {}, {
21787
+ widgetProps: (next === null || next === void 0 ? void 0 : next.widgetProps) || {}
21788
+ }));
21779
21789
  }
21780
21790
  return prv;
21781
21791
  }, []);
21782
- }, [orderSubformColumns$1, tableHeader]);
21783
- var column = [{
21784
- dataIndex: 'index',
21785
- title: '序号',
21786
- width: 80,
21787
- render: function render(val, record, index) {
21788
- return /*#__PURE__*/React.createElement(HoverTableRowDeleteIcon, {
21789
- index: index,
21790
- hoveredRowIndex: hoveredRowIndex,
21791
- handleClick: function handleClick() {
21792
- return deleteHandle(record.uuid);
21793
- }
21794
- });
21795
- // return <div style={{ width: 25 }}>{index + 1}</div>;
21796
- }
21797
- }].concat(_toConsumableArray(newTableHeader.map(function (t) {
21798
- return _objectSpread2(_objectSpread2({}, t), {}, {
21799
- dataIndex: t.dataIndex,
21800
- title: /*#__PURE__*/React.createElement("span", null, t.isRequired ? /*#__PURE__*/React.createElement("span", {
21801
- style: {
21802
- color: 'red'
21803
- }
21804
- }, "*") : null, (t === null || t === void 0 ? void 0 : t.settingName) || t.title),
21805
- ellipsis: true,
21806
- width: t.width,
21792
+ }, [orderSubformColumns, tableHeader]);
21793
+ var column = useMemo(function () {
21794
+ return [{
21795
+ dataIndex: 'index',
21796
+ title: '序号',
21797
+ width: 80,
21807
21798
  render: function render(val, record, index) {
21808
- // const column = orderSubformColumnMap[t.dataIndex];
21809
- var isDisabled = t.isEdit || disabled;
21810
- return renderEditItem$1({
21811
- item: t || {},
21812
- val: val,
21813
- disabled: isDisabled,
21799
+ return /*#__PURE__*/React.createElement(HoverTableRowDeleteIcon, {
21814
21800
  index: index,
21815
- type: t.dataIndex,
21816
- updateHandle: updateHandle
21801
+ hoveredRowIndex: hoveredRowIndex,
21802
+ handleClick: function handleClick() {
21803
+ return deleteHandle(record.uuid);
21804
+ }
21817
21805
  });
21806
+ // return <div style={{ width: 25 }}>{index + 1}</div>;
21818
21807
  }
21819
- });
21820
- })), [disabled ? {} : {
21821
- dataIndex: 'operation',
21822
- title: '操作',
21823
- width: 70,
21824
- fixed: 'right',
21825
- render: function render(val, record, index) {
21826
- return /*#__PURE__*/React.createElement(Space, null, manual && /*#__PURE__*/React.createElement(Tooltip, {
21827
- title: "\u6DFB\u52A0"
21828
- }, /*#__PURE__*/React.createElement(PlusCircleFilled, {
21829
- style: {
21830
- fontSize: 18,
21831
- color: '#1890ff'
21832
- },
21833
- onClick: function onClick() {
21834
- return addHandle(index + 1);
21835
- }
21836
- })), /*#__PURE__*/React.createElement(Tooltip, {
21837
- title: "\u5220\u9664"
21838
- }, /*#__PURE__*/React.createElement(MinusCircleFilled, {
21839
- style: {
21840
- fontSize: 18
21841
- },
21842
- onClick: function onClick() {
21843
- return deleteHandle(record.uuid);
21808
+ }].concat(_toConsumableArray(newTableHeader.map(function (t) {
21809
+ return _objectSpread2(_objectSpread2({}, t), {}, {
21810
+ dataIndex: t === null || t === void 0 ? void 0 : t.dataIndex,
21811
+ title: /*#__PURE__*/React.createElement("span", null, t.isRequired ? /*#__PURE__*/React.createElement("span", {
21812
+ style: {
21813
+ color: 'red'
21814
+ }
21815
+ }, "*") : null, (t === null || t === void 0 ? void 0 : t.settingName) || t.title),
21816
+ ellipsis: true,
21817
+ width: Number(t.width),
21818
+ render: function render(val, record, index) {
21819
+ // const column = orderSubformColumnMap[t.dataIndex];
21820
+ var isDisabled = t.isEdit || disabled;
21821
+ return renderEditItem$1({
21822
+ item: t || {},
21823
+ val: val,
21824
+ disabled: isDisabled,
21825
+ index: index,
21826
+ type: t === null || t === void 0 ? void 0 : t.dataIndex,
21827
+ updateHandle: updateHandle
21828
+ });
21844
21829
  }
21845
- })));
21846
- }
21847
- }]);
21848
- console.log('value?.allOrders', value, (value === null || value === void 0 ? void 0 : value.allOrders) || []);
21830
+ });
21831
+ })), [disabled ? {} : {
21832
+ dataIndex: 'operation',
21833
+ title: '操作',
21834
+ width: 70,
21835
+ fixed: 'right',
21836
+ render: function render(val, record, index) {
21837
+ return /*#__PURE__*/React.createElement(Space, null, manual && /*#__PURE__*/React.createElement(Tooltip, {
21838
+ title: "\u6DFB\u52A0"
21839
+ }, /*#__PURE__*/React.createElement(PlusCircleFilled, {
21840
+ style: {
21841
+ fontSize: 18,
21842
+ color: '#1890ff'
21843
+ },
21844
+ onClick: function onClick() {
21845
+ return addHandle(index + 1);
21846
+ }
21847
+ })), /*#__PURE__*/React.createElement(Tooltip, {
21848
+ title: "\u5220\u9664"
21849
+ }, /*#__PURE__*/React.createElement(MinusCircleFilled, {
21850
+ style: {
21851
+ fontSize: 18
21852
+ },
21853
+ onClick: function onClick() {
21854
+ return deleteHandle(record.uuid);
21855
+ }
21856
+ })));
21857
+ }
21858
+ }]);
21859
+ }, [newTableHeader, disabled, updateHandle]);
21849
21860
  var orderModalColumns = useMemo(function () {
21850
21861
  return [{
21851
21862
  dataIndex: '',
@@ -21876,37 +21887,37 @@ var OrderSubForm = function OrderSubForm(props) {
21876
21887
  }, {});
21877
21888
  }, [newTableHeader]);
21878
21889
  var deleteHandle = function deleteHandle(uuid) {
21879
- var _value$subOrderList2;
21880
- var newList = value === null || value === void 0 ? void 0 : (_value$subOrderList2 = value.subOrderList) === null || _value$subOrderList2 === void 0 ? void 0 : _value$subOrderList2.filter(function (item) {
21890
+ var _valueRef$current3, _valueRef$current3$su;
21891
+ var newList = (_valueRef$current3 = valueRef.current) === null || _valueRef$current3 === void 0 ? void 0 : (_valueRef$current3$su = _valueRef$current3.subOrderList) === null || _valueRef$current3$su === void 0 ? void 0 : _valueRef$current3$su.filter(function (item) {
21881
21892
  return item.uuid !== uuid;
21882
21893
  });
21883
- onChange === null || onChange === void 0 ? void 0 : onChange(newList);
21894
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
21895
+ subOrderList: newList
21896
+ }));
21884
21897
  };
21885
21898
  var addHandle = function addHandle(index) {
21886
- var _value$subOrderList3;
21887
- if (maxCount && (value === null || value === void 0 ? void 0 : (_value$subOrderList3 = value.subOrderList) === null || _value$subOrderList3 === void 0 ? void 0 : _value$subOrderList3.length) >= maxCount) {
21899
+ var _valueRef$current4, _valueRef$current4$su, _valueRef$current5;
21900
+ if (maxCount && ((_valueRef$current4 = valueRef.current) === null || _valueRef$current4 === void 0 ? void 0 : (_valueRef$current4$su = _valueRef$current4.subOrderList) === null || _valueRef$current4$su === void 0 ? void 0 : _valueRef$current4$su.length) >= maxCount) {
21888
21901
  message.error("\u8BE5\u5B50\u8868\u5355\u6700\u591A\u6DFB\u52A0".concat(maxCount, "\u6761"));
21889
21902
  return;
21890
21903
  }
21891
- var subOrderList = _toConsumableArray((value === null || value === void 0 ? void 0 : value.subOrderList) || []);
21904
+ var subOrderList = _toConsumableArray(((_valueRef$current5 = valueRef.current) === null || _valueRef$current5 === void 0 ? void 0 : _valueRef$current5.subOrderList) || []);
21892
21905
  subOrderList.splice(index, 0, _objectSpread2(_objectSpread2({}, defaultValueMap), {}, {
21893
21906
  uuid: uuid()
21894
21907
  }));
21895
- onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
21908
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
21896
21909
  subOrderList: subOrderList
21897
21910
  }));
21898
21911
  };
21899
21912
  var getDataSourceAsync = function getDataSourceAsync() {
21900
- var _effects$form;
21901
- console.log('22222');
21913
+ var _effects$form, _valueRef$current6, _valueRef$current7;
21902
21914
  var _ref = (effects === null || effects === void 0 ? void 0 : (_effects$form = effects.form) === null || _effects$form === void 0 ? void 0 : _effects$form.getFieldsValue()) || {},
21903
21915
  _ref$shopId = _ref.shopId,
21904
21916
  shopId = _ref$shopId === void 0 ? '' : _ref$shopId;
21905
- return (value === null || value === void 0 ? void 0 : value.orderNo) && shopId ? getOrderListSingleton$4({
21906
- orderNo: value === null || value === void 0 ? void 0 : value.orderNo,
21917
+ return ((_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.orderNo) && shopId ? getOrderListSingleton$4({
21918
+ orderNo: (_valueRef$current7 = valueRef.current) === null || _valueRef$current7 === void 0 ? void 0 : _valueRef$current7.orderNo,
21907
21919
  shopId: shopId
21908
21920
  }).then(function (data) {
21909
- console.log('333');
21910
21921
  // const list = processAllOrders({
21911
21922
  // data,
21912
21923
  // orderNo: value?.orderNo,
@@ -21916,16 +21927,17 @@ var OrderSubForm = function OrderSubForm(props) {
21916
21927
  }) : Promise.resolve();
21917
21928
  };
21918
21929
  var getAllTradeGoodsDetails = function getAllTradeGoodsDetails() {
21919
- var goodDetails = (value === null || value === void 0 ? void 0 : value.allOrders) || [];
21930
+ var _valueRef$current8;
21931
+ var goodDetails = ((_valueRef$current8 = valueRef.current) === null || _valueRef$current8 === void 0 ? void 0 : _valueRef$current8.allOrders) || [];
21920
21932
  return goodDetails;
21921
21933
  };
21922
21934
  var selectedGoodsChange = useCallback(function (skuList) {
21923
- var _uniqBy;
21924
- var newValue = _objectSpread2({}, value);
21935
+ var _valueRef$current9, _uniqBy;
21936
+ var newValue = _objectSpread2({}, valueRef.current);
21925
21937
  // 原订单商品
21926
21938
  var originTradeGoodList = getAllTradeGoodsDetails() || [];
21927
21939
  // 当前选中的所有商品【包含了原订单+商品库】
21928
- var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value.subOrderList) || [];
21940
+ var currentSelectGoodList = ((_valueRef$current9 = valueRef.current) === null || _valueRef$current9 === void 0 ? void 0 : _valueRef$current9.subOrderList) || [];
21929
21941
  newValue['subOrderList'] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
21930
21942
  return skuList.includes(item.uuid);
21931
21943
  });
@@ -21933,8 +21945,8 @@ var OrderSubForm = function OrderSubForm(props) {
21933
21945
  }, [value === null || value === void 0 ? void 0 : value.subOrderList]);
21934
21946
  // TODO: 商品订单中以选中商品
21935
21947
  var selectedGoods = useMemo(function () {
21936
- var _value$subOrderList4;
21937
- return value === null || value === void 0 ? void 0 : (_value$subOrderList4 = value.subOrderList) === null || _value$subOrderList4 === void 0 ? void 0 : _value$subOrderList4.map(function (v) {
21948
+ var _valueRef$current10, _valueRef$current10$s;
21949
+ return (_valueRef$current10 = valueRef.current) === null || _valueRef$current10 === void 0 ? void 0 : (_valueRef$current10$s = _valueRef$current10.subOrderList) === null || _valueRef$current10$s === void 0 ? void 0 : _valueRef$current10$s.map(function (v) {
21938
21950
  return v === null || v === void 0 ? void 0 : v.uuid;
21939
21951
  });
21940
21952
  }, [value === null || value === void 0 ? void 0 : value.subOrderList]);
@@ -21952,7 +21964,7 @@ var OrderSubForm = function OrderSubForm(props) {
21952
21964
  width: 850
21953
21965
  })), /*#__PURE__*/React.createElement(Table, {
21954
21966
  columns: column,
21955
- dataSource: value === null || value === void 0 ? void 0 : value.subOrderList,
21967
+ dataSource: (value === null || value === void 0 ? void 0 : value.subOrderList) || [],
21956
21968
  rowKey: 'uuid',
21957
21969
  size: "small",
21958
21970
  pagination: false,