import http from '@/http'

const listUrl = {
    1: '/api/v1/gov-project-collection/list',
    2: '/api/v1/gov-project-collection/draft-list'
  },
  delUrl = {
    1: '/api/v1/gov-project-collection/remove/',
    2: '/api/v1/gov-project-collection/draft-remove/'
  },
  detaillUrl = {
    1: '/api/v1/gov-project-collection/detail/',
    2: '/api/v1/gov-project-collection/draft-detail/'
  }

export const list = (state, params) => http.get(listUrl[state], { params }) // 列表
export const del = (state, id) => http.post(`${delUrl[state]}${id}`) // 删除
export const detail = (state, id) => http.get(`${detaillUrl[state]}${id}`) // 详情
export const save = data => http.post(`/api/v1/gov-project-collection/save`, data) // 保存
export const dictionary = () => http.get(`/api/v1/gov-project-collection/dictionary`) // 字典集
export const draftSave = data => http.post(`/api/v1/gov-project-collection/draft`, data) // 项目归集草稿保存

