/*
 * @Author: sunjsh
 * @Date: 2020-11-04 13:35:25
 * @LastEditTime: 2020-11-19 14:50:02
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /hrmengine/apis/matrix.js
 */
import {
	WeaTools
} from 'ecCom';

//矩阵设置
export const getMatrixList = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixListSearchList', 'POST', params)
export const getMatrixListConditionList = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixListConditionList', 'POST', params)

export const getMatrixInfoForm = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixListSetForm?is_multilang_set=true', 'POST', params)
export const saveMatrixInfo = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/addMatrixList', 'POST', params)
export const removeMatrixInfo = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/delMatrixList', 'POST', params)
export const getMaintenanceForm = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixMaintSetForm?is_multilang_set=true', 'POST', params)
export const getMaintenanceList = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixMaintSearchList', 'POST', params)
export const saveMatrixMaintenance = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/addMatrixMaint', 'POST', params)
export const removeMatrixMaintenance = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/delMatrixMaint', 'POST', params)
export const getMatrixMaintRightLevelForm = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixMaintRightLevelForm', 'POST', params)
export const saveMatrixMaintRightLevel = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/saveMatrixMaintRightLevel', 'POST', params)
export const getFieldForm = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixDesignSetForm?is_multilang_set=true', 'POST', params)
export const saveField = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/addMatrixDesign', 'POST', params)
export const getMatrixData = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixTableSetForm', 'POST', params)
export const saveMatrixData = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/addMatrixTable', 'POST', params)
export const removeMatrixData = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/delMatrixTable', 'POST', params)
export const matrixExport = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/matrixExport', 'POST', params)
export const getMatrixFile = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixFile', 'POST', params)
export const getMatrixTableStringForm = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixTableStringForm', 'POST', params)
export const getMatrixShowNameSetForm = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixShowNameSetForm', 'POST', params)
export const saveMatrixShowNameSetForm = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/saveMatrixShowNameSetForm', 'POST', params)
export const clearDimission = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/clearDimission', 'POST', params)

//矩阵分权
export const getMatrixMaintInfoListCondition = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixMaintInfoListCondition', 'POST', params)
export const getMatrixMaintInfoList = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixMaintInfoList', 'POST', params)
export const delMatrixMaintInfo = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/delMatrixMaintInfo', 'POST', params)
export const getMatrixMaintTab = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixMaintTab', 'POST', params)
export const getMatrixMaintSearchCondition = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixMaintSearchCondition', 'POST', params)
export const getMatrixMaintConditionForm = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixMaintConditionForm', 'POST', params)
export const getMatrixMaintConditionList = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixMaintConditionList', 'POST', params)
export const saveMatrixMaintCondition = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/saveMatrixMaintCondition', 'POST', params)
export const delMatrixMaintCondition = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/delMatrixMaintCondition', 'POST', params)
export const getMatrixMaintColList = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/getMatrixMaintColList', 'POST', params)
export const saveMatrixMaintCol = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/saveMatrixMaintCol', 'POST', params)
export const delMatrixMaintCol = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixList/delMatrixMaintCol', 'POST', params)

//old version
//export const initMaintenanceData = (params = {}) => Promise.all([getMaintenanceForm(params), getMaintenanceList(params)])
//new version
export const initMaintenanceData = (params = {}) => Promise.all([getMatrixMaintInfoListCondition(params), getMatrixMaintInfoList(params)])
export const initMaintenanceSettingData = (params = {}) => Promise.all([getMatrixMaintTab(params), getMatrixMaintSearchCondition(params), getMaintenanceForm()])
export const initConditionData = (params = {}) => Promise.all([getMatrixMaintConditionForm(params), getMatrixMaintConditionList(params)])
// export const initColumnData = (params = {}) => Promise.all([getMatrixMaintConditionForm(params), getMatrixMaintColList(params)])
export const initColumnData = (params = {}) => Promise.all([getMatrixMaintColList(params)])

export const initFieldData = (params = {}) => Promise.all([getFieldForm(), getFieldForm(params)])
export const initMatrixData = (params = {}) => Promise.all([getMatrixTableStringForm(params), getMatrixShowNameSetForm(params)])

//矩阵批量调整
export const getFormInfo = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixMassMaint/getMatrixListMassMaintForm', 'GET', params)

export const processData = (params = {}) => WeaTools.callApi('/api/hrm/matrix/pages/matrixMassMaint/addMatrixListMassMaintForm', 'POST', params)