/*
 * @Author: zc
 * @description 组织架构配置
 * @version: 
 * @Date: 2022-10-21 09:01:22
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-11-12 10:20:57
 */
import request from '/@/utils/request';
/**
 * @description 基础数据
 * @return {*}
 */
export const baseData = () => {
	return request({
		url: `/api/v1/Org/base-data`,
		method: 'get',
	});
};
/**
 * @description 获取组织架构列表
 * @param {object} params
 * @return {*}
 */
export const getOrgList = (params?: object) => {
	return request({
		url: '/api/v1/Org/getorgjson',
		method: 'get',
		params
	});
};
/**
 * @description 新增组织
 * @return {*}
 * @param data
 */
export const addOrg = (data: object) => {
	return request({
		url: '/api/v1/Org',
		method: 'post',
		data
	});
};
/**
 * @description 更新组织修改 不支持修改上级
 * @return {*}
 * @param data
 */
export const updateOrg = (data: object) => {
	return request({
		url: '/api/v1/Org',
		method: 'put',
		data
	});
};
/**
 * @description 删除组织
 * @param {object} id
 * @return {*}
 */
export const removeOrg = (id: string) => {
	return request({
		url: `/api/v1/Sys/removemenu/${id}`,
		method: 'delete',
	});
};
/**
 * @description 获取组织详情根据id
 * @param {object} id
 * @return {*}
 */
export const getOrgById = (id: string) => {
	return request({
		url: `/api/v1/Org/getorg/${id}`,
		method: 'get',
	});
};