@kmkf-fe-packages/basic-components 2.10.17 → 2.10.18
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';
|
|
@@ -16271,11 +16271,17 @@ var OptionalInput = function OptionalInput(props) {
|
|
|
16271
16271
|
});
|
|
16272
16272
|
}
|
|
16273
16273
|
};
|
|
16274
|
+
var handleBlur = function handleBlur(event) {
|
|
16275
|
+
var nextTarget = event.relatedTarget;
|
|
16276
|
+
if (nextTarget && event.currentTarget.contains(nextTarget)) return;
|
|
16277
|
+
if (typeof onBlur === 'function') onBlur(event);
|
|
16278
|
+
};
|
|
16274
16279
|
return /*#__PURE__*/React.createElement("div", {
|
|
16275
16280
|
style: {
|
|
16276
16281
|
display: 'flex',
|
|
16277
16282
|
alignItems: 'center'
|
|
16278
|
-
}
|
|
16283
|
+
},
|
|
16284
|
+
onBlur: handleBlur
|
|
16279
16285
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
16280
16286
|
className: "optional-input-select",
|
|
16281
16287
|
style: {
|
|
@@ -16283,8 +16289,7 @@ var OptionalInput = function OptionalInput(props) {
|
|
|
16283
16289
|
},
|
|
16284
16290
|
options: compareSymbolList,
|
|
16285
16291
|
onChange: handleSelectChange,
|
|
16286
|
-
value: (value === null || value === void 0 ? void 0 : value.type) || 'like'
|
|
16287
|
-
onBlur: onBlur
|
|
16292
|
+
value: (value === null || value === void 0 ? void 0 : value.type) || 'like'
|
|
16288
16293
|
}), /*#__PURE__*/React.createElement(Input, _objectSpread2({
|
|
16289
16294
|
style: {
|
|
16290
16295
|
width: '150px'
|
|
@@ -16293,11 +16298,34 @@ var OptionalInput = function OptionalInput(props) {
|
|
|
16293
16298
|
placeholder: placeholder,
|
|
16294
16299
|
onChange: handleInputChange,
|
|
16295
16300
|
onPressEnter: onPressEnter,
|
|
16296
|
-
onBlur: onBlur,
|
|
16297
16301
|
value: value === null || value === void 0 ? void 0 : value.inputValue
|
|
16298
16302
|
}, formItemProps)));
|
|
16299
16303
|
};
|
|
16300
16304
|
|
|
16305
|
+
var transformFormData = function transformFormData(formData) {
|
|
16306
|
+
var conditionList = [];
|
|
16307
|
+
for (var key in formData) {
|
|
16308
|
+
if (formData[key]) {
|
|
16309
|
+
var _formData$key, _formData$key2, _formData$key3, _formData$key4;
|
|
16310
|
+
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];
|
|
16311
|
+
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';
|
|
16312
|
+
if (!isNull(value)) {
|
|
16313
|
+
conditionList.push({
|
|
16314
|
+
leftValue: key,
|
|
16315
|
+
compareSymbol: compareSymbol,
|
|
16316
|
+
rightValue: value
|
|
16317
|
+
});
|
|
16318
|
+
}
|
|
16319
|
+
}
|
|
16320
|
+
}
|
|
16321
|
+
return conditionList;
|
|
16322
|
+
};
|
|
16323
|
+
var shouldSubmitOnBlur = function shouldSubmitOnBlur(relatedTarget) {
|
|
16324
|
+
var _target$closest;
|
|
16325
|
+
var target = relatedTarget;
|
|
16326
|
+
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'));
|
|
16327
|
+
};
|
|
16328
|
+
|
|
16301
16329
|
function SearchForm(_ref) {
|
|
16302
16330
|
var searchFormData = _ref.searchFormData,
|
|
16303
16331
|
form = _ref.form,
|
|
@@ -16332,6 +16360,10 @@ function SearchForm(_ref) {
|
|
|
16332
16360
|
return _ref2.apply(this, arguments);
|
|
16333
16361
|
};
|
|
16334
16362
|
}();
|
|
16363
|
+
var submitFormOnBlur = function submitFormOnBlur(event) {
|
|
16364
|
+
if (!shouldSubmitOnBlur(event.relatedTarget)) return;
|
|
16365
|
+
submitForm();
|
|
16366
|
+
};
|
|
16335
16367
|
return /*#__PURE__*/React.createElement(Form, {
|
|
16336
16368
|
layout: "inline",
|
|
16337
16369
|
form: form,
|
|
@@ -16353,9 +16385,7 @@ function SearchForm(_ref) {
|
|
|
16353
16385
|
onPressEnter: function onPressEnter() {
|
|
16354
16386
|
return submitForm();
|
|
16355
16387
|
},
|
|
16356
|
-
onBlur:
|
|
16357
|
-
return submitForm();
|
|
16358
|
-
},
|
|
16388
|
+
onBlur: submitFormOnBlur,
|
|
16359
16389
|
placeholder: label,
|
|
16360
16390
|
formItemProps: formItemProps
|
|
16361
16391
|
}) : type === 'select' ? /*#__PURE__*/React.createElement(Select, _objectSpread2({
|
|
@@ -16365,9 +16395,7 @@ function SearchForm(_ref) {
|
|
|
16365
16395
|
style: {
|
|
16366
16396
|
width: 150
|
|
16367
16397
|
},
|
|
16368
|
-
onBlur:
|
|
16369
|
-
return submitForm();
|
|
16370
|
-
}
|
|
16398
|
+
onBlur: submitFormOnBlur
|
|
16371
16399
|
}, formItemProps)) : /*#__PURE__*/React.createElement(Input, _objectSpread2({
|
|
16372
16400
|
placeholder: label,
|
|
16373
16401
|
allowClear: true,
|
|
@@ -16377,9 +16405,7 @@ function SearchForm(_ref) {
|
|
|
16377
16405
|
onPressEnter: function onPressEnter() {
|
|
16378
16406
|
return submitForm();
|
|
16379
16407
|
},
|
|
16380
|
-
onBlur:
|
|
16381
|
-
return submitForm();
|
|
16382
|
-
}
|
|
16408
|
+
onBlur: submitFormOnBlur
|
|
16383
16409
|
}, formItemProps)));
|
|
16384
16410
|
}), /*#__PURE__*/React.createElement(Form.Item, {
|
|
16385
16411
|
style: {
|
|
@@ -16399,21 +16425,200 @@ function SearchForm(_ref) {
|
|
|
16399
16425
|
}, "\u91CD\u7F6E")));
|
|
16400
16426
|
}
|
|
16401
16427
|
|
|
16402
|
-
var
|
|
16403
|
-
|
|
16404
|
-
|
|
16405
|
-
|
|
16406
|
-
|
|
16407
|
-
|
|
16408
|
-
|
|
16409
|
-
|
|
16410
|
-
|
|
16411
|
-
|
|
16412
|
-
|
|
16428
|
+
var ACTION_CONFIG = {
|
|
16429
|
+
JST_ERP: [{
|
|
16430
|
+
sourceField: 'styleCode',
|
|
16431
|
+
requestField: 'styleCodes'
|
|
16432
|
+
}, {
|
|
16433
|
+
sourceField: 'goodNo',
|
|
16434
|
+
requestField: 'goodNos'
|
|
16435
|
+
}],
|
|
16436
|
+
WLN_ERP: [{
|
|
16437
|
+
sourceField: 'goodNo',
|
|
16438
|
+
requestField: 'goodNos'
|
|
16439
|
+
}, {
|
|
16440
|
+
sourceField: 'specNo',
|
|
16441
|
+
requestField: 'skuCodes'
|
|
16442
|
+
}],
|
|
16443
|
+
WDT_ERP: [{
|
|
16444
|
+
sourceField: 'goodNo',
|
|
16445
|
+
requestField: 'goodNos'
|
|
16446
|
+
}, {
|
|
16447
|
+
sourceField: 'skuCode',
|
|
16448
|
+
requestField: 'skuCodes'
|
|
16449
|
+
}],
|
|
16450
|
+
GY_ERP: [{
|
|
16451
|
+
sourceField: 'goodNo',
|
|
16452
|
+
requestField: 'goodNos'
|
|
16453
|
+
}],
|
|
16454
|
+
JY_ERP: [{
|
|
16455
|
+
sourceField: 'goodNo',
|
|
16456
|
+
requestField: 'goodNos'
|
|
16457
|
+
}, {
|
|
16458
|
+
sourceField: 'skuCode',
|
|
16459
|
+
requestField: 'skuCodes'
|
|
16460
|
+
}],
|
|
16461
|
+
KM_ERP: [{
|
|
16462
|
+
sourceField: 'goodNo',
|
|
16463
|
+
requestField: 'goodNos'
|
|
16464
|
+
}, {
|
|
16465
|
+
sourceField: 'skuCode',
|
|
16466
|
+
requestField: 'skuCodes'
|
|
16467
|
+
}]
|
|
16468
|
+
};
|
|
16469
|
+
var getSearchValue = function getSearchValue(value) {
|
|
16470
|
+
var _value$inputValue;
|
|
16471
|
+
var inputValue = (_value$inputValue = value === null || value === void 0 ? void 0 : value.inputValue) !== null && _value$inputValue !== void 0 ? _value$inputValue : value;
|
|
16472
|
+
if (inputValue === undefined || inputValue === null) return '';
|
|
16473
|
+
return String(inputValue).trim();
|
|
16474
|
+
};
|
|
16475
|
+
var getSkuType = function getSkuType(platform, formData) {
|
|
16476
|
+
if (platform !== 'JST_ERP' && platform !== 'WLN_ERP') return undefined;
|
|
16477
|
+
var values = Array.isArray(formData.skuType) ? formData.skuType : [formData.skuType];
|
|
16478
|
+
var skuTypes = values.filter(function (value) {
|
|
16479
|
+
return value === 'normal' || value === 'combine';
|
|
16480
|
+
});
|
|
16481
|
+
return skuTypes.length === 1 ? skuTypes[0] : undefined;
|
|
16482
|
+
};
|
|
16483
|
+
var getReSyncActions = function getReSyncActions(platform, total, formData) {
|
|
16484
|
+
if (total !== 0) return [];
|
|
16485
|
+
var skuType = getSkuType(platform, formData);
|
|
16486
|
+
var requestData = _objectSpread2({
|
|
16487
|
+
platform: platform
|
|
16488
|
+
}, skuType ? {
|
|
16489
|
+
skuType: skuType
|
|
16490
|
+
} : {});
|
|
16491
|
+
var values = [];
|
|
16492
|
+
ACTION_CONFIG[platform].forEach(function (config) {
|
|
16493
|
+
var value = getSearchValue(formData[config.sourceField]);
|
|
16494
|
+
if (!value) return;
|
|
16495
|
+
requestData[config.requestField] = [value];
|
|
16496
|
+
values.push(value);
|
|
16497
|
+
});
|
|
16498
|
+
if (!values.length) return [];
|
|
16499
|
+
return [{
|
|
16500
|
+
key: 'goods',
|
|
16501
|
+
label: '同步商品',
|
|
16502
|
+
targetName: '商品',
|
|
16503
|
+
value: values.join('、'),
|
|
16504
|
+
requestData: requestData
|
|
16505
|
+
}];
|
|
16506
|
+
};
|
|
16507
|
+
|
|
16508
|
+
var useGoodsReSyncQuery = function useGoodsReSyncQuery(service) {
|
|
16509
|
+
var _React$useState = React.useState({
|
|
16510
|
+
total: null,
|
|
16511
|
+
formData: {}
|
|
16512
|
+
}),
|
|
16513
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
16514
|
+
queryState = _React$useState2[0],
|
|
16515
|
+
setQueryState = _React$useState2[1];
|
|
16516
|
+
var serviceWithReSyncState = React.useCallback(function (pagination, formData) {
|
|
16517
|
+
var currentFormData = formData;
|
|
16518
|
+
setQueryState({
|
|
16519
|
+
total: null,
|
|
16520
|
+
formData: currentFormData
|
|
16521
|
+
});
|
|
16522
|
+
return service(pagination, formData).then(function (result) {
|
|
16523
|
+
setQueryState({
|
|
16524
|
+
total: result.total,
|
|
16525
|
+
formData: currentFormData
|
|
16413
16526
|
});
|
|
16414
|
-
|
|
16415
|
-
|
|
16416
|
-
|
|
16527
|
+
return result;
|
|
16528
|
+
}, function (error) {
|
|
16529
|
+
setQueryState({
|
|
16530
|
+
total: null,
|
|
16531
|
+
formData: currentFormData
|
|
16532
|
+
});
|
|
16533
|
+
throw error;
|
|
16534
|
+
});
|
|
16535
|
+
}, [service]);
|
|
16536
|
+
return [serviceWithReSyncState, queryState];
|
|
16537
|
+
};
|
|
16538
|
+
var getErrorMessage = function getErrorMessage(error, action) {
|
|
16539
|
+
var _error$data;
|
|
16540
|
+
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");
|
|
16541
|
+
};
|
|
16542
|
+
var GoodsReSync = function GoodsReSync(_ref) {
|
|
16543
|
+
var platform = _ref.platform,
|
|
16544
|
+
queryState = _ref.queryState,
|
|
16545
|
+
onSuccess = _ref.onSuccess;
|
|
16546
|
+
var _React$useState3 = React.useState(null),
|
|
16547
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
16548
|
+
loadingAction = _React$useState4[0],
|
|
16549
|
+
setLoadingAction = _React$useState4[1];
|
|
16550
|
+
var actions = getReSyncActions(platform, queryState.total, queryState.formData);
|
|
16551
|
+
var handleReSync = function handleReSync(action) {
|
|
16552
|
+
Modal.confirm({
|
|
16553
|
+
title: "\u786E\u8BA4".concat(action.label),
|
|
16554
|
+
content: "\u5C06\u4ECE ERP \u91CD\u65B0\u62C9\u53D6".concat(action.targetName, "\u201C").concat(action.value, "\u201D\u5E76\u8986\u76D6\u672C\u5730\u6570\u636E"),
|
|
16555
|
+
okText: '确认同步',
|
|
16556
|
+
cancelText: '取消',
|
|
16557
|
+
onOk: function () {
|
|
16558
|
+
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
16559
|
+
var response;
|
|
16560
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
16561
|
+
while (1) switch (_context.prev = _context.next) {
|
|
16562
|
+
case 0:
|
|
16563
|
+
setLoadingAction(action.key);
|
|
16564
|
+
_context.prev = 1;
|
|
16565
|
+
_context.next = 4;
|
|
16566
|
+
return extendRequest('/qy/gdfw/product/reSync', {
|
|
16567
|
+
method: 'post',
|
|
16568
|
+
timeout: 60000,
|
|
16569
|
+
data: action.requestData
|
|
16570
|
+
});
|
|
16571
|
+
case 4:
|
|
16572
|
+
response = _context.sent;
|
|
16573
|
+
if (!((response === null || response === void 0 ? void 0 : response.success) === false)) {
|
|
16574
|
+
_context.next = 7;
|
|
16575
|
+
break;
|
|
16576
|
+
}
|
|
16577
|
+
throw new Error(response.message || "".concat(action.label, "\u5931\u8D25"));
|
|
16578
|
+
case 7:
|
|
16579
|
+
message.success((response === null || response === void 0 ? void 0 : response.message) || "".concat(action.label, "\u6210\u529F"));
|
|
16580
|
+
_context.next = 10;
|
|
16581
|
+
return onSuccess();
|
|
16582
|
+
case 10:
|
|
16583
|
+
_context.next = 16;
|
|
16584
|
+
break;
|
|
16585
|
+
case 12:
|
|
16586
|
+
_context.prev = 12;
|
|
16587
|
+
_context.t0 = _context["catch"](1);
|
|
16588
|
+
message.error(getErrorMessage(_context.t0, action));
|
|
16589
|
+
throw _context.t0;
|
|
16590
|
+
case 16:
|
|
16591
|
+
_context.prev = 16;
|
|
16592
|
+
setLoadingAction(null);
|
|
16593
|
+
return _context.finish(16);
|
|
16594
|
+
case 19:
|
|
16595
|
+
case "end":
|
|
16596
|
+
return _context.stop();
|
|
16597
|
+
}
|
|
16598
|
+
}, _callee, null, [[1, 12, 16, 19]]);
|
|
16599
|
+
}));
|
|
16600
|
+
function onOk() {
|
|
16601
|
+
return _onOk.apply(this, arguments);
|
|
16602
|
+
}
|
|
16603
|
+
return onOk;
|
|
16604
|
+
}()
|
|
16605
|
+
});
|
|
16606
|
+
};
|
|
16607
|
+
return /*#__PURE__*/React.createElement(Empty, {
|
|
16608
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE,
|
|
16609
|
+
description: actions.length ? /*#__PURE__*/React.createElement(Space, {
|
|
16610
|
+
size: 8
|
|
16611
|
+
}, actions.map(function (action) {
|
|
16612
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
16613
|
+
key: action.key,
|
|
16614
|
+
loading: loadingAction === action.key,
|
|
16615
|
+
disabled: loadingAction !== null && loadingAction !== action.key,
|
|
16616
|
+
onClick: function onClick() {
|
|
16617
|
+
return handleReSync(action);
|
|
16618
|
+
}
|
|
16619
|
+
}, action.label);
|
|
16620
|
+
})) : '暂无数据'
|
|
16621
|
+
});
|
|
16417
16622
|
};
|
|
16418
16623
|
|
|
16419
16624
|
var getTableData = function getTableData(_ref, formData) {
|
|
@@ -16473,13 +16678,16 @@ var GoodList = function GoodList(props, ref) {
|
|
|
16473
16678
|
var _Form$useForm = Form.useForm(),
|
|
16474
16679
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
16475
16680
|
form = _Form$useForm2[0];
|
|
16476
|
-
var
|
|
16681
|
+
var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData),
|
|
16682
|
+
_useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
|
|
16683
|
+
getTableDataWithReSync = _useGoodsReSyncQuery2[0],
|
|
16684
|
+
reSyncQueryState = _useGoodsReSyncQuery2[1];
|
|
16685
|
+
var _useAntdTable = useAntdTable(getTableDataWithReSync, {
|
|
16477
16686
|
defaultPageSize: 10,
|
|
16478
16687
|
form: form
|
|
16479
16688
|
}),
|
|
16480
16689
|
tableProps = _useAntdTable.tableProps,
|
|
16481
|
-
search = _useAntdTable.search
|
|
16482
|
-
params = _useAntdTable.params;
|
|
16690
|
+
search = _useAntdTable.search;
|
|
16483
16691
|
var submit = search.submit,
|
|
16484
16692
|
reset = search.reset;
|
|
16485
16693
|
var setGoodBrandList = function setGoodBrandList() {
|
|
@@ -16670,6 +16878,13 @@ var GoodList = function GoodList(props, ref) {
|
|
|
16670
16878
|
y: 250
|
|
16671
16879
|
}
|
|
16672
16880
|
}, tableProps), {}, {
|
|
16881
|
+
locale: {
|
|
16882
|
+
emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
|
|
16883
|
+
platform: "WDT_ERP",
|
|
16884
|
+
queryState: reSyncQueryState,
|
|
16885
|
+
onSuccess: submit
|
|
16886
|
+
})
|
|
16887
|
+
},
|
|
16673
16888
|
size: "small"
|
|
16674
16889
|
}))), /*#__PURE__*/React.createElement(Popover, {
|
|
16675
16890
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
@@ -16814,13 +17029,16 @@ var GoodList$1 = function GoodList(props, ref) {
|
|
|
16814
17029
|
var _Form$useForm = Form.useForm(),
|
|
16815
17030
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
16816
17031
|
form = _Form$useForm2[0];
|
|
16817
|
-
var
|
|
17032
|
+
var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$1),
|
|
17033
|
+
_useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
|
|
17034
|
+
getTableDataWithReSync = _useGoodsReSyncQuery2[0],
|
|
17035
|
+
reSyncQueryState = _useGoodsReSyncQuery2[1];
|
|
17036
|
+
var _useAntdTable = useAntdTable(getTableDataWithReSync, {
|
|
16818
17037
|
defaultPageSize: 10,
|
|
16819
17038
|
form: form
|
|
16820
17039
|
}),
|
|
16821
17040
|
tableProps = _useAntdTable.tableProps,
|
|
16822
|
-
search = _useAntdTable.search
|
|
16823
|
-
params = _useAntdTable.params;
|
|
17041
|
+
search = _useAntdTable.search;
|
|
16824
17042
|
var submit = search.submit,
|
|
16825
17043
|
reset = search.reset;
|
|
16826
17044
|
var rowSelection = {
|
|
@@ -16922,7 +17140,7 @@ var GoodList$1 = function GoodList(props, ref) {
|
|
|
16922
17140
|
style: {
|
|
16923
17141
|
marginTop: '4px'
|
|
16924
17142
|
}
|
|
16925
|
-
}, /*#__PURE__*/React.createElement(Table, _objectSpread2({
|
|
17143
|
+
}, /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({
|
|
16926
17144
|
className: "GoodModalColumns",
|
|
16927
17145
|
rowSelection: rowSelection,
|
|
16928
17146
|
rowKey: "goodNo",
|
|
@@ -16932,7 +17150,15 @@ var GoodList$1 = function GoodList(props, ref) {
|
|
|
16932
17150
|
y: 250
|
|
16933
17151
|
},
|
|
16934
17152
|
size: "small"
|
|
16935
|
-
}, tableProps)
|
|
17153
|
+
}, tableProps), {}, {
|
|
17154
|
+
locale: {
|
|
17155
|
+
emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
|
|
17156
|
+
platform: "JST_ERP",
|
|
17157
|
+
queryState: reSyncQueryState,
|
|
17158
|
+
onSuccess: submit
|
|
17159
|
+
})
|
|
17160
|
+
}
|
|
17161
|
+
}))), /*#__PURE__*/React.createElement(Popover, {
|
|
16936
17162
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
16937
17163
|
return triggerNode.parentElement;
|
|
16938
17164
|
},
|
|
@@ -17305,13 +17531,16 @@ var GoodList$3 = function GoodList(props, ref) {
|
|
|
17305
17531
|
var _Form$useForm = Form.useForm(),
|
|
17306
17532
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
17307
17533
|
form = _Form$useForm2[0];
|
|
17308
|
-
var
|
|
17534
|
+
var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$3),
|
|
17535
|
+
_useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
|
|
17536
|
+
getTableDataWithReSync = _useGoodsReSyncQuery2[0],
|
|
17537
|
+
reSyncQueryState = _useGoodsReSyncQuery2[1];
|
|
17538
|
+
var _useAntdTable = useAntdTable(getTableDataWithReSync, {
|
|
17309
17539
|
defaultPageSize: 10,
|
|
17310
17540
|
form: form
|
|
17311
17541
|
}),
|
|
17312
17542
|
tableProps = _useAntdTable.tableProps,
|
|
17313
|
-
search = _useAntdTable.search
|
|
17314
|
-
params = _useAntdTable.params;
|
|
17543
|
+
search = _useAntdTable.search;
|
|
17315
17544
|
var submit = search.submit,
|
|
17316
17545
|
reset = search.reset;
|
|
17317
17546
|
var rowSelection = {
|
|
@@ -17413,7 +17642,7 @@ var GoodList$3 = function GoodList(props, ref) {
|
|
|
17413
17642
|
style: {
|
|
17414
17643
|
marginTop: '4px'
|
|
17415
17644
|
}
|
|
17416
|
-
}, /*#__PURE__*/React.createElement(Table, _objectSpread2({
|
|
17645
|
+
}, /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({
|
|
17417
17646
|
className: "GoodModalColumns",
|
|
17418
17647
|
rowSelection: rowSelection,
|
|
17419
17648
|
rowKey: rowCheckKey,
|
|
@@ -17423,7 +17652,15 @@ var GoodList$3 = function GoodList(props, ref) {
|
|
|
17423
17652
|
y: 250
|
|
17424
17653
|
},
|
|
17425
17654
|
size: "small"
|
|
17426
|
-
}, tableProps)
|
|
17655
|
+
}, tableProps), {}, {
|
|
17656
|
+
locale: {
|
|
17657
|
+
emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
|
|
17658
|
+
platform: "KM_ERP",
|
|
17659
|
+
queryState: reSyncQueryState,
|
|
17660
|
+
onSuccess: submit
|
|
17661
|
+
})
|
|
17662
|
+
}
|
|
17663
|
+
}))), /*#__PURE__*/React.createElement(Popover, {
|
|
17427
17664
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
17428
17665
|
return triggerNode.parentElement;
|
|
17429
17666
|
},
|
|
@@ -17555,13 +17792,16 @@ var GoodList$4 = function GoodList(props, ref) {
|
|
|
17555
17792
|
var _Form$useForm = Form.useForm(),
|
|
17556
17793
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
17557
17794
|
form = _Form$useForm2[0];
|
|
17558
|
-
var
|
|
17795
|
+
var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$4),
|
|
17796
|
+
_useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
|
|
17797
|
+
getTableDataWithReSync = _useGoodsReSyncQuery2[0],
|
|
17798
|
+
reSyncQueryState = _useGoodsReSyncQuery2[1];
|
|
17799
|
+
var _useAntdTable = useAntdTable(getTableDataWithReSync, {
|
|
17559
17800
|
defaultPageSize: 10,
|
|
17560
17801
|
form: form
|
|
17561
17802
|
}),
|
|
17562
17803
|
tableProps = _useAntdTable.tableProps,
|
|
17563
|
-
search = _useAntdTable.search
|
|
17564
|
-
params = _useAntdTable.params;
|
|
17804
|
+
search = _useAntdTable.search;
|
|
17565
17805
|
var submit = search.submit,
|
|
17566
17806
|
reset = search.reset;
|
|
17567
17807
|
var rowSelection = {
|
|
@@ -17664,6 +17904,13 @@ var GoodList$4 = function GoodList(props, ref) {
|
|
|
17664
17904
|
y: 250
|
|
17665
17905
|
}
|
|
17666
17906
|
}, tableProps), {}, {
|
|
17907
|
+
locale: {
|
|
17908
|
+
emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
|
|
17909
|
+
platform: "GY_ERP",
|
|
17910
|
+
queryState: reSyncQueryState,
|
|
17911
|
+
onSuccess: submit
|
|
17912
|
+
})
|
|
17913
|
+
},
|
|
17667
17914
|
size: "small"
|
|
17668
17915
|
}))), /*#__PURE__*/React.createElement(Popover, {
|
|
17669
17916
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
@@ -19247,13 +19494,16 @@ var GoodList$5 = function GoodList(props, ref) {
|
|
|
19247
19494
|
var _Form$useForm = Form.useForm(),
|
|
19248
19495
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
19249
19496
|
form = _Form$useForm2[0];
|
|
19250
|
-
var
|
|
19497
|
+
var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$5),
|
|
19498
|
+
_useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
|
|
19499
|
+
getTableDataWithReSync = _useGoodsReSyncQuery2[0],
|
|
19500
|
+
reSyncQueryState = _useGoodsReSyncQuery2[1];
|
|
19501
|
+
var _useAntdTable = useAntdTable(getTableDataWithReSync, {
|
|
19251
19502
|
defaultPageSize: 10,
|
|
19252
19503
|
form: form
|
|
19253
19504
|
}),
|
|
19254
19505
|
tableProps = _useAntdTable.tableProps,
|
|
19255
|
-
search = _useAntdTable.search
|
|
19256
|
-
params = _useAntdTable.params;
|
|
19506
|
+
search = _useAntdTable.search;
|
|
19257
19507
|
var submit = search.submit,
|
|
19258
19508
|
reset = search.reset;
|
|
19259
19509
|
var rowSelection = {
|
|
@@ -19355,7 +19605,7 @@ var GoodList$5 = function GoodList(props, ref) {
|
|
|
19355
19605
|
style: {
|
|
19356
19606
|
marginTop: '4px'
|
|
19357
19607
|
}
|
|
19358
|
-
}, /*#__PURE__*/React.createElement(Table, _objectSpread2({
|
|
19608
|
+
}, /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({
|
|
19359
19609
|
className: "GoodModalColumns",
|
|
19360
19610
|
rowSelection: rowSelection,
|
|
19361
19611
|
rowKey: "id",
|
|
@@ -19365,7 +19615,15 @@ var GoodList$5 = function GoodList(props, ref) {
|
|
|
19365
19615
|
y: 250
|
|
19366
19616
|
},
|
|
19367
19617
|
size: "small"
|
|
19368
|
-
}, tableProps)
|
|
19618
|
+
}, tableProps), {}, {
|
|
19619
|
+
locale: {
|
|
19620
|
+
emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
|
|
19621
|
+
platform: "WLN_ERP",
|
|
19622
|
+
queryState: reSyncQueryState,
|
|
19623
|
+
onSuccess: submit
|
|
19624
|
+
})
|
|
19625
|
+
}
|
|
19626
|
+
}))), /*#__PURE__*/React.createElement(Popover, {
|
|
19369
19627
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
19370
19628
|
return triggerNode.parentElement;
|
|
19371
19629
|
},
|
|
@@ -19494,13 +19752,16 @@ var GoodList$6 = function GoodList(props, ref) {
|
|
|
19494
19752
|
var _Form$useForm = Form.useForm(),
|
|
19495
19753
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
19496
19754
|
form = _Form$useForm2[0];
|
|
19497
|
-
var
|
|
19755
|
+
var _useGoodsReSyncQuery = useGoodsReSyncQuery(getTableData$6),
|
|
19756
|
+
_useGoodsReSyncQuery2 = _slicedToArray(_useGoodsReSyncQuery, 2),
|
|
19757
|
+
getTableDataWithReSync = _useGoodsReSyncQuery2[0],
|
|
19758
|
+
reSyncQueryState = _useGoodsReSyncQuery2[1];
|
|
19759
|
+
var _useAntdTable = useAntdTable(getTableDataWithReSync, {
|
|
19498
19760
|
defaultPageSize: 10,
|
|
19499
19761
|
form: form
|
|
19500
19762
|
}),
|
|
19501
19763
|
tableProps = _useAntdTable.tableProps,
|
|
19502
|
-
search = _useAntdTable.search
|
|
19503
|
-
params = _useAntdTable.params;
|
|
19764
|
+
search = _useAntdTable.search;
|
|
19504
19765
|
var submit = search.submit,
|
|
19505
19766
|
reset = search.reset;
|
|
19506
19767
|
var rowSelection = {
|
|
@@ -19602,7 +19863,7 @@ var GoodList$6 = function GoodList(props, ref) {
|
|
|
19602
19863
|
style: {
|
|
19603
19864
|
marginTop: '4px'
|
|
19604
19865
|
}
|
|
19605
|
-
}, /*#__PURE__*/React.createElement(Table, _objectSpread2({
|
|
19866
|
+
}, /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({
|
|
19606
19867
|
className: "GoodModalColumns",
|
|
19607
19868
|
rowSelection: rowSelection,
|
|
19608
19869
|
rowKey: "id",
|
|
@@ -19612,7 +19873,15 @@ var GoodList$6 = function GoodList(props, ref) {
|
|
|
19612
19873
|
y: 250
|
|
19613
19874
|
},
|
|
19614
19875
|
size: "small"
|
|
19615
|
-
}, tableProps)
|
|
19876
|
+
}, tableProps), {}, {
|
|
19877
|
+
locale: {
|
|
19878
|
+
emptyText: /*#__PURE__*/React.createElement(GoodsReSync, {
|
|
19879
|
+
platform: "JY_ERP",
|
|
19880
|
+
queryState: reSyncQueryState,
|
|
19881
|
+
onSuccess: submit
|
|
19882
|
+
})
|
|
19883
|
+
}
|
|
19884
|
+
}))), /*#__PURE__*/React.createElement(Popover, {
|
|
19616
19885
|
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
19617
19886
|
return triggerNode.parentElement;
|
|
19618
19887
|
},
|
|
@@ -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.
|
|
3
|
+
"version": "2.10.18",
|
|
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.
|
|
23
|
+
"@kmkf-fe-packages/kmkf-utils": "2.10.18",
|
|
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": "d7783cafaa84b93e5f6a84605a6cef1f8d3945b7"
|
|
70
70
|
}
|