From 3d08674227b35c1dee6dbd26a3e011bbfaf1dddf Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Mon, 13 Oct 2025 10:22:54 +0800
Subject: [PATCH] feat:详情

---
 src/api/work/index.js |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/api/work/index.js b/src/api/work/index.js
index 0658350..10b197a 100644
--- a/src/api/work/index.js
+++ b/src/api/work/index.js
@@ -21,4 +21,30 @@
     method: 'get',
     params: { eventNum }
   })
+}
+
+// 修改接口:处理待审核状态,动态构建 FormData 提交
+export const flowEvent = (data, file) => {
+  const formData = new FormData()
+
+  // 动态添加非空字段到 FormData
+  Object.entries(data).forEach(([key, value]) => {
+    if (value !== undefined && value !== null) {
+      formData.append(key, value)
+    }
+  })
+
+  // 如果 file 存在,则添加到 FormData
+  if (file) {
+    formData.append('file', file)
+  }
+
+  return request({
+    url: '/drone-device-core/jobEvent/flowEvent',
+    method: 'post',
+    data: formData,
+    headers: {
+      'Content-Type': 'multipart/form-data', // 设置为表单数据格式
+    },
+  })
 }
\ No newline at end of file

--
Gitblit v1.9.3