import req from '@/request'

const portal = window.context.portal

// 部门事件统计
export function EventDept(data) {
  return new Promise((resolve, reject) => {
    req.post(portal + `/event/bizEventInfo/v1/count/type`, data)
      .then(res => {
        let resData = res.data || {}
        resData.urlKey = 'EventDept'
        resolve(resData)
      })
      .catch(err => reject(err))
  })
}

// 事件处置时间统计 (接口未出，待优化)
export function EventHandleTime(data) {
  return new Promise((resolve, reject) => {
    req.post(portal + `/event/bizEventInfo/v1/count/type`, data)
      .then(res => {
        let resData = res.data || {}
        resData.urlKey = 'EventHandleTime'
        resolve(resData)
      })
      .catch(err => reject(err))
  })
}
