@kmkf-fe-packages/basic-components 0.8.9-alpha.0 → 0.8.9-alpha.12

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,7 +1,8 @@
1
- import React, { useRef, useState, useEffect, useMemo, forwardRef, useImperativeHandle, useCallback } from 'react';
2
- import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Checkbox, Row, Col, Slider, Rate, Button, Form, Tabs, Modal, ConfigProvider, Pagination, Popover, Table } from 'antd';
1
+ import React, { useRef, useState, useEffect, useMemo, forwardRef, useImperativeHandle } from 'react';
2
+ import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate, Form, Tabs, ConfigProvider, Pagination, Popover, Table } from 'antd';
3
3
  import { EyeOutlined, DeleteOutlined, InboxOutlined } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
5
+ import { CopyToClipboard } from 'react-copy-to-clipboard';
5
6
  import { AddressData, BsAddressData, request as request$1, ExpressData, LogisticsAddressData, uuid } from '@kmkf-fe-packages/kmkf-utils';
6
7
  import zhCN from 'antd/lib/locale/zh_CN';
7
8
  import pubsub from 'pubsub-js';
@@ -6871,11 +6872,27 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6871
6872
  _ref$actionUrl = _ref.actionUrl,
6872
6873
  actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
6873
6874
  resetProps = _objectWithoutProperties(_ref, _excluded$7);
6874
- var valueRef = useRef(value);
6875
6875
  var _useState = useState(false),
6876
6876
  _useState2 = _slicedToArray(_useState, 2),
6877
- uploading = _useState2[0],
6878
- setUploading = _useState2[1];
6877
+ visible = _useState2[0],
6878
+ setVisible = _useState2[1];
6879
+ var _useState3 = useState(''),
6880
+ _useState4 = _slicedToArray(_useState3, 2),
6881
+ fileUrl = _useState4[0],
6882
+ setFileUrl = _useState4[1];
6883
+ var _useState5 = useState(''),
6884
+ _useState6 = _slicedToArray(_useState5, 2),
6885
+ fileType = _useState6[0],
6886
+ setFileType = _useState6[1];
6887
+ var _useState7 = useState(''),
6888
+ _useState8 = _slicedToArray(_useState7, 2),
6889
+ fileName = _useState8[0],
6890
+ setFileName = _useState8[1];
6891
+ var valueRef = useRef(value);
6892
+ var _useState9 = useState(false),
6893
+ _useState10 = _slicedToArray(_useState9, 2),
6894
+ uploading = _useState10[0],
6895
+ setUploading = _useState10[1];
6879
6896
  var fileList = useMemo(function () {
6880
6897
  return value.map(function (t, i) {
6881
6898
  return _objectSpread2(_objectSpread2({}, t), {}, {
@@ -6962,6 +6979,29 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6962
6979
  });
6963
6980
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
6964
6981
  };
6982
+ var onPreview = function onPreview(file) {
6983
+ var _file$url;
6984
+ var fileArr = file === null || file === void 0 ? void 0 : (_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.split('.');
6985
+ var fileType = fileArr[fileArr.length - 1];
6986
+ if (['png', 'jpg', 'jpeg', 'gif', 'bmp', 'svg'].includes(fileType.toLowerCase())) {
6987
+ setFileUrl(file === null || file === void 0 ? void 0 : file.url);
6988
+ setFileName(file === null || file === void 0 ? void 0 : file.name);
6989
+ setFileType('pic');
6990
+ setVisible(true);
6991
+ } else if (['mp4', 'avi', 'mpeg', 'asf', 'mov', '3gp', 'wmv', 'rmvb'].includes(fileType.toLowerCase())) {
6992
+ setFileUrl(file === null || file === void 0 ? void 0 : file.url);
6993
+ setFileName(file === null || file === void 0 ? void 0 : file.name);
6994
+ setFileType('video');
6995
+ setVisible(true);
6996
+ } else {
6997
+ window.open(file === null || file === void 0 ? void 0 : file.url);
6998
+ }
6999
+ };
7000
+ var handleCancel = function handleCancel() {
7001
+ setFileUrl('');
7002
+ setFileName('');
7003
+ setVisible(false);
7004
+ };
6965
7005
  return /*#__PURE__*/React.createElement(Spin, {
6966
7006
  spinning: uploading
6967
7007
  }, /*#__PURE__*/React.createElement("p", {
@@ -6973,13 +7013,40 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6973
7013
  name: "file",
6974
7014
  maxCount: maxCount,
6975
7015
  beforeUpload: beforeUpload,
7016
+ onPreview: onPreview,
6976
7017
  fileList: fileList,
6977
7018
  onRemove: onRemove
6978
7019
  }, resetProps), /*#__PURE__*/React.createElement("p", {
6979
7020
  className: "ant-upload-drag-icon"
6980
7021
  }, /*#__PURE__*/React.createElement(InboxOutlined, null)), /*#__PURE__*/React.createElement("p", {
6981
7022
  className: "ant-upload-text"
6982
- }, "\u70B9\u51FB\u201C\u9009\u62E9\u6587\u4EF6\u201D\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF")));
7023
+ }, "\u70B9\u51FB\u201C\u9009\u62E9\u6587\u4EF6\u201D\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF")), /*#__PURE__*/React.createElement(Modal, {
7024
+ visible: visible,
7025
+ title: fileName,
7026
+ footer: null,
7027
+ onCancel: handleCancel
7028
+ }, /*#__PURE__*/React.createElement(CopyToClipboard, {
7029
+ text: fileUrl,
7030
+ onCopy: function onCopy() {
7031
+ message.success('复制成功');
7032
+ }
7033
+ }, /*#__PURE__*/React.createElement(Button, {
7034
+ type: "link"
7035
+ }, "\u4E0B\u8F7D\u5730\u5740")), fileType === 'pic' ? /*#__PURE__*/React.createElement("img", {
7036
+ alt: "example",
7037
+ style: {
7038
+ width: '100%'
7039
+ },
7040
+ src: fileUrl
7041
+ }) : /*#__PURE__*/React.createElement("video", {
7042
+ style: {
7043
+ width: '100%',
7044
+ height: '100%'
7045
+ },
7046
+ autoPlay: true,
7047
+ controls: true,
7048
+ src: fileUrl
7049
+ })));
6983
7050
  };
6984
7051
 
6985
7052
  var _excluded$8 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
@@ -9699,13 +9766,14 @@ var ItemList = function ItemList(props) {
9699
9766
  }, "\u6682\u4E0D\u652F\u6301\u6DFB\u52A0")) : null);
9700
9767
  };
9701
9768
 
9769
+ var _excluded$c = ["shopId"];
9702
9770
  var columns = [{
9703
9771
  dataIndex: 'index',
9704
- title: '序号',
9772
+ title: 'NO',
9705
9773
  render: function render(val, record, index) {
9706
9774
  return /*#__PURE__*/React.createElement("div", {
9707
9775
  style: {
9708
- width: '30px'
9776
+ width: 25
9709
9777
  }
9710
9778
  }, index + 1);
9711
9779
  }
@@ -9757,13 +9825,13 @@ var columns = [{
9757
9825
  var GoodsModal$1 = function GoodsModal(props, ref) {
9758
9826
  useImperativeHandle(ref, function () {
9759
9827
  return {
9760
- open: function open() {
9828
+ open: function open(shopCode) {
9761
9829
  setVisible(true);
9762
9830
  setPageNo(1);
9763
9831
  setSelect([]);
9764
9832
  setSelectIds([]);
9765
- queryItems();
9766
- onReset();
9833
+ queryItems(shopCode);
9834
+ getShopList();
9767
9835
  }
9768
9836
  };
9769
9837
  });
@@ -9771,7 +9839,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9771
9839
  shopId = props.shopId,
9772
9840
  shopList = props.shopList,
9773
9841
  width = props.width,
9774
- shopCode = props.shopCode;
9842
+ companyKey = props.companyKey;
9775
9843
  var _useState = useState(false),
9776
9844
  _useState2 = _slicedToArray(_useState, 2),
9777
9845
  visible = _useState2[0],
@@ -9811,14 +9879,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9811
9879
  _useState20 = _slicedToArray(_useState19, 2),
9812
9880
  total = _useState20[0],
9813
9881
  setTotal = _useState20[1];
9814
- var _useState21 = useState(''),
9882
+ var _useState21 = useState(),
9815
9883
  _useState22 = _slicedToArray(_useState21, 2),
9816
- platform = _useState22[0],
9817
- setPlatform = _useState22[1]; //平台 taobao=淘宝 fxg=抖音 pdd=拼多多 sph=微信视屏号
9818
- var _useState23 = useState({}),
9819
- _useState24 = _slicedToArray(_useState23, 2),
9820
- shopInfo = _useState24[0],
9821
- setShopInfo = _useState24[1]; //店铺信息
9884
+ shopOptions = _useState22[0],
9885
+ setShopList = _useState22[1];
9822
9886
  var _Form$useForm = Form.useForm(),
9823
9887
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
9824
9888
  form = _Form$useForm2[0];
@@ -9830,54 +9894,55 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9830
9894
  /**
9831
9895
  * 查询商品
9832
9896
  */
9833
- var queryItems = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9834
- var params, res, products, newProducts;
9835
- return _regeneratorRuntime().wrap(function _callee$(_context) {
9836
- while (1) switch (_context.prev = _context.next) {
9837
- case 0:
9838
- _context.prev = 0;
9839
- setLoading(true);
9840
- params = {
9841
- shopCode: shopCode
9842
- };
9843
- _context.next = 5;
9844
- return extendRequest('/qy/gdfw/product/bsListProduct', {
9845
- method: 'post',
9846
- data: params
9847
- });
9848
- case 5:
9849
- res = _context.sent;
9850
- products = res.data.products;
9851
- newProducts = (products || []).map(function (item, index) {
9852
- return _objectSpread2(_objectSpread2({}, item), {}, {
9853
- index: index + 1
9897
+ var queryItems = /*#__PURE__*/function () {
9898
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(shopCode) {
9899
+ var params, res, products, newProducts;
9900
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9901
+ while (1) switch (_context.prev = _context.next) {
9902
+ case 0:
9903
+ form.setFieldsValue({
9904
+ shopId: shopCode
9854
9905
  });
9855
- });
9856
- setAllList(_toConsumableArray(newProducts));
9857
- initData(_toConsumableArray(newProducts));
9858
- case 10:
9859
- _context.prev = 10;
9860
- setLoading(false);
9861
- return _context.finish(10);
9862
- case 13:
9863
- case "end":
9864
- return _context.stop();
9865
- }
9866
- }, _callee, null, [[0,, 10, 13]]);
9867
- })), [shopCode]);
9868
- useEffect(function () {
9869
- var shopInfo = shopList.find(function (item) {
9870
- return shopId === item.shopId || shopId === item.shopName;
9871
- });
9872
- setShopInfo(shopInfo);
9873
- var platform = shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.shopSourceStr.toLowerCase();
9874
- setPlatform(platform);
9875
- }, [shopId]);
9906
+ _context.prev = 1;
9907
+ setLoading(true);
9908
+ params = {
9909
+ shopCode: shopCode
9910
+ };
9911
+ _context.next = 6;
9912
+ return extendRequest('/qy/gdfw/product/bsListProduct', {
9913
+ method: 'post',
9914
+ data: params
9915
+ });
9916
+ case 6:
9917
+ res = _context.sent;
9918
+ if (res.success) {
9919
+ products = res.data.products;
9920
+ newProducts = (products || []).map(function (item, index) {
9921
+ return _objectSpread2(_objectSpread2({}, item), {}, {
9922
+ index: index + 1
9923
+ });
9924
+ });
9925
+ setAllList(_toConsumableArray(newProducts));
9926
+ initData(_toConsumableArray(newProducts));
9927
+ }
9928
+ case 8:
9929
+ _context.prev = 8;
9930
+ setLoading(false);
9931
+ return _context.finish(8);
9932
+ case 11:
9933
+ case "end":
9934
+ return _context.stop();
9935
+ }
9936
+ }, _callee, null, [[1,, 8, 11]]);
9937
+ }));
9938
+ return function queryItems(_x) {
9939
+ return _ref.apply(this, arguments);
9940
+ };
9941
+ }();
9876
9942
  var rowSelection = {
9877
9943
  selectedRowKeys: selectIds,
9878
9944
  fixed: true,
9879
9945
  onChange: function onChange(selectedRowKeys, selectedRows, info) {
9880
- console.log(selectedRowKeys, selectedRows, info);
9881
9946
  setSelectIds(selectedRowKeys);
9882
9947
  setSelect(_toConsumableArray(selectedRows));
9883
9948
  }
@@ -9889,13 +9954,17 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9889
9954
  setPageNo(1);
9890
9955
  };
9891
9956
  var _onCancel = function onCancel() {
9957
+ onReset();
9892
9958
  setVisible(false);
9893
9959
  };
9894
9960
  var onOk = function onOk() {
9895
9961
  onSubmit(selectList);
9896
9962
  _onCancel();
9897
9963
  };
9898
- var onFinish = function onFinish(value) {
9964
+ var onFinish = function onFinish(val) {
9965
+ var shopId = val.shopId,
9966
+ other = _objectWithoutProperties(val, _excluded$c);
9967
+ var value = other;
9899
9968
  var newFilterList = [];
9900
9969
  var hasValue = Object.values(value).some(function (t) {
9901
9970
  return !!t;
@@ -9903,8 +9972,9 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9903
9972
  if (hasValue) {
9904
9973
  Object.keys(value).forEach(function (key) {
9905
9974
  if (value[key]) {
9975
+ var trimValue = value[key].trim();
9906
9976
  newFilterList = allList.filter(function (item) {
9907
- return item[key].indexOf(value[key]) > -1;
9977
+ return item[key].indexOf(trimValue) > -1;
9908
9978
  });
9909
9979
  }
9910
9980
  });
@@ -9915,7 +9985,52 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9915
9985
  };
9916
9986
  var onReset = function onReset() {
9917
9987
  form.resetFields();
9918
- initData(_toConsumableArray(allList));
9988
+ initData([]);
9989
+ };
9990
+ var getShopList = /*#__PURE__*/function () {
9991
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9992
+ var _yield$request, success, data, obj, list;
9993
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9994
+ while (1) switch (_context2.prev = _context2.next) {
9995
+ case 0:
9996
+ _context2.next = 2;
9997
+ return extendRequest('/qy/diamond/getConfigInfo', {
9998
+ method: 'get',
9999
+ params: {
10000
+ key: 'company-third-shop-info'
10001
+ }
10002
+ });
10003
+ case 2:
10004
+ _yield$request = _context2.sent;
10005
+ success = _yield$request.success;
10006
+ data = _yield$request.data;
10007
+ obj = JSON.parse(data || '{}');
10008
+ if (success) {
10009
+ list = ((obj === null || obj === void 0 ? void 0 : obj[companyKey]) || []).map(function (item) {
10010
+ return {
10011
+ label: item.shopName,
10012
+ value: item.shopCode
10013
+ };
10014
+ });
10015
+ setShopList(list);
10016
+ }
10017
+ case 7:
10018
+ case "end":
10019
+ return _context2.stop();
10020
+ }
10021
+ }, _callee2);
10022
+ }));
10023
+ return function getShopList() {
10024
+ return _ref2.apply(this, arguments);
10025
+ };
10026
+ }();
10027
+ var onValuesChange = function onValuesChange(changedValues) {
10028
+ if (changedValues === null || changedValues === void 0 ? void 0 : changedValues['shopId']) {
10029
+ queryItems(changedValues === null || changedValues === void 0 ? void 0 : changedValues.shopId);
10030
+ pubsub.publish('changeShopCode', {
10031
+ shopCode: changedValues.shopId
10032
+ });
10033
+ }
9919
10034
  };
9920
10035
  return /*#__PURE__*/React.createElement(Modal, {
9921
10036
  title: '选择商品',
@@ -9931,8 +10046,21 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9931
10046
  }, /*#__PURE__*/React.createElement(Form, {
9932
10047
  layout: "inline",
9933
10048
  form: form,
9934
- onFinish: onFinish
10049
+ onFinish: onFinish,
10050
+ onValuesChange: onValuesChange
9935
10051
  }, /*#__PURE__*/React.createElement(Form.Item, {
10052
+ name: "shopId"
10053
+ }, /*#__PURE__*/React.createElement(Select, {
10054
+ placeholder: "\u5E97\u94FA",
10055
+ style: {
10056
+ width: 150
10057
+ },
10058
+ options: shopOptions || [],
10059
+ showSearch: true,
10060
+ filterOption: function filterOption(input, option) {
10061
+ return option.label.includes(input);
10062
+ }
10063
+ })), /*#__PURE__*/React.createElement(Form.Item, {
9936
10064
  name: "skuName"
9937
10065
  }, /*#__PURE__*/React.createElement(Input, {
9938
10066
  placeholder: "\u5546\u54C1sku\u540D\u79F0",
@@ -10024,6 +10152,8 @@ var GoodItem = function GoodItem(props) {
10024
10152
  _props$canUpdateNumbe = props.canUpdateNumber,
10025
10153
  canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
10026
10154
  shopCode = props.shopCode,
10155
+ _props$companyKey = props.companyKey,
10156
+ companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
10027
10157
  onSelect = props.onSelect,
10028
10158
  onDelete = props.onDelete;
10029
10159
  var refModal = useRef();
@@ -10205,7 +10335,7 @@ var GoodItem = function GoodItem(props) {
10205
10335
  }));
10206
10336
  };
10207
10337
  var handleChangeGoods = function handleChangeGoods() {
10208
- refModal.current.open();
10338
+ refModal.current.open(shopCode);
10209
10339
  };
10210
10340
  var rowSelection = {
10211
10341
  selectedRowKeys: selectedRowKeys,
@@ -10245,7 +10375,7 @@ var GoodItem = function GoodItem(props) {
10245
10375
  shopList: shopList,
10246
10376
  shopId: shopId,
10247
10377
  maxLength: maxLength,
10248
- shopCode: shopCode
10378
+ companyKey: companyKey
10249
10379
  }));
10250
10380
  };
10251
10381
 
@@ -10284,7 +10414,6 @@ var BsGoods = function BsGoods(props) {
10284
10414
  //补发
10285
10415
  pubsub.subscribe('reissueType', function (type, data) {
10286
10416
  if (disabled) return;
10287
- console.log(type, data);
10288
10417
  withInfo.current = {
10289
10418
  type: type,
10290
10419
  val: data.val,
@@ -10299,6 +10428,12 @@ var BsGoods = function BsGoods(props) {
10299
10428
  });
10300
10429
  }
10301
10430
  });
10431
+ pubsub.subscribeOnce('changeShopCode', function (type, data) {
10432
+ console.log(data);
10433
+ onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
10434
+ shopCode: data.shopCode
10435
+ }));
10436
+ });
10302
10437
  }, [disabled]);
10303
10438
  var _onSelect = function onSelect(list) {
10304
10439
  var _withInfo$current, _withInfo$current2;
@@ -10345,7 +10480,7 @@ var BsGoods = function BsGoods(props) {
10345
10480
  }));
10346
10481
  };
10347
10482
 
10348
- var _excluded$c = ["value", "onChange", "reasonList", "disabled"];
10483
+ var _excluded$d = ["value", "onChange", "reasonList", "disabled"];
10349
10484
  var BsExchange = function BsExchange(props) {
10350
10485
  var _value$bsExchangeType4, _value$bsExchangeType5, _value$bsExchangeType6;
10351
10486
  var value = props.value,
@@ -10353,7 +10488,7 @@ var BsExchange = function BsExchange(props) {
10353
10488
  _props$reasonList = props.reasonList,
10354
10489
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
10355
10490
  disabled = props.disabled,
10356
- other = _objectWithoutProperties(props, _excluded$c);
10491
+ other = _objectWithoutProperties(props, _excluded$d);
10357
10492
  var valueRef = useRef({});
10358
10493
  useEffect(function () {
10359
10494
  valueRef.current = value;
@@ -10377,10 +10512,14 @@ var BsExchange = function BsExchange(props) {
10377
10512
  onChange(newValue);
10378
10513
  }
10379
10514
  });
10515
+ pubsub.subscribeOnce('changeShopCode', function (type, data) {
10516
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
10517
+ shopCode: data.shopCode
10518
+ }));
10519
+ });
10380
10520
  }, [value]);
10381
10521
  useEffect(function () {
10382
10522
  pubsub.subscribe('selectList', function (_, data) {
10383
- console.log('selectList', data, valueRef.current);
10384
10523
  if (disabled) return;
10385
10524
  var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10386
10525
  onChange(_objectSpread2(_objectSpread2({}, data.goodValue), {}, {
@@ -10390,7 +10529,6 @@ var BsExchange = function BsExchange(props) {
10390
10529
  }, []);
10391
10530
  useEffect(function () {
10392
10531
  pubsub.subscribe('selectListReturn', function (_, data) {
10393
- console.log('selectListReturn', data);
10394
10532
  if (disabled) return;
10395
10533
  var newValue = _objectSpread2({}, data.goodValue);
10396
10534
  var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
@@ -10572,14 +10710,14 @@ var BsExchange = function BsExchange(props) {
10572
10710
  }))) : null);
10573
10711
  };
10574
10712
 
10575
- var _excluded$d = ["value", "onChange", "reasonList", "disabled"];
10713
+ var _excluded$e = ["value", "onChange", "reasonList", "disabled"];
10576
10714
  var BsReissue = function BsReissue(props) {
10577
10715
  var value = props.value,
10578
10716
  onChange = props.onChange,
10579
10717
  _props$reasonList = props.reasonList,
10580
10718
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
10581
10719
  disabled = props.disabled,
10582
- other = _objectWithoutProperties(props, _excluded$d);
10720
+ other = _objectWithoutProperties(props, _excluded$e);
10583
10721
  var valueRef = useRef({});
10584
10722
  useEffect(function () {
10585
10723
  pubsub.subscribe('reissueSelectList', function (_, data) {
@@ -10621,6 +10759,11 @@ var BsReissue = function BsReissue(props) {
10621
10759
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10622
10760
  }
10623
10761
  });
10762
+ pubsub.subscribeOnce('changeShopCode', function (type, data) {
10763
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
10764
+ shopCode: data.shopCode
10765
+ }));
10766
+ });
10624
10767
  }, [value, disabled]);
10625
10768
  var changeTypeHandle = function changeTypeHandle(val) {
10626
10769
  var newValue = _objectSpread2({}, value);
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ var React = require('react');
6
6
  var antd = require('antd');
7
7
  var icons = require('@ant-design/icons');
8
8
  var request = require('umi-request');
9
+ var reactCopyToClipboard = require('react-copy-to-clipboard');
9
10
  var kmkfUtils = require('@kmkf-fe-packages/kmkf-utils');
10
11
  var zhCN = require('antd/lib/locale/zh_CN');
11
12
  var pubsub = require('pubsub-js');
@@ -6882,11 +6883,27 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6882
6883
  _ref$actionUrl = _ref.actionUrl,
6883
6884
  actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
6884
6885
  resetProps = _objectWithoutProperties(_ref, _excluded$7);
6885
- var valueRef = React.useRef(value);
6886
6886
  var _useState = React.useState(false),
6887
6887
  _useState2 = _slicedToArray(_useState, 2),
6888
- uploading = _useState2[0],
6889
- setUploading = _useState2[1];
6888
+ visible = _useState2[0],
6889
+ setVisible = _useState2[1];
6890
+ var _useState3 = React.useState(''),
6891
+ _useState4 = _slicedToArray(_useState3, 2),
6892
+ fileUrl = _useState4[0],
6893
+ setFileUrl = _useState4[1];
6894
+ var _useState5 = React.useState(''),
6895
+ _useState6 = _slicedToArray(_useState5, 2),
6896
+ fileType = _useState6[0],
6897
+ setFileType = _useState6[1];
6898
+ var _useState7 = React.useState(''),
6899
+ _useState8 = _slicedToArray(_useState7, 2),
6900
+ fileName = _useState8[0],
6901
+ setFileName = _useState8[1];
6902
+ var valueRef = React.useRef(value);
6903
+ var _useState9 = React.useState(false),
6904
+ _useState10 = _slicedToArray(_useState9, 2),
6905
+ uploading = _useState10[0],
6906
+ setUploading = _useState10[1];
6890
6907
  var fileList = React.useMemo(function () {
6891
6908
  return value.map(function (t, i) {
6892
6909
  return _objectSpread2(_objectSpread2({}, t), {}, {
@@ -6973,6 +6990,29 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6973
6990
  });
6974
6991
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
6975
6992
  };
6993
+ var onPreview = function onPreview(file) {
6994
+ var _file$url;
6995
+ var fileArr = file === null || file === void 0 ? void 0 : (_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.split('.');
6996
+ var fileType = fileArr[fileArr.length - 1];
6997
+ if (['png', 'jpg', 'jpeg', 'gif', 'bmp', 'svg'].includes(fileType.toLowerCase())) {
6998
+ setFileUrl(file === null || file === void 0 ? void 0 : file.url);
6999
+ setFileName(file === null || file === void 0 ? void 0 : file.name);
7000
+ setFileType('pic');
7001
+ setVisible(true);
7002
+ } else if (['mp4', 'avi', 'mpeg', 'asf', 'mov', '3gp', 'wmv', 'rmvb'].includes(fileType.toLowerCase())) {
7003
+ setFileUrl(file === null || file === void 0 ? void 0 : file.url);
7004
+ setFileName(file === null || file === void 0 ? void 0 : file.name);
7005
+ setFileType('video');
7006
+ setVisible(true);
7007
+ } else {
7008
+ window.open(file === null || file === void 0 ? void 0 : file.url);
7009
+ }
7010
+ };
7011
+ var handleCancel = function handleCancel() {
7012
+ setFileUrl('');
7013
+ setFileName('');
7014
+ setVisible(false);
7015
+ };
6976
7016
  return /*#__PURE__*/React__default['default'].createElement(antd.Spin, {
6977
7017
  spinning: uploading
6978
7018
  }, /*#__PURE__*/React__default['default'].createElement("p", {
@@ -6984,13 +7024,40 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6984
7024
  name: "file",
6985
7025
  maxCount: maxCount,
6986
7026
  beforeUpload: beforeUpload,
7027
+ onPreview: onPreview,
6987
7028
  fileList: fileList,
6988
7029
  onRemove: onRemove
6989
7030
  }, resetProps), /*#__PURE__*/React__default['default'].createElement("p", {
6990
7031
  className: "ant-upload-drag-icon"
6991
7032
  }, /*#__PURE__*/React__default['default'].createElement(icons.InboxOutlined, null)), /*#__PURE__*/React__default['default'].createElement("p", {
6992
7033
  className: "ant-upload-text"
6993
- }, "\u70B9\u51FB\u201C\u9009\u62E9\u6587\u4EF6\u201D\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF")));
7034
+ }, "\u70B9\u51FB\u201C\u9009\u62E9\u6587\u4EF6\u201D\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF")), /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
7035
+ visible: visible,
7036
+ title: fileName,
7037
+ footer: null,
7038
+ onCancel: handleCancel
7039
+ }, /*#__PURE__*/React__default['default'].createElement(reactCopyToClipboard.CopyToClipboard, {
7040
+ text: fileUrl,
7041
+ onCopy: function onCopy() {
7042
+ antd.message.success('复制成功');
7043
+ }
7044
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
7045
+ type: "link"
7046
+ }, "\u4E0B\u8F7D\u5730\u5740")), fileType === 'pic' ? /*#__PURE__*/React__default['default'].createElement("img", {
7047
+ alt: "example",
7048
+ style: {
7049
+ width: '100%'
7050
+ },
7051
+ src: fileUrl
7052
+ }) : /*#__PURE__*/React__default['default'].createElement("video", {
7053
+ style: {
7054
+ width: '100%',
7055
+ height: '100%'
7056
+ },
7057
+ autoPlay: true,
7058
+ controls: true,
7059
+ src: fileUrl
7060
+ })));
6994
7061
  };
6995
7062
 
6996
7063
  var _excluded$8 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
@@ -9710,13 +9777,14 @@ var ItemList = function ItemList(props) {
9710
9777
  }, "\u6682\u4E0D\u652F\u6301\u6DFB\u52A0")) : null);
9711
9778
  };
9712
9779
 
9780
+ var _excluded$c = ["shopId"];
9713
9781
  var columns = [{
9714
9782
  dataIndex: 'index',
9715
- title: '序号',
9783
+ title: 'NO',
9716
9784
  render: function render(val, record, index) {
9717
9785
  return /*#__PURE__*/React__default['default'].createElement("div", {
9718
9786
  style: {
9719
- width: '30px'
9787
+ width: 25
9720
9788
  }
9721
9789
  }, index + 1);
9722
9790
  }
@@ -9768,13 +9836,13 @@ var columns = [{
9768
9836
  var GoodsModal$1 = function GoodsModal(props, ref) {
9769
9837
  React.useImperativeHandle(ref, function () {
9770
9838
  return {
9771
- open: function open() {
9839
+ open: function open(shopCode) {
9772
9840
  setVisible(true);
9773
9841
  setPageNo(1);
9774
9842
  setSelect([]);
9775
9843
  setSelectIds([]);
9776
- queryItems();
9777
- onReset();
9844
+ queryItems(shopCode);
9845
+ getShopList();
9778
9846
  }
9779
9847
  };
9780
9848
  });
@@ -9782,7 +9850,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9782
9850
  shopId = props.shopId,
9783
9851
  shopList = props.shopList,
9784
9852
  width = props.width,
9785
- shopCode = props.shopCode;
9853
+ companyKey = props.companyKey;
9786
9854
  var _useState = React.useState(false),
9787
9855
  _useState2 = _slicedToArray(_useState, 2),
9788
9856
  visible = _useState2[0],
@@ -9822,14 +9890,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9822
9890
  _useState20 = _slicedToArray(_useState19, 2),
9823
9891
  total = _useState20[0],
9824
9892
  setTotal = _useState20[1];
9825
- var _useState21 = React.useState(''),
9893
+ var _useState21 = React.useState(),
9826
9894
  _useState22 = _slicedToArray(_useState21, 2),
9827
- platform = _useState22[0],
9828
- setPlatform = _useState22[1]; //平台 taobao=淘宝 fxg=抖音 pdd=拼多多 sph=微信视屏号
9829
- var _useState23 = React.useState({}),
9830
- _useState24 = _slicedToArray(_useState23, 2),
9831
- shopInfo = _useState24[0],
9832
- setShopInfo = _useState24[1]; //店铺信息
9895
+ shopOptions = _useState22[0],
9896
+ setShopList = _useState22[1];
9833
9897
  var _Form$useForm = antd.Form.useForm(),
9834
9898
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
9835
9899
  form = _Form$useForm2[0];
@@ -9841,54 +9905,55 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9841
9905
  /**
9842
9906
  * 查询商品
9843
9907
  */
9844
- var queryItems = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9845
- var params, res, products, newProducts;
9846
- return _regeneratorRuntime().wrap(function _callee$(_context) {
9847
- while (1) switch (_context.prev = _context.next) {
9848
- case 0:
9849
- _context.prev = 0;
9850
- setLoading(true);
9851
- params = {
9852
- shopCode: shopCode
9853
- };
9854
- _context.next = 5;
9855
- return extendRequest('/qy/gdfw/product/bsListProduct', {
9856
- method: 'post',
9857
- data: params
9858
- });
9859
- case 5:
9860
- res = _context.sent;
9861
- products = res.data.products;
9862
- newProducts = (products || []).map(function (item, index) {
9863
- return _objectSpread2(_objectSpread2({}, item), {}, {
9864
- index: index + 1
9908
+ var queryItems = /*#__PURE__*/function () {
9909
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(shopCode) {
9910
+ var params, res, products, newProducts;
9911
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9912
+ while (1) switch (_context.prev = _context.next) {
9913
+ case 0:
9914
+ form.setFieldsValue({
9915
+ shopId: shopCode
9865
9916
  });
9866
- });
9867
- setAllList(_toConsumableArray(newProducts));
9868
- initData(_toConsumableArray(newProducts));
9869
- case 10:
9870
- _context.prev = 10;
9871
- setLoading(false);
9872
- return _context.finish(10);
9873
- case 13:
9874
- case "end":
9875
- return _context.stop();
9876
- }
9877
- }, _callee, null, [[0,, 10, 13]]);
9878
- })), [shopCode]);
9879
- React.useEffect(function () {
9880
- var shopInfo = shopList.find(function (item) {
9881
- return shopId === item.shopId || shopId === item.shopName;
9882
- });
9883
- setShopInfo(shopInfo);
9884
- var platform = shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.shopSourceStr.toLowerCase();
9885
- setPlatform(platform);
9886
- }, [shopId]);
9917
+ _context.prev = 1;
9918
+ setLoading(true);
9919
+ params = {
9920
+ shopCode: shopCode
9921
+ };
9922
+ _context.next = 6;
9923
+ return extendRequest('/qy/gdfw/product/bsListProduct', {
9924
+ method: 'post',
9925
+ data: params
9926
+ });
9927
+ case 6:
9928
+ res = _context.sent;
9929
+ if (res.success) {
9930
+ products = res.data.products;
9931
+ newProducts = (products || []).map(function (item, index) {
9932
+ return _objectSpread2(_objectSpread2({}, item), {}, {
9933
+ index: index + 1
9934
+ });
9935
+ });
9936
+ setAllList(_toConsumableArray(newProducts));
9937
+ initData(_toConsumableArray(newProducts));
9938
+ }
9939
+ case 8:
9940
+ _context.prev = 8;
9941
+ setLoading(false);
9942
+ return _context.finish(8);
9943
+ case 11:
9944
+ case "end":
9945
+ return _context.stop();
9946
+ }
9947
+ }, _callee, null, [[1,, 8, 11]]);
9948
+ }));
9949
+ return function queryItems(_x) {
9950
+ return _ref.apply(this, arguments);
9951
+ };
9952
+ }();
9887
9953
  var rowSelection = {
9888
9954
  selectedRowKeys: selectIds,
9889
9955
  fixed: true,
9890
9956
  onChange: function onChange(selectedRowKeys, selectedRows, info) {
9891
- console.log(selectedRowKeys, selectedRows, info);
9892
9957
  setSelectIds(selectedRowKeys);
9893
9958
  setSelect(_toConsumableArray(selectedRows));
9894
9959
  }
@@ -9900,13 +9965,17 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9900
9965
  setPageNo(1);
9901
9966
  };
9902
9967
  var _onCancel = function onCancel() {
9968
+ onReset();
9903
9969
  setVisible(false);
9904
9970
  };
9905
9971
  var onOk = function onOk() {
9906
9972
  onSubmit(selectList);
9907
9973
  _onCancel();
9908
9974
  };
9909
- var onFinish = function onFinish(value) {
9975
+ var onFinish = function onFinish(val) {
9976
+ var shopId = val.shopId,
9977
+ other = _objectWithoutProperties(val, _excluded$c);
9978
+ var value = other;
9910
9979
  var newFilterList = [];
9911
9980
  var hasValue = Object.values(value).some(function (t) {
9912
9981
  return !!t;
@@ -9914,8 +9983,9 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9914
9983
  if (hasValue) {
9915
9984
  Object.keys(value).forEach(function (key) {
9916
9985
  if (value[key]) {
9986
+ var trimValue = value[key].trim();
9917
9987
  newFilterList = allList.filter(function (item) {
9918
- return item[key].indexOf(value[key]) > -1;
9988
+ return item[key].indexOf(trimValue) > -1;
9919
9989
  });
9920
9990
  }
9921
9991
  });
@@ -9926,7 +9996,52 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9926
9996
  };
9927
9997
  var onReset = function onReset() {
9928
9998
  form.resetFields();
9929
- initData(_toConsumableArray(allList));
9999
+ initData([]);
10000
+ };
10001
+ var getShopList = /*#__PURE__*/function () {
10002
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
10003
+ var _yield$request, success, data, obj, list;
10004
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10005
+ while (1) switch (_context2.prev = _context2.next) {
10006
+ case 0:
10007
+ _context2.next = 2;
10008
+ return extendRequest('/qy/diamond/getConfigInfo', {
10009
+ method: 'get',
10010
+ params: {
10011
+ key: 'company-third-shop-info'
10012
+ }
10013
+ });
10014
+ case 2:
10015
+ _yield$request = _context2.sent;
10016
+ success = _yield$request.success;
10017
+ data = _yield$request.data;
10018
+ obj = JSON.parse(data || '{}');
10019
+ if (success) {
10020
+ list = ((obj === null || obj === void 0 ? void 0 : obj[companyKey]) || []).map(function (item) {
10021
+ return {
10022
+ label: item.shopName,
10023
+ value: item.shopCode
10024
+ };
10025
+ });
10026
+ setShopList(list);
10027
+ }
10028
+ case 7:
10029
+ case "end":
10030
+ return _context2.stop();
10031
+ }
10032
+ }, _callee2);
10033
+ }));
10034
+ return function getShopList() {
10035
+ return _ref2.apply(this, arguments);
10036
+ };
10037
+ }();
10038
+ var onValuesChange = function onValuesChange(changedValues) {
10039
+ if (changedValues === null || changedValues === void 0 ? void 0 : changedValues['shopId']) {
10040
+ queryItems(changedValues === null || changedValues === void 0 ? void 0 : changedValues.shopId);
10041
+ pubsub__default['default'].publish('changeShopCode', {
10042
+ shopCode: changedValues.shopId
10043
+ });
10044
+ }
9930
10045
  };
9931
10046
  return /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
9932
10047
  title: '选择商品',
@@ -9942,8 +10057,21 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9942
10057
  }, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
9943
10058
  layout: "inline",
9944
10059
  form: form,
9945
- onFinish: onFinish
10060
+ onFinish: onFinish,
10061
+ onValuesChange: onValuesChange
9946
10062
  }, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
10063
+ name: "shopId"
10064
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
10065
+ placeholder: "\u5E97\u94FA",
10066
+ style: {
10067
+ width: 150
10068
+ },
10069
+ options: shopOptions || [],
10070
+ showSearch: true,
10071
+ filterOption: function filterOption(input, option) {
10072
+ return option.label.includes(input);
10073
+ }
10074
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
9947
10075
  name: "skuName"
9948
10076
  }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9949
10077
  placeholder: "\u5546\u54C1sku\u540D\u79F0",
@@ -10035,6 +10163,8 @@ var GoodItem = function GoodItem(props) {
10035
10163
  _props$canUpdateNumbe = props.canUpdateNumber,
10036
10164
  canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
10037
10165
  shopCode = props.shopCode,
10166
+ _props$companyKey = props.companyKey,
10167
+ companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
10038
10168
  onSelect = props.onSelect,
10039
10169
  onDelete = props.onDelete;
10040
10170
  var refModal = React.useRef();
@@ -10216,7 +10346,7 @@ var GoodItem = function GoodItem(props) {
10216
10346
  }));
10217
10347
  };
10218
10348
  var handleChangeGoods = function handleChangeGoods() {
10219
- refModal.current.open();
10349
+ refModal.current.open(shopCode);
10220
10350
  };
10221
10351
  var rowSelection = {
10222
10352
  selectedRowKeys: selectedRowKeys,
@@ -10256,7 +10386,7 @@ var GoodItem = function GoodItem(props) {
10256
10386
  shopList: shopList,
10257
10387
  shopId: shopId,
10258
10388
  maxLength: maxLength,
10259
- shopCode: shopCode
10389
+ companyKey: companyKey
10260
10390
  }));
10261
10391
  };
10262
10392
 
@@ -10295,7 +10425,6 @@ var BsGoods = function BsGoods(props) {
10295
10425
  //补发
10296
10426
  pubsub__default['default'].subscribe('reissueType', function (type, data) {
10297
10427
  if (disabled) return;
10298
- console.log(type, data);
10299
10428
  withInfo.current = {
10300
10429
  type: type,
10301
10430
  val: data.val,
@@ -10310,6 +10439,12 @@ var BsGoods = function BsGoods(props) {
10310
10439
  });
10311
10440
  }
10312
10441
  });
10442
+ pubsub__default['default'].subscribeOnce('changeShopCode', function (type, data) {
10443
+ console.log(data);
10444
+ onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
10445
+ shopCode: data.shopCode
10446
+ }));
10447
+ });
10313
10448
  }, [disabled]);
10314
10449
  var _onSelect = function onSelect(list) {
10315
10450
  var _withInfo$current, _withInfo$current2;
@@ -10356,7 +10491,7 @@ var BsGoods = function BsGoods(props) {
10356
10491
  }));
10357
10492
  };
10358
10493
 
10359
- var _excluded$c = ["value", "onChange", "reasonList", "disabled"];
10494
+ var _excluded$d = ["value", "onChange", "reasonList", "disabled"];
10360
10495
  var BsExchange = function BsExchange(props) {
10361
10496
  var _value$bsExchangeType4, _value$bsExchangeType5, _value$bsExchangeType6;
10362
10497
  var value = props.value,
@@ -10364,7 +10499,7 @@ var BsExchange = function BsExchange(props) {
10364
10499
  _props$reasonList = props.reasonList,
10365
10500
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
10366
10501
  disabled = props.disabled,
10367
- other = _objectWithoutProperties(props, _excluded$c);
10502
+ other = _objectWithoutProperties(props, _excluded$d);
10368
10503
  var valueRef = React.useRef({});
10369
10504
  React.useEffect(function () {
10370
10505
  valueRef.current = value;
@@ -10388,10 +10523,14 @@ var BsExchange = function BsExchange(props) {
10388
10523
  onChange(newValue);
10389
10524
  }
10390
10525
  });
10526
+ pubsub__default['default'].subscribeOnce('changeShopCode', function (type, data) {
10527
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
10528
+ shopCode: data.shopCode
10529
+ }));
10530
+ });
10391
10531
  }, [value]);
10392
10532
  React.useEffect(function () {
10393
10533
  pubsub__default['default'].subscribe('selectList', function (_, data) {
10394
- console.log('selectList', data, valueRef.current);
10395
10534
  if (disabled) return;
10396
10535
  var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10397
10536
  onChange(_objectSpread2(_objectSpread2({}, data.goodValue), {}, {
@@ -10401,7 +10540,6 @@ var BsExchange = function BsExchange(props) {
10401
10540
  }, []);
10402
10541
  React.useEffect(function () {
10403
10542
  pubsub__default['default'].subscribe('selectListReturn', function (_, data) {
10404
- console.log('selectListReturn', data);
10405
10543
  if (disabled) return;
10406
10544
  var newValue = _objectSpread2({}, data.goodValue);
10407
10545
  var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
@@ -10583,14 +10721,14 @@ var BsExchange = function BsExchange(props) {
10583
10721
  }))) : null);
10584
10722
  };
10585
10723
 
10586
- var _excluded$d = ["value", "onChange", "reasonList", "disabled"];
10724
+ var _excluded$e = ["value", "onChange", "reasonList", "disabled"];
10587
10725
  var BsReissue = function BsReissue(props) {
10588
10726
  var value = props.value,
10589
10727
  onChange = props.onChange,
10590
10728
  _props$reasonList = props.reasonList,
10591
10729
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
10592
10730
  disabled = props.disabled,
10593
- other = _objectWithoutProperties(props, _excluded$d);
10731
+ other = _objectWithoutProperties(props, _excluded$e);
10594
10732
  var valueRef = React.useRef({});
10595
10733
  React.useEffect(function () {
10596
10734
  pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
@@ -10632,6 +10770,11 @@ var BsReissue = function BsReissue(props) {
10632
10770
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10633
10771
  }
10634
10772
  });
10773
+ pubsub__default['default'].subscribeOnce('changeShopCode', function (type, data) {
10774
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
10775
+ shopCode: data.shopCode
10776
+ }));
10777
+ });
10635
10778
  }, [value, disabled]);
10636
10779
  var changeTypeHandle = function changeTypeHandle(val) {
10637
10780
  var newValue = _objectSpread2({}, value);
@@ -15,6 +15,7 @@ interface BsGoodsProps {
15
15
  otherOperations: any;
16
16
  canUpdateNumber: boolean;
17
17
  shopCode: string;
18
+ companyKey: string;
18
19
  onChange: (val: any[]) => void;
19
20
  onSelect: (val: any[]) => void;
20
21
  onDelete: (val: any[]) => void;
@@ -5,6 +5,7 @@ interface GoodModelProps {
5
5
  shopList: any[];
6
6
  width?: string | number;
7
7
  shopCode?: string;
8
+ companyKey: string;
8
9
  onSubmit: (...args: any[]) => any;
9
10
  }
10
11
  declare const _default: React.ForwardRefExoticComponent<GoodModelProps & React.RefAttributes<unknown>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.8.9-alpha.0",
3
+ "version": "0.8.9-alpha.12",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,9 +20,10 @@
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": "^0.8.7-alpha.0",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.8.9-alpha.9",
24
24
  "lodash": "^4.17.21",
25
25
  "pubsub-js": "^1.9.4",
26
+ "react-copy-to-clipboard": "^5.1.0",
26
27
  "umi-request": "^1.4.0"
27
28
  },
28
29
  "devDependencies": {
@@ -31,6 +32,7 @@
31
32
  "@types/jest": "^29.5.1",
32
33
  "@types/node": "^20.1.4",
33
34
  "@types/pubsub-js": "^1.8.3",
35
+ "@types/react-copy-to-clipboard": "^5.0.4",
34
36
  "@types/react-test-renderer": "^18.0.0",
35
37
  "@typescript-eslint/eslint-plugin": "^5.59.2",
36
38
  "@typescript-eslint/parser": "^5.59.2",
@@ -58,5 +60,5 @@
58
60
  "publishConfig": {
59
61
  "access": "public"
60
62
  },
61
- "gitHead": "97f6ab166f536ac9098b1883732a91c848165a04"
63
+ "gitHead": "8dacfd2ad0656abd11684055ab4a9a35aa460d08"
62
64
  }