@kmkf-fe-packages/basic-components 0.8.9-alpha.2 → 0.8.9-alpha.20
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 +119 -31
- package/dist/index.js +118 -30
- package/dist/src/apaas/ApaasRadio/index.d.ts +1 -0
- package/dist/src/apaas/ApaasSelect/index.d.ts +1 -0
- package/package.json +5 -3
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,
|
|
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 ?
|
|
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
|
-
|
|
6878
|
-
|
|
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"];
|
|
@@ -9699,11 +9771,16 @@ var ItemList = function ItemList(props) {
|
|
|
9699
9771
|
}, "\u6682\u4E0D\u652F\u6301\u6DFB\u52A0")) : null);
|
|
9700
9772
|
};
|
|
9701
9773
|
|
|
9774
|
+
var _excluded$c = ["shopId"];
|
|
9702
9775
|
var columns = [{
|
|
9703
9776
|
dataIndex: 'index',
|
|
9704
|
-
title: '
|
|
9777
|
+
title: 'NO',
|
|
9705
9778
|
render: function render(val, record, index) {
|
|
9706
|
-
return /*#__PURE__*/React.createElement("
|
|
9779
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
9780
|
+
style: {
|
|
9781
|
+
width: 25
|
|
9782
|
+
}
|
|
9783
|
+
}, index + 1);
|
|
9707
9784
|
}
|
|
9708
9785
|
}, {
|
|
9709
9786
|
dataIndex: 'skuName',
|
|
@@ -9828,38 +9905,46 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9828
9905
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9829
9906
|
while (1) switch (_context.prev = _context.next) {
|
|
9830
9907
|
case 0:
|
|
9908
|
+
if (shopCode) {
|
|
9909
|
+
_context.next = 2;
|
|
9910
|
+
break;
|
|
9911
|
+
}
|
|
9912
|
+
return _context.abrupt("return");
|
|
9913
|
+
case 2:
|
|
9831
9914
|
form.setFieldsValue({
|
|
9832
9915
|
shopId: shopCode
|
|
9833
9916
|
});
|
|
9834
|
-
_context.prev =
|
|
9917
|
+
_context.prev = 3;
|
|
9835
9918
|
setLoading(true);
|
|
9836
9919
|
params = {
|
|
9837
9920
|
shopCode: shopCode
|
|
9838
9921
|
};
|
|
9839
|
-
_context.next =
|
|
9922
|
+
_context.next = 8;
|
|
9840
9923
|
return extendRequest('/qy/gdfw/product/bsListProduct', {
|
|
9841
9924
|
method: 'post',
|
|
9842
9925
|
data: params
|
|
9843
9926
|
});
|
|
9844
|
-
case
|
|
9927
|
+
case 8:
|
|
9845
9928
|
res = _context.sent;
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
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
|
+
});
|
|
9850
9935
|
});
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
case
|
|
9855
|
-
_context.prev =
|
|
9936
|
+
setAllList(_toConsumableArray(newProducts));
|
|
9937
|
+
initData(_toConsumableArray(newProducts));
|
|
9938
|
+
}
|
|
9939
|
+
case 10:
|
|
9940
|
+
_context.prev = 10;
|
|
9856
9941
|
setLoading(false);
|
|
9857
|
-
return _context.finish(
|
|
9858
|
-
case
|
|
9942
|
+
return _context.finish(10);
|
|
9943
|
+
case 13:
|
|
9859
9944
|
case "end":
|
|
9860
9945
|
return _context.stop();
|
|
9861
9946
|
}
|
|
9862
|
-
}, _callee, null, [[
|
|
9947
|
+
}, _callee, null, [[3,, 10, 13]]);
|
|
9863
9948
|
}));
|
|
9864
9949
|
return function queryItems(_x) {
|
|
9865
9950
|
return _ref.apply(this, arguments);
|
|
@@ -9887,7 +9972,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9887
9972
|
onSubmit(selectList);
|
|
9888
9973
|
_onCancel();
|
|
9889
9974
|
};
|
|
9890
|
-
var onFinish = function onFinish(
|
|
9975
|
+
var onFinish = function onFinish(val) {
|
|
9976
|
+
var shopId = val.shopId,
|
|
9977
|
+
other = _objectWithoutProperties(val, _excluded$c);
|
|
9978
|
+
var value = other;
|
|
9891
9979
|
var newFilterList = [];
|
|
9892
9980
|
var hasValue = Object.values(value).some(function (t) {
|
|
9893
9981
|
return !!t;
|
|
@@ -10403,7 +10491,7 @@ var BsGoods = function BsGoods(props) {
|
|
|
10403
10491
|
}));
|
|
10404
10492
|
};
|
|
10405
10493
|
|
|
10406
|
-
var _excluded$
|
|
10494
|
+
var _excluded$d = ["value", "onChange", "reasonList", "disabled"];
|
|
10407
10495
|
var BsExchange = function BsExchange(props) {
|
|
10408
10496
|
var _value$bsExchangeType4, _value$bsExchangeType5, _value$bsExchangeType6;
|
|
10409
10497
|
var value = props.value,
|
|
@@ -10411,7 +10499,7 @@ var BsExchange = function BsExchange(props) {
|
|
|
10411
10499
|
_props$reasonList = props.reasonList,
|
|
10412
10500
|
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
10413
10501
|
disabled = props.disabled,
|
|
10414
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
10502
|
+
other = _objectWithoutProperties(props, _excluded$d);
|
|
10415
10503
|
var valueRef = useRef({});
|
|
10416
10504
|
useEffect(function () {
|
|
10417
10505
|
valueRef.current = value;
|
|
@@ -10633,14 +10721,14 @@ var BsExchange = function BsExchange(props) {
|
|
|
10633
10721
|
}))) : null);
|
|
10634
10722
|
};
|
|
10635
10723
|
|
|
10636
|
-
var _excluded$
|
|
10724
|
+
var _excluded$e = ["value", "onChange", "reasonList", "disabled"];
|
|
10637
10725
|
var BsReissue = function BsReissue(props) {
|
|
10638
10726
|
var value = props.value,
|
|
10639
10727
|
onChange = props.onChange,
|
|
10640
10728
|
_props$reasonList = props.reasonList,
|
|
10641
10729
|
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
10642
10730
|
disabled = props.disabled,
|
|
10643
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
10731
|
+
other = _objectWithoutProperties(props, _excluded$e);
|
|
10644
10732
|
var valueRef = useRef({});
|
|
10645
10733
|
useEffect(function () {
|
|
10646
10734
|
pubsub.subscribe('reissueSelectList', function (_, data) {
|
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 ?
|
|
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
|
-
|
|
6889
|
-
|
|
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"];
|
|
@@ -9710,11 +9782,16 @@ var ItemList = function ItemList(props) {
|
|
|
9710
9782
|
}, "\u6682\u4E0D\u652F\u6301\u6DFB\u52A0")) : null);
|
|
9711
9783
|
};
|
|
9712
9784
|
|
|
9785
|
+
var _excluded$c = ["shopId"];
|
|
9713
9786
|
var columns = [{
|
|
9714
9787
|
dataIndex: 'index',
|
|
9715
|
-
title: '
|
|
9788
|
+
title: 'NO',
|
|
9716
9789
|
render: function render(val, record, index) {
|
|
9717
|
-
return /*#__PURE__*/React__default['default'].createElement("
|
|
9790
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
9791
|
+
style: {
|
|
9792
|
+
width: 25
|
|
9793
|
+
}
|
|
9794
|
+
}, index + 1);
|
|
9718
9795
|
}
|
|
9719
9796
|
}, {
|
|
9720
9797
|
dataIndex: 'skuName',
|
|
@@ -9839,38 +9916,46 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9839
9916
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9840
9917
|
while (1) switch (_context.prev = _context.next) {
|
|
9841
9918
|
case 0:
|
|
9919
|
+
if (shopCode) {
|
|
9920
|
+
_context.next = 2;
|
|
9921
|
+
break;
|
|
9922
|
+
}
|
|
9923
|
+
return _context.abrupt("return");
|
|
9924
|
+
case 2:
|
|
9842
9925
|
form.setFieldsValue({
|
|
9843
9926
|
shopId: shopCode
|
|
9844
9927
|
});
|
|
9845
|
-
_context.prev =
|
|
9928
|
+
_context.prev = 3;
|
|
9846
9929
|
setLoading(true);
|
|
9847
9930
|
params = {
|
|
9848
9931
|
shopCode: shopCode
|
|
9849
9932
|
};
|
|
9850
|
-
_context.next =
|
|
9933
|
+
_context.next = 8;
|
|
9851
9934
|
return extendRequest('/qy/gdfw/product/bsListProduct', {
|
|
9852
9935
|
method: 'post',
|
|
9853
9936
|
data: params
|
|
9854
9937
|
});
|
|
9855
|
-
case
|
|
9938
|
+
case 8:
|
|
9856
9939
|
res = _context.sent;
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
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
|
+
});
|
|
9861
9946
|
});
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
case
|
|
9866
|
-
_context.prev =
|
|
9947
|
+
setAllList(_toConsumableArray(newProducts));
|
|
9948
|
+
initData(_toConsumableArray(newProducts));
|
|
9949
|
+
}
|
|
9950
|
+
case 10:
|
|
9951
|
+
_context.prev = 10;
|
|
9867
9952
|
setLoading(false);
|
|
9868
|
-
return _context.finish(
|
|
9869
|
-
case
|
|
9953
|
+
return _context.finish(10);
|
|
9954
|
+
case 13:
|
|
9870
9955
|
case "end":
|
|
9871
9956
|
return _context.stop();
|
|
9872
9957
|
}
|
|
9873
|
-
}, _callee, null, [[
|
|
9958
|
+
}, _callee, null, [[3,, 10, 13]]);
|
|
9874
9959
|
}));
|
|
9875
9960
|
return function queryItems(_x) {
|
|
9876
9961
|
return _ref.apply(this, arguments);
|
|
@@ -9898,7 +9983,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9898
9983
|
onSubmit(selectList);
|
|
9899
9984
|
_onCancel();
|
|
9900
9985
|
};
|
|
9901
|
-
var onFinish = function onFinish(
|
|
9986
|
+
var onFinish = function onFinish(val) {
|
|
9987
|
+
var shopId = val.shopId,
|
|
9988
|
+
other = _objectWithoutProperties(val, _excluded$c);
|
|
9989
|
+
var value = other;
|
|
9902
9990
|
var newFilterList = [];
|
|
9903
9991
|
var hasValue = Object.values(value).some(function (t) {
|
|
9904
9992
|
return !!t;
|
|
@@ -10414,7 +10502,7 @@ var BsGoods = function BsGoods(props) {
|
|
|
10414
10502
|
}));
|
|
10415
10503
|
};
|
|
10416
10504
|
|
|
10417
|
-
var _excluded$
|
|
10505
|
+
var _excluded$d = ["value", "onChange", "reasonList", "disabled"];
|
|
10418
10506
|
var BsExchange = function BsExchange(props) {
|
|
10419
10507
|
var _value$bsExchangeType4, _value$bsExchangeType5, _value$bsExchangeType6;
|
|
10420
10508
|
var value = props.value,
|
|
@@ -10422,7 +10510,7 @@ var BsExchange = function BsExchange(props) {
|
|
|
10422
10510
|
_props$reasonList = props.reasonList,
|
|
10423
10511
|
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
10424
10512
|
disabled = props.disabled,
|
|
10425
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
10513
|
+
other = _objectWithoutProperties(props, _excluded$d);
|
|
10426
10514
|
var valueRef = React.useRef({});
|
|
10427
10515
|
React.useEffect(function () {
|
|
10428
10516
|
valueRef.current = value;
|
|
@@ -10644,14 +10732,14 @@ var BsExchange = function BsExchange(props) {
|
|
|
10644
10732
|
}))) : null);
|
|
10645
10733
|
};
|
|
10646
10734
|
|
|
10647
|
-
var _excluded$
|
|
10735
|
+
var _excluded$e = ["value", "onChange", "reasonList", "disabled"];
|
|
10648
10736
|
var BsReissue = function BsReissue(props) {
|
|
10649
10737
|
var value = props.value,
|
|
10650
10738
|
onChange = props.onChange,
|
|
10651
10739
|
_props$reasonList = props.reasonList,
|
|
10652
10740
|
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
10653
10741
|
disabled = props.disabled,
|
|
10654
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
10742
|
+
other = _objectWithoutProperties(props, _excluded$e);
|
|
10655
10743
|
var valueRef = React.useRef({});
|
|
10656
10744
|
React.useEffect(function () {
|
|
10657
10745
|
pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "0.8.9-alpha.
|
|
3
|
+
"version": "0.8.9-alpha.20",
|
|
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.
|
|
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": "
|
|
63
|
+
"gitHead": "229f72526a0b46b2db48fee3ada308087ea4c79c"
|
|
62
64
|
}
|