import http from "@/api/http.js"

/* 部门管理模块 */
const departInterence = {

	/**
	 * AdminId
	 * Enabled 0 1
	 */
	statusChange: params => {
		return http.post('/system/sysuser/editEnabled',params)
	},
	/* 审批配置详情 */
	approvalFlowDetail:params=>{
		return http.get('/system/flow/detail',params)
	},
	/* 添加审批人搜索 */
	approvalUserSearch:params=>{
		return http.get('/system/flow/user',params)
	},
	/* 审批配置保存/编辑 */
	approvalFlowSave:params=>{
		return http.post('/system/flow/edit',params)
	},

	/* 新增部门接口
	"DepartmentName": "string" */
	addDepart: params => {
		return http.post('/system/department/add',params)
	},
	/* 删除部门
	DepartmentId int */
	delDepart: params => {
		return http.post('/system/department/delete',params)
	},
	/* 修改部门
	"DepartmentId": int,
	"DepartmentName": "string" */
	editDepart: params => {
		return http.post('/system/department/edit',params)
	},
	/* 获取部门列表 */
	getDepartList: params => {
		return http.get('/system/department/list',params)
	},
	/* 新增分组
		"DepartmentId": int,
		"GroupName": "string"
	*/
	addGroup: params => {
		return http.post('/system/group/add',params)
	},
	/* 新增二级分组接口
		"DepartmentId": int,
		"GroupName": "string"
	*/
	addTeamGroup: params => {
		return http.post('/system/team/add',params)
	},
	/* 删除分组
	"GroupId": int
	 */
	delGroup: params => {
		return http.post('/system/group/delete',params)
	},
	/* 删除分组接口
	"GroupId": int
	 */
	delTeamGroup: params => {
		return http.post('/system/team/delete',params)
	},
	/* 修改分组
	 "GroupId": int,
	 "GroupName": "string" 
	  DepartmentId int*/
	editGroup: params => {
		return http.post('/system/group/edit',params)
	},
	/* 修改分组
	 "GroupId": int,
	 "GroupName": "string" 
	  DepartmentId int*/
	editTeamGroup: params => {
		return http.post('/system/team/edit',params)
	},
	/*	新增用户 
	 "AdminName": "string",
  "Authority": 0,
  "DepartmentId": 0,
  "GroupId": 0,
  "Mobile": "string",
  "Password": "string",
  "Position": "string",
  "RealName": "string",
  "RoleId": 0*/
	addUser: params => {
		return http.post('/system/sysuser/add',params)
	},
	/* 修改用户
	"AdminId": 0,
  "AdminName": "string",
  "Authority": 0,
  "DepartmentId": 0,
  "GroupId": 0,
  "Mobile": "string",
  "Password": "string",
  "Position": "string",
  "RealName": "string",
  "RoleId": 0 */
	editUser: params => {
		return http.post('/system/sysuser/edit',params)
	},
	/* 删除用户
	AdminId */
	delUser: params => {
		return http.post('/system/sysuser/delete',params)
	},
	/* 获取用户列表
	PageSize int
	CurrentIndex int
	DepartmentId int
	GroupId int
	KeyWord  */
	getUserList: params => {
		return http.get('/system/sysuser/list',params)
	},
	//获取menu
	getMenu:params => {
		return http.get('/system/menu/list',params)
	},
	/* 获取所有已添加角色 */
	getRole:params => {
		return http.get('/system/role/all',params)
	},
	/* 新增角色
	 "RoleName": "string" */
	addRole: params => {
		return http.post('/system/role/add',params)
	},
	/* 删除角色
		"RoleId": 0 */
	delRole: params => {
		return http.post('/system/role/delete',params)
	},
	/* 修改角色
	  "RoleId": 0 int,
	  "RoleName": "string" */
	editRole: params => {
		return http.post('/system/role/edit',params)
	},
	/* 获取角色列表
	PageSize int
	CurrentIndex int
	KeyWord  */
	getRoleList: params => {
		return http.get('/system/role/list',params)
	},
	/* 新增角色权限
	MenuIdStr
	"RoleId" 
	MenuButtonIdStr
	*/
	saveAuth:params => {
		return http.post('/system/role/menu/add',params)
	},
	/* 获取所有权限
	RoleId  */
	getAuthList:params => {
		return http.get('/system/role/menu/list',params)
	},
	/* 获取所有功能权限 */
	getBtnAuth:params => {
		return http.get('/system/menu/buttons',params)
	},
	/* 获取研究方向分组列表 */
	getResearchGroupList:params => {
		return http.get('/system/research_group/list',params)
	},
	/* 获取研究员的研究方向 */
	getResearchGroupByAdminId:params => {
		return http.get('/system/research_group/admin_group',params)
	},
	/* 获取需要配置的账号列表 */
	getQuestionAdminList:params =>{
		return http.get('/system/role/seller/list',params)
	},
	/* 新增运营管理员(批量)*/
	addQuestionAdmins:params=>{
		return http.post('/system/role/admin/add',params)
	},
	/* 删除运营管理员(单个) RoleTypeCode:yb_question_admin*/
	deleteQuestionAdmin:params=>{
		return http.post('/system/role/admin/del',params)
	},
	/* 已绑定的管理员列表 
	RoleTypeCode:yb_comment_admin/yb_question_admin
	*/
	getRoleAdminList:params=>{
		return http.get('/system/role/admin/list',params)
	},
	/* 获取标签库数据
		 IncludeDisableMember:1包含禁用的研究员
	 */
	getTagTree:params=>{
		return http.get('/taglib/variety_tag/tag_tree',params)
	},
	/* 同步每刻 
	*/
	syncCompanyProfile:params=>{
		return http.post('/maycur/company_profile/sync',params)
	},
	/**
	 * 移动用户分组
	 * AdminId
	 * DepartmentId
	 * GroupId
	 * TeamId
	 */
	moveSysuser:params=>{
		return http.post('/system/sysuser/move',params)
	},
	/**
	 * 重置用户密码
	 * AdminId
	 * Password 密码是经过md5加密后的字符串
	 * RePassword 两次的密码要一样
	 */
	resetSysuserPass:params=>{
		return http.post('/system/sysuser/reset_pass',params)
	},
	/**
	 * 部门移动排序
	 * DepartmentIds 移动的是一级部门时,移动后的排序
	 * GroupIds 移动的是二级部门时,移动后的排序
	 * TeamIds 移动的是三级部门时,移动后的排序
	 */
	sortDepart:params=>{
		return http.post('/system/group/set_sort',params)
	},
	// 获取跳转到ETA系统的code
	getToETASysCode:()=>{
		return http.get('/sysuser/get_eta_auth_code',{})
	},
	//从其他系统跳转来用code换token
	useCodeLogin:params=>{
		return http.get('/sysuser/auth_code_login',params)
	},
    /**
	 * 获取图形验证码 返回Base64格式数据
	 * @returns 
	 */
	getCodePic:params=>{
		return http.get('/user_login/get_captcha',params)
	},
	/**
	 * 获取短信/邮箱验证码
	 * @param {Number} VerifyType 验证方式: 1-手机号; 2-邮箱
	 * @param {String} CaptchaId 图形验证码ID
	 * @param {String} CaptchaCode 图形验证码的值
	 * @param {String} Mobile 手机号 验证方式为1时必填
	 * @param {String} Email 邮箱 验证方式为2时必填
	 * @param {String} TelAreaCode 手机区号
	 * @param {Number} Source 来源：1-登录；2-异常登录校验；3-忘记密码
	 * @returns 
	 */
	getCodeVerify:params=>{
		return http.post('/user_login/verify_code',params)
	},
	/**
	 * ETA1.4后，用户登录
	 * @param {Number} LoginType 登录方式: 1-账号; 2-手机号; 3-邮箱
	 * @param {Number} AbnormalCheckType 异常登陆校验方式: 1-手机号; 2-邮箱
	 * @param {String} Username 用户名
	 * @param {String} Password 密码
	 * @param {String} Mobile 手机号
	 * @param {String} Email 邮箱
	 * @param {String} VerifyCode 手机号/邮箱的验证码
	 * @returns 
	 */
	userLogin:params=>{
		return http.post('/user_login/login',params)
	},
	/**
	 * 忘记密码账号校验，获取账号信息
	 * @param {String} CaptchaId 
	 * @param {String} CaptchaCode 
	 * @param {String} UserName 
	 * @returns 
	 */
	accountCheck:params=>{
		return http.post('/user_login/forget/account_get',params)
	},
	/**
	 * 忘记密码-手机/邮箱的验证码校验
	 * @param {Number} FindType 密码找回方式：1-手机号；2-邮箱
	 * @param {String} VerifyCode 验证码
	 * @param {String} UserName 用户名
	 * @param {String} Mobile 找回方式为手机号时必填
	 * @param {String} Email 找回方式为邮箱时必填
	 * @returns 
	 */
	checkCodeVerify:params=>{
		return http.post('/user_login/forget/code_verify',params)
	},
	/**
	 * 忘记密码-重置密码
	 * @param {String} UserName 
	 * @param {String} Password 
	 * @param {String} RePassword 
	 * @returns 
	 */
	resetPass:params=>{
		return http.post('/user_login/forget/reset_pass',params)
	},
	/**
	 * 获取手机号区号
	 * @returns 
	 */
	getPhoneAreaCode:params=>{
		return http.get('/user_login/area_code/list',params)
	},
	/**
	 * 小程序banner统计
	 * @returns 
	 */
	getBannerStatistic:params=>{
		return http.get('/banner/statistic',params)
	}
}

/* 视频管理 */
const videoInterence = {
	/* 上传视频接口 file  */
	upload: params => { 
		return http.post('/resource/video/upload',params);
	},
	/* 删除视频 VideoId */
	delVideo: params => {
		return http.post('/video/delete',params)
	},
	/* 编辑视频   
  "PlaySeconds": 0,
  "TagsIdStr": "string",
  "Title": "string",
  "VideoCoverUrl": "string",
  "VideoId": 0,
  "VideoUrl": "string" */
	editVideo: params => {
		return http.post('/video/edit',params)
	},
	/* 视频列表 
	PageSize *
	CurrentIndex *
	KeyWord **/
	getVideoList: params => {
		return http.get('/video/list',params)
	},
	/* 发布 "VideoIds": "string" */
	publish: params => {
		return http.post('/video/publish',params)
	},
	/* 取消发布 "VideoIds": "string"*/
	cancelPublish: params => {
		return http.post('/video/publish/cancel',params)
	},
	/* 新增视频 
	"PlaySeconds": 0,
  "TagsIdStr": "string",
  "Title": "string",
  "VideoCoverUrl": "string",
  "VideoUrl": "string" */
	saveVideo: params => {
		return http.post('/video/save',params)
	},
	/* 标签 */
	tagList: params => {
		return http.get('/video/tags/list',params)
	},
}

/* 互动管理 */
const InteractionInterence = {
	/* 问答列表 */
	getQuestionList:params => {
		return http.get('/yb/community/question/list',params)
	},
	/* 分配回复人 */
	distributeAnswer:params => {
		return http.post('/yb/community/question/distribute',params)
	},
	/* 删除问答 */
	deleteQuestion:params => {
		return http.post('/yb/community/question/delete',params)
	},
	/* 推送分配消息 */
	sendMsg:params =>{
		return http.post('/yb/community/question/send_template_msg',params)
	},
	/* 编辑问题描述 */
	editQuestion:params=>{
		return http.post('/yb/community/question/edit',params)
	},
	/* 查询点击量详情列表 */
	questionClickLogs:params=>{
		return http.get('yb/community/question/click/logs',params)
	},
	/* 提问者详情 */
	questionUser:params=>{
		return http.get('yb/community/question/user',params)
	},
	questionDetail:params=>{
		return http.get('yb/community/question/detail',params)
	},
	// 转移问题
	questionTransfer:params=>{
		return http.post('yb/community/question/transfer',params)
	}
}

/* 数据操作权限 */
const operateAuthInterface = {
	/**
	 * 列表
	 * @param {*} params 
	 * Source=5&UserId=11&CurrentIndex=1&PageSize=10 Keyword
	 * @returns 
	 */
	list: params => {
		return http.get('/datamanage/edb_chart/list',params)
	},

	/**
	 * 修改权限所属
	 * @param {*} params 
	 * Source DataIdList NewUserId
	 * @returns 
	 */
	authEdit: params => {
		return http.post('/datamanage/edb_chart/change_user',params)
	},

		/**
	 * 修改权限所属
	 * @param {*} params.Source - string -来源 ：1：手工数据指标 2：钢联化工数据库 3：ETA指标库 4：ETA预测指标 5：图库
	 * @returns 
	 */
		getClassificationBySource: params => {
			return http.get('/datamanage/edb_chart/classify',params)
		},

	/**
	 * 获取指标无权限列表
	 * @param {*} params EdbInfoId
	 * @returns 
	 */
	getEdbNoAuthList: params => {
		return http.get('/datamanage/edb_no_permission/list',params)
	},

	/**
	 * 设置无权限用户
	 * @param {*} params EdbInfoId AdminIdList:[]
	 * @returns 
	 */
	edbNoAuthSet: params => {
		return http.post('/datamanage/edb_no_permission/modify',params)
	},

	/**
	 * 删除指标无权限  EdbInfoId  AdminId
	 * @param {*} params 
	 * @returns 
	 */
	edbNoAuthDel: params => {
		return http.post('/datamanage/edb_no_permission/delete',params)
	},

	/**
	 * 批量配置无权限用户
	 * @param {*} params EdbInfoIdList AdminIdList
	 * @returns 
	 */
	edbNoAuthBatchSet: params => {
		return http.post('/datamanage/edb_no_permission/batch_add',params)
	}
}

/* 英文权限管理 */
const enAuthInterence = {
  /* 英文权限列表 */
  getAuthList:params=>{
    return http.get('/english_report/auth/list',params)
  },
  /* 英文权限详情  AdminId*/
  getAuthDetail:params=>{
    return http.get('/english_report/auth/detail',params)
  },
  /* 英文权限批量新增 AdminIds*/
  addAuthAdmins:params=>{
    return http.post('/english_report/auth/batch_add',params)
  },
  /* 英文权限编辑 AdminId RoleTypeCodes*/
  editAuthAdmin:params=>{
    return http.post('/english_report/auth/edit',params)
  },
  /* 英文权限 删除 AdminId*/
  deleteAuthAdmin:params=>{
    return http.post('/english_report/auth/del',params)
  }
}
export {
	departInterence,
	videoInterence,
	InteractionInterence,
	operateAuthInterface,
  enAuthInterence
}