From 736973883280e9a6059c5da2f2e67d5a6aecdcef Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期五, 29 八月 2025 15:03:22 +0800
Subject: [PATCH] 1

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

diff --git a/zy-acs-flow/src/map/http.js b/zy-acs-flow/src/map/http.js
index dfc2940..b126eed 100644
--- a/zy-acs-flow/src/map/http.js
+++ b/zy-acs-flow/src/map/http.js
@@ -14,7 +14,7 @@
     mapContainer = param;
 }
 
-export const fetchMapData = (zoneId, setRcsStatus) => {
+export const fetchMapData = (zoneId, setRcsStatus, setCurSprite) => {
     Tool.clearMapData();
     return request.post('/map/data/fetch', {
         zoneId: zoneId
@@ -49,14 +49,14 @@
                         // 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);
                     }
                 }
             })
@@ -184,7 +184,7 @@
     })
 }
 
-export const getRouteList = async (zoneId, callback) => {
+export const getRouteList = async (zoneId, callback, errCallBack) => {
     await request.post('/map/route/list', {
         zoneId: zoneId,
     }, {
@@ -195,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();
+        }
     })
 }
 
@@ -246,7 +252,7 @@
 }
 
 export const getFakeSign = async (param, callback) => {
-    await request.get('/fake/sign').then((res) => {
+    await request.get('/fake/sign/get').then((res) => {
         const { code, msg, data } = res.data;
         if (code === 200) {
             if (callback) {
@@ -260,3 +266,110 @@
         console.error(error.message);
     })
 }
+
+export const setFakeSign = async (param, callback) => {
+    await request.post('/fake/sign/set', {
+        sign: param,
+    }, {
+        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
+    }).then((res) => {
+        const { code, msg, data } = res.data;
+        if (code === 200) {
+            if (data) {
+                notify.success(msg);
+            }
+            if (callback) {
+                callback(data)
+            }
+        } else {
+            notify.error(msg);
+        }
+    }).catch((error) => {
+        notify.error(error.message);
+        console.error(error.message);
+    })
+}
+
+export const handleAgvPatrol = async (param) => {
+    try {
+        const res = await request.post('/handler/agv/patrol', 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 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;
+}
\ No newline at end of file

--
Gitblit v1.9.1