import request from '@/utils/request'
import { preventRepeatFu } from "@/utils/hciot";
// 查询行政划分列表
export function listRegionalism(query) {
    return request({
        url: '/system/regionalism/list',
        method: 'get',
        params: query
    })
}

// 查询行政划分详细
export function getRegionalism(regionalismId) {
    return request({
        url: '/system/regionalism/' + regionalismId,
        method: 'get'
    })
}

// 新增行政划分
export function addRegionalism(data) {
    preventRepeatFu(true)
    return request({
        url: '/system/regionalism',
        method: 'post',
        data: data
    })
}

// 修改行政划分
export function updateRegionalism(data) {
    preventRepeatFu(true)
    return request({
        url: '/system/regionalism',
        method: 'put',
        data: data
    })
}

// 删除行政划分
export function delRegionalism(regionalismId) {
    return request({
        url: '/system/regionalism/' + regionalismId,
        method: 'delete'
    })
}

// 查询行政区划下拉树结构
export function treeListRegionalism() {
    return request({
      url: '/system/regionalism/tree-list',
      method: 'get'
    })
  }

  // 查询行政区划下拉树结构
export function treeListChild(id) {
    return request({
      url: '/system/regionalism/child/' + id,
      method: 'get'
    })
  }
