@bit-sun/business-component 2.2.14 → 2.2.16
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/components/Business/AddSelectBusiness/index.d.ts +1 -0
- package/dist/components/Business/BsLayouts/utils.d.ts +0 -4
- package/dist/index.esm.js +332 -44
- package/dist/index.js +332 -43
- package/dist/utils/LocalstorageUtils.d.ts +9 -1
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/Business/AddSelectBusiness/index.md +40 -4
- package/src/components/Business/AddSelectBusiness/index.tsx +233 -0
- package/src/components/Business/BsLayouts/Components/RightContent/LoginModal.tsx +3 -3
- package/src/components/Business/BsLayouts/Components/RightContent/index.tsx +5 -6
- package/src/components/Business/BsLayouts/utils.tsx +1 -24
- package/src/components/Business/JsonQueryTable/index.tsx +11 -11
- package/src/components/Business/SearchSelect/BusinessUtils.ts +2 -2
- package/src/components/Functional/AddSelect/index.tsx +41 -3
- package/src/utils/LocalstorageUtils.ts +33 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/requestUtils.ts +5 -7
package/dist/index.js
CHANGED
|
@@ -55,6 +55,7 @@ var ENUM = {
|
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
+
var resposne = JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}');
|
|
58
59
|
// 存储表头
|
|
59
60
|
var setConfigTableColumns = function setConfigTableColumns(configvalue, tableCode) {
|
|
60
61
|
var config = localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]';
|
|
@@ -86,10 +87,42 @@ var getConfigTableColumns = function getConfigTableColumns(tableCode) {
|
|
|
86
87
|
return [];
|
|
87
88
|
};
|
|
88
89
|
var getCurrentTenantId = function getCurrentTenantId() {
|
|
89
|
-
return localStorage.getItem('current_tenant_id') ||
|
|
90
|
+
return localStorage.getItem('current_tenant_id') || 1;
|
|
90
91
|
};
|
|
92
|
+
function getEmployeeId() {
|
|
93
|
+
var _resposne$employeeRes;
|
|
94
|
+
return (resposne === null || resposne === void 0 ? void 0 : (_resposne$employeeRes = resposne.employeeResVo) === null || _resposne$employeeRes === void 0 ? void 0 : _resposne$employeeRes.id) || 2;
|
|
95
|
+
}
|
|
96
|
+
function getEmployeeCode() {
|
|
97
|
+
var _resposne$employeeRes2;
|
|
98
|
+
return resposne === null || resposne === void 0 ? void 0 : (_resposne$employeeRes2 = resposne.employeeResVo) === null || _resposne$employeeRes2 === void 0 ? void 0 : _resposne$employeeRes2.employeeNumber;
|
|
99
|
+
}
|
|
100
|
+
function getSessionId() {
|
|
101
|
+
return (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
|
|
102
|
+
}
|
|
103
|
+
function getAccountId() {
|
|
104
|
+
var _resposne$accountPers;
|
|
105
|
+
return (resposne === null || resposne === void 0 ? void 0 : (_resposne$accountPers = resposne.accountPersonDetail) === null || _resposne$accountPers === void 0 ? void 0 : _resposne$accountPers.accountId) || -1;
|
|
106
|
+
}
|
|
107
|
+
function getUserId() {
|
|
108
|
+
var _resposne$accountPers2;
|
|
109
|
+
return (_resposne$accountPers2 = resposne.accountPersonDetail) === null || _resposne$accountPers2 === void 0 ? void 0 : _resposne$accountPers2.username;
|
|
110
|
+
}
|
|
111
|
+
function getAccountID() {
|
|
112
|
+
var _resposne$accountPers3;
|
|
113
|
+
return resposne === null || resposne === void 0 ? void 0 : (_resposne$accountPers3 = resposne.accountPersonDetail) === null || _resposne$accountPers3 === void 0 ? void 0 : _resposne$accountPers3.id;
|
|
114
|
+
}
|
|
115
|
+
function getUserName() {
|
|
116
|
+
var _resposne$accountPers4;
|
|
117
|
+
return resposne === null || resposne === void 0 ? void 0 : (_resposne$accountPers4 = resposne.accountPersonDetail) === null || _resposne$accountPers4 === void 0 ? void 0 : _resposne$accountPers4.employeeName;
|
|
118
|
+
}
|
|
119
|
+
function handleUserPhone() {
|
|
120
|
+
var _resposne$person;
|
|
121
|
+
var str = (resposne === null || resposne === void 0 ? void 0 : (_resposne$person = resposne.person) === null || _resposne$person === void 0 ? void 0 : _resposne$person.phone) || '';
|
|
122
|
+
var enStr = str && str.slice(0, 3) + '****' + str.slice(str.length - 4);
|
|
123
|
+
return enStr;
|
|
124
|
+
}
|
|
91
125
|
|
|
92
|
-
var resposne = JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}');
|
|
93
126
|
function handleRequestAuthHeader(config) {
|
|
94
127
|
var _config$url, _config$url2;
|
|
95
128
|
// https://www.kdocs.cn/l/coNbPpjamr5v这个表格里面涉及的接口,接口请求头里需要添加参数:x-biz-code 值就是列表里的code
|
|
@@ -105,11 +138,10 @@ function handleRequestAuthHeader(config) {
|
|
|
105
138
|
}
|
|
106
139
|
// 处理请求头
|
|
107
140
|
var handleRequestHeader = function handleRequestHeader(config) {
|
|
108
|
-
|
|
109
|
-
config.headers['
|
|
110
|
-
config.headers['x-
|
|
111
|
-
config.headers['x-
|
|
112
|
-
config.headers['x-tenant-id'] = getCurrentTenantId() || 1;
|
|
141
|
+
config.headers['sso-sessionid'] = getSessionId();
|
|
142
|
+
config.headers['x-account-id'] = getAccountId();
|
|
143
|
+
config.headers['x-employee-id'] = getEmployeeId();
|
|
144
|
+
config.headers['x-tenant-id'] = getCurrentTenantId();
|
|
113
145
|
if (localStorage.getItem('x-user-auth-context')) {
|
|
114
146
|
config.headers['x-user-auth-context'] = localStorage.getItem('x-user-auth-context');
|
|
115
147
|
}
|
|
@@ -9890,6 +9922,11 @@ var formatTreeDataSource = function formatTreeDataSource(reData, position, chang
|
|
|
9890
9922
|
}) || [];
|
|
9891
9923
|
changeSearchForm[changePosition].field.props.treeData = formatData;
|
|
9892
9924
|
};
|
|
9925
|
+
var initTableCode = {
|
|
9926
|
+
'sku': ['skuSelect-tableOptionsToChoosePartCode', 'skuSelect-tableSelectedItemPartCode'],
|
|
9927
|
+
'skc': ['skcSelect-tableOptionsToChoosePartCode', 'skcSelect-tableSelectedItemPartCode'],
|
|
9928
|
+
'spu': [['spuSelect-tableOptionsToChoosePartCode', 'spuSelect-tableSelectedItemPartCode']]
|
|
9929
|
+
};
|
|
9893
9930
|
var Option$1 = antd.Select.Option;
|
|
9894
9931
|
var AddSelect = function AddSelect(props) {
|
|
9895
9932
|
var value = props.value,
|
|
@@ -10068,8 +10105,8 @@ var AddSelect = function AddSelect(props) {
|
|
|
10068
10105
|
_useState46 = _slicedToArray(_useState45, 2),
|
|
10069
10106
|
showToChooseColumns = _useState46[0],
|
|
10070
10107
|
setShowToChooseColumns = _useState46[1];
|
|
10071
|
-
var codeToChoose = tableCodeList[0] ||
|
|
10072
|
-
var codeSelected = tableCodeList[1] ||
|
|
10108
|
+
var codeToChoose = tableCodeList[0] || initTableCode[businessType][0];
|
|
10109
|
+
var codeSelected = tableCodeList[1] || initTableCode[businessType][1];
|
|
10073
10110
|
React.useEffect(function () {
|
|
10074
10111
|
setTableColumns(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableColumns);
|
|
10075
10112
|
}, [modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableColumns]);
|
|
@@ -10500,6 +10537,28 @@ var AddSelect = function AddSelect(props) {
|
|
|
10500
10537
|
formatSource(x, 3, 6, tableSearchForm, ['id', 'name']);
|
|
10501
10538
|
});
|
|
10502
10539
|
}
|
|
10540
|
+
if (businessType == 'spu') {
|
|
10541
|
+
Promise.all([loadSelectSource("/user/orgViewNode/listNoPage", {
|
|
10542
|
+
'qp-employeeId-eq': getEmployeeId(),
|
|
10543
|
+
'qp-orgViewCode-eq': 'business-organizational-view',
|
|
10544
|
+
'ctl-withDefaultOrg': true
|
|
10545
|
+
}), loadSelectSource("/items/brand/queryBrandList", {
|
|
10546
|
+
pageSize: 5000,
|
|
10547
|
+
currentPage: 1,
|
|
10548
|
+
'ctl-withAuth': true
|
|
10549
|
+
}), loadSelectSource("/items/category/queryCategoryTree", {
|
|
10550
|
+
pageSize: 5000,
|
|
10551
|
+
currentPage: 1
|
|
10552
|
+
}), loadSelectSource("/items/class/withProperty", {
|
|
10553
|
+
pageSize: 5000,
|
|
10554
|
+
currentPage: 1
|
|
10555
|
+
})]).then(function (x) {
|
|
10556
|
+
formatSource(x, 0, 2, tableSearchForm, ['targetId', 'name']);
|
|
10557
|
+
formatSource(x, 1, 3, tableSearchForm, ['id', 'name']);
|
|
10558
|
+
formatTreeDataSource(x, 2, 4, tableSearchForm);
|
|
10559
|
+
formatSource(x, 3, 5, tableSearchForm, ['id', 'name']);
|
|
10560
|
+
});
|
|
10561
|
+
}
|
|
10503
10562
|
}, [businessType]);
|
|
10504
10563
|
React.useEffect(function () {
|
|
10505
10564
|
if (value) {
|
|
@@ -10581,7 +10640,11 @@ var AddSelect = function AddSelect(props) {
|
|
|
10581
10640
|
}
|
|
10582
10641
|
handleLoading(isContinue, false);
|
|
10583
10642
|
}).catch(function (Error) {
|
|
10584
|
-
|
|
10643
|
+
if (_typeof(Error) === 'object') {
|
|
10644
|
+
!Error.needThrowError ? null : antd.message.error(Error.message);
|
|
10645
|
+
} else {
|
|
10646
|
+
antd.message.error(Error);
|
|
10647
|
+
}
|
|
10585
10648
|
handleLoading(isContinue, false);
|
|
10586
10649
|
});
|
|
10587
10650
|
} else {
|
|
@@ -13487,7 +13550,6 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
13487
13550
|
}, modalTableBusProps);
|
|
13488
13551
|
}
|
|
13489
13552
|
if (type === 'shopFile2') {
|
|
13490
|
-
var _JSON$parse, _JSON$parse$employeeR;
|
|
13491
13553
|
requestConfig = _objectSpread2({
|
|
13492
13554
|
url: "".concat(prefixUrl.selectPrefix, "/store/page"),
|
|
13493
13555
|
filter: 'qp-name,code-orGroup,like',
|
|
@@ -13530,7 +13592,7 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
13530
13592
|
}
|
|
13531
13593
|
}];
|
|
13532
13594
|
Promise.all([loadSelectSource$1("".concat(prefixUrl.formSelectFix, "/orgView/getTree/sales-organizational-view"), {
|
|
13533
|
-
'qp-employeeCode-eq': (
|
|
13595
|
+
'qp-employeeCode-eq': getEmployeeCode(),
|
|
13534
13596
|
'qp-realOrg-eq': true,
|
|
13535
13597
|
'qp-status-eq': 10
|
|
13536
13598
|
})]).then(function (x) {
|
|
@@ -14028,6 +14090,7 @@ var AddSkuSelect = function AddSkuSelect(parProps) {
|
|
|
14028
14090
|
_useState2 = _slicedToArray(_useState, 2),
|
|
14029
14091
|
value = _useState2[0],
|
|
14030
14092
|
setValue = _useState2[1];
|
|
14093
|
+
//注⚠️:自定义过表头的请记得传tableCodeList参数
|
|
14031
14094
|
var initialSelectColumn = [{
|
|
14032
14095
|
title: 'SKU编码',
|
|
14033
14096
|
width: 150,
|
|
@@ -14365,6 +14428,7 @@ var AddSkcSelect = function AddSkcSelect(parProps) {
|
|
|
14365
14428
|
setPropertyList(data);
|
|
14366
14429
|
}).catch(function (err) {});
|
|
14367
14430
|
}, []);
|
|
14431
|
+
//注⚠️:自定义过表头的请记得传tableCodeList参数
|
|
14368
14432
|
var initialSelectColumn = [{
|
|
14369
14433
|
title: 'SKC编码',
|
|
14370
14434
|
width: 150,
|
|
@@ -14615,6 +14679,250 @@ var AddSkcSelect = function AddSkcSelect(parProps) {
|
|
|
14615
14679
|
modalTableProps: modalTableProps
|
|
14616
14680
|
})));
|
|
14617
14681
|
};
|
|
14682
|
+
var AddSpuSelect = function AddSpuSelect(parProps) {
|
|
14683
|
+
var selectProps = {
|
|
14684
|
+
mode: 'multiple'
|
|
14685
|
+
};
|
|
14686
|
+
var _useState7 = React.useState((selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode) ? [] : null),
|
|
14687
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
14688
|
+
value = _useState8[0],
|
|
14689
|
+
setValue = _useState8[1];
|
|
14690
|
+
//注⚠️:自定义过表头的请记得传tableCodeList参数
|
|
14691
|
+
var initialSelectColumn = [{
|
|
14692
|
+
title: '商品编码',
|
|
14693
|
+
width: 150,
|
|
14694
|
+
dataIndex: 'itemCode'
|
|
14695
|
+
}, {
|
|
14696
|
+
title: '商品名称',
|
|
14697
|
+
width: 200,
|
|
14698
|
+
ellipsis: {
|
|
14699
|
+
showTitle: false
|
|
14700
|
+
},
|
|
14701
|
+
render: function render(text) {
|
|
14702
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14703
|
+
placement: "topLeft",
|
|
14704
|
+
title: text
|
|
14705
|
+
}, text);
|
|
14706
|
+
},
|
|
14707
|
+
dataIndex: 'name'
|
|
14708
|
+
}, {
|
|
14709
|
+
title: '数量',
|
|
14710
|
+
width: 100,
|
|
14711
|
+
isInputItem: true,
|
|
14712
|
+
dataIndex: 'count'
|
|
14713
|
+
}, {
|
|
14714
|
+
title: '所属组织',
|
|
14715
|
+
dataIndex: 'ownOrgSignName'
|
|
14716
|
+
}, {
|
|
14717
|
+
title: '品牌',
|
|
14718
|
+
dataIndex: 'brandName'
|
|
14719
|
+
}, {
|
|
14720
|
+
title: '类目',
|
|
14721
|
+
dataIndex: 'categoryText'
|
|
14722
|
+
}, {
|
|
14723
|
+
title: '品类',
|
|
14724
|
+
dataIndex: 'className'
|
|
14725
|
+
}];
|
|
14726
|
+
var mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps);
|
|
14727
|
+
var props = {
|
|
14728
|
+
buttonText: parProps.buttonText || '新增',
|
|
14729
|
+
buttonProps: parProps.buttonProps || {},
|
|
14730
|
+
tableCodeList: parProps.tableCodeList || [],
|
|
14731
|
+
value: value,
|
|
14732
|
+
// labelInValue: true, // 非必填 默认为false
|
|
14733
|
+
requestConfig: _objectSpread2({
|
|
14734
|
+
url: "/items/item",
|
|
14735
|
+
filter: 'qp-itemCode,name-orGroup,like',
|
|
14736
|
+
otherParams: {
|
|
14737
|
+
'qp-approveStatus-eq': 1,
|
|
14738
|
+
sorter: 'desc-id'
|
|
14739
|
+
},
|
|
14740
|
+
mappingTextField: 'name',
|
|
14741
|
+
mappingValueField: 'itemCode'
|
|
14742
|
+
}, parProps.requestConfig),
|
|
14743
|
+
selectProps: selectProps,
|
|
14744
|
+
onChange: function onChange(value) {
|
|
14745
|
+
console.log(value);
|
|
14746
|
+
setValue(value);
|
|
14747
|
+
},
|
|
14748
|
+
beforeShowModal: parProps === null || parProps === void 0 ? void 0 : parProps.beforeShowModal,
|
|
14749
|
+
onSaveCallback: parProps.onSaveCallback,
|
|
14750
|
+
businessType: 'spu'
|
|
14751
|
+
// onSaveCallback: (rows) => {
|
|
14752
|
+
// console.log('save call', rows);
|
|
14753
|
+
// // return Promise.resolve(true);
|
|
14754
|
+
// // return Promise.reject('FAILE')
|
|
14755
|
+
// }
|
|
14756
|
+
};
|
|
14757
|
+
|
|
14758
|
+
var modalTableProps = {
|
|
14759
|
+
modalTableTitle: '选择商品',
|
|
14760
|
+
tableSearchForm: [{
|
|
14761
|
+
name: 'qp-itemCode-like',
|
|
14762
|
+
label: '商品编码'
|
|
14763
|
+
}, {
|
|
14764
|
+
name: 'qp-name-like',
|
|
14765
|
+
label: '商品名称'
|
|
14766
|
+
}, {
|
|
14767
|
+
name: 'qp-ownOrgSign-in',
|
|
14768
|
+
type: 'select',
|
|
14769
|
+
label: '所属组织',
|
|
14770
|
+
field: {
|
|
14771
|
+
type: 'select',
|
|
14772
|
+
props: {
|
|
14773
|
+
mode: 'multiple',
|
|
14774
|
+
notFoundContent: '暂无数据',
|
|
14775
|
+
allowClear: true,
|
|
14776
|
+
showSearch: true,
|
|
14777
|
+
showArrow: true,
|
|
14778
|
+
maxTagCount: 1,
|
|
14779
|
+
optionFilterProp: 'children',
|
|
14780
|
+
filterOption: function filterOption(input, option) {
|
|
14781
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
14782
|
+
}
|
|
14783
|
+
}
|
|
14784
|
+
}
|
|
14785
|
+
}, {
|
|
14786
|
+
name: 'qp-brandId-in',
|
|
14787
|
+
type: 'select',
|
|
14788
|
+
label: '品牌',
|
|
14789
|
+
field: {
|
|
14790
|
+
type: 'select',
|
|
14791
|
+
props: {
|
|
14792
|
+
mode: 'multiple',
|
|
14793
|
+
notFoundContent: '暂无数据',
|
|
14794
|
+
allowClear: true,
|
|
14795
|
+
showSearch: true,
|
|
14796
|
+
showArrow: true,
|
|
14797
|
+
maxTagCount: 1,
|
|
14798
|
+
optionFilterProp: 'children',
|
|
14799
|
+
filterOption: function filterOption(input, option) {
|
|
14800
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
14801
|
+
}
|
|
14802
|
+
}
|
|
14803
|
+
}
|
|
14804
|
+
}, {
|
|
14805
|
+
name: 'qp-categoryId-in',
|
|
14806
|
+
type: 'treeSelect',
|
|
14807
|
+
label: '类目',
|
|
14808
|
+
field: {
|
|
14809
|
+
type: 'treeSelect',
|
|
14810
|
+
props: {
|
|
14811
|
+
treeData: [],
|
|
14812
|
+
treeCheckable: true,
|
|
14813
|
+
showSearch: true,
|
|
14814
|
+
allowClear: true,
|
|
14815
|
+
showArrow: true,
|
|
14816
|
+
treeNodeFilterProp: 'title',
|
|
14817
|
+
treeDefaultExpandAll: true,
|
|
14818
|
+
maxTagCount: 1,
|
|
14819
|
+
placeholder: '请选择',
|
|
14820
|
+
style: {
|
|
14821
|
+
width: '100%'
|
|
14822
|
+
},
|
|
14823
|
+
dropdownStyle: {
|
|
14824
|
+
maxHeight: 400,
|
|
14825
|
+
maxWidth: 100,
|
|
14826
|
+
overflow: 'auto'
|
|
14827
|
+
}
|
|
14828
|
+
}
|
|
14829
|
+
}
|
|
14830
|
+
}, {
|
|
14831
|
+
name: 'qp-classId-in',
|
|
14832
|
+
type: 'select',
|
|
14833
|
+
label: '品类',
|
|
14834
|
+
field: {
|
|
14835
|
+
type: 'select',
|
|
14836
|
+
props: {
|
|
14837
|
+
mode: 'multiple',
|
|
14838
|
+
notFoundContent: '暂无数据',
|
|
14839
|
+
allowClear: true,
|
|
14840
|
+
showSearch: true,
|
|
14841
|
+
showArrow: true,
|
|
14842
|
+
maxTagCount: 1,
|
|
14843
|
+
optionFilterProp: 'children',
|
|
14844
|
+
filterOption: function filterOption(input, option) {
|
|
14845
|
+
return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
14846
|
+
}
|
|
14847
|
+
}
|
|
14848
|
+
}
|
|
14849
|
+
}],
|
|
14850
|
+
tableColumns: [{
|
|
14851
|
+
title: '商品编码',
|
|
14852
|
+
width: 150,
|
|
14853
|
+
dataIndex: 'itemCode'
|
|
14854
|
+
}, {
|
|
14855
|
+
title: '商品名称',
|
|
14856
|
+
width: 200,
|
|
14857
|
+
ellipsis: {
|
|
14858
|
+
showTitle: false
|
|
14859
|
+
},
|
|
14860
|
+
render: function render(text) {
|
|
14861
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14862
|
+
placement: "topLeft",
|
|
14863
|
+
title: text
|
|
14864
|
+
}, text);
|
|
14865
|
+
},
|
|
14866
|
+
dataIndex: 'name'
|
|
14867
|
+
}, {
|
|
14868
|
+
title: '所属组织',
|
|
14869
|
+
width: 100,
|
|
14870
|
+
ellipsis: {
|
|
14871
|
+
showTitle: false
|
|
14872
|
+
},
|
|
14873
|
+
render: function render(text) {
|
|
14874
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14875
|
+
placement: "topLeft",
|
|
14876
|
+
title: text
|
|
14877
|
+
}, text);
|
|
14878
|
+
},
|
|
14879
|
+
dataIndex: 'ownOrgSignName'
|
|
14880
|
+
}, {
|
|
14881
|
+
title: '品牌',
|
|
14882
|
+
width: 100,
|
|
14883
|
+
ellipsis: {
|
|
14884
|
+
showTitle: false
|
|
14885
|
+
},
|
|
14886
|
+
render: function render(text) {
|
|
14887
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14888
|
+
placement: "topLeft",
|
|
14889
|
+
title: text
|
|
14890
|
+
}, text);
|
|
14891
|
+
},
|
|
14892
|
+
dataIndex: 'brandName'
|
|
14893
|
+
}, {
|
|
14894
|
+
title: '类目',
|
|
14895
|
+
width: 100,
|
|
14896
|
+
ellipsis: {
|
|
14897
|
+
showTitle: false
|
|
14898
|
+
},
|
|
14899
|
+
render: function render(text) {
|
|
14900
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14901
|
+
placement: "topLeft",
|
|
14902
|
+
title: text
|
|
14903
|
+
}, text);
|
|
14904
|
+
},
|
|
14905
|
+
dataIndex: 'categoryName'
|
|
14906
|
+
}, {
|
|
14907
|
+
title: '品类',
|
|
14908
|
+
width: 100,
|
|
14909
|
+
ellipsis: {
|
|
14910
|
+
showTitle: false
|
|
14911
|
+
},
|
|
14912
|
+
render: function render(text) {
|
|
14913
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
14914
|
+
placement: "topLeft",
|
|
14915
|
+
title: text
|
|
14916
|
+
}, text);
|
|
14917
|
+
},
|
|
14918
|
+
dataIndex: 'className'
|
|
14919
|
+
}],
|
|
14920
|
+
selectColumn: mTpSelectColumn
|
|
14921
|
+
};
|
|
14922
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(AddSelect, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
14923
|
+
modalTableProps: modalTableProps
|
|
14924
|
+
})));
|
|
14925
|
+
};
|
|
14618
14926
|
|
|
14619
14927
|
var CommodityEntry = function CommodityEntry(props) {
|
|
14620
14928
|
var dataValidationRef = React.useRef();
|
|
@@ -18533,24 +18841,6 @@ var setMenuTreeData = function setMenuTreeData(routesData) {
|
|
|
18533
18841
|
if (_ret === "continue") continue;
|
|
18534
18842
|
}
|
|
18535
18843
|
};
|
|
18536
|
-
function handleUserID() {
|
|
18537
|
-
var _JSON$parse, _JSON$parse$accountPe;
|
|
18538
|
-
return (_JSON$parse = JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}')) === null || _JSON$parse === void 0 ? void 0 : (_JSON$parse$accountPe = _JSON$parse.accountPersonDetail) === null || _JSON$parse$accountPe === void 0 ? void 0 : _JSON$parse$accountPe.username;
|
|
18539
|
-
}
|
|
18540
|
-
function handleAccountID() {
|
|
18541
|
-
var _JSON$parse2, _JSON$parse2$accountP;
|
|
18542
|
-
return (_JSON$parse2 = JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}')) === null || _JSON$parse2 === void 0 ? void 0 : (_JSON$parse2$accountP = _JSON$parse2.accountPersonDetail) === null || _JSON$parse2$accountP === void 0 ? void 0 : _JSON$parse2$accountP.id;
|
|
18543
|
-
}
|
|
18544
|
-
function handleUserName() {
|
|
18545
|
-
var _JSON$parse3, _JSON$parse3$accountP;
|
|
18546
|
-
return (_JSON$parse3 = JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}')) === null || _JSON$parse3 === void 0 ? void 0 : (_JSON$parse3$accountP = _JSON$parse3.accountPersonDetail) === null || _JSON$parse3$accountP === void 0 ? void 0 : _JSON$parse3$accountP.employeeName;
|
|
18547
|
-
}
|
|
18548
|
-
function handleUserPhone() {
|
|
18549
|
-
var _JSON$parse4, _JSON$parse4$accountP, _JSON$parse4$accountP2;
|
|
18550
|
-
var str = ((_JSON$parse4 = JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}')) === null || _JSON$parse4 === void 0 ? void 0 : (_JSON$parse4$accountP = _JSON$parse4.accountPersonDetail) === null || _JSON$parse4$accountP === void 0 ? void 0 : (_JSON$parse4$accountP2 = _JSON$parse4$accountP.person) === null || _JSON$parse4$accountP2 === void 0 ? void 0 : _JSON$parse4$accountP2.phone) || '';
|
|
18551
|
-
var enStr = str && str.slice(0, 3) + '****' + str.slice(str.length - 4);
|
|
18552
|
-
return enStr;
|
|
18553
|
-
}
|
|
18554
18844
|
var setLoginOutPath = function setLoginOutPath() {
|
|
18555
18845
|
if (window.__POWERED_BY_WUJIE__) {
|
|
18556
18846
|
var _window$$wujie;
|
|
@@ -18937,7 +19227,7 @@ var LoginModal = (function (props) {
|
|
|
18937
19227
|
onClick: function onClick() {
|
|
18938
19228
|
form.validateFields().then(function (res) {
|
|
18939
19229
|
axios__default['default']({
|
|
18940
|
-
url: "/bop/api/account/changePassWord/".concat(
|
|
19230
|
+
url: "/bop/api/account/changePassWord/".concat(getAccountID()),
|
|
18941
19231
|
method: 'patch',
|
|
18942
19232
|
params: res
|
|
18943
19233
|
}).then(function (res) {
|
|
@@ -18957,7 +19247,7 @@ var LoginModal = (function (props) {
|
|
|
18957
19247
|
span: 20
|
|
18958
19248
|
},
|
|
18959
19249
|
initialValues: {
|
|
18960
|
-
username:
|
|
19250
|
+
username: getUserId()
|
|
18961
19251
|
}
|
|
18962
19252
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
18963
19253
|
label: "\u8D26\u53F7",
|
|
@@ -19039,21 +19329,20 @@ var GlobalHeaderRight = function GlobalHeaderRight(_ref) {
|
|
|
19039
19329
|
};
|
|
19040
19330
|
var loginOut = /*#__PURE__*/function () {
|
|
19041
19331
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
19042
|
-
var
|
|
19332
|
+
var sessionId;
|
|
19043
19333
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
19044
19334
|
while (1) {
|
|
19045
19335
|
switch (_context.prev = _context.next) {
|
|
19046
19336
|
case 0:
|
|
19047
19337
|
_context.next = 2;
|
|
19048
|
-
return
|
|
19338
|
+
return getSessionId();
|
|
19049
19339
|
case 2:
|
|
19050
|
-
|
|
19051
|
-
|
|
19052
|
-
_context.next = 6;
|
|
19340
|
+
sessionId = _context.sent;
|
|
19341
|
+
_context.next = 5;
|
|
19053
19342
|
return outLogin({
|
|
19054
19343
|
sessionId: sessionId
|
|
19055
19344
|
});
|
|
19056
|
-
case
|
|
19345
|
+
case 5:
|
|
19057
19346
|
// @ts-ignore
|
|
19058
19347
|
if (BUILD_TYPE) {
|
|
19059
19348
|
antd.message.success('退出登录成功');
|
|
@@ -19063,7 +19352,7 @@ var GlobalHeaderRight = function GlobalHeaderRight(_ref) {
|
|
|
19063
19352
|
} else {
|
|
19064
19353
|
setLoginOutPath();
|
|
19065
19354
|
}
|
|
19066
|
-
case
|
|
19355
|
+
case 6:
|
|
19067
19356
|
case "end":
|
|
19068
19357
|
return _context.stop();
|
|
19069
19358
|
}
|
|
@@ -19088,7 +19377,7 @@ var GlobalHeaderRight = function GlobalHeaderRight(_ref) {
|
|
|
19088
19377
|
src: Morentouxiang32
|
|
19089
19378
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19090
19379
|
className: 'userDownTopC'
|
|
19091
|
-
},
|
|
19380
|
+
}, getUserName()), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19092
19381
|
className: 'userDownTopB'
|
|
19093
19382
|
}, handleUserPhone())), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19094
19383
|
className: 'userDownB'
|
|
@@ -19123,7 +19412,7 @@ var GlobalHeaderRight = function GlobalHeaderRight(_ref) {
|
|
|
19123
19412
|
className: 'rcom_c'
|
|
19124
19413
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19125
19414
|
className: 'rcom_ct'
|
|
19126
|
-
},
|
|
19415
|
+
}, getUserName()), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19127
19416
|
className: 'rcom_cb'
|
|
19128
19417
|
}, handleUserPhone())), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19129
19418
|
className: 'rcom_r'
|
|
@@ -30344,8 +30633,7 @@ function hanleCallbackValue(codeProps, value, customerFields) {
|
|
|
30344
30633
|
return newCodeProps;
|
|
30345
30634
|
}
|
|
30346
30635
|
function isAdmin() {
|
|
30347
|
-
var
|
|
30348
|
-
var username = (_JSON$parse = JSON.parse(localStorage.getItem('userInfo') || '{}')) === null || _JSON$parse === void 0 ? void 0 : (_JSON$parse$accountPe = _JSON$parse.accountPersonDetail) === null || _JSON$parse$accountPe === void 0 ? void 0 : _JSON$parse$accountPe.username;
|
|
30636
|
+
var username = getUserId();
|
|
30349
30637
|
return username === 'admin' || username === 'uiuiui';
|
|
30350
30638
|
}
|
|
30351
30639
|
var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props) {
|
|
@@ -30477,6 +30765,7 @@ var JsonQueryTable = /*#__PURE__*/React__default['default'].memo(function (props
|
|
|
30477
30765
|
exports.AddSelect = AddSelect;
|
|
30478
30766
|
exports.AddSkcSelect = AddSkcSelect;
|
|
30479
30767
|
exports.AddSkuSelect = AddSkuSelect;
|
|
30768
|
+
exports.AddSpuSelect = AddSpuSelect;
|
|
30480
30769
|
exports.BillEntry = BillEntry;
|
|
30481
30770
|
exports.BsLayout = index$5;
|
|
30482
30771
|
exports.BsSulaQueryTable = BsSulaQueryTable;
|
|
@@ -4,5 +4,13 @@ export declare const saveTenantList: (data: any) => void;
|
|
|
4
4
|
export declare const getTenantList: () => any;
|
|
5
5
|
export declare const removeTenantList: () => void;
|
|
6
6
|
export declare const saveCurrentTenantId: (item: string) => void;
|
|
7
|
-
export declare const getCurrentTenantId: () => string;
|
|
7
|
+
export declare const getCurrentTenantId: () => string | 1;
|
|
8
8
|
export declare const removeCurrentTenantId: () => void;
|
|
9
|
+
export declare function getEmployeeId(): any;
|
|
10
|
+
export declare function getEmployeeCode(): any;
|
|
11
|
+
export declare function getSessionId(): any;
|
|
12
|
+
export declare function getAccountId(): any;
|
|
13
|
+
export declare function getUserId(): any;
|
|
14
|
+
export declare function getAccountID(): any;
|
|
15
|
+
export declare function getUserName(): any;
|
|
16
|
+
export declare function handleUserPhone(): any;
|
package/dist/utils/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -9,9 +9,11 @@ title: 商品档案录入器
|
|
|
9
9
|
order: 1
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
#
|
|
12
|
+
# 商品选择录入器
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## AddSkuSelect
|
|
15
|
+
|
|
16
|
+
### SKU选择录入器
|
|
15
17
|
|
|
16
18
|
```tsx
|
|
17
19
|
import React, { useState } from 'react';
|
|
@@ -61,9 +63,9 @@ export default () => {
|
|
|
61
63
|
};
|
|
62
64
|
```
|
|
63
65
|
|
|
64
|
-
|
|
66
|
+
## AddSkcSelect
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
### SKC选择录入器
|
|
67
69
|
|
|
68
70
|
```tsx
|
|
69
71
|
import React, { useState } from 'react';
|
|
@@ -91,3 +93,37 @@ export default () => {
|
|
|
91
93
|
);
|
|
92
94
|
};
|
|
93
95
|
```
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## AddSpuSelect
|
|
99
|
+
|
|
100
|
+
### SPU选择录入器
|
|
101
|
+
|
|
102
|
+
```tsx
|
|
103
|
+
import React, { useState } from 'react';
|
|
104
|
+
import { Tabs } from 'antd';
|
|
105
|
+
import { AddSpuSelect } from '../../../index.ts';
|
|
106
|
+
|
|
107
|
+
export default () => {
|
|
108
|
+
const config = {
|
|
109
|
+
buttonText: 'context',
|
|
110
|
+
buttonProps: { disabled: false },
|
|
111
|
+
exceptColumns: ['count', 'categoryText', 'className'],
|
|
112
|
+
tableCodeList: [null,'spuSelect-tableSelectedItemPartCode_ItemLabel'],
|
|
113
|
+
beforeShowModal: () => {
|
|
114
|
+
return Promise.resolve(true);
|
|
115
|
+
// return Promise.reject('校验有误');
|
|
116
|
+
},
|
|
117
|
+
onSaveCallback: (rows) => {
|
|
118
|
+
console.log('save call', rows);
|
|
119
|
+
return Promise.resolve(true);
|
|
120
|
+
// return Promise.reject('FAILE')
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return (
|
|
124
|
+
<div>
|
|
125
|
+
<AddSpuSelect {...config} />
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
129
|
+
```
|