Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
c29f22fe
Commit
c29f22fe
authored
Jan 18, 2018
by
valleykid
Committed by
陈帅
Jan 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复TableList验证误触发 (#756)
* Add *bak in gitignore * 修复TableList表单验证误触发问题 fix #755
parent
3f2263d4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
14 deletions
+42
-14
.gitignore
.gitignore
+1
-0
src/routes/List/TableList.js
src/routes/List/TableList.js
+41
-14
No files found.
.gitignore
View file @
c29f22fe
...
@@ -18,4 +18,5 @@ yarn-error.log
...
@@ -18,4 +18,5 @@ yarn-error.log
.idea
.idea
yarn.lock
yarn.lock
package-lock.json
package-lock.json
*bak
jsconfig.json
jsconfig.json
src/routes/List/TableList.js
View file @
c29f22fe
...
@@ -10,6 +10,36 @@ const FormItem = Form.Item;
...
@@ -10,6 +10,36 @@ const FormItem = Form.Item;
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
const
getValue
=
obj
=>
Object
.
keys
(
obj
).
map
(
key
=>
obj
[
key
]).
join
(
'
,
'
);
const
getValue
=
obj
=>
Object
.
keys
(
obj
).
map
(
key
=>
obj
[
key
]).
join
(
'
,
'
);
const
CreateForm
=
Form
.
create
()((
props
)
=>
{
const
{
modalVisible
,
addInputValue
,
parent
,
form
}
=
props
;
const
okHandle
=
()
=>
{
form
.
validateFields
((
err
/* , fieldsValue */
)
=>
{
if
(
err
)
return
;
parent
.
handleAdd
();
});
};
return
(
<
Modal
title
=
"
新建规则
"
visible
=
{
modalVisible
}
onOk
=
{
okHandle
}
onCancel
=
{()
=>
parent
.
handleModalVisible
()}
>
<
FormItem
labelCol
=
{{
span
:
5
}}
wrapperCol
=
{{
span
:
15
}}
label
=
"
描述
"
>
{
form
.
getFieldDecorator
(
'
desc
'
,
{
rules
:
[{
required
:
true
,
message
:
'
Please input some description...
'
}],
})(
<
Input
placeholder
=
"
请输入
"
onChange
=
{
parent
.
handleAddInput
}
value
=
{
addInputValue
}
/
>
)}
<
/FormItem
>
<
/Modal
>
);
});
@
connect
(({
rule
,
loading
})
=>
({
@
connect
(({
rule
,
loading
})
=>
({
rule
,
rule
,
loading
:
loading
.
models
.
rule
,
loading
:
loading
.
models
.
rule
,
...
@@ -279,6 +309,12 @@ export default class TableList extends PureComponent {
...
@@ -279,6 +309,12 @@ export default class TableList extends PureComponent {
<
/Menu
>
<
/Menu
>
);
);
const
parentMethods
=
{
handleAdd
:
this
.
handleAdd
,
handleModalVisible
:
this
.
handleModalVisible
,
handleAddInput
:
this
.
handleAddInput
,
};
return
(
return
(
<
PageHeaderLayout
title
=
"
查询表格
"
>
<
PageHeaderLayout
title
=
"
查询表格
"
>
<
Card
bordered
=
{
false
}
>
<
Card
bordered
=
{
false
}
>
...
@@ -312,20 +348,11 @@ export default class TableList extends PureComponent {
...
@@ -312,20 +348,11 @@ export default class TableList extends PureComponent {
/
>
/
>
<
/div
>
<
/div
>
<
/Card
>
<
/Card
>
<
Modal
<
CreateForm
title
=
"
新建规则
"
parent
=
{
parentMethods
}
visible
=
{
modalVisible
}
modalVisible
=
{
modalVisible
}
onOk
=
{
this
.
handleAdd
}
addInputValue
=
{
addInputValue
}
onCancel
=
{()
=>
this
.
handleModalVisible
()}
/
>
>
<
FormItem
labelCol
=
{{
span
:
5
}}
wrapperCol
=
{{
span
:
15
}}
label
=
"
描述
"
>
<
Input
placeholder
=
"
请输入
"
onChange
=
{
this
.
handleAddInput
}
value
=
{
addInputValue
}
/
>
<
/FormItem
>
<
/Modal
>
<
/PageHeaderLayout
>
<
/PageHeaderLayout
>
);
);
}
}
...
...
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