import createAxios from '@/utils/request'

import {ADVANCE_BOOT} from '@/utils/constantRequest'

/**
 * 新增设备
 */
export const listMachine = (productLineId: any) => {
    const data = {productLineId}
    return createAxios({
        url: ADVANCE_BOOT + '/sgMachine/list',
        method: 'POST',
        data: data
    })
}


/**
 * 根据生产线id查询所有设备
 */
export const querySgMachineByProductLineId = (data: any) => {
    return createAxios({
        url: ADVANCE_BOOT + '/sgMachine/querySgMachineByProductLineId?productId='+data,
        method: 'GET',
    })
}



/**
 * 新增设备
 */
export const addSgMachine = (data: any) => {
    return createAxios({
        url: ADVANCE_BOOT + '/sgMachine/add',
        method: 'POST',
        data: data
    })
}


/**
 * 更新设备
 */
export const updateSgMachine = (data: any) => {
    return createAxios({
        url: ADVANCE_BOOT + '/sgMachine/update',
        method: 'POST',
        data: data
    })
}


/**
 * 删除设备
 */
export const deleteSgMachine = (data: any) => {
    let ids = [data]
    return createAxios({
        url: ADVANCE_BOOT + '/sgMachine/delete',
        method: 'POST',
        data: ids
    })
}
