import request from '@/config/axios'

// 维保方案 VO
export interface MoldRecordItemVO {
  id: number // ID
  name: string // 名称 
  type: string // 类型
  subjectId: string // 关联项目id
  remark: string // 备注
}

// 维保方案 API
export const MoldRecordItemApi = {
  // 查询维保方案分页
  getMoldRecordItemPage: async (params: any) => {
    return await request.get({ url: `/mes/mold-record-item/page`, params })
  },

  // 查询维保方案详情
  getMoldRecordItem: async (id: number) => {
    return await request.get({ url: `/mes/mold-record-item/get?id=` + id })
  },

  // 新增维保方案
  createMoldRecordItem: async (data: MoldRecordItemVO) => {
    return await request.post({ url: `/mes/mold-record-item/create`, data })
  },

  // 修改维保方案
  updateMoldRecordItem: async (data: MoldRecordItemVO) => {
    return await request.put({ url: `/mes/mold-record-item/update`, data })
  },

  // 删除维保方案
  deleteMoldRecordItem: async (id: number) => {
    return await request.delete({ url: `/mes/mold-record-item/delete?id=` + id })
  },

  // 导出维保方案 Excel
  exportMoldRecordItem: async (params) => {
    return await request.download({ url: `/mes/mold-record-item/export-excel`, params })
  },
}
