oceanus.js 1.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 13 14 15 16 17 18 19 20 21 22 23 24 25
function updateOceanusTreeApi(data) {
    return putReq('/oceanus/api/v1/categories', data);
}
function delOceanusTreeApi(data) {
    return putReq(`/oceanus/api/v1/categories/${data.categoryId}`, data);
}
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
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
    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
41
}
陈浩玮's avatar
设备  
陈浩玮 committed
42 43 44 45

export default {
    getOceanusTree: getOceanusTreeApi,
    addOceanusTree: addOceanusTreeApi,
陈浩玮's avatar
陈浩玮 committed
46 47 48 49 50 51
    updateOceanusTree: updateOceanusTreeApi,
    delOceanusTree: delOceanusTreeApi,
    addAttributes: addAttributesApi,
    updateAttributes: updateAttributesApi,
    movementAttributes: movementAttributesApi,
    getEquipmentsTree: getEquipmentsTreeApi,
陈浩玮's avatar
陈浩玮 committed
52 53 54 55
    addEquipmentsTree: addEquipmentsTreeApi,
    updateEquipmentsTree: updateEquipmentsTreeApi,
    delEquipmentsTree: delEquipmentsTreeApi,
    getEquipmentsInfo: getEquipmentsInfoApi,
陈浩玮's avatar
设备  
陈浩玮 committed
56
};