import request from '@/utils/request'
import qs from 'qs'
import {upcloud_base_gsp} from "@/config/serviceSettings";
import { axios } from "@/utils/request";
import { upcloud_base_common } from '@/config/serviceSettings'

export function getList() {
  return axios.get(
    upcloud_base_common+'/dict/basic/type-list?typeCode=gsp_measure',
  )
}
const api = {
  batchAdd: upcloud_base_gsp + '/gspUpkeepCheck/batchAdd',
  findPlan: upcloud_base_gsp + '/gspUpkeepCheck/findPlan',
  findByPlanId: upcloud_base_gsp + '/gspUpkeepCheck/findByPlanId',
  batchEdit: upcloud_base_gsp + '/gspUpkeepCheck/batchEdit',
  gspUpkeepCheckbatchAdd: upcloud_base_gsp + '/gspUpkeepCheck/batchAdd',
  batchCheck: upcloud_base_gsp + '/gspUpkeepCheck/batchCheck',
  printgetGSPUpkeepPrintData: upcloud_base_gsp + '/print/getGSPUpkeepPrintData',
  senToEis: upcloud_base_gsp + '/gspUpkeepCheck/sendTaskToEis'
}

export function batchCheck(parameter) {
  //   养护记录批量修改 POST
  return request({
    method: 'post',
    url: api.batchCheck,
    data: parameter
  })
}

export function gspUpkeepCheckbatchAdd(parameter) {
  //   养护记录批量修改 POST
  return request({
    method: 'post',
    url: api.gspUpkeepCheckbatchAdd,
    data: parameter
  })
}

export function batchEdit(parameter) {
  //   养护记录批量修改 POST
  return request({
    method: 'post',
    url: api.batchEdit,
    data: parameter
  })
}

export function batchAdd(parameter) {
  //   养护计划批量新增 POST
  return request({
    method: 'post',
    url: api.batchAdd,
    data: parameter
  })
}

// 养护记录菜单，弹框接口：查询养护计划

export function findPlan(parameter) {
  //   养护计划批量新增 POST
  return request({
    method: 'get',
    url: api.findPlan,
    params: parameter
  })
}

export function findByPlanId(parameter) {
  //   养护计划批量新增 POST
  return request({
    method: 'get',
    url: api.findByPlanId,
    params: parameter
  })
}

//养护打印 GET
export function printgetGSPUpkeepPrintData(parameter) {
  //   养护计划批量新增 POST
  return request({
    method: 'get',
    url: api.printgetGSPUpkeepPrintData,
    params: parameter
  })
}

// 普通养护录入-发送设备指令
export function sendToEis(parameter) {
  return request({
    method: 'post',
    url: api.senToEis,
    data: parameter
  })
}
