import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index';
// 1.获取所有已附加的表
export const CM_Table_LoadTable = param => get(`${PUBLISH_SERVICE}/CaseManage/LoadTable`, param);
// 2.获取单张表的字段 CM_Table_ReloadFields
export const CM_Table_ReloadFields = param =>
  get(`${CITY_SERVICE}/OMS.svc/CM_Table_ReloadFields`, param);

// 3.删除表
export const removeTable = param => get(`${PUBLISH_SERVICE}/CaseManage/RemoveTable`, param);

// 4.建立表
export const createTable = param => get(`${PUBLISH_SERVICE}/CaseManage/CreateTable`, param);

// 5.附加字段
export const loadTableFields = param => get(`${PUBLISH_SERVICE}/CaseManage/LoadTableFields`, param);

// 6.附加表时加载未添加的表
export const loadUnattachedTables = () => get(`${PUBLISH_SERVICE}/CaseManage/LoadUnattachedTables`);

// 7.附加表
export const addTables = param => post(`${PUBLISH_SERVICE}/CaseManage/AddTables`, param);

// 8.添加表字段
export const addFields = param => post(`${PUBLISH_SERVICE}/CaseManage/AddFields`, param);

// 9.获取表信息
export const getTableInfo = param => get(`${PUBLISH_SERVICE}/CaseManage/GetTableInfo`, param);

// 10.更新表信息
export const updateTable = param => get(`${PUBLISH_SERVICE}/CaseManage/UpdateTable`, param);

// 11.加载表字段
export const reloadTableFields = param =>
  get(`${PUBLISH_SERVICE}/CaseManage/ReloadTableFields`, param);

// 12.根据字段ID查询字段信息
export const getField = param => get(`${PUBLISH_SERVICE}/CaseManage/GetField`, param);

// 13.删除表字段
export const removeFields = param => get(`${PUBLISH_SERVICE}/CaseManage/RemoveFields`, param);

// 14.加载事件类型
export const LoadEventType = param => get(`${PUBLISH_SERVICE}/CaseManage/LoadEventType`, param);

// 15.根据触发事件加载字段
export const LoadEventFields = param => get(`${PUBLISH_SERVICE}/CaseManage/LoadEventFields`, param);

// 16.更改字段信息
export const UpdateFields = data => post(`${PUBLISH_SERVICE}/CaseManage/UpdateFields`, data);

// 17.分组与调序，根据表名加载分组
export const LoadGroup = param => get(`${PUBLISH_SERVICE}/CaseManage/LoadGroup`, param);

// 18.根据分组名加载字段集
export const LoadFieldsByGroup = param =>
  get(`${PUBLISH_SERVICE}/CaseManage/LoadFieldsByGroup`, param);

// 18.根据分组名加载字段集
export const ChangeOrder = data => post(`${PUBLISH_SERVICE}/CaseManage/ChangeOrder`, data);
