import request from '@/utils/request'

// 分页查询工程列表
export const queryEngineeringPage = (data) => {
    return request({
        url: '/cs-device-boot/engineering/queryEngineeringPage',
        method: 'post',
        data: Object.assign(
            {
                city: '',
                currentPage: {},
                name: '',
                pageSize: {},
                province: '',
            },
            data
        ),
    })
}

// 新增工程
export const addEngineering = (data) => {
    return request({
        url: '/cs-device-boot/engineering/addEngineering',
        method: 'post',
        data: data,
    })
}

// 删除工程
export const deleteEngineering = (id) => {
    return request({
        url: '/cs-device-boot/engineering/auditEngineering',
        method: 'post',
        data: {
            id,
            status: 0,
        },
    })
}

// 修改工程
export const updateEngineering = (data) => {
    return request({
        url: '/cs-device-boot/engineering/auditEngineering',
        method: 'post',
        data: data,
    })
}

// 工程-项目-拓扑图树

export const engineeringTree = () => {
    return request({
        url: '/cs-device-boot/csLedger/getProjectTree',
        method: 'post',
    })
}
