1
This commit is contained in:
@@ -20,6 +20,7 @@ function adminRequest(token, path, options = {}) {
|
||||
* page?: number,
|
||||
* pageSize?: number,
|
||||
* username?: string,
|
||||
* deviceSerial?: string,
|
||||
* oemId?: number | null,
|
||||
* agentId?: number | null,
|
||||
* roleId?: number | null,
|
||||
@@ -27,7 +28,7 @@ function adminRequest(token, path, options = {}) {
|
||||
*/
|
||||
export function listAdminUsersApi(
|
||||
token,
|
||||
{ page = 1, pageSize = 20, username, oemId, agentId, roleId } = {},
|
||||
{ page = 1, pageSize = 20, username, deviceSerial, oemId, agentId, roleId } = {},
|
||||
) {
|
||||
const query = new URLSearchParams({
|
||||
page: String(page),
|
||||
@@ -35,6 +36,8 @@ export function listAdminUsersApi(
|
||||
});
|
||||
const trimmed = username?.trim();
|
||||
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 (agentId != null) query.set("agent_id", String(agentId));
|
||||
if (roleId != null) query.set("role_id", String(roleId));
|
||||
|
||||
@@ -35,6 +35,7 @@ const agentOptions = ref([]);
|
||||
|
||||
const filters = ref({
|
||||
username: "",
|
||||
device_serial: "",
|
||||
oem_id: null,
|
||||
agent_id: null,
|
||||
});
|
||||
@@ -122,6 +123,7 @@ async function loadUsers() {
|
||||
page: page.value,
|
||||
pageSize: pageSize.value,
|
||||
username: filters.value.username,
|
||||
deviceSerial: filters.value.device_serial,
|
||||
oemId: filters.value.oem_id,
|
||||
agentId: filters.value.agent_id,
|
||||
});
|
||||
@@ -151,7 +153,7 @@ async function applyFilters() {
|
||||
}
|
||||
|
||||
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;
|
||||
await loadUsers();
|
||||
}
|
||||
@@ -305,6 +307,12 @@ onMounted(async () => {
|
||||
class="admin-users__search"
|
||||
@keyup.enter="applyFilters"
|
||||
/>
|
||||
<InputText
|
||||
v-model="filters.device_serial"
|
||||
placeholder="搜索设备码"
|
||||
class="admin-users__search"
|
||||
@keyup.enter="applyFilters"
|
||||
/>
|
||||
<Select
|
||||
v-model="filters.oem_id"
|
||||
:options="oemOptions"
|
||||
|
||||
Reference in New Issue
Block a user