// src/api/ManageApi/index.js
import request from '@/utils/request';
// 分页查询所有数据(负面清单和正面清单)
export function getBasicInformationPage(params) {
  return request({
    url:'/gysl/basicInformation/page',
    method: 'get',
    params
  })
}
//产业标签 查询所有数据
export function getCybqInformationPage(params) {
  return request({
    url:'/gysl/Cybq/page',
    method: 'get',
    params
  })
}
//产业标签 通过主键查询单条数据
export function getSpanById(id) {
  return request({
    url: `/gysl/Cybq/${id}`,
    method: "get",
  });
}

// 通过主键查询单条所有数据（企业端）
export function getBasicInformationById(id) {
  return request({
    url: `/gysl/basicInformation/stagingInfo/${id}`,
    method: 'get'
  });
}
// 通过主键查询单条所有数据（政务端）
export function getzwBasicInformationById(id) {
  return request({
    url: `/gysl/basicInformation/${id}`,
    method: 'get'
  });
}

// 企业端提交填报
export function fillBasicInformation(data) {
  return request({
    url: '/gysl/basicInformation/fill',
    method: 'post',
    data: data
  })
}
//企业端暂存数据
export function tempBasicInformation(data) {
  return request({
    url: '/gysl/basicInformation/staging',
    method: 'post',
    data: data
  })
}
// 政务端审核通过
export function auditBasicInformation(data) {
  return request({
    url: '/gysl/basicInformation/audit',
    method: 'post',
    data: data
  })
}
// 基本信息删除数据
export function deleteBasicInformation(idList) {
  return request({
    url: '/gysl/basicInformation/delete',
    method: 'delete',
    params: { idList }
  })
} 

// 企业--基本信息==修改
export function updateBasicInformation(data) {
  return request({
    url: `/gysl/basicInformation/edit`,
    method: 'post',
    data
  });
}
// 基本信息的导出功能
export function exportBasicInformation(idList) {
  return request({
    url: '/gysl/basicInformation/exportInfo',
    method: 'post',
    params: { idList }, 
  });
}
// 项目详情 规划信息
// 修改规划信息
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 updateYsElement(data){
  return request({
    url:'/gysl/mx/updateYs',
    method:'post',
    data
  })
}


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

//删除要素
export function deleteYsElement(params) {
  return request({
    url: '/gysl/mx/deleteYs',
    method: 'delete',
    params  
  })
}

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

// 删除目录
export function deleteCatalog(idList) {
  return request({
    url: `/gysl/ml/delete`,
    method: 'delete',
    params: {
      idList: idList.join(',') // 将数组转换为逗号分隔的字符串
    }
  });
}

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

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

// 项目知识库管理
// 新增数据
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: idList.join(',') // 将数组转换为逗号分隔的字符串
    }
  });
}

// 修改数据
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: idList.join(',') // 将数组转换为逗号分隔的字符串
    }
  });
}
//修改项目巡礼
export function updataXmxl (data) {
  return request({
    url: '/gysl/xmxl/edit',
    method: 'post',
    data
  });
}
//分页查询所有项目巡礼
export function getXmxlList(params) {
  return request({
    url: '/gysl/xmxl/list',
    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'
  });
}
//企业入驻信息
// 根据项目ID分页查询所有入驻企业
export function getqyBasicInformationPage(params) {
  return request({
    url: '/gysl/enterprise/page',
    method: 'get',
    params
  });
}

// 修改信息
export function updateqyBasicInformation(data) {
  return request({
    url: '/gysl/enterprise/edit',
    method: 'post',
    data
  });
}

// 删除信息
export function deleteqyBasicInformation(idList) {
  return request({
    url: '/gysl/enterprise/delete',
    method: 'delete',
    params: {
      idList: idList.join(',') // 将数组转换为逗号分隔的字符串
    }
  });
}

//月度进展信息
//根据项目ID查询所有数据
export function getMonthInformationPage(params) {
  return request({
    url: '/gysl/projectProgress/page',
    method: 'get',
    params
  });
}

//建筑信息表
//新增数据
export function addjzxx(data) {
  return request({
    url: '/gysl/buildingInformation/add',
    method: 'post',
    data
  })
}
//删除数据
export function deletejzxx(idList) {
  return request({
      url: '/gysl/buildingInformation/delete',
      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 editxmtl(data) {
  return request({
    url: '/gysl/projectLegend/edit',
    method: 'put',
    data: data
  })
}
//根据项目ID查询数据// 修正后的API定义
export function getxmtlPageByxmId(params) {
  return request({
    url: '/gysl/projectLegend/page',
    method: 'get',
    params  // 注意这里改为params，GET请求会自动拼接到URL
  })
}

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

//项目其他信息
//新增数据
export function addxmqt(data) {
  return request({
    url:'/gysl/projectOtherInfo/add',
    method:'post',
    data
  })
}
//删除数据
export function deletexmqt(idList) {
  return request({
    url:'/gysl/projectOtherInfo/delete',
    method:'delete',
    params: { idList: idList.join(',') } 
  })
}
//修改数据
export function updatexmqt(data) {
  return request({
    url:'/gysl/projectOtherInfo/edit',
    method:'post',
    data
  })
}
//根据项目id查询信息
export function getOtherInfoByxmId(query) {
  return request({
    url: '/gysl/projectOtherInfo/searchId',
    method: 'get',
    params: query // 使用 params 传递查询参数
  });
}
//项目备忘录
//新增数据
export function addxmmmb(data) {
  return request({
    url:'/gysl/projectRemark/add',
    method:'post',
    data
  })
}
//删除数据
export function deletexmmmb(idList) {
  return request({
    url: '/gysl/projectRemark/delete',
    method: 'delete',
    params: { 
      idList: idList.join(',') // 将数组转换为逗号分隔的字符串
    }
  });
}
//修改数据
export function updateProjectRemark(projectRemark) {
  return request({
    url: '/gysl/projectRemark/edit',
    method: 'put',
    data: projectRemark, 
    headers: {
      'Content-Type': 'application/json' 
    }
  });
}
//查询所有数据
export function getxmmmbPage(params) {
  return request({
    url:'/gysl/projectRemark/page',
    method:'get',
    params
  })
}
//通过主键查询单条数据
export function getxmmmbById(id) {
  return request({
    url:`/gysl/projectRemark/${id}`,
    method:'get',
    params:{id}
  })
}

//单片材料管理
//新增数据
export function addClgl(data) {
  return request({
    url: '/gysl/dpclgl/add',
    method: 'post',
    data
  });
}

// 删除数据
export function deleteClgl(idList) {
  return request({
    url: '/gysl/dpclgl/delete',
    method: 'delete',
    params: { idList: idList.join(',') } // 将数组转换为逗号分隔的字符串
  });
}

// 修改数据
export function updateClgl(data) {
  return request({
    url: '/gysl/dpclgl/edit',
    method: 'put',
    data
  });
}

// 分页查询所有数据
export function getClglPage(params) {
  return request({
    url: '/gysl/dpclgl/page',
    method: 'get',
    params
  });
}
// 富文本编辑接口
export function exportToPdf(params) {
  return request({
    url: '/gysl/dpclgl/unloadPdf',
    method: 'get',
    params,
  })
}

//通用下载请求
export function downloadPdf(fileName) {
  return request({
    url: '/common/download',
    method: 'get',
    params: { fileName },
  })
}

//政务统计
//整体项目情况
export function allinformation(params){
    return request({
      url:'/gysl/zwStats/allProject',
      method:'get',
      params
    })
}

// //投资主体
export function investall(params) {
  return request({
    url: '/gysl/zwStats/investors',
    method: 'get',
    params
  })
}

// 功能区
export function fungong(params){
  return request({
    url:'/gysl/zwStats/ribbon',
    method:'get',
    params
  })
}

//详细通知
export function getAllMessages(){
  return request({
    url:'/gysl/zwStats/zwNotice',
    method:'get'
  })
}

//项目列表
export function  xmlist(){
  return request({
    url:'/gysl/zwStats/projectList',
    method:'get'
  })
}
//政务统计结束

//企业统计
//整体项目情况
export function allinformationtwo(){
  return request({
    url:'/gysl/qyStats/allProject',
    method:'get'
  })
}
//产业数据分析
export function allchanye(){
  return request({
    url:'/gysl/zwStats/slfx',
    method:'get'
  })
}
//产业导向目录分析
export function allchanyeml(){
  return request({
    url:'/gysl/zwStats/mlfx',
    method:'get'
  })
}


//产业导向细分产业分析
export function allchanyexfcyfx(){
  return request({
    url:'/gysl/zwStats/xfcyfx',
    method:'get'
  })
}

//企业详细通知
export function getAllMessagestwo(){
  return request({
    url:'/gysl/qyStats/qyNotice',
    method:'get'
  })
}

//通过主键查询项目画像
export function getpicture(id){
  return request({
    url:`/gysl/xmpjqd/oneXmhx/${id}`,
    method:'get'
  })
}
//通过主键查询单条项目评价清单
export function getpicturelist(id){
  return request({
    url:`/gysl/xmpjqd/${id}`,
    method:'get'
  })
}


// 细分产业管理
// 新增数据
export function addXfcygl(data) {
  return request({
    url: '/gysl/xfcygl/add',
    method: 'post',
    data:data
  });
}

// 删除数据
export function deleteXfcygl(idList) {
  return request({
    url: '/gysl/xfcygl/delete',
    method: 'delete',
    params: {
      idList: idList.join(',') // 将数组转换为逗号分隔的字符串
    }
  });
}

// 修改数据
export function updateXfcygl(data) {
  return request({
    url: '/gysl/xfcygl/edit',
    method: 'put',
    data:data
  });
}

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


//消息通知数量(企业端)
export function getMessageCount() {
  return request({
    url: '/gysl/qyStats/qyNoticeCount',
    method: 'get'
  })
}
//消息通知数量(政务端)
export function getMessageCounttwo() {
  return request({
    url: '/gysl/zwStats/zwNoticeCount',
    method: 'get'
  })
}

//智能提醒
//已读提醒
export function markSmartReminderAsRead(id) {
  return request({
    url: `/gysl/jSmartReminders/isRead/${id}`,
    method: 'get'
  });
}

//分页查询智能提醒规则数据
export function getSmartReminderPage(params) {
  return request({
    url: '/gysl/jSmartReminders',
    method: 'get',
    params: params
  });
}
//新增智能提醒规则
export function addSmartReminder(params) {
  return request({
    url: '/gysl/jSmartReminders/add',
    method: 'post',
    data: params
  });
}
//删除智能提醒规则
export function deleteSmartReminder(id) {
  return request({
    url: `/gysl/jSmartReminders/delete/${id}`,
    method: 'post'
  });
}

//通过主键查询单条智能提醒规则数据
export function getSmartReminderDetail(id) {
  return request({
    url: `/gysl/jSmartReminders/${id}`,
    method: 'get'
  });
}

//修改定期提醒数据和不定期提醒数据
export function updateSmartReminder(params) {
  return request({
    url: '/gysl/jSmartReminders/updateDq',
    method: 'post',
    data: params
  });
}

//定时器更新不定期提醒数据
export function updateSmartReminderUntimer(params) {
  return request({
    url: '/gysl/jSmartReminders/updateNoRegularReminders',
    method: 'post',
    data: params
  });
}

//分页查询工作手册所有数据
export function getHandbookPage(params) {
  return request({
    url: '/gysl/handbook/page',
    method: 'get',
    params
  });
}

//新增工作手册
export function addHandbook(data) {
  return request({
    url: '/gysl/handbook/add',
    method: 'post',
    data
  });
}

//修改工作手册
export function updateHandbook(data) {
  return request({
    url: '/gysl/handbook/edit',
    method: 'post',
    data
  });
}

//删除工作手册
export function deleteHandbook(idList) {
  return request({
    url: `/gysl/handbook/delete`,
    method: 'delete',
    params:{
      idList: idList.join(',')
    }
  });
}

//通过主键查询单条工作手册数据
export function getHandbookDetail(id) {
  return request({
    url: `/gysl/handbook/${id}`,
    method: 'get'
  });
}

//导出工作手册
export function exportHandbook(id) {
  return request({
    url: `/gysl/handbook/export`,
    method: 'post',
    responseType: 'blob',
    params: { id: id.join(',') }
  });
}