import http from '@/utils/http'
import { AppDispatch } from '..'
/**
 * 流程设置 - 获取分页列表
 */
export const Z3_APIgetList = (data: any): any => {
  return async (dispatch: AppDispatch) => {
    const res = await http.post('cms/flow/getList', data)
    if (res.code === 0) {
      dispatch({ type: 'Z3/getList', payload: res.data })
    }
  }
}

/**
 * 流程设置-编辑
 */
export const Z3_APIsave = (data: any) => {
  return http.post('cms/flow/edit', data)
}

/**
 * 流程设置-获取详情
 */
export const Z3_APIgetInfo = (id: number) => {
  return http.get(`cms/flow/detail/${id}`)
}

/**
 * 流程设置- 环节 - 列表
 */
export const Z3_APIgetProList = (id: number) => {
  return http.get(`cms/flow/process/getList/${id}`)
}

/**
 * 流程设置- 环节-获取详情
 */
export const Z3_APIgetProInfo = (id: number) => {
  return http.get(`cms/flow/process/${id}`)
}

/**
 * 流程设置- 环节-删除
 */
export const Z3_APIgetProDel = (id: number) => {
  return http.get(`cms/flow/process/remove/${id}`)
}

/**
 * 流程设置- 环节-新增/编辑
 */
export const Z3_APIgetProSave = (data: any) => {
  return http.post('cms/flow/process/save', data)
}

/**
 * 流程设置- 环节 - 列表
 */
export const Z3_APIgetProGetUser = (id: number) => {
  return http.get(`cms/flow/process/getUser/${id}`)
}
