From ee56d420df75e3284a1fe4756363fa3c924b9190 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 03 十一月 2025 15:34:52 +0800
Subject: [PATCH] 能耗管理-添加导出功能
---
src/views/energyManagement/energyTrends/index.vue | 27 ++++++++++++++++++++++++---
1 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/src/views/energyManagement/energyTrends/index.vue b/src/views/energyManagement/energyTrends/index.vue
index 6429023..7f67be7 100644
--- a/src/views/energyManagement/energyTrends/index.vue
+++ b/src/views/energyManagement/energyTrends/index.vue
@@ -4,7 +4,7 @@
<div>
<span class="search_title">璁惧鍚嶇О锛�</span>
<el-input
- v-model="searchForm.customerName"
+ v-model="searchForm.name"
style="width: 240px"
placeholder="璇疯緭鍏�"
@change="handleQuery"
@@ -14,6 +14,7 @@
<el-button type="primary" @click="handleQuery" style="margin-left: 10px"
>鎼滅储</el-button
>
+ <el-button @click="handleOut" style="margin-left: 10px">瀵煎嚭</el-button>
</div>
</div>
<div class="table_list">
@@ -34,12 +35,15 @@
<script setup>
import {Search} from "@element-plus/icons-vue";
-import {onMounted, ref} from "vue";
+import {onMounted, ref, getCurrentInstance} from "vue";
import {listPageByTrend} from "@/api/energyManagement/index.js";
+import { ElMessageBox } from "element-plus";
+
+const { proxy } = getCurrentInstance();
const data = reactive({
searchForm: {
- customerName: "",
+ name: "",
},
});
const { searchForm } = toRefs(data);
@@ -76,6 +80,7 @@
},
]);
const tableData = ref([]);
+const selectedRows = ref([]);
const tableLoading = ref(false);
const page = reactive({
current: 1,
@@ -106,6 +111,22 @@
page.total = res.data.total;
});
};
+
+// 瀵煎嚭
+const handleOut = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download("/equipmentEnergyConsumption/exportTwo", {}, "鑳芥簮瓒嬪娍.xlsx");
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
+
onMounted(() => {
getList();
});
--
Gitblit v1.9.3