import request from '@/config/axios'

// 运行记录填报 VO
export interface IotOpeationFillVO {
  id: any // 主键id
  wellName: string // 井号
  deviceCode: string // 资产编号
  deviceCategoryId: number
  deviceName: string // 设备名称
  fillContent: any // 填写内容
  deviceType: string // 设备类别
  deviceComponent: string // 设备部件
  deptId: number // 公司id
  orgName: string // 所属组织
  proId: number // 项目部id
  proName: string // 所属项目部
  teamId: number // 小队id
  teamName: string // 所属小队
  dutyName: string // 设备负责人
  creDate: Date // 填写日期
  name: string
  type: string
  modelAttr: string
  modelId: number
  isFill: number
  pointCode: string
  pointName: string
  orderName: string
  orderType: string
  orderStatus: number
  createTime: any
  totalRunTime: number
  userId: any
  isSum: number
  deviceId: any
  limitType: any
  currentSumValue: any
  maxAllowedValue: any
  isCollection: any
  description: any
  wellNamePair: any
  noGasTasks: any
}

// 运行记录填报 API
export const IotOpeationFillApi = {
  // 查询运行记录填报分页
  getIotOpeationFillPage: async (params: any) => {
    return await request.get({ url: `/rq/iot-opeation-fill/page`, params })
  },

  getIotOrderPage: async (params: any) => {
    return await request.get({ url: `/rq/iot-opeation-fill/orderPage`, params })
  },

  getIotOpeationFillPage1: async (params: any) => {
    return await request.get({ url: `/rq/iot-opeation-fill/page1`, params })
  },
  getDeviceData: async (params: any) => {
    return await request.get({ url: `/rq/iot-opeation-fill/countPage`, params })
  },

  getFillRecordsPage: async (params: any) => {
    return await request.get({ url: `/rq/iot-opeation-fill/fillRecordPage`, params })
  },

  getAttrs: async (params: any) => {
    return await request.get({ url: `/rq/iot-opeation-fill/getAttrs`, params })
  },

  getAttrs1: async (params: any) => {
    return await request.get({ url: `/rq/iot-opeation-fill/getAttrs1`, params })
  },

  getDeivceFillInfo: async (params: any) => {
    return await request.get({ url: `/rq/iot-opeation-fill/getDeivceFillInfo`, params })
  },

  // 查询运行记录填报详情
  getIotOpeationFill: async (id: number) => {
    return await request.get({ url: `/rq/iot-opeation-fill/get?id=` + id })
  },

  // 新增运行记录填报
  createIotOpeationFill: async (data: IotOpeationFillVO) => {
    return await request.post({ url: `/rq/iot-opeation-fill/create`, data })
  },

  // 新增运行记录填报
  insertLog: async (data: any) => {
    return await request.post({ url: `/rq/iot-opeation-fill/insertLog`, data })
  },

  getReportDetails: async (id: any) => {
    return await request.get({ url: `/rq/iot-opeation-fill/prod/detail/${id}` })
  },

  // 修改运行记录填报
  updateIotOpeationFill: async (data: IotOpeationFillVO) => {
    return await request.put({ url: `/rq/iot-opeation-fill/update`, data })
  },

  // 修改运行记录填报
  updateIotOpeationFill1: async (data: IotOpeationFillVO) => {
    return await request.put({ url: `/rq/iot-opeation-fill/update1`, data })
  },

  // 删除运行记录填报
  deleteIotOpeationFill: async (id: number) => {
    return await request.delete({ url: `/rq/iot-opeation-fill/delete?id=` + id })
  },

  // 导出运行记录填报 Excel
  exportIotOpeationFill: async (params) => {
    return await request.download({ url: `/rq/iot-opeation-fill/export-excel`, params })
  },

  // 获取公司
  getOrgName: async (id) => {
    return await request.get({ url: `/rq/report/dept/${id}` })
  }
}
