@bit-sun/business-component 3.0.0-alpha.0 → 3.0.0-alpha.1
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
|
@@ -6817,6 +6817,16 @@ var nodeType = [{
|
|
|
6817
6817
|
text: '商店',
|
|
6818
6818
|
value: 100
|
|
6819
6819
|
}];
|
|
6820
|
+
var personDataSourceType = [{
|
|
6821
|
+
text: "平台自建",
|
|
6822
|
+
value: 10
|
|
6823
|
+
}, {
|
|
6824
|
+
text: "MDM",
|
|
6825
|
+
value: 20
|
|
6826
|
+
}, {
|
|
6827
|
+
text: "IAM",
|
|
6828
|
+
value: 30
|
|
6829
|
+
}];
|
|
6820
6830
|
|
|
6821
6831
|
var getDicData = function getDicData(dicCode) {
|
|
6822
6832
|
var dicData = {};
|
|
@@ -6896,6 +6906,7 @@ var handleDefaultPrefixUrl = function handleDefaultPrefixUrl(type) {
|
|
|
6896
6906
|
case 'salesOrg':
|
|
6897
6907
|
case 'employee2':
|
|
6898
6908
|
case 'role':
|
|
6909
|
+
case 'person':
|
|
6899
6910
|
result = '/user';
|
|
6900
6911
|
break;
|
|
6901
6912
|
case 'deliveryMode':
|
|
@@ -9108,6 +9119,53 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
9108
9119
|
}]
|
|
9109
9120
|
}, modalTableBusProps);
|
|
9110
9121
|
}
|
|
9122
|
+
// 人员选择器
|
|
9123
|
+
if (type === 'person') {
|
|
9124
|
+
requestConfig = _objectSpread2({
|
|
9125
|
+
url: "".concat(prefixUrl.selectPrefix, "/person"),
|
|
9126
|
+
filter: 'qp-code,name-orGroup,like',
|
|
9127
|
+
mappingTextField: 'name',
|
|
9128
|
+
mappingTextShowKeyField: 'code',
|
|
9129
|
+
mappingValueField: 'code',
|
|
9130
|
+
otherParams: {
|
|
9131
|
+
sorter: 'desc-id'
|
|
9132
|
+
},
|
|
9133
|
+
sourceName: 'personCode'
|
|
9134
|
+
}, requestConfigProp);
|
|
9135
|
+
tableSearchForm = [{
|
|
9136
|
+
name: 'qp-name-like',
|
|
9137
|
+
label: '姓名'
|
|
9138
|
+
}, {
|
|
9139
|
+
name: 'qp-code-like',
|
|
9140
|
+
label: '员工工号'
|
|
9141
|
+
}, {
|
|
9142
|
+
name: 'qp-phone-like',
|
|
9143
|
+
label: '手机号'
|
|
9144
|
+
}];
|
|
9145
|
+
modalTableProps = _objectSpread2({
|
|
9146
|
+
modalTableTitle: '添加人员',
|
|
9147
|
+
tableSearchForm: tableSearchForm,
|
|
9148
|
+
tableColumns: [{
|
|
9149
|
+
title: '姓名',
|
|
9150
|
+
dataIndex: 'name'
|
|
9151
|
+
}, {
|
|
9152
|
+
title: '员工工号',
|
|
9153
|
+
dataIndex: 'code'
|
|
9154
|
+
}, {
|
|
9155
|
+
title: '员工类型',
|
|
9156
|
+
dataIndex: 'dataSource',
|
|
9157
|
+
render: function render(text) {
|
|
9158
|
+
var _personDataSourceType;
|
|
9159
|
+
return (_personDataSourceType = personDataSourceType.find(function (i) {
|
|
9160
|
+
return i.value == text;
|
|
9161
|
+
})) === null || _personDataSourceType === void 0 ? void 0 : _personDataSourceType.text;
|
|
9162
|
+
}
|
|
9163
|
+
}, {
|
|
9164
|
+
title: '手机号',
|
|
9165
|
+
dataIndex: 'phone'
|
|
9166
|
+
}]
|
|
9167
|
+
}, modalTableBusProps);
|
|
9168
|
+
}
|
|
9111
9169
|
return {
|
|
9112
9170
|
modalTableProps: modalTableProps,
|
|
9113
9171
|
requestConfig: requestConfig,
|
package/dist/index.js
CHANGED
|
@@ -6839,6 +6839,16 @@ var nodeType = [{
|
|
|
6839
6839
|
text: '商店',
|
|
6840
6840
|
value: 100
|
|
6841
6841
|
}];
|
|
6842
|
+
var personDataSourceType = [{
|
|
6843
|
+
text: "平台自建",
|
|
6844
|
+
value: 10
|
|
6845
|
+
}, {
|
|
6846
|
+
text: "MDM",
|
|
6847
|
+
value: 20
|
|
6848
|
+
}, {
|
|
6849
|
+
text: "IAM",
|
|
6850
|
+
value: 30
|
|
6851
|
+
}];
|
|
6842
6852
|
|
|
6843
6853
|
var getDicData = function getDicData(dicCode) {
|
|
6844
6854
|
var dicData = {};
|
|
@@ -6918,6 +6928,7 @@ var handleDefaultPrefixUrl = function handleDefaultPrefixUrl(type) {
|
|
|
6918
6928
|
case 'salesOrg':
|
|
6919
6929
|
case 'employee2':
|
|
6920
6930
|
case 'role':
|
|
6931
|
+
case 'person':
|
|
6921
6932
|
result = '/user';
|
|
6922
6933
|
break;
|
|
6923
6934
|
case 'deliveryMode':
|
|
@@ -9130,6 +9141,53 @@ function commonFun(type, prefixUrl, requestConfigProp, modalTableBusProps) {
|
|
|
9130
9141
|
}]
|
|
9131
9142
|
}, modalTableBusProps);
|
|
9132
9143
|
}
|
|
9144
|
+
// 人员选择器
|
|
9145
|
+
if (type === 'person') {
|
|
9146
|
+
requestConfig = _objectSpread2({
|
|
9147
|
+
url: "".concat(prefixUrl.selectPrefix, "/person"),
|
|
9148
|
+
filter: 'qp-code,name-orGroup,like',
|
|
9149
|
+
mappingTextField: 'name',
|
|
9150
|
+
mappingTextShowKeyField: 'code',
|
|
9151
|
+
mappingValueField: 'code',
|
|
9152
|
+
otherParams: {
|
|
9153
|
+
sorter: 'desc-id'
|
|
9154
|
+
},
|
|
9155
|
+
sourceName: 'personCode'
|
|
9156
|
+
}, requestConfigProp);
|
|
9157
|
+
tableSearchForm = [{
|
|
9158
|
+
name: 'qp-name-like',
|
|
9159
|
+
label: '姓名'
|
|
9160
|
+
}, {
|
|
9161
|
+
name: 'qp-code-like',
|
|
9162
|
+
label: '员工工号'
|
|
9163
|
+
}, {
|
|
9164
|
+
name: 'qp-phone-like',
|
|
9165
|
+
label: '手机号'
|
|
9166
|
+
}];
|
|
9167
|
+
modalTableProps = _objectSpread2({
|
|
9168
|
+
modalTableTitle: '添加人员',
|
|
9169
|
+
tableSearchForm: tableSearchForm,
|
|
9170
|
+
tableColumns: [{
|
|
9171
|
+
title: '姓名',
|
|
9172
|
+
dataIndex: 'name'
|
|
9173
|
+
}, {
|
|
9174
|
+
title: '员工工号',
|
|
9175
|
+
dataIndex: 'code'
|
|
9176
|
+
}, {
|
|
9177
|
+
title: '员工类型',
|
|
9178
|
+
dataIndex: 'dataSource',
|
|
9179
|
+
render: function render(text) {
|
|
9180
|
+
var _personDataSourceType;
|
|
9181
|
+
return (_personDataSourceType = personDataSourceType.find(function (i) {
|
|
9182
|
+
return i.value == text;
|
|
9183
|
+
})) === null || _personDataSourceType === void 0 ? void 0 : _personDataSourceType.text;
|
|
9184
|
+
}
|
|
9185
|
+
}, {
|
|
9186
|
+
title: '手机号',
|
|
9187
|
+
dataIndex: 'phone'
|
|
9188
|
+
}]
|
|
9189
|
+
}, modalTableBusProps);
|
|
9190
|
+
}
|
|
9133
9191
|
return {
|
|
9134
9192
|
modalTableProps: modalTableProps,
|
|
9135
9193
|
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':
|