macro.vm
1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#*自定义宏*#
##分页
#macro(showPage $page)
#if($page != "")
<div>
<ul class="pagination pull-right" style="margin:0px;">
## #set($page.isFirstPage=$page.currentPage == 1)
## #set($page.isLastPage=$page.currentPage == $page.totalCount)
<li class="prev #if($page.isFirstPage())disabled#end">
#set ( $tmpCurr = $page.currentPage - 1 )
<a href="#if($page.isFirstPage())javascript:void(0)#else javascript:XUI.Page(${tmpCurr})#end">
<i class="icon-double-angle-left"></i>
</a>
</li>
#if(${page.currentPage}>4)
<li><a href="javascript:XUI.Page(1)">首页</a></li>
#end
#foreach($index in $!{webUtils.pageSplit($page.currentPage,$page.pageCount,6)})
#set( $i = $index )
<li #if($index == $page.currentPage)class="active" #end><a href="javascript:XUI.Page(${i})">$index</a></li>
#end
#if(${page.currentPage}+2<${page.pageCount})
<li><a href="javascript:XUI.Page(${page.pageCount})">末页</a></li>
#end
<li class="next #if($page.isLastPage())disabled#end">
#set ( $tmpCurr = $page.currentPage + 1 )
<a href="#if($page.isLastPage())javascript:void(0)#else javascript:XUI.Page(${tmpCurr})#end">
<i class="icon-double-angle-right"></i>
</a>
</li>
</ul>
</div>
<div style="float:right;">
<span>
查询出<strong>$!{page.totalCount}</strong>条数据,共<strong>${page.pageCount}</strong>页,转到 <input type="text" id="changePage" max="${page.pageCount}" curr="${page.currentPage}"size="3"/> 页 <a href="javascript:XUI.ChangePage()" class="btn-sm btn-primary" style="display: inline-block;">确定</a>
</span>
</div>
#end
#end
##排序
#macro(sorting $obj $field)
#if($obj && $obj.orderField == $field)
class="sorting_$obj.orderFieldType" data-orderFieldType="$obj.orderFieldNextType"
#else
class="sorting" data-orderFieldType="DESC"
#end
data-orderField="$field"
#end
#macro(vn)
20160412
#end