import request from '@/utils/request';

//获取左侧导航树
export function getTreeData(params:any){
  return request({
    url: '/basedata/substation/getSubstationTree' ,
    method: 'get',
    params:params
  });
}
//获取右侧表格
export function getdata(params:any){
    return request({
      url: '/basedata/substation-maindevice/getMainDeviceTree' ,
      method: 'get',
      params:params
    });
  }
// 增加主设备
export function addMain(params:any){
  return request({
    url: '/basedata/substation-maindevice/addMainDevice' ,
    method: 'post',
    params:params
  });
}
//修改主设备
export function editMain(params:any){
  return request({
    url: '/basedata/substation-maindevice/updateMainDevice' ,
    method: 'post',
    params:params
  });
}
//新增部件
export function addCom (params:any){
  return request({
    url: '/basedata/substation-maindevice/addComponent' ,
    method: 'post',
    params:params
  });
}
//修改部件
export function editCom (params:any){
  return request({
    url: '/basedata/substation-maindevice/updateComponent' ,
    method: 'post',
    params:params
  });
}
//修改主设备状态
export function Mainchange (params:any){
  return request({
    url: '/basedata/substation-maindevice/setMainDeviceStatus' ,
    method: 'post',
    params:params
  });
}
//修改部件状态
export function comchange (params:any){
  return request({
    url: '/basedata/substation-maindevice/setComponentStatus' ,
    method: 'post',
    params:params
  });
}
//删除主设备
export function delMainData (params:any){
  return request({
    url: '/basedata/substation-maindevice/deleteMainDevice' ,
    method: 'post',
    params:params
  });
}
//删除部件
export function delComData (params:any){
  return request({
    url: '/basedata/substation-maindevice/deleteComponent' ,
    method: 'post',
    params:params
  });
}
//上串文件
export function addFile (data:any){
  return request({
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    url: '/basedata/substation-maindevice/uploadFile' ,
    method: 'post',
    data
  });
}