// import request from '@/utils/request';
import { useHttp } from '@crami/http';

export interface saveData {
  ObjectType: string;
  companyId: string;
  connect: string;
  data: {
    ECODE: string;
    EID: string;
    ENAME: string;
    EXPORTTYPE: string;
    FILETYPE: string;
    MAXCOUNT: string;
    SETTING: string;
    STATE: string;
    TEMPLATE: string;
  };
  lang: string;
  mode: string;
  modelName: string;
  newObject: string;
  objectID: string;
  productLine: string;
  projectCode: string;
  type: string;
  userId: string;
}
export async function saveDataAPI(data: any) {
  return await useHttp({
    url: '/system/model/saveObjectData',
    method: 'post',
    data,
    headers: {
      //根据接扣文档需要加的请求头
      'Content-Type': 'application/json',
    },
  });
}

export interface editData {
  companyId: string;
  connect: string;
  lang: string;
  objectID: string;
  // projectCode: string;
  // userDept: string;
  // userGroup: string;
  // userId: string;
}
export async function editDataAPI(data: editData) {
  return await useHttp({
    url: '/system/model/GetObjectDataTestList',
    method: 'post',
    data,
  });
}

export interface deleteRule {
  companyId: string;
  connect: string;
  lang: string;
  eidstr: string[];
}
export async function deleteRuleAPI(data: deleteRule) {
  return await useHttp({
    url: '/exportservice/exportMaintain/deleteRule',
    method: 'post',
    data,
  });
}
