| | |
| | | mapContainer = param; |
| | | } |
| | | |
| | | export const fetchMapData = (zoneId, setRcsStatus) => { |
| | | export const fetchMapData = (zoneId, setRcsStatus, setCurSprite) => { |
| | | Tool.clearMapData(); |
| | | return request.post('/map/data/fetch', { |
| | | zoneId: zoneId |
| | |
| | | // 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); |
| | | } |
| | | } |
| | | }) |
| | |
| | | }) |
| | | } |
| | | |
| | | export const getRouteList = async (zoneId, callback) => { |
| | | export const getRouteList = async (zoneId, callback, errCallBack) => { |
| | | await request.post('/map/route/list', { |
| | | zoneId: zoneId, |
| | | }, { |
| | |
| | | callback(data) |
| | | } else { |
| | | notify.error(msg); |
| | | if (errCallBack) { |
| | | errCallBack(); |
| | | } |
| | | } |
| | | }).catch((error) => { |
| | | notify.error(error.message); |
| | | console.error(error.message); |
| | | if (errCallBack) { |
| | | errCallBack(); |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |