From 45574a93cd079e20662dd2717765918a0066984f Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期四, 03 七月 2025 10:53:46 +0800
Subject: [PATCH] fix: 修复设备,基础数据分页不显示

---
 src/views/equipmentManagement/repair/index.vue |  143 ++++++++++++++++++++++++++---------------------
 1 files changed, 78 insertions(+), 65 deletions(-)

diff --git a/src/views/equipmentManagement/repair/index.vue b/src/views/equipmentManagement/repair/index.vue
index 2e75914..11679ba 100644
--- a/src/views/equipmentManagement/repair/index.vue
+++ b/src/views/equipmentManagement/repair/index.vue
@@ -36,6 +36,7 @@
           total: pagination.total,
         }"
         @selection-change="handleSelectionChange"
+        @pagination="changePage"
       >
         <template #statusRef="{ row }">
           <el-tag v-if="row.status === 1" type="success">瀹岀粨</el-tag>
@@ -87,72 +88,79 @@
 const multipleList = ref([]);
 
 // 琛ㄦ牸閽╁瓙
-const { filters, columns, dataList, pagination, getTableData, resetFilters } =
-  usePaginationApi(
-    getRepairPage,
+const {
+  filters,
+  columns,
+  dataList,
+  pagination,
+  getTableData,
+  resetFilters,
+  onCurrentChange,
+} = usePaginationApi(
+  getRepairPage,
+  {
+    searchText: undefined,
+  },
+  [
     {
-      searchText: undefined,
+      label: "璁惧鍚嶇О",
+      align: "center",
+      prop: "deviceName",
     },
-    [
-      {
-        label: "璁惧鍚嶇О",
-        align: "center",
-        prop: "deviceName",
-      },
-      {
-        label: "瑙勬牸鍨嬪彿",
-        align: "center",
-        prop: "deviceModel",
-      },
-      {
-        label: "鎶ヤ慨鏃ユ湡",
-        align: "center",
-        prop: "repairTime",
-        formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"),
-      },
-      {
-        label: "鎶ヤ慨浜�",
-        align: "center",
-        prop: "repairName",
-      },
-      {
-        label: "鏁呴殰鐜拌薄",
-        align: "center",
-        prop: "remark",
-      },
-      {
-        label: "缁翠慨浜�",
-        align: "center",
-        prop: "maintenanceName",
-      },
-      {
-        label: "缁翠慨缁撴灉",
-        align: "center",
-        prop: "maintenanceResult",
-      },
-      {
-        label: "缁翠慨鏃ユ湡",
-        align: "center",
-        prop: "maintenanceTime",
-        formatData: (cell) => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""),
-      },
-      {
-        label: "鐘舵��",
-        align: "center",
-        prop: "status",
-        dataType: "slot",
-        slot: "statusRef",
-      },
-      {
-        fixed: "right",
-        label: "鎿嶄綔",
-        dataType: "slot",
-        slot: "operation",
-        align: "center",
-        width: "200px",
-      },
-    ]
-  );
+    {
+      label: "瑙勬牸鍨嬪彿",
+      align: "center",
+      prop: "deviceModel",
+    },
+    {
+      label: "鎶ヤ慨鏃ユ湡",
+      align: "center",
+      prop: "repairTime",
+      formatData: (cell) => dayjs(cell).format("YYYY-MM-DD"),
+    },
+    {
+      label: "鎶ヤ慨浜�",
+      align: "center",
+      prop: "repairName",
+    },
+    {
+      label: "鏁呴殰鐜拌薄",
+      align: "center",
+      prop: "remark",
+    },
+    {
+      label: "缁翠慨浜�",
+      align: "center",
+      prop: "maintenanceName",
+    },
+    {
+      label: "缁翠慨缁撴灉",
+      align: "center",
+      prop: "maintenanceResult",
+    },
+    {
+      label: "缁翠慨鏃ユ湡",
+      align: "center",
+      prop: "maintenanceTime",
+      formatData: (cell) => (cell ? dayjs(cell).format("YYYY-MM-DD") : ""),
+    },
+    {
+      label: "鐘舵��",
+      align: "center",
+      prop: "status",
+      dataType: "slot",
+      slot: "statusRef",
+    },
+    {
+      fixed: "right",
+      label: "鎿嶄綔",
+      dataType: "slot",
+      slot: "operation",
+      align: "center",
+      width: "200px",
+    },
+  ]
+);
 
 // 澶氶�夊悗鍋氫粈涔�
 const handleSelectionChange = (selectionList) => {
@@ -161,7 +169,7 @@
 
 // 鏂板鎶ヤ慨
 const addRepair = () => {
-  repairModalRef.value.openModal();
+  repairModalRef.value.openAdd();
 };
 
 // 缂栬緫鎶ヤ慨
@@ -175,6 +183,11 @@
   maintainModalRef.value.open(row.id, row);
 };
 
+const changePage = ({ page }) => {
+  pagination.currentPage = page;
+  onCurrentChange(page);
+};
+
 // 鍗曡鍒犻櫎
 const delRepairByIds = async (ids) => {
   ElMessageBox.confirm("纭鍒犻櫎鎶ヤ慨鏁版嵁, 姝ゆ搷浣滀笉鍙��?", "璀﹀憡", {

--
Gitblit v1.9.3