import request from '@/utils/request'

// 创建资产档案
export function createElectronicAssets(data) {
  return request({
    url: '/ea/electronic/create',
    method: 'post',
    data: data
  })
}

// 更新资产档案
export function updateElectronicAssets(data) {
  return request({
    url: '/ea/electronic/update',
    method: 'put',
    data: data
  })
}

// 删除资产档案
export function deleteElectronicAssets(id) {
  return request({
    url: '/ea/electronic/delete?id=' + id,
    method: 'delete'
  })
}

// 获得资产档案
export function getElectronicAssets(id) {
  return request({
    url: '/ea/electronic/get?id=' + id,
    method: 'get'
  })
}

// 获得资产档案分页
export function getElectronicAssetsPage(query) {
  return request({
    url: '/ea/electronic/page',
    method: 'get',
    params: query
  })
}

// 导出资产档案 Excel
export function exportElectronicAssetsExcel(query) {
  return request({
    url: '/ea/electronic/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
