import request from '@/utils/request'
import data from "@/views/system/dict/data.vue";

// 查询小区集合
export function getAreaList({district}) {
    return request({
        url: `/zdsz/area/getAreaList?district=${district}`,
        method: 'get',
    })
}

// 获取字典
export function getDictType({dictType}) {
    return request({
        url: `/system/dict/data/type/${dictType}`,
        method: 'get',
    })
}

// 获取工程子节点集合（民用 基建 顶管）
export function getDictList({enginType}) {
    return request({
        url: `/system/dict/data/dictList/${enginType}`,
        method: 'get',
    })
}

export function getUnits(areaId,buildingId) {
    return request({
      url: '/zdsz/unit/getUnitList',
      method: 'GET',
      params:{
        areaId:areaId,
        buildingId:buildingId
      }
    })
  }

// 查询楼栋集合
export function getBuildingList({areaId}) {
    return request({
        url: `/zdsz/building/getBuildingList?areaId=${areaId}`,
        method: 'get',
    })
}

// 查询单元集合
export function getUnitList({buildingId}) {
    return request({
        url: `/zdsz/unit/getUnitList?buildingId=${buildingId}`,
        method: 'get',
    })
}

// 查询房间集合
export function getHousesList({unitId}) {
    return request({
        url: `/zdsz/house/getHousesList?unitId=${unitId}`,
        method: 'get',
    })
}

// 获取工程材质
export function getEnginMaterialQualityList({enginType}) {
    return request({
        url: `/zdsz/enginMaterialQuality/getEnginMaterialQualityList?enginType=${enginType}`,
        method: 'get',
    })
}

// 获取材质规格
export function getEnginSpecificationsList(params) {
    return request({
        url: `/zdsz/enginSpecifications/getEnginSpecificationsList`,
        method: 'get',
        params
    })
}


// 查询工程列表（工业 1 市政 2）
export function getEngineeList({type, enginType ='',}) {
    return request({
        url: `/zdsz/engineeringIndustry/list?type=${type}&enginType=${enginType}`,
        method: 'get',
    })
}

// 查看市政工程历史
export function viewEngineeringIndustrySource({id ,type}) {
    return request({
      url: `/zdsz/engineeringIndustry/${id}/${type}`,
      method: 'get',
    })
}


// 查询顶管列表（顶管 ）
export function getPipeJackingList(sata) {
    return request({
        url: `/zdsz/engineeringPipeJacking/list`,
        method: 'get',
      params:sata
    })
}

// 新增工程（工业 市政）
export function addEnginee(data) {
    return request({
      url: '/zdsz/engineeringIndustry',
      method: 'post',
      data
    })
}


// 查询危险工程列表
export function getEnginDangerousList({ZEngineeringDangerousBo = {}}) {
    return request({
        url: `/zdsz/engineeringDangerous/list?ZEngineeringDangerousBo=${ZEngineeringDangerousBo}`,
        method: 'get',
    })
}


// 新增危险作业工程
export function addEngineeringDangerous(data) {
    return request({
      url: '/zdsz/engineeringDangerous',
      method: 'post',
      data
    })
}

// 查询危险作业工程详情
export function viewEngineeringDangerous(id) {
    return request({
      url: `/zdsz/engineeringDangerous/query/${id}`,
      method: 'get',
    })
}

// 修改危险作业工程
export function putEngineeringDangerous(data) {
    return request({
      url: '/zdsz/engineeringDangerous',
      method: 'post',
      data
    })
}

// 新增顶管工程
export function addEngineeringPipeJacking(data) {
    return request({
      url: '/zdsz/engineeringPipeJacking',
      method: 'post',
      data
    })
}

// 修改顶管工程
export function putEngineeringPipeJacking(data) {
    return request({
      url: '/zdsz/engineeringPipeJacking',
      method: 'put',
      data
    })
}

// 查看顶管工程历史
export function detailEngineeringPipeJacking({id ,type}) {
    return request({
      url: `/zdsz/engineeringPipeJacking/${id}/${type}`,
      method: 'get',
    })
}


// 新增民用工程
export function addEngineeringCivil(data) {
    return request({
      url: '/zdsz/engineeringCivil',
      method: 'post',
      data
    })
}

// 民用单项审核
export function engineeringCivilReview(data) {
    return request({
      url: '/zdsz/engineeringCivil/Review',
      method: 'post',
      data
    })
}

/**
 * 民用审核
 * @param data
 * @returns {*}
 * @constructor
 */
export function CivilReview(data) {
  return request({
    url: '/zdsz/engineeringCivil/CivilReview',
    method: 'post',
    data
  })
}


// 民用批量审核
export function engineeringCivilAllReview(data) {
    return request({
      url: '/zdsz/engineeringCivil/batchReview?enginClassification',
      method: 'post',
      data
    })
}


// 楼栋小区单元完成情况统计
export function getObtainRoomcCompletionInformationList(data) {
    return request({
      url: '/zdsz/engineeringCivil/getObtainRoomcCompletionInformationList',
      method: 'post',
      data
    })
}

// 修改民用工程
export function putEngineeringCivil(data) {
    return request({
      url: '/zdsz/engineeringCivil',
      method: 'put',
      data
    })
}

// 历史民用工程
export function viewEngineeringCivilSource({id,type}) {
    return request({
      url: `/zdsz/engineeringCivil/${id}/${type}`,
      method: 'get',
    })
}

// 查看房间历史
export function viewQueryProcessSource(data) {
    return request({
      url: '/zdsz/engineeringCivil/queryProcess',
      method: 'post',
      data
    })
}

// 查询民用工程详情
export function viewEngineeringCivil(id) {
    return request({
      url: `/zdsz/engineeringCivil/${id}`,
      method: 'get',
    })
}

// 删除民用工程
export function deleteEngineeringCivil(id) {
    return request({
      url: `/zdsz/engineeringCivil/${id}`,
      method: 'delete',
    })
}


// 查询顶管工程详情
export function viewEngineeringPipeJacking(id) {
    return request({
      url: `/zdsz/engineeringPipeJacking/${id}`,
      method: 'get',
    })
}


// 删除顶管工程详情
export function deleteEngineeringPipeJacking(id) {
    return request({
      url: `/zdsz/engineeringPipeJacking/${id}`,
      method: 'delete',
    })
}


// 新增基建工程
export function addEngineeringInfrastructure(data) {
    return request({
      url: '/zdsz/engineeringInfrastructure',
      method: 'post',
      data
    })
}

// 修改基建工程
export function putEngineeringInfrastructure(data) {
    return request({
      url: '/zdsz/engineeringInfrastructure',
      method: 'put',
      data
    })
}

// 历史基建工程
export function viewEngineeringInfrastructureSource({id,type}) {
    return request({
      url: `/zdsz/engineeringInfrastructure/${id}/${type}`,
      method: 'get',
    })
}


// 查询基建工程列表
export function getEngineeringInfrastructure(data) {
    return request({
        url: `/zdsz/engineeringInfrastructure/list`,
        method: 'get',
      params:data
    })
}

// 查询基建工程详情
export function viewEngineeringInfrastructure(id) {
    return request({
        url: `/zdsz/engineeringInfrastructure/${id}`,
        method: 'get',
    })
}

// 删除基建工程
export function deleteEngineeringInfrastructure(id) {
    return request({
        url: `/zdsz/engineeringInfrastructure/${id}`,
        method: 'delete',
    })
}
