/*
 * @Author: zc
 * @description 辅助功能-区域管理
 */
import request from '@/utils/request';
/**
 * @description 获取省市区树形
 */
export const treeArea = () => {
	return request({
		url: `/api/v1/Sys/area/tree`,
		method: 'get',
	});
};
/**
 * @description 获取省市区树形 （泸州）
 */
export const treeAreaLZ = () => {
	return request({
		url: `/api/v1/Sys/area/tree_accepted`,
		method: 'get',
	});
};
/**
 * @description 导出省市区树形
 */
export const treeAreaExport = (data: any) => {
	return request(
		{
			url: `/api/v1/Sys/area/tree/export`,
			method: 'post',
			data,
			responseType: 'blob',
		},
		{
			reduce_data_format: false,
		}
	);
};
/**
 * @description 新增省市区树形
 * @param {object} data
 */
export const treeAreaAdd = (data: object) => {
	return request({
		url: `/api/v1/Sys/area`,
		method: 'post',
		data,
	});
};
/**
 * @description 编辑省市区树形
 * @param {object} data
 */
export const treeAreaEdit = (data: object) => {
	return request({
		url: `/api/v1/Sys/area`,
		method: 'put',
		data,
	});
};
/**
 * @description 删除省市区树形
 * @param {string} id
 */
export const treeAreaDelete = (id: object) => {
	return request({
		url: `/api/v1/Sys/area/${id}`,
		method: 'delete',
	});
};
/**
 * @description 省市区详情
 * @param {string} id
 */
export const treeAreaDetail = (id: object) => {
	return request({
		url: `/api/v1/Sys/area/${id}`,
		method: 'get',
	});
};
