@bit-sun/business-component 2.2.20 → 2.2.22
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/JsonQueryTable/static.d.ts +2 -0
- package/dist/index.esm.js +83 -42
- package/dist/index.js +83 -42
- package/package.json +1 -1
- package/src/assets/arrow_top.svg +18 -0
- package/src/components/Business/CommonGuideWrapper/index.less +3 -1
- package/src/components/Business/CommonGuideWrapper/index.tsx +3 -3
- package/src/components/Business/JsonQueryTable/static.ts +35 -1
- package/src/components/Business/StateFlow/index.less +49 -28
- package/src/components/Business/StateFlow/index.md +5 -5
- package/src/components/Business/StateFlow/index.tsx +18 -15
- package/src/components/Business/TreeSearchSelect/index.md +29 -1
- package/src/components/Business/TreeSearchSelect/utils.ts +9 -0
- package/src/components/Functional/TreeSearchSelect/index.tsx +7 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.form-status-label {
|
|
2
|
-
height:
|
|
3
|
-
margin-right:
|
|
2
|
+
height: 38px;
|
|
3
|
+
margin-right: 7px;
|
|
4
4
|
// flex-grow: 1;
|
|
5
5
|
// flex-shrink: 1;
|
|
6
6
|
display: inline-block;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
align-items: center;
|
|
10
10
|
}
|
|
11
11
|
.choosed-status-label.form-status-label {
|
|
12
|
-
background-color: #
|
|
12
|
+
background-color: #68C900;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.form-status-label:last-child {
|
|
@@ -20,21 +20,23 @@
|
|
|
20
20
|
position: absolute;
|
|
21
21
|
display: block;
|
|
22
22
|
content: '';
|
|
23
|
-
right: -
|
|
23
|
+
right: -38px;
|
|
24
24
|
top: 0;
|
|
25
|
-
width:
|
|
26
|
-
height:
|
|
27
|
-
border:
|
|
25
|
+
width: 38px;
|
|
26
|
+
height: 38px;
|
|
27
|
+
border: 19px solid;
|
|
28
28
|
border-color: transparent transparent transparent transparent;
|
|
29
29
|
border-left: 12px solid #B0B4B7;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
.choosed-status-label.form-status-label::after {
|
|
33
|
-
border-left: 12px solid #
|
|
33
|
+
border-left: 12px solid #68C900;
|
|
34
|
+
z-index: 9;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
.choosed-status-label.form-status-label:not(:first-child):not(:last-child)::after {
|
|
37
|
-
border-left: 12px solid #
|
|
38
|
+
border-left: 12px solid #68C900;
|
|
39
|
+
z-index: 10;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
.form-status-label:last-child::after {
|
|
@@ -43,9 +45,9 @@
|
|
|
43
45
|
content: '';
|
|
44
46
|
left: 0;
|
|
45
47
|
top: 0;
|
|
46
|
-
width:
|
|
47
|
-
height:
|
|
48
|
-
border:
|
|
48
|
+
width: 38px;
|
|
49
|
+
height: 38px;
|
|
50
|
+
border: 19px solid;
|
|
49
51
|
border-color: transparent transparent transparent transparent;
|
|
50
52
|
border-left: 12px solid #ffffff;
|
|
51
53
|
}
|
|
@@ -56,9 +58,9 @@
|
|
|
56
58
|
content: '';
|
|
57
59
|
left: 0;
|
|
58
60
|
top: 0;
|
|
59
|
-
width:
|
|
60
|
-
height:
|
|
61
|
-
border:
|
|
61
|
+
width: 38px;
|
|
62
|
+
height: 38px;
|
|
63
|
+
border: 19px solid;
|
|
62
64
|
border-color: transparent transparent transparent transparent;
|
|
63
65
|
border-left: 12px solid #ffffff;
|
|
64
66
|
}
|
|
@@ -67,26 +69,44 @@
|
|
|
67
69
|
position: absolute;
|
|
68
70
|
display: block;
|
|
69
71
|
content: '';
|
|
70
|
-
right: -
|
|
72
|
+
right: -38px;
|
|
71
73
|
top: 0;
|
|
72
|
-
width:
|
|
73
|
-
height:
|
|
74
|
-
border:
|
|
74
|
+
width: 38px;
|
|
75
|
+
height: 38px;
|
|
76
|
+
border: 19px solid;
|
|
75
77
|
border-color: transparent transparent transparent transparent;
|
|
76
78
|
border-left: 12px solid #B0B4B7;
|
|
79
|
+
z-index: 9;
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
.status-label-index {
|
|
80
83
|
display: inline-block;
|
|
81
|
-
width:
|
|
82
|
-
height:
|
|
84
|
+
width: 16px;
|
|
85
|
+
height: 16px;
|
|
86
|
+
// border: 1px solid #FFFFFF;
|
|
87
|
+
// color: #FFFFFF;
|
|
88
|
+
background: #FFFFFF;
|
|
89
|
+
color: #68C900;
|
|
90
|
+
border-radius: 50%;
|
|
91
|
+
font-family: Montserrat;
|
|
92
|
+
font-weight: 500;
|
|
93
|
+
font-size: 12px;line-height: 16px;
|
|
94
|
+
text-align: center;
|
|
95
|
+
margin: 0 4px 0 20px;
|
|
96
|
+
}
|
|
97
|
+
.choosed-status-label-index{
|
|
83
98
|
border: 1px solid #FFFFFF;
|
|
84
99
|
color: #FFFFFF;
|
|
100
|
+
display: inline-block;
|
|
101
|
+
width: 16px;
|
|
102
|
+
height: 16px;
|
|
85
103
|
border-radius: 50%;
|
|
86
104
|
font-family: Montserrat;
|
|
87
|
-
font-
|
|
105
|
+
font-weight: 500;
|
|
106
|
+
font-size: 12px;
|
|
107
|
+
line-height: 16px;
|
|
88
108
|
text-align: center;
|
|
89
|
-
margin: 0
|
|
109
|
+
margin: 0 4px 0 20px;
|
|
90
110
|
}
|
|
91
111
|
|
|
92
112
|
.status-label-key {
|
|
@@ -111,18 +131,19 @@
|
|
|
111
131
|
height: 100%;
|
|
112
132
|
margin: 4px 0;
|
|
113
133
|
&>div {
|
|
114
|
-
font-size:
|
|
115
|
-
height:
|
|
116
|
-
line-height:
|
|
134
|
+
font-size: 10px;
|
|
135
|
+
height: 14px;
|
|
136
|
+
line-height: 14px;
|
|
117
137
|
color: #FFFFFF;
|
|
118
138
|
font-family: PingFangSC;
|
|
119
139
|
overflow: hidden;
|
|
120
140
|
text-overflow: ellipsis;
|
|
121
141
|
white-space: nowrap;
|
|
142
|
+
font-weight: 300;
|
|
122
143
|
}
|
|
123
144
|
&>div:first-child {
|
|
124
|
-
font-size:
|
|
125
|
-
font-weight:
|
|
145
|
+
font-size: 12px;
|
|
146
|
+
font-weight: 500;
|
|
126
147
|
}
|
|
127
148
|
}
|
|
128
149
|
|
|
@@ -23,32 +23,32 @@ export default () => {
|
|
|
23
23
|
{
|
|
24
24
|
text: '状态1',
|
|
25
25
|
modifyUserName: '张三',
|
|
26
|
-
modifyTime: '2022
|
|
26
|
+
modifyTime: '2022/09/01 12:20:20',
|
|
27
27
|
isDone: true,
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
text: '状态2',
|
|
31
31
|
modifyUserName: '李四',
|
|
32
|
-
modifyTime: '2022
|
|
32
|
+
modifyTime: '2022/09/01 12:20:20',
|
|
33
33
|
isDone: true,
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
text: '状态3',
|
|
37
37
|
modifyUserName: '王五',
|
|
38
|
-
modifyTime: '2022
|
|
38
|
+
modifyTime: '2022/09/01 12:20:20',
|
|
39
39
|
isDone: true,
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
text: '状态4',
|
|
43
43
|
modifyUserName: '韩梅梅',
|
|
44
44
|
isDone: true,
|
|
45
|
-
modifyTime: '2022
|
|
45
|
+
modifyTime: '2022/09/01 12:20:20',
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
text: '状态5',
|
|
49
49
|
modifyUserName: '李雷',
|
|
50
50
|
isDone: true,
|
|
51
|
-
modifyTime: '2022
|
|
51
|
+
modifyTime: '2022/09/01 12:20:20',
|
|
52
52
|
},
|
|
53
53
|
]
|
|
54
54
|
return (
|
|
@@ -4,24 +4,27 @@ import './index.less'
|
|
|
4
4
|
export default (props: any) => {
|
|
5
5
|
const { formStatusMapping = [] } = props;
|
|
6
6
|
return (
|
|
7
|
-
<div style={{display: 'flex',
|
|
7
|
+
<div style={{display: 'flex', background: '#FFFFFF'}}>
|
|
8
8
|
{
|
|
9
9
|
formStatusMapping.map((item:any, index:number) => {
|
|
10
10
|
return (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
<div style={{width: `${(100/formStatusMapping.length).toFixed(2)}%`}} className={`form-status-label ${item.isDone ? 'choosed-status-label' : ''} ${formStatusMapping.length === 1 ? 'only-one-child' : ''}`}>
|
|
12
|
+
<div className='status-label-key'>
|
|
13
|
+
<span
|
|
14
|
+
// className='status-label-index'
|
|
15
|
+
className={`${item.isDone?'status-label-index':'choosed-status-label-index' }`}
|
|
16
|
+
>{index+1}</span>
|
|
17
|
+
</div>
|
|
18
|
+
<div className='status-label-operate'>
|
|
19
|
+
<div style={!item.isDone ? {height: '30px', lineHeight: '30px'} : {}}>{item.text}</div>
|
|
20
|
+
{
|
|
21
|
+
item.isDone ? (
|
|
22
|
+
<div title={`${item.modifyUserName || '--'} ${item.modifyTime || '--'}`}>{`${item.modifyUserName || '--'} ${item.modifyTime || '--'}`}</div>
|
|
23
|
+
) : null
|
|
24
|
+
}
|
|
25
|
+
</div>
|
|
26
|
+
<div style={{clear: 'both'}}></div>
|
|
27
|
+
</div>
|
|
25
28
|
)
|
|
26
29
|
})
|
|
27
30
|
}
|
|
@@ -13,7 +13,7 @@ order: 2
|
|
|
13
13
|
|
|
14
14
|
Demo
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
行政组织(部门)选择器:
|
|
17
17
|
|
|
18
18
|
```tsx
|
|
19
19
|
import React, { useState } from 'react';
|
|
@@ -123,4 +123,32 @@ export default () => {
|
|
|
123
123
|
};
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
+
|
|
127
|
+
营销区域选择器:
|
|
128
|
+
|
|
129
|
+
```tsx
|
|
130
|
+
import React, { useState } from 'react';
|
|
131
|
+
import { BusinessTreeSearchSelect } from '../../../index';
|
|
132
|
+
|
|
133
|
+
export default () => {
|
|
134
|
+
|
|
135
|
+
const [value, setValue] = useState();
|
|
136
|
+
|
|
137
|
+
const props = {
|
|
138
|
+
mode: 'create',
|
|
139
|
+
value,
|
|
140
|
+
onChange: (v) => {
|
|
141
|
+
setValue(v)
|
|
142
|
+
},
|
|
143
|
+
businessType: 'market-area'
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
<div>
|
|
148
|
+
<BusinessTreeSearchSelect {...props} />
|
|
149
|
+
</div>
|
|
150
|
+
);
|
|
151
|
+
};
|
|
152
|
+
```
|
|
153
|
+
|
|
126
154
|
More skills for writing demo: https://d.umijs.org/guide/demo-principle
|
|
@@ -42,6 +42,15 @@ const handleDefaultProps = (type: string) => {
|
|
|
42
42
|
},
|
|
43
43
|
};
|
|
44
44
|
break;
|
|
45
|
+
case 'market-area':
|
|
46
|
+
result = {
|
|
47
|
+
isChoose: true,
|
|
48
|
+
remoteSource: {
|
|
49
|
+
url: `/channel-manage/tagNode/getTree/10`,
|
|
50
|
+
resKeyValue: ['code', 'name'],
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
break;
|
|
45
54
|
default:
|
|
46
55
|
result = {
|
|
47
56
|
treeCheckable: true,
|
|
@@ -25,10 +25,11 @@ const TreeSearchSelect = (props: any) => {
|
|
|
25
25
|
labelInValue = false,
|
|
26
26
|
showArrow = true,
|
|
27
27
|
allowClear = true,
|
|
28
|
-
showCheckedStrategy = TreeSelect.SHOW_PARENT,
|
|
28
|
+
showCheckedStrategy = props?.treeCheckStrictly ? TreeSelect.SHOW_ALL : TreeSelect.SHOW_PARENT,
|
|
29
29
|
style = { width: '100%' },
|
|
30
30
|
getTreeData,
|
|
31
|
-
disabled
|
|
31
|
+
disabled,
|
|
32
|
+
...restProps
|
|
32
33
|
} = props;
|
|
33
34
|
|
|
34
35
|
const {
|
|
@@ -69,7 +70,7 @@ const TreeSearchSelect = (props: any) => {
|
|
|
69
70
|
const resData = res?.data || [];
|
|
70
71
|
let coverData;
|
|
71
72
|
|
|
72
|
-
if(resData.status === '0') {
|
|
73
|
+
if(resData.status === '0' || resData.code === '000000') {
|
|
73
74
|
const { data } = resData;
|
|
74
75
|
if (remoteSource.converter) {
|
|
75
76
|
coverData = await remoteSource.converter({ data: [data] })
|
|
@@ -88,10 +89,10 @@ const TreeSearchSelect = (props: any) => {
|
|
|
88
89
|
|
|
89
90
|
const formatData = (value: any) => {
|
|
90
91
|
if (labelInValue) {
|
|
91
|
-
const formatResult = multiple ? value.map((i: any) => ({...i, key: i.value})) : { ...value, key: value?.value };
|
|
92
|
+
const formatResult = multiple||treeCheckable ? value.map((i: any) => ({...i, key: i.value})) : { ...value, key: value?.value };
|
|
92
93
|
return formatResult
|
|
93
94
|
} else {
|
|
94
|
-
const formatResult = multiple ? value.map((i: any) => (i?.value || i)) : (_.get(value[0], 'value') || value)
|
|
95
|
+
const formatResult = multiple||treeCheckable ? value.map((i: any) => (i?.value || i)) : (_.get(value?.[0], 'value') || value)
|
|
95
96
|
return formatResult
|
|
96
97
|
}
|
|
97
98
|
}
|
|
@@ -132,6 +133,7 @@ const TreeSearchSelect = (props: any) => {
|
|
|
132
133
|
return (
|
|
133
134
|
<div className={'tree_search_select'}>
|
|
134
135
|
<TreeSelect
|
|
136
|
+
{...restProps}
|
|
135
137
|
treeCheckable={treeCheckable}
|
|
136
138
|
maxTagCount={maxTagCount}
|
|
137
139
|
showSearch={showSearch}
|