import req from '@/request'

const portal = window.context.portal

// 表格分页
export function tableData(data) {
    return new Promise((resolve, reject) => {
        req.post(portal + `/event/bizEventUpload/v1/query`, data)
            .then(res => resolve(res?.data || []))
            .catch(err => reject(err))
    })
}

// 表格详情
export function tableDetail(id) {
    return new Promise((resolve, reject) => {
      req.get(portal + `/event/bizEventUpload/v1/${id}`)
        .then(res => resolve(res?.data || {}))
        .catch(err => reject(err))
    })
}

// 事件确认
export function eventConfirm(id) {
    return new Promise((resolve, reject) => {
      req.post(portal + `/event/bizEventUpload/v1/isAffirm?id=${id}`)
        .then(res => resolve(res?.data || {}))
        .catch(err => reject(err))
    })
}