[2024-08-09](UPDATE): 分页查询

This commit is contained in:
june 2024-08-10 20:32:17 +08:00
parent 5feaf4ef49
commit e841b84a4e

View File

@ -83,26 +83,44 @@
<option value="50">50条/页</option>
</select>
</li>
<!-- 上一页 -->
<li class="page-item{{if eq .Data.CurrentPage 1}} disabled{{end}}">
<a class="page-link" href="javascript:void(0);" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
</li>
<!-- 当前页左边是否显示 ... -->
{{if .Data.LeftHasMore}}
<li class="page-item"><a class="page-link" href="javascript:void(0);" data-page="1">1</a></li>
<li class="page-item active"><a class="page-link" href="javascript:void(0);" data-page="2">2</a></li>
<li class="page-item"><a class="page-link" href="javascript:void(0);" data-page="3">3</a></li>
<!-- 省略部分页码 -->
<li class="page-item disabled"><span class="page-link">...</span></li>
<li class="page-item"><a class="page-link" href="javascript:void(0);" data-page="9">9</a></li>
<li class="page-item"><a class="page-link" href="javascript:void(0);" data-page="10">10</a></li>
{{end}}
<!-- 当前页左边显示按钮 -->
{{ range .Data.LeftPages }}
<li class="page-item"><a class="page-link" href="javascript:void(0);" data-page="{{.}}">{{.}}</a></li>
{{end}}
<!-- 当前页 -->
<li class="page-item active"><a class="page-link" href="javascript:void(0);" data-page="{{.Data.CurrentPage}}">{{.Data.CurrentPage}}</a></li>
<!-- 当前页右边显示按钮 -->
{{ range .Data.RightPages }}
<li class="page-item"><a class="page-link" href="javascript:void(0);" data-page="{{.}}">{{.}}</a></li>
{{end}}
<!-- 当前页右边是否显示 ... -->
{{if .Data.RightHasMore}}
<li class="page-item disabled"><span class="page-link">...</span></li>
<li class="page-item"><a class="page-link" href="javascript:void(0);" data-page="{{.Data.NumPages}}">{{.Data.NumPages}}</a></li>
{{end}}
<!-- 下一页 -->
<li class="page-item {{if eq .Data.CurrentPage .Data.NumPages}} disabled{{end}}">
<a class="page-link" href="javascript:void(0);" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
<!-- 跳到第x页 -->
<li class="page-item disabled ml-2"><span class="page-link" style="border: none">到第</span></li>
<li class="page-item"><input type="text" class="form-control" style="max-width: 40px;max-height: 31px"></li>
<li class="page-item ml-1 disabled"><span class="page-link" style="border: none"></span></li>
<li class="page-item ml-2"><a class="page-link" href="javascript:void(0);">确定</a></li>
<!-- 数据总数 -->
<li class="page-item disabled ml-2"><span class="page-link" style="border: none">共 {{.Data.Total}} 条</span></li>
</ul>
</nav>