import request from '@/utils/request'
import da from 'element-ui/src/locale/lang/da'


// 查询系统文章列表
export function listArticle(data) {
  return request({
    url: '/sist/article/list',
    method: 'post',
    data: data
  })
}

// 导出系统文章
export function exportArticle(data) {
  return request({
    url: '/sist/article/export',
    method: 'post',
    data: data
  })
}

// 查询系统文章详细
export function getArticle(id) {
  return request({
    url: '/sist/article/' + id,
    method: 'get'
  })
}

// 查询系统文章详细
export function getArticleType() {
  return request({
    url: '/sist/article/type',
    method: 'get'
  })
}


// 查询系统文章详细
export function getArticleNav() {
  return request({
    url: '/sist/article/nav',
    method: 'get'
  })
}

export function getArticleApprove(type) {
  return request({
    url: '/sist/article/approve/'+type,
    method: 'get'
  })
}

// 新增系统文章
export function addArticle(data) {
  return request({
    url: '/sist/article',
    method: 'post',
    data: data
  })
}

// 审批系统文章
export function approve(data) {
  return request({
    url: '/sist/article/approve',
    method: 'post',
    data: data
  })
}

// 保存草稿
export function drafts(data) {
  return request({
    url: '/sist/article/drafts',
    method: 'post',
    data: data
  })
}

// 驳回系统文章
export function rejected(data) {
  return request({
    url: '/sist/article/rejected',
    method: 'post',
    data
  })
}

// 驳回系统文章
export function offline(data) {
  return request({
    url: '/sist/article/offline',
    method: 'post',
    data
  })
}

// 修改系统文章
export function updateArticle(data) {
  return request({
    url: '/sist/article',
    method: 'put',
    data: data
  })
}

// 修改系统文章
export function putIndex(data) {
  console.log(data,"data")
  return request({
    url: '/sist/article/index',
    method: 'put',
    data: data
  })
}

// 删除系统文章
export function delArticle(id) {
  return request({
    url: '/sist/article/' + id,
    method: 'delete'
  })
}
