Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
前端-吴智勇
jinfa-platform
Commits
1a681b90
Commit
1a681b90
authored
May 12, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加 DescProgess 描述进度条组件
parent
f1b8cf97
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
0 deletions
+91
-0
index.less
src/components/DescProgress/index.less
+27
-0
index.tsx
src/components/DescProgress/index.tsx
+64
-0
No files found.
src/components/DescProgress/index.less
0 → 100644
View file @
1a681b90
@import '~antd/es/style/themes/default.less';
.desc-progress {
&-statistic {
display: flex;
align-items: center;
justify-content: space-between;
&-item {
&-title {
margin-bottom: @margin-xss;
line-height: @font-size-sm;
font-size: @font-size-sm;
font-weight: 400;
color: @text-color-secondary;
}
&-content {
line-height: @font-size-sm;
font-size: @font-size-sm;
font-weight: 500;
color: @text-color;
}
}
}
}
\ No newline at end of file
src/components/DescProgress/index.tsx
0 → 100644
View file @
1a681b90
/*
* @Author: XieZhiXiong
* @Date: 2021-05-12 14:00:38
* @LastEditors: XieZhiXiong
* @LastEditTime: 2021-05-12 14:37:54
* @Description: 带描述信息的进度条
*/
import
React
from
'react'
;
import
{
Progress
}
from
'antd'
;
import
{
ProgressProps
}
from
'antd/lib/progress'
;
import
styles
from
'./index.less'
;
export
interface
DescriptionsItem
{
/**
* 标题
*/
title
:
React
.
ReactNode
,
/**
* 值
*/
value
:
React
.
ReactNode
,
/**
* 自定义渲染
*/
customRender
?:
React
.
ReactNode
,
}
interface
IProps
extends
ProgressProps
{
/**
* 描述列表
*/
descriptions
:
DescriptionsItem
[],
}
const
DescProgress
:
React
.
FC
<
IProps
>
=
(
props
:
IProps
)
=>
{
const
{
descriptions
,
...
rest
}
=
props
;
return
(
<
div
className=
{
styles
[
'desc-progress'
]
}
>
<
div
className=
{
styles
[
'desc-progress-statistic'
]
}
>
{
descriptions
.
map
((
item
,
index
)
=>
(
!
item
.
customRender
?
(
<
div
key=
{
index
}
className=
{
styles
[
'desc-progress-statistic-item'
]
}
>
<
div
className=
{
styles
[
'desc-progress-statistic-item-title'
]
}
>
{
item
.
title
}
</
div
>
<
div
className=
{
styles
[
'desc-progress-statistic-item-content'
]
}
>
{
item
.
value
}
</
div
>
</
div
>
)
:
(
item
.
customRender
)
))
}
</
div
>
<
Progress
strokeColor=
"#6B778C"
showInfo=
{
false
}
{
...
rest
}
/>
</
div
>
);
};
export
default
DescProgress
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment