From 10f91cf8cc7f5ebe1cb4d9f06bd9cf4693277dc6 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期四, 21 十一月 2024 09:17:45 +0800 Subject: [PATCH] # --- zy-acs-flow/src/map/http.js | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 47 insertions(+), 2 deletions(-) diff --git a/zy-acs-flow/src/map/http.js b/zy-acs-flow/src/map/http.js index dfc2940..3a66580 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 @@ -57,6 +57,7 @@ // }, 50); mapContainer.addChild(sprite); + Tool.beInsight(sprite, setCurSprite); } } }) @@ -246,7 +247,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 +261,47 @@ 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; +} \ No newline at end of file -- Gitblit v1.9.1