import http from '@/utils/http'
import { AppDispatch } from '..'
/**
 * 获取 进度统计 表格列表（存到仓库）
 */
export const B3_APIgetlist = (data: any): any => {
  return async (dispatch: AppDispatch) => {
    const res = await http.post('cms/push/pageList', data)
    if (res.code === 0) {
      const obj = {
        list: res.data.records,
        total: res.data.total
      }
      dispatch({ type: 'B3/getList', payload: obj })
    }
  }
}

/**
 * 获取 进度统计 表格列表（导出表格）
 */
export const B3_APIgetlistAll = (data: any) => {
  return http.post('cms/push/pageList', data)
}

/**
 * 点击推送
 */
export const B3_APIpush = (arr: string[]) => {
  return http.post(`cms/push/send`, arr)
}
