import http from '@/utils/http'
import { AppDispatch } from '..'
/**
 *Json推送 表格列表（存到仓库）
 */
export const B4_APIgetlist = (data: any): any => {
  return async (dispatch: AppDispatch) => {
    const res = await http.post('cms/json/pageList', data)
    if (res.code === 0) {
      const obj = {
        list: res.data.records,
        total: res.data.total
      }
      dispatch({ type: 'B4/getList', payload: obj })
    }
  }
}

/**
 *Json推送 表格列表（导出表格）
 */
export const B4_APIgetlistAll = (data: any) => {
  return http.post('cms/json/pageList', data)
}
