import {httpApi} from "../../request/httpApi";

export default {
    //获取平曲线数据
    async queryListData(form, msg = true) {
        return httpApi({
            url: '/api/blade-business/mileage/list',
            method: 'get',
            params: form
        }, msg);
    },
    //获取片段列表
    async queryPartList(form, msg = true) {
        return httpApi({
            url: '/api/blade-business/mileage/part/list',
            method: 'get',
            params: form
        }, msg)
    },
    //新增片段
    async savePartAdd(form, msg = true) {
        return httpApi({
            url: '/api/blade-business/mileage/part/add',
            method: 'post',
            data: form
        }, msg)
    },
    //编辑片段
    async savePartUpdate(form, msg = true) {
        return httpApi({
            url: '/api/blade-business/mileage/part/update',
            method: 'post',
            data: form
        }, msg)
    },
    //删除片段
    async delPartData(form, msg = true) {
        return httpApi({
            url: '/api/blade-business/mileage/part/del',
            method: 'post',
            params: form
        }, msg)
    },
    //获取新增线元信息的初始数据
    async getNextMileagexy(form, msg = true) {
        return httpApi({
            url: '/api/blade-business/mileage/getNextMileagexy',
            method: 'post',
            data: form
        }, msg)
    },
    //里程转换坐标
    async queryPsChange(form, msg = true) {
        return httpApi({
            url: '/api/blade-business/mileage/pschange',
            method: 'get',
            params: form
        }, msg)
    },
    //新增保存线元
    async saveAddMileage(form, msg = true) {
        return httpApi({
            url: '/api/blade-business/mileage/add',
            method: 'post',
            data: form
        }, msg)
    },
    //编辑保存线元
    async saveUpdateMileage(form, msg = true) {
        return httpApi({
            url: '/api/blade-business/mileage/update',
            method: 'post',
            data: form
        }, msg)
    },
    //删除线元
    async saveDelMileage(form, msg = true) {
        return httpApi({
            url: '/api/blade-business/mileage/del',
            method: 'post',
            params: form
        }, msg)
    },
    //生成坐标
    async getZzList(form, msg = true) {
        return httpApi({
            url: '/api/blade-business/mileage/getZzList',
            method: 'get',
            params: form
        }, msg)
    },
    //导出数据
    async getExportExcel(form, msg = true) {
        return httpApi({
            url: '/api/blade-business/mileage/exportExcel',
            method: 'get',
            params: form,
            responseType: 'blob'
        }, msg)
    },
}
