Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
bca1afd3
提交
bca1afd3
authored
5月 08, 2019
作者:
sin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- 添加一个搜索功能呢
上级
23be2069
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
52 行增加
和
6 行删除
+52
-6
OrderRefundsList.js
admin-web/src/pages/OrderRefunds/OrderRefundsList.js
+9
-3
TableSearch.js
admin-web/src/pages/OrderRefunds/TableSearch.js
+43
-3
没有找到文件。
admin-web/src/pages/OrderRefunds/OrderRefundsList.js
浏览文件 @
bca1afd3
...
@@ -19,9 +19,15 @@ import dictionary from '../../utils/dictionary';
...
@@ -19,9 +19,15 @@ import dictionary from '../../utils/dictionary';
class
OrderRefundsList
extends
PureComponent
{
class
OrderRefundsList
extends
PureComponent
{
componentDidMount
()
{
componentDidMount
()
{
// 查询 list
// 查询 list
this
.
queryList
({
index
:
1
});
this
.
queryList
({
index
:
1
}
,
{}
);
}
}
handleSearch
=
searchParams
=>
{
const
{
orderRefunds
}
=
this
.
props
;
const
{
index
,
pageSize
}
=
orderRefunds
;
this
.
queryList
({
index
,
pageSize
},
searchParams
);
};
queryList
=
({
index
=
0
,
pageSize
=
10
},
searchParams
)
=>
{
queryList
=
({
index
=
0
,
pageSize
=
10
},
searchParams
)
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
dispatch
}
=
this
.
props
;
dispatch
({
dispatch
({
...
@@ -40,7 +46,7 @@ class OrderRefundsList extends PureComponent {
...
@@ -40,7 +46,7 @@ class OrderRefundsList extends PureComponent {
handleTableChange
=
pagination
=>
{
handleTableChange
=
pagination
=>
{
const
{
pageSize
,
current
}
=
pagination
;
const
{
pageSize
,
current
}
=
pagination
;
this
.
queryList
({
pageSize
,
index
:
current
});
this
.
queryList
({
pageSize
,
index
:
current
}
,
{}
);
};
};
render
()
{
render
()
{
...
@@ -125,7 +131,7 @@ class OrderRefundsList extends PureComponent {
...
@@ -125,7 +131,7 @@ class OrderRefundsList extends PureComponent {
<
PageHeaderWrapper
>
<
PageHeaderWrapper
>
<
Card
>
<
Card
>
<
div
className
=
{
styles
.
tableListForm
}
>
<
div
className
=
{
styles
.
tableListForm
}
>
<
TableSearch
/>
<
TableSearch
handleSearch
=
{
this
.
handleSearch
}
/
>
<
/div
>
<
/div
>
<
Tabs
defaultActiveKey
=
{
null
}
onChange
=
{
this
.
handleTabsChange
}
>
<
Tabs
defaultActiveKey
=
{
null
}
onChange
=
{
this
.
handleTabsChange
}
>
...
...
admin-web/src/pages/OrderRefunds/TableSearch.js
浏览文件 @
bca1afd3
...
@@ -9,11 +9,51 @@ const FormItem = Form.Item;
...
@@ -9,11 +9,51 @@ const FormItem = Form.Item;
* @type {React.ComponentClass<RcBaseFormProps & Omit<FormComponentProps, keyof FormComponentProps>>}
* @type {React.ComponentClass<RcBaseFormProps & Omit<FormComponentProps, keyof FormComponentProps>>}
*/
*/
const
TableSearch
=
Form
.
create
()(
props
=>
{
const
TableSearch
=
Form
.
create
()(
props
=>
{
const
{
getFieldDecorator
}
=
props
.
form
;
const
{
getFieldDecorator
,
form
,
handleSearch
}
=
props
.
form
;
function
onSubmit
()
{}
function
onSubmit
(
e
)
{
e
.
preventDefault
();
function
handleFormReset
()
{}
form
.
validateFields
((
err
,
fields
)
=>
{
const
buildTime
=
(
fieldValue
,
key
)
=>
{
const
res
=
{};
if
(
fieldValue
&&
fieldValue
.
length
>=
2
)
{
const
keySuffix
=
key
.
substring
(
0
,
1
).
toUpperCase
()
+
key
.
substring
(
1
);
res
[
`start
${
keySuffix
}
`
]
=
fieldValue
[
0
].
format
(
'YYYY-MM-DD HH:mm:ss'
);
res
[
`end
${
keySuffix
}
`
]
=
fieldValue
[
1
].
format
(
'YYYY-MM-DD HH:mm:ss'
);
}
return
res
;
};
const
timeFields
=
[
'createTime'
];
const
buildSearchParams
=
fields2
=>
{
let
res
=
{};
Object
.
keys
(
fields
).
map
(
objectKey
=>
{
const
fieldValue
=
fields2
[
objectKey
];
if
(
timeFields
.
indexOf
(
objectKey
)
!==
-
1
)
{
// 处理时间
res
=
{
...
res
,
...
buildTime
(
fieldValue
,
objectKey
),
};
}
else
if
(
fieldValue
!==
undefined
)
{
res
[
objectKey
]
=
fieldValue
;
}
return
true
;
});
return
res
;
};
const
searchParams
=
buildSearchParams
(
fields
);
if
(
handleSearch
)
{
handleSearch
(
searchParams
);
}
});
}
function
handleFormReset
()
{
form
.
resetFields
();
}
return
(
return
(
<
Form
onSubmit
=
{
onSubmit
}
layout
=
"inline"
>
<
Form
onSubmit
=
{
onSubmit
}
layout
=
"inline"
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论