@kmkf-fe-packages/basic-components 2.10.9-beta.22 → 2.10.9-beta.24
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,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useMemo, useEffect, useRef, forwardRef, useImperativeHandle, useCallback } from 'react';
|
|
2
|
-
import { Cascader, DatePicker, Image, InputNumber, Input, Select, Upload, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate as Rate$1, Form, Popover, Tooltip, Table, Tabs, ConfigProvider, Pagination, Typography,
|
|
2
|
+
import { Cascader, DatePicker, Image, InputNumber, Input, Select, Upload, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate as Rate$1, Form, Popover, Tooltip, Table, Tabs, ConfigProvider, Pagination, Typography, Empty, Skeleton, Tag } from 'antd';
|
|
3
3
|
import { EyeOutlined, DeleteOutlined, CloseOutlined, PlusSquareOutlined, MinusCircleFilled, PlusCircleFilled, CopyOutlined, CloseCircleOutlined, CaretUpOutlined, UpOutlined, DownOutlined, PlusOutlined, VideoCameraTwoTone } from '@ant-design/icons';
|
|
4
4
|
import request, { extend as extend$1 } from 'umi-request';
|
|
5
5
|
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
|
@@ -16368,11 +16368,17 @@ var OptionalInput = function OptionalInput(props) {
|
|
|
16368
16368
|
});
|
|
16369
16369
|
}
|
|
16370
16370
|
};
|
|
16371
|
+
var handleBlur = function handleBlur(event) {
|
|
16372
|
+
var nextTarget = event.relatedTarget;
|
|
16373
|
+
if (nextTarget && event.currentTarget.contains(nextTarget)) return;
|
|
16374
|
+
if (typeof onBlur === 'function') onBlur(event);
|
|
16375
|
+
};
|
|
16371
16376
|
return /*#__PURE__*/React.createElement("div", {
|
|
16372
16377
|
style: {
|
|
16373
16378
|
display: 'flex',
|
|
16374
16379
|
alignItems: 'center'
|
|
16375
|
-
}
|
|
16380
|
+
},
|
|
16381
|
+
onBlur: handleBlur
|
|
16376
16382
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
16377
16383
|
className: "optional-input-select",
|
|
16378
16384
|
style: {
|
|
@@ -16380,8 +16386,7 @@ var OptionalInput = function OptionalInput(props) {
|
|
|
16380
16386
|
},
|
|
16381
16387
|
options: compareSymbolList,
|
|
16382
16388
|
onChange: handleSelectChange,
|
|
16383
|
-
value: (value === null || value === void 0 ? void 0 : value.type) || 'like'
|
|
16384
|
-
onBlur: onBlur
|
|
16389
|
+
value: (value === null || value === void 0 ? void 0 : value.type) || 'like'
|
|
16385
16390
|
}), /*#__PURE__*/React.createElement(Input, _objectSpread2({
|
|
16386
16391
|
style: {
|
|
16387
16392
|
width: '150px'
|
|
@@ -16390,11 +16395,32 @@ var OptionalInput = function OptionalInput(props) {
|
|
|
16390
16395
|
placeholder: placeholder,
|
|
16391
16396
|
onChange: handleInputChange,
|
|
16392
16397
|
onPressEnter: onPressEnter,
|
|
16393
|
-
onBlur: onBlur,
|
|
16394
16398
|
value: value === null || value === void 0 ? void 0 : value.inputValue
|
|
16395
16399
|
}, formItemProps)));
|
|
16396
16400
|
};
|
|
16397
16401
|
|
|
16402
|
+
var transformFormData = function transformFormData(formData) {
|
|
16403
|
+
var conditionList = [];
|
|
16404
|
+
for (var key in formData) {
|
|
16405
|
+
if (formData[key]) {
|
|
16406
|
+
var _formData$key, _formData$key2, _formData$key3, _formData$key4;
|
|
16407
|
+
var value = ((_formData$key = formData[key]) === null || _formData$key === void 0 ? void 0 : _formData$key.type) ? (_formData$key2 = formData[key]) === null || _formData$key2 === void 0 ? void 0 : _formData$key2.inputValue : formData[key];
|
|
16408
|
+
var compareSymbol = ((_formData$key3 = formData[key]) === null || _formData$key3 === void 0 ? void 0 : _formData$key3.type) ? (_formData$key4 = formData[key]) === null || _formData$key4 === void 0 ? void 0 : _formData$key4.type : Array.isArray(value) ? 'eq' : 'like';
|
|
16409
|
+
conditionList.push({
|
|
16410
|
+
leftValue: key,
|
|
16411
|
+
compareSymbol: compareSymbol,
|
|
16412
|
+
rightValue: value
|
|
16413
|
+
});
|
|
16414
|
+
}
|
|
16415
|
+
}
|
|
16416
|
+
return conditionList;
|
|
16417
|
+
};
|
|
16418
|
+
var shouldSubmitOnBlur = function shouldSubmitOnBlur(relatedTarget) {
|
|
16419
|
+
var _target$closest;
|
|
16420
|
+
var target = relatedTarget;
|
|
16421
|
+
return !(target === null || target === void 0 ? void 0 : (_target$closest = target.closest) === null || _target$closest === void 0 ? void 0 : _target$closest.call(target, '.search-form-actions'));
|
|
16422
|
+
};
|
|
16423
|
+
|
|
16398
16424
|
function SearchForm(_ref) {
|
|
16399
16425
|
var searchFormData = _ref.searchFormData,
|
|
16400
16426
|
form = _ref.form,
|
|
@@ -16429,6 +16455,10 @@ function SearchForm(_ref) {
|
|
|
16429
16455
|
return _ref2.apply(this, arguments);
|
|
16430
16456
|
};
|
|
16431
16457
|
}();
|
|
16458
|
+
var submitFormOnBlur = function submitFormOnBlur(event) {
|
|
16459
|
+
if (!shouldSubmitOnBlur(event.relatedTarget)) return;
|
|
16460
|
+
submitForm();
|
|
16461
|
+
};
|
|
16432
16462
|
return /*#__PURE__*/React.createElement(Form, {
|
|
16433
16463
|
layout: "inline",
|
|
16434
16464
|
form: form,
|
|
@@ -16450,9 +16480,7 @@ function SearchForm(_ref) {
|
|
|
16450
16480
|
onPressEnter: function onPressEnter() {
|
|
16451
16481
|
return submitForm();
|
|
16452
16482
|
},
|
|
16453
|
-
onBlur:
|
|
16454
|
-
return submitForm();
|
|
16455
|
-
},
|
|
16483
|
+
onBlur: submitFormOnBlur,
|
|
16456
16484
|
placeholder: label,
|
|
16457
16485
|
formItemProps: formItemProps
|
|
16458
16486
|
}) : type === 'select' ? /*#__PURE__*/React.createElement(Select, _objectSpread2({
|
|
@@ -16462,9 +16490,7 @@ function SearchForm(_ref) {
|
|
|
16462
16490
|
style: {
|
|
16463
16491
|
width: 150
|
|
16464
16492
|
},
|
|
16465
|
-
onBlur:
|
|
16466
|
-
return submitForm();
|
|
16467
|
-
}
|
|
16493
|
+
onBlur: submitFormOnBlur
|
|
16468
16494
|
}, formItemProps)) : /*#__PURE__*/React.createElement(Input, _objectSpread2({
|
|
16469
16495
|
placeholder: label,
|
|
16470
16496
|
allowClear: true,
|
|
@@ -16474,9 +16500,7 @@ function SearchForm(_ref) {
|
|
|
16474
16500
|
onPressEnter: function onPressEnter() {
|
|
16475
16501
|
return submitForm();
|
|
16476
16502
|
},
|
|
16477
|
-
onBlur:
|
|
16478
|
-
return submitForm();
|
|
16479
|
-
}
|
|
16503
|
+
onBlur: submitFormOnBlur
|
|
16480
16504
|
}, formItemProps)));
|
|
16481
16505
|
}), /*#__PURE__*/React.createElement(Form.Item, {
|
|
16482
16506
|
style: {
|
|
@@ -16496,21 +16520,200 @@ function SearchForm(_ref) {
|
|
|
16496
16520
|
}, "\u91CD\u7F6E")));
|
|
16497
16521
|
}
|
|
16498
16522
|
|
|
16499
|
-
var
|
|
16500
|
-
|
|
16501
|
-
|
|
16502
|
-
|
|
16503
|
-
|
|
16504
|
-
|
|
16505
|
-
|
|
16506
|
-
|
|
16507
|
-
|
|
16508
|
-
|
|
16509
|
-
|
|
16523
|
+
var ACTION_CONFIG = {
|
|
16524
|
+
JST_ERP: [{
|
|
16525
|
+
sourceField: 'styleCode',
|
|
16526
|
+
requestField: 'styleCodes'
|
|
16527
|
+
}, {
|
|
16528
|
+
sourceField: 'goodNo',
|
|
16529
|
+
requestField: 'goodNos'
|
|
16530
|
+
}],
|
|
16531
|
+
WLN_ERP: [{
|
|
16532
|
+
sourceField: 'goodNo',
|
|
16533
|
+
requestField: 'goodNos'
|
|
16534
|
+
}, {
|
|
16535
|
+
sourceField: 'specNo',
|
|
16536
|
+
requestField: 'skuCodes'
|
|
16537
|
+
}],
|
|
16538
|
+
WDT_ERP: [{
|
|
16539
|
+
sourceField: 'goodNo',
|
|
16540
|
+
requestField: 'goodNos'
|
|
16541
|
+
}, {
|
|
16542
|
+
sourceField: 'skuCode',
|
|
16543
|
+
requestField: 'skuCodes'
|
|
16544
|
+
}],
|
|
16545
|
+
GY_ERP: [{
|
|
16546
|
+
sourceField: 'goodNo',
|
|
16547
|
+
requestField: 'goodNos'
|
|
16548
|
+
}],
|
|
16549
|
+
JY_ERP: [{
|
|
16550
|
+
sourceField: 'goodNo',
|
|
16551
|
+
requestField: 'goodNos'
|
|
16552
|
+
}, {
|
|
16553
|
+
sourceField: 'skuCode',
|
|
16554
|
+
requestField: 'skuCodes'
|
|
16555
|
+
}],
|
|
16556
|
+
KM_ERP: [{
|
|
16557
|
+
sourceField: 'goodNo',
|
|
16558
|
+
requestField: 'goodNos'
|
|
16559
|
+
}, {
|
|
16560
|
+
sourceField: 'skuCode',
|
|
16561
|
+
requestField: 'skuCodes'
|
|
16562
|
+
}]
|
|
16563
|
+
};
|
|
16564
|
+
var getSearchValue = function getSearchValue(value) {
|
|
16565
|
+
var _value$inputValue;
|
|
16566
|
+
var inputValue = (_value$inputValue = value === null || value === void 0 ? void 0 : value.inputValue) !== null && _value$inputValue !== void 0 ? _value$inputValue : value;
|
|
16567
|
+
if (inputValue === undefined || inputValue === null) return '';
|
|
16568
|
+
return String(inputValue).trim();
|
|
16569
|
+
};
|
|
16570
|
+
var getSkuType = function getSkuType(platform, formData) {
|
|
16571
|
+
if (platform !== 'JST_ERP' && platform !== 'WLN_ERP') return undefined;
|
|
16572
|
+
var values = Array.isArray(formData.skuType) ? formData.skuType : [formData.skuType];
|
|
16573
|
+
var skuTypes = values.filter(function (value) {
|
|
16574
|
+
return value === 'normal' || value === 'combine';
|
|
16575
|
+
});
|
|
16576
|
+
return skuTypes.length === 1 ? skuTypes[0] : undefined;
|
|
16577
|
+
};
|
|
16578
|
+
var getReSyncActions = function getReSyncActions(platform, total, formData) {
|
|
16579
|
+
if (total !== 0) return [];
|
|
16580
|
+
var skuType = getSkuType(platform, formData);
|
|
16581
|
+
var requestData = _objectSpread2({
|
|
16582
|
+
platform: platform
|
|
16583
|
+
}, skuType ? {
|
|
16584
|
+
skuType: skuType
|
|
16585
|
+
} : {});
|
|
16586
|
+
var values = [];
|
|
16587
|
+
ACTION_CONFIG[platform].forEach(function (config) {
|
|
16588
|
+
var value = getSearchValue(formData[config.sourceField]);
|
|
16589
|
+
if (!value) return;
|
|
16590
|
+
requestData[config.requestField] = [value];
|
|
16591
|
+
values.push(value);
|
|
16592
|
+
});
|
|
16593
|
+
if (!values.length) return [];
|
|
16594
|
+
return [{
|
|
16595
|
+
key: 'goods',
|
|
16596
|
+
label: '同步商品',
|
|
16597
|
+
targetName: '商品',
|
|
16598
|
+
value: values.join('、'),
|
|
16599
|
+
requestData: requestData
|
|
16600
|
+
}];
|
|
16601
|
+
};
|
|
16602
|
+
|
|
16603
|
+
var useGoodsReSyncQuery = function useGoodsReSyncQuery(service) {
|
|
16604
|
+
var _React$useState = React.useState({
|
|
16605
|
+
total: null,
|
|
16606
|
+
formData: {}
|
|
16607
|
+
}),
|
|
16608
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
16609
|
+
queryState = _React$useState2[0],
|
|
16610
|
+
setQueryState = _React$useState2[1];
|
|
16611
|
+
var serviceWithReSyncState = React.useCallback(function (pagination, formData) {
|
|
16612
|
+
var currentFormData = formData;
|
|
16613
|
+
setQueryState({
|
|
16614
|
+
total: null,
|
|
16615
|
+
formData: currentFormData
|
|
16616
|
+
});
|
|
16617
|
+
return service(pagination, formData).then(function (result) {
|
|
16618
|
+
setQueryState({
|
|
16619
|
+
total: result.total,
|
|
16620
|
+
formData: currentFormData
|
|
16510
16621
|
});
|
|
16511
|
-
|
|
16512
|
-
|
|
16513
|
-
|
|
16622
|
+
return result;
|
|
16623
|
+
}, function (error) {
|
|
16624
|
+
setQueryState({
|
|
16625
|
+
total: null,
|
|
16626
|
+
formData: currentFormData
|
|
16627
|
+
});
|
|
16628
|
+
throw error;
|
|
16629
|
+
});
|
|
16630
|
+
}, [service]);
|
|
16631
|
+
return [serviceWithReSyncState, queryState];
|
|
16632
|
+
};
|
|
16633
|
+
var getErrorMessage = function getErrorMessage(error, action) {
|
|
16634
|
+
var _error$data;
|
|
16635
|
+
return (error === null || error === void 0 ? void 0 : (_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.message) || (error === null || error === void 0 ? void 0 : error.message) || "".concat(action.label, "\u5931\u8D25");
|
|
16636
|
+
};
|
|
16637
|
+
var GoodsReSync = function GoodsReSync(_ref) {
|
|
16638
|
+
var platform = _ref.platform,
|
|
16639
|
+
queryState = _ref.queryState,
|
|
16640
|
+
onSuccess = _ref.onSuccess;
|
|
16641
|
+
var _React$useState3 = React.useState(null),
|
|
16642
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
16643
|
+
loadingAction = _React$useState4[0],
|
|
16644
|
+
setLoadingAction = _React$useState4[1];
|
|
16645
|
+
var actions = getReSyncActions(platform, queryState.total, queryState.formData);
|
|
16646
|
+
var handleReSync = function handleReSync(action) {
|
|
16647
|
+
Modal.confirm({
|
|
16648
|
+
title: "\u786E\u8BA4".concat(action.label),
|
|
16649
|
+
content: "\u5C06\u4ECE ERP \u91CD\u65B0\u62C9\u53D6".concat(action.targetName, "\u201C").concat(action.value, "\u201D\u5E76\u8986\u76D6\u672C\u5730\u6570\u636E"),
|
|
16650
|
+
okText: '确认同步',
|
|
16651
|
+
cancelText: '取消',
|
|
16652
|
+
onOk: function () {
|
|
16653
|
+
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
16654
|
+
var response;
|
|
16655
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
16656
|
+
while (1) switch (_context.prev = _context.next) {
|
|
16657
|
+
case 0:
|
|
16658
|
+
setLoadingAction(action.key);
|
|
16659
|
+
_context.prev = 1;
|
|
16660
|
+
_context.next = 4;
|
|
16661
|
+
return extendRequest('/qy/gdfw/product/reSync', {
|
|
16662
|
+
method: 'post',
|
|
16663
|
+
timeout: 60000,
|
|
16664
|
+
data: action.requestData
|
|
16665
|
+
});
|
|
16666
|
+
case 4:
|
|
16667
|
+
response = _context.sent;
|
|
16668
|
+
if (!((response === null || response === void 0 ? void 0 : response.success) === false)) {
|
|
16669
|
+
_context.next = 7;
|
|
16670
|
+
break;
|
|
16671
|
+
}
|
|
16672
|
+
throw new Error(response.message || "".concat(action.label, "\u5931\u8D25"));
|
|
16673
|
+
case 7:
|
|
16674
|
+
message.success((response === null || response === void 0 ? void 0 : response.message) || "".concat(action.label, "\u6210\u529F"));
|
|
16675
|
+
_context.next = 10;
|
|
16676
|
+
return onSuccess();
|
|
16677
|
+
case 10:
|
|
16678
|
+
_context.next = 16;
|
|
16679
|
+
break;
|
|
16680
|
+
case 12:
|
|
16681
|
+
_context.prev = 12;
|
|
16682
|
+
_context.t0 = _context["catch"](1);
|
|
16683
|
+
message.error(getErrorMessage(_context.t0, action));
|
|
16684
|
+
throw _context.t0;
|
|
16685
|
+
case 16:
|
|
16686
|
+
_context.prev = 16;
|
|
16687
|
+
setLoadingAction(null);
|
|
16688
|
+
return _context.finish(16);
|
|
16689
|
+
case 19:
|
|
16690
|
+
case "end":
|
|
16691
|
+
return _context.stop();
|
|
16692
|
+
}
|
|
16693
|
+
}, _callee, null, [[1, 12, 16, 19]]);
|
|
16694
|
+
}));
|
|
16695
|
+
function onOk() {
|
|
16696
|
+
return _onOk.apply(this, arguments);
|
|
16697
|
+
}
|
|
16698
|
+
return onOk;
|
|
16699
|
+
}()
|
|
16700
|
+
});
|
|
16701
|
+
};
|
|
16702
|
+
return /*#__PURE__*/React.createElement(Empty, {
|
|
16703
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
16704
|
+
description: actions.length ? /*#__PURE__*/React.createElement(Space, {
|
|
16705
|
+
size: 8
|
|
16706
|
+
}, actions.map(function (action) {
|
|
16707
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
16708
|
+
key: action.key,
|
|
16709
|
+
loading: loadingAction === action.key,
|
|
16710
|
+
disabled: loadingAction !== null && loadingAction !== action.key,
|
|
16711
|
+
onClick: function onClick() {
|
|
16712
|
+
return handleReSync(action);
|
|
16713
|
+
}
|
|
16714
|
+
}, action.label);
|
|
16715
|
+
})) : '暂无数据'
|
|
16716
|
+
});
|
|
16514
16717
|
};
|
|
16515
16718
|
|
|
16516
16719
|
var getTableData = function getTableData(_ref, formData) {
|
|
@@ -16570,13 +16773,16 @@ var GoodList = function GoodList(props, ref) {
|
|
|
16570
16773
|
var _Form$useForm = Form.useForm(),
|
|
16571
16774
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
16572
16775
|
form = _Form$useForm2[0];
|
|
16573
|
-
var
|
|
16776
|
+
var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData),
|
|
16777
|
+
_useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
|
|
16778
|
+
getTableDataWithReSync = _useGoodsReSyncQuery2[0],
|
|
16779
|
+
reSyncQueryState = _useGoodsReSyncQuery2[1];
|
|
16780
|
+
var _useAntdTable = useAntdTable(getTableDataWithReSync, {
|
|
16574
16781
|
defaultPageSize: 10,
|
|
16575
16782
|
form: form
|
|
16576
16783
|
}),
|
|
16577
16784
|
tableProps = _useAntdTable.tableProps,
|
|
16578
|
-
search = _useAntdTable.search
|
|
16579
|
-
params = _useAntdTable.params;
|
|
16785
|
+
search = _useAntdTable.search;
|
|
16580
16786
|
var submit = search.submit,
|
|
16581
16787
|
reset = search.reset;
|
|
16582
16788
|
var setGoodBrandList = function setGoodBrandList() {
|
|
@@ -16775,6 +16981,13 @@ var GoodList = function GoodList(props, ref) {
|
|
|
16775
16981
|
y: 250
|
|
16776
16982
|
}
|
|
16777
16983
|
}, tableProps), {}, {
|
|
16984
|
+
locale: {
|
|
16985
|
+
emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
|
|
16986
|
+
platform: "WDT_ERP",
|
|
16987
|
+
queryState: reSyncQueryState,
|
|
16988
|
+
onSuccess: submit
|
|
16989
|
+
})
|
|
16990
|
+
},
|
|
16778
16991
|
size: "small"
|
|
16779
16992
|
}))), /*#__PURE__*/React.createElement(Popover, {
|
|
16780
16993
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
@@ -16919,13 +17132,16 @@ var GoodList$1 = function GoodList(props, ref) {
|
|
|
16919
17132
|
var _Form$useForm = Form.useForm(),
|
|
16920
17133
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
16921
17134
|
form = _Form$useForm2[0];
|
|
16922
|
-
var
|
|
17135
|
+
var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$1),
|
|
17136
|
+
_useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
|
|
17137
|
+
getTableDataWithReSync = _useGoodsReSyncQuery2[0],
|
|
17138
|
+
reSyncQueryState = _useGoodsReSyncQuery2[1];
|
|
17139
|
+
var _useAntdTable = useAntdTable(getTableDataWithReSync, {
|
|
16923
17140
|
defaultPageSize: 10,
|
|
16924
17141
|
form: form
|
|
16925
17142
|
}),
|
|
16926
17143
|
tableProps = _useAntdTable.tableProps,
|
|
16927
|
-
search = _useAntdTable.search
|
|
16928
|
-
params = _useAntdTable.params;
|
|
17144
|
+
search = _useAntdTable.search;
|
|
16929
17145
|
var submit = search.submit,
|
|
16930
17146
|
reset = search.reset;
|
|
16931
17147
|
var rowSelection = {
|
|
@@ -17027,7 +17243,7 @@ var GoodList$1 = function GoodList(props, ref) {
|
|
|
17027
17243
|
style: {
|
|
17028
17244
|
marginTop: '4px'
|
|
17029
17245
|
}
|
|
17030
|
-
}, /*#__PURE__*/React.createElement(Table, _objectSpread2({
|
|
17246
|
+
}, /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({
|
|
17031
17247
|
className: "GoodModalColumns",
|
|
17032
17248
|
rowSelection: rowSelection,
|
|
17033
17249
|
rowKey: "goodNo",
|
|
@@ -17037,7 +17253,15 @@ var GoodList$1 = function GoodList(props, ref) {
|
|
|
17037
17253
|
y: 250
|
|
17038
17254
|
},
|
|
17039
17255
|
size: "small"
|
|
17040
|
-
}, tableProps)
|
|
17256
|
+
}, tableProps), {}, {
|
|
17257
|
+
locale: {
|
|
17258
|
+
emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
|
|
17259
|
+
platform: "JST_ERP",
|
|
17260
|
+
queryState: reSyncQueryState,
|
|
17261
|
+
onSuccess: submit
|
|
17262
|
+
})
|
|
17263
|
+
}
|
|
17264
|
+
}))), /*#__PURE__*/React.createElement(Popover, {
|
|
17041
17265
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
17042
17266
|
return triggerNode.parentElement;
|
|
17043
17267
|
},
|
|
@@ -17410,13 +17634,16 @@ var GoodList$3 = function GoodList(props, ref) {
|
|
|
17410
17634
|
var _Form$useForm = Form.useForm(),
|
|
17411
17635
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
17412
17636
|
form = _Form$useForm2[0];
|
|
17413
|
-
var
|
|
17637
|
+
var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$3),
|
|
17638
|
+
_useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
|
|
17639
|
+
getTableDataWithReSync = _useGoodsReSyncQuery2[0],
|
|
17640
|
+
reSyncQueryState = _useGoodsReSyncQuery2[1];
|
|
17641
|
+
var _useAntdTable = useAntdTable(getTableDataWithReSync, {
|
|
17414
17642
|
defaultPageSize: 10,
|
|
17415
17643
|
form: form
|
|
17416
17644
|
}),
|
|
17417
17645
|
tableProps = _useAntdTable.tableProps,
|
|
17418
|
-
search = _useAntdTable.search
|
|
17419
|
-
params = _useAntdTable.params;
|
|
17646
|
+
search = _useAntdTable.search;
|
|
17420
17647
|
var submit = search.submit,
|
|
17421
17648
|
reset = search.reset;
|
|
17422
17649
|
var rowSelection = {
|
|
@@ -17518,7 +17745,7 @@ var GoodList$3 = function GoodList(props, ref) {
|
|
|
17518
17745
|
style: {
|
|
17519
17746
|
marginTop: '4px'
|
|
17520
17747
|
}
|
|
17521
|
-
}, /*#__PURE__*/React.createElement(Table, _objectSpread2({
|
|
17748
|
+
}, /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({
|
|
17522
17749
|
className: "GoodModalColumns",
|
|
17523
17750
|
rowSelection: rowSelection,
|
|
17524
17751
|
rowKey: rowCheckKey,
|
|
@@ -17528,7 +17755,15 @@ var GoodList$3 = function GoodList(props, ref) {
|
|
|
17528
17755
|
y: 250
|
|
17529
17756
|
},
|
|
17530
17757
|
size: "small"
|
|
17531
|
-
}, tableProps)
|
|
17758
|
+
}, tableProps), {}, {
|
|
17759
|
+
locale: {
|
|
17760
|
+
emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
|
|
17761
|
+
platform: "KM_ERP",
|
|
17762
|
+
queryState: reSyncQueryState,
|
|
17763
|
+
onSuccess: submit
|
|
17764
|
+
})
|
|
17765
|
+
}
|
|
17766
|
+
}))), /*#__PURE__*/React.createElement(Popover, {
|
|
17532
17767
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
17533
17768
|
return triggerNode.parentElement;
|
|
17534
17769
|
},
|
|
@@ -17660,13 +17895,16 @@ var GoodList$4 = function GoodList(props, ref) {
|
|
|
17660
17895
|
var _Form$useForm = Form.useForm(),
|
|
17661
17896
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
17662
17897
|
form = _Form$useForm2[0];
|
|
17663
|
-
var
|
|
17898
|
+
var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$4),
|
|
17899
|
+
_useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
|
|
17900
|
+
getTableDataWithReSync = _useGoodsReSyncQuery2[0],
|
|
17901
|
+
reSyncQueryState = _useGoodsReSyncQuery2[1];
|
|
17902
|
+
var _useAntdTable = useAntdTable(getTableDataWithReSync, {
|
|
17664
17903
|
defaultPageSize: 10,
|
|
17665
17904
|
form: form
|
|
17666
17905
|
}),
|
|
17667
17906
|
tableProps = _useAntdTable.tableProps,
|
|
17668
|
-
search = _useAntdTable.search
|
|
17669
|
-
params = _useAntdTable.params;
|
|
17907
|
+
search = _useAntdTable.search;
|
|
17670
17908
|
var submit = search.submit,
|
|
17671
17909
|
reset = search.reset;
|
|
17672
17910
|
var rowSelection = {
|
|
@@ -17769,6 +18007,13 @@ var GoodList$4 = function GoodList(props, ref) {
|
|
|
17769
18007
|
y: 250
|
|
17770
18008
|
}
|
|
17771
18009
|
}, tableProps), {}, {
|
|
18010
|
+
locale: {
|
|
18011
|
+
emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
|
|
18012
|
+
platform: "GY_ERP",
|
|
18013
|
+
queryState: reSyncQueryState,
|
|
18014
|
+
onSuccess: submit
|
|
18015
|
+
})
|
|
18016
|
+
},
|
|
17772
18017
|
size: "small"
|
|
17773
18018
|
}))), /*#__PURE__*/React.createElement(Popover, {
|
|
17774
18019
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
@@ -19355,13 +19600,16 @@ var GoodList$5 = function GoodList(props, ref) {
|
|
|
19355
19600
|
var _Form$useForm = Form.useForm(),
|
|
19356
19601
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
19357
19602
|
form = _Form$useForm2[0];
|
|
19358
|
-
var
|
|
19603
|
+
var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$5),
|
|
19604
|
+
_useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
|
|
19605
|
+
getTableDataWithReSync = _useGoodsReSyncQuery2[0],
|
|
19606
|
+
reSyncQueryState = _useGoodsReSyncQuery2[1];
|
|
19607
|
+
var _useAntdTable = useAntdTable(getTableDataWithReSync, {
|
|
19359
19608
|
defaultPageSize: 10,
|
|
19360
19609
|
form: form
|
|
19361
19610
|
}),
|
|
19362
19611
|
tableProps = _useAntdTable.tableProps,
|
|
19363
|
-
search = _useAntdTable.search
|
|
19364
|
-
params = _useAntdTable.params;
|
|
19612
|
+
search = _useAntdTable.search;
|
|
19365
19613
|
var submit = search.submit,
|
|
19366
19614
|
reset = search.reset;
|
|
19367
19615
|
var rowSelection = {
|
|
@@ -19463,7 +19711,7 @@ var GoodList$5 = function GoodList(props, ref) {
|
|
|
19463
19711
|
style: {
|
|
19464
19712
|
marginTop: '4px'
|
|
19465
19713
|
}
|
|
19466
|
-
}, /*#__PURE__*/React.createElement(Table, _objectSpread2({
|
|
19714
|
+
}, /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({
|
|
19467
19715
|
className: "GoodModalColumns",
|
|
19468
19716
|
rowSelection: rowSelection,
|
|
19469
19717
|
rowKey: "id",
|
|
@@ -19473,7 +19721,15 @@ var GoodList$5 = function GoodList(props, ref) {
|
|
|
19473
19721
|
y: 250
|
|
19474
19722
|
},
|
|
19475
19723
|
size: "small"
|
|
19476
|
-
}, tableProps)
|
|
19724
|
+
}, tableProps), {}, {
|
|
19725
|
+
locale: {
|
|
19726
|
+
emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
|
|
19727
|
+
platform: "WLN_ERP",
|
|
19728
|
+
queryState: reSyncQueryState,
|
|
19729
|
+
onSuccess: submit
|
|
19730
|
+
})
|
|
19731
|
+
}
|
|
19732
|
+
}))), /*#__PURE__*/React.createElement(Popover, {
|
|
19477
19733
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
19478
19734
|
return triggerNode.parentElement;
|
|
19479
19735
|
},
|
|
@@ -19602,13 +19858,16 @@ var GoodList$6 = function GoodList(props, ref) {
|
|
|
19602
19858
|
var _Form$useForm = Form.useForm(),
|
|
19603
19859
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
19604
19860
|
form = _Form$useForm2[0];
|
|
19605
|
-
var
|
|
19861
|
+
var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$6),
|
|
19862
|
+
_useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
|
|
19863
|
+
getTableDataWithReSync = _useGoodsReSyncQuery2[0],
|
|
19864
|
+
reSyncQueryState = _useGoodsReSyncQuery2[1];
|
|
19865
|
+
var _useAntdTable = useAntdTable(getTableDataWithReSync, {
|
|
19606
19866
|
defaultPageSize: 10,
|
|
19607
19867
|
form: form
|
|
19608
19868
|
}),
|
|
19609
19869
|
tableProps = _useAntdTable.tableProps,
|
|
19610
|
-
search = _useAntdTable.search
|
|
19611
|
-
params = _useAntdTable.params;
|
|
19870
|
+
search = _useAntdTable.search;
|
|
19612
19871
|
var submit = search.submit,
|
|
19613
19872
|
reset = search.reset;
|
|
19614
19873
|
var rowSelection = {
|
|
@@ -19710,7 +19969,7 @@ var GoodList$6 = function GoodList(props, ref) {
|
|
|
19710
19969
|
style: {
|
|
19711
19970
|
marginTop: '4px'
|
|
19712
19971
|
}
|
|
19713
|
-
}, /*#__PURE__*/React.createElement(Table, _objectSpread2({
|
|
19972
|
+
}, /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({
|
|
19714
19973
|
className: "GoodModalColumns",
|
|
19715
19974
|
rowSelection: rowSelection,
|
|
19716
19975
|
rowKey: "id",
|
|
@@ -19720,7 +19979,15 @@ var GoodList$6 = function GoodList(props, ref) {
|
|
|
19720
19979
|
y: 250
|
|
19721
19980
|
},
|
|
19722
19981
|
size: "small"
|
|
19723
|
-
}, tableProps)
|
|
19982
|
+
}, tableProps), {}, {
|
|
19983
|
+
locale: {
|
|
19984
|
+
emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
|
|
19985
|
+
platform: "JY_ERP",
|
|
19986
|
+
queryState: reSyncQueryState,
|
|
19987
|
+
onSuccess: submit
|
|
19988
|
+
})
|
|
19989
|
+
}
|
|
19990
|
+
}))), /*#__PURE__*/React.createElement(Popover, {
|
|
19724
19991
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
19725
19992
|
return triggerNode.parentElement;
|
|
19726
19993
|
},
|
|
@@ -25512,7 +25779,7 @@ var processKmGoods$1 = function processKmGoods(_ref9) {
|
|
|
25512
25779
|
return list.map(function (item) {
|
|
25513
25780
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
25514
25781
|
skuPropertiesName: item.specName,
|
|
25515
|
-
sysSkuPropertiesName: item.
|
|
25782
|
+
sysSkuPropertiesName: item.propertiesValue,
|
|
25516
25783
|
sysTitle: item.goodName,
|
|
25517
25784
|
title: null,
|
|
25518
25785
|
shortTitle: item.goodShortName,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ReSyncPlatform } from './utils';
|
|
3
|
+
export type ReSyncQueryState = {
|
|
4
|
+
total: number | null;
|
|
5
|
+
formData: Record<string, any>;
|
|
6
|
+
};
|
|
7
|
+
type QueryService<TFormData, TResult extends {
|
|
8
|
+
total: number;
|
|
9
|
+
}> = (pagination: any, formData: TFormData) => Promise<TResult>;
|
|
10
|
+
export declare const useGoodsReSyncQuery: <TFormData, TResult extends {
|
|
11
|
+
total: number;
|
|
12
|
+
}>(service: QueryService<TFormData, TResult>) => readonly [(pagination: any, formData: TFormData) => Promise<TResult>, ReSyncQueryState];
|
|
13
|
+
type Props = {
|
|
14
|
+
platform: ReSyncPlatform;
|
|
15
|
+
queryState: ReSyncQueryState;
|
|
16
|
+
onSuccess: () => void | Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
declare const GoodsReSync: ({ platform, queryState, onSuccess }: Props) => React.JSX.Element;
|
|
19
|
+
export default GoodsReSync;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ReSyncPlatform = 'JST_ERP' | 'WLN_ERP' | 'WDT_ERP' | 'GY_ERP' | 'JY_ERP' | 'KM_ERP';
|
|
2
|
+
export type ReSyncAction = {
|
|
3
|
+
key: 'goods';
|
|
4
|
+
label: '同步商品';
|
|
5
|
+
targetName: '商品';
|
|
6
|
+
value: string;
|
|
7
|
+
requestData: {
|
|
8
|
+
platform: ReSyncPlatform;
|
|
9
|
+
goodNos?: string[];
|
|
10
|
+
skuCodes?: string[];
|
|
11
|
+
styleCodes?: string[];
|
|
12
|
+
skuType?: 'normal' | 'combine';
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const getReSyncActions: (platform: ReSyncPlatform, total: number | null, formData: Record<string, any>) => ReSyncAction[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "2.10.9-beta.
|
|
3
|
+
"version": "2.10.9-beta.24",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@kmkf-fe-packages/kmkf-utils": "2.10.9-beta.
|
|
23
|
+
"@kmkf-fe-packages/kmkf-utils": "2.10.9-beta.24",
|
|
24
24
|
"ahooks": "^3.7.4",
|
|
25
25
|
"ali-react-table": "2.6.1",
|
|
26
26
|
"bignumber.js": "^9.1.2",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "3ac6e1b16ea3b64400ddff2423e5e134a0c4dcca"
|
|
70
70
|
}
|