From 8e0aa1df10036183ed7a42e9d1c7a3428fdee1c1 Mon Sep 17 00:00:00 2001 From: WuYongJie Date: Wed, 11 Mar 2026 20:48:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B5=84=E4=BA=A7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=98=BE=E7=A4=BA=E5=B9=B6=E8=B0=83=E6=95=B4=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E8=80=85=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/equipment/EquipmentList.vue | 43 ++++++++++++++----- .../settings/components/PersonManagement.vue | 43 ++++++++++++++++--- 2 files changed, 70 insertions(+), 16 deletions(-) diff --git a/frontend/src/views/equipment/EquipmentList.vue b/frontend/src/views/equipment/EquipmentList.vue index 865754e..f0b4560 100644 --- a/frontend/src/views/equipment/EquipmentList.vue +++ b/frontend/src/views/equipment/EquipmentList.vue @@ -55,7 +55,7 @@
- +
- - + - - + - - + diff --git a/frontend/src/views/settings/components/PersonManagement.vue b/frontend/src/views/settings/components/PersonManagement.vue index 24f7b5d..f184c5d 100644 --- a/frontend/src/views/settings/components/PersonManagement.vue +++ b/frontend/src/views/settings/components/PersonManagement.vue @@ -12,16 +12,16 @@ type="text" class="input-apple" placeholder="输入花名 / 姓名 / 证件编号" - @keyup.enter="fetchPersons" + @keyup.enter="handleSearch" />
- - +
@@ -93,6 +93,19 @@
@@ -100,21 +100,36 @@ {{ equipment.equipment_code }} +
- {{ equipment.equipment_name }} + + {{ equipment.equipment_name }} + 父 子 ({{ equipment.children?.length }}个配件)
{{ equipment.equipment_model || '-' }} + + {{ equipment.equipment_model || '-' }} + + {{ equipment.equipment_type }}{{ equipment.department?.name || '-' }} - - + + + {{ equipment.department?.name || '-' }} + + + + + + {{ formatCurrencyNoFraction(Number(equipment.unit_price || 0)) }} @@ -141,13 +156,19 @@ └ {{ child.equipment_code }} +
- {{ child.equipment_name }} + + {{ child.equipment_name }} + 配件
{{ child.equipment_model || '-' }} + + {{ child.equipment_model || '-' }} + + {{ child.equipment_type }} - -
+
+

+ 第 {{ currentPage }} / {{ totalPages }} 页,每页 {{ pageSize }} 人 +

+
+ + +
+

暂无使用者数据。

@@ -211,6 +224,8 @@ import { batchImportPersons } from '@/api/batchImport' const persons = ref([]) const total = ref(0) +const currentPage = ref(1) +const pageSize = 30 const listLoading = ref(false) const createLoading = ref(false) const updateLoading = ref(false) @@ -228,13 +243,19 @@ const editDraft = reactive({ }) const canCreate = computed(() => newPerson.nickname.trim() && newPerson.real_name.trim()) +const totalPages = computed(() => Math.max(1, Math.ceil(total.value / pageSize))) + +const handleSearch = () => { + currentPage.value = 1 + fetchPersons() +} const fetchPersons = async () => { listLoading.value = true try { const response = await getPersonList({ - page: 1, - pageSize: 500, + page: currentPage.value, + pageSize, keyword: keyword.value || undefined, status: statusFilter.value || undefined }) @@ -345,6 +366,18 @@ const toggleStatus = async (person: Person) => { } } +const handlePrevPage = () => { + if (currentPage.value <= 1) return + currentPage.value -= 1 + fetchPersons() +} + +const handleNextPage = () => { + if (currentPage.value >= totalPages.value) return + currentPage.value += 1 + fetchPersons() +} + const handleDeletePerson = async (person: Person) => { if (!confirm(`确定要删除使用者 "${person.nickname}" 吗?此操作不可恢复。`)) return try {