import request from 'utils/request'

// 获取电梯列表
export const getElevatorListApi = (data) => {
  return request.tryGet('/elevator/info/list', data)
}

// 获取电梯详情
export const getElevatorInfoApi = (data) => {
  return request.tryGet(`/elevator/info/${data.id}`, data)
}

// 获取电梯详情 - 无 token
export const getElevatorInfoWxApi = (data) => {
  return request.tryGet('/wechat/portal/ma/wxff99592fd1b5d95b/getEleInfo', data)
}

// 获取电梯详情 - 无 token
export const getElevatorIdInfoWxApi = (data) => {
  return request.tryGet(
    `/wechat/portal/ma/wxff99592fd1b5d95b/getEleInfo/${data.id}`,
    data
  )
}

// 根据电梯编号获取电梯信息
export const getElevatorInfoDetailApi = (data) => {
  return request.tryGet(`/elevator/info/detail/${data.elevatorNum}`, data)
}

// 获取电梯救援列表
export const getOtherMaintainRecordListApi = (data) => {
  return request.tryGet('/otherRecord/otherMaintainRecord/list', data)
}

// 获取电梯维保计划列表
export const getMaintainPlanListApi = (data) => {
  return request.tryGet('/maintenancePlan/maintenancePlan/list', data)
}

// 获取电梯维保列表
export const getMaintainRecordListApi = (data) => {
  return request.tryGet('/mrecord/maintenanceRecord/list', data)
}

// 获取电梯维保详情
export const getMaintainRecordInfoApi = (data) => {
  return request.tryGet(`/mrecord/maintenanceRecord/${data.id}`, data)
}

// 获取电梯运行记录
export const getBehaviorMessageListApi = (data) => {
  return request.tryGet('/behavior/behaviorMessage/list', data)
}

// 获取电梯运行详情
export const getBehaviorMessageInfoApi = (data) => {
  return request.tryGet(`/behavior/behaviorMessage/${data.id}`, data)
}

// 获取签到列表
export const getSignInListApi = (data) => {
  return request.tryGet('/sign/signInInfo/list', data)
}

// 签到
export const postSignInApi = (data) => {
  return request.tryPost('/sign/signInInfo', data)
}

// 获取乘客反馈列表
export const getPassengerFeedbackListApi = (data) => {
  return request.tryGet('/feedback/passengerFeedback/list', data)
}

// 提交乘客反馈列表
export const postPassengerFeedbackListApi = (data) => {
  return request.tryPost('/feedback/passengerFeedback', data)
}

// 获取故障列表
export const getFaultMessageListApi = (data) => {
  return request.tryGet('/fault/faultMessage/list', data)
}

// 获取电梯操作记录
export const getWorkOperationRecordListApi = (data) => {
  return request.tryGet('/elevator/workOperationRecord/list', data)
}

// 获取电梯操作详情
export const getWorkOperationRecordInfoApi = (data) => {
  return request.tryGet(`/elevator/workOperationRecord/${data.id}`, data)
}

// 获取员工信息列表
export const getWorkerInfoListApi = (data) => {
  return request.tryGet('/worker/workerInfo/list', data)
}

// 获取电梯详情统计
export const getElevatorDetailStatisticsApi = (data) => {
  return request.tryGet(
    '/elevator/behaviorStatistics/elevator/detail/statistics',
    data
  )
}

// 获取电梯实时数据
export const getElevatorRealDataApi = (data) => {
  return request.tryGet(`/elevator/info/real/${data.elevatorNum}`, data)
}

// 获取维保完成数量统计
export const getCompleteStatisticsApi = (data) => {
  return request.tryGet(
    '/maintenancePlan/maintenancePlan/complete/statistics/list',
    data
  )
}

// 获取工作数据
export const getWorkDataListApi = (data) => {
  return request.tryGet('/work/workData/list', {
    ...data,
    miniSearchFlag: true
  })
  // return request.tryGet('/work/workData/list', data)
}

// 获取工作数据详情
export const getWorkDataInfoApi = (data) => {
  return request.tryGet(`/work/workData/${data.id}`, data)
}

// 派发工作数据信息
export const postWorkDataDistributionApi = (data) => {
  return request.tryPost('/work/workData/distribution', data)
}

// 修改工作数据
export const putWorkDataApi = (data) => {
  return request.tryPut('/work/workData', data)
}

// 轿厢 - 新增工作记录轿厢信息
export const postWorkElevatorCabinApi = (data) => {
  return request.tryPost('/elevator/workElevatorCabin', data)
}

// 轿厢 - 获取工作记录轿厢信息
export const getWorkElevatorCabinInfoApi = (data) => {
  return request.tryGet(`/elevator/workElevatorCabin/info/${data.id}`, data)
}

// 轿顶 - 新增工作记录轿顶信息
export const postWorkCarRoofApi = (data) => {
  return request.tryPost('/elevator/workCarRoof', data)
}

// 轿顶 - 获取工作记录轿顶信息
export const getWorkCarRoofInfoApi = (data) => {
  return request.tryGet(`/elevator/workCarRoof/info/${data.id}`, data)
}

// 机房 - 新增工作记录机房信息
export const postWorkMachineRoomApi = (data) => {
  return request.tryPost('/elevator/workPit', data)
}

// 机房 - 获取工作记录机房信息
export const getWorkMachineRoomInfoApi = (data) => {
  return request.tryGet(`/elevator/workMachineRoom/info/${data.id}`, data)
}

// 底坑 - 新增工作记录底坑信息
export const postWorkPitApi = (data) => {
  return request.tryPost('/elevator/workPit', data)
}

// 底坑 - 获取工作记录底坑信息
export const getWorkPitInfoApi = (data) => {
  return request.tryGet(`/elevator/workPit/info/${data.id}`, data)
}

// 提交 - 工作表
export const postWorkDataWorkRecordApi = (data) => {
  return request.tryPost('/work/workData/workRecord', data)
}

// 工作接收
export const postWorkDataReceiveApi = (data) => {
  return request.tryPost('/work/workData/receive', data)
}

// 工作到场
export const postWorkDataArriveApi = (data) => {
  return request.tryPost('/work/workData/arrive', data)
}

// 工作评价
export const postWorkDataEvaluateApi = (data) => {
  return request.tryPost('/work/workData/evaluate', data)
}

// 获取超期年检列表
export const getAnnualPlanOverdueListApi = (data) => {
  return request.tryGet('/annual/annualPlan/overdue/list', data)
}

// 获取超期维保列表
export const getWorkDataOverdueListApi = (data) => {
  return request.tryGet('/work/workData/overdue/list', data)
}

// 获取年检日期
export const getAnnualPlanGetDateApi = (data) => {
  return request.tryGet('/annual/annualPlan/getDate', data)
}

// 获取年检列表
export const getAnnualPlanListApi = (data) => {
  return request.tryGet('/annual/annualPlan/list', data)
}

// 查询电梯及工作人员关联信息列表
export const getElevatorUserListApi = (data) => {
  return request.tryGet('/elevator/elevatorUser/list', data)
}

// 批量关注或取消关注电梯
export const postElevatorUserConcernApi = (data) => {
  return request.tryPost('/elevator/elevatorUser/concern', data)
}

// 获取电梯体检详细信息
export const getElevatorExaminationApi = (data) => {
  return request.tryGet(`/elevator/elevatorExamination/${data.id}`)
}

// 获取单个电梯体检详细信息
export const getElevatorExaminationInfoApi = (data) => {
  return request.tryGet('/elevator/elevatorExamination/info', data)
}

// 根据日期获取电梯年检信息
export const getAnnualPlanGetByDateApi = (data) => {
  return request.tryGet(`/annual/annualPlan/getByDate/${data.planDate}`, data)
}

// 根据电梯编号查询物业维保等人员信息
export const getThirdPartyUserApi = (data) => {
  return request.tryGet(
    `/elevator/thirdPartyUser/getThirdPartyUser/${data.elevatorNum}`,
    data
  )
}

// 修改密码
export const putProfileUpdatePwdApi = (data) => {
  return request.tryPut('/system/user/profile/updatePwd', data, {
    encrypt: true
  })
}

// 工作记录附件(图片、视频等)上传
export const postWorkDataRecordUploadApi = (data, id) => {
  return request.tryPost(`/work/workData/record/upload/${id}`, data)
}

// 工作签名
export const postWorkDataSignApi = (data) => {
  return request.tryPost('/work/workData/sign', data)
}

// 工作签名完成
export const postWorkDataCompleteApi = (data) => {
  return request.tryPost('/work/workData/complete', data)
}

// 创建维修单
export const postWorkDataRepairCreateApi = (data) => {
  return request.tryPost('/work/workData/repair/create', data)
}

// 维修单审核
export const postWorkDataRepairAuditApi = (data) => {
  return request.tryPost('/work/workData/repair/audit', data)
}

// 获取大屏电梯列表
export const getElevatorLargeScreenListApi = (data) => {
  return request.tryGet('/elevator/largeScreen/list', data)
}
