From 8d1904686cabb414eff5a2fb22098785a7d0bff0 Mon Sep 17 00:00:00 2001
From: vincentlu <t1341870251@gmail.com>
Date: 星期五, 27 二月 2026 16:33:04 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/map/http.js |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/zy-acs-flow/src/map/http.js b/zy-acs-flow/src/map/http.js
index de50b3e..f1be56e 100644
--- a/zy-acs-flow/src/map/http.js
+++ b/zy-acs-flow/src/map/http.js
@@ -14,6 +14,26 @@
     mapContainer = param;
 }
 
+export const fetchMapPreferences = async (zoneId, setMapPreferences) => {
+    try {
+        const res = await request.post('/map/config/preferences', {
+            zoneId: zoneId
+        }, {
+            headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
+        });
+        const { code, msg, data } = res.data;
+        if (code === 200) {
+            setMapPreferences(data);
+            return data || {};
+        }
+        notify?.error(msg);
+    } catch (error) {
+        notify?.error(error.message);
+        console.error(error.message);
+    }
+    return {};
+}
+
 export const fetchMapData = (zoneId, setRcsStatus, setCurSprite) => {
     Tool.clearMapData();
     return request.post('/map/data/fetch', {
@@ -431,6 +451,38 @@
     return null;
 }
 
+export const updateAreaData = async (payload = {}) => {
+    try {
+        const res = await request.post('/map/area/update', payload);
+        const { code, msg, data } = res.data;
+        if (code === 200) {
+            notify.success(msg);
+            return data;
+        }
+        notify.error(msg);
+    } catch (error) {
+        notify.error(error.message);
+        console.error(error.message);
+    }
+    return null;
+};
+
+export const removeArea = async (id) => {
+    try {
+        const res = await request.post('/map/area/remove', { id });
+        const { code, msg } = res.data;
+        if (code === 200) {
+            notify.success(msg);
+            return true;
+        }
+        notify.error(msg);
+    } catch (error) {
+        notify.error(error.message);
+        console.error(error.message);
+    }
+    return false;
+};
+
 export const fetchAgvListAll = async () => {
     try {
         const res = await request.post('/agv/list', {});

--
Gitblit v1.9.1