#
vincentlu
3 天以前 3553afdbe35ed5ff5d2ce2a85e90962a01de9a4a
zy-acs-flow/src/map/http.js
@@ -204,6 +204,78 @@
    })
}
export const getCodeInfo = async (codeData, callback, errCallBack) => {
    await request.post('/code/info', {
        codeData,
    }, {
        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);
            if (errCallBack) {
                errCallBack();
            }
        }
    }).catch((error) => {
        notify?.error(error.message);
        console.error(error.message);
        if (errCallBack) {
            errCallBack();
        }
    })
}
export const getCodeRouteList = async (codeData, callback, errCallBack) => {
    await request.post('/code/route/list', {
        codeData,
    }, {
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    }).then((res) => {
        const { code, msg, data } = res.data;
        if (code === 200) {
            callback(Array.isArray(data) ? data : []);
        } else {
            notify?.error(msg);
            if (errCallBack) {
                errCallBack();
            }
        }
    }).catch((error) => {
        notify?.error(error.message);
        console.error(error.message);
        if (errCallBack) {
            errCallBack();
        }
    })
}
export const getCodeFuncStaList = async (codeData, callback, errCallBack) => {
    await request.post('/code/funcSta/list', {
        codeData,
    }, {
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
    }).then((res) => {
        const { code, msg, data } = res.data;
        if (code === 200) {
            callback(Array.isArray(data) ? data : []);
        } else {
            notify?.error(msg);
            if (errCallBack) {
                errCallBack();
            }
        }
    }).catch((error) => {
        notify?.error(error.message);
        console.error(error.message);
        if (errCallBack) {
            errCallBack();
        }
    })
}
export const getRouteList = async (zoneId, callback, errCallBack) => {
    await request.post('/map/route/list', {
        zoneId: zoneId,
@@ -511,4 +583,4 @@
        console.error(error.message);
    }
    return null;
}
}