@kmkf-fe-packages/basic-components 0.8.9-alpha.1 → 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 +147 -64
- package/dist/index.js +145 -62
- package/dist/src/bs/component/GoodItem/index.d.ts +1 -0
- package/dist/src/bs/component/GoodsModal.d.ts +1 -0
- package/package.json +5 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React, { useRef, useState, useEffect, useMemo, forwardRef, useImperativeHandle
|
|
2
|
-
import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Checkbox, Row, Col, Slider, Rate,
|
|
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
|
-
|
|
6878
|
-
|
|
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:
|
|
9776
|
+
width: 25
|
|
9709
9777
|
}
|
|
9710
9778
|
}, index + 1);
|
|
9711
9779
|
}
|
|
@@ -9757,12 +9825,12 @@ 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();
|
|
9833
|
+
queryItems(shopCode);
|
|
9766
9834
|
getShopList();
|
|
9767
9835
|
}
|
|
9768
9836
|
};
|
|
@@ -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
|
-
|
|
9842
|
+
companyKey = props.companyKey;
|
|
9775
9843
|
var _useState = useState(false),
|
|
9776
9844
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9777
9845
|
visible = _useState2[0],
|
|
@@ -9826,44 +9894,51 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9826
9894
|
/**
|
|
9827
9895
|
* 查询商品
|
|
9828
9896
|
*/
|
|
9829
|
-
var queryItems =
|
|
9830
|
-
var
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
_context.prev = 1;
|
|
9838
|
-
setLoading(true);
|
|
9839
|
-
params = {
|
|
9840
|
-
shopCode: shopCode
|
|
9841
|
-
};
|
|
9842
|
-
_context.next = 6;
|
|
9843
|
-
return extendRequest('/qy/gdfw/product/bsListProduct', {
|
|
9844
|
-
method: 'post',
|
|
9845
|
-
data: params
|
|
9846
|
-
});
|
|
9847
|
-
case 6:
|
|
9848
|
-
res = _context.sent;
|
|
9849
|
-
products = res.data.products;
|
|
9850
|
-
newProducts = (products || []).map(function (item, index) {
|
|
9851
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
9852
|
-
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
|
|
9853
9905
|
});
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
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
|
+
}();
|
|
9867
9942
|
var rowSelection = {
|
|
9868
9943
|
selectedRowKeys: selectIds,
|
|
9869
9944
|
fixed: true,
|
|
@@ -9886,7 +9961,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9886
9961
|
onSubmit(selectList);
|
|
9887
9962
|
_onCancel();
|
|
9888
9963
|
};
|
|
9889
|
-
var onFinish = function onFinish(
|
|
9964
|
+
var onFinish = function onFinish(val) {
|
|
9965
|
+
var shopId = val.shopId,
|
|
9966
|
+
other = _objectWithoutProperties(val, _excluded$c);
|
|
9967
|
+
var value = other;
|
|
9890
9968
|
var newFilterList = [];
|
|
9891
9969
|
var hasValue = Object.values(value).some(function (t) {
|
|
9892
9970
|
return !!t;
|
|
@@ -9911,31 +9989,32 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9911
9989
|
};
|
|
9912
9990
|
var getShopList = /*#__PURE__*/function () {
|
|
9913
9991
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
9914
|
-
var _yield$request, success, data,
|
|
9992
|
+
var _yield$request, success, data, obj, list;
|
|
9915
9993
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9916
9994
|
while (1) switch (_context2.prev = _context2.next) {
|
|
9917
9995
|
case 0:
|
|
9918
9996
|
_context2.next = 2;
|
|
9919
|
-
return extendRequest('/qy/
|
|
9920
|
-
method: '
|
|
9921
|
-
|
|
9922
|
-
|
|
9997
|
+
return extendRequest('/qy/diamond/getConfigInfo', {
|
|
9998
|
+
method: 'get',
|
|
9999
|
+
params: {
|
|
10000
|
+
key: 'company-third-shop-info'
|
|
9923
10001
|
}
|
|
9924
10002
|
});
|
|
9925
10003
|
case 2:
|
|
9926
10004
|
_yield$request = _context2.sent;
|
|
9927
10005
|
success = _yield$request.success;
|
|
9928
10006
|
data = _yield$request.data;
|
|
10007
|
+
obj = JSON.parse(data || '{}');
|
|
9929
10008
|
if (success) {
|
|
9930
|
-
list = (
|
|
10009
|
+
list = ((obj === null || obj === void 0 ? void 0 : obj[companyKey]) || []).map(function (item) {
|
|
9931
10010
|
return {
|
|
9932
|
-
label:
|
|
9933
|
-
value:
|
|
10011
|
+
label: item.shopName,
|
|
10012
|
+
value: item.shopCode
|
|
9934
10013
|
};
|
|
9935
10014
|
});
|
|
9936
10015
|
setShopList(list);
|
|
9937
10016
|
}
|
|
9938
|
-
case
|
|
10017
|
+
case 7:
|
|
9939
10018
|
case "end":
|
|
9940
10019
|
return _context2.stop();
|
|
9941
10020
|
}
|
|
@@ -9947,6 +10026,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9947
10026
|
}();
|
|
9948
10027
|
var onValuesChange = function onValuesChange(changedValues) {
|
|
9949
10028
|
if (changedValues === null || changedValues === void 0 ? void 0 : changedValues['shopId']) {
|
|
10029
|
+
queryItems(changedValues === null || changedValues === void 0 ? void 0 : changedValues.shopId);
|
|
9950
10030
|
pubsub.publish('changeShopCode', {
|
|
9951
10031
|
shopCode: changedValues.shopId
|
|
9952
10032
|
});
|
|
@@ -10072,6 +10152,8 @@ var GoodItem = function GoodItem(props) {
|
|
|
10072
10152
|
_props$canUpdateNumbe = props.canUpdateNumber,
|
|
10073
10153
|
canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
|
|
10074
10154
|
shopCode = props.shopCode,
|
|
10155
|
+
_props$companyKey = props.companyKey,
|
|
10156
|
+
companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
|
|
10075
10157
|
onSelect = props.onSelect,
|
|
10076
10158
|
onDelete = props.onDelete;
|
|
10077
10159
|
var refModal = useRef();
|
|
@@ -10253,7 +10335,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
10253
10335
|
}));
|
|
10254
10336
|
};
|
|
10255
10337
|
var handleChangeGoods = function handleChangeGoods() {
|
|
10256
|
-
refModal.current.open();
|
|
10338
|
+
refModal.current.open(shopCode);
|
|
10257
10339
|
};
|
|
10258
10340
|
var rowSelection = {
|
|
10259
10341
|
selectedRowKeys: selectedRowKeys,
|
|
@@ -10293,7 +10375,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
10293
10375
|
shopList: shopList,
|
|
10294
10376
|
shopId: shopId,
|
|
10295
10377
|
maxLength: maxLength,
|
|
10296
|
-
|
|
10378
|
+
companyKey: companyKey
|
|
10297
10379
|
}));
|
|
10298
10380
|
};
|
|
10299
10381
|
|
|
@@ -10347,6 +10429,7 @@ var BsGoods = function BsGoods(props) {
|
|
|
10347
10429
|
}
|
|
10348
10430
|
});
|
|
10349
10431
|
pubsub.subscribeOnce('changeShopCode', function (type, data) {
|
|
10432
|
+
console.log(data);
|
|
10350
10433
|
onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
|
|
10351
10434
|
shopCode: data.shopCode
|
|
10352
10435
|
}));
|
|
@@ -10397,7 +10480,7 @@ var BsGoods = function BsGoods(props) {
|
|
|
10397
10480
|
}));
|
|
10398
10481
|
};
|
|
10399
10482
|
|
|
10400
|
-
var _excluded$
|
|
10483
|
+
var _excluded$d = ["value", "onChange", "reasonList", "disabled"];
|
|
10401
10484
|
var BsExchange = function BsExchange(props) {
|
|
10402
10485
|
var _value$bsExchangeType4, _value$bsExchangeType5, _value$bsExchangeType6;
|
|
10403
10486
|
var value = props.value,
|
|
@@ -10405,7 +10488,7 @@ var BsExchange = function BsExchange(props) {
|
|
|
10405
10488
|
_props$reasonList = props.reasonList,
|
|
10406
10489
|
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
10407
10490
|
disabled = props.disabled,
|
|
10408
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
10491
|
+
other = _objectWithoutProperties(props, _excluded$d);
|
|
10409
10492
|
var valueRef = useRef({});
|
|
10410
10493
|
useEffect(function () {
|
|
10411
10494
|
valueRef.current = value;
|
|
@@ -10627,14 +10710,14 @@ var BsExchange = function BsExchange(props) {
|
|
|
10627
10710
|
}))) : null);
|
|
10628
10711
|
};
|
|
10629
10712
|
|
|
10630
|
-
var _excluded$
|
|
10713
|
+
var _excluded$e = ["value", "onChange", "reasonList", "disabled"];
|
|
10631
10714
|
var BsReissue = function BsReissue(props) {
|
|
10632
10715
|
var value = props.value,
|
|
10633
10716
|
onChange = props.onChange,
|
|
10634
10717
|
_props$reasonList = props.reasonList,
|
|
10635
10718
|
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
10636
10719
|
disabled = props.disabled,
|
|
10637
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
10720
|
+
other = _objectWithoutProperties(props, _excluded$e);
|
|
10638
10721
|
var valueRef = useRef({});
|
|
10639
10722
|
useEffect(function () {
|
|
10640
10723
|
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');
|
|
@@ -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
|
-
|
|
6889
|
-
|
|
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:
|
|
9787
|
+
width: 25
|
|
9720
9788
|
}
|
|
9721
9789
|
}, index + 1);
|
|
9722
9790
|
}
|
|
@@ -9768,12 +9836,12 @@ 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();
|
|
9844
|
+
queryItems(shopCode);
|
|
9777
9845
|
getShopList();
|
|
9778
9846
|
}
|
|
9779
9847
|
};
|
|
@@ -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
|
-
|
|
9853
|
+
companyKey = props.companyKey;
|
|
9786
9854
|
var _useState = React.useState(false),
|
|
9787
9855
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9788
9856
|
visible = _useState2[0],
|
|
@@ -9837,44 +9905,51 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9837
9905
|
/**
|
|
9838
9906
|
* 查询商品
|
|
9839
9907
|
*/
|
|
9840
|
-
var queryItems =
|
|
9841
|
-
var
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
_context.prev = 1;
|
|
9849
|
-
setLoading(true);
|
|
9850
|
-
params = {
|
|
9851
|
-
shopCode: shopCode
|
|
9852
|
-
};
|
|
9853
|
-
_context.next = 6;
|
|
9854
|
-
return extendRequest('/qy/gdfw/product/bsListProduct', {
|
|
9855
|
-
method: 'post',
|
|
9856
|
-
data: params
|
|
9857
|
-
});
|
|
9858
|
-
case 6:
|
|
9859
|
-
res = _context.sent;
|
|
9860
|
-
products = res.data.products;
|
|
9861
|
-
newProducts = (products || []).map(function (item, index) {
|
|
9862
|
-
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
9863
|
-
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
|
|
9864
9916
|
});
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
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
|
+
}();
|
|
9878
9953
|
var rowSelection = {
|
|
9879
9954
|
selectedRowKeys: selectIds,
|
|
9880
9955
|
fixed: true,
|
|
@@ -9897,7 +9972,10 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9897
9972
|
onSubmit(selectList);
|
|
9898
9973
|
_onCancel();
|
|
9899
9974
|
};
|
|
9900
|
-
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;
|
|
9901
9979
|
var newFilterList = [];
|
|
9902
9980
|
var hasValue = Object.values(value).some(function (t) {
|
|
9903
9981
|
return !!t;
|
|
@@ -9922,31 +10000,32 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9922
10000
|
};
|
|
9923
10001
|
var getShopList = /*#__PURE__*/function () {
|
|
9924
10002
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
9925
|
-
var _yield$request, success, data,
|
|
10003
|
+
var _yield$request, success, data, obj, list;
|
|
9926
10004
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9927
10005
|
while (1) switch (_context2.prev = _context2.next) {
|
|
9928
10006
|
case 0:
|
|
9929
10007
|
_context2.next = 2;
|
|
9930
|
-
return extendRequest('/qy/
|
|
9931
|
-
method: '
|
|
9932
|
-
|
|
9933
|
-
|
|
10008
|
+
return extendRequest('/qy/diamond/getConfigInfo', {
|
|
10009
|
+
method: 'get',
|
|
10010
|
+
params: {
|
|
10011
|
+
key: 'company-third-shop-info'
|
|
9934
10012
|
}
|
|
9935
10013
|
});
|
|
9936
10014
|
case 2:
|
|
9937
10015
|
_yield$request = _context2.sent;
|
|
9938
10016
|
success = _yield$request.success;
|
|
9939
10017
|
data = _yield$request.data;
|
|
10018
|
+
obj = JSON.parse(data || '{}');
|
|
9940
10019
|
if (success) {
|
|
9941
|
-
list = (
|
|
10020
|
+
list = ((obj === null || obj === void 0 ? void 0 : obj[companyKey]) || []).map(function (item) {
|
|
9942
10021
|
return {
|
|
9943
|
-
label:
|
|
9944
|
-
value:
|
|
10022
|
+
label: item.shopName,
|
|
10023
|
+
value: item.shopCode
|
|
9945
10024
|
};
|
|
9946
10025
|
});
|
|
9947
10026
|
setShopList(list);
|
|
9948
10027
|
}
|
|
9949
|
-
case
|
|
10028
|
+
case 7:
|
|
9950
10029
|
case "end":
|
|
9951
10030
|
return _context2.stop();
|
|
9952
10031
|
}
|
|
@@ -9958,6 +10037,7 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
9958
10037
|
}();
|
|
9959
10038
|
var onValuesChange = function onValuesChange(changedValues) {
|
|
9960
10039
|
if (changedValues === null || changedValues === void 0 ? void 0 : changedValues['shopId']) {
|
|
10040
|
+
queryItems(changedValues === null || changedValues === void 0 ? void 0 : changedValues.shopId);
|
|
9961
10041
|
pubsub__default['default'].publish('changeShopCode', {
|
|
9962
10042
|
shopCode: changedValues.shopId
|
|
9963
10043
|
});
|
|
@@ -10083,6 +10163,8 @@ var GoodItem = function GoodItem(props) {
|
|
|
10083
10163
|
_props$canUpdateNumbe = props.canUpdateNumber,
|
|
10084
10164
|
canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
|
|
10085
10165
|
shopCode = props.shopCode,
|
|
10166
|
+
_props$companyKey = props.companyKey,
|
|
10167
|
+
companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
|
|
10086
10168
|
onSelect = props.onSelect,
|
|
10087
10169
|
onDelete = props.onDelete;
|
|
10088
10170
|
var refModal = React.useRef();
|
|
@@ -10264,7 +10346,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
10264
10346
|
}));
|
|
10265
10347
|
};
|
|
10266
10348
|
var handleChangeGoods = function handleChangeGoods() {
|
|
10267
|
-
refModal.current.open();
|
|
10349
|
+
refModal.current.open(shopCode);
|
|
10268
10350
|
};
|
|
10269
10351
|
var rowSelection = {
|
|
10270
10352
|
selectedRowKeys: selectedRowKeys,
|
|
@@ -10304,7 +10386,7 @@ var GoodItem = function GoodItem(props) {
|
|
|
10304
10386
|
shopList: shopList,
|
|
10305
10387
|
shopId: shopId,
|
|
10306
10388
|
maxLength: maxLength,
|
|
10307
|
-
|
|
10389
|
+
companyKey: companyKey
|
|
10308
10390
|
}));
|
|
10309
10391
|
};
|
|
10310
10392
|
|
|
@@ -10358,6 +10440,7 @@ var BsGoods = function BsGoods(props) {
|
|
|
10358
10440
|
}
|
|
10359
10441
|
});
|
|
10360
10442
|
pubsub__default['default'].subscribeOnce('changeShopCode', function (type, data) {
|
|
10443
|
+
console.log(data);
|
|
10361
10444
|
onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
|
|
10362
10445
|
shopCode: data.shopCode
|
|
10363
10446
|
}));
|
|
@@ -10408,7 +10491,7 @@ var BsGoods = function BsGoods(props) {
|
|
|
10408
10491
|
}));
|
|
10409
10492
|
};
|
|
10410
10493
|
|
|
10411
|
-
var _excluded$
|
|
10494
|
+
var _excluded$d = ["value", "onChange", "reasonList", "disabled"];
|
|
10412
10495
|
var BsExchange = function BsExchange(props) {
|
|
10413
10496
|
var _value$bsExchangeType4, _value$bsExchangeType5, _value$bsExchangeType6;
|
|
10414
10497
|
var value = props.value,
|
|
@@ -10416,7 +10499,7 @@ var BsExchange = function BsExchange(props) {
|
|
|
10416
10499
|
_props$reasonList = props.reasonList,
|
|
10417
10500
|
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
10418
10501
|
disabled = props.disabled,
|
|
10419
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
10502
|
+
other = _objectWithoutProperties(props, _excluded$d);
|
|
10420
10503
|
var valueRef = React.useRef({});
|
|
10421
10504
|
React.useEffect(function () {
|
|
10422
10505
|
valueRef.current = value;
|
|
@@ -10638,14 +10721,14 @@ var BsExchange = function BsExchange(props) {
|
|
|
10638
10721
|
}))) : null);
|
|
10639
10722
|
};
|
|
10640
10723
|
|
|
10641
|
-
var _excluded$
|
|
10724
|
+
var _excluded$e = ["value", "onChange", "reasonList", "disabled"];
|
|
10642
10725
|
var BsReissue = function BsReissue(props) {
|
|
10643
10726
|
var value = props.value,
|
|
10644
10727
|
onChange = props.onChange,
|
|
10645
10728
|
_props$reasonList = props.reasonList,
|
|
10646
10729
|
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
10647
10730
|
disabled = props.disabled,
|
|
10648
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
10731
|
+
other = _objectWithoutProperties(props, _excluded$e);
|
|
10649
10732
|
var valueRef = React.useRef({});
|
|
10650
10733
|
React.useEffect(function () {
|
|
10651
10734
|
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.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.
|
|
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": "8dacfd2ad0656abd11684055ab4a9a35aa460d08"
|
|
62
64
|
}
|