/*
 * @Author: zc
 * @description 辅助功能-行业管理
 */
import request from '@/utils/request';
/**
 * @description 获取部门树形
 * @param {string} id
 */
export const getAuxIndustryTree = (id?: string) => {
	return request({
		url: `/api/v1/IndustrialManagement/getorglist/${id}`,
		method: 'get',
	});
};
/**
 * @description 获取行业列表
 * @param {object} params
 */
export const getAuxIndustryList = (params?: object) => {
	return request({
		url: '/api/v1/IndustrialManagement/getindustrialmanagementlist',
		method: 'get',
		params,
	});
};
/**
 * @description 行业列表导出
 * @param {object} data
 */
export const exportAuxIndustry = (data?: object) => {
	return request(
		{
			url: '/api/v1/IndustrialManagement/getindustrialmanagementlist_export',
			method: 'post',
			data,
			responseType: 'blob',
		},
		{
			reduce_data_format: false,
		}
	);
};
/**
 * @description 新增行业
 * @param {object} data
 */
export const addAuxIndustry = (data: object) => {
	return request({
		url: '/api/v1/IndustrialManagement/industryadd',
		method: 'post',
		data,
	});
};
/**
 * @description 获取行业详情
 * @param {string} id
 */
export const getAuxIndustryDetail = (id: string) => {
	return request({
		url: `/api/v1/IndustrialManagement/${id}`,
		method: 'get',
	});
};
/**
 * @description 修改行业
 * @param {object} data
 */
export const updateAuxIndustry = (data: object) => {
	return request({
		url: '/api/v1/IndustrialManagement/industryupdate',
		method: 'post',
		data,
	});
};
/**
 * @description 删除行业
 * @param {string} id
 */
export const deleteAuxIndustry = (id: string) => {
	return request({
		url: `/api/v1/IndustrialManagement/${id}`,
		method: 'delete',
	});
};
/**
 * @description 根据行业查询部门
 * @param {object} params
 */
export const getAuxIndustryDepartment = (params?: object) => {
	return request({
		url: '/api/v1/IndustrialManagement/getindustryassociationsbyid',
		method: 'get',
		params,
	});
};
/**
 * @description 获取行业诉求工单
 * @param {object} params
 */
export const getAuxIndustryWorkOrder = (params?: object) => {
	return request({
		url: '/api/v1/IndustrialManagement/industrial-orders',
		method: 'get',
		params,
	});
};
/**
 * @description 行业诉求工单导出
 * @param {object} data
 */
export const exportAuxIndustryWorkOrder = (data?: object) => {
	return request(
		{
			url: '/api/v1/IndustrialManagement/industrial-orders-export',
			method: 'post',
			data,
			responseType: 'blob',
		},
		{
			reduce_data_format: false,
		}
	);
};
