import config from "@/config";
import http from "@/utils/request";

export default {
	menu: {
		myMenus: {
			url: `${config.API_URL}/sys.menu`,
			name: "获取我的菜单",
			get: async function () {
				return await http.get(this.url);
			},
		},
		list: {
			url: `${config.API_URL}/system/menu/list`,
			name: "获取菜单",
			get: async function () {
				return await http.get(this.url);
			},
		},
	},
	dic: {
		tree: {
			url: `${config.API_URL}/system/dic/tree`,
			name: "获取字典树",
			get: async function () {
				return await http.get(this.url);
			},
		},
		list: {
			url: `${config.API_URL}/system/dic/list`,
			name: "字典明细",
			get: async function (params) {
				return await http.get(this.url, params);
			},
		},
		get: {
			url: `${config.API_URL}/system/dic/get`,
			name: "获取字典数据",
			get: async function (params) {
				return await http.get(this.url, params);
			},
		},
	},
	role: {
		list: {
			url: `${config.API_URL}/roles.list`,
			name: "获取角色列表",
			get: async function (params) {
				return await http.post(this.url, params);
			},
		},
		add:{
			url: `${config.API_URL}/roles.add`,
			name: "角色增加",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		delete:{
			url: `${config.API_URL}/roles.delete`,
			name: "角色删除",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		status:{
			url: `${config.API_URL}/roles.status`,
			name: "角色状态",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		sort:{
			url: `${config.API_URL}/roles.sort`,
			name: "角色排序",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		users:{
			url: `${config.API_URL}/roles.users`,
			name: "角色成员",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		removeUser:{
			url: `${config.API_URL}/roles.removed.users`,
			name: "移除角色成员",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		addUser:{
			url: `${config.API_URL}/roles.add.users`,
			name: "添加角色成员",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		tree:{
			url: `${config.API_URL}/roles.dept.tree`,
			name: "部门树",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		roleUserTree:{
			url: `${config.API_URL}/roles.user.select.list`,
			name: "角色用户列表",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		roleAuth: {
			url: `${config.API_URL}/auth.role.auth`,
			name: "角色授权",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		roleMenu:{
			url: `${config.API_URL}/auth.role.permission.checked`,
			name: "菜单权限",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		dataMenu:{
			url: `${config.API_URL}/auth.data.permission.checked`,
			name: "数据权限",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		dataAuth:{
            url: `${config.API_URL}/auth.data.permission.add`,
            name: "数据授权",
            post: async function (params) {
                return await http.post(this.url, params);
            }
		},
		roleCode: {
			url: `${config.API_URL}/authorize.role.codes`,
			name: "角色对应CODE列表",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		roleUser:{
			url: `${config.API_URL}/roles.users`,
			name: "角色成员列表",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		roleUserAdd:{
			url: `${config.API_URL}/roles.add.users`,
			name: "添加角色成员",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		roleUserDel:{
			url: `${config.API_URL}/roles.removed.users`,
			name: "删除角色成员",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		}
	},
	company:{
		list: {
			url: `${config.API_URL}/organization.list`,
			name: "公司列表",
			get: async function (params) {
				return await http.post(this.url, params);
			},
		},
		add: {
			url: `${config.API_URL}/organization.add`,
			name: "公司增加",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		update:{
			url: `${config.API_URL}/organization.update`,
			name: "公司更新",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		info: {
			url: `${config.API_URL}/organization.info`,
			name: "公司详情",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		status: {
			url: `${config.API_URL}/organization.update.status`,
			name: "公司状态",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		delete: {
			url: `${config.API_URL}/organization.delete`,
			name: "公司删除",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		field:{
			url: `${config.API_URL}/organization.field.list`,
			name: "公司检索",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		select:{
			url: `${config.API_URL}/organization.name.list`,
			name: "公司下拉选择",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		typeSelect:{
			url: `${config.API_URL}/common.company.type.list`,
			name: "公司类型下拉选择",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		permission:{
			url: `${config.API_URL}/auth.company.permission.checked`,
			name: "公司权限列表",
			post: async function (params) {
				return await http.post(this.url,params);
			}
		},
		moduleAdd:{
			url: `${config.API_URL}/auth.company.module.add`,
			name: "公司权限分配",
			post: async function (params) {
				return await http.post(this.url,params);
			}
		},
		export:{
			url: `${config.API_URL}/organization.export`,
			name: "公司资料导出",
			post: async function (params) {
				return await http.post(this.url,params);
			}
		},
		template:{
			url: `${config.API_URL}/company.import.template`,
			name: "公司资料导入模版",
			post: async function (params) {
				return await http.get(this.url,params,{responseType: 'arraybuffer'});
			}
		},
		import:{
			url: `${config.API_URL}/organization.import`,
			name: "公司资料导入",
			post: async function (params) {
				return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
			}
		}
	},
	dept: {
		list: {
			url: `${config.API_URL}/dept.list`,
			name: "获取部门列表",
			get: async function (params) {
				return await http.post(this.url, params);
			},
		},
		add: {
			url: `${config.API_URL}/dept.add`,
			name: "部门增加",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		active:{
			url: `${config.API_URL}/dept.list.active`,
			name: "部门列表启用",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		delete: {
			url: `${config.API_URL}/dept.delete`,
			name: "部门删除",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		info: {
			url: `${config.API_URL}/dept.info`,
			name: "部门详情",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		update:{
			url: `${config.API_URL}/dept.update`,
			name: "部门更新",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		status:{
			url: `${config.API_URL}/dept.update.status`,
			name: "部门状态",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		}
	},
	user: {
		list: {
			url: `${config.API_URL}/user.list`,
			name: "获取用户列表",
			get: async function (params) {
				return await http.post(this.url, params);
			},
		},
		logout: {
			url: `${config.API_URL}/user.logout`,
			name: "用户退出",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		add:{
			url: `${config.API_URL}/user.add`,
			name: "用户新增",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		delete:{
			url: `${config.API_URL}/user.delete`,
			name: "用户删除",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		userType:{
			url: `${config.API_URL}/user.type.list`,
			name: "用户类型常量",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		status:{
			url: `${config.API_URL}/user.status.update`,
			name: "用户状态",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		auditStatus:{
			url: `${config.API_URL}/user.audit.status.list`,
			name: "用户审核常量",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		audit:{
			url: `${config.API_URL}/user.audit`,
			name: "用户审核",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		allocatRole: {
			url: `${config.API_URL}/auth.user.role`,
			name: "用户分配角色",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		userPermission:{
			url: `${config.API_URL}/auth.user.permission.checked`,
			name: "查看用户权限",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		userCompanyList:{
			url: `${config.API_URL}/organization.user.list`,
			name: "查看公司用户列表",
			get: async function (params) {
				return await http.post(this.url, params);
			}
		},
		userCompanyField:{
			url: `${config.API_URL}/user.company.field.list`,
			name: "用户公司下拉选择",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		export:{
			url: `${config.API_URL}/user.export`,
			name: "用户列表导出",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		template:{
			url: `${config.API_URL}/user.import.template`,
			name: "用户资料导入模版",
			post: async function (params) {
				return await http.get(this.url,params,{responseType: 'arraybuffer'});
			}
		},
		import:{
			url: `${config.API_URL}/user.import`,
			name: "用户资料导入",
			post: async function (params) {
				return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
			}
		},
		generateRegistration:{
			url: `${config.API_URL}/generate.registration.challenge`,
			name: "passKey 创建",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		verifyResponse:{
			url: `${config.API_URL}/verify.registration.response`,
			name: "passKey 创建认证",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		generateAuthentication:{
			url: `${config.API_URL}/generate.authentication.challenge`,
			name: "passKey登录生成",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		verifyAuthentication:{
			url: `${config.API_URL}/verify.authentication.response`,
			name: "passKey 登录认证",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		publishList:{
			url: `${config.API_URL}/publish.key.list`,
			name: "passKey 指纹列表",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		renameAlias:{
			url: `${config.API_URL}/rename.alias`,
			name: "passKey 指纹重命名",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
	},
	app: {
		list: {
			url: `${config.API_URL}/system/app/list`,
			name: "应用列表",
			get: async function () {
				return await http.get(this.url);
			},
		},
	},
	log: {
		list: {
			url: `${config.API_URL}/sys.log.list`,
			name: "日志列表",
			get: async function (params) {
				return await http.post(this.url, params);
			},
		},
		commandLog: {
			url: `${config.API_URL}/sys.log.command.list`,
			name: "日志命令列表",
			get: async function (params) {
				return await http.post(this.url, params);
			},
		},
		operation: {
			url: `${config.API_URL}/sys.log.operation.list`,
			name: "日志操作功能",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		field:{
			url: `${config.API_URL}/sys.log.operation.field.list`,
			name: "操作日志选择列表",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		export:{
			url: `${config.API_URL}/sys.log.export`,
			name: "操作日志导出",
			post: async function (params) {
				return await http.post(this.url,params);
			}
		},
		commandExport:{
			url: `${config.API_URL}/sys.log.command.export`,
			name: "操作日志命令导出",
			post: async function (params) {
				return await http.post(this.url,params);
			}
		},
	},
	table: {
		list: {
			url: `${config.API_URL}/system/table/list`,
			name: "表格列管理列表",
			get: async function (params) {
				return await http.get(this.url, params);
			},
		},
		info: {
			url: `${config.API_URL}/system/table/info`,
			name: "表格列管理详情",
			get: async function (params) {
				return await http.get(this.url, params);
			},
		},
	},
	tasks: {
		list: {
			url: `${config.API_URL}/system/tasks/list`,
			name: "系统任务管理",
			get: async function (params) {
				return await http.get(this.url, params);
			},
		},
	},
	sso:{
		setup:{
			url: `${config.API_URL}/sys.single.login.config`,
			name: "单点登录配置",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		get:{
			url: `${config.API_URL}/sys.single.login.config.get`,
			name: "获取单点登录配置",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		}
	},
	spare:{
		list: {
			url: `${config.API_URL}/spare.parts.list`,
			name: "备件列表",
			get: async function (params) {
				return await http.post(this.url, params);
			},
		},
		add:{
			url: `${config.API_URL}/spare.parts.add`,
			name: "新增备件",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		info:{
			url: `${config.API_URL}/spare.parts.info`,
			name: "备件明细",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		delete:{
			url: `${config.API_URL}/spare.parts.delete`,
			name: "删除备件",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		field:{
			url: `${config.API_URL}/spare.parts.field.list`,
			name: "备件检索",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		export:{
			url: `${config.API_URL}/spare.parts.export`,
			name: "备件导出",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		template:{
			url: `${config.API_URL}/spare.parts.import.template`,
			name: "备件导入模版",
			post: async function (params) {
				return await http.get(this.url,params,{responseType: 'arraybuffer'});
			}
		},
		import:{
			url: `${config.API_URL}/spare.parts.import`,
			name: "备件导入",
			post: async function (params) {
				return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
			}
		},
	},
	spareInfo:{
		list: {
			url: `${config.API_URL}/spare.parts.info.list`,
			name: "备件信息列表",
			get: async function (params) {
				return await http.post(this.url, params);
			},
		},
		add:{
			url: `${config.API_URL}/spare.parts.info.add`,
			name: "新增备件信息",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		info:{
			url: `${config.API_URL}/spare.parts.info.detail`,
			name: "备件信息明细",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		delete:{
			url: `${config.API_URL}/spare.parts.info.delete`,
			name: "删除备件信息",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		field:{
			url: `${config.API_URL}/spare.parts.info.field.list`,
			name: "备件信息检索",
			post: async function (params) {
				return await http.post(this.url, params);
			},
		},
		export:{
			url: `${config.API_URL}/spare.parts.info.export`,
			name: "备件信息导出",
			post: async function (params) {
				return await http.post(this.url, params);
			}
		},
		template:{
			url: `${config.API_URL}/spare.parts.info.import.template`,
			name: "备件信息导入模版",
			post: async function (params) {
				return await http.get(this.url,params,{responseType: 'arraybuffer'});
			}
		},
		import:{
			url: `${config.API_URL}/spare.parts.info.import`,
			name: "备件信息导入",
			post: async function (params) {
				return await http.post(this.url,params,{'Content-Type': 'multipart/form-data'});
			}
		},
	}
};
