import request from '@/utils/request'

export function _getTrackingMoreNodeDtos(idStr) {
  let url = '/TrackingMore/getTrackingMoreNodeDtos'
  if (idStr) {
    url += `?ids=${idStr}`
  }
  return request({
    url: url,
    method: 'get'
  })
}

export function _editNote(data) {
  return request({
    timeout: 60000,
    url: '/TrackingMore/EditNote',
    method: 'post',
    data
  })
}

export function _loadSolutions(){
  return request({
    timeout: 60000,
    url: '/TrackingMore/LoadSolutions',
    method: 'post'
  })
}

export function _cloneSolution(data){
  return request({
    timeout: 60000,
    url: '/TrackingMore/CloneSolution',
    method: 'post',
    data
  })
}

/**
 * 获取服务商
 * @returns
 */
export function _getEndServiceProviderList() {
  return request({
    timeout: 60000,
    url: '/TrackingMore/GetEndServiceProviderList',
    method: 'get'
  })
}

/**
 * 编辑异常轨迹服务商
 * @returns
 */
export function _setChannelEndServiceProvider(params) {
  return request({
    timeout: 60000,
    url: '/LogisticsChannel/SetChannelEndServiceProvider',
    method: 'post',
    params
  })
}

/**
 * 异常轨迹服务商分页数据
 * @param {*} data
 * @returns
 */
export function _getEndServiceProviderPageResult(data) {
  return request({
    timeout: 60000,
    url: '/TrackingMore/GetEndServiceProviderPageResult',
    method: 'post',
    data,
  })
}

/**
 * 添加或编辑服务商
 * @param {*} data
 * @returns
 */
export function _AddOrEditProvider(data) {
  return request({
    timeout: 60000,
    url: '/TrackingMore/AddOrEditProvider',
    method: 'post',
    data
  })
}

/**
 * 添加或编辑节点
 * @param {*} data
 * @returns
 */
export function _EditProviderNote(data) {
  return request({
    timeout: 60000,
    url: '/TrackingMore/EditProviderNote',
    method: 'post',
    data
  })
}
