import request from '@/config/axios'

// 设备台账 API
export const IotStatApi = {
  getMainDay: async (params: any) => {
    return await request.get({ url: `/rq/stat/main/day` })
  },
  getMainWeek: async (params: any) => {
    return await request.get({ url: `/rq/stat/main/week` })
  },
  getMainMonth: async (params: any) => {
    return await request.get({ url: `/rq/stat/main/month` })
  },
  getMainTotal: async (params: any) => {
    return await request.get({ url: `/rq/stat/main/total` })
  },
  getMainStatus: async (params: any) => {
    return await request.get({ url: `/rq/stat/main/status` })
  },
  getInspectDay: async (params: any) => {
    return await request.get({ url: `/rq/stat/inspect/day` })
  },
  getInspectWeek: async (params: any) => {
    return await request.get({ url: `/rq/stat/inspect/week` })
  },
  getInspectMonth: async (params: any) => {
    return await request.get({ url: `/rq/stat/inspect/month` })
  },
  getInspectTotal: async (params: any) => {
    return await request.get({ url: `/rq/stat/inspect/total` })
  },
  getInspectStatus: async (params: any) => {
    return await request.get({ url: `/rq/stat/inspect/status` })
  },
  getInspectTodayStatus: async (params: any) => {
    return await request.get({ url: `/rq/stat/inspect/today/status` })
  },
  getInspectDeviceStatus: async (params: any) => {
    return await request.get({ url: `/rq/stat/inspect/device` })
  },
  getMaintenanceDay: async (params: any) => {
    return await request.get({ url: `/rq/stat/maintenance/day` })
  },
  getMaintenanceWeek: async (params: any) => {
    return await request.get({ url: `/rq/stat/maintenance/week` })
  },
  getMaintenanceMonth: async (params: any) => {
    return await request.get({ url: `/rq/stat/maintenance/month` })
  },
  getMaintenanceTotal: async (params: any) => {
    return await request.get({ url: `/rq/stat/maintenance/total` })
  },
  getMaintenanceStatus: async (params: any) => {
    return await request.get({ url: `/rq/stat/maintenance/status` })
  },
  getMaintenanceTodayStatus: async (params: any) => {
    return await request.get({ url: `/rq/stat/maintenance/today/status` })
  },
  getMaintenanceType: async (params: any) => {
    return await request.get({ url: `/rq/stat/maintenance/type` })
  },
  getDeviceInfoChart: async (deviceCode: any, identifier: any, begin: string, end:string) => {
    return await request.get({ url: `/rq/stat/td/chart/`+deviceCode+'/'+identifier+'?beginTime='+begin+'&endTime='+end })
  },


  getDeviceCount: async (params: any) => {
    return await request.get({ url: `/rq/stat/home/device/count` })
  },
  getMaintainCount: async (params: any) => {
    return await request.get({ url: `/rq/stat/home/maintain/count` })
  },
  getMainWorkCount: async (params: any) => {
    return await request.get({ url: `/rq/stat/home/work/count` })
  },
  getInspectCount: async (params: any) => {
    return await request.get({ url: `/rq/stat/home/inspect/count` })
  },
  getDeviceStatusCount: async (params: any) => {
    return await request.get({ url: `/rq/stat/home/device/status` })
  },

  getDeviceTypeCount: async (params: any) => {
    return await request.get({ url: `/rq/stat/home/device/type` })
  },
  getDeptCount: async (params: any) => {
    return await request.get({ url: `/rq/stat/home/dept` })
  },
  getSafeCount: async (params: any) => {
    return await request.get({ url: `/rq/stat/home/safe` })
  },
  getDeptStatistics: async (params: any) => {
      return await request.get({ url: `/rq/iot-opeation-fill/getCount`, params })
  },
  getDevSta: async (params: any) => {
    return await request.get({ url: `/rq/iot-opeation-fill/getDeviceCount`, params })
  },
}
