import { creatRequest } from '../../utils/request.js';

const requestList = {
  // 获取条件树
  conditions: {
    method: 'GET',
    url: 'common/conditions',
		// successMessage: '',
		// needLoading: false // 还有这两个参数，但不是必传的，默认loading
  }, 
	// 查核组列表
  checkGroupList: {
    method: 'POST',
    url: 'situation/getCheckGroupByCondition ',
  },
	// 查核地图列表
  checkDeptList: {
    method: 'POST',
    url: 'situation/checkDeptList',
  },
	// 地图新增单位树
  deptList: {
    method: 'GET',
    url: 'common/deptList',
  },
	// 地图新增选择返回新增单位
  addDeptList: {
    method: 'POST',
    url: 'situation/addDeptList',
  },
	// 情境新增保存
  savePOST: {
    method: 'POST',
    url: 'situation',
		successMessage: '保存成功！'
  },
	// 情境新增保存
  savePUT: {
    method: 'PUT',
    url: 'situation',
		successMessage: '编辑成功！'
  },
	// 情境配置的明细(出参同创建入参)
  detialConfig: {
    method: 'GET',
    url: 'situation/config',
  },
  // 获取情境类型列表
  getSituationTypes: {
    method: 'GET',
    url: 'common/getSituationTypes',
  },
  //获取分页模板数据
  getTemplates:{
	method: 'GET',
	url: 'situation/getPageTemplateList',  
  },
  //获取自查督查条件
  getTypeLists:{
  	method: 'GET',
  	url: 'inspector/filter',  
  },
  //获取创建个案情境时的条件
  getTypeListsInGeanCreate:{
  	method: 'GET',
  	url: 'common/newConditions',  
  },
  //获取自查督查可选查核人
  getCheckPersonLists:{
  	method: 'POST',
  	url: 'inspector/filterEmployees',  
  },
  //获取职能科室
  getZhinengDepartments:{
  	method: 'GET',
  	url: 'inspector/functionEmployees',  
  },
  //获职能科室负责计划设置中的可选地图列表
  getPlanSetMap:{
  	method: 'POST',
  	url: 'inspector/getCheckDepartments',  
  },
  //添加督查自查情境
  addDuchazichaSituation:{
  	method: 'POST',
  	url: 'inspector/add',  
  },
  //保存自查督查情境计划
  saveZichaduchaPlan:{
	  method: 'POST',
	  url: 'inspector/savePlan',  
  }
};

export const commServer = (key, data) => {
  let obj = requestList[key];
  return creatRequest(obj, data);
}