This commit is contained in:
fengchuanhn@gmail.com
2026-05-22 15:01:47 +08:00
parent edaaf4d469
commit c8d7d3e8f3
2 changed files with 13 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ function adminRequest(token, path, options = {}) {
* page?: number, * page?: number,
* pageSize?: number, * pageSize?: number,
* username?: string, * username?: string,
* deviceSerial?: string,
* oemId?: number | null, * oemId?: number | null,
* agentId?: number | null, * agentId?: number | null,
* roleId?: number | null, * roleId?: number | null,
@@ -27,7 +28,7 @@ function adminRequest(token, path, options = {}) {
*/ */
export function listAdminUsersApi( export function listAdminUsersApi(
token, token,
{ page = 1, pageSize = 20, username, oemId, agentId, roleId } = {}, { page = 1, pageSize = 20, username, deviceSerial, oemId, agentId, roleId } = {},
) { ) {
const query = new URLSearchParams({ const query = new URLSearchParams({
page: String(page), page: String(page),
@@ -35,6 +36,8 @@ export function listAdminUsersApi(
}); });
const trimmed = username?.trim(); const trimmed = username?.trim();
if (trimmed) query.set("username", trimmed); if (trimmed) query.set("username", trimmed);
const serial = deviceSerial?.trim();
if (serial) query.set("device_serial", serial);
if (oemId != null) query.set("oem_id", String(oemId)); if (oemId != null) query.set("oem_id", String(oemId));
if (agentId != null) query.set("agent_id", String(agentId)); if (agentId != null) query.set("agent_id", String(agentId));
if (roleId != null) query.set("role_id", String(roleId)); if (roleId != null) query.set("role_id", String(roleId));

View File

@@ -35,6 +35,7 @@ const agentOptions = ref([]);
const filters = ref({ const filters = ref({
username: "", username: "",
device_serial: "",
oem_id: null, oem_id: null,
agent_id: null, agent_id: null,
}); });
@@ -122,6 +123,7 @@ async function loadUsers() {
page: page.value, page: page.value,
pageSize: pageSize.value, pageSize: pageSize.value,
username: filters.value.username, username: filters.value.username,
deviceSerial: filters.value.device_serial,
oemId: filters.value.oem_id, oemId: filters.value.oem_id,
agentId: filters.value.agent_id, agentId: filters.value.agent_id,
}); });
@@ -151,7 +153,7 @@ async function applyFilters() {
} }
async function resetFilters() { async function resetFilters() {
filters.value = { username: "", oem_id: null, agent_id: null }; filters.value = { username: "", device_serial: "", oem_id: null, agent_id: null };
page.value = 1; page.value = 1;
await loadUsers(); await loadUsers();
} }
@@ -305,6 +307,12 @@ onMounted(async () => {
class="admin-users__search" class="admin-users__search"
@keyup.enter="applyFilters" @keyup.enter="applyFilters"
/> />
<InputText
v-model="filters.device_serial"
placeholder="搜索设备码"
class="admin-users__search"
@keyup.enter="applyFilters"
/>
<Select <Select
v-model="filters.oem_id" v-model="filters.oem_id"
:options="oemOptions" :options="oemOptions"