feat: 测试信息页增加每页记录数选择(20/50/100)
This commit is contained in:
@@ -99,7 +99,9 @@ async function searchData(page = 1) {
|
|||||||
const dateTo = document.getElementById("search-date-to").value;
|
const dateTo = document.getElementById("search-date-to").value;
|
||||||
const v = VIEWS[currentView];
|
const v = VIEWS[currentView];
|
||||||
|
|
||||||
const params = new URLSearchParams({ page, per_page: 20 });
|
const perPage = parseInt(document.getElementById("per-page").value) || 20;
|
||||||
|
|
||||||
|
const params = new URLSearchParams({ page, per_page: perPage });
|
||||||
if (serial) params.set("serial", serial);
|
if (serial) params.set("serial", serial);
|
||||||
if (dateFrom) params.set("date_from", dateFrom);
|
if (dateFrom) params.set("date_from", dateFrom);
|
||||||
if (dateTo) params.set("date_to", dateTo);
|
if (dateTo) params.set("date_to", dateTo);
|
||||||
|
|||||||
@@ -23,6 +23,14 @@
|
|||||||
</label>
|
</label>
|
||||||
<button onclick="searchData(1)" class="btn-search">搜索</button>
|
<button onclick="searchData(1)" class="btn-search">搜索</button>
|
||||||
<button onclick="exportCSV()" class="btn-export">导出 CSV</button>
|
<button onclick="exportCSV()" class="btn-export">导出 CSV</button>
|
||||||
|
<label style="margin-left:16px;">
|
||||||
|
每页:
|
||||||
|
<select id="per-page" onchange="searchData(1)" style="width:70px;">
|
||||||
|
<option value="20">20</option>
|
||||||
|
<option value="50">50</option>
|
||||||
|
<option value="100">100</option>
|
||||||
|
</select>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table id="test-data-table">
|
<table id="test-data-table">
|
||||||
|
|||||||
Reference in New Issue
Block a user