index.js 3.15 KB
import api from "../index";
import baseUrl from "../baseUrl";
export default {
	devs(params){
		return api.get(`${baseUrl}/api/v1/devconf_fx/devs`, params)
	},
	treeList(params,id) {
		return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchan_struct`, params)
	},
	getVideoList(params,id) {
		return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans`, params)
	},
	addCode(params,id) {
		return api.post(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes`, params)
	},
	addNode(params,id){
		return api.post(`${baseUrl}/api/v1/org`, params)
	},
	getCode(params,id){
		return api.get(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes`, params)
	},
	editCode(params,id,unid){
		return api.post(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes/${unid}`, params)
	},
	delCode(params,id,unid){
		return api.delete(`${baseUrl}/api/v1/codes/custom/cates/${id}/codes/${unid}`, params)
	},
	delOrg(params,id){
		return api.delete(`${baseUrl}/api/v1/org/${id}`, params)
	},
	delCamera(params,id,id2){
		return api.delete(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params)
	},
	getCameraTable(params,id,id2){
		console.log(id2)
		if(id2){
			return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params)
		}else{
			return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans`, params)
		}
	},
	editVideo(params,id,id2){
		return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params)
	},
	delVideo(params,id,id2){
		return api.delete(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params)
	},
	addCamera(params,id){
		return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans`, params)
	},
	editCamera(params,id,id2){
		return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vchans/${id2}`, params)
	},
	uploadFile(params,id){
		return api.post(`${baseUrl}/api/v1/devconf_fx/devs/${id}/vfile_vchans`, params,{'Content-Type': 'multipart/form-data'})
	},

  getResource(params, id) {
    return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/status`, params);
  },
  getDevsName(params, id) {
    return api.get(`${baseUrl}/api/v1/devconf_fx/devs/${id}/fx_devs`, params);
  },
  getStoreConList(params) {
    return api.get(`${baseUrl}/api/v1/devconf_fx/store_confs`, params);
  },
  uploadStore(params) {
    return api.post(`${baseUrl}/api/v1/devconf_fx/store_confs`, params, {
      "Content-Type": "multipart/form-data"
    });
  },
  getSubTask(params, id) {
    return api.get(`${baseUrl}/api/v1/devconf_fx/tasks/${id}/subtasks`, params);
  },
  delStore(params, id) {
    return api.delete(`${baseUrl}/api/v1/devconf_fx/store_confs/${id}`, params);
  },
  getsip(params, id, id2) {
    return api.get(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/sip_server`,
      params
    );
  },
  addSip(params, id, id2) {
    return api.post(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/sip_server`,
      params
    );
  },
  editSip(params, id, id2, id3) {
    return api.post(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/${id3}/sip_server`,
      params
    );
  },
  delSip(params, id, id2, id3) {
    return api.delete(
      `${baseUrl}/api/v1/devconf_fx/devs/${id}/${id2}/${id3}/sip_server`,
      params
    );
  }
};