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/inspectionManagement/index.vue | 28 +++++++++++++++++++++++++++-
1 files changed, 27 insertions(+), 1 deletions(-)
diff --git a/src/views/equipmentManagement/inspectionManagement/index.vue b/src/views/equipmentManagement/inspectionManagement/index.vue
index 74886b2..3e4e31e 100644
--- a/src/views/equipmentManagement/inspectionManagement/index.vue
+++ b/src/views/equipmentManagement/inspectionManagement/index.vue
@@ -26,7 +26,10 @@
<el-space v-if="activeRadio !== 'task'">
<el-button type="primary" :icon="Plus" @click="handleAdd(undefined)">鏂板缓</el-button>
<el-button type="danger" :icon="Delete" @click="handleDelete">鍒犻櫎</el-button>
- <!-- <el-button type="info" plain :icon="Download">瀵煎嚭</el-button> -->
+ <el-button @click="handleOut">瀵煎嚭</el-button>
+ </el-space>
+ <el-space v-else>
+ <el-button @click="handleOut">瀵煎嚭</el-button>
</el-space>
</div>
<div>
@@ -77,6 +80,7 @@
<script setup>
import { Delete, Plus } from "@element-plus/icons-vue";
import { onMounted, ref, reactive, getCurrentInstance, nextTick } from "vue";
+import { ElMessageBox } from "element-plus";
// 缁勪欢寮曞叆
import Pagination from "@/components/Pagination/index.vue";
@@ -310,6 +314,28 @@
const handleSelectionChange = (selection) => {
selectedRows.value = selection;
};
+
+// 瀵煎嚭
+const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ // 鏍规嵁褰撳墠閫変腑鐨勬爣绛鹃〉璋冪敤涓嶅悓鐨勫鍑烘帴鍙�
+ if (activeRadio.value === "taskManage") {
+ // 瀹氭椂浠诲姟绠$悊
+ proxy.download("/timingTask/export", {}, "瀹氭椂浠诲姟绠$悊.xlsx");
+ } else if (activeRadio.value === "task") {
+ // 瀹氭椂浠诲姟璁板綍
+ proxy.download("/inspectionTask/export", {}, "瀹氭椂浠诲姟璁板綍.xlsx");
+ }
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
</script>
<style scoped>
--
Gitblit v1.9.3