Newer
Older
rescue_front / src / api / marker.js
[wangxitong] on 26 Mar 2022 1 KB first commit
import qs from 'qs'

/**
 * 标识管理接口
 */
import request from '@/utils/request'

export function getMarkerList(params) {
  return request({
    url: 'marker/listPage',
    method: 'get',
    params
  })
}

export function getMarkerInfo(id) {
  return request({
    url: 'marker/detail',
    method: 'get',
    params: {
      id: id
    }
  })
}

// 添加设备
export function addMarker(params) {
  return request({
    url: 'marker/add',
    method: 'post',
    params
  })
}
// 修改设备
export function updateMarker(params) {
  return request({
    url: 'marker/update',
    method: 'post',
    params
  })
}

// 系统统计
export function statisticsByDept() {
  return request({
    url: 'marker/statisticsByDept',
    method: 'get'
  })
}

export function statisticsByStatus() {
  return request({
    url: 'marker/statisticsByStatus',
    method: 'get'
  })
}

// 批量导入标识器
export function batchImportMarker(fileobj) {
  const param = new FormData()
  param.append('file', fileobj)
  return request({
    url: 'marker/batchImport',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: param,
    timeout: 3000000
  })
}

// 删除设备
export function delMarker(ids) {
  return request({
    url: 'marker/delete',
    method: 'post',
    params: {
      ids: ids
    },
    paramsSerializer: params => {
      return qs.stringify(params, { indices: false })
    }
  })
}

export function getInspectionList(params) {
  return request({
    url: 'inspection/list',
    method: 'get',
    params
  })
}

export function getMaintainList(params) {
  return request({
    url: '/maintain/list',
    method: 'get',
    params
  })
}