import server from '@/utils/request'


//查询
interface Query{
    pageSize:String|Number	      //每页条数
    pageNo:String|Number	          //页数
    divisionNo?:String        //区划编码
    poname?:String	          //运营商名称
    pocode?:String	          //运营商组织机构代码
    status?:String	          //状态：1-启用，0-禁用
}

export function getyyslist(params:Query) {
  return server.request({
    url: '/resource/proxyoperater/list',
    method: 'get',
    params
  })
}


//下拉菜单查询
export function optionyyslist() {
  return server.request({
    url: '/resource/proxyoperater/option/list',
    method: 'get'
  })
}

//新增
interface Addata{
    division:String	            //区划名称
    divisionNo:String	        //区划编码	
    poname:String	            //运营商名称
    pocode:String	            //运营商组织机构代码
    address?:String	            //地址
    addressProvince?:String      //地址-省
    addressCity?:String	        //地址-市
    addressArea?:String	        //地址-区县
    contacts?:String	        //联系人
    phone?:String	            //联系电话
    status?:String|Number	    //状态：1-启用，0-禁用
    readonly?:String|Number     //只读：1-是，0-否
    stationCount?:String	        //换电站数量
}
export function addyunys(data:Addata) {
    return server.request({
      url: '/resource/proxyoperater/add',
      method: 'post',
      data
    })
}

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

//删除
export function delyys(id:String) {
  return server.request({
    url: '/resource/proxyoperater/del',
    method: 'post',
    data:{
      id
    }
  })
}