oceanus.js 2.83 KB
Newer Older
陈浩玮's avatar
设备  
陈浩玮 committed
1 2 3 4 5 6 7 8
import { delReq, getReq, postReq, putReq } from '@/utils';

function getOceanusTreeApi(data) {
    return getReq('/oceanus/api/v1/categories', data);
}
function addOceanusTreeApi(data) {
    return postReq('/oceanus/api/v1/categories', data);
}
陈浩玮's avatar
陈浩玮 committed
9 10 11 12
function updateOceanusTreeApi(data) {
    return putReq('/oceanus/api/v1/categories', data);
}
function delOceanusTreeApi(data) {
陈浩玮's avatar
陈浩玮 committed
13
    return delReq(`/oceanus/api/v1/categories/${data.categoryId}`, data);
陈浩玮's avatar
陈浩玮 committed
14
}
陈浩玮's avatar
陈浩玮 committed
15 16 17 18 19

function getAttributesApi(data) {
  return getReq('/oceanus/api/v1/categories/attributes', data);
}

陈浩玮's avatar
陈浩玮 committed
20 21 22 23 24 25 26 27 28 29 30
function addAttributesApi(data) {
    return postReq('/oceanus/api/v1/categories/attributes', data);
}
function updateAttributesApi(data) {
    return putReq('/oceanus/api/v1/categories/attributes', data);
}
function movementAttributesApi(data) {
    return putReq('/oceanus/api/v1/categories/attributes/movement', data);
}

function getEquipmentsTreeApi(data) {
陈浩玮's avatar
陈浩玮 committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
    return getReq(`/oceanus/api/v1/equipments/catalogs/${data.catalogId}`);
}
function addEquipmentsTreeApi(data) {
    return postReq(`/oceanus/api/v1/equipments/catalogs`, data);
}

function updateEquipmentsTreeApi(data) {
    return putReq(`/oceanus/api/v1/equipments/catalogs`, data);
}
function delEquipmentsTreeApi(data) {
    return delReq(`/oceanus/api/v1/equipments/catalogs`, {}, { data });
}

function getEquipmentsInfoApi(data) {
    return getReq(`/oceanus/api/v1/equipments/${data.catalogValue}`);
陈浩玮's avatar
陈浩玮 committed
46
}
陈浩玮's avatar
陈浩玮 committed
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
function getEquipmentsAttributesApi(data) {
  return getReq('/oceanus/api/v1/equipments/attributes', data);
}

function addEquipmentsAttributesApi(data) {
  return postReq('/oceanus/api/v1/equipments/attributes', data);
}

function updateEquipmentsAttributesApi(data) {
  return putReq('/oceanus/api/v1/equipments/attributes', data);
}
function topEquipmentsAttributesApi(data) {
  return putReq(`/oceanus/api/v1/equipments/attributes/top/${data.instanceId}`,{});
}
function bottomEquipmentsAttributesApi(data) {
  return putReq(`/oceanus/api/v1/equipments/attributes/bottom/${data.instanceId}`,{});
}


陈浩玮's avatar
设备  
陈浩玮 committed
66 67 68 69

export default {
    getOceanusTree: getOceanusTreeApi,
    addOceanusTree: addOceanusTreeApi,
陈浩玮's avatar
陈浩玮 committed
70 71
    updateOceanusTree: updateOceanusTreeApi,
    delOceanusTree: delOceanusTreeApi,
陈浩玮's avatar
陈浩玮 committed
72
    getAttributes:getAttributesApi,
陈浩玮's avatar
陈浩玮 committed
73 74 75 76
    addAttributes: addAttributesApi,
    updateAttributes: updateAttributesApi,
    movementAttributes: movementAttributesApi,
    getEquipmentsTree: getEquipmentsTreeApi,
陈浩玮's avatar
陈浩玮 committed
77 78 79 80
    addEquipmentsTree: addEquipmentsTreeApi,
    updateEquipmentsTree: updateEquipmentsTreeApi,
    delEquipmentsTree: delEquipmentsTreeApi,
    getEquipmentsInfo: getEquipmentsInfoApi,
陈浩玮's avatar
陈浩玮 committed
81 82 83 84 85
    getEquipmentsAttributes:getEquipmentsAttributesApi,
    addEquipmentsAttributes:addEquipmentsAttributesApi,
    updateEquipmentsAttributes:updateEquipmentsAttributesApi,
    topEquipmentsAttributes:topEquipmentsAttributesApi,
    bottomEquipmentsAttributes:bottomEquipmentsAttributesApi,
陈浩玮's avatar
设备  
陈浩玮 committed
86
};