import { requestClient } from '#/api/request';

const prefix = 'medical-device/';

/**
 * 分页查询医疗器械列表
 * @param data
 */
export async function getMedicalDeviceList(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}

/**
 * 获取医疗器械下拉选项
 * @param data
 */
export async function getMedicalDeviceOption(data: any) {
  return requestClient.get<any>(`${prefix}option`, { params: data });
}

/**
 * 获取医疗器械详情
 * @param id
 */
export async function getMedicalDeviceInfo(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

/**
 * 导出医疗器械
 */
export async function exportMedicalDeviceApi() {
  return requestClient.download(`${prefix}export`);
}

/**
 * 新增医疗器械
 * @param data
 */
export async function createMedicalDevice(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

/**
 * 编辑医疗器械
 * @param data
 */
export async function updateMedicalDevice(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

/**
 * 删除医疗器械
 * @param data
 */
export async function deleteMedicalDevice(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}

/**
 * 导入医疗器械
 * @param data
 */
export async function importMedicalDeviceApi(data: Record<string, any>) {
  return requestClient.upload(`${prefix}import`, data);
}

/**
 * 更新医疗器械分区分类
 * @param data
 */
export async function updateZoneCategory(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update-zone-category`, data);
}

/**
 * 同步空拼音（首拼/全拼/数字串）
 */
export async function syncMedicalDevicePinyin() {
  return requestClient.post<any>(`${prefix}sync-pinyin`, {});
}








