import http from '@/http'

const listUrl = {
    1: '/api/v1/gov-project-collection/operation/list',
    2: '/api/v1/gov-project-collection/operation/draft-list'
  },
  detaillUrl = {
    1: '/api/v1/gov-project-collection/operation/detail/',
    2: '/api/v1/gov-project-collection/operation/draft-detail/'
  },
  delUrl = {
    1: '/api/v1/gov-project-collection/operation/remove/',
    2: '/api/v1/gov-project-collection/operation/draft-remove/'
  }
export const list = (state, params) => http.get(listUrl[state], { params }) // 列表
export const save = data => http.post(`/api/v1/gov-project-collection/operation/save`, data) // 保存
export const detail = (state, id) => http.get(`${detaillUrl[state]}${id}`) // 详情
export const del = (state, id) => http.post(`${delUrl[state]}${id}`) // 删除
export const draftSave = data => http.post(`/api/v1/gov-project-collection/operation/draft`, data) // 草稿保存
