/*
 * @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';
/**
 * 后端控制菜单模拟json，路径在 https://gitee.com/lyt-top/vue-next-admin-images/tree/master/menu
 * 后端控制路由，isRequestRoutes 为 true，则开启后端控制路由
 * @method getMenu 获取后端动态路由菜单(admin)
 */
/**
 * @description: 获取组织架构列表
 * @param {object} params
 * @return {*}
 */
export const getOrgList = (params?: object) => {
	return request({
		url: '/api/v1/Org/getorgjson',
		method: 'get',
		params
	});
};
/**
 * @description: 新增组织
 * @param {object} params
 * @return {*}
 */
export const addOrg = (params: object) => {
	return request({
		url: '/api/v1/Org/add-org',
		method: 'post',
		data:params
	});
};
/**
 * @description: 更新组织修改
 * @param {object} params
 * @return {*}
 */
export const updateOrg = (params: object) => {
	return request({
		url: '/api/v1/Org/update-org',
		method: 'post',
		data:params
	});
};
/**
 * @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',
	});
};