/*
 * @Descripttion: 
 * @version: 
 * @Author: ysh
 * @Date: 2022-09-05 16:56:28
 * @LastEditors: wrh
 * @LastEditTime: 2024-09-06 15:35:49
 */
import request from '@/utils/request'

// 查询项目管理列表
export function listProject(query) {
  return request({
    url: '/file/project/list',
    method: 'get',
    params: query
  })
}

// 查询项目管理详细
export function getProject(id) {
  return request({
    url: '/file/project/' + id,
    method: 'get'
  })
}

// 新增项目管理
export function addProject(data) {
  return request({
    url: '/file/project',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'post',
    data: data
  })
}

// 修改项目管理
export function updateProject(data) {
  return request({
    url: '/file/project/edit',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'post',
    data: data
  })
}

// 删除项目管理
export function delProject(id) {
  return request({
    url: '/file/project/' + id,
    method: 'delete'
  })
}

// 上传项目KML文件
export function uploadProjectKml(params) {
  return request({
    url: '/file/project/uploadKml',
    method: 'post',
    params: params
  })
}

// 上传项目excel文件
export function uploadProjectSheet(params) {
  return request({
    url: '/file/project/uploadSheet',
    method: 'post',
    params: params
  })
}

export function downloadTemplate(url) {
  return request({
    url: url,
    method: 'get',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    responseType: 'blob'
  })
}

export function getProjectKml(url) {
  return request({
    url: url,
    method: 'get',
  })
}

// 根据项目编号查询项目信息
export function getInfoByProjectNumbers(data) {
  return request({
    url: '/file/project/query',
    method: 'get',
    params: data
  })
}
