oceanus.js 3.31 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

function getAttributesApi(data) {
陈浩玮's avatar
陈浩玮 committed
17
    return getReq('/oceanus/api/v1/categories/attributes', data);
陈浩玮's avatar
陈浩玮 committed
18 19
}

陈浩玮'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
function getEquipmentsAttributesApi(data) {
陈浩玮's avatar
陈浩玮 committed
48
    return getReq('/oceanus/api/v1/equipments/attributes', data);
陈浩玮's avatar
陈浩玮 committed
49 50 51
}

function addEquipmentsAttributesApi(data) {
陈浩玮's avatar
陈浩玮 committed
52
    return postReq('/oceanus/api/v1/equipments/attributes', data);
陈浩玮's avatar
陈浩玮 committed
53 54 55
}

function updateEquipmentsAttributesApi(data) {
陈浩玮's avatar
陈浩玮 committed
56
    return putReq('/oceanus/api/v1/equipments/attributes', data);
陈浩玮's avatar
陈浩玮 committed
57 58
}
function topEquipmentsAttributesApi(data) {
陈浩玮's avatar
陈浩玮 committed
59
    return putReq(`/oceanus/api/v1/equipments/attributes/top/${data.instanceId}`, {});
陈浩玮's avatar
陈浩玮 committed
60 61
}
function bottomEquipmentsAttributesApi(data) {
陈浩玮's avatar
陈浩玮 committed
62 63 64 65 66 67 68 69 70 71
    return putReq(`/oceanus/api/v1/equipments/attributes/bottom/${data.instanceId}`, {});
}
function getEquipmentsEventsApi(data) {
    return getReq('/oceanus/api/v1/equipments/events', data);
}
function addEquipmentsEventsApi(data) {
    return postReq('/oceanus/api/v1/equipments/events', data);
}
function updateEquipmentsEventsApi(data) {
    return putReq('/oceanus/api/v1/equipments/events', data);
陈浩玮's avatar
陈浩玮 committed
72
}
陈浩玮's avatar
设备  
陈浩玮 committed
73 74 75 76

export default {
    getOceanusTree: getOceanusTreeApi,
    addOceanusTree: addOceanusTreeApi,
陈浩玮's avatar
陈浩玮 committed
77 78
    updateOceanusTree: updateOceanusTreeApi,
    delOceanusTree: delOceanusTreeApi,
陈浩玮's avatar
陈浩玮 committed
79
    getAttributes: getAttributesApi,
陈浩玮's avatar
陈浩玮 committed
80 81 82 83
    addAttributes: addAttributesApi,
    updateAttributes: updateAttributesApi,
    movementAttributes: movementAttributesApi,
    getEquipmentsTree: getEquipmentsTreeApi,
陈浩玮's avatar
陈浩玮 committed
84 85 86 87
    addEquipmentsTree: addEquipmentsTreeApi,
    updateEquipmentsTree: updateEquipmentsTreeApi,
    delEquipmentsTree: delEquipmentsTreeApi,
    getEquipmentsInfo: getEquipmentsInfoApi,
陈浩玮's avatar
陈浩玮 committed
88 89 90 91 92 93 94 95
    getEquipmentsAttributes: getEquipmentsAttributesApi,
    addEquipmentsAttributes: addEquipmentsAttributesApi,
    updateEquipmentsAttributes: updateEquipmentsAttributesApi,
    topEquipmentsAttributes: topEquipmentsAttributesApi,
    bottomEquipmentsAttributes: bottomEquipmentsAttributesApi,
    getEquipmentsEvents: getEquipmentsEventsApi,
    addEquipmentsEvents: addEquipmentsEventsApi,
    updateEquipmentsEvents: updateEquipmentsEventsApi,
陈浩玮's avatar
设备  
陈浩玮 committed
96
};