macro.vm
3.9 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#*自定义宏*#
##分页
#macro(showPage $page)
<input type="hidden" name="currentPage" id="currentPage" value="${page.currentPage}"/>
#if($page != "")
<div>
<ul class="pagination pull-right" style="margin:0px;">
<li class="prev #if($page.isFirstPage())disabled#end" title="前一页">
#set ( $tmpCurr = $page.currentPage - 1 )
<a href="#if($page.isFirstPage())javascript:void(0)#else javascript:XUI.form.page(${tmpCurr},globalValidator)#end">
<i class="icon-double-angle-left"></i>
</a>
</li>
#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.form.page($i,globalValidator)">$index</a></li>
#end
<li class="next #if($page.isLastPage())disabled#end" title="后一页">
#set ( $tmpCurr = $page.currentPage + 1 )
<a href="#if($page.isLastPage())javascript:void(0)#else javascript:XUI.form.page(${tmpCurr},globalValidator)#end">
<i class="icon-double-angle-right"></i>
</a>
</li>
</ul>
</div>
<div style="float:right;">
<span style="line-height: 33px;" class="pull-left">显示数量<select id="pageSize" name="pageSize" value="${page.pageSize}" onchange="$('#queryBtn').click()">
#if(${page.pageSize}==10)
<option value="10" selected >10</option>
#else
<option value="10">10</option>
#end
#if(${page.pageSize}==15)
<option value="15" selected >15</option>
#else
<option value="15">15</option>
#end
#if(${page.pageSize}==20)
<option value="20" selected >20</option>
#else
<option value="20" >20</option>
#end
#if(${page.pageSize}==25)
<option value="25" selected >25</option>
#else
<option value="25">25</option>
#end
#if(${page.pageSize}==30)
<option value="30" selected >30</option>
#else
<option value="30">30</option>
#end
#if(${page.pageSize}==40)
<option value="40" selected >40</option>
#else
<option value="40">50</option>
#end
#if(${page.pageSize}==50)
<option value="50" selected >50</option>
#else
<option value="50">50</option>
#end
#if(${page.pageSize}==100)
<option value="100" selected >100</option>
#else
<option value="100">100</option>
#end
</select>
#set($currentPage=${page.currPage}+1)
查询出<strong>${page.totalCount}</strong>条数据,共<strong>${page.pageCount}</strong>页,当前第<strong>${page.currentPage}</strong>页
</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