@kmkf-fe-packages/basic-components 2.10.9-beta.21 → 2.10.9-beta.23

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
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useMemo, useEffect, useRef, forwardRef, useImperativeHandle, useCallback } from 'react';
2
- import { Cascader, DatePicker, Image, InputNumber, Input, Select, Upload, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate as Rate$1, Form, Popover, Tooltip, Table, Tabs, ConfigProvider, Pagination, Typography, Skeleton, Empty, Tag } from 'antd';
2
+ import { Cascader, DatePicker, Image, InputNumber, Input, Select, Upload, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate as Rate$1, Form, Popover, Tooltip, Table, Tabs, ConfigProvider, Pagination, Typography, Empty, Skeleton, Tag } from 'antd';
3
3
  import { EyeOutlined, DeleteOutlined, CloseOutlined, PlusSquareOutlined, MinusCircleFilled, PlusCircleFilled, CopyOutlined, CloseCircleOutlined, CaretUpOutlined, UpOutlined, DownOutlined, PlusOutlined, VideoCameraTwoTone } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
5
5
  import { CopyToClipboard } from 'react-copy-to-clipboard';
@@ -13419,7 +13419,6 @@ var Item = Form.Item;
13419
13419
  var LogisticsInterception = function LogisticsInterception(props) {
13420
13420
  var _value$interceptLogis3, _value$interceptLogis4, _value$interceptLogis5;
13421
13421
  var LogisticsAddress = LogisticsAddressData.getInstance();
13422
- var LogisticsAddressOptions = (LogisticsAddress === null || LogisticsAddress === void 0 ? void 0 : LogisticsAddress.getAddressData()) || [];
13423
13422
  var address = AddressData.getInstance();
13424
13423
  var _props$value = props.value,
13425
13424
  value = _props$value === void 0 ? {} : _props$value,
@@ -13457,6 +13456,12 @@ var LogisticsInterception = function LogisticsInterception(props) {
13457
13456
  _useState8 = _slicedToArray(_useState7, 2),
13458
13457
  isInterface = _useState8[0],
13459
13458
  setIsInterface = _useState8[1];
13459
+ var _useState9 = useState(function () {
13460
+ return (LogisticsAddress === null || LogisticsAddress === void 0 ? void 0 : LogisticsAddress.getAddressData()) || [];
13461
+ }),
13462
+ _useState10 = _slicedToArray(_useState9, 2),
13463
+ logisticsAddressData = _useState10[0],
13464
+ setLogisticsAddressData = _useState10[1];
13460
13465
  useEffect(function () {
13461
13466
  if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) {
13462
13467
  setTypeOptions([]);
@@ -13554,13 +13559,13 @@ var LogisticsInterception = function LogisticsInterception(props) {
13554
13559
  var baseFieldDisabled = disabled || isEdit && !canEditPreCreateBaseFields;
13555
13560
  //退回地址列表
13556
13561
  var logisticsAddressOptions = useMemo(function () {
13557
- return LogisticsAddressOptions === null || LogisticsAddressOptions === void 0 ? void 0 : LogisticsAddressOptions.filter(function (item) {
13562
+ return logisticsAddressData === null || logisticsAddressData === void 0 ? void 0 : logisticsAddressData.filter(function (item) {
13558
13563
  return item.cpCode === (value === null || value === void 0 ? void 0 : value.interceptCompany);
13559
13564
  });
13560
- }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
13565
+ }, [logisticsAddressData, value === null || value === void 0 ? void 0 : value.interceptCompany]);
13561
13566
  // K码列表
13562
13567
  var kCodeList = useMemo(function () {
13563
- return LogisticsAddressOptions === null || LogisticsAddressOptions === void 0 ? void 0 : LogisticsAddressOptions.filter(function (item) {
13568
+ return logisticsAddressData === null || logisticsAddressData === void 0 ? void 0 : logisticsAddressData.filter(function (item) {
13564
13569
  return item.cpCode === (value === null || value === void 0 ? void 0 : value.interceptCompany) && item.userKCode;
13565
13570
  }).map(function (item) {
13566
13571
  return _objectSpread2(_objectSpread2({}, item), {}, {
@@ -13568,10 +13573,45 @@ var LogisticsInterception = function LogisticsInterception(props) {
13568
13573
  label: item === null || item === void 0 ? void 0 : item.userKCode
13569
13574
  });
13570
13575
  });
13571
- }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
13576
+ }, [logisticsAddressData, value === null || value === void 0 ? void 0 : value.interceptCompany]);
13572
13577
  var customerCodeOptions = useMemo(function () {
13573
- return getJdCustomerCodeOptions(LogisticsAddressOptions, value === null || value === void 0 ? void 0 : value.interceptCompany);
13574
- }, [LogisticsAddressOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
13578
+ return getJdCustomerCodeOptions(logisticsAddressData);
13579
+ }, [logisticsAddressData]);
13580
+ var refreshLogisticsAddressOptions = /*#__PURE__*/function () {
13581
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
13582
+ var _yield$request, data, latestData;
13583
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
13584
+ while (1) switch (_context.prev = _context.next) {
13585
+ case 0:
13586
+ _context.prev = 0;
13587
+ _context.next = 3;
13588
+ return request$1({
13589
+ url: '/qy/userConfig/listLogisticsAddress',
13590
+ method: 'get',
13591
+ data: {}
13592
+ });
13593
+ case 3:
13594
+ _yield$request = _context.sent;
13595
+ data = _yield$request.data;
13596
+ latestData = data || [];
13597
+ LogisticsAddress.setaddressData(latestData);
13598
+ setLogisticsAddressData(latestData);
13599
+ _context.next = 13;
13600
+ break;
13601
+ case 10:
13602
+ _context.prev = 10;
13603
+ _context.t0 = _context["catch"](0);
13604
+ console.log(_context.t0);
13605
+ case 13:
13606
+ case "end":
13607
+ return _context.stop();
13608
+ }
13609
+ }, _callee, null, [[0, 10]]);
13610
+ }));
13611
+ return function refreshLogisticsAddressOptions() {
13612
+ return _ref.apply(this, arguments);
13613
+ };
13614
+ }();
13575
13615
  var returnValue = useMemo(function () {
13576
13616
  var _value$interceptAddre, _value$interceptAddre2, _value$interceptAddre3;
13577
13617
  var uk = LogisticsAddress === null || LogisticsAddress === void 0 ? void 0 : LogisticsAddress.getUkByInfo({
@@ -13734,7 +13774,10 @@ var LogisticsInterception = function LogisticsInterception(props) {
13734
13774
  },
13735
13775
  onClick: function onClick() {
13736
13776
  return onJumpPage && (onJumpPage === null || onJumpPage === void 0 ? void 0 : onJumpPage({
13737
- type: 'interceptConfig'
13777
+ type: 'interceptConfig',
13778
+ state: {
13779
+ tab: 'JDLCodeRelation'
13780
+ }
13738
13781
  }));
13739
13782
  }
13740
13783
  }, 'K码/EBU码配置>>')) : null),
@@ -13752,6 +13795,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
13752
13795
  onChange: function onChange(val) {
13753
13796
  return changeHandle(val, 'interceptLogisticsCustomerCode');
13754
13797
  },
13798
+ onFocus: refreshLogisticsAddressOptions,
13755
13799
  options: customerCodeOptions,
13756
13800
  value: value === null || value === void 0 ? void 0 : value.interceptLogisticsCustomerCode,
13757
13801
  filterOption: function filterOption(input, option) {
@@ -16324,11 +16368,17 @@ var OptionalInput = function OptionalInput(props) {
16324
16368
  });
16325
16369
  }
16326
16370
  };
16371
+ var handleBlur = function handleBlur(event) {
16372
+ var nextTarget = event.relatedTarget;
16373
+ if (nextTarget && event.currentTarget.contains(nextTarget)) return;
16374
+ if (typeof onBlur === 'function') onBlur(event);
16375
+ };
16327
16376
  return /*#__PURE__*/React.createElement("div", {
16328
16377
  style: {
16329
16378
  display: 'flex',
16330
16379
  alignItems: 'center'
16331
- }
16380
+ },
16381
+ onBlur: handleBlur
16332
16382
  }, /*#__PURE__*/React.createElement(Select, {
16333
16383
  className: "optional-input-select",
16334
16384
  style: {
@@ -16336,8 +16386,7 @@ var OptionalInput = function OptionalInput(props) {
16336
16386
  },
16337
16387
  options: compareSymbolList,
16338
16388
  onChange: handleSelectChange,
16339
- value: (value === null || value === void 0 ? void 0 : value.type) || 'like',
16340
- onBlur: onBlur
16389
+ value: (value === null || value === void 0 ? void 0 : value.type) || 'like'
16341
16390
  }), /*#__PURE__*/React.createElement(Input, _objectSpread2({
16342
16391
  style: {
16343
16392
  width: '150px'
@@ -16346,11 +16395,32 @@ var OptionalInput = function OptionalInput(props) {
16346
16395
  placeholder: placeholder,
16347
16396
  onChange: handleInputChange,
16348
16397
  onPressEnter: onPressEnter,
16349
- onBlur: onBlur,
16350
16398
  value: value === null || value === void 0 ? void 0 : value.inputValue
16351
16399
  }, formItemProps)));
16352
16400
  };
16353
16401
 
16402
+ var transformFormData = function transformFormData(formData) {
16403
+ var conditionList = [];
16404
+ for (var key in formData) {
16405
+ if (formData[key]) {
16406
+ var _formData$key, _formData$key2, _formData$key3, _formData$key4;
16407
+ var value = ((_formData$key = formData[key]) === null || _formData$key === void 0 ? void 0 : _formData$key.type) ? (_formData$key2 = formData[key]) === null || _formData$key2 === void 0 ? void 0 : _formData$key2.inputValue : formData[key];
16408
+ var compareSymbol = ((_formData$key3 = formData[key]) === null || _formData$key3 === void 0 ? void 0 : _formData$key3.type) ? (_formData$key4 = formData[key]) === null || _formData$key4 === void 0 ? void 0 : _formData$key4.type : Array.isArray(value) ? 'eq' : 'like';
16409
+ conditionList.push({
16410
+ leftValue: key,
16411
+ compareSymbol: compareSymbol,
16412
+ rightValue: value
16413
+ });
16414
+ }
16415
+ }
16416
+ return conditionList;
16417
+ };
16418
+ var shouldSubmitOnBlur = function shouldSubmitOnBlur(relatedTarget) {
16419
+ var _target$closest;
16420
+ var target = relatedTarget;
16421
+ return !(target === null || target === void 0 ? void 0 : (_target$closest = target.closest) === null || _target$closest === void 0 ? void 0 : _target$closest.call(target, '.search-form-actions'));
16422
+ };
16423
+
16354
16424
  function SearchForm(_ref) {
16355
16425
  var searchFormData = _ref.searchFormData,
16356
16426
  form = _ref.form,
@@ -16385,6 +16455,10 @@ function SearchForm(_ref) {
16385
16455
  return _ref2.apply(this, arguments);
16386
16456
  };
16387
16457
  }();
16458
+ var submitFormOnBlur = function submitFormOnBlur(event) {
16459
+ if (!shouldSubmitOnBlur(event.relatedTarget)) return;
16460
+ submitForm();
16461
+ };
16388
16462
  return /*#__PURE__*/React.createElement(Form, {
16389
16463
  layout: "inline",
16390
16464
  form: form,
@@ -16406,9 +16480,7 @@ function SearchForm(_ref) {
16406
16480
  onPressEnter: function onPressEnter() {
16407
16481
  return submitForm();
16408
16482
  },
16409
- onBlur: function onBlur() {
16410
- return submitForm();
16411
- },
16483
+ onBlur: submitFormOnBlur,
16412
16484
  placeholder: label,
16413
16485
  formItemProps: formItemProps
16414
16486
  }) : type === 'select' ? /*#__PURE__*/React.createElement(Select, _objectSpread2({
@@ -16418,9 +16490,7 @@ function SearchForm(_ref) {
16418
16490
  style: {
16419
16491
  width: 150
16420
16492
  },
16421
- onBlur: function onBlur() {
16422
- return submitForm();
16423
- }
16493
+ onBlur: submitFormOnBlur
16424
16494
  }, formItemProps)) : /*#__PURE__*/React.createElement(Input, _objectSpread2({
16425
16495
  placeholder: label,
16426
16496
  allowClear: true,
@@ -16430,9 +16500,7 @@ function SearchForm(_ref) {
16430
16500
  onPressEnter: function onPressEnter() {
16431
16501
  return submitForm();
16432
16502
  },
16433
- onBlur: function onBlur() {
16434
- return submitForm();
16435
- }
16503
+ onBlur: submitFormOnBlur
16436
16504
  }, formItemProps)));
16437
16505
  }), /*#__PURE__*/React.createElement(Form.Item, {
16438
16506
  style: {
@@ -16452,21 +16520,200 @@ function SearchForm(_ref) {
16452
16520
  }, "\u91CD\u7F6E")));
16453
16521
  }
16454
16522
 
16455
- var transformFormData = function transformFormData(formData) {
16456
- var conditionList = [];
16457
- for (var key in formData) {
16458
- if (formData[key]) {
16459
- var _formData$key, _formData$key2, _formData$key3, _formData$key4;
16460
- var value = ((_formData$key = formData[key]) === null || _formData$key === void 0 ? void 0 : _formData$key.type) ? (_formData$key2 = formData[key]) === null || _formData$key2 === void 0 ? void 0 : _formData$key2.inputValue : formData[key];
16461
- var compareSymbol = ((_formData$key3 = formData[key]) === null || _formData$key3 === void 0 ? void 0 : _formData$key3.type) ? (_formData$key4 = formData[key]) === null || _formData$key4 === void 0 ? void 0 : _formData$key4.type : Array.isArray(value) ? 'eq' : 'like';
16462
- conditionList.push({
16463
- leftValue: key,
16464
- compareSymbol: compareSymbol,
16465
- rightValue: value
16523
+ var ACTION_CONFIG = {
16524
+ JST_ERP: [{
16525
+ sourceField: 'styleCode',
16526
+ requestField: 'styleCodes'
16527
+ }, {
16528
+ sourceField: 'goodNo',
16529
+ requestField: 'goodNos'
16530
+ }],
16531
+ WLN_ERP: [{
16532
+ sourceField: 'goodNo',
16533
+ requestField: 'goodNos'
16534
+ }, {
16535
+ sourceField: 'specNo',
16536
+ requestField: 'skuCodes'
16537
+ }],
16538
+ WDT_ERP: [{
16539
+ sourceField: 'goodNo',
16540
+ requestField: 'goodNos'
16541
+ }, {
16542
+ sourceField: 'skuCode',
16543
+ requestField: 'skuCodes'
16544
+ }],
16545
+ GY_ERP: [{
16546
+ sourceField: 'goodNo',
16547
+ requestField: 'goodNos'
16548
+ }],
16549
+ JY_ERP: [{
16550
+ sourceField: 'goodNo',
16551
+ requestField: 'goodNos'
16552
+ }, {
16553
+ sourceField: 'skuCode',
16554
+ requestField: 'skuCodes'
16555
+ }],
16556
+ KM_ERP: [{
16557
+ sourceField: 'goodNo',
16558
+ requestField: 'goodNos'
16559
+ }, {
16560
+ sourceField: 'skuCode',
16561
+ requestField: 'skuCodes'
16562
+ }]
16563
+ };
16564
+ var getSearchValue = function getSearchValue(value) {
16565
+ var _value$inputValue;
16566
+ var inputValue = (_value$inputValue = value === null || value === void 0 ? void 0 : value.inputValue) !== null && _value$inputValue !== void 0 ? _value$inputValue : value;
16567
+ if (inputValue === undefined || inputValue === null) return '';
16568
+ return String(inputValue).trim();
16569
+ };
16570
+ var getSkuType = function getSkuType(platform, formData) {
16571
+ if (platform !== 'JST_ERP' && platform !== 'WLN_ERP') return undefined;
16572
+ var values = Array.isArray(formData.skuType) ? formData.skuType : [formData.skuType];
16573
+ var skuTypes = values.filter(function (value) {
16574
+ return value === 'normal' || value === 'combine';
16575
+ });
16576
+ return skuTypes.length === 1 ? skuTypes[0] : undefined;
16577
+ };
16578
+ var getReSyncActions = function getReSyncActions(platform, total, formData) {
16579
+ if (total !== 0) return [];
16580
+ var skuType = getSkuType(platform, formData);
16581
+ var requestData = _objectSpread2({
16582
+ platform: platform
16583
+ }, skuType ? {
16584
+ skuType: skuType
16585
+ } : {});
16586
+ var values = [];
16587
+ ACTION_CONFIG[platform].forEach(function (config) {
16588
+ var value = getSearchValue(formData[config.sourceField]);
16589
+ if (!value) return;
16590
+ requestData[config.requestField] = [value];
16591
+ values.push(value);
16592
+ });
16593
+ if (!values.length) return [];
16594
+ return [{
16595
+ key: 'goods',
16596
+ label: '同步商品',
16597
+ targetName: '商品',
16598
+ value: values.join('、'),
16599
+ requestData: requestData
16600
+ }];
16601
+ };
16602
+
16603
+ var useGoodsReSyncQuery = function useGoodsReSyncQuery(service) {
16604
+ var _React$useState = React.useState({
16605
+ total: null,
16606
+ formData: {}
16607
+ }),
16608
+ _React$useState2 = _slicedToArray(_React$useState, 2),
16609
+ queryState = _React$useState2[0],
16610
+ setQueryState = _React$useState2[1];
16611
+ var serviceWithReSyncState = React.useCallback(function (pagination, formData) {
16612
+ var currentFormData = formData;
16613
+ setQueryState({
16614
+ total: null,
16615
+ formData: currentFormData
16616
+ });
16617
+ return service(pagination, formData).then(function (result) {
16618
+ setQueryState({
16619
+ total: result.total,
16620
+ formData: currentFormData
16466
16621
  });
16467
- }
16468
- }
16469
- return conditionList;
16622
+ return result;
16623
+ }, function (error) {
16624
+ setQueryState({
16625
+ total: null,
16626
+ formData: currentFormData
16627
+ });
16628
+ throw error;
16629
+ });
16630
+ }, [service]);
16631
+ return [serviceWithReSyncState, queryState];
16632
+ };
16633
+ var getErrorMessage = function getErrorMessage(error, action) {
16634
+ var _error$data;
16635
+ return (error === null || error === void 0 ? void 0 : (_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.message) || (error === null || error === void 0 ? void 0 : error.message) || "".concat(action.label, "\u5931\u8D25");
16636
+ };
16637
+ var GoodsReSync = function GoodsReSync(_ref) {
16638
+ var platform = _ref.platform,
16639
+ queryState = _ref.queryState,
16640
+ onSuccess = _ref.onSuccess;
16641
+ var _React$useState3 = React.useState(null),
16642
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
16643
+ loadingAction = _React$useState4[0],
16644
+ setLoadingAction = _React$useState4[1];
16645
+ var actions = getReSyncActions(platform, queryState.total, queryState.formData);
16646
+ var handleReSync = function handleReSync(action) {
16647
+ Modal.confirm({
16648
+ title: "\u786E\u8BA4".concat(action.label),
16649
+ content: "\u5C06\u4ECE ERP \u91CD\u65B0\u62C9\u53D6".concat(action.targetName, "\u201C").concat(action.value, "\u201D\u5E76\u8986\u76D6\u672C\u5730\u6570\u636E"),
16650
+ okText: '确认同步',
16651
+ cancelText: '取消',
16652
+ onOk: function () {
16653
+ var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
16654
+ var response;
16655
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
16656
+ while (1) switch (_context.prev = _context.next) {
16657
+ case 0:
16658
+ setLoadingAction(action.key);
16659
+ _context.prev = 1;
16660
+ _context.next = 4;
16661
+ return extendRequest('/qy/gdfw/product/reSync', {
16662
+ method: 'post',
16663
+ timeout: 60000,
16664
+ data: action.requestData
16665
+ });
16666
+ case 4:
16667
+ response = _context.sent;
16668
+ if (!((response === null || response === void 0 ? void 0 : response.success) === false)) {
16669
+ _context.next = 7;
16670
+ break;
16671
+ }
16672
+ throw new Error(response.message || "".concat(action.label, "\u5931\u8D25"));
16673
+ case 7:
16674
+ message.success((response === null || response === void 0 ? void 0 : response.message) || "".concat(action.label, "\u6210\u529F"));
16675
+ _context.next = 10;
16676
+ return onSuccess();
16677
+ case 10:
16678
+ _context.next = 16;
16679
+ break;
16680
+ case 12:
16681
+ _context.prev = 12;
16682
+ _context.t0 = _context["catch"](1);
16683
+ message.error(getErrorMessage(_context.t0, action));
16684
+ throw _context.t0;
16685
+ case 16:
16686
+ _context.prev = 16;
16687
+ setLoadingAction(null);
16688
+ return _context.finish(16);
16689
+ case 19:
16690
+ case "end":
16691
+ return _context.stop();
16692
+ }
16693
+ }, _callee, null, [[1, 12, 16, 19]]);
16694
+ }));
16695
+ function onOk() {
16696
+ return _onOk.apply(this, arguments);
16697
+ }
16698
+ return onOk;
16699
+ }()
16700
+ });
16701
+ };
16702
+ return /*#__PURE__*/React.createElement(Empty, {
16703
+ image: Empty.PRESENTED_IMAGE_SIMPLE,
16704
+ description: actions.length ? /*#__PURE__*/React.createElement(Space, {
16705
+ size: 8
16706
+ }, actions.map(function (action) {
16707
+ return /*#__PURE__*/React.createElement(Button, {
16708
+ key: action.key,
16709
+ loading: loadingAction === action.key,
16710
+ disabled: loadingAction !== null && loadingAction !== action.key,
16711
+ onClick: function onClick() {
16712
+ return handleReSync(action);
16713
+ }
16714
+ }, action.label);
16715
+ })) : '暂无数据'
16716
+ });
16470
16717
  };
16471
16718
 
16472
16719
  var getTableData = function getTableData(_ref, formData) {
@@ -16526,13 +16773,16 @@ var GoodList = function GoodList(props, ref) {
16526
16773
  var _Form$useForm = Form.useForm(),
16527
16774
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
16528
16775
  form = _Form$useForm2[0];
16529
- var _useAntdTable = useAntdTable(getTableData, {
16776
+ var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData),
16777
+ _useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
16778
+ getTableDataWithReSync = _useGoodsReSyncQuery2[0],
16779
+ reSyncQueryState = _useGoodsReSyncQuery2[1];
16780
+ var _useAntdTable = useAntdTable(getTableDataWithReSync, {
16530
16781
  defaultPageSize: 10,
16531
16782
  form: form
16532
16783
  }),
16533
16784
  tableProps = _useAntdTable.tableProps,
16534
- search = _useAntdTable.search,
16535
- params = _useAntdTable.params;
16785
+ search = _useAntdTable.search;
16536
16786
  var submit = search.submit,
16537
16787
  reset = search.reset;
16538
16788
  var setGoodBrandList = function setGoodBrandList() {
@@ -16731,6 +16981,13 @@ var GoodList = function GoodList(props, ref) {
16731
16981
  y: 250
16732
16982
  }
16733
16983
  }, tableProps), {}, {
16984
+ locale: {
16985
+ emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
16986
+ platform: "WDT_ERP",
16987
+ queryState: reSyncQueryState,
16988
+ onSuccess: submit
16989
+ })
16990
+ },
16734
16991
  size: "small"
16735
16992
  }))), /*#__PURE__*/React.createElement(Popover, {
16736
16993
  getPopupContainer: function getPopupContainer(triggerNode) {
@@ -16875,13 +17132,16 @@ var GoodList$1 = function GoodList(props, ref) {
16875
17132
  var _Form$useForm = Form.useForm(),
16876
17133
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
16877
17134
  form = _Form$useForm2[0];
16878
- var _useAntdTable = useAntdTable(getTableData$1, {
17135
+ var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$1),
17136
+ _useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
17137
+ getTableDataWithReSync = _useGoodsReSyncQuery2[0],
17138
+ reSyncQueryState = _useGoodsReSyncQuery2[1];
17139
+ var _useAntdTable = useAntdTable(getTableDataWithReSync, {
16879
17140
  defaultPageSize: 10,
16880
17141
  form: form
16881
17142
  }),
16882
17143
  tableProps = _useAntdTable.tableProps,
16883
- search = _useAntdTable.search,
16884
- params = _useAntdTable.params;
17144
+ search = _useAntdTable.search;
16885
17145
  var submit = search.submit,
16886
17146
  reset = search.reset;
16887
17147
  var rowSelection = {
@@ -16983,7 +17243,7 @@ var GoodList$1 = function GoodList(props, ref) {
16983
17243
  style: {
16984
17244
  marginTop: '4px'
16985
17245
  }
16986
- }, /*#__PURE__*/React.createElement(Table, _objectSpread2({
17246
+ }, /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({
16987
17247
  className: "GoodModalColumns",
16988
17248
  rowSelection: rowSelection,
16989
17249
  rowKey: "goodNo",
@@ -16993,7 +17253,15 @@ var GoodList$1 = function GoodList(props, ref) {
16993
17253
  y: 250
16994
17254
  },
16995
17255
  size: "small"
16996
- }, tableProps))), /*#__PURE__*/React.createElement(Popover, {
17256
+ }, tableProps), {}, {
17257
+ locale: {
17258
+ emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
17259
+ platform: "JST_ERP",
17260
+ queryState: reSyncQueryState,
17261
+ onSuccess: submit
17262
+ })
17263
+ }
17264
+ }))), /*#__PURE__*/React.createElement(Popover, {
16997
17265
  getPopupContainer: function getPopupContainer(triggerNode) {
16998
17266
  return triggerNode.parentElement;
16999
17267
  },
@@ -17366,13 +17634,16 @@ var GoodList$3 = function GoodList(props, ref) {
17366
17634
  var _Form$useForm = Form.useForm(),
17367
17635
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
17368
17636
  form = _Form$useForm2[0];
17369
- var _useAntdTable = useAntdTable(getTableData$3, {
17637
+ var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$3),
17638
+ _useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
17639
+ getTableDataWithReSync = _useGoodsReSyncQuery2[0],
17640
+ reSyncQueryState = _useGoodsReSyncQuery2[1];
17641
+ var _useAntdTable = useAntdTable(getTableDataWithReSync, {
17370
17642
  defaultPageSize: 10,
17371
17643
  form: form
17372
17644
  }),
17373
17645
  tableProps = _useAntdTable.tableProps,
17374
- search = _useAntdTable.search,
17375
- params = _useAntdTable.params;
17646
+ search = _useAntdTable.search;
17376
17647
  var submit = search.submit,
17377
17648
  reset = search.reset;
17378
17649
  var rowSelection = {
@@ -17474,7 +17745,7 @@ var GoodList$3 = function GoodList(props, ref) {
17474
17745
  style: {
17475
17746
  marginTop: '4px'
17476
17747
  }
17477
- }, /*#__PURE__*/React.createElement(Table, _objectSpread2({
17748
+ }, /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({
17478
17749
  className: "GoodModalColumns",
17479
17750
  rowSelection: rowSelection,
17480
17751
  rowKey: rowCheckKey,
@@ -17484,7 +17755,15 @@ var GoodList$3 = function GoodList(props, ref) {
17484
17755
  y: 250
17485
17756
  },
17486
17757
  size: "small"
17487
- }, tableProps))), /*#__PURE__*/React.createElement(Popover, {
17758
+ }, tableProps), {}, {
17759
+ locale: {
17760
+ emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
17761
+ platform: "KM_ERP",
17762
+ queryState: reSyncQueryState,
17763
+ onSuccess: submit
17764
+ })
17765
+ }
17766
+ }))), /*#__PURE__*/React.createElement(Popover, {
17488
17767
  getPopupContainer: function getPopupContainer(triggerNode) {
17489
17768
  return triggerNode.parentElement;
17490
17769
  },
@@ -17616,13 +17895,16 @@ var GoodList$4 = function GoodList(props, ref) {
17616
17895
  var _Form$useForm = Form.useForm(),
17617
17896
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
17618
17897
  form = _Form$useForm2[0];
17619
- var _useAntdTable = useAntdTable(getTableData$4, {
17898
+ var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$4),
17899
+ _useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
17900
+ getTableDataWithReSync = _useGoodsReSyncQuery2[0],
17901
+ reSyncQueryState = _useGoodsReSyncQuery2[1];
17902
+ var _useAntdTable = useAntdTable(getTableDataWithReSync, {
17620
17903
  defaultPageSize: 10,
17621
17904
  form: form
17622
17905
  }),
17623
17906
  tableProps = _useAntdTable.tableProps,
17624
- search = _useAntdTable.search,
17625
- params = _useAntdTable.params;
17907
+ search = _useAntdTable.search;
17626
17908
  var submit = search.submit,
17627
17909
  reset = search.reset;
17628
17910
  var rowSelection = {
@@ -17725,6 +18007,13 @@ var GoodList$4 = function GoodList(props, ref) {
17725
18007
  y: 250
17726
18008
  }
17727
18009
  }, tableProps), {}, {
18010
+ locale: {
18011
+ emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
18012
+ platform: "GY_ERP",
18013
+ queryState: reSyncQueryState,
18014
+ onSuccess: submit
18015
+ })
18016
+ },
17728
18017
  size: "small"
17729
18018
  }))), /*#__PURE__*/React.createElement(Popover, {
17730
18019
  getPopupContainer: function getPopupContainer(triggerNode) {
@@ -19311,13 +19600,16 @@ var GoodList$5 = function GoodList(props, ref) {
19311
19600
  var _Form$useForm = Form.useForm(),
19312
19601
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
19313
19602
  form = _Form$useForm2[0];
19314
- var _useAntdTable = useAntdTable(getTableData$5, {
19603
+ var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$5),
19604
+ _useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
19605
+ getTableDataWithReSync = _useGoodsReSyncQuery2[0],
19606
+ reSyncQueryState = _useGoodsReSyncQuery2[1];
19607
+ var _useAntdTable = useAntdTable(getTableDataWithReSync, {
19315
19608
  defaultPageSize: 10,
19316
19609
  form: form
19317
19610
  }),
19318
19611
  tableProps = _useAntdTable.tableProps,
19319
- search = _useAntdTable.search,
19320
- params = _useAntdTable.params;
19612
+ search = _useAntdTable.search;
19321
19613
  var submit = search.submit,
19322
19614
  reset = search.reset;
19323
19615
  var rowSelection = {
@@ -19419,7 +19711,7 @@ var GoodList$5 = function GoodList(props, ref) {
19419
19711
  style: {
19420
19712
  marginTop: '4px'
19421
19713
  }
19422
- }, /*#__PURE__*/React.createElement(Table, _objectSpread2({
19714
+ }, /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({
19423
19715
  className: "GoodModalColumns",
19424
19716
  rowSelection: rowSelection,
19425
19717
  rowKey: "id",
@@ -19429,7 +19721,15 @@ var GoodList$5 = function GoodList(props, ref) {
19429
19721
  y: 250
19430
19722
  },
19431
19723
  size: "small"
19432
- }, tableProps))), /*#__PURE__*/React.createElement(Popover, {
19724
+ }, tableProps), {}, {
19725
+ locale: {
19726
+ emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
19727
+ platform: "WLN_ERP",
19728
+ queryState: reSyncQueryState,
19729
+ onSuccess: submit
19730
+ })
19731
+ }
19732
+ }))), /*#__PURE__*/React.createElement(Popover, {
19433
19733
  getPopupContainer: function getPopupContainer(triggerNode) {
19434
19734
  return triggerNode.parentElement;
19435
19735
  },
@@ -19558,13 +19858,16 @@ var GoodList$6 = function GoodList(props, ref) {
19558
19858
  var _Form$useForm = Form.useForm(),
19559
19859
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
19560
19860
  form = _Form$useForm2[0];
19561
- var _useAntdTable = useAntdTable(getTableData$6, {
19861
+ var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$6),
19862
+ _useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
19863
+ getTableDataWithReSync = _useGoodsReSyncQuery2[0],
19864
+ reSyncQueryState = _useGoodsReSyncQuery2[1];
19865
+ var _useAntdTable = useAntdTable(getTableDataWithReSync, {
19562
19866
  defaultPageSize: 10,
19563
19867
  form: form
19564
19868
  }),
19565
19869
  tableProps = _useAntdTable.tableProps,
19566
- search = _useAntdTable.search,
19567
- params = _useAntdTable.params;
19870
+ search = _useAntdTable.search;
19568
19871
  var submit = search.submit,
19569
19872
  reset = search.reset;
19570
19873
  var rowSelection = {
@@ -19666,7 +19969,7 @@ var GoodList$6 = function GoodList(props, ref) {
19666
19969
  style: {
19667
19970
  marginTop: '4px'
19668
19971
  }
19669
- }, /*#__PURE__*/React.createElement(Table, _objectSpread2({
19972
+ }, /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({
19670
19973
  className: "GoodModalColumns",
19671
19974
  rowSelection: rowSelection,
19672
19975
  rowKey: "id",
@@ -19676,7 +19979,15 @@ var GoodList$6 = function GoodList(props, ref) {
19676
19979
  y: 250
19677
19980
  },
19678
19981
  size: "small"
19679
- }, tableProps))), /*#__PURE__*/React.createElement(Popover, {
19982
+ }, tableProps), {}, {
19983
+ locale: {
19984
+ emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
19985
+ platform: "JY_ERP",
19986
+ queryState: reSyncQueryState,
19987
+ onSuccess: submit
19988
+ })
19989
+ }
19990
+ }))), /*#__PURE__*/React.createElement(Popover, {
19680
19991
  getPopupContainer: function getPopupContainer(triggerNode) {
19681
19992
  return triggerNode.parentElement;
19682
19993
  },
@@ -25468,7 +25779,7 @@ var processKmGoods$1 = function processKmGoods(_ref9) {
25468
25779
  return list.map(function (item) {
25469
25780
  return _objectSpread2(_objectSpread2({}, item), {}, {
25470
25781
  skuPropertiesName: item.specName,
25471
- sysSkuPropertiesName: item.specId,
25782
+ sysSkuPropertiesName: item.propertiesValue,
25472
25783
  sysTitle: item.goodName,
25473
25784
  title: null,
25474
25785
  shortTitle: item.goodShortName,
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { type ReSyncPlatform } from './utils';
3
+ export type ReSyncQueryState = {
4
+ total: number | null;
5
+ formData: Record<string, any>;
6
+ };
7
+ type QueryService<TFormData, TResult extends {
8
+ total: number;
9
+ }> = (pagination: any, formData: TFormData) => Promise<TResult>;
10
+ export declare const useGoodsReSyncQuery: <TFormData, TResult extends {
11
+ total: number;
12
+ }>(service: QueryService<TFormData, TResult>) => readonly [(pagination: any, formData: TFormData) => Promise<TResult>, ReSyncQueryState];
13
+ type Props = {
14
+ platform: ReSyncPlatform;
15
+ queryState: ReSyncQueryState;
16
+ onSuccess: () => void | Promise<void>;
17
+ };
18
+ declare const GoodsReSync: ({ platform, queryState, onSuccess }: Props) => React.JSX.Element;
19
+ export default GoodsReSync;
@@ -0,0 +1,15 @@
1
+ export type ReSyncPlatform = 'JST_ERP' | 'WLN_ERP' | 'WDT_ERP' | 'GY_ERP' | 'JY_ERP' | 'KM_ERP';
2
+ export type ReSyncAction = {
3
+ key: 'goods';
4
+ label: '同步商品';
5
+ targetName: '商品';
6
+ value: string;
7
+ requestData: {
8
+ platform: ReSyncPlatform;
9
+ goodNos?: string[];
10
+ skuCodes?: string[];
11
+ styleCodes?: string[];
12
+ skuType?: 'normal' | 'combine';
13
+ };
14
+ };
15
+ export declare const getReSyncActions: (platform: ReSyncPlatform, total: number | null, formData: Record<string, any>) => ReSyncAction[];
@@ -3,3 +3,4 @@ export declare const transformFormData: (formData: Record<string, any>) => {
3
3
  compareSymbol: any;
4
4
  rightValue: any;
5
5
  }[];
6
+ export declare const shouldSubmitOnBlur: (relatedTarget: EventTarget | null) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "2.10.9-beta.21",
3
+ "version": "2.10.9-beta.23",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,7 +20,7 @@
20
20
  "watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/kmkf-utils": "2.10.9-beta.20",
23
+ "@kmkf-fe-packages/kmkf-utils": "2.10.9-beta.23",
24
24
  "ahooks": "^3.7.4",
25
25
  "ali-react-table": "2.6.1",
26
26
  "bignumber.js": "^9.1.2",
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "gitHead": "4dedd2a3b38f76b1511c4cc6e50830a0db126ae9"
69
+ "gitHead": "04e1e62b6cb964e5d1f9b9f2cb30c45c30d9c244"
70
70
  }