import service from '@/utils/axios';
import { baseURL4,baseURL5 } from '@/constant';
import { baseURL1 } from '../../constant';

// 任务数据 设备列表
export const getTaskDataClassList = (data) => {
  console.log('任务数据接口1',baseURL4,baseURL5)
  return service.request({
    method: 'POST',
    url: '/DeviceClassList/List',
    data,
    // baseURL: localStorage.getItem('ping')?baseURL4:baseURL5,
    baseURL:baseURL1,

  });
};

// 任务数据（列表）
export const checkTaskData = (data) => {
  return service.request({
    method: 'POST',
    url: '/TaskData/Check',
    data,
    baseURL: localStorage.getItem('ping')?baseURL4:baseURL5,
  });
};

// 任务数据（提取数据）
export const extractTaskData = (data) => {
  return service.request({
    method: 'POST',
    url: '/TaskData/Extract_TaskData',
    data,
    baseURL: baseURL1,
  });
};

// 设备分类-设备列表（列表）
export const getTaskDataList = (data) => {
  return service.request({
    method: 'POST',
    url: '/TaskData/List',
    data,
    baseURL: localStorage.getItem('ping')?baseURL4:baseURL5,
  });
};

// 更新线上数据
export const updateTaskData = (data) => {
  return service.request({
    method: 'POST',
    url: '/TaskData/Up_TaskData',
    data,
    baseURL: localStorage.getItem('ping')?baseURL4:baseURL5,
  });
};

// 任务数据（添加）
export const addTaskData = (data) => {
  return service.request({
    method: 'POST',
    url: '/TaskData/Add',
    data,
    baseURL: localStorage.getItem('ping')?baseURL4:baseURL5,
  });
};

// 任务数据（添加）
export const addTaskDatas = (data) => {
  return service.request({
    method: 'POST',
    url: '/TaskData//AddS',
    data,
    baseURL: localStorage.getItem('ping')?baseURL4:baseURL5,
  });
};

// 任务数据（编辑）
export const editTaskData = (data) => {
  return service.request({
    method: 'POST',
    url: '/TaskData/Up',
    data,
    baseURL: localStorage.getItem('ping')?baseURL4:baseURL5,
  });
};

// 任务数据（删除）
export const deleteTaskData = (data) => {
  return service.request({
    method: 'POST',
    url: '/TaskData/Del',
    data,
    baseURL: localStorage.getItem('ping')?baseURL4:baseURL5,
  });
};

// 任务数据（导出excel）
export const exportTaskData = (data) => {
  return service.request({
    method: 'POST',
    url: '/TaskData/Export_Data_Excel',
    data,
    baseURL: localStorage.getItem('ping')?baseURL4:baseURL5,
  });
};

// 任务数据 设备编辑
export const editTaskDataClass = (data) => {
  return service.request({
    method: 'POST',
    url: '/TaskData/TaskDataClass_Edit',
    data,
    baseURL: localStorage.getItem('ping')?baseURL4:baseURL5,
  });
};

// 任务数据 设备删除
export const deleteTaskDataClass = (data) => {
  return service.request({
    method: 'POST',
    url: '/TaskData/TaskDataClass_Del',
    data,
    baseURL: localStorage.getItem('ping')?baseURL4:baseURL5,
  });
};


export const TaskDatajpg = (data) => {
  return service.request({
    method: 'POST',
    url: '/TaskData/jpg',
    data,
    baseURL: localStorage.getItem('ping')?baseURL4:baseURL5,
  });
};
export const TaskDatajpgSta = (data) => {
  return service.request({
    method: 'POST',
    url: '/TaskData/JPG/State',
    data,
    baseURL: localStorage.getItem('ping')?baseURL4:baseURL5,
  });
};
