From 25034216a69ba73360982762065e4a12788eace8 Mon Sep 17 00:00:00 2001 From: Jonathan Chevalier Date: Wed, 18 Jan 2023 13:42:50 +0100 Subject: [PATCH] #init --- src/App.vue | 38 +- src/components/Search.vue | 6 +- src/router/index.js | 7 +- src/stores/shipment.js | 44 +- src/style.css | 10 +- src/views/index.vue | 226 +- src/views/login.vue | 10853 +++++++++++++++++++++++++++++++++++- 7 files changed, 11056 insertions(+), 128 deletions(-) diff --git a/src/App.vue b/src/App.vue index 0611fba..083a663 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,33 +4,25 @@ import Header from "./components/TemplateParts/Header.vue"; - diff --git a/src/components/Search.vue b/src/components/Search.vue index 8a27391..fa078c9 100644 --- a/src/components/Search.vue +++ b/src/components/Search.vue @@ -1,7 +1,6 @@ @@ -30,8 +29,9 @@ export default { const apiResult = await ShipmentApi.getDeliveriesByOrder(this.query) - this.shipmentStore.setOrderNumber(this.query) + this.shipmentStore.setIdOrder(this.query) this.shipmentStore.setDeliveryLines(apiResult.data) + this.query = null }, } } diff --git a/src/router/index.js b/src/router/index.js index 7583f8a..06f55b9 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,8 +8,13 @@ const routes = [ name: 'home', component: () => import('/src/views/index.vue'), meta: { transition: 'slide-right' }, + }, + { + path: '/login', + name: 'login', + component: () => import('/src/views/login.vue'), + meta: { transition: 'slide-right' }, } - ] const router = createRouter({ history: createWebHistory('/vue-admin'), diff --git a/src/stores/shipment.js b/src/stores/shipment.js index abcd7fe..c5bedf4 100644 --- a/src/stores/shipment.js +++ b/src/stores/shipment.js @@ -1,39 +1,8 @@ import {defineStore} from 'pinia' - -const shipmentStatus = [ - { - code: "30", - label: 'Colisage', - allowStatus: [3, 80, 39, 37] - - }, - { - code: "3", - label: 'A livrer', - allowStatus: [] - }, - { - code: "31", - label: 'A livrer Dépôt', - allowStatus: [3, 80, 39, 37] - }, - { - code: "80", - label: 'Manquant à rembourser', - allowStatus: [] - }, - { - code: "39", - label: 'Produit en commande', - allowStatus: [30, 3, 80, 39, 37] - }, -] - - export const useShipmentStore = defineStore('shipment', { state: () => ({ - orderNumber: '', + idOrder: null, deliveryLines: [] }), getters: { @@ -41,14 +10,13 @@ export const useShipmentStore = defineStore('shipment', { }, actions: { setDeliveryLines(lines) { - // for (const line of lines) { - // let labelFinder = shipmentStatus.filter(status => status.code === line.status) - // line.labelStatus = (labelFinder.length > 0) ? labelFinder.code : 'Unknown' - // } + for (const line of lines) { + line.scan = false + } this.deliveryLines = lines }, - setOrderNumber(orderNumber) { - this.orderNumber = orderNumber + setIdOrder(idOrder) { + this.idOrder = idOrder }, }, }) diff --git a/src/style.css b/src/style.css index f43f35a..1f7c134 100644 --- a/src/style.css +++ b/src/style.css @@ -442,7 +442,7 @@ h6 { width: 100%; } -.header .search-form input { +.search-form input { border: 0; font-size: 14px; color: #012970; @@ -453,21 +453,21 @@ h6 { width: 100%; } -.header .search-form input:focus, -.header .search-form input:hover { +.search-form input:focus, +.search-form input:hover { outline: none; box-shadow: 0 0 10px 0 rgba(1, 41, 112, 0.15); border: 1px solid rgba(1, 41, 112, 0.3); } -.header .search-form button { +.search-form button { border: 0; padding: 0; margin-left: -30px; background: none; } -.header .search-form button i { +.search-form button i { color: #012970; } diff --git a/src/views/index.vue b/src/views/index.vue index 63613ef..e12ffe9 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,47 +1,80 @@ diff --git a/src/views/login.vue b/src/views/login.vue index e31274f..9a25112 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -1,13 +1,10860 @@ -