@bit-sun/business-component 2.4.18 → 2.4.19
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/SearchSelect/common.d.ts +5 -1
- package/dist/index.esm.js +58 -0
- package/dist/index.js +58 -0
- package/package.json +1 -1
- package/src/components/Business/SearchSelect/BusinessUtils.ts +49 -4
- package/src/components/Business/SearchSelect/common.ts +16 -1
- package/src/components/Business/SearchSelect/index.md +58 -1
- package/src/components/Business/SearchSelect/utils.ts +1 -1
|
@@ -30,4 +30,8 @@ declare const nodeType: {
|
|
|
30
30
|
text: string;
|
|
31
31
|
value: number;
|
|
32
32
|
}[];
|
|
33
|
-
|
|
33
|
+
declare const personDataSourceType: {
|
|
34
|
+
text: string;
|
|
35
|
+
value: number;
|
|
36
|
+
}[];
|
|
37
|
+
export { shopFileType, arrivalPaySupportList, sharingType, shopFile2Type, shopFile2Status, employeeType, orgType, nodeType, personDataSourceType };
|
package/dist/index.esm.js
CHANGED
|
@@ -6772,6 +6772,16 @@ var nodeType = [{
|
|
|
6772
6772
|
text: '商店',
|
|
6773
6773
|
value: 100
|
|
6774
6774
|
}];
|
|
6775
|
+
var personDataSourceType = [{
|
|
6776
|
+
text: "平台自建",
|
|
6777
|
+
value: 10
|
|
6778
|
+
}, {
|
|
6779
|
+
text: "MDM",
|
|
6780
|
+
value: 20
|
|
6781
|
+
}, {
|
|
6782
|
+
text: "IAM",
|
|
6783
|
+
value: 30
|
|
6784
|
+
}];
|
|
6775
6785
|
|
|
6776
6786
|
var getDicData = function getDicData(dicCode) {
|
|
6777
6787
|
var dicData = {};
|
|
@@ -6851,6 +6861,7 @@ var handleDefaultPrefixUrl = function handleDefaultPrefixUrl(type) {
|
|
|
6851
6861
|
case 'salesOrg':
|
|
6852
6862
|
case 'employee2':
|
|
6853
6863
|
case 'role':
|
|
6864
|
+
case 'person':
|
|
6854
6865
|
result = '/user';
|
|
6855
6866
|
break;
|
|
6856
6867
|
case 'deliveryMode':
|
|
@@ -9063,6 +9074,53 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
9063
9074
|
}]
|
|
9064
9075
|
}, modalTableBusProps);
|
|
9065
9076
|
}
|
|
9077
|
+
// 人员选择器
|
|
9078
|
+
if (type === 'person') {
|
|
9079
|
+
requestConfig = _objectSpread2({
|
|
9080
|
+
url: "".concat(prefixUrl.selectPrefix, "/person"),
|
|
9081
|
+
filter: 'qp-code,name-orGroup,like',
|
|
9082
|
+
mappingTextField: 'name',
|
|
9083
|
+
mappingTextShowKeyField: 'code',
|
|
9084
|
+
mappingValueField: 'code',
|
|
9085
|
+
otherParams: {
|
|
9086
|
+
sorter: 'desc-id'
|
|
9087
|
+
},
|
|
9088
|
+
sourceName: 'personCode'
|
|
9089
|
+
}, requestConfigProp);
|
|
9090
|
+
tableSearchForm = [{
|
|
9091
|
+
name: 'qp-name-like',
|
|
9092
|
+
label: '姓名'
|
|
9093
|
+
}, {
|
|
9094
|
+
name: 'qp-code-like',
|
|
9095
|
+
label: '员工工号'
|
|
9096
|
+
}, {
|
|
9097
|
+
name: 'qp-phone-like',
|
|
9098
|
+
label: '手机号'
|
|
9099
|
+
}];
|
|
9100
|
+
modalTableProps = _objectSpread2({
|
|
9101
|
+
modalTableTitle: '添加人员',
|
|
9102
|
+
tableSearchForm: tableSearchForm,
|
|
9103
|
+
tableColumns: [{
|
|
9104
|
+
title: '姓名',
|
|
9105
|
+
dataIndex: 'name'
|
|
9106
|
+
}, {
|
|
9107
|
+
title: '员工工号',
|
|
9108
|
+
dataIndex: 'code'
|
|
9109
|
+
}, {
|
|
9110
|
+
title: '员工类型',
|
|
9111
|
+
dataIndex: 'dataSource',
|
|
9112
|
+
render: function render(text) {
|
|
9113
|
+
var _personDataSourceType;
|
|
9114
|
+
return (_personDataSourceType = personDataSourceType.find(function (i) {
|
|
9115
|
+
return i.value == text;
|
|
9116
|
+
})) === null || _personDataSourceType === void 0 ? void 0 : _personDataSourceType.text;
|
|
9117
|
+
}
|
|
9118
|
+
}, {
|
|
9119
|
+
title: '手机号',
|
|
9120
|
+
dataIndex: 'phone'
|
|
9121
|
+
}]
|
|
9122
|
+
}, modalTableBusProps);
|
|
9123
|
+
}
|
|
9066
9124
|
return {
|
|
9067
9125
|
modalTableProps: modalTableProps,
|
|
9068
9126
|
requestConfig: requestConfig,
|
package/dist/index.js
CHANGED
|
@@ -6792,6 +6792,16 @@ var nodeType = [{
|
|
|
6792
6792
|
text: '商店',
|
|
6793
6793
|
value: 100
|
|
6794
6794
|
}];
|
|
6795
|
+
var personDataSourceType = [{
|
|
6796
|
+
text: "平台自建",
|
|
6797
|
+
value: 10
|
|
6798
|
+
}, {
|
|
6799
|
+
text: "MDM",
|
|
6800
|
+
value: 20
|
|
6801
|
+
}, {
|
|
6802
|
+
text: "IAM",
|
|
6803
|
+
value: 30
|
|
6804
|
+
}];
|
|
6795
6805
|
|
|
6796
6806
|
var getDicData = function getDicData(dicCode) {
|
|
6797
6807
|
var dicData = {};
|
|
@@ -6871,6 +6881,7 @@ var handleDefaultPrefixUrl = function handleDefaultPrefixUrl(type) {
|
|
|
6871
6881
|
case 'salesOrg':
|
|
6872
6882
|
case 'employee2':
|
|
6873
6883
|
case 'role':
|
|
6884
|
+
case 'person':
|
|
6874
6885
|
result = '/user';
|
|
6875
6886
|
break;
|
|
6876
6887
|
case 'deliveryMode':
|
|
@@ -9083,6 +9094,53 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
9083
9094
|
}]
|
|
9084
9095
|
}, modalTableBusProps);
|
|
9085
9096
|
}
|
|
9097
|
+
// 人员选择器
|
|
9098
|
+
if (type === 'person') {
|
|
9099
|
+
requestConfig = _objectSpread2({
|
|
9100
|
+
url: "".concat(prefixUrl.selectPrefix, "/person"),
|
|
9101
|
+
filter: 'qp-code,name-orGroup,like',
|
|
9102
|
+
mappingTextField: 'name',
|
|
9103
|
+
mappingTextShowKeyField: 'code',
|
|
9104
|
+
mappingValueField: 'code',
|
|
9105
|
+
otherParams: {
|
|
9106
|
+
sorter: 'desc-id'
|
|
9107
|
+
},
|
|
9108
|
+
sourceName: 'personCode'
|
|
9109
|
+
}, requestConfigProp);
|
|
9110
|
+
tableSearchForm = [{
|
|
9111
|
+
name: 'qp-name-like',
|
|
9112
|
+
label: '姓名'
|
|
9113
|
+
}, {
|
|
9114
|
+
name: 'qp-code-like',
|
|
9115
|
+
label: '员工工号'
|
|
9116
|
+
}, {
|
|
9117
|
+
name: 'qp-phone-like',
|
|
9118
|
+
label: '手机号'
|
|
9119
|
+
}];
|
|
9120
|
+
modalTableProps = _objectSpread2({
|
|
9121
|
+
modalTableTitle: '添加人员',
|
|
9122
|
+
tableSearchForm: tableSearchForm,
|
|
9123
|
+
tableColumns: [{
|
|
9124
|
+
title: '姓名',
|
|
9125
|
+
dataIndex: 'name'
|
|
9126
|
+
}, {
|
|
9127
|
+
title: '员工工号',
|
|
9128
|
+
dataIndex: 'code'
|
|
9129
|
+
}, {
|
|
9130
|
+
title: '员工类型',
|
|
9131
|
+
dataIndex: 'dataSource',
|
|
9132
|
+
render: function render(text) {
|
|
9133
|
+
var _personDataSourceType;
|
|
9134
|
+
return (_personDataSourceType = personDataSourceType.find(function (i) {
|
|
9135
|
+
return i.value == text;
|
|
9136
|
+
})) === null || _personDataSourceType === void 0 ? void 0 : _personDataSourceType.text;
|
|
9137
|
+
}
|
|
9138
|
+
}, {
|
|
9139
|
+
title: '手机号',
|
|
9140
|
+
dataIndex: 'phone'
|
|
9141
|
+
}]
|
|
9142
|
+
}, modalTableBusProps);
|
|
9143
|
+
}
|
|
9086
9144
|
return {
|
|
9087
9145
|
modalTableProps: modalTableProps,
|
|
9088
9146
|
requestConfig: requestConfig,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// 此文件用于 处理业务组件 所用到的公共方法
|
|
2
2
|
// @ts-nocheck
|
|
3
|
-
import { shopFileType, arrivalPaySupportList, sharingType, shopFile2Type, shopFile2Status, employeeType, orgType, nodeType } from './common';
|
|
3
|
+
import { shopFileType, arrivalPaySupportList, sharingType, shopFile2Type, shopFile2Status, employeeType, orgType, nodeType, personDataSourceType } from './common';
|
|
4
4
|
import { getDictionarySource, getDictionaryTextByValue, loadSelectSource } from './utils';
|
|
5
5
|
import { handleTextOverflow, tableColumnsImage } from '@/components/Business/BsSulaQueryTable/utils';
|
|
6
6
|
import { getSkuImg } from '@/utils/TableUtils';
|
|
@@ -1900,7 +1900,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
1900
1900
|
}
|
|
1901
1901
|
|
|
1902
1902
|
//业务组织选择器(可筛选业务职能/组织类型/组织形态)
|
|
1903
|
-
if (type === 'business-organization') {
|
|
1903
|
+
if (type === 'business-organization') {
|
|
1904
1904
|
requestConfig = {
|
|
1905
1905
|
url: `${prefixUrl.selectPrefix}/orgViewNode/common/pageList`,
|
|
1906
1906
|
filter: 'qp-name-like', // 过滤参数
|
|
@@ -1990,7 +1990,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
1990
1990
|
{
|
|
1991
1991
|
title: '组织类型',
|
|
1992
1992
|
dataIndex: 'orgType',
|
|
1993
|
-
render: (text: any) => {
|
|
1993
|
+
render: (text: any) => {
|
|
1994
1994
|
const obj = orgType.find((i: any) => i.value == text);
|
|
1995
1995
|
return obj ? obj.text : '--';
|
|
1996
1996
|
}
|
|
@@ -1998,7 +1998,7 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
1998
1998
|
{
|
|
1999
1999
|
title: '组织形态',
|
|
2000
2000
|
dataIndex: 'nodeType',
|
|
2001
|
-
render: (text: any) => {
|
|
2001
|
+
render: (text: any) => {
|
|
2002
2002
|
const obj = nodeType.find((i: any) => i.value == text);
|
|
2003
2003
|
return obj ? obj.text : '--';
|
|
2004
2004
|
}
|
|
@@ -2008,5 +2008,50 @@ export function commonFun (type?: string, prefixUrl: any, requestConfigProp?: an
|
|
|
2008
2008
|
}
|
|
2009
2009
|
}
|
|
2010
2010
|
|
|
2011
|
+
// 人员选择器
|
|
2012
|
+
if(type === 'person') {
|
|
2013
|
+
requestConfig = {
|
|
2014
|
+
url: `${prefixUrl.selectPrefix}/person`,
|
|
2015
|
+
filter: 'qp-code,name-orGroup,like', // 过滤参数
|
|
2016
|
+
mappingTextField: 'name',
|
|
2017
|
+
mappingTextShowKeyField: 'code',
|
|
2018
|
+
mappingValueField: 'code',
|
|
2019
|
+
otherParams: {
|
|
2020
|
+
sorter: 'desc-id'
|
|
2021
|
+
}, // 默认参数
|
|
2022
|
+
sourceName: 'personCode',
|
|
2023
|
+
...requestConfigProp,
|
|
2024
|
+
}
|
|
2025
|
+
tableSearchForm = [
|
|
2026
|
+
{ name: 'qp-name-like', label: '姓名' },
|
|
2027
|
+
{ name: 'qp-code-like', label: '员工工号' },
|
|
2028
|
+
{ name: 'qp-phone-like', label: '手机号' },
|
|
2029
|
+
]
|
|
2030
|
+
modalTableProps = {
|
|
2031
|
+
modalTableTitle: '添加人员',
|
|
2032
|
+
tableSearchForm,
|
|
2033
|
+
tableColumns: [
|
|
2034
|
+
{
|
|
2035
|
+
title: '姓名',
|
|
2036
|
+
dataIndex: 'name',
|
|
2037
|
+
},
|
|
2038
|
+
{
|
|
2039
|
+
title: '员工工号',
|
|
2040
|
+
dataIndex: 'code',
|
|
2041
|
+
},
|
|
2042
|
+
{
|
|
2043
|
+
title: '员工类型',
|
|
2044
|
+
dataIndex: 'dataSource',
|
|
2045
|
+
render: (text: number) => personDataSourceType.find((i: any) => i.value == text)?.text,
|
|
2046
|
+
},
|
|
2047
|
+
{
|
|
2048
|
+
title: '手机号',
|
|
2049
|
+
dataIndex: 'phone',
|
|
2050
|
+
},
|
|
2051
|
+
],
|
|
2052
|
+
...modalTableBusProps
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2011
2056
|
return { modalTableProps, requestConfig, needModalTable };
|
|
2012
2057
|
}
|
|
@@ -116,4 +116,19 @@ const nodeType = [
|
|
|
116
116
|
},
|
|
117
117
|
]
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
const personDataSourceType = [
|
|
120
|
+
{
|
|
121
|
+
text: "平台自建",
|
|
122
|
+
value: 10,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
text: "MDM",
|
|
126
|
+
value: 20,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
text: "IAM",
|
|
130
|
+
value: 30,
|
|
131
|
+
},
|
|
132
|
+
]
|
|
133
|
+
|
|
134
|
+
export { shopFileType, arrivalPaySupportList, sharingType, shopFile2Type, shopFile2Status, employeeType, orgType, nodeType, personDataSourceType }
|
|
@@ -1327,7 +1327,7 @@ export default () => {
|
|
|
1327
1327
|
};
|
|
1328
1328
|
```
|
|
1329
1329
|
|
|
1330
|
-
|
|
1330
|
+
## 角色选择器 Select-ROLE-001
|
|
1331
1331
|
|
|
1332
1332
|
```tsx
|
|
1333
1333
|
import React, { useState } from 'react';
|
|
@@ -1384,4 +1384,61 @@ export default () => {
|
|
|
1384
1384
|
};
|
|
1385
1385
|
```
|
|
1386
1386
|
|
|
1387
|
+
## 人员选择器 Select-PERSON-001
|
|
1388
|
+
|
|
1389
|
+
```tsx
|
|
1390
|
+
import React, { useState } from 'react';
|
|
1391
|
+
import { Tabs } from 'antd';
|
|
1392
|
+
import {BusinessSearchSelect} from '../../../index.ts';
|
|
1393
|
+
|
|
1394
|
+
const { TabPane } = Tabs;
|
|
1395
|
+
|
|
1396
|
+
export default () => {
|
|
1397
|
+
const selectProps = {
|
|
1398
|
+
// mode: 'multiple',
|
|
1399
|
+
// maxTagCount: 1,
|
|
1400
|
+
// disabled: true
|
|
1401
|
+
}
|
|
1402
|
+
const selectPropsMultiple = {
|
|
1403
|
+
mode: 'multiple',
|
|
1404
|
+
maxTagCount: 1,
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
const [ tabKey, setTabKey ] = useState('single')
|
|
1408
|
+
const [value, setValue] = useState(selectProps?.mode ? [] : null);
|
|
1409
|
+
|
|
1410
|
+
const props = {
|
|
1411
|
+
value,
|
|
1412
|
+
onChange: (value: any) => {
|
|
1413
|
+
console.log(value)
|
|
1414
|
+
setValue(value)
|
|
1415
|
+
},
|
|
1416
|
+
selectProps,
|
|
1417
|
+
selectBusinessType: 'person',
|
|
1418
|
+
};
|
|
1419
|
+
|
|
1420
|
+
const onTabChange = (key) => {
|
|
1421
|
+
setTabKey(key)
|
|
1422
|
+
setValue(key === 'single' ? null: [])
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
return (
|
|
1426
|
+
<div>
|
|
1427
|
+
<Tabs onChange={onTabChange} activeKey={tabKey}>
|
|
1428
|
+
<TabPane tab='单选' key='single'>
|
|
1429
|
+
{tabKey === 'single' && (
|
|
1430
|
+
<BusinessSearchSelect {...props} />
|
|
1431
|
+
)}
|
|
1432
|
+
</TabPane>
|
|
1433
|
+
<TabPane tab='多选' key='multiple'>
|
|
1434
|
+
{tabKey === 'multiple' && (
|
|
1435
|
+
<BusinessSearchSelect {...props} selectProps={selectPropsMultiple} />
|
|
1436
|
+
)}
|
|
1437
|
+
</TabPane>
|
|
1438
|
+
</Tabs>
|
|
1439
|
+
</div>
|
|
1440
|
+
);
|
|
1441
|
+
};
|
|
1442
|
+
```
|
|
1443
|
+
|
|
1387
1444
|
More skills for writing demo: https://d.umijs.org/guide/demo-principle
|
|
@@ -85,7 +85,7 @@ const handleDefaultPrefixUrl = (type: string) => {
|
|
|
85
85
|
case 'physicalWarehouse': case 'realWarehouse': case 'virtualWarehouse': case 'channelWarehouse': case 'ownerWarehouse':
|
|
86
86
|
result = '/stock';
|
|
87
87
|
break;
|
|
88
|
-
case 'inventoryOrg2': case 'purchaseOrg': case 'salesOrg': case 'employee2': case 'role':
|
|
88
|
+
case 'inventoryOrg2': case 'purchaseOrg': case 'salesOrg': case 'employee2': case 'role': case 'person':
|
|
89
89
|
result = '/user';
|
|
90
90
|
break;
|
|
91
91
|
case 'deliveryMode': case 'ruleTemplate':
|