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

/**
 * 编码规则-获取列表
 */
export const I3_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: 'I3/getList', payload: res.data })
    }
  }
}

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