/*
 * @Description:
 * @Author: leizhe
 * @Date: 2022-01-13 17:26:14
 * @LastEditTime: 2022-07-19 10:57:34
 * @LastEditors: dengchao 754083046@qq.com
 */
import { get, post, PUBLISH_SERVICE, CITY_SERVICE } from '@/services/index';
// 检查表类型重分组
export const checkTableType = param => get(`${PUBLISH_SERVICE}/CaseManage/CheckTableType`, param);
// 执行重分组表类型
export const regroupTableType = param => get(`${PUBLISH_SERVICE}/CaseManage/RegroupTableType`, param);
// 1.获取所有已附加的表
// export const CM_Table_LoadTable = param => get(`${PUBLISH_SERVICE}/CaseManage/LoadTable`, param);
export const CM_Table_LoadTable = param => get(`${PUBLISH_SERVICE}/CaseManage/LoadTableV2`, 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);
// 创建表
export const CreateTablePost = data => post(`${PUBLISH_SERVICE}/CaseManage/CreateTable`, data);
// 修改表
export const updateTablePost = param => post(`${PUBLISH_SERVICE}/CaseManage/UpdateTable`, param);

// 加载台账
export const LoadLedgers = query =>
  get(`${PUBLISH_SERVICE}/WorkOrderCenter/GetCM_Ledger_LoadLedgers`, query);
