import {
	WeaTools
} from 'ecCom';

export const getDetachable = (params = {}) => WeaTools.callApi('/api/hrm/common/getDetachableAll', 'GET', params)

export const getRoleCondition = (params = {}) => WeaTools.callApi('/api/hrm/role/getRoleSetCondition', 'GET', params)

export const getRoleList = (params = {}) => WeaTools.callApi('/api/hrm/role/getRoleSetList', 'POST', params)

export const getTabInfo = (params = {}) => WeaTools.callApi('/api/hrm/role/getRoleSetTabInfo', 'GET', params)

export const getRoleInfo = (params = {}) => WeaTools.callApi('/api/hrm/role/getRoleSetForm', 'GET', params)

export const saveRoleInfo = (params = {}) => WeaTools.callApi('/api/hrm/role/saveRoleSet', 'POST', params)

export const removeRoleInfo = (params = {}) => WeaTools.callApi('/api/hrm/role/delRoleSet', 'POST', params)

export const getAuthCondition = (params = {}) => WeaTools.callApi('/api/hrm/rolefucrightset/getRolesFucRightSetCondition', 'GET', params)

export const getAuthInfoForm = (params = {}) => WeaTools.callApi('/api/hrm/rolefucrightset/getRolesFucRightSetForm', 'GET', params)

export const getAuthList = (params = {}) => WeaTools.callApi('/api/hrm/rolefucrightset/getRolesFucRightSetList', 'POST', params)

export const saveAuth = (params = {}) => WeaTools.callApi('/api/hrm/rolefucrightset/saveRolesFucRightSet', 'POST', params)

export const removeAuth = (params = {}) => WeaTools.callApi('/api/hrm/rolefucrightset/delRolesFucRightSet', 'POST', params)

export const getDetachCondition = (params = {}) => WeaTools.callApi('/api/hrm/rolesstrrightset/getRolesStrRightSetCondition', 'GET', params)

export const getDetachInfoForm = (params = {}) => WeaTools.callApi('/api/hrm/rolesstrrightset/getRolesStrRightSetForm', 'GET', params)

export const getDetachList = (params = {}) => WeaTools.callApi('/api/hrm/rolesstrrightset/getRolesStrRightSetList', 'POST', params)

export const saveDetachAuth = (params = {}) => WeaTools.callApi('/api/hrm/rolesstrrightset/saveRolesStrRightSet', 'POST', params)

export const removeDetachAuth = (params = {}) => WeaTools.callApi('/api/hrm/rolesstrrightset/delRolesStrRightSet', 'POST', params)

export const getMemberCondition = (params = {}) => WeaTools.callApi('/api/hrm/rolesmembers/getRolesMembersCondition', 'GET', params)

export const getMemberInfoForm = (params = {}) => WeaTools.callApi('/api/hrm/rolesmembers/getRolesMembersForm', 'GET', params)

export const getMemberList = (params = {}) => WeaTools.callApi('/api/hrm/rolesmembers/getRolesMembersList', 'POST', params)

export const saveMemberAuth = (params = {}) => WeaTools.callApi('/api/hrm/rolesmembers/saveRolesMembers', 'POST', params)

export const removeMemberAuth = (params = {}) => WeaTools.callApi('/api/hrm/rolesmembers/delRolesMembers', 'POST', params)

export const saveAs = (params = {}) => WeaTools.callApi('/api/hrm/role/saveAsRoleSet', 'POST', params)

/********************* promise api *********************/
/**
 * 初始权限设置化模块数据
 * @return {[type]} [description]
 */
export const initData = () => Promise.all([getDetachable(), getRoleCondition(), getRoleList(), getRoleInfo()])

export const initAuthData = (params = {}) => Promise.all([getAuthCondition(), getAuthInfoForm(params), getAuthList(params)])

export const initDetachData = (params = {}) => Promise.all([getDetachCondition(), getDetachInfoForm(params), getDetachList(params)])

export const initMemberData = (params = {}) => Promise.all([getMemberCondition(), getMemberInfoForm(params), getMemberList(params)])
/********************* promise api *********************/