import request from '@/router/axios';

export const getList =
    (current, size, params) => {
      return request({
        url: '/api/jobslink-api/tenant/station/company/info/list',
        method: 'get',
        params: {
          ...params,
          current,
          size,
        }
      })
    }

export const getMain = null
export const check = null
export const getDetail =
    (id) => {
      return request({
        url: '/api/jobslink-api/tenant/station/company/info/detail',
        method: 'get',
        params: {id}
      })
    }

export const add =
    (row) => {
      return request({
        url: '/api/jobslink-api/tenant/station/company/info/save',
        method: 'post',
        data: row
      })
    }

export const update =
    (row) => {
      return request({
        url: '/api/jobslink-api/tenant/station/company/info/update	',
        method: 'post',
        data: row
      })
    }

export const end = (id) => {
  return request({
    url: '/api/jobslink-api/tenant/station/company/info/end',
    method: 'post',
    params: {id}
  })
}

// 工作站新增主体
export const companyInfoAdd = (id) => {
  return request({
    url: '/api/jobslink-api/tenant/company/station/companyInfo',
    method: 'post',
    data: id
  })
}

// 工作站主体列表
export const companyStationInfo =
  (current, size, params) => {
  return request({
    url: '/api/jobslink-api/tenant/company/station/info',
    method: 'get',
    params: {
      current,
      size,
      ...params,
    }
  })
}
// 查看主体信息
export const companyDetail =
  (params) => {
    return request({
      url: '/api/jobslink-api/tenant/company/detail',
      method: 'get',
      params: params
    })
  }

// 修改主体信息
export const companyUpdate =
  (params) => {
    return request({
      url: '/api/jobslink-api/tenant/company/update',
      method: 'post',
      data: params
    })
  }

// 终止合作主体
export const stationStop =
  (params) => {
    return request({
      url: '/api/jobslink-api/tenant/company/station/status',
      method: 'post',
      params: params
    })
  }


export const tuserList =
  (current, size, params, tenantId) => {
    return request({
      url: '/api/jobslink-api/system/tuser/list',
      method: 'get',
      params: {
        ...params,
        current,
        size,
        tenantId,
        authType: 2
      }
    })
  }

export const tuserUpdate =
  (row) => {
    return request({
      url: '/api/jobslink-api/tenant/station/company/info/update	',
      method: 'post',
      data: row
    })
  }

export const disableUser =
  (ids) => {
    return request({
      url: '/api/jobslink-api/system/tuser/off',
      method: 'post',
      params: {
        ids,
        authType: 2
      }
    })
  }

export const enableUser =
  (ids) => {
    return request(
      {url: '/api/jobslink-api/system/tuser/on', method: 'post', params: {ids, authType: 2}})
  }


  export const removeMainList = (data) => request({
    url: '/api/jobslink-api/tenant/company/update',
    method: 'post',
    data
  })
