From efabc6ba991acfd01d38bb0bf4e8cfd772416617 Mon Sep 17 00:00:00 2001
From: vincentlu <t1341870251@gmail.com>
Date: 星期一, 05 一月 2026 13:07:39 +0800
Subject: [PATCH] #

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

diff --git a/zy-acs-flow/src/map/http.js b/zy-acs-flow/src/map/http.js
index 3a66580..4754b48 100644
--- a/zy-acs-flow/src/map/http.js
+++ b/zy-acs-flow/src/map/http.js
@@ -49,12 +49,11 @@
                         // support
                         switch (item.type) {
                             case DEVICE_TYPE.POINT:
-                                sprite.scale.set(0.85, 0.85);
+                                sprite.scale.set(pointList.length < 2000 ? 1 : 1.6);
                                 break
                             default:
                                 break
                         }
-                        // }, 50);
 
                         mapContainer.addChild(sprite);
                         Tool.beInsight(sprite, setCurSprite);
@@ -185,7 +184,7 @@
     })
 }
 
-export const getRouteList = async (zoneId, callback) => {
+export const getRouteList = async (zoneId, callback, errCallBack) => {
     await request.post('/map/route/list', {
         zoneId: zoneId,
     }, {
@@ -196,10 +195,16 @@
             callback(data)
         } else {
             notify.error(msg);
+            if (errCallBack) {
+                errCallBack();
+            }
         }
     }).catch((error) => {
         notify.error(error.message);
         console.error(error.message);
+        if (errCallBack) {
+            errCallBack();
+        }
     })
 }
 
@@ -304,4 +309,171 @@
         console.error(error.message);
     }
     return false;
-}
\ No newline at end of file
+}
+
+export const locateAllAgv = async (param) => {
+    try {
+        const res = await request.post('/handler/locateAllAgv', param, {
+            headers: {
+                'appKey': HANDLE_APP_KEY
+            }
+        });
+        const { code, msg, data } = res.data;
+        if (code === 200) {
+            notify.success(msg);
+            return true;
+        } else {
+            notify.error(msg);
+        }
+    } catch (error) {
+        notify.error(error.message);
+        console.error(error.message);
+    }
+    return false;
+}
+
+export const startPatrolBatch = async (param) => {
+    try {
+        const res = await request.post('/handler/patrol/batch/startup', param, {
+            headers: {
+                'appKey': HANDLE_APP_KEY
+            }
+        });
+        const { code, msg, data } = res.data;
+        if (code === 200) {
+            notify.success(msg);
+            return true;
+        } else {
+            notify.error(msg);
+        }
+    } catch (error) {
+        notify.error(error.message);
+        console.error(error.message);
+    }
+    return false;
+}
+
+export const cancelPatrolBatch = async (param) => {
+    try {
+        const res = await request.post('/handler/patrol/batch/shutdown', param, {
+            headers: {
+                'appKey': HANDLE_APP_KEY
+            }
+        });
+        const { code, msg, data } = res.data;
+        if (code === 200) {
+            notify.success(msg);
+            return true;
+        } else {
+            notify.error(msg);
+        }
+    } catch (error) {
+        notify.error(error.message);
+        console.error(error.message);
+    }
+    return false;
+}
+
+
+export const fetchAreaList = async (zoneId) => {
+    try {
+        const res = await request.post('/map/area/list', {
+            zoneId: zoneId,
+        }, {
+            headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
+        });
+        const { code, msg, data } = res.data;
+        if (code === 200) {
+            return data || [];
+        } else {
+            notify.error(msg);
+            return [];
+        }
+    } catch (error) {
+        notify.error(error.message);
+        console.error(error.message);
+        return [];
+    }
+}
+
+export const getAreaInfo = async (param, callback) => {
+    await request.get('/map/area/get', param).then((res) => {
+        const { code, msg, data } = res.data;
+        if (code === 200) {
+            if (callback) {
+                callback(data)
+            }
+        } else {
+            notify.error(msg);
+        }
+    }).catch((error) => {
+        notify.error(error.message);
+        console.error(error.message);
+    })
+}
+
+export const saveAreaData = async (zoneId, areaData) => {
+    try {
+        const res = await request.post('/map/area/save', {
+            zoneId: zoneId,
+            ...areaData,
+        });
+        const { code, msg, data } = res.data;
+        if (code !== 200) {
+            notify.error(msg);
+            return null;
+        }
+        return data;
+    } catch (error) {
+        notify.error(error.message);
+        console.error(error.message);
+    }
+    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', {});
+        const { code, msg, data } = res.data;
+        if (code === 200) {
+            return data || [];
+        }
+        notify.error(msg);
+    } catch (error) {
+        notify.error(error.message);
+        console.error(error.message);
+    }
+    return [];
+}

--
Gitblit v1.9.1