index.js 2.04 KB
import api from "../index";
import urls from "./urls";

export default {
  //登陆
  getTask(params, id) {
    return api.get(urls.getTask, params);
  },
  addTask(params, headers) {
    return api.post2(urls.getTask, params, headers)
  },
  editTask(params, taskid) {
    return api.post(urls.editTask(taskid), params);
  },
  editSubTask(taskid, params) {
    return api.post2(urls.setSubTask(taskid), params);
  },
  editRoi(taskid, subtaskid, params) {
    return api.post(urls.editroi(taskid, subtaskid), params);
  },
  alternatestate(params, taskid, subtaskid) {
    return api.post(urls.alternatestate(taskid, subtaskid), params);
  },
  algostate(params, taskid, subtaskid) {
    return api.post(urls.algostate(taskid, subtaskid), params);
  },
  getSubTask(taskid) {
    return api.get(urls.getSubTask(taskid));
  },
  addSubtaskList(taskid, params) {
    return api.post(urls.setSubTaskList(taskid), params);
  },
  getStream(devid, vrefid, params) {
    return api.post(urls.getstream(devid, vrefid), params);
  },
  getPlayUrl(subid) {
    return api.get(urls.getPlayUrl(subid)); // 获取播放地址
  },
  getTaskParams(taskid, subtaskid) {
    return api.get(urls.getTaskParams(taskid, subtaskid));
  },
  cutpic(devid, vchanid, subtaskid) {
    return api.get(urls.cutpic(devid, vchanid, subtaskid));
  },
  deleteTask(taskid) {
    return api.delete(urls.deleteTask(taskid));
  },
  deleteSubTask(taskid, subtaskid) {
    return api.delete(urls.deleteSubTask(taskid, subtaskid));
  },
  setTaskStatus(taskid, params) {
    return api.post(urls.changeTask(taskid), params);
  },
  moveTask(taskid, params) {
    return api.post(urls.movetask(taskid), params);
  },
  switchScene(taskid, subtaskid, scene_unid) {
    return api.get(urls.switchScene(taskid, subtaskid, scene_unid));
  },
  suspendAlternate(taskid, subtaskid, suspend) {
    return api.get(urls.suspendAlternate(taskid, subtaskid, suspend));
  },
  exportParams(subtaskid) {
    return api.get(urls.exparams(subtaskid));
  },
  importParams(subtaskid) {
    return api.get(urls.upparams(subtaskid));
  }
};