Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nouiWithSpringMVC
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gechengyang
nouiWithSpringMVC
Commits
9795a4c5
Commit
9795a4c5
authored
Sep 14, 2022
by
WeiCong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.对返回list字段,增加__data后缀配置规则,这样返回的list数据是集合,而不加则返回map(包含data属性和pagenation属性)
parent
6d498c6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
13 deletions
+20
-13
AbstractCommonController.java
...resentation/noui/controller/AbstractCommonController.java
+20
-13
No files found.
src/main/java/org/sss/presentation/noui/controller/AbstractCommonController.java
View file @
9795a4c5
...
...
@@ -231,27 +231,34 @@ public abstract class AbstractCommonController {
}
private
void
doHandleReturnDataForModuleList
(
Alias
alias
,
String
aliasKey
,
Map
<
String
,
Object
>
dataMap
,
IModuleList
moduleList
,
List
<
Map
>
lst
,
NoUiRequest
noUiRequest
)
{
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
//查询数据
item
.
put
(
Constants
.
DATA
,
lst
);
if
(
noUiRequest
.
isSelByPagination
())
{
//分页信息
if
(
aliasKey
.
endsWith
(
"__data"
)){
//直接返回结果集
dataMap
.
put
(
aliasKey
,
lst
);
}
else
{
//对该list封装一层,data属性表示实际结果集;pagination属性(分页请求下才有)表示分页信息
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
//查询数据
item
.
put
(
Constants
.
DATA
,
lst
);
if
(
noUiRequest
.
isSelByPagination
())
{
//分页信息
/*int total = moduleList.fullSize();
int index = moduleList.getPage();
Map<String, Object> pagination = new HashMap<>();
pagination.put(Constants.PAGINATION_TOTAL, total);
pagination.put(Constants.PAGINATION_INDEX, index);
item.put(Constants.PAGINATION, pagination);*/
Map
<
String
,
Object
>
paginationInfo
=
AbstractCache
.
getPageInfo
(
moduleList
);
if
(
paginationInfo
!=
null
){
item
.
put
(
Constants
.
PAGINATION
,
paginationInfo
);
Map
<
String
,
Object
>
paginationInfo
=
AbstractCache
.
getPageInfo
(
moduleList
);
if
(
paginationInfo
!=
null
){
item
.
put
(
Constants
.
PAGINATION
,
paginationInfo
);
}
}
if
(
alias
.
isSingleLst
())
{
dataMap
.
put
(
Constants
.
SIGNLE_LST
,
item
);
}
else
{
dataMap
.
put
(
aliasKey
,
item
);
}
}
if
(
alias
.
isSingleLst
())
{
dataMap
.
put
(
Constants
.
SIGNLE_LST
,
item
);
}
else
{
dataMap
.
put
(
aliasKey
,
item
);
}
}
private
Map
<
String
,
Object
>
handleReturnData
(
String
eventType
,
NoUiContext
context
,
NoUiRequest
noUiRequest
,
Alias
alias
)
{
...
...
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