feat: 增加分页工具栏和标签
This commit is contained in:
@@ -31,14 +31,15 @@ class OverviewController {
|
|||||||
"items" to result.content.map {
|
"items" to result.content.map {
|
||||||
val iframe = (sites.firstOrNull { site -> site.code == it.code }?.properties?.get("iframe")?: "false").toBoolean()
|
val iframe = (sites.firstOrNull { site -> site.code == it.code }?.properties?.get("iframe")?: "false").toBoolean()
|
||||||
mapOf(
|
mapOf(
|
||||||
"code" to code,
|
"code" to it.code,
|
||||||
"title" to it.title,
|
"title" to it.title,
|
||||||
"subtitle" to it.subtitle,
|
"subtitle" to it.subtitle,
|
||||||
"author" to it.author,
|
"author" to it.author,
|
||||||
"description" to it.description,
|
"description" to it.description,
|
||||||
"url" to it.url,
|
"url" to it.url,
|
||||||
"createTime" to it.createTime,
|
"createTime" to it.createTime,
|
||||||
"iframe" to iframe
|
"iframe" to iframe,
|
||||||
|
"category" to it.category,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
"total" to result.totalElements,
|
"total" to result.totalElements,
|
||||||
|
|||||||
@@ -1,3 +1,31 @@
|
|||||||
|
function pagination() {
|
||||||
|
return {
|
||||||
|
type: 'pagination',
|
||||||
|
layout: 'total,perPage,pager',
|
||||||
|
model: 'normal',
|
||||||
|
maxButtons: 10,
|
||||||
|
showPageInput: false,
|
||||||
|
perPageAvailable: [10, 15, 20],
|
||||||
|
activePage: '${page|default:1}',
|
||||||
|
total: '${total|default:0}',
|
||||||
|
className: 'text-right',
|
||||||
|
onEvent: {
|
||||||
|
change: {
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
actionType: 'reload',
|
||||||
|
componentId: 'news_list',
|
||||||
|
args: {
|
||||||
|
page: '${event.data.page}',
|
||||||
|
count: '${event.data.perPage}',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function overviewTab() {
|
function overviewTab() {
|
||||||
return {
|
return {
|
||||||
title: '总览',
|
title: '总览',
|
||||||
@@ -14,6 +42,18 @@ function overviewTab() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
body: [
|
body: [
|
||||||
|
{
|
||||||
|
type: 'action',
|
||||||
|
icon: 'fa fa-refresh',
|
||||||
|
label: '刷新',
|
||||||
|
className: 'mb-2',
|
||||||
|
actionType: 'reload',
|
||||||
|
target: 'news_list',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
...pagination(),
|
||||||
|
className: 'float-right',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
type: 'list',
|
type: 'list',
|
||||||
listItem: {
|
listItem: {
|
||||||
@@ -92,38 +132,34 @@ function overviewTab() {
|
|||||||
tpl: '${description}',
|
tpl: '${description}',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'tpl',
|
type: 'wrapper',
|
||||||
className: 'text-sm font-medium mt-1 text-dark',
|
size: 'none',
|
||||||
tpl: '${DATETOSTR(DATE(createTime), \'YYYY-MM-DD HH:mm\')} ${author}',
|
className: 'mt-2',
|
||||||
},
|
body: [
|
||||||
]
|
{
|
||||||
},
|
type: 'tag',
|
||||||
|
label: '${DATETOSTR(DATE(createTime), \'YYYY-MM-DD HH:mm\')}',
|
||||||
|
displayMode: 'rounded',
|
||||||
|
color: '#4096ff',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'pagination',
|
type: 'tag',
|
||||||
layout: 'total,perPage,pager',
|
label: '${category}',
|
||||||
model: 'normal',
|
displayMode: 'rounded',
|
||||||
maxButtons: 10,
|
color: '#2fa15d',
|
||||||
showPageInput: false,
|
},
|
||||||
perPageAvailable: [10, 15, 20],
|
|
||||||
activePage: '${page|default:1}',
|
|
||||||
total: '${total|default:0}',
|
|
||||||
className: 'text-right',
|
|
||||||
onEvent: {
|
|
||||||
change: {
|
|
||||||
actions: [
|
|
||||||
{
|
{
|
||||||
actionType: 'reload',
|
type: 'tag',
|
||||||
componentId: 'news_list',
|
label: '${author}',
|
||||||
args: {
|
displayMode: 'rounded',
|
||||||
page: '${event.data.page}',
|
color: '#ff8888',
|
||||||
count: '${event.data.perPage}',
|
},
|
||||||
}
|
]
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
pagination(),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user