Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
61d947db
A
ant-design
项目概览
wanjj_1210
/
ant-design
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
61d947db
编写于
6月 14, 2015
作者:
夏
夏奈
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
progress line demo
上级
c467790b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
72 addition
and
21 deletion
+72
-21
components/progress/demo/line.md
components/progress/demo/line.md
+6
-1
components/progress/index.jsx
components/progress/index.jsx
+41
-18
components/progress/index.md
components/progress/index.md
+1
-1
style/components/index.less
style/components/index.less
+2
-1
style/components/progress.less
style/components/progress.less
+22
-0
未找到文件。
components/progress/demo/line.md
浏览文件 @
61d947db
...
...
@@ -10,5 +10,10 @@ Progress Line用法
var
Line
=
antd
.
Progress
.
Line
;
React
.
render
(
<
Line
percent
=
"30"
status
=
"exception"
/>,
document
.
getElementById
(
'
components-progress-demo-line
'
));
<
div
>
<
Line
percent
=
"30"
width
=
"300"
strokeWidth
=
"4"
/>
<
Line
percent
=
"70"
width
=
"300"
strokeWidth
=
"4"
status
=
"exception"
/>
<
Line
percent
=
"100"
width
=
"300"
strokeWidth
=
"4"
/>
</
div
>
,
document
.
getElementById
(
'
components-progress-demo-line
'
));
````
components/progress/index.jsx
浏览文件 @
61d947db
...
...
@@ -5,36 +5,58 @@ var Progresscircle = require('rc-progress').Circle;
var
React
=
require
(
'
react
'
);
var
Line
=
React
.
createClass
({
getDefaultProps
:
function
()
{
getDefaultProps
:
function
()
{
return
{
width
:
"
100%
"
,
percent
:
0
,
strokeWidth
:
1
,
status
:
"
normal
"
strokeWidth
:
2
,
status
:
"
normal
"
// exception
}
},
render
()
{
var
statusColorMap
=
{
"
normal
"
:
"
#3FC7FA
"
,
"
exception
"
:
"
#FE8C6A
"
,
"
success
"
:
"
#85D262
"
};
if
(
parseInt
(
this
.
props
.
percent
)
===
100
)
{
this
.
props
.
status
=
'
success
'
}
var
style
=
{
"
width
"
:
this
.
props
.
width
}
var
wrapStyle
=
{
"
font-size
"
:
this
.
props
.
width
/
100
*
this
.
props
.
strokeWidth
}
var
textStyle
=
{
"
color
"
:
statusColorMap
[
this
.
props
.
status
]
}
var
progressInfo
if
(
this
.
props
.
status
===
'
normal
'
)
{
if
(
this
.
props
.
status
===
'
exception
'
)
{
progressInfo
=
(
<
span
className
=
"ant-progress-line-text"
>
{
this
.
props
.
percent
}
%
</
span
>
<
span
style
=
{
textStyle
}
className
=
"ant-progress-line-text"
>
<
i
className
=
"anticon anticon-exclamation-round"
></
i
>
</
span
>
)
}
else
if
(
this
.
props
.
status
===
'
success
'
){
progressInfo
=
(
<
span
style
=
{
textStyle
}
className
=
"ant-progress-line-text"
>
<
i
className
=
"anticon anticon-check-round"
></
i
>
</
span
>
)
}
else
{
progressInfo
=
(
<
i
className
=
"anticon anticon-check-circle"
></
i
>
<
span
className
=
"ant-progress-line-text"
>
{
this
.
props
.
percent
}
%
</
span
>
)
}
var
statusColorMap
=
{
"
normal
"
:
"
#3FC7FA
"
,
"
exception
"
:
"
#FE8C6A
"
};
return
(
<
div
className
=
"ant-progress-line-wrap"
style
=
{
style
}
>
<
Progressline
percent
=
{
this
.
props
.
percent
}
strokeWidth
=
{
this
.
props
.
strokeWidth
}
strokeColor
=
{
statusColorMap
[
this
.
props
.
status
]
}
/>
<
div
className
=
"ant-progress-line-wrap"
style
=
{
wrapStyle
}
>
<
div
className
=
"ant-progress-line-inner"
style
=
{
style
}
>
<
Progressline
percent
=
{
this
.
props
.
percent
}
strokeWidth
=
{
this
.
props
.
strokeWidth
}
strokeColor
=
{
statusColorMap
[
this
.
props
.
status
]
}
/>
</
div
>
{
progressInfo
}
</
div
>
);
...
...
@@ -42,9 +64,9 @@ var Line = React.createClass({
});
var
Circle
=
React
.
createClass
({
getDefaultProps
:
function
()
{
getDefaultProps
:
function
()
{
return
{
width
:
"
100
px
"
,
width
:
"
100
%
"
,
percent
:
0
,
strokeWidth
:
1
,
status
:
"
normal
"
...
...
@@ -56,11 +78,11 @@ var Circle = React.createClass({
"
height
"
:
this
.
props
.
width
}
var
progressInfo
if
(
this
.
props
.
status
===
'
normal
'
)
{
if
(
this
.
props
.
status
===
'
normal
'
)
{
progressInfo
=
(
<
i
className
=
"anticon anticon-check-circle"
></
i
>
)
}
else
{
}
else
{
progressInfo
=
(
<
span
className
=
"ant-progress-line-text"
>
{
this
.
props
.
percent
}
%
</
span
>
)
...
...
@@ -72,7 +94,8 @@ var Circle = React.createClass({
};
return
(
<
div
className
=
"ant-progress-circle-wrap"
style
=
{
style
}
>
<
Progresscircle
percent
=
{
this
.
props
.
percent
}
strokeWidth
=
{
this
.
props
.
strokeWidth
}
strokeColor
=
{
statusColorMap
[
this
.
props
.
status
]
}
/>
<
Progresscircle
percent
=
{
this
.
props
.
percent
}
strokeWidth
=
{
this
.
props
.
strokeWidth
}
strokeColor
=
{
statusColorMap
[
this
.
props
.
status
]
}
/>
{
progressInfo
}
</
div
>
);
...
...
components/progress/index.md
浏览文件 @
61d947db
...
...
@@ -19,7 +19,7 @@
| perscent | 百分比 | number | 0 |
| status | 状态,有两个值normal、exception | string | normal |
| strokeWidth | 进度条线宽度,单位是进度条画布宽度的百分比 | number | 1 |
| width |
进度条画布宽度,这里没有提供height属性设置,Line型高度就是strokeWidth,Circle型高度等于width | string
| null |
| width |
必填,进度条画布宽度,单位px。这里没有提供height属性设置,Line型高度就是strokeWidth,Circle型高度等于width | number
| null |
...
...
style/components/index.less
浏览文件 @
61d947db
...
...
@@ -8,4 +8,5 @@
@import "tab";
@import "tooltip";
@import "form";
@import "loading";
\ No newline at end of file
@import "loading";
@import "progress";
\ No newline at end of file
style/components/progress.less
浏览文件 @
61d947db
@prefixProgressClass: ant-progress;
.@{prefixProgressClass} {
&-line-inner {
display: inline-block;
svg {
vertical-align: middle;
}
}
&-line-text {
display: inline-block;
font-size: 1em;
margin-left: 10px;
line-height: 1;
.anticon {
font-size: 1.5em;
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录