diff --git a/src/api/data/complaintCollection.ts b/src/api/data/complaintCollection.ts
index 9bbb34f..3b42779 100644
--- a/src/api/data/complaintCollection.ts
+++ b/src/api/data/complaintCollection.ts
@@ -1,4 +1,6 @@
import request from "@/api/request";
+import feedback from "../../utils/feedback";
+import {getToken} from "../../utils/token";
export function getComplaintCollectionPage(body) {
return request.post({
@@ -64,3 +66,43 @@ export function handlerData(body) {
body
});
}
+
+
+/**
+ * 导出
+ */
+export async function exportData(body) {
+ const response = await fetch('/api/v2/data/complaintCollection/exportData', {
+ method: 'POST',
+ headers: {
+ 'Authorization': getToken(),
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify(body)
+ })
+ if (!response.ok) {
+ feedback.msgError('导出失败')
+ return
+ }
+ // 👉 关键:直接拿 blob
+ const blob = await response.blob()
+ let filename = '涉访涉诉数据.xlsx'
+ const disposition = response.headers.get('content-disposition')
+ if (disposition) {
+ const match = disposition.match(/filename\*=UTF-8''(.+)/)
+ if (match) {
+ filename = decodeURIComponent(match[1])
+ }
+ }
+ // 👉 触发下载
+ const url = window.URL.createObjectURL(blob)
+ const a = document.createElement('a')
+ a.href = url
+ a.download = filename
+
+ document.body.appendChild(a)
+ a.click()
+
+ document.body.removeChild(a)
+ window.URL.revokeObjectURL(url)
+}
\ No newline at end of file
diff --git a/src/views/data/ComplaintCollection.vue b/src/views/data/ComplaintCollection.vue
index 85c1def..e23ebe7 100644
--- a/src/views/data/ComplaintCollection.vue
+++ b/src/views/data/ComplaintCollection.vue
@@ -212,6 +212,7 @@