import request from '@/utils/request'

enum API {
  SAVE_COMPLAINT = '/crmComplain/save',
  DELETE_BY_ID_FILE = '/commonFile/deleteFileById'
}

export interface complaintData extends SliderVerify{
  "name": string,
  "phone": string,
  "remark": string,
  "title": string,
  "type": string,
  "content":string,
  card:string,
  files:FileType[],
  unifiedSocialCreditCode:string,
  enterpriseName:string
}

export const saveComplaint = (data:complaintData)=> {
  return request<any,any>({
    url:API.SAVE_COMPLAINT,
    method:'post',
    data
  })
}

export const delFileById = (id:string)=>{
  return request<any,any>({
    url:API.DELETE_BY_ID_FILE,
    method:'get',
    params:{
      id
    }
  })
}

//拿到字典信息
export const getDict = (dick:string) => {
  return request.get('/system/dict/data/type/'+dick,{
    params:{
      dick
    }
  })
}
