import type { SysEvaluationRecord, EmployeePerformance } from './model';
import type { BaseResult } from '#/api/base-result';    
import { requestClient } from '#/api/request';

// API路径常量枚举
enum Api {
  // 查询员工评价记录列表
  getEvaluationRecordList = '/formEmployeeWeeklyEvaluation/evaluation/list',
  // 查询员工绩效列表
  getEmployeePerformanceList = '/formEmployeePerformance/performance/list',
  // 修改员工绩效
  updateEmployeePerformance = '/formEmployeePerformance/performance',

  // 获取员工绩效详细信息
  getEmployeePerformanceDetail = '/formEmployeePerformance/performance/',


}

/**
 * 查询员工评价记录列表
 * @param params 查询参数
 * @returns 员工评价记录列表
 */
export function getEvaluationRecordList(params: any) {
  return requestClient.get<BaseResult<SysEvaluationRecord[]>>(Api.getEvaluationRecordList, {
    params,
  });
}

/**
 * 查询员工绩效列表
 * @param params 查询参数
 * @returns 员工绩效列表
 */
export function getEmployeePerformanceList(params: any) {
  return requestClient.get<BaseResult<EmployeePerformance[]>>(Api.getEmployeePerformanceList, {
    params,
  });
}

/**
 * 修改员工绩效
 * @param params 员工绩效参数
 * @returns 员工绩效
 */
export function updateEmployeePerformance(params: EmployeePerformance) {
  return requestClient.put<BaseResult<EmployeePerformance>>(Api.updateEmployeePerformance, params);
}

/**
 * 获取员工绩效详细信息
 * @param params 员工绩效参数
 * @returns 员工绩效详细信息
 */
export function getEmployeePerformanceDetail(params: any) {
  return requestClient.get<BaseResult<EmployeePerformance>>(Api.getEmployeePerformanceDetail + params.id, {
    params,
  });
}

