import req from '@/request'

const portal = window.context.portal

// 导出三级培训档案
export function exportWord(userIds = '') {
  return new Promise((resolve, reject) => {
    req.downloadGet(portal + `/biz/train/task/threeLevel/exportWord?userIds=${userIds}`)
      .then(res => resolve(res.data || {}))
      .catch(err => reject(err))
  })
}

// 查看个人三级培训档案
export function userTrainInfo(userId) {
  return new Promise((resolve, reject) => {
    req.get(portal + `/biz/train/task/threeLevel/userTrainInfo?userId=${userId}`)
      .then(res => resolve(res?.data?.value || {}))
      .catch(err => reject(err))
  })
}



