import request from '@/utils/request'

// 查询列表
export function listEngineering(query) {
    return request({
        url: '/bracelet/engineering/list',
        method: 'get',
        params: query
    })
}

// 工程详情
export function getEngineeringInfo(proId) {
    return request({
        url: '/bracelet/engineering/getEngineeringInfo/' + proId,
        method: 'get',
    })
}


// 杆塔详情
export function getGtInfo(data) {
    return request({
        url: '/bracelet/engineering/gtInfo',
        method: 'get',
        params: data
    })
}

// 添加杆塔
export function addGt(data) {
    return request({
        url: '/bracelet/engineering/addGt',
        method: 'post',
        data: data
    })
}

// 某杆塔详情
export function getGtId(gtId) {
    return request({
        url: '/bracelet/engineering/'+ gtId,
        method: 'get',
    })
}

// 修改杆塔
export function editGt(data) {
    return request({
        url: '/bracelet/engineering/editGt',
        method: 'post',
        data: data
    })
}

// 删除杆塔
export function delGt(data) {
    return request({
        url: '/bracelet/engineering/delGt',
       method: 'post',
       data: data
    })
}


// 添加工程
export function addPro(data) {
    return request({
        url: '/bracelet/engineering/addPro',
        method: 'post',
        data: data
    })
}



// 修改工程
export function editPro(data) {
    return request({
        url: '/bracelet/engineering/editPro',
        method: 'post',
        data: data
    })
}

// 删除工程
export function delPro(proId) {
    return request({
        url: '/bracelet/engineering/delPro/' + proId,
       method: 'post',
    })
}



// 导出工程
export function exportEngineering(query) {
    return request({
        url: '/bracelet/export/exportEngineering',
        method: 'get',
        responseType: 'blob',
        params: query
    })
}

// 批量导出工程
export function exportEngineeringSome(query) {
    return request({
        url: '/bracelet/engineering/exportEngineeringSome',
        method: 'get',
        responseType: 'blob',
        params: query
    })
}

// 导出杆塔
export function exportGt(query) {
    return request({
        url: '/bracelet/export/exportGt',
        method: 'get',
        responseType: 'blob',
        params: query
    })
}

// 批量导出工程
export function exportGtSome(query) {
    return request({
        url: '/bracelet/engineering/exportGtSome',
        method: 'get',
        responseType: 'blob',
        params: query
    })
}


// 模板下载
export function gtFile(query) {
    return request({
        url: '/bracelet/download/gtFile',
        method: 'get',
        headers: { 'Content-Type': 'application/x-www-form-urlencoded',
            "encryption":"encryption"
        },
        responseType: 'blob',
        params: query
    })
}