Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
45f01f1f
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,发现更多精彩内容 >>
提交
45f01f1f
编写于
12月 17, 2015
作者:
dqaria
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update style
上级
f9135426
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
59 addition
and
25 deletion
+59
-25
components/transfer/index.jsx
components/transfer/index.jsx
+33
-8
components/transfer/list.jsx
components/transfer/list.jsx
+5
-1
components/transfer/search.jsx
components/transfer/search.jsx
+7
-1
style/components/transfer.less
style/components/transfer.less
+14
-15
未找到文件。
components/transfer/index.jsx
浏览文件 @
45f01f1f
...
...
@@ -24,14 +24,25 @@ class Transfer extends Component {
}
checkDirection
(
direction
)
{
//
const { filterKey } = this.props;
const
{
filterKey
}
=
this
.
props
;
let
{
dataSource
}
=
this
.
state
;
let
result
=
false
;
if
(
direction
===
'
right
'
)
{
dataSource
.
forEach
((
data
)
=>
{
if
(
!
data
[
filterKey
]
&&
data
.
checked
)
{
result
=
true
;
}
});
}
else
{
dataSource
.
forEach
((
data
)
=>
{
//if ( !data[filterKey] && data.checked ) {
//}
if
(
data
[
filterKey
]
&&
data
.
checked
)
{
result
=
true
;
}
});
return
true
;
}
return
result
;
}
moveTo
(
direction
)
{
...
...
@@ -109,6 +120,18 @@ class Transfer extends Component {
}
}
handleClear
(
direction
)
{
if
(
direction
===
'
left
'
)
{
this
.
setState
({
'
leftFilter
'
:
''
,
});
}
else
{
this
.
setState
({
'
rightFilter
'
:
''
,
});
}
}
matchFilter
(
text
,
filterText
)
{
const
regex
=
new
RegExp
(
filterText
);
return
text
.
match
(
regex
);
...
...
@@ -134,8 +157,8 @@ class Transfer extends Component {
let
leftDataSource
=
[];
let
rightDataSource
=
[];
let
leftActive
=
false
;
let
rightActive
=
false
;
let
leftActive
=
this
.
checkDirection
(
'
left
'
)
;
let
rightActive
=
this
.
checkDirection
(
'
right
'
)
;
dataSource
.
map
((
item
)
=>
{
// filter item
...
...
@@ -155,6 +178,7 @@ class Transfer extends Component {
dataSource
=
{
leftDataSource
}
filter
=
{
leftFilter
}
handleFilter
=
{
this
.
handleFilter
.
bind
(
this
,
'
left
'
)
}
handleClear
=
{
this
.
handleClear
.
bind
(
this
,
'
left
'
)
}
handleSelect
=
{
this
.
handleSelect
.
bind
(
this
)
}
handleSelectAll
=
{
this
.
handleSelectAll
.
bind
(
this
,
'
left
'
)
}
position
=
"left"
...
...
@@ -169,6 +193,7 @@ class Transfer extends Component {
dataSource
=
{
rightDataSource
}
filter
=
{
rightFilter
}
handleFilter
=
{
this
.
handleFilter
.
bind
(
this
,
'
right
'
)
}
handleClear
=
{
this
.
handleClear
.
bind
(
this
,
'
right
'
)
}
handleSelect
=
{
this
.
handleSelect
.
bind
(
this
)
}
handleSelectAll
=
{
this
.
handleSelectAll
.
bind
(
this
,
'
right
'
)
}
position
=
"right"
...
...
components/transfer/list.jsx
浏览文件 @
45f01f1f
...
...
@@ -24,6 +24,10 @@ class TransferList extends Component {
this
.
props
.
handleFilter
(
e
);
}
handleClear
()
{
this
.
props
.
handleClear
();
}
getGlobalCheckStatus
()
{
let
{
dataSource
}
=
this
.
props
;
...
...
@@ -92,7 +96,7 @@ class TransferList extends Component {
</
div
>
}
{
bodyDom
?
bodyDom
:
<
div
className
=
{
`
${
prefixCls
}
-body`
}
>
<
div
className
=
{
`
${
prefixCls
}
-body-search-wrapper`
}
>
<
Search
className
=
{
`
${
prefixCls
}
-body-search-bar`
}
onChange
=
{
this
.
handleFilter
.
bind
(
this
)
}
value
=
{
filter
}
/>
<
Search
className
=
{
`
${
prefixCls
}
-body-search-bar`
}
onChange
=
{
this
.
handleFilter
.
bind
(
this
)
}
handleClear
=
{
this
.
handleClear
.
bind
(
this
)
}
value
=
{
filter
}
/>
</
div
>
<
ul
className
=
""
>
{
dataSource
.
map
((
item
)
=>
{
...
...
components/transfer/search.jsx
浏览文件 @
45f01f1f
...
...
@@ -14,7 +14,13 @@ class Search extends Component {
render
()
{
const
{
placeholder
,
value
,
prefixCls
}
=
this
.
props
;
return
<
input
placeholder
=
{
placeholder
}
className
=
{
prefixCls
+
'
ant-input
'
}
value
=
{
value
}
ref
=
"input"
onChange
=
{
this
.
handleChange
.
bind
(
this
)
}
/>;
return
<
div
>
<
input
placeholder
=
{
placeholder
}
className
=
{
prefixCls
+
'
ant-input
'
}
value
=
{
value
}
ref
=
"input"
onChange
=
{
this
.
handleChange
.
bind
(
this
)
}
/>
{
value
&&
value
.
length
>
0
?
<
a
href
=
"javascirpt:;"
className
=
{
prefixCls
+
'
-action
'
}
onClick
=
{
this
.
props
.
handleClear
}
><
i
className
=
"anticon anticon-cross-circle"
></
i
></
a
>
:
<
span
className
=
{
prefixCls
+
'
-action
'
}
><
i
className
=
"anticon anticon-search"
></
i
></
span
>
}
</
div
>;
}
}
...
...
style/components/transfer.less
浏览文件 @
45f01f1f
...
...
@@ -10,6 +10,20 @@
width: 160px;
height: 191px;
&-search {
&-action {
color: #ccc;
position: absolute;
top: 2px;
right: 2px;
width: 32px;
height: 32px;
line-height: 32px;
text-align: center;
font-size: 14px;
}
}
&-header {
padding: 7px 14px;
border-radius: 5px 5px 0 0;
...
...
@@ -37,21 +51,6 @@
padding: 4px;
width: 100%;
&:after {
//"\E631" cross-circle
content: "\E68C";
color: #ccc;
position: absolute;
top: 2px;
right: 2px;
font-family: "anticon";
width: 32px;
height: 32px;
line-height: 32px;
text-align: center;
font-size: 14px;
}
}
ul {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录