From f7a68273c9ae23eb81e90eb0349c8314ccd8927c Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期二, 12 十一月 2024 09:15:04 +0800 Subject: [PATCH] # --- zy-acs-flow/src/map/http.js | 62 ++++++++++++++++++++++++++++++ 1 files changed, 61 insertions(+), 1 deletions(-) diff --git a/zy-acs-flow/src/map/http.js b/zy-acs-flow/src/map/http.js index b8a6cfd..b059e6c 100644 --- a/zy-acs-flow/src/map/http.js +++ b/zy-acs-flow/src/map/http.js @@ -27,7 +27,7 @@ const commonList = common ? eval(common) : []; const pointList = point ? eval(point) : []; const mapItemList = [...commonList, ...pointList]; - + mapItemList.forEach(item => { if (item.type !== DEVICE_TYPE.AGV) { const sprite = Tool.generateSprite(item.type); @@ -244,3 +244,63 @@ console.error(error.message); }) } + +export const getFakeSign = async (param, callback) => { + await request.get('/fake/sign/get').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 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