// 状态管理相关接口api
import request from '../index'
import type { ISearchQuery } from '@/views/device/stateManage/components/status-interface'

// 设备申请列表
export function getStatusList(data: ISearchQuery) {
  return request({
    url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`,
    method: 'post',
    data,
  })
}
// 状态管理新建
export function addStatus(data: Object) {
  return request({
    url: '/meter/stateManage/addStateManageInfo',
    method: 'post',
    data,
  })
}

// 状态管理编辑
export function updateStatus(data: Object) {
  return request({
    url: '/meter/stateManage/updateStateManageInfo',
    method: 'post',
    data,
  })
}

// 状态管理删除
export function deleteStatus(data: { id: string | number }) {
  return request({
    url: '/meter/stateManage/deleteStateManageList',
    method: 'post',
    data,
  })
}
// 状态管理取消
export function cancelStatus(data: { processInstanceId: string }) {
  return request({
    url: '/approval/operate/revoke',
    method: 'post',
    data,
  })
}
// 状态管理提交
export function submitStatus(data: { id: string | number; formId: string }) {
  return request({
    url: '/meter/stateManage/submitStandardEquipmentApply',
    method: 'post',
    data,
  })
}
// 状态管理详情
export function detailStatus(data: object) {
  return request({
    url: '/meter/stateManage/selectStateManageInfo',
    method: 'post',
    data,
  })
}

// 状态管理导出
export function exportStatus(data: object) {
  return request({
    url: '/meter/stateManage/exportStateManageList',
    method: 'post',
    responseType: 'blob',
    data,
  })
}
