From a8e98d400e784df056e5ffb3228d859d6fef6b0f Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期六, 19 十月 2024 16:11:07 +0800
Subject: [PATCH] #

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

diff --git a/zy-acs-flow/src/map/http.js b/zy-acs-flow/src/map/http.js
index c6d34e1..f78cfe5 100644
--- a/zy-acs-flow/src/map/http.js
+++ b/zy-acs-flow/src/map/http.js
@@ -14,15 +14,16 @@
     mapContainer = param;
 }
 
-export const fetchMapData = (zoneId) => {
+export const fetchMapData = (zoneId, setRcsStatus) => {
     Tool.clearMapData();
     return request.post('/map/data/fetch', {
         zoneId: zoneId
     }, {
         headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
     }).then((res) => {
-        const { code, msg, data: { common, point } } = res.data;
+        const { code, msg, data: { rcsStatus, common, point } } = res.data;
         if (code === 200) {
+            setRcsStatus(rcsStatus);
             const mapItemList = [...eval(common), ...eval(point)];
             mapItemList.forEach(item => {
                 if (item.type !== DEVICE_TYPE.AGV) {
@@ -108,6 +109,23 @@
     })
 }
 
+export const startupOrShutdown = async (callback) => {
+    try {
+        const res = await request.post('/map/startupOrShutdown');
+        const { code, msg, data } = res.data;
+        if (code === 200) {
+            if (callback) {
+                callback();
+            }
+        } else {
+            notify.error(msg);
+        }
+    } catch (error) {
+        notify.error(error.message);
+        console.error(error.message);
+    }
+}
+
 export const getLocGroup = async (row, bay, callback) => {
     await request.post('/map/shelf/group', {
         row: row,
@@ -145,6 +163,43 @@
     })
 }
 
+export const getPointInfo = async (point, callback) => {
+    await request.post('/map/point/info', {
+        codeData: point,
+    }, {
+        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
+    }).then((res) => {
+        const { code, msg, data } = res.data;
+        if (code === 200) {
+            callback(data)
+        } else {
+            notify.error(msg);
+        }
+    }).catch((error) => {
+        notify.error(error.message);
+        console.error(error.message);
+    })
+}
+
+export const getRouteList = async (zoneId, callback) => {
+    await request.post('/map/route/list', {
+        zoneId: zoneId,
+    }, {
+        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
+    }).then((res) => {
+        const { code, msg, data } = res.data;
+        if (code === 200) {
+            callback(data)
+        } else {
+            notify.error(msg);
+        }
+    }).catch((error) => {
+        notify.error(error.message);
+        console.error(error.message);
+    })
+}
+
+
 export const handleControlAgv = async (param, callback) => {
     await request.post('/handler/control/agv', param, {
         headers: {

--
Gitblit v1.9.1