import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/blade-manager/trial/summary/page',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}

export const getDetail = (id) => {
  return request({
    url: '/api/blade-manager/trial/summary/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (id) => {
  return request({
    url: '/api/blade-manager/trial/summary/remove',
    method: 'get',
    params: {
      id,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/blade-manager/trial/summary/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/blade-manager/trial/summary/submit',
    method: 'post',
    data: row
  })
}

export const getMetadataDetail = (current, size, params) => {
  return request({
    url: '/api/blade-business/metadata/classification/detail',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}

export const metadataSubmit = (row) => {
  return request({
    url: '/api/blade-business/metadata/classification/submit',
    method: 'post',
    data: row
  })
}

export const metadataUpdate = (row) => {
  return request({
    url: '/api/blade-business/metadata/classification/submit',
    method: 'post',
    data: row
  })
}

export const metadataRemove = (id) => {
  return request({
    url: '/api/blade-business/metadata/remove',
    method: 'post',
    params: {
      ids:id,
    }
  })
}

export const getAllocationDetail = (current, size, params) => {
  return request({
    url: '/api/blade-business/metadata/allocation/detail',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}
//设置分类
export const allocation = (row) => {
  return request({
    url: '/api/blade-business/metadata/allocation',
    method: 'post',
    params: row
  })
}
//取消捕获
export const cancelAllocation = (row) => {
  return request({
    url: '/api/blade-business/metadata/cancelAllocation',
    method: 'post',
    params: row
  })
}

//匹配划分
export const matching = (row) => {
  return request({
    url: '/api/blade-manager/trial/summary/matching',
    method: 'post',
    data: row
  })
}

//关联清表
export const relevancy = (row) => {
  return request({
    url: '/api/blade-manager/trial/summary/relevancy',
    method: 'post',
    data: row
  })
}
//关联清表-清表懒加载
export const tablazy = (params) => {
  return request({
    url: '/api/blade-manager/trial/summary/lazy',
    method: 'get',
    params
  })
}
//获取关联清表html
export const getLinkHtml = (params) => {
  return request({
    url: '/api/blade-manager/trial/summary/tab/html',
    method: 'get',
    params
  })
}

//选择表单列表
export const getLinkTablist = (params) => {
  return request({
    url: '/api/blade-manager/trial/summary/tab/list',
    method: 'get',
    params
  })
}
//选择表单列表
export const getLinkElelist = (params) => {
  return request({
    url: '/api/blade-manager/trial/summary/element/list',
    method: 'get',
    params
  })
}

//获取输入框映射数据来源
export const getLinkDetail = (params) => {
  return request({
    url: '/api/blade-manager/trial/summary/input/detail',
    method: 'get',
    params
  })
}

//映射数据保存
export const saveLinkDetail = (row) => {
  return request({
    url: '/api/blade-manager/trial/summary/reflection/save',
    method: 'post',
    data: row
  })
}
//获取当前清表表所有已匹配的映射字段列表接口
export const getLinkData = (params) => {
  return request({
    url: '/api/blade-manager/trial/summary/reflection/html/data',
    method: 'get',
    params
  })
}
export const removeLinkData = (params) => {
  return request({
    url: '/api/blade-manager/trial/summary/reflection/remove',
    method: 'post',
    params
  })
}
