@@ -15,7 +15,9 @@ import useConfig from '../hooks/useConfig';
15
15
import getBackgroundColor from '../_util/linearGradient' ;
16
16
import { progressDefaultProps } from './defaultProps' ;
17
17
import useDefaultProps from '../hooks/useDefaultProps' ;
18
- import { PRO_THEME , CIRCLE_SIZE_PX , STATUS_ICON , PLUMP_SEPARATE } from './constants' ;
18
+ import { PRO_THEME , STATUS_ICON } from '../_common/js/progress/const' ;
19
+ import { getDiameter , getCircleStokeWidth } from '../_common/js/progress/utils' ;
20
+ import { PLUMP_SEPARATE } from './constants' ;
19
21
20
22
export interface ProgressProps extends TdProgressProps , StyledProps { }
21
23
@@ -33,6 +35,7 @@ const Progress = forwardRef<HTMLDivElement, ProgressProps>((props, ref) => {
33
35
className,
34
36
style,
35
37
status,
38
+ size,
36
39
} = useDefaultProps < ProgressProps > ( props , progressDefaultProps ) ;
37
40
38
41
const computedStatus = percentage >= 100 ? 'success' : status || 'default' ;
@@ -125,12 +128,10 @@ const Progress = forwardRef<HTMLDivElement, ProgressProps>((props, ref) => {
125
128
</ div >
126
129
) ;
127
130
} else if ( theme === PRO_THEME . CIRCLE ) {
128
- // 获取环形进度条 环的宽度
129
- const getCircleStokeWidth = ( ) : number => ( strokeWidth ? Number ( strokeWidth ) : 6 ) ;
130
131
// 环形进度条尺寸(进度条占位空间,长宽占位)
131
- const circleStokeWidth = getCircleStokeWidth ( ) ;
132
+ const circleStokeWidth = getCircleStokeWidth ( strokeWidth , size ) ;
132
133
// 直径
133
- const diameter = CIRCLE_SIZE_PX ;
134
+ const diameter = getDiameter ( size ) ;
134
135
// 半径
135
136
const radius = diameter / 2 ;
136
137
// 内环半径
0 commit comments