oceanus.js 1.22 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 26 27
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) {
    return getReq(`/oceanus/api/v1/equipments/catalogs/${data.catalogId}`, data);
}
陈浩玮's avatar
设备  
陈浩玮 committed
28 29 30 31

export default {
    getOceanusTree: getOceanusTreeApi,
    addOceanusTree: addOceanusTreeApi,
陈浩玮's avatar
陈浩玮 committed
32 33 34 35 36 37
    updateOceanusTree: updateOceanusTreeApi,
    delOceanusTree: delOceanusTreeApi,
    addAttributes: addAttributesApi,
    updateAttributes: updateAttributesApi,
    movementAttributes: movementAttributesApi,
    getEquipmentsTree: getEquipmentsTreeApi,
陈浩玮's avatar
设备  
陈浩玮 committed
38
};