diff --git a/src/api/liftingPeriod.js b/src/api/liftingPeriod.js new file mode 100644 index 00000000..fc01ef4a --- /dev/null +++ b/src/api/liftingPeriod.js @@ -0,0 +1,31 @@ +import axios from 'axios' + +const LiftingPeriodEndpointUrl = 'https://metadata.service.development.therig.onlinefuelslabs.io' + +export function fetchList(query) { + return axios.get(`${LiftingPeriodEndpointUrl}/lifting-periods`, { params: query }) +} + +export function fetchLiftingPeriod(id) { + return axios.get(`${LiftingPeriodEndpointUrl}/lifting-periods/${id}?platform=OLFDE`) +} + +export function createLiftingPeriod(data) { + const dto = { + 'name': data.name, + 'days': Number(data.days), + 'platform': data.platform || 'OLFDE' + } + + return axios.post(`${LiftingPeriodEndpointUrl}/lifting-periods`, dto) +} + +export function updateLiftingPeriod(data) { + const dto = { + 'name': data.name, + 'days': Number(data.days), + 'platform': data.platform || 'OLFDE' + } + + return axios.put(`${LiftingPeriodEndpointUrl}/lifting-periods/${data._id}`, dto) +} diff --git a/src/router/index.js b/src/router/index.js index 21231fdf..a0424b5f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -267,6 +267,37 @@ export const asyncRoutes = [ } ] }, + { + path: '/lifting-periods', + component: Layout, + redirect: '/lifting-periods/list', + name: 'LiftingPeriods', + meta: { + title: 'Lifting Periods', + icon: 'example' + }, + children: [ + { + path: 'create', + component: () => import('@/views/liftingperiods/create'), + name: 'CreateLiftingPeriod', + meta: { title: 'Create Lifting Period', icon: 'edit' } + }, + { + path: 'edit/:id', + component: () => import('@/views/liftingperiods/edit'), + name: 'EditLiftingPeriod', + meta: { title: 'Edit Lifting Period', noCache: true, activeMenu: '/liftingperiods/list' }, + hidden: true + }, + { + path: 'list', + component: () => import('@/views/liftingperiods/list'), + name: 'LiftingPeriodList', + meta: { title: 'Lifting Period List', icon: 'list' } + } + ] + }, { path: '/faqs', component: Layout, diff --git a/src/views/liftingperiods/components/LiftingPeriodDetail.vue b/src/views/liftingperiods/components/LiftingPeriodDetail.vue new file mode 100644 index 00000000..3de17761 --- /dev/null +++ b/src/views/liftingperiods/components/LiftingPeriodDetail.vue @@ -0,0 +1,210 @@ + + + + + diff --git a/src/views/liftingperiods/create.vue b/src/views/liftingperiods/create.vue new file mode 100644 index 00000000..f1992c2e --- /dev/null +++ b/src/views/liftingperiods/create.vue @@ -0,0 +1,13 @@ + + + + diff --git a/src/views/liftingperiods/edit.vue b/src/views/liftingperiods/edit.vue new file mode 100644 index 00000000..593fb345 --- /dev/null +++ b/src/views/liftingperiods/edit.vue @@ -0,0 +1,13 @@ + + + + diff --git a/src/views/liftingperiods/list.vue b/src/views/liftingperiods/list.vue new file mode 100644 index 00000000..d2394645 --- /dev/null +++ b/src/views/liftingperiods/list.vue @@ -0,0 +1,78 @@ + + + + +