@kmkf-fe-packages/basic-components 1.22.1-beta.39 → 1.22.1-beta.40

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
@@ -3,7 +3,7 @@ import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, messag
3
3
  import { EyeOutlined, DeleteOutlined, CloseCircleOutlined, CaretUpOutlined } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
5
5
  import { CopyToClipboard } from 'react-copy-to-clipboard';
6
- import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, uuid, LogisticsAddressData, SendDataCenter, BS_E3_BOOLEAN_STATUS_MAP, filterWdtOrders, WDT_ORDER_TYPE_MAP, filterBsE3Orders, filterKmOrders, KM_SYSTEM_ORDER_CONFIG, BS_E3_ORDER_STATUS_MAP, updateWdtGoodsHandle, updateBsE3GoodsHandle } from '@kmkf-fe-packages/kmkf-utils';
6
+ import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, uuid, columnsGoodsList, LogisticsAddressData, SendDataCenter, BS_E3_BOOLEAN_STATUS_MAP, filterWdtOrders, WDT_ORDER_TYPE_MAP, filterBsE3Orders, filterKmOrders, KM_SYSTEM_ORDER_CONFIG, BS_E3_ORDER_STATUS_MAP, updateWdtGoodsHandle, updateBsE3GoodsHandle } from '@kmkf-fe-packages/kmkf-utils';
7
7
  import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith, takeRight, reject, isEmpty, intersection, uniqBy } from 'lodash';
8
8
  import { useUpdateEffect, useDebounceEffect, useAntdTable } from 'ahooks';
9
9
  import zhCN from 'antd/lib/locale/zh_CN';
@@ -9485,7 +9485,8 @@ var GoodItem = function GoodItem(props) {
9485
9485
  picUrl: item.picUrl,
9486
9486
  numIid: item.numIid,
9487
9487
  skuId: item.skuId,
9488
- outerSkuId: item.outerSkuId
9488
+ outerSkuId: item.outerSkuId,
9489
+ num: 1 //手动选择商品默认数量
9489
9490
  };
9490
9491
  // if (type === 1) {
9491
9492
  // params.outerId = item.outerId; //编码
@@ -9575,9 +9576,9 @@ var GoodItem = function GoodItem(props) {
9575
9576
  };
9576
9577
  }();
9577
9578
  var headerList = useMemo(function () {
9578
- if (!Array.isArray(showHeader)) return ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku 信息
9579
- ];
9580
-
9579
+ if (!Array.isArray(showHeader)) return columnsGoodsList.map(function (item) {
9580
+ return item.dataIndex;
9581
+ });
9581
9582
  var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
9582
9583
  var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
9583
9584
  var dataIndexList = [];
@@ -9593,16 +9594,17 @@ var GoodItem = function GoodItem(props) {
9593
9594
  }).map(function (item) {
9594
9595
  return item.dataIndex;
9595
9596
  }) : [] || {
9596
- 1: ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku 信息
9597
- ]
9597
+ 1: columnsGoodsList.map(function (item) {
9598
+ return item.dataIndex;
9599
+ })
9598
9600
  }[type] || [];
9599
9601
  }, [showHeader]);
9600
9602
  //修改参数
9601
- var handleChangeValue = function handleChangeValue(key, index) {
9603
+ var handleChangeValue = function handleChangeValue(key, index, replaceFn) {
9602
9604
  return function (e) {
9603
- var _e$target;
9605
+ var _e$target, _e$target2;
9604
9606
  var newImgList = _toConsumableArray(imgList);
9605
- newImgList[index][key] = e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value;
9607
+ newImgList[index][key] = replaceFn ? replaceFn(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value) : e === null || e === void 0 ? void 0 : (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.value;
9606
9608
  var newValue = {
9607
9609
  shopId: shopId,
9608
9610
  imgList: newImgList
@@ -9626,6 +9628,20 @@ var GoodItem = function GoodItem(props) {
9626
9628
  isShow: headerList.includes('numIid'),
9627
9629
  key: 'numIid',
9628
9630
  label: '商品id'
9631
+ }, {
9632
+ isShow: headerList.includes('num'),
9633
+ key: 'num',
9634
+ label: '商品数量',
9635
+ replaceFn: function replaceFn(value) {
9636
+ // 使用正则表达式匹配所有数字字符
9637
+ var numbers = String(value || '').match(/\d+/g);
9638
+ // 如果没有匹配到任何数字字符,返回null
9639
+ if (!numbers) {
9640
+ return null;
9641
+ }
9642
+ // 将匹配到的数字字符拼接成一个新的数字
9643
+ return Number(numbers.join('')) ? Number(numbers.join('')) : null;
9644
+ }
9629
9645
  }, {
9630
9646
  isShow: changeSku && headerList.includes('skuId'),
9631
9647
  key: 'skuId',
@@ -9641,11 +9657,7 @@ var GoodItem = function GoodItem(props) {
9641
9657
  }];
9642
9658
  if (!Array.isArray(showHeader)) return initList;
9643
9659
  var newList = [];
9644
- var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
9645
- var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
9646
- (isStringArray ? showHeader : isObjectArray ? showHeader.map(function (item) {
9647
- return item.dataIndex;
9648
- }) : []).forEach(function (dataIndex) {
9660
+ headerList.forEach(function (dataIndex) {
9649
9661
  if (initList.find(function (item) {
9650
9662
  return item.key === dataIndex;
9651
9663
  })) {
@@ -9719,7 +9731,7 @@ var GoodItem = function GoodItem(props) {
9719
9731
  title: String(img[item.key] || ''),
9720
9732
  value: img[item.key],
9721
9733
  disabled: item.disabled || disabled,
9722
- onChange: handleChangeValue(item.key, index)
9734
+ onChange: handleChangeValue(item.key, index, item.replaceFn)
9723
9735
  }));
9724
9736
  }), !disabled && !hasPic && type !== 4 && changeSku ? /*#__PURE__*/React.createElement(Button, {
9725
9737
  style: {
package/dist/index.js CHANGED
@@ -9497,7 +9497,8 @@ var GoodItem = function GoodItem(props) {
9497
9497
  picUrl: item.picUrl,
9498
9498
  numIid: item.numIid,
9499
9499
  skuId: item.skuId,
9500
- outerSkuId: item.outerSkuId
9500
+ outerSkuId: item.outerSkuId,
9501
+ num: 1 //手动选择商品默认数量
9501
9502
  };
9502
9503
  // if (type === 1) {
9503
9504
  // params.outerId = item.outerId; //编码
@@ -9587,9 +9588,9 @@ var GoodItem = function GoodItem(props) {
9587
9588
  };
9588
9589
  }();
9589
9590
  var headerList = React.useMemo(function () {
9590
- if (!Array.isArray(showHeader)) return ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku 信息
9591
- ];
9592
-
9591
+ if (!Array.isArray(showHeader)) return kmkfUtils.columnsGoodsList.map(function (item) {
9592
+ return item.dataIndex;
9593
+ });
9593
9594
  var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
9594
9595
  var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
9595
9596
  var dataIndexList = [];
@@ -9605,16 +9606,17 @@ var GoodItem = function GoodItem(props) {
9605
9606
  }).map(function (item) {
9606
9607
  return item.dataIndex;
9607
9608
  }) : [] || {
9608
- 1: ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku 信息
9609
- ]
9609
+ 1: kmkfUtils.columnsGoodsList.map(function (item) {
9610
+ return item.dataIndex;
9611
+ })
9610
9612
  }[type] || [];
9611
9613
  }, [showHeader]);
9612
9614
  //修改参数
9613
- var handleChangeValue = function handleChangeValue(key, index) {
9615
+ var handleChangeValue = function handleChangeValue(key, index, replaceFn) {
9614
9616
  return function (e) {
9615
- var _e$target;
9617
+ var _e$target, _e$target2;
9616
9618
  var newImgList = _toConsumableArray(imgList);
9617
- newImgList[index][key] = e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value;
9619
+ newImgList[index][key] = replaceFn ? replaceFn(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value) : e === null || e === void 0 ? void 0 : (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.value;
9618
9620
  var newValue = {
9619
9621
  shopId: shopId,
9620
9622
  imgList: newImgList
@@ -9638,6 +9640,20 @@ var GoodItem = function GoodItem(props) {
9638
9640
  isShow: headerList.includes('numIid'),
9639
9641
  key: 'numIid',
9640
9642
  label: '商品id'
9643
+ }, {
9644
+ isShow: headerList.includes('num'),
9645
+ key: 'num',
9646
+ label: '商品数量',
9647
+ replaceFn: function replaceFn(value) {
9648
+ // 使用正则表达式匹配所有数字字符
9649
+ var numbers = String(value || '').match(/\d+/g);
9650
+ // 如果没有匹配到任何数字字符,返回null
9651
+ if (!numbers) {
9652
+ return null;
9653
+ }
9654
+ // 将匹配到的数字字符拼接成一个新的数字
9655
+ return Number(numbers.join('')) ? Number(numbers.join('')) : null;
9656
+ }
9641
9657
  }, {
9642
9658
  isShow: changeSku && headerList.includes('skuId'),
9643
9659
  key: 'skuId',
@@ -9653,11 +9669,7 @@ var GoodItem = function GoodItem(props) {
9653
9669
  }];
9654
9670
  if (!Array.isArray(showHeader)) return initList;
9655
9671
  var newList = [];
9656
- var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
9657
- var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
9658
- (isStringArray ? showHeader : isObjectArray ? showHeader.map(function (item) {
9659
- return item.dataIndex;
9660
- }) : []).forEach(function (dataIndex) {
9672
+ headerList.forEach(function (dataIndex) {
9661
9673
  if (initList.find(function (item) {
9662
9674
  return item.key === dataIndex;
9663
9675
  })) {
@@ -9731,7 +9743,7 @@ var GoodItem = function GoodItem(props) {
9731
9743
  title: String(img[item.key] || ''),
9732
9744
  value: img[item.key],
9733
9745
  disabled: item.disabled || disabled,
9734
- onChange: handleChangeValue(item.key, index)
9746
+ onChange: handleChangeValue(item.key, index, item.replaceFn)
9735
9747
  }));
9736
9748
  }), !disabled && !hasPic && type !== 4 && changeSku ? /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9737
9749
  style: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "1.22.1-beta.39",
3
+ "version": "1.22.1-beta.40",
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": "1.22.1-beta.38",
23
+ "@kmkf-fe-packages/kmkf-utils": "1.22.1-beta.40",
24
24
  "ahooks": "^3.7.4",
25
25
  "bignumber.js": "^9.1.2",
26
26
  "kmkf-monitor": "^0.8.9",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "9e437f40a3d69cebe8f152d63b8454a09db6f2c5"
68
+ "gitHead": "caa912596f663c9d3725775c83f455a5edd4b977"
69
69
  }