import { defHttp } from '@/utils/http/axios';
import { ID, IDS, commonExport } from '@/api/base';
import { WorkDataVO, WorkDataForm, WorkDataQuery, WorkDataDisForm, ExpertConsultVO, ExpertConsultQuery } from './model';

/**
 * 查询工作数据信息;列表
 * @param params
 * @returns
 */
export function workDataList(params?: WorkDataQuery) {
  return defHttp.get<WorkDataVO[]>({ url: '/work/workData/list', params });
}
/**
 * 查询专家咨询;列表
 * @param params
 * @returns
 */
export function expertConsultList(params?: ExpertConsultQuery) {
  return defHttp.get<ExpertConsultVO[]>({ url: '/elevator/expertConsult/list', params });
}
/**
 * 导出工作数据信息;列表
 * @param params
 * @returns
 */
export function workDataExport(params?: WorkDataQuery) {
  return commonExport('/work/workData/exportPicture', params ?? {});
}

/**
 * 查询工作数据信息;详细
 * @param id id
 * @returns
 */
export function workMaintenanceDetail(id: ID) {
  return defHttp.get({ url: '/work/workData/' + id });
}
/**
 * 查询工作数据信息;详细
 * @param id id
 * @returns
 */
export function workDataInfo(id: ID) {
  return defHttp.get<WorkDataVO>({ url: '/work/workData/' + id });
}
/**
 * 查询专家咨询详细
 * @param id id
 * @returns
 */
export function expertConsultInfo(id: ID) {
  return defHttp.get<ExpertConsultVO>({ url: '/elevator/expertConsult/' + id });
}

/**
 * 新增工作数据信息;
 * @param data
 * @returns
 */
export function workDataAdd(data: WorkDataForm) {
  return defHttp.postWithMsg<void>({ url: '/work/workData', data });
}

/**
 * 更新工作数据信息;
 * @param data
 * @returns
 */
export function workDataUpdate(data: WorkDataForm) {
  return defHttp.putWithMsg<void>({ url: '/work/workData', data });
}

export function workAudiooUpdate(data: any) {
  return defHttp.postWithMsg<void>({ url: '/work/workData/maintenance/audit', data });
}

/**
 * 删除工作数据信息;
 * @param id id
 * @returns
 */
export function workDataRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/work/workData/' + id });
}
/**
 * 删除专家咨询
 * @param id id
 * @returns
 */
export function expertConsultRemove(id: ID | IDS) {
  return defHttp.deleteWithMsg<void>({ url: '/elevator/expertConsult/' + id });
}


/**
 * 工作派发;
 * @param data
 * @returns
 */
export function workDataDistribute(data: WorkDataDisForm) {
  return defHttp.postWithMsg<void>({ url: '/work/workData/distribution', data });
}
