import request from '@/utils/request'
// 获取接入反馈列表
export function getTabAccessFeedbackList (params) {
  return request({
    url: '/web/tab-access-ready/list',
    method: 'get',
    params: params
  })
}

// 
export function updateIsApplyById (data) {
  return request({
    url: `/web/tab-access-ready/updateIsApplyById`,
    method: 'post',
    data:data
  })
}

// 删除接入反馈列表
export function delTabAccessFeedbackList (data) {
  return request({
    url: `/web/tab-access-feedback/deleteTabAccessFeedbackById`,
    method: 'delete',
    data: data
  })
}

// 第一步详情查询
export function getFirstStepTabAccessReadyById (id) {
  return request({
    url: `/web/tab-access-ready/getTabAccessAndReadyById/${id}`,
    method: 'get',
  })
}

// 第二步详情查询
export function getSecondStepTabAccessReadyById (id) {
  return request({
    url: `/web/tab-access-feedback/getTabAccessFeedbackListByAccessOnlyId/${id}`,
    method: 'get',
  })
}

export function updateSecondStepTabAccessFeedbackById (data) {
  return request({
    url: `/web/tab-access-feedback/updateTabAccessFeedbackById`,
    method: 'put',
    data:data
  })
}



// 第三步详情查询
export function getThirdStepTabAccessReadyById (id) {
  return request({
    url: `/web/tab-datasource-msg/getDataSunByAccessOnlyId/${id}`,
    method: 'post',
  })
}


export function saveStepTabAccessReadyById (data) {
  return request({
    url: `/web/tab-access-ready/updateStatusById`,
    method: 'post',
    data:data
  })
}

// 第三步 修改
export function updateThirdStepDataSun (data) {
  return request({
    url: `/web/tab-datasource-msg/updateDataSun`,
    method: 'post',
    data:data
  })
}




// 添加接入基本准备
export function addFirstStepTabAccessReady (data) {
  return request({
    url: '/web/tab-access-ready/insertTabAccessReady',
    method: 'post',
    data:data
  })
}



export function updateFirstStepTabAccessReadyById (data) {
  return request({
    url: '/web/tab-access-ready/updateTabAccessReadyById',
    method: 'post',
    // data: data
    data
  })
}


export function delFirstStepTabAccessReady (id) {
  return request({
    url: `/web/tab-access-ready/falseDeleteTabAccessAndReadyById/${id}`,
    method: 'post',
  })
}


// 第二步 删除子项
export function delSecondStepTabAccessReady (id) {
  return request({
    url: `/web/tab-access-feedback/falseDeleteTabAccessFeedbackById/${id}`,
    method: 'delete',
  })
}

// 第三步删除  子项
export function deleteDataSun(id) {
  return request({
    url: `/web/tab-datasource-msg/deleteDataSun/${id}`,
    method: 'delete',
  })
}

// 第三步删除 api 子项
export function deleteUrlSun(id) {
  return request({
    url: `/web/tab-datasource-msg/deleteUrlSun/${id}`,
    method: 'delete',
  })
}

export function addSecondStepTabAccessReady (data) {
  return request({
    url: `/web/tab-access-feedback/insertTabAccessFeedback`,
    method: 'post',
    data: data
  })
}


// 第三步
export function addThirdStepTabAccessReady (data) {
  return request({
    url: `/web/tab-datasource-msg/insertDataSun`,
    method: 'post',
    data: data
  })
}

export function delThirdStepTabAccessReady (id) {
  return request({
    url: `/web/tab-datasource-msg/deleteDataSun/${id}`,
    method: 'post',
  })
}

// 取消接入反馈
export function deleteTabAccessFeedbackById (accessOnlyId) {
  return request({
    url: `/web/tab-access-feedback/deleteTabAccessFeedbackById/${accessOnlyId}`,
    method: 'post',
  })
}