import http from '@/utils/http'
import { AppDispatch } from '..'

/**
 * 业务中心-列表
 */
export const A3_APIList = (data: any, exportFlag = false): any => {
  if (exportFlag) return http.post('/cms/flowManage/page', data)
  return async (dispatch: AppDispatch) => {
    const res = await http.post('/cms/flowManage/page', data)
    if (res.code === 0) {
      const obj = {
        list: res.data.records,
        total: res.data.total
      }

      dispatch({ type: 'A3/getList', payload: obj })
    }
  }
}
