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

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
1
  import React, { useRef, useState, useEffect, useMemo, forwardRef, useImperativeHandle } 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';
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';
@@ -513,19 +514,22 @@ function ApaasInputNumber(props) {
513
514
  return /*#__PURE__*/React.createElement(InputNumber, _objectSpread2({}, props));
514
515
  }
515
516
 
516
- var _excluded$2 = ["options", "basicMultSelect"];
517
+ var _excluded$2 = ["options", "basicMultSelect", "readonly"];
517
518
  function ApaasSelect(props) {
518
519
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
519
520
  var _props$options = props.options,
520
521
  options = _props$options === void 0 ? [] : _props$options,
521
522
  basicMultSelect = props.basicMultSelect,
523
+ readonly = props.readonly,
522
524
  otherProps = _objectWithoutProperties(props, _excluded$2);
523
525
  return /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({}, otherProps), {}, {
526
+ showSearch: !readonly,
524
527
  style: {
525
528
  width: '100%'
526
529
  }
527
530
  }), options.map(function (item) {
528
531
  return /*#__PURE__*/React.createElement(Select.Option, {
532
+ disabled: readonly,
529
533
  value: item.value,
530
534
  key: item.value
531
535
  }, item.label);
@@ -803,7 +807,7 @@ var ApaasUpload = function ApaasUpload(_ref) {
803
807
  })));
804
808
  };
805
809
 
806
- var _excluded$5 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
810
+ var _excluded$5 = ["showOther", "horizontal", "options", "value", "onChange", "disabled", "hideUnselectedItem"];
807
811
  function ApaasRadio(props) {
808
812
  var showOther = props.showOther,
809
813
  _props$horizontal = props.horizontal,
@@ -814,6 +818,7 @@ function ApaasRadio(props) {
814
818
  value = _props$value === void 0 ? {} : _props$value,
815
819
  onChange = props.onChange,
816
820
  disabled = props.disabled,
821
+ hideUnselectedItem = props.hideUnselectedItem,
817
822
  otherProps = _objectWithoutProperties(props, _excluded$5);
818
823
  var radioValue = value.value,
819
824
  other = value.other;
@@ -841,13 +846,14 @@ function ApaasRadio(props) {
841
846
  direction: horizontal ? 'horizontal' : 'vertical',
842
847
  wrap: true
843
848
  }, options.map(function (item) {
849
+ if (hideUnselectedItem && item.value !== radioValue) return /*#__PURE__*/React.createElement(React.Fragment, null);
844
850
  return /*#__PURE__*/React.createElement(Radio, {
845
851
  value: item.value,
846
852
  key: item.label,
847
853
  disabled: disabled,
848
854
  onClick: onRadioClick
849
855
  }, item.label);
850
- }), showOther && /*#__PURE__*/React.createElement(Radio, {
856
+ }), showOther && (!hideUnselectedItem || radioValue === '其他') && /*#__PURE__*/React.createElement(Radio, {
851
857
  value: "\u5176\u4ED6",
852
858
  disabled: disabled,
853
859
  onClick: onRadioClick
@@ -6856,7 +6862,7 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6856
6862
  var _ref$maxCount = _ref.maxCount,
6857
6863
  maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
6858
6864
  _ref$maxSize = _ref.maxSize,
6859
- maxSize = _ref$maxSize === void 0 ? 20 : _ref$maxSize,
6865
+ maxSize = _ref$maxSize === void 0 ? 50 : _ref$maxSize,
6860
6866
  _ref$onChange = _ref.onChange,
6861
6867
  onChange = _ref$onChange === void 0 ? fn$2 : _ref$onChange,
6862
6868
  _ref$value = _ref.value,
@@ -6871,11 +6877,27 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6871
6877
  _ref$actionUrl = _ref.actionUrl,
6872
6878
  actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
6873
6879
  resetProps = _objectWithoutProperties(_ref, _excluded$7);
6874
- var valueRef = useRef(value);
6875
6880
  var _useState = useState(false),
6876
6881
  _useState2 = _slicedToArray(_useState, 2),
6877
- uploading = _useState2[0],
6878
- setUploading = _useState2[1];
6882
+ visible = _useState2[0],
6883
+ setVisible = _useState2[1];
6884
+ var _useState3 = useState(''),
6885
+ _useState4 = _slicedToArray(_useState3, 2),
6886
+ fileUrl = _useState4[0],
6887
+ setFileUrl = _useState4[1];
6888
+ var _useState5 = useState(''),
6889
+ _useState6 = _slicedToArray(_useState5, 2),
6890
+ fileType = _useState6[0],
6891
+ setFileType = _useState6[1];
6892
+ var _useState7 = useState(''),
6893
+ _useState8 = _slicedToArray(_useState7, 2),
6894
+ fileName = _useState8[0],
6895
+ setFileName = _useState8[1];
6896
+ var valueRef = useRef(value);
6897
+ var _useState9 = useState(false),
6898
+ _useState10 = _slicedToArray(_useState9, 2),
6899
+ uploading = _useState10[0],
6900
+ setUploading = _useState10[1];
6879
6901
  var fileList = useMemo(function () {
6880
6902
  return value.map(function (t, i) {
6881
6903
  return _objectSpread2(_objectSpread2({}, t), {}, {
@@ -6962,6 +6984,29 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6962
6984
  });
6963
6985
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
6964
6986
  };
6987
+ var onPreview = function onPreview(file) {
6988
+ var _file$url;
6989
+ var fileArr = file === null || file === void 0 ? void 0 : (_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.split('.');
6990
+ var fileType = fileArr[fileArr.length - 1];
6991
+ if (['png', 'jpg', 'jpeg', 'gif', 'bmp', 'svg'].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('pic');
6995
+ setVisible(true);
6996
+ } else if (['mp4', 'avi', 'mpeg', 'asf', 'mov', '3gp', 'wmv', 'rmvb'].includes(fileType.toLowerCase())) {
6997
+ setFileUrl(file === null || file === void 0 ? void 0 : file.url);
6998
+ setFileName(file === null || file === void 0 ? void 0 : file.name);
6999
+ setFileType('video');
7000
+ setVisible(true);
7001
+ } else {
7002
+ window.open(file === null || file === void 0 ? void 0 : file.url);
7003
+ }
7004
+ };
7005
+ var handleCancel = function handleCancel() {
7006
+ setFileUrl('');
7007
+ setFileName('');
7008
+ setVisible(false);
7009
+ };
6965
7010
  return /*#__PURE__*/React.createElement(Spin, {
6966
7011
  spinning: uploading
6967
7012
  }, /*#__PURE__*/React.createElement("p", {
@@ -6973,13 +7018,40 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6973
7018
  name: "file",
6974
7019
  maxCount: maxCount,
6975
7020
  beforeUpload: beforeUpload,
7021
+ onPreview: onPreview,
6976
7022
  fileList: fileList,
6977
7023
  onRemove: onRemove
6978
7024
  }, resetProps), /*#__PURE__*/React.createElement("p", {
6979
7025
  className: "ant-upload-drag-icon"
6980
7026
  }, /*#__PURE__*/React.createElement(InboxOutlined, null)), /*#__PURE__*/React.createElement("p", {
6981
7027
  className: "ant-upload-text"
6982
- }, "\u70B9\u51FB\u201C\u9009\u62E9\u6587\u4EF6\u201D\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF")));
7028
+ }, "\u70B9\u51FB\u201C\u9009\u62E9\u6587\u4EF6\u201D\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF")), /*#__PURE__*/React.createElement(Modal, {
7029
+ visible: visible,
7030
+ title: fileName,
7031
+ footer: null,
7032
+ onCancel: handleCancel
7033
+ }, /*#__PURE__*/React.createElement(CopyToClipboard, {
7034
+ text: fileUrl,
7035
+ onCopy: function onCopy() {
7036
+ message.success('复制成功');
7037
+ }
7038
+ }, /*#__PURE__*/React.createElement(Button, {
7039
+ type: "link"
7040
+ }, "\u4E0B\u8F7D\u5730\u5740")), fileType === 'pic' ? /*#__PURE__*/React.createElement("img", {
7041
+ alt: "example",
7042
+ style: {
7043
+ width: '100%'
7044
+ },
7045
+ src: fileUrl
7046
+ }) : /*#__PURE__*/React.createElement("video", {
7047
+ style: {
7048
+ width: '100%',
7049
+ height: '100%'
7050
+ },
7051
+ autoPlay: true,
7052
+ controls: true,
7053
+ src: fileUrl
7054
+ })));
6983
7055
  };
6984
7056
 
6985
7057
  var _excluded$8 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
@@ -9833,38 +9905,46 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9833
9905
  return _regeneratorRuntime().wrap(function _callee$(_context) {
9834
9906
  while (1) switch (_context.prev = _context.next) {
9835
9907
  case 0:
9908
+ if (shopCode) {
9909
+ _context.next = 2;
9910
+ break;
9911
+ }
9912
+ return _context.abrupt("return");
9913
+ case 2:
9836
9914
  form.setFieldsValue({
9837
9915
  shopId: shopCode
9838
9916
  });
9839
- _context.prev = 1;
9917
+ _context.prev = 3;
9840
9918
  setLoading(true);
9841
9919
  params = {
9842
9920
  shopCode: shopCode
9843
9921
  };
9844
- _context.next = 6;
9922
+ _context.next = 8;
9845
9923
  return extendRequest('/qy/gdfw/product/bsListProduct', {
9846
9924
  method: 'post',
9847
9925
  data: params
9848
9926
  });
9849
- case 6:
9927
+ case 8:
9850
9928
  res = _context.sent;
9851
- products = res.data.products;
9852
- newProducts = (products || []).map(function (item, index) {
9853
- return _objectSpread2(_objectSpread2({}, item), {}, {
9854
- index: index + 1
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
+ });
9855
9935
  });
9856
- });
9857
- setAllList(_toConsumableArray(newProducts));
9858
- initData(_toConsumableArray(newProducts));
9859
- case 11:
9860
- _context.prev = 11;
9936
+ setAllList(_toConsumableArray(newProducts));
9937
+ initData(_toConsumableArray(newProducts));
9938
+ }
9939
+ case 10:
9940
+ _context.prev = 10;
9861
9941
  setLoading(false);
9862
- return _context.finish(11);
9863
- case 14:
9942
+ return _context.finish(10);
9943
+ case 13:
9864
9944
  case "end":
9865
9945
  return _context.stop();
9866
9946
  }
9867
- }, _callee, null, [[1,, 11, 14]]);
9947
+ }, _callee, null, [[3,, 10, 13]]);
9868
9948
  }));
9869
9949
  return function queryItems(_x) {
9870
9950
  return _ref.apply(this, arguments);
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');
@@ -524,19 +525,22 @@ function ApaasInputNumber(props) {
524
525
  return /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, _objectSpread2({}, props));
525
526
  }
526
527
 
527
- var _excluded$2 = ["options", "basicMultSelect"];
528
+ var _excluded$2 = ["options", "basicMultSelect", "readonly"];
528
529
  function ApaasSelect(props) {
529
530
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
530
531
  var _props$options = props.options,
531
532
  options = _props$options === void 0 ? [] : _props$options,
532
533
  basicMultSelect = props.basicMultSelect,
534
+ readonly = props.readonly,
533
535
  otherProps = _objectWithoutProperties(props, _excluded$2);
534
536
  return /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, otherProps), {}, {
537
+ showSearch: !readonly,
535
538
  style: {
536
539
  width: '100%'
537
540
  }
538
541
  }), options.map(function (item) {
539
542
  return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
543
+ disabled: readonly,
540
544
  value: item.value,
541
545
  key: item.value
542
546
  }, item.label);
@@ -814,7 +818,7 @@ var ApaasUpload = function ApaasUpload(_ref) {
814
818
  })));
815
819
  };
816
820
 
817
- var _excluded$5 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
821
+ var _excluded$5 = ["showOther", "horizontal", "options", "value", "onChange", "disabled", "hideUnselectedItem"];
818
822
  function ApaasRadio(props) {
819
823
  var showOther = props.showOther,
820
824
  _props$horizontal = props.horizontal,
@@ -825,6 +829,7 @@ function ApaasRadio(props) {
825
829
  value = _props$value === void 0 ? {} : _props$value,
826
830
  onChange = props.onChange,
827
831
  disabled = props.disabled,
832
+ hideUnselectedItem = props.hideUnselectedItem,
828
833
  otherProps = _objectWithoutProperties(props, _excluded$5);
829
834
  var radioValue = value.value,
830
835
  other = value.other;
@@ -852,13 +857,14 @@ function ApaasRadio(props) {
852
857
  direction: horizontal ? 'horizontal' : 'vertical',
853
858
  wrap: true
854
859
  }, options.map(function (item) {
860
+ if (hideUnselectedItem && item.value !== radioValue) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
855
861
  return /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
856
862
  value: item.value,
857
863
  key: item.label,
858
864
  disabled: disabled,
859
865
  onClick: onRadioClick
860
866
  }, item.label);
861
- }), showOther && /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
867
+ }), showOther && (!hideUnselectedItem || radioValue === '其他') && /*#__PURE__*/React__default['default'].createElement(antd.Radio, {
862
868
  value: "\u5176\u4ED6",
863
869
  disabled: disabled,
864
870
  onClick: onRadioClick
@@ -6867,7 +6873,7 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6867
6873
  var _ref$maxCount = _ref.maxCount,
6868
6874
  maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
6869
6875
  _ref$maxSize = _ref.maxSize,
6870
- maxSize = _ref$maxSize === void 0 ? 20 : _ref$maxSize,
6876
+ maxSize = _ref$maxSize === void 0 ? 50 : _ref$maxSize,
6871
6877
  _ref$onChange = _ref.onChange,
6872
6878
  onChange = _ref$onChange === void 0 ? fn$2 : _ref$onChange,
6873
6879
  _ref$value = _ref.value,
@@ -6882,11 +6888,27 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6882
6888
  _ref$actionUrl = _ref.actionUrl,
6883
6889
  actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
6884
6890
  resetProps = _objectWithoutProperties(_ref, _excluded$7);
6885
- var valueRef = React.useRef(value);
6886
6891
  var _useState = React.useState(false),
6887
6892
  _useState2 = _slicedToArray(_useState, 2),
6888
- uploading = _useState2[0],
6889
- setUploading = _useState2[1];
6893
+ visible = _useState2[0],
6894
+ setVisible = _useState2[1];
6895
+ var _useState3 = React.useState(''),
6896
+ _useState4 = _slicedToArray(_useState3, 2),
6897
+ fileUrl = _useState4[0],
6898
+ setFileUrl = _useState4[1];
6899
+ var _useState5 = React.useState(''),
6900
+ _useState6 = _slicedToArray(_useState5, 2),
6901
+ fileType = _useState6[0],
6902
+ setFileType = _useState6[1];
6903
+ var _useState7 = React.useState(''),
6904
+ _useState8 = _slicedToArray(_useState7, 2),
6905
+ fileName = _useState8[0],
6906
+ setFileName = _useState8[1];
6907
+ var valueRef = React.useRef(value);
6908
+ var _useState9 = React.useState(false),
6909
+ _useState10 = _slicedToArray(_useState9, 2),
6910
+ uploading = _useState10[0],
6911
+ setUploading = _useState10[1];
6890
6912
  var fileList = React.useMemo(function () {
6891
6913
  return value.map(function (t, i) {
6892
6914
  return _objectSpread2(_objectSpread2({}, t), {}, {
@@ -6973,6 +6995,29 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6973
6995
  });
6974
6996
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
6975
6997
  };
6998
+ var onPreview = function onPreview(file) {
6999
+ var _file$url;
7000
+ var fileArr = file === null || file === void 0 ? void 0 : (_file$url = file.url) === null || _file$url === void 0 ? void 0 : _file$url.split('.');
7001
+ var fileType = fileArr[fileArr.length - 1];
7002
+ if (['png', 'jpg', 'jpeg', 'gif', 'bmp', 'svg'].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('pic');
7006
+ setVisible(true);
7007
+ } else if (['mp4', 'avi', 'mpeg', 'asf', 'mov', '3gp', 'wmv', 'rmvb'].includes(fileType.toLowerCase())) {
7008
+ setFileUrl(file === null || file === void 0 ? void 0 : file.url);
7009
+ setFileName(file === null || file === void 0 ? void 0 : file.name);
7010
+ setFileType('video');
7011
+ setVisible(true);
7012
+ } else {
7013
+ window.open(file === null || file === void 0 ? void 0 : file.url);
7014
+ }
7015
+ };
7016
+ var handleCancel = function handleCancel() {
7017
+ setFileUrl('');
7018
+ setFileName('');
7019
+ setVisible(false);
7020
+ };
6976
7021
  return /*#__PURE__*/React__default['default'].createElement(antd.Spin, {
6977
7022
  spinning: uploading
6978
7023
  }, /*#__PURE__*/React__default['default'].createElement("p", {
@@ -6984,13 +7029,40 @@ var ApaasUploadAsync$1 = function ApaasUploadAsync(_ref) {
6984
7029
  name: "file",
6985
7030
  maxCount: maxCount,
6986
7031
  beforeUpload: beforeUpload,
7032
+ onPreview: onPreview,
6987
7033
  fileList: fileList,
6988
7034
  onRemove: onRemove
6989
7035
  }, resetProps), /*#__PURE__*/React__default['default'].createElement("p", {
6990
7036
  className: "ant-upload-drag-icon"
6991
7037
  }, /*#__PURE__*/React__default['default'].createElement(icons.InboxOutlined, null)), /*#__PURE__*/React__default['default'].createElement("p", {
6992
7038
  className: "ant-upload-text"
6993
- }, "\u70B9\u51FB\u201C\u9009\u62E9\u6587\u4EF6\u201D\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u533A\u57DF")));
7039
+ }, "\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, {
7040
+ visible: visible,
7041
+ title: fileName,
7042
+ footer: null,
7043
+ onCancel: handleCancel
7044
+ }, /*#__PURE__*/React__default['default'].createElement(reactCopyToClipboard.CopyToClipboard, {
7045
+ text: fileUrl,
7046
+ onCopy: function onCopy() {
7047
+ antd.message.success('复制成功');
7048
+ }
7049
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
7050
+ type: "link"
7051
+ }, "\u4E0B\u8F7D\u5730\u5740")), fileType === 'pic' ? /*#__PURE__*/React__default['default'].createElement("img", {
7052
+ alt: "example",
7053
+ style: {
7054
+ width: '100%'
7055
+ },
7056
+ src: fileUrl
7057
+ }) : /*#__PURE__*/React__default['default'].createElement("video", {
7058
+ style: {
7059
+ width: '100%',
7060
+ height: '100%'
7061
+ },
7062
+ autoPlay: true,
7063
+ controls: true,
7064
+ src: fileUrl
7065
+ })));
6994
7066
  };
6995
7067
 
6996
7068
  var _excluded$8 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
@@ -9844,38 +9916,46 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
9844
9916
  return _regeneratorRuntime().wrap(function _callee$(_context) {
9845
9917
  while (1) switch (_context.prev = _context.next) {
9846
9918
  case 0:
9919
+ if (shopCode) {
9920
+ _context.next = 2;
9921
+ break;
9922
+ }
9923
+ return _context.abrupt("return");
9924
+ case 2:
9847
9925
  form.setFieldsValue({
9848
9926
  shopId: shopCode
9849
9927
  });
9850
- _context.prev = 1;
9928
+ _context.prev = 3;
9851
9929
  setLoading(true);
9852
9930
  params = {
9853
9931
  shopCode: shopCode
9854
9932
  };
9855
- _context.next = 6;
9933
+ _context.next = 8;
9856
9934
  return extendRequest('/qy/gdfw/product/bsListProduct', {
9857
9935
  method: 'post',
9858
9936
  data: params
9859
9937
  });
9860
- case 6:
9938
+ case 8:
9861
9939
  res = _context.sent;
9862
- products = res.data.products;
9863
- newProducts = (products || []).map(function (item, index) {
9864
- return _objectSpread2(_objectSpread2({}, item), {}, {
9865
- index: index + 1
9940
+ if (res.success) {
9941
+ products = res.data.products;
9942
+ newProducts = (products || []).map(function (item, index) {
9943
+ return _objectSpread2(_objectSpread2({}, item), {}, {
9944
+ index: index + 1
9945
+ });
9866
9946
  });
9867
- });
9868
- setAllList(_toConsumableArray(newProducts));
9869
- initData(_toConsumableArray(newProducts));
9870
- case 11:
9871
- _context.prev = 11;
9947
+ setAllList(_toConsumableArray(newProducts));
9948
+ initData(_toConsumableArray(newProducts));
9949
+ }
9950
+ case 10:
9951
+ _context.prev = 10;
9872
9952
  setLoading(false);
9873
- return _context.finish(11);
9874
- case 14:
9953
+ return _context.finish(10);
9954
+ case 13:
9875
9955
  case "end":
9876
9956
  return _context.stop();
9877
9957
  }
9878
- }, _callee, null, [[1,, 11, 14]]);
9958
+ }, _callee, null, [[3,, 10, 13]]);
9879
9959
  }));
9880
9960
  return function queryItems(_x) {
9881
9961
  return _ref.apply(this, arguments);
@@ -14,6 +14,7 @@ export interface ApaasRadioProps extends Omit<RadioGroupProps, 'onChange' | 'val
14
14
  horizontal?: boolean;
15
15
  options?: OptionsType[];
16
16
  disabled?: boolean;
17
+ hideUnselectedItem?: boolean;
17
18
  onChange?: (value: RadioValue) => void;
18
19
  value?: RadioValue;
19
20
  }
@@ -7,6 +7,7 @@ type OptionsType = {
7
7
  };
8
8
  export interface ApaasSelectProps extends SelectProps<string[]> {
9
9
  options?: OptionsType[];
10
+ readonly?: boolean;
10
11
  [propName: string]: any;
11
12
  }
12
13
  declare function ApaasSelect(props: ApaasSelectProps): React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.8.9-alpha.8",
3
+ "version": "0.8.9",
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.9-alpha.8",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.8.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": "672df53b9985eb15d46e8f47153b42897106ab08"
63
+ "gitHead": "8e9ebe4b588b4e9921e42e34594319fba0c9995e"
62
64
  }