import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/admin/user/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/admin/user',
    method: 'post',
    data: obj
  })
}

export function delObj(id) {
  return request({
    url: '/admin/user/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/admin/user',
    method: 'put',
    data: obj
  })
}

// 代理商管理列表
export function getAgentList(query) {
  return request({
    url: '/autoSR/zkagent/page',
    method:'get',
    params:query
  })
}

//省市
export function getparentIdList(query) {
  return request({
    url: '/autoSR/zksysarea/list',
    method:'get',
    params:query
  })
}

//获取运营人员
export function getAllOperationsStaff(query) {
  return request({
    url: '/admin/user/getAllOperationsStaff',
    method:'get'
  })
}

//添加代理商
export function AddAgent(data) {
  return request({
    url: '/autoSR/zkagent/save',
    method:'post',
    data
  })
}

//删除代理商
export function delAgent(data) {
  return request({
    url: '/autoSR/zkagent/del',
    method:'post',
    data
  })
}

//更换管理账号
export function updateManagerPhone(data) {
  return request({
    url: '/autoSR/zkagent/updateManagerPhone',
    method:'post',
    data
  })
}

//编辑代理商
export function editorAgent(data) {
  return request({
    url: '/autoSR/zkagent/update',
    method:'post',
    data
  })
}


//公司管理列表
export function getcompanyList(query) {
  return request({
    url: '/autoSR/zkorg/page',
    method:'get',
    params:query
  })
}

//获取代理商
export function findMyAgent(query) {
  return request({
    url: 'autoSR/zkagent/findMyAgent',
    method:'get',
    params:query
  })
}

//获取运营人员列表
export function getAllOperationsStaffByAgent(query) {
  return request({
    url: 'admin/user/getAllOperationsStaffByAgent',
    method:'get',
    params:query
  })
}

//添加公司
export function AddaddOrg(data) {
  return request({
    url: '/autoSR/zkorg/addOrg',
    method:'post',
    data
  })
}

//删除公司
export function delOrg(data) {
  return request({
    url: '/autoSR/zkorg/delOrg',
    method:'post',
    data
  })
}

//公司更换运营人员
export function changeAccount(data) {
  return request({
    url: '/autoSR/zkorg/updateManagerPhone',
    method:'post',
    data
  })
}

//编辑公司获取公司信息
export function gitfindById(query) {
  return request({
    url: '/autoSR/zkorg/findById',
    method:'get',
    params:query
  })
}

//公司编辑
export function updateOrg(data) {
  return request({
    url: '/autoSR/zkorg/updateOrg',
    method:'post',
    data
  })
}

//设备批次列表
export function getequipmentbatch(query) {
  return request({
    url: '/autoSR/zkequipmentbatch/page',
    method:'get',
    params:query
  })
}

//绑定批次
export function insert(data) {
  return request({
    url: '/autoSR/zkequipmentbatch/insert',
    method:'post',
    data
  })
}

//修改批次
export function insertupdate(data) {
  return request({
    url: '/autoSR/zkequipmentbatch/update',
    method:'post',
    data
  })
}


//用户洞察
export function findmatchdata(query) {
  return request({
    url: '/autoSR/matchKeywords/findmatchdata',
    method:'get',
    params:query
  })
}

