From c17ac0f57907c49652b0a613350c7d5437a6de83 Mon Sep 17 00:00:00 2001 From: Martin Araneda Date: Wed, 1 Feb 2023 23:51:02 -0300 Subject: [PATCH] basic crud layout in progress --- frontend/src/assets/badges.scss | 81 +++++++++ frontend/src/layout/AppMenu.vue | 3 +- frontend/src/main.js | 22 +++ frontend/src/router/index.js | 12 +- frontend/src/views/{menu => }/Chart.vue | 2 +- frontend/src/views/Crud.vue | 225 ++++++++++++++++++++++++ 6 files changed, 341 insertions(+), 4 deletions(-) create mode 100644 frontend/src/assets/badges.scss rename frontend/src/views/{menu => }/Chart.vue (98%) create mode 100644 frontend/src/views/Crud.vue diff --git a/frontend/src/assets/badges.scss b/frontend/src/assets/badges.scss new file mode 100644 index 0000000..77355a0 --- /dev/null +++ b/frontend/src/assets/badges.scss @@ -0,0 +1,81 @@ +.customer-badge, +.product-badge, +.order-badge { + border-radius: var(--border-radius); + padding: .25em .5rem; + text-transform: uppercase; + font-weight: 700; + font-size: 12px; + letter-spacing: .3px; +} + +.product-badge { + &.status-instock { + background: #C8E6C9; + color: #256029; + } + + &.status-outofstock { + background: #FFCDD2; + color: #C63737; + } + + &.status-lowstock { + background: #FEEDAF; + color: #8A5340; + } +} + +.customer-badge { + &.status-qualified { + background: #C8E6C9; + color: #256029; + } + + &.status-unqualified { + background: #FFCDD2; + color: #C63737; + } + + &.status-negotiation { + background: #FEEDAF; + color: #8A5340; + } + + &.status-new { + background: #B3E5FC; + color: #23547B; + } + + &.status-renewal { + background: #ECCFFF; + color: #694382; + } + + &.status-proposal { + background: #FFD8B2; + color: #805B36; + } +} + +.order-badge { + &.order-delivered { + background: #C8E6C9; + color: #256029; + } + + &.order-cancelled { + background: #FFCDD2; + color: #C63737; + } + + &.order-pending { + background: #FEEDAF; + color: #8A5340; + } + + &.order-returned { + background: #ECCFFF; + color: #694382; + } +} diff --git a/frontend/src/layout/AppMenu.vue b/frontend/src/layout/AppMenu.vue index 5714a40..61b2eb3 100644 --- a/frontend/src/layout/AppMenu.vue +++ b/frontend/src/layout/AppMenu.vue @@ -8,7 +8,8 @@ const model = ref([ label: 'Home', items: [ { label: 'Dashboard', icon: 'pi pi-fw pi-home', to: '/home' }, - { label: 'Chart', icon: 'pi pi-fw pi-chart-bar', to: '/charts' }] + { label: 'Chart', icon: 'pi pi-fw pi-chart-bar', to: '/charts' }, + { label: 'Crud', icon: 'pi pi-fw pi-pencil', to: '/crud' }] } ]); diff --git a/frontend/src/main.js b/frontend/src/main.js index d0521fd..580cdfa 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -12,14 +12,26 @@ import InputText from 'primevue/inputtext'; import Password from 'primevue/password'; import Ripple from 'primevue/ripple'; import StyleClass from 'primevue/styleclass'; +import Toast from 'primevue/toast'; +import ToastService from 'primevue/toastservice'; +import Toolbar from 'primevue/toolbar'; +import Column from 'primevue/column'; +import DataTable from 'primevue/datatable'; +import Textarea from 'primevue/textarea'; +import RadioButton from 'primevue/radiobutton'; +import InputNumber from 'primevue/inputnumber'; +import Dialog from 'primevue/dialog'; + import '@/assets/styles.scss'; + const app = createApp(App); app.use(createPinia()); app.use(router); app.use(PrimeVue, { ripple: true }); +app.use(ToastService); app.directive('ripple', Ripple); app.directive('styleclass', StyleClass); @@ -29,6 +41,16 @@ app.component('Chart', Chart); app.component('Dropdown', Dropdown); app.component('InputText', InputText); app.component('Password', Password); +app.component('Toast', Toast); +app.component('Column', Column); +app.component('Toolbar', Toolbar); +app.component('DataTable', DataTable); +app.component('Textarea', Textarea); +app.component('RadioButton', RadioButton); +app.component('InputNumber', InputNumber); +app.component('Dialog', Dialog); + + app.mount('#app'); diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 6829a40..c5c40f9 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -3,7 +3,8 @@ import AppLayout from '@/layout/AppLayout.vue'; import HomeView from '../views/HomeView.vue'; import Landing from '../views/Landing.vue'; import Login from '../views/Login.vue'; -import Chart from '@/views/menu/Chart.vue'; +import Chart from '@/views/Chart.vue'; +import Crud from '@/views/Crud.vue'; const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -29,7 +30,14 @@ const router = createRouter({ path: '/charts', name: 'charts', component: Chart - }/* , + }, + { + path: '/crud', + name: 'crud', + component: Crud + } + + /* , { path: '/about', name: 'about', diff --git a/frontend/src/views/menu/Chart.vue b/frontend/src/views/Chart.vue similarity index 98% rename from frontend/src/views/menu/Chart.vue rename to frontend/src/views/Chart.vue index dc6edc1..8783896 100644 --- a/frontend/src/views/menu/Chart.vue +++ b/frontend/src/views/Chart.vue @@ -1,7 +1,7 @@ + +