// src/api/ManageApi/index.js
import request from '@/utils/request';

// 企业--基本信息==展示
export function getBasicInformationById(id) {
  return request({
    url: `/gysl/basicInformation/${id}`,
    method: 'get'
  });
}

// 企业--基本信息==修改
export function updateBasicInformation(data) {
  return request({
    url: `/gysl/basicInformation/edit`,
    method: 'post',
    data 
  });
}
// 基本信息的导出功能
export function exportBasicInformation(params) {
  return request({
    url: `/gysl/basicInformation/export`,
    method: 'post',
    data: params,
    responseType: 'blob'
  });
}
// 分页查询所有数据
export function getBasicInformationPage(params) {
  return request({
    url:'/gysl/basicInformation/page',
    method: 'get',
    params
  })
}
// 项目详情 规划信息
// 修改规划信息
export function updateProgrammeInformation(data) {
  return request({
    url: '/gysl/planInformation/edit',
    method: 'post',
    data
  });
}

//根据主键来查询单条数据
export function getProgrammeInformationById(quey) {
  return request({
    url: '/gysl/planInformation/selectAll', 
    method: 'get',
    params: quey
  });
}


// 项目评价清单 
// 分页查询项目评价清单
export function getProjectEvaluationList(params) {
  return request({
    url: '/gysl/xmpjqd/page',
    method: 'get',
    params
  });
}
// 修改项目评价清单
export function updateProjectEvaluationList(data) {
  return request({
    url: '/gysl/xmpjqd/edit',
    method: 'post',
    data
  });
}
// 新增项目评价清单
export function addProjectEvaluationList(data) {
  return request({
    url: '/gysl/xmpjqd/add',
    method: 'post',
    data
  });
}
// 删除项目评价清单
export function deleteProjectEvaluationList(idList) {
  return request({
    url: '/gysl/xmpjqd/delete',
    method: 'delete',
    params: { idList }
  });
}
//评价清单结束


// 项目评价配置接口
// 新增数据
export function addProjectEvaluation(data) {
  return request({
    url: '/gysl/pjpz/add',
    method: 'post',
    data
  });
}

// 删除数据
export function deleteProjectEvaluation(idList) {
  return request({
    url: '/gysl/pjpz/delete',
    method: 'delete',
    params: { idList }
  });
}

// 修改数据
export function updateProjectEvaluation(data) {
  return request({
    url: '/gysl/pjpz/edit',
    method: 'post',
    data
  });
}

// 分页查询所有数据
export function getProjectEvaluationPage(params) {
  return request({
    url: '/gysl/pjpz/page',
    method: 'get',
    params
  });
}
// 评价配置结束

// 要素指标管理
// 新增要素或者指标
export function addElement(data) {
  return request({
    url: '/gysl/mx/add',
    method: 'post',
    data
  });
}

// 查询所有要素
export function getAllElements(params) {
  return request({
    url: '/gysl/mx/page',
    method: 'get',
    params 
  });
}

// 编辑要素或者指标
export function editElemention(data) {
  return request({
    url: '/gysl/mx/edit',
    method: 'post',
    data
  });
}

// 删除指标
export function deleteElemention(id) {
  return request({
    url: `/gysl/mx/delete`,
    method: 'delete'
  });
}

// 目录管理
// 新增目录
export function addCatalog(data) {
  return request({
    url: '/gysl/ml/add',
    method: 'post',
    data
  });
}

// 删除目录
export function deleteCatalog(idList) {
  return request({
    url: `/gysl/ml/delete`,
    method: 'delete',
    params: { idList }
  });
}

// 修改目录
export function editCatalog(data) {
  return request({
    url: '/gysl/ml/edit',
    method: 'post',
    data
  });
}

// 查询所有目录
export function getAllCatalogs(params) {
  return request({
    url: '/gysl/ml/page',
    method: 'get',
    params
  });
}

// 项目知识库管理
// 新增数据
export function addXmzsk(data) {
  return request({
    url: '/gysl/xmzsk/add',
    method: 'post',
    data
  });
}

// 删除数据
export function deleteXmzsk(idList) {
  return request({
    url: '/gysl/xmzsk/delete',
    method: 'delete',
    params: { idList }
  });
}

// 修改数据
export function updateXmzsk(data) {
  return request({
    url: '/gysl/xmzsk/edit',
    method: 'post',
    data
  });
}

// 分页查询所有数据
export function getXmzskPage(params) {
  return request({
    url: '/gysl/xmzsk/page',
    method: 'get',
    params
  });
}

// 通过主键查询单条数据
export function getXmzskById(id) {
  return request({
    url: `/gysl/xmzsk/${id}`,
    method: 'get'
  });
}

//项目巡礼
//新增项目巡礼
export function addXmxl(data) {
  return request({
    url: '/gysl/xmxl/add',
    method: 'post',
    data
  });
}
//删除项目巡礼
export function deleteXmxl(idList) {
  return request({
    url: '/gysl/xmxl/delete',
    method: 'delete',
    params: { idList }
  });
}
//修改项目巡礼
export function updateXmxl(data) {
  return request({
    url: '/gysl/xmxl/edit',
    method: 'post',
    data
  });
}
//分页查询所有项目巡礼
export function getXmxlPage(params) {
  return request({
    url: '/gysl/xmxl/page',
    method: 'get',
    params
  });
}

//企业入驻内容区表格
//新增数据
export function addqyrz(data) {
  return request({
    url: '/gysl/qyrzInformation/add',
    method: 'post',
    data
  });
}
//修改数据
export function updateqyrz(data) {
  return request({
    url: '/gysl/qyrzInformation/edit',
    method: 'post',
    data
  });
}
//分页查询所有数据
export function getqyrzPage(params) {
  return request({
    url: '/gysl/qyrzInformation/page',
    method: 'get',
    params
  });
}
//删除数据
export function deleteqyrz(idList) {
  return request({
    url: '/gysl/qyrzInformation/delete',
    method: 'delete',
    params: { idList }
  });
}

//通过主键查询单条数据
export function getqyrzById(id) {
  return request({
    url: `/gysl/qyrzInformation/${id}`,
    method: 'get'
  });
}


//建筑信息表
//新增数据
export function addjzxx(data) {
  return request({
    url: '/gysl/buildingInformation/add',
    method: 'post',
    data
  })
}
//删除数据
export function deletejzxx(idList) {
  console.log('Deleting buildings with IDs:', idList); // 调试信息
  return request({
      url: '/gysl/buildingInformation/delete', // 使用正确的URL
      method: 'delete',
      params: { idList: idList.join(',') } // 将数组转换为逗号分隔的字符串
  });
}
//修改数据
export function updatejzxx(data) {
  return request({
    url: '/gysl/buildingInformation/edit',
    method: 'post',
    data
  })
}
//导入项目建筑信息
export function importjzxx(data) {
  return request({
    url: '/gysl/buildingInformation/importProjectBuilding',
    method: 'post',
    data
  })
}
//分页查询所有数据
export function getjzxxinformationByxmId(params) {
  return request({
    url: '/gysl/buildingInformation/page',
    method: 'get',
    params
  })
}
//通过主键查询单条数据
export function getjzxxById(id) {
  return request({
    url: `/gysl/buildingInformation/${id}`,
    method: 'get'
  })
}

//项目图例
//新增数据
export function addxmtl(data) {
  return request({
    url:'/gysl/projectLegend/add',
    method:'post',
    data
  })
}
//删除数据
export function deletexmtl(idList) {
  return request({
    url:'/gysl/projectLegend/delete',
    method:'delete',
    params:{idList}
  })
}
//修改数据
export function updatexmtll(data) {
  return request({
    url:'/gysl/projectLegend/edit',
    method:'post',
    data
  })
}
//分页查询所有数据
export function getxmtlPageByxmid(params) {
  return request({
    url:'/gysl/projectLegend/page',
    method:'get',
    params
  })
}
//通过主键查询单条数据
export function getxmtlById(id) {
  return request({
    url:`/gysl/projectLegend/${id}`,
    method:'get',
  })
}