@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
|
@@ -39,6 +39,7 @@ export const AddSkuSelect = (parProps: any) => {
|
|
|
39
39
|
mode: 'multiple',
|
|
40
40
|
}
|
|
41
41
|
const [value, setValue] = useState(selectProps?.mode ? [] : null);
|
|
42
|
+
//注⚠️:自定义过表头的请记得传tableCodeList参数
|
|
42
43
|
const initialSelectColumn = [
|
|
43
44
|
{
|
|
44
45
|
title: 'SKU编码',
|
|
@@ -365,6 +366,7 @@ export const AddSkcSelect = (parProps: any) => {
|
|
|
365
366
|
}).catch((err) => {});
|
|
366
367
|
},[])
|
|
367
368
|
|
|
369
|
+
//注⚠️:自定义过表头的请记得传tableCodeList参数
|
|
368
370
|
const initialSelectColumn = [
|
|
369
371
|
{
|
|
370
372
|
title: 'SKC编码',
|
|
@@ -600,3 +602,234 @@ export const AddSkcSelect = (parProps: any) => {
|
|
|
600
602
|
</div>
|
|
601
603
|
);
|
|
602
604
|
};
|
|
605
|
+
|
|
606
|
+
export const AddSpuSelect = (parProps: any) => {
|
|
607
|
+
const selectProps = {
|
|
608
|
+
mode: 'multiple',
|
|
609
|
+
}
|
|
610
|
+
const [value, setValue] = useState(selectProps?.mode ? [] : null);
|
|
611
|
+
//注⚠️:自定义过表头的请记得传tableCodeList参数
|
|
612
|
+
const initialSelectColumn = [
|
|
613
|
+
{
|
|
614
|
+
title: '商品编码',
|
|
615
|
+
width: 150,
|
|
616
|
+
dataIndex: 'itemCode',
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
title: '商品名称',
|
|
620
|
+
width: 200,
|
|
621
|
+
ellipsis: {
|
|
622
|
+
showTitle: false,
|
|
623
|
+
},
|
|
624
|
+
render: (text: any) => (
|
|
625
|
+
<Tooltip placement="topLeft" title={text}>
|
|
626
|
+
{text}
|
|
627
|
+
</Tooltip>
|
|
628
|
+
),
|
|
629
|
+
dataIndex: 'name',
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
title: '数量',
|
|
633
|
+
width: 100,
|
|
634
|
+
isInputItem: true,
|
|
635
|
+
dataIndex: 'count',
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
title: '所属组织',
|
|
639
|
+
dataIndex: 'ownOrgSignName',
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
title: '品牌',
|
|
643
|
+
dataIndex: 'brandName',
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
title: '类目',
|
|
647
|
+
dataIndex: 'categoryText',
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
title: '品类',
|
|
651
|
+
dataIndex: 'className',
|
|
652
|
+
},
|
|
653
|
+
]
|
|
654
|
+
const mTpSelectColumn = handleSelectColumn(initialSelectColumn, parProps)
|
|
655
|
+
const props = {
|
|
656
|
+
buttonText: parProps.buttonText || '新增',
|
|
657
|
+
buttonProps: parProps.buttonProps || {},
|
|
658
|
+
tableCodeList: parProps.tableCodeList || [],
|
|
659
|
+
value,
|
|
660
|
+
// labelInValue: true, // 非必填 默认为false
|
|
661
|
+
requestConfig: {
|
|
662
|
+
url: `/items/item`,
|
|
663
|
+
filter: 'qp-itemCode,name-orGroup,like', // 过滤参数
|
|
664
|
+
otherParams: {
|
|
665
|
+
'qp-approveStatus-eq': 1, // 审核状态(0.待审批;1.审批通过;2.驳回;3.审批未通过)
|
|
666
|
+
sorter: 'desc-id'
|
|
667
|
+
}, // 默认参数
|
|
668
|
+
mappingTextField: 'name',
|
|
669
|
+
mappingValueField: 'itemCode',
|
|
670
|
+
...parProps.requestConfig
|
|
671
|
+
},
|
|
672
|
+
selectProps,
|
|
673
|
+
onChange: (value: any) => {
|
|
674
|
+
console.log(value)
|
|
675
|
+
setValue(value)
|
|
676
|
+
},
|
|
677
|
+
beforeShowModal: parProps?.beforeShowModal,
|
|
678
|
+
onSaveCallback: parProps.onSaveCallback,
|
|
679
|
+
businessType: 'spu',
|
|
680
|
+
// onSaveCallback: (rows) => {
|
|
681
|
+
// console.log('save call', rows);
|
|
682
|
+
// // return Promise.resolve(true);
|
|
683
|
+
// // return Promise.reject('FAILE')
|
|
684
|
+
// }
|
|
685
|
+
};
|
|
686
|
+
const modalTableProps = {
|
|
687
|
+
modalTableTitle: '选择商品',
|
|
688
|
+
tableSearchForm: [
|
|
689
|
+
{ name: 'qp-itemCode-like', label: '商品编码' },
|
|
690
|
+
{ name: 'qp-name-like', label: '商品名称' },
|
|
691
|
+
{ name: 'qp-ownOrgSign-in', type: 'select', label: '所属组织', field: {
|
|
692
|
+
type: 'select',
|
|
693
|
+
props: {
|
|
694
|
+
mode: 'multiple',
|
|
695
|
+
notFoundContent: '暂无数据',
|
|
696
|
+
allowClear: true,
|
|
697
|
+
showSearch: true,
|
|
698
|
+
showArrow: true,
|
|
699
|
+
maxTagCount: 1,
|
|
700
|
+
optionFilterProp: 'children',
|
|
701
|
+
filterOption: (input: string, option: { props: { children: string } }) =>
|
|
702
|
+
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
703
|
+
},
|
|
704
|
+
} },
|
|
705
|
+
{ name: 'qp-brandId-in', type: 'select', label: '品牌', field: {
|
|
706
|
+
type: 'select',
|
|
707
|
+
props: {
|
|
708
|
+
mode: 'multiple',
|
|
709
|
+
notFoundContent: '暂无数据',
|
|
710
|
+
allowClear: true,
|
|
711
|
+
showSearch: true,
|
|
712
|
+
showArrow: true,
|
|
713
|
+
maxTagCount: 1,
|
|
714
|
+
optionFilterProp: 'children',
|
|
715
|
+
filterOption: (input: string, option: { props: { children: string } }) =>
|
|
716
|
+
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
717
|
+
},
|
|
718
|
+
} },
|
|
719
|
+
{ name: 'qp-categoryId-in', type: 'treeSelect', label: '类目', field: {
|
|
720
|
+
type: 'treeSelect',
|
|
721
|
+
props: {
|
|
722
|
+
treeData: [],
|
|
723
|
+
treeCheckable: true,
|
|
724
|
+
showSearch: true,
|
|
725
|
+
allowClear: true,
|
|
726
|
+
showArrow: true,
|
|
727
|
+
treeNodeFilterProp: 'title',
|
|
728
|
+
treeDefaultExpandAll: true,
|
|
729
|
+
maxTagCount: 1,
|
|
730
|
+
placeholder: '请选择',
|
|
731
|
+
style: {
|
|
732
|
+
width: '100%',
|
|
733
|
+
},
|
|
734
|
+
dropdownStyle: { maxHeight: 400, maxWidth: 100, overflow: 'auto' }
|
|
735
|
+
},
|
|
736
|
+
} },
|
|
737
|
+
{ name: 'qp-classId-in', type: 'select', label: '品类', field: {
|
|
738
|
+
type: 'select',
|
|
739
|
+
props: {
|
|
740
|
+
mode: 'multiple',
|
|
741
|
+
notFoundContent: '暂无数据',
|
|
742
|
+
allowClear: true,
|
|
743
|
+
showSearch: true,
|
|
744
|
+
showArrow: true,
|
|
745
|
+
maxTagCount: 1,
|
|
746
|
+
optionFilterProp: 'children',
|
|
747
|
+
filterOption: (input: string, option: { props: { children: string } }) =>
|
|
748
|
+
option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0,
|
|
749
|
+
},
|
|
750
|
+
} },
|
|
751
|
+
],
|
|
752
|
+
tableColumns: [
|
|
753
|
+
{
|
|
754
|
+
title: '商品编码',
|
|
755
|
+
width: 150,
|
|
756
|
+
dataIndex: 'itemCode',
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
title: '商品名称',
|
|
760
|
+
width: 200,
|
|
761
|
+
ellipsis: {
|
|
762
|
+
showTitle: false,
|
|
763
|
+
},
|
|
764
|
+
render: (text: any) => (
|
|
765
|
+
<Tooltip placement="topLeft" title={text}>
|
|
766
|
+
{text}
|
|
767
|
+
</Tooltip>
|
|
768
|
+
),
|
|
769
|
+
dataIndex: 'name',
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
title: '所属组织',
|
|
773
|
+
width: 100,
|
|
774
|
+
ellipsis: {
|
|
775
|
+
showTitle: false,
|
|
776
|
+
},
|
|
777
|
+
render: (text: any) => (
|
|
778
|
+
<Tooltip placement="topLeft" title={text}>
|
|
779
|
+
{text}
|
|
780
|
+
</Tooltip>
|
|
781
|
+
),
|
|
782
|
+
dataIndex: 'ownOrgSignName',
|
|
783
|
+
},
|
|
784
|
+
{
|
|
785
|
+
title: '品牌',
|
|
786
|
+
width: 100,
|
|
787
|
+
ellipsis: {
|
|
788
|
+
showTitle: false,
|
|
789
|
+
},
|
|
790
|
+
render: (text: any) => (
|
|
791
|
+
<Tooltip placement="topLeft" title={text}>
|
|
792
|
+
{text}
|
|
793
|
+
</Tooltip>
|
|
794
|
+
),
|
|
795
|
+
dataIndex: 'brandName',
|
|
796
|
+
},
|
|
797
|
+
{
|
|
798
|
+
title: '类目',
|
|
799
|
+
width: 100,
|
|
800
|
+
ellipsis: {
|
|
801
|
+
showTitle: false,
|
|
802
|
+
},
|
|
803
|
+
render: (text: any) => (
|
|
804
|
+
<Tooltip placement="topLeft" title={text}>
|
|
805
|
+
{text}
|
|
806
|
+
</Tooltip>
|
|
807
|
+
),
|
|
808
|
+
dataIndex: 'categoryName',
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
title: '品类',
|
|
812
|
+
width: 100,
|
|
813
|
+
ellipsis: {
|
|
814
|
+
showTitle: false,
|
|
815
|
+
},
|
|
816
|
+
render: (text: any) => (
|
|
817
|
+
<Tooltip placement="topLeft" title={text}>
|
|
818
|
+
{text}
|
|
819
|
+
</Tooltip>
|
|
820
|
+
),
|
|
821
|
+
dataIndex: 'className',
|
|
822
|
+
},
|
|
823
|
+
],
|
|
824
|
+
selectColumn: mTpSelectColumn
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
return (
|
|
828
|
+
<div>
|
|
829
|
+
<AddSelect
|
|
830
|
+
{...props}
|
|
831
|
+
modalTableProps={modalTableProps}
|
|
832
|
+
/>
|
|
833
|
+
</div>
|
|
834
|
+
);
|
|
835
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Form, Input, Button, Modal } from 'antd';
|
|
4
|
-
import {
|
|
4
|
+
import { getAccountID, getUserId } from '@/utils/LocalstorageUtils';
|
|
5
5
|
import axios from 'axios';
|
|
6
6
|
|
|
7
7
|
export default (props: any) => {
|
|
@@ -21,7 +21,7 @@ export default (props: any) => {
|
|
|
21
21
|
onClick={() => {
|
|
22
22
|
form.validateFields().then((res) => {
|
|
23
23
|
axios({
|
|
24
|
-
url: `/bop/api/account/changePassWord/${
|
|
24
|
+
url: `/bop/api/account/changePassWord/${getAccountID()}`,
|
|
25
25
|
method: 'patch',
|
|
26
26
|
params: res,
|
|
27
27
|
}).then(res => {
|
|
@@ -41,7 +41,7 @@ export default (props: any) => {
|
|
|
41
41
|
labelCol={{ span: 4 }}
|
|
42
42
|
wrapperCol={{ span: 20 }}
|
|
43
43
|
initialValues={{
|
|
44
|
-
username:
|
|
44
|
+
username: getUserId(),
|
|
45
45
|
}}
|
|
46
46
|
>
|
|
47
47
|
<Form.Item label="账号" name="username">
|
|
@@ -9,9 +9,9 @@ import Morentouxiang32 from '../../../../../assets/32.svg';
|
|
|
9
9
|
import Out from '../../../../../assets/xinglan-icon-out.png';
|
|
10
10
|
import { outLogin } from '../../service';
|
|
11
11
|
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
12
|
-
import {
|
|
12
|
+
import { setLoginOutPath } from '../../utils';
|
|
13
13
|
import LoginModal from './LoginModal';
|
|
14
|
-
import
|
|
14
|
+
import { getSessionId, getUserName, handleUserPhone } from '@/utils/LocalstorageUtils';
|
|
15
15
|
|
|
16
16
|
export type SiderTheme = 'light' | 'dark';
|
|
17
17
|
export type GlobalHeaderRightProps = {
|
|
@@ -58,8 +58,7 @@ const GlobalHeaderRight: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
|
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
const loginOut = async () => {
|
|
61
|
-
const
|
|
62
|
-
const sessionId = resposne?.sessionId || '';
|
|
61
|
+
const sessionId = await getSessionId();
|
|
63
62
|
await outLogin({ sessionId: sessionId });
|
|
64
63
|
// @ts-ignore
|
|
65
64
|
if (BUILD_TYPE) {
|
|
@@ -78,7 +77,7 @@ const GlobalHeaderRight: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
|
|
|
78
77
|
<div className={'userDownTopT'}>
|
|
79
78
|
<img style={{ width: 68, height: 68 }} src={Morentouxiang32} />
|
|
80
79
|
</div>
|
|
81
|
-
<div className={'userDownTopC'}>{
|
|
80
|
+
<div className={'userDownTopC'}>{getUserName()}</div>
|
|
82
81
|
<div className={'userDownTopB'}>{handleUserPhone()}</div>
|
|
83
82
|
</div>
|
|
84
83
|
<div className={'userDownB'}>
|
|
@@ -136,7 +135,7 @@ const GlobalHeaderRight: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
|
|
|
136
135
|
<img src={Morentouxiang} />
|
|
137
136
|
</div>
|
|
138
137
|
<div className={'rcom_c'}>
|
|
139
|
-
<div className={'rcom_ct'}>{
|
|
138
|
+
<div className={'rcom_ct'}>{getUserName()}</div>
|
|
140
139
|
<div className={'rcom_cb'}>{handleUserPhone()}</div>
|
|
141
140
|
</div>
|
|
142
141
|
<div className={'rcom_r'}>
|
|
@@ -136,29 +136,6 @@ export const setMenuTreeData = (routesData: Array<any>) => {
|
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
-
export function handleUserID() {
|
|
140
|
-
return JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}')
|
|
141
|
-
?.accountPersonDetail?.username;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export function handleAccountID() {
|
|
145
|
-
return JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}')
|
|
146
|
-
?.accountPersonDetail?.id;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export function handleUserName() {
|
|
150
|
-
return JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}')
|
|
151
|
-
?.accountPersonDetail?.employeeName;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export function handleUserPhone() {
|
|
155
|
-
const str =
|
|
156
|
-
JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}')?.accountPersonDetail
|
|
157
|
-
?.person?.phone || '';
|
|
158
|
-
const enStr = str && str.slice(0, 3) + '****' + str.slice(str.length - 4);
|
|
159
|
-
return enStr;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
139
|
export const setLoginOutPath = () => {
|
|
163
140
|
if (window.__POWERED_BY_WUJIE__) {
|
|
164
141
|
window.$wujie?.props.goToLogin();
|
|
@@ -223,4 +200,4 @@ export const encodeUrlQuery = (pathStr: any) => {
|
|
|
223
200
|
newPathStr = pathStr;
|
|
224
201
|
}
|
|
225
202
|
return newPathStr;
|
|
226
|
-
}
|
|
203
|
+
}
|
|
@@ -8,6 +8,7 @@ import axios from 'axios';
|
|
|
8
8
|
import FieldsSettingsTable from './components/FieldsSettingsTable';
|
|
9
9
|
import { isEmpty } from "lodash"
|
|
10
10
|
import './index.less';
|
|
11
|
+
import { getUserId } from '@/utils/LocalstorageUtils';
|
|
11
12
|
|
|
12
13
|
function iterFileds (fields) {
|
|
13
14
|
let filedsValue = [];
|
|
@@ -101,7 +102,7 @@ function convertFileds (fields, falltValue, faltFieldRange, containerName) {
|
|
|
101
102
|
|
|
102
103
|
function faltColumns(columns) {
|
|
103
104
|
let columnsValue = {}
|
|
104
|
-
|
|
105
|
+
|
|
105
106
|
columns.forEach(item => {
|
|
106
107
|
columnsValue[item.key] = {...item}
|
|
107
108
|
})
|
|
@@ -111,7 +112,7 @@ function faltColumns(columns) {
|
|
|
111
112
|
|
|
112
113
|
function faltCustomerFieldRange(fileds) {
|
|
113
114
|
let columnsValue = {}
|
|
114
|
-
|
|
115
|
+
|
|
115
116
|
fileds.forEach(item => {
|
|
116
117
|
columnsValue[item.name] = {...item}
|
|
117
118
|
})
|
|
@@ -163,15 +164,14 @@ function hanleCallbackValue(codeProps, value, customerFields) {
|
|
|
163
164
|
}
|
|
164
165
|
return item;
|
|
165
166
|
});
|
|
166
|
-
|
|
167
|
+
|
|
167
168
|
}
|
|
168
|
-
|
|
169
|
+
|
|
169
170
|
return newCodeProps;
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
function isAdmin() {
|
|
173
|
-
const username =
|
|
174
|
-
?.accountPersonDetail?.username;
|
|
174
|
+
const username = getUserId();
|
|
175
175
|
|
|
176
176
|
return username === 'admin' || username === 'uiuiui'
|
|
177
177
|
}
|
|
@@ -254,7 +254,7 @@ const JsonQueryTable = React.memo(props => {
|
|
|
254
254
|
moduleRelationId
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
}
|
|
257
|
+
}
|
|
258
258
|
})
|
|
259
259
|
},[]);
|
|
260
260
|
|
|
@@ -272,7 +272,7 @@ const JsonQueryTable = React.memo(props => {
|
|
|
272
272
|
React.useEffect(() => {
|
|
273
273
|
localStorage.setItem('jsonEditorVal',JSON.stringify(jsonEditorVal||{}))
|
|
274
274
|
}, [jsonEditorVal]);
|
|
275
|
-
|
|
275
|
+
|
|
276
276
|
React.useEffect(() => {
|
|
277
277
|
if (initialSetting) {
|
|
278
278
|
onClickRun(initialSetting);
|
|
@@ -282,18 +282,18 @@ const JsonQueryTable = React.memo(props => {
|
|
|
282
282
|
|
|
283
283
|
const height =
|
|
284
284
|
styleRef?.current?.clientHeight || styleRef?.current?.offsetHeight;
|
|
285
|
-
|
|
285
|
+
|
|
286
286
|
const tableParams = {
|
|
287
287
|
...moduleParams,
|
|
288
288
|
jsonEditorVal,
|
|
289
289
|
codeProps,
|
|
290
290
|
};
|
|
291
|
-
|
|
291
|
+
|
|
292
292
|
return (
|
|
293
293
|
<div>
|
|
294
294
|
<Drawer visible={visible} width={800} onClose={() => setVisible(false)} className={'customFieldsDrawer'}>
|
|
295
295
|
<div ref={styleRef}>
|
|
296
|
-
|
|
296
|
+
|
|
297
297
|
</div>
|
|
298
298
|
{
|
|
299
299
|
isEmpty(moduleParams)?(
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
import { shopFileType, arrivalPaySupportList, sharingType, shopFile2Type } from './common';
|
|
4
4
|
import { getDictionarySource, getDictionaryTextByValue, loadSelectSource } from './utils';
|
|
5
|
-
import ENUM from '@/utils/enumConfig';
|
|
6
5
|
import { handleTextOverflow, tableColumnsImage } from '@/components/Business/BsSulaQueryTable/utils';
|
|
7
6
|
import { getSkuImg } from '@/utils/TableUtils';
|
|
7
|
+
import { getEmployeeCode } from '@/utils/LocalstorageUtils';
|
|
8
8
|
|
|
9
9
|
const hasDictSharingType = getDictionarySource('UC000013')?.length;
|
|
10
10
|
const sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType
|
|
@@ -1324,7 +1324,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
1324
1324
|
]
|
|
1325
1325
|
Promise.all([
|
|
1326
1326
|
loadSelectSource(`${prefixUrl.formSelectFix}/orgView/getTree/sales-organizational-view`, {
|
|
1327
|
-
'qp-employeeCode-eq':
|
|
1327
|
+
'qp-employeeCode-eq': getEmployeeCode(),
|
|
1328
1328
|
'qp-realOrg-eq': true,
|
|
1329
1329
|
'qp-status-eq': 10
|
|
1330
1330
|
}),
|
|
@@ -14,6 +14,7 @@ import TableColumnSetting from '@/plugin/TableColumnSetting';
|
|
|
14
14
|
import { setInitialShowColumn } from '@/plugin/TableColumnSetting/utils';
|
|
15
15
|
import { handleAntdColumnsSpecialParams, uuid } from '@/utils/utils';
|
|
16
16
|
import { getItemDefaultWidth, noEmptyArray } from '@/components/Business/columnSettingTable/utils';
|
|
17
|
+
import { getEmployeeId } from '@/utils/LocalstorageUtils';
|
|
17
18
|
|
|
18
19
|
const loadSelectSource = (url: string, params?: any) => {
|
|
19
20
|
return new Promise((resolve, reject) => {
|
|
@@ -81,6 +82,12 @@ const formatTreeDataSource = (reData: any, position: number, changePosition: num
|
|
|
81
82
|
changeSearchForm[changePosition].field.props.treeData = formatData;
|
|
82
83
|
}
|
|
83
84
|
|
|
85
|
+
const initTableCode = {
|
|
86
|
+
'sku': ['skuSelect-tableOptionsToChoosePartCode','skuSelect-tableSelectedItemPartCode'],
|
|
87
|
+
'skc': ['skcSelect-tableOptionsToChoosePartCode','skcSelect-tableSelectedItemPartCode'],
|
|
88
|
+
'spu': [['spuSelect-tableOptionsToChoosePartCode','spuSelect-tableSelectedItemPartCode']]
|
|
89
|
+
}
|
|
90
|
+
|
|
84
91
|
const { Option } = Select;
|
|
85
92
|
|
|
86
93
|
const AddSelect = (props: any) => {
|
|
@@ -170,8 +177,8 @@ const AddSelect = (props: any) => {
|
|
|
170
177
|
const [showColumns, setShowColumns] = useState([]);
|
|
171
178
|
const [tableColumns, setTableColumns] = useState([]);
|
|
172
179
|
const [showToChooseColumns, setShowToChooseColumns] = useState([]);
|
|
173
|
-
const codeToChoose = tableCodeList[0] ||
|
|
174
|
-
const codeSelected = tableCodeList[1] ||
|
|
180
|
+
const codeToChoose = tableCodeList[0] || initTableCode[businessType][0];
|
|
181
|
+
const codeSelected = tableCodeList[1] || initTableCode[businessType][1];
|
|
175
182
|
|
|
176
183
|
useEffect(() => {
|
|
177
184
|
setTableColumns(modalTableProps?.tableColumns)
|
|
@@ -637,6 +644,33 @@ const AddSelect = (props: any) => {
|
|
|
637
644
|
formatSource(x,3, 6, tableSearchForm,['id','name'])
|
|
638
645
|
})
|
|
639
646
|
}
|
|
647
|
+
if(businessType == 'spu') {
|
|
648
|
+
Promise.all([
|
|
649
|
+
loadSelectSource(`/user/orgViewNode/listNoPage`, {
|
|
650
|
+
'qp-employeeId-eq': getEmployeeId(),
|
|
651
|
+
'qp-orgViewCode-eq': 'business-organizational-view',
|
|
652
|
+
'ctl-withDefaultOrg': true,
|
|
653
|
+
}),
|
|
654
|
+
loadSelectSource(`/items/brand/queryBrandList`, {
|
|
655
|
+
pageSize: 5000,
|
|
656
|
+
currentPage: 1,
|
|
657
|
+
'ctl-withAuth': true
|
|
658
|
+
}),
|
|
659
|
+
loadSelectSource(`/items/category/queryCategoryTree`, {
|
|
660
|
+
pageSize: 5000,
|
|
661
|
+
currentPage: 1,
|
|
662
|
+
}),
|
|
663
|
+
loadSelectSource(`/items/class/withProperty`, {
|
|
664
|
+
pageSize: 5000,
|
|
665
|
+
currentPage: 1,
|
|
666
|
+
}),
|
|
667
|
+
]).then((x: any)=>{
|
|
668
|
+
formatSource(x,0, 2, tableSearchForm,['targetId','name'])
|
|
669
|
+
formatSource(x,1, 3, tableSearchForm,['id','name'])
|
|
670
|
+
formatTreeDataSource(x,2, 4, tableSearchForm)
|
|
671
|
+
formatSource(x,3, 5, tableSearchForm,['id','name'])
|
|
672
|
+
})
|
|
673
|
+
}
|
|
640
674
|
}, [businessType])
|
|
641
675
|
|
|
642
676
|
useEffect(() => {
|
|
@@ -718,7 +752,11 @@ const AddSelect = (props: any) => {
|
|
|
718
752
|
}
|
|
719
753
|
handleLoading(isContinue,false)
|
|
720
754
|
}).catch(Error => {
|
|
721
|
-
|
|
755
|
+
if(typeof Error === 'object') {
|
|
756
|
+
!Error.needThrowError ? null : message.error(Error.message)
|
|
757
|
+
} else {
|
|
758
|
+
message.error(Error);
|
|
759
|
+
}
|
|
722
760
|
handleLoading(isContinue,false)
|
|
723
761
|
})
|
|
724
762
|
} else {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import ENUM from '@/utils/enumConfig';
|
|
2
2
|
|
|
3
|
+
const resposne = JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}');
|
|
4
|
+
|
|
3
5
|
// 存储表头
|
|
4
6
|
export const setConfigTableColumns = (configvalue: any, tableCode:string) => {
|
|
5
7
|
let config = localStorage.getItem(ENUM.BROWSER_CACHE.COLUMN_CONDITION) || '[]'
|
|
@@ -50,9 +52,39 @@ export const saveCurrentTenantId = (item: string) => {
|
|
|
50
52
|
localStorage.setItem('current_tenant_id', String(item));
|
|
51
53
|
}
|
|
52
54
|
export const getCurrentTenantId = () => {
|
|
53
|
-
return localStorage.getItem('current_tenant_id') ||
|
|
55
|
+
return localStorage.getItem('current_tenant_id') || 1;
|
|
54
56
|
}
|
|
55
57
|
export const removeCurrentTenantId = () => {
|
|
56
58
|
localStorage.removeItem('current_tenant_id');
|
|
57
59
|
}
|
|
58
60
|
|
|
61
|
+
|
|
62
|
+
export function getEmployeeId() {
|
|
63
|
+
return resposne?.employeeResVo?.id || 2;
|
|
64
|
+
}
|
|
65
|
+
export function getEmployeeCode() {
|
|
66
|
+
return resposne?.employeeResVo?.employeeNumber;
|
|
67
|
+
}
|
|
68
|
+
export function getSessionId() {
|
|
69
|
+
return resposne?.sessionId || '';
|
|
70
|
+
}
|
|
71
|
+
export function getAccountId() {
|
|
72
|
+
return resposne?.accountPersonDetail?.accountId || -1;
|
|
73
|
+
}
|
|
74
|
+
export function getUserId() {
|
|
75
|
+
return resposne.accountPersonDetail?.username;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function getAccountID() {
|
|
79
|
+
return resposne?.accountPersonDetail?.id;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function getUserName() {
|
|
83
|
+
return resposne?.accountPersonDetail?.employeeName;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function handleUserPhone() {
|
|
87
|
+
const str = resposne?.person?.phone || '';
|
|
88
|
+
const enStr = str && str.slice(0, 3) + '****' + str.slice(str.length - 4);
|
|
89
|
+
return enStr;
|
|
90
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import ENUM from './enumConfig';
|
|
3
|
-
import { getCurrentTenantId } from './LocalstorageUtils';
|
|
4
|
-
|
|
5
|
-
const resposne = JSON.parse(localStorage.getItem(ENUM.BROWSER_CACHE.USER_INFO) || '{}');
|
|
3
|
+
import { getCurrentTenantId, getEmployeeId, getSessionId, getAccountId } from './LocalstorageUtils';
|
|
6
4
|
|
|
7
5
|
export function handleRequestAuthHeader(config?: any) {
|
|
8
6
|
// https://www.kdocs.cn/l/coNbPpjamr5v这个表格里面涉及的接口,接口请求头里需要添加参数:x-biz-code 值就是列表里的code
|
|
@@ -19,10 +17,10 @@ export function handleRequestAuthHeader(config?: any) {
|
|
|
19
17
|
|
|
20
18
|
// 处理请求头
|
|
21
19
|
const handleRequestHeader = (config: any) => {
|
|
22
|
-
config.headers['sso-sessionid'] =
|
|
23
|
-
config.headers['x-account-id'] =
|
|
24
|
-
config.headers['x-employee-id'] =
|
|
25
|
-
config.headers['x-tenant-id'] = getCurrentTenantId()
|
|
20
|
+
config.headers['sso-sessionid'] = getSessionId()
|
|
21
|
+
config.headers['x-account-id'] = getAccountId()
|
|
22
|
+
config.headers['x-employee-id'] = getEmployeeId()
|
|
23
|
+
config.headers['x-tenant-id'] = getCurrentTenantId()
|
|
26
24
|
if (localStorage.getItem('x-user-auth-context')) {
|
|
27
25
|
config.headers['x-user-auth-context'] = localStorage.getItem('x-user-auth-context');
|
|
28
26
|
}
|