import qs from 'qs';
import { CITY_SERVICE, get, PUBLISH_SERVICE, post, postForm } from '../index';

// 获取任务列表
export const taskOptionsList = () =>
  get(`${PUBLISH_SERVICE}/AIConfig/TaskOptionsList`);

// 获取设备类型
export const getIotDeviceType = () =>
  get(`${PUBLISH_SERVICE}/AIConfig/GetIotDeviceType`);

// 获取场景列表
export const algorithmList = () => get(`/PandaCore/OMS/AIConfig/AlgorithmList`);

// 获取设备列表
export const getEquipmentInfo = query =>
  get(`/PandaCore/GCK/Device/DeviceTree?equipType=${query}`);

// 获取指标列表
export const getQutaList = query =>
  get(
    `/PandaCore/GCK/Device/GetQuotaList?AcountName=${
      query.accountName
    }&&AddrSchemeID=${query.AddrSchemeID}`,
  );

// 获取场景列表
export const getSceneNameInfo = () =>
  get(`/PandaCore/OMS/AIConfig/GetSceneNameInfo`);

// 任务添加
export const addTaskOptions = params =>
  post(`/PandaCore/OMS/AIConfig/AddTaskOptions`, params);

// 任务编辑
export const updateTaskOptions = params =>
  post(`/PandaCore/OMS/AIConfig/UpdateTaskOptions`, params);

// 任务删除
export const deleteTaskOptions = params =>
  post(`/PandaCore/OMS/AIConfig/DeleteTaskOptions`, params);

// 预测列表
export const getPredictInfo = () =>
  get(`${PUBLISH_SERVICE}/AIConfig/GetPredictInfo`);

// 预测新增
export const addPredictOptions = params =>
  post(`/PandaCore/OMS/AIConfig/AddPredictOptions`, params);

// 预测编辑
export const editPredictOptions = params =>
  post(`/PandaCore/OMS/AIConfig/EditPredictOptions`, params);

// 预测删除
export const deletePredictOptions = params =>
  post(`/PandaCore/OMS/AIConfig/DeletePredictOptions?PredictID=${params}`);

// 策略下发列表
export const getStrategyInfo = () =>
  get(`/PandaCore/OMS/AIConfig/GetStrategyInfo`);

// 策略下发增加
export const addStrategyOptions = params =>
  post(`/PandaCore/OMS/AIConfig/AddStrategyOptions`, params);

// 策略下发编辑
export const editStrategyOptions = params =>
  post(`/PandaCore/OMS/AIConfig/EditStrategyOptions`, params);

// 策略下发删除
export const deleteStrategyOptions = params =>
  post(`/PandaCore/OMS​/AIConfig​/DeleteStrategyOptions?StrategyId=${params}`);

// 获取预测设备
export const getPredictDevice = params =>
  get(`/PandaCore/OMS/AIConfig/GetPredictDevice?DeviceType=${params}`);

// 获取预测指标
export const getPredictDevicePoint = params =>
  get(
    `/PandaCore/OMS/AIConfig/GetPredictDevicePoint?DeviceType=${
      params.deviceType
    }&DeviceCode=${params.DeviceCode}`,
  );
