#
vincentlu
10 小时以前 befebaf1b91877843acccc31d04f77f2258a501d
zy-acs-flow/src/map/http.js
@@ -14,6 +14,26 @@
    mapContainer = param;
}
export const fetchMapPreferences = async (zoneId, setMapPreferences) => {
    try {
        const res = await request.post('/map/config/preferences', {
            zoneId: zoneId
        }, {
            headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
        });
        const { code, msg, data } = res.data;
        if (code === 200) {
            setMapPreferences(data);
            return data || {};
        }
        notify?.error(msg);
    } catch (error) {
        notify?.error(error.message);
        console.error(error.message);
    }
    return {};
}
export const fetchMapData = (zoneId, setRcsStatus, setCurSprite) => {
    Tool.clearMapData();
    return request.post('/map/data/fetch', {
@@ -431,6 +451,38 @@
    return null;
}
export const updateAreaData = async (payload = {}) => {
    try {
        const res = await request.post('/map/area/update', payload);
        const { code, msg, data } = res.data;
        if (code === 200) {
            notify.success(msg);
            return data;
        }
        notify.error(msg);
    } catch (error) {
        notify.error(error.message);
        console.error(error.message);
    }
    return null;
};
export const removeArea = async (id) => {
    try {
        const res = await request.post('/map/area/remove', { id });
        const { code, msg } = res.data;
        if (code === 200) {
            notify.success(msg);
            return true;
        }
        notify.error(msg);
    } catch (error) {
        notify.error(error.message);
        console.error(error.message);
    }
    return false;
};
export const fetchAgvListAll = async () => {
    try {
        const res = await request.post('/agv/list', {});