import server from '@/utils/request'

//新增
interface Addobj{
  pkId?:String,
  typeName:String	                //型号名称
  typeCode:String	                //型号编码
  batteryCellManuafactory:String	//电芯厂商
  batteryManuafactory:String	    //电池包厂商
  material:String	                //电池材料：1-三元铁锂，2-磷酸铁锂
  connectionMode:String	          //连接方式
  capacity:String	                //标称容量，单位千瓦时kWh
  voltage:String	                //标称电压，单位伏特V
  weight:String 	                //重量，单位克
  size:String	                    //尺寸，长宽高
}

export function adddicttype(data:Addobj) {
  return server.request({
    url: '/resource/batterytype/add',
    method: 'post',
    data
  })
}

//修改
export function update(data:Addobj) {
  return server.request({
    url: '/resource/batterytype/update',
    method: 'post',
    data
  })
}

//查询
interface Querydata{
  pageSize:String|number,	  //每页条数
  pageNo:String|number	    //页数
}
export function getdicttype(params:Querydata) {
  return server.request({
    url: '/resource/batterytype/list',
    method: 'get',
    params
  })
}

//删除
export function deltype(id:string) {
  return server.request({
    url: '/resource/batterytype/del',
    method: 'post',
    data:{
      id
    }
  })
}


