@bit-sun/business-component 2.0.14 → 2.0.17-alpha.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/.fatherrc.ts +1 -0
- package/dist/components/Business/CommonGuideWrapper/index.d.ts +6 -0
- package/dist/components/Business/SearchSelect/index.d.ts +1 -1
- package/dist/components/Business/StateFlow/index.d.ts +3 -0
- package/dist/components/Functional/SearchSelect/index.d.ts +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +245 -25
- package/dist/index.js +245 -23
- package/dist/index.umd.js +113561 -0
- package/dist/index.umd.min.js +27 -0
- package/package.json +1 -1
- package/src/assets/arrow_top.png +0 -0
- package/src/assets/drag.svg +17 -0
- package/src/assets/label_icon_bottom.svg +26 -0
- package/src/components/Business/CommodityEntry/index.md +2 -1
- package/src/components/Business/CommodityEntry/index.tsx +3 -1
- package/src/components/Business/CommonGuideWrapper/index.less +112 -0
- package/src/components/Business/CommonGuideWrapper/index.md +39 -0
- package/src/components/Business/CommonGuideWrapper/index.tsx +84 -0
- package/src/components/Business/SearchSelect/index.tsx +16 -11
- package/src/components/Business/StateFlow/index.less +131 -0
- package/src/components/Business/StateFlow/index.md +60 -0
- package/src/components/Business/StateFlow/index.tsx +30 -0
- package/src/components/Functional/DataValidation/index.tsx +2 -1
- package/src/components/Functional/SearchSelect/index.tsx +134 -69
- package/src/index.ts +2 -0
- package/typings.d.ts +2 -0
package/package.json
CHANGED
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" class="design-iconfont">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient x1="100%" y1="50%" x2="0%" y2="50%" id="l1lf23lgga">
|
|
4
|
+
<stop stop-color="#10295B" offset="0%"/>
|
|
5
|
+
<stop stop-color="#0F2A61" offset="100%"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
<path id="okxu11mz5b" d="M0 0H24V24H0z"/>
|
|
8
|
+
</defs>
|
|
9
|
+
<g fill="none" fill-rule="evenodd">
|
|
10
|
+
<mask id="7u8dk2lilc" fill="#fff">
|
|
11
|
+
<use xlink:href="#okxu11mz5b"/>
|
|
12
|
+
</mask>
|
|
13
|
+
<g mask="url(#7u8dk2lilc)" fill="#999" fill-rule="nonzero">
|
|
14
|
+
<path d="M1.31655092,7 C2.03935948,7 2.6253116,7.58595212 2.6253116,8.30876068 C2.6253116,9.03156925 2.03935948,9.61752137 1.31655092,9.61752137 C0.593742351,9.61752137 0.00779023438,9.03156925 0.00779023438,8.30876068 C0.00779023438,7.58595212 0.593742351,7 1.31655092,7 Z M6.99034011,7 C7.71314867,7 8.29910079,7.58595212 8.29910079,8.30876068 C8.29910079,9.03156925 7.71314867,9.61752137 6.99034011,9.61752137 C6.26753154,9.61752137 5.68157942,9.03156925 5.68157942,8.30876068 C5.68157942,7.58595212 6.26753154,7 6.99034011,7 Z M12.6641293,7 C13.3869378,7 13.97289,7.58595212 13.97289,8.30876068 C13.97289,9.03156925 13.3869378,9.61752137 12.6641293,9.61752137 C11.9413207,9.61752137 11.3553686,9.03156925 11.3553686,8.30876068 C11.3553686,7.58595212 11.9413207,7 12.6641293,7 Z M1.31655092,-5.32907052e-15 C2.03935948,-5.32907052e-15 2.6253116,0.585952117 2.6253116,1.30876068 C2.6253116,2.03156925 2.03935948,2.61752137 1.31655092,2.61752137 C0.593742351,2.61752137 0.00779023438,2.03156925 0.00779023438,1.30876068 C0.00779023438,0.585952117 0.593742351,-5.32907052e-15 1.31655092,-5.32907052e-15 Z M6.99034011,-5.32907052e-15 C7.71314867,-5.32907052e-15 8.29910079,0.585952117 8.29910079,1.30876068 C8.29910079,2.03156925 7.71314867,2.61752137 6.99034011,2.61752137 C6.26753154,2.61752137 5.68157942,2.03156925 5.68157942,1.30876068 C5.68157942,0.585952117 6.26753154,-5.32907052e-15 6.99034011,-5.32907052e-15 Z M12.6641293,-5.32907052e-15 C13.3869378,-5.32907052e-15 13.97289,0.585952117 13.97289,1.30876068 C13.97289,2.03156925 13.3869378,2.61752137 12.6641293,2.61752137 C11.9413207,2.61752137 11.3553686,2.03156925 11.3553686,1.30876068 C11.3553686,0.585952117 11.9413207,-5.32907052e-15 12.6641293,-5.32907052e-15 Z" transform="translate(5 7)"/>
|
|
15
|
+
</g>
|
|
16
|
+
</g>
|
|
17
|
+
</svg>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>编组 3备份 4</title>
|
|
4
|
+
<defs>
|
|
5
|
+
<rect id="path-1" x="0" y="0" width="24" height="24"></rect>
|
|
6
|
+
</defs>
|
|
7
|
+
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
8
|
+
<g id="单据-详情页(二级页)-下拉" transform="translate(-1858.000000, -1326.000000)">
|
|
9
|
+
<g id="编组-20" transform="translate(280.000000, 866.000000)">
|
|
10
|
+
<g id="编组-5" transform="translate(1554.000000, 179.000000)">
|
|
11
|
+
<g id="编组-3备份-4" transform="translate(24.000000, 281.000000)">
|
|
12
|
+
<mask id="mask-2" fill="white">
|
|
13
|
+
<use xlink:href="#path-1"></use>
|
|
14
|
+
</mask>
|
|
15
|
+
<use id="蒙版" fill="#D8D8D8" opacity="0" xlink:href="#path-1"></use>
|
|
16
|
+
<g id="编组" mask="url(#mask-2)" fill="#B1BAD4" fill-rule="nonzero">
|
|
17
|
+
<g transform="translate(3.000000, 3.000000)" id="形状">
|
|
18
|
+
<path d="M5.99072727,0.237481917 C6.50454545,-0.0418576482 6.56509091,-0.0745634228 6.97254545,0.138292264 L7.15527271,0.236945765 C7.31727271,0.445512161 7.34672726,0.483579531 7.3761818,0.664265595 L7.39690908,0.809565049 L7.39690908,17 L5.76054545,17 L5.76054545,2.73974241 L1.15690909,7.26654448 L0,6.12934831 L5.99072727,0.237481917 Z M13.0909091,13.6720525 L13.0909091,15.2805337 L9.81818182,15.2805337 L9.81818182,13.6720525 L13.0909091,13.6720525 Z M14.7272727,9.91892987 L14.7272727,11.527411 L9.81818182,11.527411 L9.81818182,9.91892987 L14.7272727,9.91892987 Z M16.3636364,6.16580723 L16.3636364,7.77428836 L9.81818182,7.77428836 L9.81818182,6.16580723 L16.3636364,6.16580723 Z M18,2.41268459 L18,4.02116572 L9.81818182,4.02116572 L9.81818182,2.41268459 L18,2.41268459 Z"></path>
|
|
19
|
+
</g>
|
|
20
|
+
</g>
|
|
21
|
+
</g>
|
|
22
|
+
</g>
|
|
23
|
+
</g>
|
|
24
|
+
</g>
|
|
25
|
+
</g>
|
|
26
|
+
</svg>
|
|
@@ -14,7 +14,8 @@ const CommodityEntry = (props: any) => {
|
|
|
14
14
|
callbackHandleOk,
|
|
15
15
|
columns=["skuCode", "quantity", "price"],
|
|
16
16
|
validDataUrl="/items/sku/import/check",
|
|
17
|
-
isBrandAuth = true // 默认做品牌过滤
|
|
17
|
+
isBrandAuth = true, // 默认做品牌过滤
|
|
18
|
+
isCheckStockNum = true
|
|
18
19
|
} = props;
|
|
19
20
|
|
|
20
21
|
const [modalProps, setModalProps]: any = useState({
|
|
@@ -68,6 +69,7 @@ const CommodityEntry = (props: any) => {
|
|
|
68
69
|
columns={columns}
|
|
69
70
|
validDataUrl={validDataUrl}
|
|
70
71
|
isBrandAuth={isBrandAuth}
|
|
72
|
+
isCheckStockNum={isCheckStockNum}
|
|
71
73
|
/>
|
|
72
74
|
</Modal>
|
|
73
75
|
) || ''}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
.form-guide {
|
|
2
|
+
cursor: pointer;
|
|
3
|
+
position: fixed;
|
|
4
|
+
right: 5px;
|
|
5
|
+
color: #B1BAD4;
|
|
6
|
+
padding: 5px 0;
|
|
7
|
+
width: 48px;
|
|
8
|
+
z-index: 10;
|
|
9
|
+
top: 50%;
|
|
10
|
+
transform: translateY(-50%);
|
|
11
|
+
background-color: #141620;
|
|
12
|
+
.form-guide-top {
|
|
13
|
+
padding: 0px 10px;
|
|
14
|
+
display: flex;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
}
|
|
17
|
+
border-radius: 5px;
|
|
18
|
+
.form-guide-center {
|
|
19
|
+
border-top: 1px solid #6E7588;
|
|
20
|
+
border-bottom: 1px solid #6E7588;
|
|
21
|
+
padding: 0px 10px;
|
|
22
|
+
}
|
|
23
|
+
.form-guide-item {
|
|
24
|
+
width: 28px;
|
|
25
|
+
padding: 5px 0;
|
|
26
|
+
display: block;
|
|
27
|
+
word-break: break-all;
|
|
28
|
+
color: #B1BAD4;
|
|
29
|
+
font-size: 14px;
|
|
30
|
+
line-height: 16px;
|
|
31
|
+
position: relative;
|
|
32
|
+
}
|
|
33
|
+
.form-guide-item::after {
|
|
34
|
+
content: '';
|
|
35
|
+
display: block;
|
|
36
|
+
width: 15px;
|
|
37
|
+
height: 1px;
|
|
38
|
+
background-color: #6E7588;
|
|
39
|
+
position: absolute;
|
|
40
|
+
bottom: 0px;
|
|
41
|
+
left: 7px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.form-guide-bottom {
|
|
45
|
+
padding: 5px 10px;
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
}
|
|
49
|
+
.form-guide-item:last-child::after {
|
|
50
|
+
content: '';
|
|
51
|
+
display: none;
|
|
52
|
+
width: 15px;
|
|
53
|
+
height: 1px;
|
|
54
|
+
background-color: #6E7588;
|
|
55
|
+
position: absolute;
|
|
56
|
+
bottom: 0px;
|
|
57
|
+
left: 7px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.white-card.bitsun-form-card-class {
|
|
62
|
+
.ant-card-body {
|
|
63
|
+
background-color: #FFFFFF;
|
|
64
|
+
padding: 0px;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.bitsun-form-card-class {
|
|
69
|
+
&>.ant-card-body {
|
|
70
|
+
margin-bottom: 10px;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.bitsun-form-card-class {
|
|
75
|
+
.ant-card-head {
|
|
76
|
+
border: 0px;
|
|
77
|
+
padding: 0px;
|
|
78
|
+
height: 48px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.ant-card-body {
|
|
82
|
+
padding: 12px 0 0;
|
|
83
|
+
margin-top: -4px;
|
|
84
|
+
background-color: #F3F3F3;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.ant-card-head-title {
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
font-size: 16px;
|
|
91
|
+
color: #000000;
|
|
92
|
+
font-weight: 600;
|
|
93
|
+
font-family: PingFangSC;
|
|
94
|
+
background-color: #FFFFFF;
|
|
95
|
+
padding: 8px 0;
|
|
96
|
+
margin: 0px;
|
|
97
|
+
.title-left-line {
|
|
98
|
+
display: inline-block;
|
|
99
|
+
width: 4px;
|
|
100
|
+
height: 100%;
|
|
101
|
+
background-color: #005CFF;
|
|
102
|
+
height: 20px;
|
|
103
|
+
margin-right: 16px;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.field-group-hidden {
|
|
109
|
+
.ant-card-body {
|
|
110
|
+
display: none !important;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav:
|
|
3
|
+
title: '组件'
|
|
4
|
+
order: 1
|
|
5
|
+
group:
|
|
6
|
+
title: 业务组件
|
|
7
|
+
order: 1
|
|
8
|
+
title: 模块导航容器组件
|
|
9
|
+
order: 1
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# GuideWrapper
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 容器模块导航
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React, { useState } from 'react';
|
|
19
|
+
import { GuideWrapper } from '../../../index.ts';
|
|
20
|
+
|
|
21
|
+
export default () => {
|
|
22
|
+
const { Field } = GuideWrapper;
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<GuideWrapper>
|
|
26
|
+
<Field id='test1' title='基础信息'>
|
|
27
|
+
<div style={{height: '400px', textAlign:'center', lineHeight: '400px'}}>模块一</div>
|
|
28
|
+
</Field>
|
|
29
|
+
<Field id='test2' title='销售信息' isWhiteCard={true}>
|
|
30
|
+
<div style={{height: '400px', textAlign:'center', lineHeight: '400px'}}>模块二</div>
|
|
31
|
+
</Field>
|
|
32
|
+
<Field id='test3' title='其他信息'>
|
|
33
|
+
<div style={{height: '400px', textAlign:'center', lineHeight: '400px'}}>模块三</div>
|
|
34
|
+
</Field>
|
|
35
|
+
</GuideWrapper>
|
|
36
|
+
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
```
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React, { Component } from "react";
|
|
2
|
+
import dragImg from '../../../assets/drag.svg';
|
|
3
|
+
import label_icon_bottom from '../../../assets/label_icon_bottom.svg';
|
|
4
|
+
import arrow_top from '../../../assets/arrow_top.png';
|
|
5
|
+
import './index.less';
|
|
6
|
+
|
|
7
|
+
const Field = ({ children, ...props }: any) => {
|
|
8
|
+
const [fieldGroupVisible, setVisible] = React.useState(true);
|
|
9
|
+
return (
|
|
10
|
+
<div
|
|
11
|
+
className={
|
|
12
|
+
`bitsun-form-card-class
|
|
13
|
+
${fieldGroupVisible ? '' : 'field-group-hidden'}
|
|
14
|
+
${props.isWhiteCard ? 'white-card' : ''}
|
|
15
|
+
`
|
|
16
|
+
}
|
|
17
|
+
id={props.id}
|
|
18
|
+
>
|
|
19
|
+
<div className="ant-card-head">
|
|
20
|
+
<div className="ant-card-head-title">
|
|
21
|
+
<span className='title-left-line'></span>
|
|
22
|
+
<span style={{ marginRight: '5px' }}>
|
|
23
|
+
{props?.title}
|
|
24
|
+
</span>
|
|
25
|
+
<img
|
|
26
|
+
width={24}
|
|
27
|
+
style={{
|
|
28
|
+
transform: fieldGroupVisible ? 'inherit' : 'rotate(180deg)',
|
|
29
|
+
cursor: 'pointer'
|
|
30
|
+
}}
|
|
31
|
+
src={arrow_top}
|
|
32
|
+
onClick={(e) => {
|
|
33
|
+
e.stopPropagation();
|
|
34
|
+
setVisible(!fieldGroupVisible);
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
<div className="ant-card-body">
|
|
40
|
+
{children}
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default class GuideWrapper extends Component {
|
|
47
|
+
static Field = Field;
|
|
48
|
+
render() {
|
|
49
|
+
const { children = [], ...props }: any = this.props;
|
|
50
|
+
let cardGroups = children.filter((item:any) => item?.props?.id && item?.props?.title);
|
|
51
|
+
return (
|
|
52
|
+
<div {...props}>
|
|
53
|
+
{children}
|
|
54
|
+
<div
|
|
55
|
+
className='form-guide'
|
|
56
|
+
>
|
|
57
|
+
<div className='form-guide-top'>
|
|
58
|
+
<img width={24} src={dragImg} />
|
|
59
|
+
</div>
|
|
60
|
+
<div className='form-guide-center'>
|
|
61
|
+
{
|
|
62
|
+
cardGroups.map((item:any) => {
|
|
63
|
+
return (
|
|
64
|
+
<span
|
|
65
|
+
className='form-guide-item'
|
|
66
|
+
onClick={() => {
|
|
67
|
+
let currentDom = document.getElementById(item.props.id);
|
|
68
|
+
currentDom && currentDom.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
|
69
|
+
}}
|
|
70
|
+
>
|
|
71
|
+
{item.props.title}
|
|
72
|
+
</span>
|
|
73
|
+
)
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
</div>
|
|
77
|
+
<div className='form-guide-bottom'>
|
|
78
|
+
<img width={24} src={label_icon_bottom} />
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
* @Description:
|
|
3
3
|
* @Author: rodchen
|
|
4
4
|
* @Date: 2022-05-07 15:17:28
|
|
5
|
-
* @LastEditTime: 2022-
|
|
6
|
-
* @LastEditors:
|
|
5
|
+
* @LastEditTime: 2022-08-16 16:49:01
|
|
6
|
+
* @LastEditors: Sirius-kk
|
|
7
7
|
*/
|
|
8
|
-
import React, { useMemo } from 'react';
|
|
8
|
+
import React, { useMemo, useRef, forwardRef, useImperativeHandle } from 'react';
|
|
9
9
|
import { commonFun } from './BusinessUtils';
|
|
10
10
|
import { handleDefaultPrefixUrl } from './utils';
|
|
11
11
|
import SearchSelect from '@/components/Functional/SearchSelect';
|
|
12
12
|
|
|
13
13
|
const MemoSearchSelect = React.memo(SearchSelect)
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const BusinessSearchSelect = forwardRef((props: any, ref: any) => {
|
|
16
16
|
const businessType = props?.selectBusinessType || 'supplier';
|
|
17
17
|
const prefixUrl = props?.prefixUrl || { selectPrefix: handleDefaultPrefixUrl(businessType), formSelectFix: handleDefaultPrefixUrl(businessType) };
|
|
18
|
+
const innerRef = useRef();
|
|
18
19
|
|
|
19
|
-
const { requestConfig, modalTableProps, needModalTable } = commonFun(businessType, prefixUrl,props?.requestConfig || {}, props?.modalTableProps || {});
|
|
20
|
+
const { requestConfig, modalTableProps, needModalTable } = commonFun(businessType, prefixUrl, props?.requestConfig || {}, props?.modalTableProps || {});
|
|
20
21
|
const currentProps = useMemo(() => {
|
|
21
22
|
return {
|
|
22
23
|
...props,
|
|
@@ -24,21 +25,25 @@ const BusinessSearchSelect = (props: any) => {
|
|
|
24
25
|
needModalTable,
|
|
25
26
|
modalTableProps
|
|
26
27
|
}
|
|
27
|
-
}, [props?.value])
|
|
28
|
+
}, [props?.value]);
|
|
29
|
+
|
|
30
|
+
useImperativeHandle(ref, () => ({
|
|
31
|
+
getRef: () => innerRef,
|
|
32
|
+
}))
|
|
28
33
|
|
|
29
34
|
return (
|
|
30
35
|
<div>
|
|
31
|
-
<MemoSearchSelect {...currentProps} />
|
|
36
|
+
<MemoSearchSelect {...currentProps} ref={innerRef} />
|
|
32
37
|
</div>
|
|
33
38
|
);
|
|
34
|
-
};
|
|
39
|
+
});
|
|
35
40
|
|
|
36
41
|
export default React.memo(BusinessSearchSelect, (props, nextProps) => {
|
|
37
|
-
if(props && props.labelInValue && props.value && JSON.stringify(props.value) !== JSON.stringify(nextProps.value)) {
|
|
42
|
+
if (props && props.labelInValue && props.value && JSON.stringify(props.value) !== JSON.stringify(nextProps.value)) {
|
|
38
43
|
return false
|
|
39
44
|
}
|
|
40
|
-
if(props && props.value !== nextProps.value) {
|
|
45
|
+
if (props && props.value !== nextProps.value) {
|
|
41
46
|
return false
|
|
42
47
|
}
|
|
43
48
|
return true
|
|
44
|
-
});
|
|
49
|
+
});
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
.form-status-label {
|
|
2
|
+
height: 48px;
|
|
3
|
+
margin-right: 12px;
|
|
4
|
+
// flex-grow: 1;
|
|
5
|
+
// flex-shrink: 1;
|
|
6
|
+
display: inline-block;
|
|
7
|
+
position: relative;
|
|
8
|
+
background-color: #B0B4B7;
|
|
9
|
+
align-items: center;
|
|
10
|
+
}
|
|
11
|
+
.choosed-status-label.form-status-label {
|
|
12
|
+
background-color: #005CFF;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.form-status-label:last-child {
|
|
16
|
+
margin-right: 0px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.form-status-label:first-child::after {
|
|
20
|
+
position: absolute;
|
|
21
|
+
display: block;
|
|
22
|
+
content: '';
|
|
23
|
+
right: -48px;
|
|
24
|
+
top: 0;
|
|
25
|
+
width: 48px;
|
|
26
|
+
height: 48px;
|
|
27
|
+
border: 24px solid;
|
|
28
|
+
border-color: transparent transparent transparent transparent;
|
|
29
|
+
border-left: 12px solid #B0B4B7;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.choosed-status-label.form-status-label::after {
|
|
33
|
+
border-left: 12px solid #005CFF;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.choosed-status-label.form-status-label:not(:first-child):not(:last-child)::after {
|
|
37
|
+
border-left: 12px solid #005CFF;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.form-status-label:last-child::after {
|
|
41
|
+
position: absolute;
|
|
42
|
+
display: block;
|
|
43
|
+
content: '';
|
|
44
|
+
left: 0;
|
|
45
|
+
top: 0;
|
|
46
|
+
width: 48px;
|
|
47
|
+
height: 48px;
|
|
48
|
+
border: 24px solid;
|
|
49
|
+
border-color: transparent transparent transparent transparent;
|
|
50
|
+
border-left: 12px solid #ffffff;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.form-status-label:not(:first-child):not(:last-child)::before {
|
|
54
|
+
position: absolute;
|
|
55
|
+
display: block;
|
|
56
|
+
content: '';
|
|
57
|
+
left: 0;
|
|
58
|
+
top: 0;
|
|
59
|
+
width: 48px;
|
|
60
|
+
height: 48px;
|
|
61
|
+
border: 24px solid;
|
|
62
|
+
border-color: transparent transparent transparent transparent;
|
|
63
|
+
border-left: 12px solid #ffffff;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.form-status-label:not(:first-child):not(:last-child)::after {
|
|
67
|
+
position: absolute;
|
|
68
|
+
display: block;
|
|
69
|
+
content: '';
|
|
70
|
+
right: -48px;
|
|
71
|
+
top: 0;
|
|
72
|
+
width: 48px;
|
|
73
|
+
height: 48px;
|
|
74
|
+
border: 24px solid;
|
|
75
|
+
border-color: transparent transparent transparent transparent;
|
|
76
|
+
border-left: 12px solid #B0B4B7;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.status-label-index {
|
|
80
|
+
display: inline-block;
|
|
81
|
+
width: 24px;
|
|
82
|
+
height: 24px;
|
|
83
|
+
border: 1px solid #FFFFFF;
|
|
84
|
+
color: #FFFFFF;
|
|
85
|
+
border-radius: 50%;
|
|
86
|
+
font-family: Montserrat;
|
|
87
|
+
font-size: 14px;line-height: 24px;
|
|
88
|
+
text-align: center;
|
|
89
|
+
margin: 0 6px 0 20px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.status-label-key {
|
|
93
|
+
width: 50px;
|
|
94
|
+
height: 100%;
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
float: left;
|
|
97
|
+
// flex-grow: 0;
|
|
98
|
+
// flex-shrink: 0;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.status-label-operate {
|
|
104
|
+
// flex-grow: 1;
|
|
105
|
+
// flex-shrink: 1;
|
|
106
|
+
float: left;
|
|
107
|
+
width: calc(100% - 50px);
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
text-overflow: ellipsis;
|
|
110
|
+
white-space: nowrap;
|
|
111
|
+
height: 100%;
|
|
112
|
+
margin: 4px 0;
|
|
113
|
+
&>div {
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
height: 20px;
|
|
116
|
+
line-height: 20px;
|
|
117
|
+
color: #FFFFFF;
|
|
118
|
+
font-family: PingFangSC;
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
text-overflow: ellipsis;
|
|
121
|
+
white-space: nowrap;
|
|
122
|
+
}
|
|
123
|
+
&>div:first-child {
|
|
124
|
+
font-size: 14px;
|
|
125
|
+
font-weight: 600;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.only-one-child.form-status-label::after,.only-one-child.form-status-label::before {
|
|
130
|
+
border-left: 0px;
|
|
131
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav:
|
|
3
|
+
title: '组件'
|
|
4
|
+
order: 1
|
|
5
|
+
group:
|
|
6
|
+
title: 业务组件
|
|
7
|
+
order: 1
|
|
8
|
+
title: 状态流转
|
|
9
|
+
order: 1
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# StateFlow
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 单据状态流转
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React, { useState } from 'react';
|
|
19
|
+
import { StateFlow } from '../../../index.ts';
|
|
20
|
+
|
|
21
|
+
export default () => {
|
|
22
|
+
const formStatusMapping = [
|
|
23
|
+
{
|
|
24
|
+
text: '状态1',
|
|
25
|
+
modifyUserName: '张三',
|
|
26
|
+
modifyTime: '2022-09-01 12:20:20',
|
|
27
|
+
isDone: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
text: '状态2',
|
|
31
|
+
modifyUserName: '李四',
|
|
32
|
+
modifyTime: '2022-09-01 12:20:20',
|
|
33
|
+
isDone: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
text: '状态3',
|
|
37
|
+
modifyUserName: '王五',
|
|
38
|
+
modifyTime: '2022-09-01 12:20:20',
|
|
39
|
+
isDone: true,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
text: '状态4',
|
|
43
|
+
modifyUserName: '韩梅梅',
|
|
44
|
+
isDone: true,
|
|
45
|
+
modifyTime: '2022-09-01 12:20:20',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
text: '状态5',
|
|
49
|
+
modifyUserName: '李雷',
|
|
50
|
+
isDone: true,
|
|
51
|
+
modifyTime: '2022-09-01 12:20:20',
|
|
52
|
+
},
|
|
53
|
+
]
|
|
54
|
+
return (
|
|
55
|
+
<StateFlow
|
|
56
|
+
formStatusMapping={formStatusMapping}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import './index.less'
|
|
3
|
+
|
|
4
|
+
export default (props: any) => {
|
|
5
|
+
const { formStatusMapping = [] } = props;
|
|
6
|
+
return (
|
|
7
|
+
<div style={{display: 'flex', padding: '10px 60px 0px', background: '#FFFFFF'}}>
|
|
8
|
+
{
|
|
9
|
+
formStatusMapping.map((item:any, index:number) => {
|
|
10
|
+
return (
|
|
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 className='status-label-index'>{index+1}</span>
|
|
14
|
+
</div>
|
|
15
|
+
<div className='status-label-operate'>
|
|
16
|
+
<div style={!item.isDone ? {height: '40px', lineHeight: '40px'} : {}}>{item.text}</div>
|
|
17
|
+
{
|
|
18
|
+
item.isDone ? (
|
|
19
|
+
<div title={`${item.modifyUserName || '--'} ${item.modifyTime || '--'}`}>{`${item.modifyUserName || '--'} ${item.modifyTime || '--'}`}</div>
|
|
20
|
+
) : null
|
|
21
|
+
}
|
|
22
|
+
</div>
|
|
23
|
+
<div style={{clear: 'both'}}></div>
|
|
24
|
+
</div>
|
|
25
|
+
)
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
</div>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
@@ -401,7 +401,7 @@ class DataValidation extends React.Component {
|
|
|
401
401
|
};
|
|
402
402
|
|
|
403
403
|
resetData = () => {
|
|
404
|
-
const { validDataUrl, updateData, columns, isBrandAuth } = this.props;
|
|
404
|
+
const { validDataUrl, updateData, columns, isBrandAuth, isCheckStockNum = true } = this.props;
|
|
405
405
|
const resultData = this.getData().filter(d => {
|
|
406
406
|
return _.compact(Object.values(d)).length
|
|
407
407
|
})
|
|
@@ -417,6 +417,7 @@ class DataValidation extends React.Component {
|
|
|
417
417
|
...otherParams,
|
|
418
418
|
columns: columns,
|
|
419
419
|
data: resultData,
|
|
420
|
+
checkStockNum: isCheckStockNum
|
|
420
421
|
})
|
|
421
422
|
.then((result) => {
|
|
422
423
|
result = result.data;
|