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

/**
 * 编码规则-获取列表
 */
export const Z2_APIgetList = (name: string): any => {
  return async (dispatch: AppDispatch) => {
    let url = 'cms/number/getList'
    if (name) url += `?name=${name}`
    const res = await http.get(url)
    if (res.code === 0) {
      dispatch({ type: 'Z2/getList', payload: res.data })
    }
  }
}

/**
 * 点击编辑
 */
export const Z2_APIsave = (data: any) => {
  return http.post('cms/number/edit', data)
}
