@bit-sun/business-component 1.2.1 → 2.0.0
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/.umirc.ts +31 -16
- package/dist/components/Business/SearchSelect/BusinessUtils.d.ts +1 -1
- package/dist/components/Business/SearchSelect/common.d.ts +5 -1
- package/dist/components/Business/SearchSelect/utils.d.ts +2 -1
- package/dist/components/Functional/DataImport/index.d.ts +144 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +823 -25
- package/dist/index.js +823 -24
- package/package.json +1 -1
- package/src/components/Business/SearchSelect/BusinessUtils.ts +83 -6
- package/src/components/Business/SearchSelect/common.ts +20 -1
- package/src/components/Business/SearchSelect/index.md +60 -30
- package/src/components/Business/SearchSelect/index.tsx +2 -1
- package/src/components/Business/SearchSelect/utils.ts +27 -2
- package/src/components/Functional/DataImport/index.less +63 -0
- package/src/components/Functional/DataImport/index.md +44 -0
- package/src/components/Functional/DataImport/index.tsx +690 -0
- package/src/components/Functional/SearchSelect/index.tsx +24 -7
- package/src/index.ts +2 -0
|
@@ -7,7 +7,7 @@ import axios from 'axios';
|
|
|
7
7
|
import { stringify } from 'querystring';
|
|
8
8
|
import _ from "loadsh"
|
|
9
9
|
import './index.less';
|
|
10
|
-
import { BusinessSearchSelect } from '@/index';
|
|
10
|
+
import { BusinessSearchSelect, QueryMutipleInput } from '@/index';
|
|
11
11
|
|
|
12
12
|
const { Option } = Select;
|
|
13
13
|
|
|
@@ -33,6 +33,7 @@ const SearchSelect = (props: any) => {
|
|
|
33
33
|
const tableInitPageSize = 10 // 弹框默认分页 条数
|
|
34
34
|
const currentPage = 1
|
|
35
35
|
const selectParamsKey = requestConfig?.filter || 'qp-codeAndName-like'
|
|
36
|
+
const selectParamsInitKey = requestConfig?.filterInit || selectParamsKey
|
|
36
37
|
const currentSelectProps = {
|
|
37
38
|
...selectProps,
|
|
38
39
|
// 以下属性不可更改----设计配置项
|
|
@@ -57,7 +58,7 @@ const SearchSelect = (props: any) => {
|
|
|
57
58
|
// 优化搜索参数 支持传多个
|
|
58
59
|
let searchParams = {};
|
|
59
60
|
if(typeof selectParamsKey === 'string') {
|
|
60
|
-
searchParams = { [
|
|
61
|
+
searchParams = v ? { [selectParamsInitKey]: initVal } : { [selectParamsKey]: searchValue }
|
|
61
62
|
}
|
|
62
63
|
if(Array.isArray(selectParamsKey)) {
|
|
63
64
|
selectParamsKey.forEach((i: any) => {
|
|
@@ -205,7 +206,7 @@ const SearchSelect = (props: any) => {
|
|
|
205
206
|
.then((result: any) => {
|
|
206
207
|
setFetching(false)
|
|
207
208
|
result = result.data;
|
|
208
|
-
if (result.status !== '0') {
|
|
209
|
+
if ((result?.status && result.status !== '0') || (result?.code && result.code !== '000000')) {
|
|
209
210
|
message.error(result.msg);
|
|
210
211
|
return;
|
|
211
212
|
}
|
|
@@ -310,7 +311,6 @@ const SearchSelect = (props: any) => {
|
|
|
310
311
|
useEffect(() => {
|
|
311
312
|
if(value) {
|
|
312
313
|
setPopValue(value);
|
|
313
|
-
onChange(value);
|
|
314
314
|
}
|
|
315
315
|
}, [value]);
|
|
316
316
|
|
|
@@ -356,7 +356,7 @@ const SearchSelect = (props: any) => {
|
|
|
356
356
|
|
|
357
357
|
const formaData = (value) => {
|
|
358
358
|
if(labelInValue) {
|
|
359
|
-
const formatResult = value.map((i: any) => ({ key: i
|
|
359
|
+
const formatResult = value.map((i: any) => ({ key: i[mappingValueField], label: i[mappingTextField], value: i[mappingValueField] }))
|
|
360
360
|
onChange(selectMode ? formatResult : formatResult[0])
|
|
361
361
|
} else {
|
|
362
362
|
const formatResult = selectMode ? value.map((i: any) => i.value) : _.get(value[0], 'value')
|
|
@@ -511,6 +511,9 @@ const SearchSelect = (props: any) => {
|
|
|
511
511
|
onChange: (sks, srs) => {
|
|
512
512
|
onChangeSelectedKeys(sks, srs)
|
|
513
513
|
},
|
|
514
|
+
getCheckboxProps: () => ({
|
|
515
|
+
disabled: selectProps?.disabled || props?.disabled,
|
|
516
|
+
}),
|
|
514
517
|
};
|
|
515
518
|
|
|
516
519
|
const onDoubleClickSelect = (e, record) => {
|
|
@@ -546,7 +549,7 @@ const SearchSelect = (props: any) => {
|
|
|
546
549
|
)
|
|
547
550
|
}
|
|
548
551
|
|
|
549
|
-
if(i?.type === 'businessSearchSelect') {
|
|
552
|
+
if(i?.type === 'businessSearchSelect' || i?.field?.type === 'businessSearchSelect') {
|
|
550
553
|
return (
|
|
551
554
|
<div>
|
|
552
555
|
<Form.Item name={i.name} label={i.label} key={i.name}>
|
|
@@ -556,6 +559,20 @@ const SearchSelect = (props: any) => {
|
|
|
556
559
|
)
|
|
557
560
|
}
|
|
558
561
|
|
|
562
|
+
if (i?.type === 'multipleQueryInput' || i?.field?.type === 'multipleQueryInput') {
|
|
563
|
+
return (
|
|
564
|
+
<div>
|
|
565
|
+
<Form.Item name={i.name} label={i.label} key={i.name}>
|
|
566
|
+
<QueryMutipleInput onValueChange={(value) => {
|
|
567
|
+
form.setFieldsValue({
|
|
568
|
+
[i.name]: value
|
|
569
|
+
})
|
|
570
|
+
}} />
|
|
571
|
+
</Form.Item>
|
|
572
|
+
</div>
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
|
|
559
576
|
// 默认type是input
|
|
560
577
|
return (
|
|
561
578
|
<Form.Item name={i.name} label={i.label} key={i.name}>
|
|
@@ -702,7 +719,7 @@ const SearchSelect = (props: any) => {
|
|
|
702
719
|
};
|
|
703
720
|
}}
|
|
704
721
|
/>
|
|
705
|
-
{selectMode ? <div className={'select_list_selectAll'}><Checkbox indeterminate={indeterminate} checked={checkedAll} onChange={onChangeCheckAll} /> 全选所有页面</div> : ''}
|
|
722
|
+
{selectMode ? <div className={'select_list_selectAll'}><Checkbox indeterminate={indeterminate} checked={checkedAll} onChange={onChangeCheckAll} disabled={selectProps?.disabled || props?.disabled} /> 全选所有页面</div> : ''}
|
|
706
723
|
</div>
|
|
707
724
|
</div>
|
|
708
725
|
</div>
|
package/src/index.ts
CHANGED
|
@@ -12,8 +12,10 @@ import axios from 'axios';
|
|
|
12
12
|
const resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
|
|
13
13
|
|
|
14
14
|
axios.defaults.headers.common['sso-sessionid'] = resposne?.sessionId || '';
|
|
15
|
+
axios.defaults.headers.common['x-tenant-id'] = resposne?.tenantId || '1';
|
|
15
16
|
|
|
16
17
|
export { default as DataValidation } from './components/Functional/DataValidation';
|
|
18
|
+
export { default as DataImport } from './components/Functional/DataImport';
|
|
17
19
|
export { default as QueryMutipleInput } from './components/Functional/QueryMutipleInput';
|
|
18
20
|
export { default as SearchSelect } from './components/Functional/SearchSelect';
|
|
19
21
|
export { default as BusinessSearchSelect } from './components/Business/SearchSelect';
|