@kmkf-fe-packages/basic-components 2.0.48 → 2.0.50

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,6 +1,6 @@
1
1
  import React, { useRef, useState, useEffect, forwardRef, useImperativeHandle, useMemo, useCallback } from 'react';
2
2
  import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate, Form, Popover, Table, Tabs, ConfigProvider, Pagination, Typography } from 'antd';
3
- import { EyeOutlined, DeleteOutlined, CloseCircleOutlined, CaretUpOutlined } from '@ant-design/icons';
3
+ import { EyeOutlined, DeleteOutlined, CopyOutlined, CloseCircleOutlined, CaretUpOutlined, MinusCircleFilled } 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
6
  import { AddressData, BsAddressData, WdtAddressData, GyAddressData, request as request$1, ExpressData, uuid, columnsGoodsList, LogisticsAddressData, SendDataCenter, BS_E3_BOOLEAN_STATUS_MAP, isNull, filterWdtOrders, WDT_ORDER_TYPE_MAP, filterBsE3Orders, filterGyOrders, GY_DELIVERY_STATE_MAPPING, servers, filterJstOrders, filterKmOrders, getIsPlatformCodesIncludeOrderNos, BS_SYSTEM_ORDER_CONFIG, KM_SYSTEM_ORDER_CONFIG, WLN_SYSTEM_ORDER_CONFIG, WDT_SYSTEM_ORDER_CONFIG, BS_E3_SYSTEM_ORDER_CONFIG, GY_SYSTEM_ORDER_CONFIG, JST_SYSTEM_ORDER_CONFIG, updateWdtGoodsHandle, updateBsE3GoodsHandle, updateGyGoodsHandle, updateJstGoodsHandle, jstMergeIdenticalGoods, msgTypeCh, pushGyLog } from '@kmkf-fe-packages/kmkf-utils';
@@ -8019,6 +8019,33 @@ var SubForm = function SubForm(props) {
8019
8019
  }));
8020
8020
  };
8021
8021
 
8022
+ function CopyTextIcon(_ref) {
8023
+ var val = _ref.val;
8024
+ return /*#__PURE__*/React.createElement("div", {
8025
+ style: {
8026
+ display: 'flex',
8027
+ alignItems: 'center',
8028
+ justifyContent: 'center'
8029
+ }
8030
+ }, /*#__PURE__*/React.createElement("span", {
8031
+ style: {
8032
+ marginRight: 8,
8033
+ overflow: 'hidden',
8034
+ textOverflow: 'ellipsis',
8035
+ whiteSpace: 'nowrap'
8036
+ }
8037
+ }, val), /*#__PURE__*/React.createElement(CopyToClipboard, {
8038
+ text: val,
8039
+ onCopy: function onCopy() {
8040
+ message.success('复制成功');
8041
+ }
8042
+ }, /*#__PURE__*/React.createElement(CopyOutlined, {
8043
+ style: {
8044
+ color: '#1890ff'
8045
+ }
8046
+ })));
8047
+ }
8048
+
8022
8049
  var BuyerNick = function BuyerNick(props) {
8023
8050
  var _props$value = props.value,
8024
8051
  value = _props$value === void 0 ? {} : _props$value,
@@ -13774,7 +13801,12 @@ var getColumns$2 = function getColumns(_ref) {
13774
13801
  }, {
13775
13802
  dataIndex: 'goodName',
13776
13803
  title: "\u5546\u54C1\u540D\u79F0",
13777
- width: 200
13804
+ width: 200,
13805
+ render: function render(text) {
13806
+ return /*#__PURE__*/React.createElement(CopyTextIcon, {
13807
+ val: text
13808
+ });
13809
+ }
13778
13810
  }, {
13779
13811
  dataIndex: 'specId',
13780
13812
  title: "SKUID",
@@ -13786,7 +13818,12 @@ var getColumns$2 = function getColumns(_ref) {
13786
13818
  }, {
13787
13819
  dataIndex: 'specName',
13788
13820
  title: "\u5546\u54C1SKU\u540D\u79F0",
13789
- width: 250
13821
+ width: 250,
13822
+ render: function render(text) {
13823
+ return /*#__PURE__*/React.createElement(CopyTextIcon, {
13824
+ val: text
13825
+ });
13826
+ }
13790
13827
  }, {
13791
13828
  dataIndex: 'orderPrice',
13792
13829
  title: "\u6210\u4EA4\u603B\u91D1\u989D",
@@ -13825,8 +13862,12 @@ var getColumns$2 = function getColumns(_ref) {
13825
13862
  dataIndex: 'goodName',
13826
13863
  title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
13827
13864
  align: 'center',
13828
- ellipsis: true,
13829
- width: 250
13865
+ width: 250,
13866
+ render: function render(text) {
13867
+ return /*#__PURE__*/React.createElement(CopyTextIcon, {
13868
+ val: text
13869
+ });
13870
+ }
13830
13871
  }, {
13831
13872
  dataIndex: 'specId',
13832
13873
  title: "".concat(text, "SKUID"),
@@ -13843,8 +13884,12 @@ var getColumns$2 = function getColumns(_ref) {
13843
13884
  dataIndex: 'specName',
13844
13885
  title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
13845
13886
  align: 'center',
13846
- ellipsis: true,
13847
- width: 250
13887
+ width: 250,
13888
+ render: function render(text) {
13889
+ return /*#__PURE__*/React.createElement(CopyTextIcon, {
13890
+ val: text
13891
+ });
13892
+ }
13848
13893
  }, {
13849
13894
  dataIndex: 'orderPrice',
13850
13895
  title: "\u6210\u4EA4\u603B\u91D1\u989D",
@@ -13915,8 +13960,12 @@ var getColumns$2 = function getColumns(_ref) {
13915
13960
  dataIndex: 'goodName',
13916
13961
  title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
13917
13962
  align: 'center',
13918
- ellipsis: true,
13919
- width: 250
13963
+ width: 250,
13964
+ render: function render(text) {
13965
+ return /*#__PURE__*/React.createElement(CopyTextIcon, {
13966
+ val: text
13967
+ });
13968
+ }
13920
13969
  }, {
13921
13970
  dataIndex: 'specId',
13922
13971
  title: "".concat(text, "SKUID"),
@@ -13933,8 +13982,12 @@ var getColumns$2 = function getColumns(_ref) {
13933
13982
  dataIndex: 'specName',
13934
13983
  title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
13935
13984
  align: 'center',
13936
- ellipsis: true,
13937
- width: 250
13985
+ width: 250,
13986
+ render: function render(text) {
13987
+ return /*#__PURE__*/React.createElement(CopyTextIcon, {
13988
+ val: text
13989
+ });
13990
+ }
13938
13991
  }, {
13939
13992
  dataIndex: 'num',
13940
13993
  title: "".concat(text, "\u9000\u8D27\u6570\u91CF"),
@@ -14039,8 +14092,12 @@ var getColumns$2 = function getColumns(_ref) {
14039
14092
  dataIndex: 'goodName',
14040
14093
  title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
14041
14094
  align: 'center',
14042
- ellipsis: true,
14043
- width: 250
14095
+ width: 250,
14096
+ render: function render(text) {
14097
+ return /*#__PURE__*/React.createElement(CopyTextIcon, {
14098
+ val: text
14099
+ });
14100
+ }
14044
14101
  }, {
14045
14102
  dataIndex: 'specId',
14046
14103
  title: "".concat(text, "SKUID"),
@@ -14057,8 +14114,12 @@ var getColumns$2 = function getColumns(_ref) {
14057
14114
  dataIndex: 'specName',
14058
14115
  title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
14059
14116
  align: 'center',
14060
- ellipsis: true,
14061
- width: 250
14117
+ width: 250,
14118
+ render: function render(text) {
14119
+ return /*#__PURE__*/React.createElement(CopyTextIcon, {
14120
+ val: text
14121
+ });
14122
+ }
14062
14123
  }, {
14063
14124
  dataIndex: 'num',
14064
14125
  title: "".concat(text, "\u6362\u51FA\u6570\u91CF"),
@@ -15365,6 +15426,29 @@ var getBsE3ReissueGoodColumns = function getBsE3ReissueGoodColumns(_ref4) {
15365
15426
  });
15366
15427
  };
15367
15428
 
15429
+ function HoverTableRowDeleteIcon(_ref) {
15430
+ var index = _ref.index,
15431
+ hoveredRowIndex = _ref.hoveredRowIndex,
15432
+ handleClick = _ref.handleClick;
15433
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
15434
+ style: {
15435
+ display: hoveredRowIndex === index ? 'none' : 'inline'
15436
+ }
15437
+ }, index + 1), /*#__PURE__*/React.createElement("span", {
15438
+ style: {
15439
+ cursor: 'pointer'
15440
+ },
15441
+ onClick: handleClick,
15442
+ title: "\u5220\u9664"
15443
+ }, /*#__PURE__*/React.createElement(MinusCircleFilled, {
15444
+ style: {
15445
+ fontSize: 18,
15446
+ color: '#1890ff',
15447
+ display: hoveredRowIndex === index ? 'inline' : 'none'
15448
+ }
15449
+ })));
15450
+ }
15451
+
15368
15452
  var GoodsModalMap = {
15369
15453
  WDT_REISSUE_GOODS: WdtGoodsModal,
15370
15454
  WDT_GOODS: WdtGoodsModal,
@@ -15512,6 +15596,10 @@ var GoodItem$1 = function GoodItem(props) {
15512
15596
  _useState4 = _slicedToArray(_useState3, 2),
15513
15597
  selectedRowKeys = _useState4[0],
15514
15598
  setSelectedRowKeys = _useState4[1];
15599
+ var _useState5 = useState(null),
15600
+ _useState6 = _slicedToArray(_useState5, 2),
15601
+ hoveredRowIndex = _useState6[0],
15602
+ setHoveredRowIndex = _useState6[1];
15515
15603
  useEffect(function () {
15516
15604
  setSelectedRowKeys([]);
15517
15605
  }, [tableSelect, selectType]);
@@ -15649,7 +15737,13 @@ var GoodItem$1 = function GoodItem(props) {
15649
15737
  ellipsis: true,
15650
15738
  width: 50,
15651
15739
  render: function render(val, record, index) {
15652
- return /*#__PURE__*/React.createElement("span", null, index + 1);
15740
+ return /*#__PURE__*/React.createElement(HoverTableRowDeleteIcon, {
15741
+ index: index,
15742
+ hoveredRowIndex: !disabled && record.canDelete ? hoveredRowIndex : null,
15743
+ handleClick: function handleClick() {
15744
+ return handleDelete(record, index);
15745
+ }
15746
+ });
15653
15747
  }
15654
15748
  }].concat(_toConsumableArray(baseInfoColumns));
15655
15749
  if (!disabled) {
@@ -15670,7 +15764,7 @@ var GoodItem$1 = function GoodItem(props) {
15670
15764
  });
15671
15765
  }
15672
15766
  return columnList;
15673
- }, [showHeader, value, disabled]);
15767
+ }, [showHeader, value, disabled, hoveredRowIndex]);
15674
15768
  var orderColumns = useMemo(function () {
15675
15769
  var columns = COLUMNS_MAP('', {
15676
15770
  operate: false,
@@ -15866,6 +15960,16 @@ var GoodItem$1 = function GoodItem(props) {
15866
15960
  },
15867
15961
  locale: {
15868
15962
  emptyText: '暂无数据'
15963
+ },
15964
+ onRow: function onRow(_, index) {
15965
+ return {
15966
+ onMouseEnter: function onMouseEnter() {
15967
+ return setHoveredRowIndex(index);
15968
+ },
15969
+ onMouseLeave: function onMouseLeave() {
15970
+ return setHoveredRowIndex(null);
15971
+ }
15972
+ };
15869
15973
  }
15870
15974
  })), /*#__PURE__*/React.createElement(TheGoodsModal, {
15871
15975
  ref: refModal,
@@ -15889,11 +15993,12 @@ var BsGoods = function BsGoods(props) {
15889
15993
  setTableSelect = _useState2[1];
15890
15994
  var withInfo = useRef(null);
15891
15995
  var valueRef = useRef(null);
15996
+ var tokens = useRef([]);
15892
15997
  useEffect(function () {
15893
15998
  valueRef.current = value;
15894
15999
  }, [value]);
15895
16000
  useEffect(function () {
15896
- pubsub.subscribe('type', function (type, data) {
16001
+ tokens.current = [pubsub.subscribe('type', function (type, data) {
15897
16002
  if (disabled) return;
15898
16003
  // console.log(type, data);
15899
16004
  withInfo.current = {
@@ -15910,9 +16015,7 @@ var BsGoods = function BsGoods(props) {
15910
16015
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
15911
16016
  });
15912
16017
  }
15913
- });
15914
- //补发
15915
- pubsub.subscribe('reissueType', function (type, data) {
16018
+ }), pubsub.subscribe('reissueType', function (type, data) {
15916
16019
  if (disabled) return;
15917
16020
  withInfo.current = {
15918
16021
  type: type,
@@ -15932,9 +16035,7 @@ var BsGoods = function BsGoods(props) {
15932
16035
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
15933
16036
  });
15934
16037
  }
15935
- });
15936
- //退货
15937
- pubsub.subscribe('returnType', function (type, data) {
16038
+ }), pubsub.subscribe('returnType', function (type, data) {
15938
16039
  if (disabled) return;
15939
16040
  withInfo.current = {
15940
16041
  type: type,
@@ -15950,15 +16051,18 @@ var BsGoods = function BsGoods(props) {
15950
16051
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
15951
16052
  });
15952
16053
  }
15953
- });
15954
- pubsub.subscribeOnce('changeShopCode', function (type, data) {
16054
+ }), pubsub.subscribeOnce('changeShopCode', function (type, data) {
15955
16055
  // console.log(data);
15956
16056
  onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
15957
16057
  shopCode: data.shopCode
15958
16058
  }));
15959
- });
16059
+ })];
15960
16060
  return function () {
15961
- pubsub.clearAllSubscriptions();
16061
+ // 清除当前组件所有订阅
16062
+ tokens.current.forEach(function (token) {
16063
+ return pubsub.unsubscribe(token);
16064
+ });
16065
+ tokens.current = [];
15962
16066
  };
15963
16067
  }, [disabled]);
15964
16068
  var _onSelect = function onSelect(list) {
@@ -17200,6 +17304,7 @@ var CommonGoods = function CommonGoods(props) {
17200
17304
  setTableSelect = _useState2[1];
17201
17305
  var withInfo = useRef(null);
17202
17306
  var valueRef = useRef(null);
17307
+ var tokens = useRef([]);
17203
17308
  useEffect(function () {
17204
17309
  var _value$orders;
17205
17310
  valueRef.current = value;
@@ -17233,7 +17338,7 @@ var CommonGoods = function CommonGoods(props) {
17233
17338
  };
17234
17339
  }();
17235
17340
  useEffect(function () {
17236
- pubsub.subscribe(componentMap$1[compType].eventNameMap.type, function (type, data) {
17341
+ tokens.current = [pubsub.subscribe(componentMap$1[compType].eventNameMap.type, function (type, data) {
17237
17342
  if (disabled) return;
17238
17343
  // console.log(type, data);
17239
17344
  withInfo.current = {
@@ -17250,9 +17355,7 @@ var CommonGoods = function CommonGoods(props) {
17250
17355
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
17251
17356
  });
17252
17357
  }
17253
- });
17254
- //补发
17255
- pubsub.subscribe(componentMap$1[compType].eventNameMap.reissueType, function (type, data) {
17358
+ }), pubsub.subscribe(componentMap$1[compType].eventNameMap.reissueType, function (type, data) {
17256
17359
  if (disabled) return;
17257
17360
  withInfo.current = {
17258
17361
  type: type,
@@ -17268,9 +17371,7 @@ var CommonGoods = function CommonGoods(props) {
17268
17371
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
17269
17372
  });
17270
17373
  }
17271
- });
17272
- //退货
17273
- pubsub.subscribe(componentMap$1[compType].eventNameMap.returnType, function (type, data) {
17374
+ }), pubsub.subscribe(componentMap$1[compType].eventNameMap.returnType, function (type, data) {
17274
17375
  if (disabled) return;
17275
17376
  withInfo.current = {
17276
17377
  type: type,
@@ -17286,15 +17387,18 @@ var CommonGoods = function CommonGoods(props) {
17286
17387
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
17287
17388
  });
17288
17389
  }
17289
- });
17290
- pubsub.subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
17390
+ }), pubsub.subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
17291
17391
  // console.log(data);
17292
17392
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
17293
17393
  shopCode: data.shopCode
17294
17394
  }));
17295
- });
17395
+ })];
17296
17396
  return function () {
17297
- pubsub.clearAllSubscriptions();
17397
+ // 清除当前组件所有订阅
17398
+ tokens.current.forEach(function (token) {
17399
+ return pubsub.unsubscribe(token);
17400
+ });
17401
+ tokens.current = [];
17298
17402
  };
17299
17403
  }, [disabled]);
17300
17404
  var _onSelect = function onSelect(list) {
@@ -19831,4 +19935,4 @@ var GyReturnGoods = function GyReturnGoods(props) {
19831
19935
  })));
19832
19936
  };
19833
19937
 
19834
- export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, bsE3Reissue as BsE3Reissue, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, GyReissue, GyReturnGoods as GyReturn, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, PublicReissue, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods, columnsBaseInfoMap, getColumns$5 as getJstColumns, getColumns$3 as getWlnColumns };
19938
+ export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, bsE3Reissue as BsE3Reissue, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, CopyTextIcon, ExpressLogistics, Goods, index$2 as GoodsTable, GyReissue, GyReturnGoods as GyReturn, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, PublicReissue, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods, columnsBaseInfoMap, getColumns$5 as getJstColumns, getColumns$3 as getWlnColumns };
package/dist/index.js CHANGED
@@ -8031,6 +8031,33 @@ var SubForm = function SubForm(props) {
8031
8031
  }));
8032
8032
  };
8033
8033
 
8034
+ function CopyTextIcon(_ref) {
8035
+ var val = _ref.val;
8036
+ return /*#__PURE__*/React__default['default'].createElement("div", {
8037
+ style: {
8038
+ display: 'flex',
8039
+ alignItems: 'center',
8040
+ justifyContent: 'center'
8041
+ }
8042
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
8043
+ style: {
8044
+ marginRight: 8,
8045
+ overflow: 'hidden',
8046
+ textOverflow: 'ellipsis',
8047
+ whiteSpace: 'nowrap'
8048
+ }
8049
+ }, val), /*#__PURE__*/React__default['default'].createElement(reactCopyToClipboard.CopyToClipboard, {
8050
+ text: val,
8051
+ onCopy: function onCopy() {
8052
+ antd.message.success('复制成功');
8053
+ }
8054
+ }, /*#__PURE__*/React__default['default'].createElement(icons.CopyOutlined, {
8055
+ style: {
8056
+ color: '#1890ff'
8057
+ }
8058
+ })));
8059
+ }
8060
+
8034
8061
  var BuyerNick = function BuyerNick(props) {
8035
8062
  var _props$value = props.value,
8036
8063
  value = _props$value === void 0 ? {} : _props$value,
@@ -13786,7 +13813,12 @@ var getColumns$2 = function getColumns(_ref) {
13786
13813
  }, {
13787
13814
  dataIndex: 'goodName',
13788
13815
  title: "\u5546\u54C1\u540D\u79F0",
13789
- width: 200
13816
+ width: 200,
13817
+ render: function render(text) {
13818
+ return /*#__PURE__*/React__default['default'].createElement(CopyTextIcon, {
13819
+ val: text
13820
+ });
13821
+ }
13790
13822
  }, {
13791
13823
  dataIndex: 'specId',
13792
13824
  title: "SKUID",
@@ -13798,7 +13830,12 @@ var getColumns$2 = function getColumns(_ref) {
13798
13830
  }, {
13799
13831
  dataIndex: 'specName',
13800
13832
  title: "\u5546\u54C1SKU\u540D\u79F0",
13801
- width: 250
13833
+ width: 250,
13834
+ render: function render(text) {
13835
+ return /*#__PURE__*/React__default['default'].createElement(CopyTextIcon, {
13836
+ val: text
13837
+ });
13838
+ }
13802
13839
  }, {
13803
13840
  dataIndex: 'orderPrice',
13804
13841
  title: "\u6210\u4EA4\u603B\u91D1\u989D",
@@ -13837,8 +13874,12 @@ var getColumns$2 = function getColumns(_ref) {
13837
13874
  dataIndex: 'goodName',
13838
13875
  title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
13839
13876
  align: 'center',
13840
- ellipsis: true,
13841
- width: 250
13877
+ width: 250,
13878
+ render: function render(text) {
13879
+ return /*#__PURE__*/React__default['default'].createElement(CopyTextIcon, {
13880
+ val: text
13881
+ });
13882
+ }
13842
13883
  }, {
13843
13884
  dataIndex: 'specId',
13844
13885
  title: "".concat(text, "SKUID"),
@@ -13855,8 +13896,12 @@ var getColumns$2 = function getColumns(_ref) {
13855
13896
  dataIndex: 'specName',
13856
13897
  title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
13857
13898
  align: 'center',
13858
- ellipsis: true,
13859
- width: 250
13899
+ width: 250,
13900
+ render: function render(text) {
13901
+ return /*#__PURE__*/React__default['default'].createElement(CopyTextIcon, {
13902
+ val: text
13903
+ });
13904
+ }
13860
13905
  }, {
13861
13906
  dataIndex: 'orderPrice',
13862
13907
  title: "\u6210\u4EA4\u603B\u91D1\u989D",
@@ -13927,8 +13972,12 @@ var getColumns$2 = function getColumns(_ref) {
13927
13972
  dataIndex: 'goodName',
13928
13973
  title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
13929
13974
  align: 'center',
13930
- ellipsis: true,
13931
- width: 250
13975
+ width: 250,
13976
+ render: function render(text) {
13977
+ return /*#__PURE__*/React__default['default'].createElement(CopyTextIcon, {
13978
+ val: text
13979
+ });
13980
+ }
13932
13981
  }, {
13933
13982
  dataIndex: 'specId',
13934
13983
  title: "".concat(text, "SKUID"),
@@ -13945,8 +13994,12 @@ var getColumns$2 = function getColumns(_ref) {
13945
13994
  dataIndex: 'specName',
13946
13995
  title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
13947
13996
  align: 'center',
13948
- ellipsis: true,
13949
- width: 250
13997
+ width: 250,
13998
+ render: function render(text) {
13999
+ return /*#__PURE__*/React__default['default'].createElement(CopyTextIcon, {
14000
+ val: text
14001
+ });
14002
+ }
13950
14003
  }, {
13951
14004
  dataIndex: 'num',
13952
14005
  title: "".concat(text, "\u9000\u8D27\u6570\u91CF"),
@@ -14051,8 +14104,12 @@ var getColumns$2 = function getColumns(_ref) {
14051
14104
  dataIndex: 'goodName',
14052
14105
  title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
14053
14106
  align: 'center',
14054
- ellipsis: true,
14055
- width: 250
14107
+ width: 250,
14108
+ render: function render(text) {
14109
+ return /*#__PURE__*/React__default['default'].createElement(CopyTextIcon, {
14110
+ val: text
14111
+ });
14112
+ }
14056
14113
  }, {
14057
14114
  dataIndex: 'specId',
14058
14115
  title: "".concat(text, "SKUID"),
@@ -14069,8 +14126,12 @@ var getColumns$2 = function getColumns(_ref) {
14069
14126
  dataIndex: 'specName',
14070
14127
  title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
14071
14128
  align: 'center',
14072
- ellipsis: true,
14073
- width: 250
14129
+ width: 250,
14130
+ render: function render(text) {
14131
+ return /*#__PURE__*/React__default['default'].createElement(CopyTextIcon, {
14132
+ val: text
14133
+ });
14134
+ }
14074
14135
  }, {
14075
14136
  dataIndex: 'num',
14076
14137
  title: "".concat(text, "\u6362\u51FA\u6570\u91CF"),
@@ -15377,6 +15438,29 @@ var getBsE3ReissueGoodColumns = function getBsE3ReissueGoodColumns(_ref4) {
15377
15438
  });
15378
15439
  };
15379
15440
 
15441
+ function HoverTableRowDeleteIcon(_ref) {
15442
+ var index = _ref.index,
15443
+ hoveredRowIndex = _ref.hoveredRowIndex,
15444
+ handleClick = _ref.handleClick;
15445
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("span", {
15446
+ style: {
15447
+ display: hoveredRowIndex === index ? 'none' : 'inline'
15448
+ }
15449
+ }, index + 1), /*#__PURE__*/React__default['default'].createElement("span", {
15450
+ style: {
15451
+ cursor: 'pointer'
15452
+ },
15453
+ onClick: handleClick,
15454
+ title: "\u5220\u9664"
15455
+ }, /*#__PURE__*/React__default['default'].createElement(icons.MinusCircleFilled, {
15456
+ style: {
15457
+ fontSize: 18,
15458
+ color: '#1890ff',
15459
+ display: hoveredRowIndex === index ? 'inline' : 'none'
15460
+ }
15461
+ })));
15462
+ }
15463
+
15380
15464
  var GoodsModalMap = {
15381
15465
  WDT_REISSUE_GOODS: WdtGoodsModal,
15382
15466
  WDT_GOODS: WdtGoodsModal,
@@ -15524,6 +15608,10 @@ var GoodItem$1 = function GoodItem(props) {
15524
15608
  _useState4 = _slicedToArray(_useState3, 2),
15525
15609
  selectedRowKeys = _useState4[0],
15526
15610
  setSelectedRowKeys = _useState4[1];
15611
+ var _useState5 = React.useState(null),
15612
+ _useState6 = _slicedToArray(_useState5, 2),
15613
+ hoveredRowIndex = _useState6[0],
15614
+ setHoveredRowIndex = _useState6[1];
15527
15615
  React.useEffect(function () {
15528
15616
  setSelectedRowKeys([]);
15529
15617
  }, [tableSelect, selectType]);
@@ -15661,7 +15749,13 @@ var GoodItem$1 = function GoodItem(props) {
15661
15749
  ellipsis: true,
15662
15750
  width: 50,
15663
15751
  render: function render(val, record, index) {
15664
- return /*#__PURE__*/React__default['default'].createElement("span", null, index + 1);
15752
+ return /*#__PURE__*/React__default['default'].createElement(HoverTableRowDeleteIcon, {
15753
+ index: index,
15754
+ hoveredRowIndex: !disabled && record.canDelete ? hoveredRowIndex : null,
15755
+ handleClick: function handleClick() {
15756
+ return handleDelete(record, index);
15757
+ }
15758
+ });
15665
15759
  }
15666
15760
  }].concat(_toConsumableArray(baseInfoColumns));
15667
15761
  if (!disabled) {
@@ -15682,7 +15776,7 @@ var GoodItem$1 = function GoodItem(props) {
15682
15776
  });
15683
15777
  }
15684
15778
  return columnList;
15685
- }, [showHeader, value, disabled]);
15779
+ }, [showHeader, value, disabled, hoveredRowIndex]);
15686
15780
  var orderColumns = React.useMemo(function () {
15687
15781
  var columns = COLUMNS_MAP('', {
15688
15782
  operate: false,
@@ -15878,6 +15972,16 @@ var GoodItem$1 = function GoodItem(props) {
15878
15972
  },
15879
15973
  locale: {
15880
15974
  emptyText: '暂无数据'
15975
+ },
15976
+ onRow: function onRow(_, index) {
15977
+ return {
15978
+ onMouseEnter: function onMouseEnter() {
15979
+ return setHoveredRowIndex(index);
15980
+ },
15981
+ onMouseLeave: function onMouseLeave() {
15982
+ return setHoveredRowIndex(null);
15983
+ }
15984
+ };
15881
15985
  }
15882
15986
  })), /*#__PURE__*/React__default['default'].createElement(TheGoodsModal, {
15883
15987
  ref: refModal,
@@ -15901,11 +16005,12 @@ var BsGoods = function BsGoods(props) {
15901
16005
  setTableSelect = _useState2[1];
15902
16006
  var withInfo = React.useRef(null);
15903
16007
  var valueRef = React.useRef(null);
16008
+ var tokens = React.useRef([]);
15904
16009
  React.useEffect(function () {
15905
16010
  valueRef.current = value;
15906
16011
  }, [value]);
15907
16012
  React.useEffect(function () {
15908
- pubsub__default['default'].subscribe('type', function (type, data) {
16013
+ tokens.current = [pubsub__default['default'].subscribe('type', function (type, data) {
15909
16014
  if (disabled) return;
15910
16015
  // console.log(type, data);
15911
16016
  withInfo.current = {
@@ -15922,9 +16027,7 @@ var BsGoods = function BsGoods(props) {
15922
16027
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
15923
16028
  });
15924
16029
  }
15925
- });
15926
- //补发
15927
- pubsub__default['default'].subscribe('reissueType', function (type, data) {
16030
+ }), pubsub__default['default'].subscribe('reissueType', function (type, data) {
15928
16031
  if (disabled) return;
15929
16032
  withInfo.current = {
15930
16033
  type: type,
@@ -15944,9 +16047,7 @@ var BsGoods = function BsGoods(props) {
15944
16047
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
15945
16048
  });
15946
16049
  }
15947
- });
15948
- //退货
15949
- pubsub__default['default'].subscribe('returnType', function (type, data) {
16050
+ }), pubsub__default['default'].subscribe('returnType', function (type, data) {
15950
16051
  if (disabled) return;
15951
16052
  withInfo.current = {
15952
16053
  type: type,
@@ -15962,15 +16063,18 @@ var BsGoods = function BsGoods(props) {
15962
16063
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
15963
16064
  });
15964
16065
  }
15965
- });
15966
- pubsub__default['default'].subscribeOnce('changeShopCode', function (type, data) {
16066
+ }), pubsub__default['default'].subscribeOnce('changeShopCode', function (type, data) {
15967
16067
  // console.log(data);
15968
16068
  onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
15969
16069
  shopCode: data.shopCode
15970
16070
  }));
15971
- });
16071
+ })];
15972
16072
  return function () {
15973
- pubsub__default['default'].clearAllSubscriptions();
16073
+ // 清除当前组件所有订阅
16074
+ tokens.current.forEach(function (token) {
16075
+ return pubsub__default['default'].unsubscribe(token);
16076
+ });
16077
+ tokens.current = [];
15974
16078
  };
15975
16079
  }, [disabled]);
15976
16080
  var _onSelect = function onSelect(list) {
@@ -17212,6 +17316,7 @@ var CommonGoods = function CommonGoods(props) {
17212
17316
  setTableSelect = _useState2[1];
17213
17317
  var withInfo = React.useRef(null);
17214
17318
  var valueRef = React.useRef(null);
17319
+ var tokens = React.useRef([]);
17215
17320
  React.useEffect(function () {
17216
17321
  var _value$orders;
17217
17322
  valueRef.current = value;
@@ -17245,7 +17350,7 @@ var CommonGoods = function CommonGoods(props) {
17245
17350
  };
17246
17351
  }();
17247
17352
  React.useEffect(function () {
17248
- pubsub__default['default'].subscribe(componentMap$1[compType].eventNameMap.type, function (type, data) {
17353
+ tokens.current = [pubsub__default['default'].subscribe(componentMap$1[compType].eventNameMap.type, function (type, data) {
17249
17354
  if (disabled) return;
17250
17355
  // console.log(type, data);
17251
17356
  withInfo.current = {
@@ -17262,9 +17367,7 @@ var CommonGoods = function CommonGoods(props) {
17262
17367
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
17263
17368
  });
17264
17369
  }
17265
- });
17266
- //补发
17267
- pubsub__default['default'].subscribe(componentMap$1[compType].eventNameMap.reissueType, function (type, data) {
17370
+ }), pubsub__default['default'].subscribe(componentMap$1[compType].eventNameMap.reissueType, function (type, data) {
17268
17371
  if (disabled) return;
17269
17372
  withInfo.current = {
17270
17373
  type: type,
@@ -17280,9 +17383,7 @@ var CommonGoods = function CommonGoods(props) {
17280
17383
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
17281
17384
  });
17282
17385
  }
17283
- });
17284
- //退货
17285
- pubsub__default['default'].subscribe(componentMap$1[compType].eventNameMap.returnType, function (type, data) {
17386
+ }), pubsub__default['default'].subscribe(componentMap$1[compType].eventNameMap.returnType, function (type, data) {
17286
17387
  if (disabled) return;
17287
17388
  withInfo.current = {
17288
17389
  type: type,
@@ -17298,15 +17399,18 @@ var CommonGoods = function CommonGoods(props) {
17298
17399
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
17299
17400
  });
17300
17401
  }
17301
- });
17302
- pubsub__default['default'].subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
17402
+ }), pubsub__default['default'].subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
17303
17403
  // console.log(data);
17304
17404
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
17305
17405
  shopCode: data.shopCode
17306
17406
  }));
17307
- });
17407
+ })];
17308
17408
  return function () {
17309
- pubsub__default['default'].clearAllSubscriptions();
17409
+ // 清除当前组件所有订阅
17410
+ tokens.current.forEach(function (token) {
17411
+ return pubsub__default['default'].unsubscribe(token);
17412
+ });
17413
+ tokens.current = [];
17310
17414
  };
17311
17415
  }, [disabled]);
17312
17416
  var _onSelect = function onSelect(list) {
@@ -19878,6 +19982,7 @@ exports.CommonMultiStatus = CommonSystemOrder$1;
19878
19982
  exports.CommonReturnGoods = CommonReturnGoods;
19879
19983
  exports.CommonStatus = CommonStatus;
19880
19984
  exports.CommonSystemOrder = CommonSystemOrder;
19985
+ exports.CopyTextIcon = CopyTextIcon;
19881
19986
  exports.ExpressLogistics = ExpressLogistics;
19882
19987
  exports.Goods = Goods;
19883
19988
  exports.GoodsTable = index$2;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare function CopyTextIcon({ val }: {
3
+ val: string;
4
+ }): React.JSX.Element;
5
+ export default CopyTextIcon;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface HoverTableRowDeleteIconProps {
3
+ index: number;
4
+ hoveredRowIndex: number | null;
5
+ handleClick: () => void;
6
+ }
7
+ declare function HoverTableRowDeleteIcon({ index, hoveredRowIndex, handleClick, }: HoverTableRowDeleteIconProps): React.JSX.Element;
8
+ export default HoverTableRowDeleteIcon;
@@ -17,6 +17,7 @@ export { default as ApaasPosting } from './apaas/ApaasPosting';
17
17
  export { default as ApaasLogistics } from './apaas/ApaasLogistics';
18
18
  export { default as ApaasHoc } from './apaas/hoc/withFormItem';
19
19
  export { default as SubForm } from './apaas/SubForm';
20
+ export { default as CopyTextIcon } from './apaas/CopyTextIcon';
20
21
  export { default as BuyerNick } from './business/BuyerNick';
21
22
  export { default as TradeId } from './business/TradeId';
22
23
  export { default as ShopName } from './business/ShopName';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "2.0.48",
3
+ "version": "2.0.50",
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.0.48",
23
+ "@kmkf-fe-packages/kmkf-utils": "2.0.50",
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": "c73160ce1d8542bbff5b17946e75bc0a269ce846"
68
+ "gitHead": "16c894e447edf1416f3bb0cac9f1496e388e92e6"
69
69
  }