From 0a6a18524ea5c03ea03898ebd1945bc81153db45 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 03 十一月 2025 15:15:25 +0800
Subject: [PATCH] 设备管理-添加导出功能

---
 src/views/equipmentManagement/upkeep/index.vue |   36 +++++++++++++++++++++++++++++++-----
 1 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/src/views/equipmentManagement/upkeep/index.vue b/src/views/equipmentManagement/upkeep/index.vue
index 7183964..5612bb6 100644
--- a/src/views/equipmentManagement/upkeep/index.vue
+++ b/src/views/equipmentManagement/upkeep/index.vue
@@ -59,6 +59,9 @@
           <el-button type="success" icon="Van" @click="addPlan">
             鏂板璁″垝
           </el-button>
+          <el-button @click="handleOut">
+            瀵煎嚭
+          </el-button>
           <el-button
             type="danger"
             icon="Delete"
@@ -122,7 +125,7 @@
 <script setup>
 import { usePaginationApi } from "@/hooks/usePaginationApi";
 import { getUpkeepPage, delUpkeep } from "@/api/equipmentManagement/upkeep";
-import { onMounted } from "vue";
+import { onMounted, getCurrentInstance } from "vue";
 import PlanModal from "./Modal/PlanModal.vue";
 import MaintenanceModal from "./Modal/MaintenanceModal.vue";
 import dayjs from "dayjs";
@@ -131,6 +134,8 @@
 defineOptions({
   name: "璁惧淇濆吇",
 });
+
+const { proxy } = getCurrentInstance();
 
 // 璁″垝寮圭獥鎺у埗鍣�
 const planModalRef = ref();
@@ -154,7 +159,12 @@
   getTableData,
   resetFilters,
   onCurrentChange,
-} = usePaginationApi(getUpkeepPage, {}, [
+} = usePaginationApi(getUpkeepPage, {
+  deviceName: undefined,
+  maintenancePlanTime: undefined,
+  maintenanceActuallyTime: undefined,
+  maintenanceActuallyName: undefined,
+}, [
   {
     label: "璁惧鍚嶇О",
     align: "center",
@@ -250,9 +260,10 @@
   planModalRef.value.openEdit(id);
 };
 
-const changePage = ({ page }) => {
-  pagination.currentPage = page;
-  onCurrentChange(page);
+const changePage = ({ page, limit }) => {
+	pagination.currentPage = page;
+	pagination.pageSize = limit;
+	onCurrentChange(page);
 };
 
 // 鍗曡鍒犻櫎
@@ -270,6 +281,21 @@
   });
 };
 
+// 瀵煎嚭
+const handleOut = () => {
+  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  })
+    .then(() => {
+      proxy.download("/device/maintenance/export", {}, "璁惧淇濆吇.xlsx");
+    })
+    .catch(() => {
+      ElMessage.info("宸插彇娑�");
+    });
+};
+
 onMounted(() => {
   getTableData();
 });

--
Gitblit v1.9.3