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
P
pro-blocks
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
pro-blocks
Commits
bdc92d5c
Commit
bdc92d5c
authored
Jan 17, 2019
by
何乐
Committed by
陈帅
Jan 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enhance TableList: auto search after editing (#3380)
parent
acd67d21
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
14 deletions
+11
-14
mock/rule.js
mock/rule.js
+1
-8
src/pages/List/TableList.js
src/pages/List/TableList.js
+7
-3
src/services/api.js
src/services/api.js
+3
-3
No files found.
mock/rule.js
View file @
bdc92d5c
...
@@ -122,14 +122,7 @@ function postRule(req, res, u, b) {
...
@@ -122,14 +122,7 @@ function postRule(req, res, u, b) {
break
;
break
;
}
}
const
result
=
{
return
getRule
(
req
,
res
,
u
);
list
:
tableListDataSource
,
pagination
:
{
total
:
tableListDataSource
.
length
,
},
};
return
res
.
json
(
result
);
}
}
export
default
{
export
default
{
...
...
src/pages/List/TableList.js
View file @
bdc92d5c
...
@@ -483,12 +483,16 @@ class TableList extends PureComponent {
...
@@ -483,12 +483,16 @@ class TableList extends PureComponent {
handleUpdate
=
fields
=>
{
handleUpdate
=
fields
=>
{
const
{
dispatch
}
=
this
.
props
;
const
{
dispatch
}
=
this
.
props
;
const
{
formValues
}
=
this
.
state
;
dispatch
({
dispatch
({
type
:
'
rule/update
'
,
type
:
'
rule/update
'
,
payload
:
{
payload
:
{
name
:
fields
.
name
,
query
:
formValues
,
desc
:
fields
.
desc
,
body
:
{
key
:
fields
.
key
,
name
:
fields
.
name
,
desc
:
fields
.
desc
,
key
:
fields
.
key
,
},
},
},
});
});
...
...
src/services/api.js
View file @
bdc92d5c
...
@@ -33,11 +33,11 @@ export async function addRule(params) {
...
@@ -33,11 +33,11 @@ export async function addRule(params) {
});
});
}
}
export
async
function
updateRule
(
params
)
{
export
async
function
updateRule
(
params
=
{}
)
{
return
request
(
'
/api/rule
'
,
{
return
request
(
`/api/rule?
${
stringify
(
params
.
query
)}
`
,
{
method
:
'
POST
'
,
method
:
'
POST
'
,
body
:
{
body
:
{
...
params
,
...
params
.
body
,
method
:
'
update
'
,
method
:
'
update
'
,
},
},
});
});
...
...
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